@arbocollab/arbo-plugin-item-table 0.1.136 → 0.1.137

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.
@@ -196,7 +196,7 @@ ${c}`:l)}else throw i},onCacheKey:i=>Xee(t,n,i)}}function Ane(e){if(yt(e))return
196
196
  * Released under the MIT License.
197
197
  */const Gne="9.14.5";function Une(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(sa().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(sa().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(sa().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(sa().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(sa().__INTLIFY_PROD_DEVTOOLS__=!1)}const HM=no.__EXTEND_POINT__,ra=gv(HM),Gn={FALLBACK_TO_ROOT:HM,NOT_SUPPORTED_PRESERVE:ra(),NOT_SUPPORTED_FORMATTER:ra(),NOT_SUPPORTED_PRESERVE_DIRECTIVE:ra(),NOT_SUPPORTED_GET_CHOICE_INDEX:ra(),COMPONENT_NAME_LEGACY_COMPATIBLE:ra(),NOT_FOUND_PARENT_SCOPE:ra(),IGNORE_OBJ_FLATTEN:ra(),NOTICE_DROP_ALLOW_COMPOSITION:ra(),NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG:ra()},Wne={[Gn.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[Gn.NOT_SUPPORTED_PRESERVE]:"Not supported 'preserve'.",[Gn.NOT_SUPPORTED_FORMATTER]:"Not supported 'formatter'.",[Gn.NOT_SUPPORTED_PRESERVE_DIRECTIVE]:"Not supported 'preserveDirectiveContent'.",[Gn.NOT_SUPPORTED_GET_CHOICE_INDEX]:"Not supported 'getChoiceIndex'.",[Gn.COMPONENT_NAME_LEGACY_COMPATIBLE]:"Component name legacy compatible: '{name}' -> 'i18n'",[Gn.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[Gn.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[Gn.NOTICE_DROP_ALLOW_COMPOSITION]:"'allowComposition' option will be dropped in the next major version. For more information, please see 👉 https://tinyurl.com/2p97mcze",[Gn.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG]:"'translateExistCompatible' option will be dropped in the next major version."};function go(e,...t){return US(Wne[e],...t)}const GM=Rs.__EXTEND_POINT__,mo=gv(GM),dn={UNEXPECTED_RETURN_TYPE:GM,INVALID_ARGUMENT:mo(),MUST_BE_CALL_SETUP_TOP:mo(),NOT_INSTALLED:mo(),NOT_AVAILABLE_IN_LEGACY_MODE:mo(),REQUIRED_VALUE:mo(),INVALID_VALUE:mo(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:mo(),NOT_INSTALLED_WITH_PROVIDE:mo(),UNEXPECTED_ERROR:mo(),NOT_COMPATIBLE_LEGACY_VUE_I18N:mo(),BRIDGE_SUPPORT_VUE_2_ONLY:mo(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:mo(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:mo(),__EXTEND_POINT__:mo()};function Ss(e,...t){return Xu(e,null,X.env.NODE_ENV!=="production"?{messages:zne,args:t}:void 0)}const zne={[dn.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[dn.INVALID_ARGUMENT]:"Invalid argument",[dn.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[dn.NOT_INSTALLED]:"Need to install with `app.use` function",[dn.UNEXPECTED_ERROR]:"Unexpected error",[dn.NOT_AVAILABLE_IN_LEGACY_MODE]:"Not available in legacy mode",[dn.REQUIRED_VALUE]:"Required in value: {0}",[dn.INVALID_VALUE]:"Invalid value",[dn.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[dn.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[dn.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[dn.BRIDGE_SUPPORT_VUE_2_ONLY]:"vue-i18n-bridge support Vue 2.x only",[dn.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION]:"Must define ‘i18n’ option or custom block in Composition API with using local scope in Legacy API mode",[dn.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},sE=pi("__translateVNode"),oE=pi("__datetimeParts"),rE=pi("__numberParts"),hc=pi("__enableEmitter"),Ff=pi("__disableEmitter"),UM=pi("__setPluralRules"),WM=pi("__injectWithOption"),iE=pi("__dispose");function Pf(e){if(!an(e)||ir(e))return e;for(const t in e)if(Nr(e,t))if(!t.includes("."))an(e[t])&&Pf(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,r=!1;for(let i=0;i<s;i++){if(n[i]==="__proto__")throw new Error(`unsafe key: ${n[i]}`);if(n[i]in o||(o[n[i]]=Rn()),!an(o[n[i]])){X.env.NODE_ENV!=="production"&&fs(go(Gn.IGNORE_OBJ_FLATTEN,{key:n[i]})),r=!0;break}o=o[n[i]]}if(r||(ir(o)?oM.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!ir(o)){const i=o[n[s]];an(i)&&Pf(i)}}return e}function _v(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:r}=t,i=Gt(n)?n:An(s)?Rn():{[e]:Rn()};if(An(s)&&s.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:l,resource:c}=a;l?(i[l]=i[l]||Rn(),vv(c,i[l])):vv(c,i)}else yt(a)&&vv(JSON.parse(a),i)}),o==null&&r)for(const a in i)Nr(i,a)&&Pf(i[a]);return i}function zM(e){return e.type}function jM(e,t,n){let s=an(t.messages)?t.messages:Rn();"__i18nGlobal"in n&&(s=_v(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(r=>{e.mergeLocaleMessage(r,s[r])});{if(an(t.datetimeFormats)){const r=Object.keys(t.datetimeFormats);r.length&&r.forEach(i=>{e.mergeDateTimeFormat(i,t.datetimeFormats[i])})}if(an(t.numberFormats)){const r=Object.keys(t.numberFormats);r.length&&r.forEach(i=>{e.mergeNumberFormat(i,t.numberFormats[i])})}}}function KM(e){return he(Ta,null,e,0)}const qM="__INTLIFY_META__",YM=()=>[],jne=()=>!1;let XM=0;function ZM(e){return(t,n,s,o)=>e(n,s,ts()||void 0,o)}const Kne=()=>{const e=ts();let t=null;return e&&(t=zM(e)[qM])?{[qM]:t}:null};function aE(e={},t){const{__root:n,__injectWithOption:s}=e,o=n===void 0,r=e.flatJson,i=Mr?B:Up,a=!!e.translateExistCompatible;X.env.NODE_ENV!=="production"&&a&&NO(go(Gn.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG));let l=tn(e.inheritLocale)?e.inheritLocale:!0;const c=i(n&&l?n.locale.value:yt(e.locale)?e.locale:Qu),u=i(n&&l?n.fallbackLocale.value:yt(e.fallbackLocale)||An(e.fallbackLocale)||Gt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:c.value),d=i(_v(c.value,e)),h=i(Gt(e.datetimeFormats)?e.datetimeFormats:{[c.value]:{}}),f=i(Gt(e.numberFormats)?e.numberFormats:{[c.value]:{}});let p=n?n.missingWarn:tn(e.missingWarn)||Xa(e.missingWarn)?e.missingWarn:!0,g=n?n.fallbackWarn:tn(e.fallbackWarn)||Xa(e.fallbackWarn)?e.fallbackWarn:!0,v=n?n.fallbackRoot:tn(e.fallbackRoot)?e.fallbackRoot:!0,C=!!e.fallbackFormat,S=Dn(e.missing)?e.missing:null,b=Dn(e.missing)?ZM(e.missing):null,w=Dn(e.postTranslation)?e.postTranslation:null,D=n?n.warnHtmlMessage:tn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,R=!!e.escapeParameter;const T=n?n.modifiers:Gt(e.modifiers)?e.modifiers:{};let F=e.pluralRules||n&&n.pluralRules,x;x=(()=>{o&&wM(null);const _e={version:Gne,locale:c.value,fallbackLocale:u.value,messages:d.value,modifiers:T,pluralRules:F,missing:b===null?void 0:b,missingWarn:p,fallbackWarn:g,fallbackFormat:C,unresolving:!0,postTranslation:w===null?void 0:w,warnHtmlMessage:D,escapeParameter:R,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};_e.datetimeFormats=h.value,_e.numberFormats=f.value,_e.__datetimeFormatters=Gt(x)?x.__datetimeFormatters:void 0,_e.__numberFormatters=Gt(x)?x.__numberFormatters:void 0,X.env.NODE_ENV!=="production"&&(_e.__v_emitter=Gt(x)?x.__v_emitter:void 0);const Ve=Ene(_e);return o&&wM(Ve),Ve})(),xf(x,c.value,u.value);function E(){return[c.value,u.value,d.value,h.value,f.value]}const k=Y({get:()=>c.value,set:_e=>{c.value=_e,x.locale=c.value}}),I=Y({get:()=>u.value,set:_e=>{u.value=_e,x.fallbackLocale=u.value,xf(x,c.value,_e)}}),M=Y(()=>d.value),O=Y(()=>h.value),$=Y(()=>f.value);function Z(){return Dn(w)?w:null}function Q(_e){w=_e,x.postTranslation=_e}function se(){return S}function ae(_e){_e!==null&&(b=ZM(_e)),S=_e,x.missing=b}function ee(_e,Ve){return _e!=="translate"||!Ve.resolvedMessage}const V=(_e,Ve,gt,kt,Ut,en)=>{E();let zt;try{X.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,o||(x.fallbackContext=n?Sne():void 0),zt=_e(x)}finally{X.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,o||(x.fallbackContext=void 0)}if(gt!=="translate exists"&&os(zt)&&zt===bv||gt==="translate exists"&&!zt){const[Ne,qe]=Ve();if(X.env.NODE_ENV!=="production"&&n&&yt(Ne)&&ee(gt,qe)&&(v&&(Ev(g,Ne)||bM(p,Ne))&&fs(go(Gn.FALLBACK_TO_ROOT,{key:Ne,type:gt})),X.env.NODE_ENV!=="production")){const{__v_emitter:wt}=x;wt&&v&&wt.emit("fallback",{type:gt,key:Ne,to:"global",groupId:`${gt}:${Ne}`})}return n&&v?kt(n):Ut(Ne)}else{if(en(zt))return zt;throw Ss(dn.UNEXPECTED_RETURN_TYPE)}};function W(..._e){return V(Ve=>Reflect.apply(xM,null,[Ve,..._e]),()=>QS(..._e),"translate",Ve=>Reflect.apply(Ve.t,Ve,[..._e]),Ve=>Ve,Ve=>yt(Ve))}function te(..._e){const[Ve,gt,kt]=_e;if(kt&&!an(kt))throw Ss(dn.INVALID_ARGUMENT);return W(Ve,gt,As({resolvedMessage:!0},kt||{}))}function pe(..._e){return V(Ve=>Reflect.apply(OM,null,[Ve,..._e]),()=>eE(..._e),"datetime format",Ve=>Reflect.apply(Ve.d,Ve,[..._e]),()=>Sv,Ve=>yt(Ve))}function ve(..._e){return V(Ve=>Reflect.apply(LM,null,[Ve,..._e]),()=>tE(..._e),"number format",Ve=>Reflect.apply(Ve.n,Ve,[..._e]),()=>Sv,Ve=>yt(Ve))}function re(_e){return _e.map(Ve=>yt(Ve)||os(Ve)||tn(Ve)?KM(String(Ve)):Ve)}const j={normalize:re,interpolate:_e=>_e,type:"vnode"};function me(..._e){return V(Ve=>{let gt;const kt=Ve;try{kt.processor=j,gt=Reflect.apply(xM,null,[kt,..._e])}finally{kt.processor=null}return gt},()=>QS(..._e),"translate",Ve=>Ve[sE](..._e),Ve=>[KM(Ve)],Ve=>An(Ve))}function oe(..._e){return V(Ve=>Reflect.apply(LM,null,[Ve,..._e]),()=>tE(..._e),"number format",Ve=>Ve[rE](..._e),YM,Ve=>yt(Ve)||An(Ve))}function Se(..._e){return V(Ve=>Reflect.apply(OM,null,[Ve,..._e]),()=>eE(..._e),"datetime format",Ve=>Ve[oE](..._e),YM,Ve=>yt(Ve)||An(Ve))}function U(_e){F=_e,x.pluralRules=F}function K(_e,Ve){return V(()=>{if(!_e)return!1;const gt=yt(Ve)?Ve:c.value,kt=Fe(gt),Ut=x.messageResolver(kt,_e);return a?Ut!=null:ir(Ut)||ar(Ut)||yt(Ut)},()=>[_e],"translate exists",gt=>Reflect.apply(gt.te,gt,[_e,Ve]),jne,gt=>tn(gt))}function ue(_e){let Ve=null;const gt=uM(x,u.value,c.value);for(let kt=0;kt<gt.length;kt++){const Ut=d.value[gt[kt]]||{},en=x.messageResolver(Ut,_e);if(en!=null){Ve=en;break}}return Ve}function Ae(_e){const Ve=ue(_e);return Ve??(n?n.tm(_e)||{}:{})}function Fe(_e){return d.value[_e]||{}}function Le(_e,Ve){if(r){const gt={[_e]:Ve};for(const kt in gt)Nr(gt,kt)&&Pf(gt[kt]);Ve=gt[_e]}d.value[_e]=Ve,x.messages=d.value}function ye(_e,Ve){d.value[_e]=d.value[_e]||{};const gt={[_e]:Ve};if(r)for(const kt in gt)Nr(gt,kt)&&Pf(gt[kt]);Ve=gt[_e],vv(Ve,d.value[_e]),x.messages=d.value}function N(_e){return h.value[_e]||{}}function H(_e,Ve){h.value[_e]=Ve,x.datetimeFormats=h.value,NM(x,_e,Ve)}function ce(_e,Ve){h.value[_e]=As(h.value[_e]||{},Ve),x.datetimeFormats=h.value,NM(x,_e,Ve)}function Ge(_e){return f.value[_e]||{}}function Ce(_e,Ve){f.value[_e]=Ve,x.numberFormats=f.value,BM(x,_e,Ve)}function ze(_e,Ve){f.value[_e]=As(f.value[_e]||{},Ve),x.numberFormats=f.value,BM(x,_e,Ve)}XM++,n&&Mr&&(et(n.locale,_e=>{l&&(c.value=_e,x.locale=_e,xf(x,c.value,u.value))}),et(n.fallbackLocale,_e=>{l&&(u.value=_e,x.fallbackLocale=_e,xf(x,c.value,u.value))}));const Ue={id:XM,locale:k,fallbackLocale:I,get inheritLocale(){return l},set inheritLocale(_e){l=_e,_e&&n&&(c.value=n.locale.value,u.value=n.fallbackLocale.value,xf(x,c.value,u.value))},get availableLocales(){return Object.keys(d.value).sort()},messages:M,get modifiers(){return T},get pluralRules(){return F||{}},get isGlobal(){return o},get missingWarn(){return p},set missingWarn(_e){p=_e,x.missingWarn=p},get fallbackWarn(){return g},set fallbackWarn(_e){g=_e,x.fallbackWarn=g},get fallbackRoot(){return v},set fallbackRoot(_e){v=_e},get fallbackFormat(){return C},set fallbackFormat(_e){C=_e,x.fallbackFormat=C},get warnHtmlMessage(){return D},set warnHtmlMessage(_e){D=_e,x.warnHtmlMessage=_e},get escapeParameter(){return R},set escapeParameter(_e){R=_e,x.escapeParameter=_e},t:W,getLocaleMessage:Fe,setLocaleMessage:Le,mergeLocaleMessage:ye,getPostTranslationHandler:Z,setPostTranslationHandler:Q,getMissingHandler:se,setMissingHandler:ae,[UM]:U};return Ue.datetimeFormats=O,Ue.numberFormats=$,Ue.rt=te,Ue.te=K,Ue.tm=Ae,Ue.d=pe,Ue.n=ve,Ue.getDateTimeFormat=N,Ue.setDateTimeFormat=H,Ue.mergeDateTimeFormat=ce,Ue.getNumberFormat=Ge,Ue.setNumberFormat=Ce,Ue.mergeNumberFormat=ze,Ue[WM]=s,Ue[sE]=me,Ue[oE]=Se,Ue[rE]=oe,X.env.NODE_ENV!=="production"&&(Ue[hc]=_e=>{x.__v_emitter=_e},Ue[Ff]=()=>{x.__v_emitter=void 0}),Ue}function qne(e){const t=yt(e.locale)?e.locale:Qu,n=yt(e.fallbackLocale)||An(e.fallbackLocale)||Gt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=Dn(e.missing)?e.missing:void 0,o=tn(e.silentTranslationWarn)||Xa(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,r=tn(e.silentFallbackWarn)||Xa(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,i=tn(e.fallbackRoot)?e.fallbackRoot:!0,a=!!e.formatFallbackMessages,l=Gt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Dn(e.postTranslation)?e.postTranslation:void 0,d=yt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,h=!!e.escapeParameterHtml,f=tn(e.sync)?e.sync:!0;X.env.NODE_ENV!=="production"&&e.formatter&&fs(go(Gn.NOT_SUPPORTED_FORMATTER)),X.env.NODE_ENV!=="production"&&e.preserveDirectiveContent&&fs(go(Gn.NOT_SUPPORTED_PRESERVE_DIRECTIVE));let p=e.messages;if(Gt(e.sharedMessages)){const R=e.sharedMessages;p=Object.keys(R).reduce((F,x)=>{const P=F[x]||(F[x]={});return As(P,R[x]),F},p||{})}const{__i18n:g,__root:v,__injectWithOption:C}=e,S=e.datetimeFormats,b=e.numberFormats,w=e.flatJson,D=e.translateExistCompatible;return{locale:t,fallbackLocale:n,messages:p,flatJson:w,datetimeFormats:S,numberFormats:b,missing:s,missingWarn:o,fallbackWarn:r,fallbackRoot:i,fallbackFormat:a,modifiers:l,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:h,messageResolver:e.messageResolver,inheritLocale:f,translateExistCompatible:D,__i18n:g,__root:v,__injectWithOption:C}}function lE(e={},t){{const n=aE(qne(e)),{__extender:s}=e,o={id:n.id,get locale(){return n.locale.value},set locale(r){n.locale.value=r},get fallbackLocale(){return n.fallbackLocale.value},set fallbackLocale(r){n.fallbackLocale.value=r},get messages(){return n.messages.value},get datetimeFormats(){return n.datetimeFormats.value},get numberFormats(){return n.numberFormats.value},get availableLocales(){return n.availableLocales},get formatter(){return X.env.NODE_ENV!=="production"&&fs(go(Gn.NOT_SUPPORTED_FORMATTER)),{interpolate(){return[]}}},set formatter(r){X.env.NODE_ENV!=="production"&&fs(go(Gn.NOT_SUPPORTED_FORMATTER))},get missing(){return n.getMissingHandler()},set missing(r){n.setMissingHandler(r)},get silentTranslationWarn(){return tn(n.missingWarn)?!n.missingWarn:n.missingWarn},set silentTranslationWarn(r){n.missingWarn=tn(r)?!r:r},get silentFallbackWarn(){return tn(n.fallbackWarn)?!n.fallbackWarn:n.fallbackWarn},set silentFallbackWarn(r){n.fallbackWarn=tn(r)?!r:r},get modifiers(){return n.modifiers},get formatFallbackMessages(){return n.fallbackFormat},set formatFallbackMessages(r){n.fallbackFormat=r},get postTranslation(){return n.getPostTranslationHandler()},set postTranslation(r){n.setPostTranslationHandler(r)},get sync(){return n.inheritLocale},set sync(r){n.inheritLocale=r},get warnHtmlInMessage(){return n.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(r){n.warnHtmlMessage=r!=="off"},get escapeParameterHtml(){return n.escapeParameter},set escapeParameterHtml(r){n.escapeParameter=r},get preserveDirectiveContent(){return X.env.NODE_ENV!=="production"&&fs(go(Gn.NOT_SUPPORTED_PRESERVE_DIRECTIVE)),!0},set preserveDirectiveContent(r){X.env.NODE_ENV!=="production"&&fs(go(Gn.NOT_SUPPORTED_PRESERVE_DIRECTIVE))},get pluralizationRules(){return n.pluralRules||{}},__composer:n,t(...r){const[i,a,l]=r,c={};let u=null,d=null;if(!yt(i))throw Ss(dn.INVALID_ARGUMENT);const h=i;return yt(a)?c.locale=a:An(a)?u=a:Gt(a)&&(d=a),An(l)?u=l:Gt(l)&&(d=l),Reflect.apply(n.t,n,[h,u||d||{},c])},rt(...r){return Reflect.apply(n.rt,n,[...r])},tc(...r){const[i,a,l]=r,c={plural:1};let u=null,d=null;if(!yt(i))throw Ss(dn.INVALID_ARGUMENT);const h=i;return yt(a)?c.locale=a:os(a)?c.plural=a:An(a)?u=a:Gt(a)&&(d=a),yt(l)?c.locale=l:An(l)?u=l:Gt(l)&&(d=l),Reflect.apply(n.t,n,[h,u||d||{},c])},te(r,i){return n.te(r,i)},tm(r){return n.tm(r)},getLocaleMessage(r){return n.getLocaleMessage(r)},setLocaleMessage(r,i){n.setLocaleMessage(r,i)},mergeLocaleMessage(r,i){n.mergeLocaleMessage(r,i)},d(...r){return Reflect.apply(n.d,n,[...r])},getDateTimeFormat(r){return n.getDateTimeFormat(r)},setDateTimeFormat(r,i){n.setDateTimeFormat(r,i)},mergeDateTimeFormat(r,i){n.mergeDateTimeFormat(r,i)},n(...r){return Reflect.apply(n.n,n,[...r])},getNumberFormat(r){return n.getNumberFormat(r)},setNumberFormat(r,i){n.setNumberFormat(r,i)},mergeNumberFormat(r,i){n.mergeNumberFormat(r,i)},getChoiceIndex(r,i){return X.env.NODE_ENV!=="production"&&fs(go(Gn.NOT_SUPPORTED_GET_CHOICE_INDEX)),-1}};return o.__extender=s,X.env.NODE_ENV!=="production"&&(o.__enableEmitter=r=>{const i=n;i[hc]&&i[hc](r)},o.__disableEmitter=()=>{const r=n;r[Ff]&&r[Ff]()}),o}}const cE={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function Yne({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===xt?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},Rn())}function JM(e){return xt}const uE=ot({name:"i18n-t",props:As({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>os(e)||!isNaN(e)}},cE),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||pE({useScope:e.scope,__useComponent:!0});return()=>{const r=Object.keys(n).filter(d=>d!=="_"),i=Rn();e.locale&&(i.locale=e.locale),e.plural!==void 0&&(i.plural=yt(e.plural)?+e.plural:e.plural);const a=Yne(t,r),l=o[sE](e.keypath,a,i),c=As(Rn(),s),u=yt(e.tag)||an(e.tag)?e.tag:JM();return qc(u,c,l)}}});function Xne(e){return An(e)&&!yt(e[0])}function QM(e,t,n,s){const{slots:o,attrs:r}=t;return()=>{const i={part:!0};let a=Rn();e.locale&&(i.locale=e.locale),yt(e.format)?i.key=e.format:an(e.format)&&(yt(e.format.key)&&(i.key=e.format.key),a=Object.keys(e.format).reduce((h,f)=>n.includes(f)?As(Rn(),h,{[f]:e.format[f]}):h,Rn()));const l=s(e.value,i,a);let c=[i.key];An(l)?c=l.map((h,f)=>{const p=o[h.type],g=p?p({[h.type]:h.value,index:f,parts:l}):[h.value];return Xne(g)&&(g[0].key=`${h.type}-${f}`),g}):yt(l)&&(c=[l]);const u=As(Rn(),r),d=yt(e.tag)||an(e.tag)?e.tag:JM();return qc(d,u,c)}}const eN=ot({name:"i18n-n",props:As({value:{type:Number,required:!0},format:{type:[String,Object]}},cE),setup(e,t){const n=e.i18n||pE({useScope:e.scope,__useComponent:!0});return QM(e,t,VM,(...s)=>n[rE](...s))}}),tN=ot({name:"i18n-d",props:As({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},cE),setup(e,t){const n=e.i18n||pE({useScope:e.scope,__useComponent:!0});return QM(e,t,MM,(...s)=>n[oE](...s))}});function Zne(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function Jne(e){const t=i=>{const{instance:a,modifiers:l,value:c}=i;if(!a||!a.$)throw Ss(dn.UNEXPECTED_ERROR);const u=Zne(e,a.$);X.env.NODE_ENV!=="production"&&l.preserve&&fs(go(Gn.NOT_SUPPORTED_PRESERVE));const d=nN(c);return[Reflect.apply(u.t,u,[...sN(d)]),u]};return{created:(i,a)=>{const[l,c]=t(a);Mr&&e.global===c&&(i.__i18nWatcher=et(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),i.__composer=c,i.textContent=l},unmounted:i=>{Mr&&i.__i18nWatcher&&(i.__i18nWatcher(),i.__i18nWatcher=void 0,delete i.__i18nWatcher),i.__composer&&(i.__composer=void 0,delete i.__composer)},beforeUpdate:(i,{value:a})=>{if(i.__composer){const l=i.__composer,c=nN(a);i.textContent=Reflect.apply(l.t,l,[...sN(c)])}},getSSRProps:i=>{const[a]=t(i);return{textContent:a}}}}function nN(e){if(yt(e))return{path:e};if(Gt(e)){if(!("path"in e))throw Ss(dn.REQUIRED_VALUE,"path");return e}else throw Ss(dn.INVALID_VALUE)}function sN(e){const{path:t,locale:n,args:s,choice:o,plural:r}=e,i={},a=s||{};return yt(n)&&(i.locale=n),os(o)&&(i.plural=o),os(r)&&(i.plural=r),[t,a,i]}function Qne(e,t,...n){const s=Gt(n[0])?n[0]:{},o=!!s.useI18nComponentName,r=tn(s.globalInstall)?s.globalInstall:!0;X.env.NODE_ENV!=="production"&&r&&o&&fs(go(Gn.COMPONENT_NAME_LEGACY_COMPATIBLE,{name:uE.name})),r&&([o?"i18n":uE.name,"I18nT"].forEach(i=>e.component(i,uE)),[eN.name,"I18nN"].forEach(i=>e.component(i,eN)),[tN.name,"I18nD"].forEach(i=>e.component(i,tN))),e.directive("t",Jne(t))}const dE={"vue-devtools-plugin-vue-i18n":"Vue I18n devtools","vue-i18n-resource-inspector":"I18n Resources","vue-i18n-timeline":"Vue I18n"},ese={"vue-i18n-resource-inspector":"Search for scopes ..."},tse={"vue-i18n-timeline":16764185},oN="vue-i18n: composer properties";let hE;async function nse(e,t){return new Promise((n,s)=>{try{Hne({id:"vue-devtools-plugin-vue-i18n",label:dE["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[oN],app:e},o=>{hE=o,o.on.visitComponentTree(({componentInstance:i,treeNode:a})=>{sse(i,a,t)}),o.on.inspectComponent(({componentInstance:i,instanceData:a})=>{i.vnode.el&&i.vnode.el.__VUE_I18N__&&a&&(t.mode==="legacy"?i.vnode.el.__VUE_I18N__!==t.global.__composer&&iN(a,i.vnode.el.__VUE_I18N__):iN(a,i.vnode.el.__VUE_I18N__))}),o.addInspector({id:"vue-i18n-resource-inspector",label:dE["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:ese["vue-i18n-resource-inspector"]}),o.on.getInspectorTree(i=>{i.app===e&&i.inspectorId==="vue-i18n-resource-inspector"&&lse(i,t)});const r=new Map;o.on.getInspectorState(async i=>{if(i.app===e&&i.inspectorId==="vue-i18n-resource-inspector")if(o.unhighlightElement(),use(i,t),i.nodeId==="global"){if(!r.has(i.app)){const[a]=await o.getComponentInstances(i.app);r.set(i.app,a)}o.highlightElement(r.get(i.app))}else{const a=cse(i.nodeId,t);a&&o.highlightElement(a)}}),o.on.editInspectorState(i=>{i.app===e&&i.inspectorId==="vue-i18n-resource-inspector"&&hse(i,t)}),o.addTimelineLayer({id:"vue-i18n-timeline",label:dE["vue-i18n-timeline"],color:tse["vue-i18n-timeline"]}),n(!0)})}catch(o){console.error(o),s(!1)}})}function rN(e){return e.type.name||e.type.displayName||e.type.__file||"Anonymous"}function sse(e,t,n){const s=n.mode==="composition"?n.global:n.global.__composer;if(e&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&e.vnode.el.__VUE_I18N__!==s){const o={label:`i18n (${rN(e)} Scope)`,textColor:0,backgroundColor:16764185};t.tags.push(o)}}function iN(e,t){const n=oN;e.state.push({type:n,key:"locale",editable:!0,value:t.locale.value}),e.state.push({type:n,key:"availableLocales",editable:!1,value:t.availableLocales}),e.state.push({type:n,key:"fallbackLocale",editable:!0,value:t.fallbackLocale.value}),e.state.push({type:n,key:"inheritLocale",editable:!0,value:t.inheritLocale}),e.state.push({type:n,key:"messages",editable:!1,value:fE(t.messages.value)}),e.state.push({type:n,key:"datetimeFormats",editable:!1,value:t.datetimeFormats.value}),e.state.push({type:n,key:"numberFormats",editable:!1,value:t.numberFormats.value})}function fE(e){const t={};return Object.keys(e).forEach(n=>{const s=e[n];Dn(s)&&"source"in s?t[n]=ase(s):ir(s)&&s.loc&&s.loc.source?t[n]=s.loc.source:an(s)?t[n]=fE(s):t[n]=s}),t}const ose={"<":"&lt;",">":"&gt;",'"':"&quot;","&":"&amp;"};function rse(e){return e.replace(/[<>"&]/g,ise)}function ise(e){return ose[e]||e}function ase(e){return{_custom:{type:"function",display:`<span>ƒ</span> ${e.source?`("${rse(e.source)}")`:"(?)"}`}}}function lse(e,t){e.rootNodes.push({id:"global",label:"Global Scope"});const n=t.mode==="composition"?t.global:t.global.__composer;for(const[s,o]of t.__instances){const r=t.mode==="composition"?o:o.__composer;n!==r&&e.rootNodes.push({id:r.id.toString(),label:`${rN(s)} Scope`})}}function cse(e,t){let n=null;if(e!=="global"){for(const[s,o]of t.__instances.entries())if(o.id.toString()===e){n=s;break}}return n}function aN(e,t){if(e==="global")return t.mode==="composition"?t.global:t.global.__composer;{const n=Array.from(t.__instances.values()).find(s=>s.id.toString()===e);return n?t.mode==="composition"?n:n.__composer:null}}function use(e,t){const n=aN(e.nodeId,t);return n&&(e.state=dse(n)),null}function dse(e){const t={},n="Locale related info",s=[{type:n,key:"locale",editable:!0,value:e.locale.value},{type:n,key:"fallbackLocale",editable:!0,value:e.fallbackLocale.value},{type:n,key:"availableLocales",editable:!1,value:e.availableLocales},{type:n,key:"inheritLocale",editable:!0,value:e.inheritLocale}];t[n]=s;const o="Locale messages info",r=[{type:o,key:"messages",editable:!1,value:fE(e.messages.value)}];t[o]=r;{const i="Datetime formats info",a=[{type:i,key:"datetimeFormats",editable:!1,value:e.datetimeFormats.value}];t[i]=a;const l="Datetime formats info",c=[{type:l,key:"numberFormats",editable:!1,value:e.numberFormats.value}];t[l]=c}return t}function Af(e,t){if(hE){let n;t&&"groupId"in t&&(n=t.groupId,delete t.groupId),hE.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:e,groupId:n,time:Date.now(),meta:{},data:t||{},logType:e==="compile-error"?"error":e==="fallback"||e==="missing"?"warning":"default"}})}}function hse(e,t){const n=aN(e.nodeId,t);if(n){const[s]=e.path;s==="locale"&&yt(e.state.value)?n.locale.value=e.state.value:s==="fallbackLocale"&&(yt(e.state.value)||An(e.state.value)||an(e.state.value))?n.fallbackLocale.value=e.state.value:s==="inheritLocale"&&tn(e.state.value)&&(n.inheritLocale=e.state.value)}}function fse(e,t,n){return{beforeCreate(){const s=ts();if(!s)throw Ss(dn.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const r=o.i18n;if(o.__i18n&&(r.__i18n=o.__i18n),r.__root=t,this===this.$root)this.$i18n=lN(e,r);else{r.__injectWithOption=!0,r.__extender=n.__vueI18nExtend,this.$i18n=lE(r);const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=lN(e,o);else{this.$i18n=lE({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&jM(t,o,o),this.$t=(...r)=>this.$i18n.t(...r),this.$rt=(...r)=>this.$i18n.rt(...r),this.$tc=(...r)=>this.$i18n.tc(...r),this.$te=(r,i)=>this.$i18n.te(r,i),this.$d=(...r)=>this.$i18n.d(...r),this.$n=(...r)=>this.$i18n.n(...r),this.$tm=r=>this.$i18n.tm(r),n.__setInstance(s,this.$i18n)},mounted(){if(X.env.NODE_ENV!=="production"&&this.$el&&this.$i18n){const s=this.$i18n;this.$el.__VUE_I18N__=s.__composer;const o=this.__v_emitter=WS();s.__enableEmitter&&s.__enableEmitter(o),o.on("*",Af)}},unmounted(){const s=ts();if(!s)throw Ss(dn.UNEXPECTED_ERROR);const o=this.$i18n;X.env.NODE_ENV!=="production"&&this.$el&&this.$el.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",Af),delete this.__v_emitter),this.$i18n&&(o.__disableEmitter&&o.__disableEmitter(),delete this.$el.__VUE_I18N__)),delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(s),delete this.$i18n}}}function lN(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[UM](t.pluralizationRules||e.pluralizationRules);const n=_v(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const pse=pi("global-vue-i18n");function gse(e={},t){const n=__VUE_I18N_LEGACY_API__&&tn(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,s=tn(e.globalInjection)?e.globalInjection:!0,o=__VUE_I18N_LEGACY_API__&&n?!!e.allowComposition:!0,r=new Map,[i,a]=mse(e,n),l=pi(X.env.NODE_ENV!=="production"?"vue-i18n":"");X.env.NODE_ENV!=="production"&&n&&o&&fs(go(Gn.NOTICE_DROP_ALLOW_COMPOSITION));function c(h){return r.get(h)||null}function u(h,f){r.set(h,f)}function d(h){r.delete(h)}{const h={get mode(){return __VUE_I18N_LEGACY_API__&&n?"legacy":"composition"},get allowComposition(){return o},async install(f,...p){if(X.env.NODE_ENV!=="production"&&(f.__VUE_I18N__=h),f.__VUE_I18N_SYMBOL__=l,f.provide(f.__VUE_I18N_SYMBOL__,h),Gt(p[0])){const C=p[0];h.__composerExtend=C.__composerExtend,h.__vueI18nExtend=C.__vueI18nExtend}let g=null;!n&&s&&(g=Rse(f,h.global)),__VUE_I18N_FULL_INSTALL__&&Qne(f,h,...p),__VUE_I18N_LEGACY_API__&&n&&f.mixin(fse(a,a.__composer,h));const v=f.unmount;if(f.unmount=()=>{g&&g(),h.dispose(),v()},X.env.NODE_ENV!=="production"){if(!await nse(f,h))throw Ss(dn.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const S=WS();if(n){const b=a;b.__enableEmitter&&b.__enableEmitter(S)}else{const b=a;b[hc]&&b[hc](S)}S.on("*",Af)}},get global(){return a},dispose(){i.stop()},__instances:r,__getInstance:c,__setInstance:u,__deleteInstance:d};return h}}function pE(e={}){const t=ts();if(t==null)throw Ss(dn.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Ss(dn.NOT_INSTALLED);const n=vse(t),s=wse(n),o=zM(t),r=yse(e,o);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!e.__useComponent){if(!n.allowComposition)throw Ss(dn.NOT_AVAILABLE_IN_LEGACY_MODE);return Ese(t,r,s,e)}if(r==="global")return jM(s,e,o),s;if(r==="parent"){let l=Cse(n,t,e.__useComponent);return l==null&&(X.env.NODE_ENV!=="production"&&fs(go(Gn.NOT_FOUND_PARENT_SCOPE)),l=s),l}const i=n;let a=i.__getInstance(t);if(a==null){const l=As({},e);"__i18n"in o&&(l.__i18n=o.__i18n),s&&(l.__root=s),a=aE(l),i.__composerExtend&&(a[iE]=i.__composerExtend(a)),Sse(i,t,a),i.__setInstance(t,a)}return a}function mse(e,t,n){const s=tw();{const o=__VUE_I18N_LEGACY_API__&&t?s.run(()=>lE(e)):s.run(()=>aE(e));if(o==null)throw Ss(dn.UNEXPECTED_ERROR);return[s,o]}}function vse(e){{const t=Sn(e.isCE?pse:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Ss(e.isCE?dn.NOT_INSTALLED_WITH_PROVIDE:dn.UNEXPECTED_ERROR);return t}}function yse(e,t){return pv(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function wse(e){return e.mode==="composition"?e.global:e.global.__composer}function Cse(e,t,n=!1){let s=null;const o=t.root;let r=bse(t,n);for(;r!=null;){const i=e;if(e.mode==="composition")s=i.__getInstance(r);else if(__VUE_I18N_LEGACY_API__){const a=i.__getInstance(r);a!=null&&(s=a.__composer,n&&s&&!s[WM]&&(s=null))}if(s!=null||o===r)break;r=r.parent}return s}function bse(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function Sse(e,t,n){let s=null;sn(()=>{if(X.env.NODE_ENV!=="production"&&t.vnode.el){t.vnode.el.__VUE_I18N__=n,s=WS();const o=n;o[hc]&&o[hc](s),s.on("*",Af)}},t),zc(()=>{const o=n;X.env.NODE_ENV!=="production"&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&(s&&s.off("*",Af),o[Ff]&&o[Ff](),delete t.vnode.el.__VUE_I18N__),e.__deleteInstance(t);const r=o[iE];r&&(r(),delete o[iE])},t)}function Ese(e,t,n,s={}){const o=t==="local",r=Up(null);if(o&&e.proxy&&!(e.proxy.$options.i18n||e.proxy.$options.__i18n))throw Ss(dn.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const i=tn(s.inheritLocale)?s.inheritLocale:!yt(s.locale),a=B(!o||i?n.locale.value:yt(s.locale)?s.locale:Qu),l=B(!o||i?n.fallbackLocale.value:yt(s.fallbackLocale)||An(s.fallbackLocale)||Gt(s.fallbackLocale)||s.fallbackLocale===!1?s.fallbackLocale:a.value),c=B(_v(a.value,s)),u=B(Gt(s.datetimeFormats)?s.datetimeFormats:{[a.value]:{}}),d=B(Gt(s.numberFormats)?s.numberFormats:{[a.value]:{}}),h=o?n.missingWarn:tn(s.missingWarn)||Xa(s.missingWarn)?s.missingWarn:!0,f=o?n.fallbackWarn:tn(s.fallbackWarn)||Xa(s.fallbackWarn)?s.fallbackWarn:!0,p=o?n.fallbackRoot:tn(s.fallbackRoot)?s.fallbackRoot:!0,g=!!s.fallbackFormat,v=Dn(s.missing)?s.missing:null,C=Dn(s.postTranslation)?s.postTranslation:null,S=o?n.warnHtmlMessage:tn(s.warnHtmlMessage)?s.warnHtmlMessage:!0,b=!!s.escapeParameter,w=o?n.modifiers:Gt(s.modifiers)?s.modifiers:{},D=s.pluralRules||o&&n.pluralRules;function R(){return[a.value,l.value,c.value,u.value,d.value]}const T=Y({get:()=>r.value?r.value.locale.value:a.value,set:K=>{r.value&&(r.value.locale.value=K),a.value=K}}),F=Y({get:()=>r.value?r.value.fallbackLocale.value:l.value,set:K=>{r.value&&(r.value.fallbackLocale.value=K),l.value=K}}),x=Y(()=>r.value?r.value.messages.value:c.value),P=Y(()=>u.value),E=Y(()=>d.value);function k(){return r.value?r.value.getPostTranslationHandler():C}function I(K){r.value&&r.value.setPostTranslationHandler(K)}function M(){return r.value?r.value.getMissingHandler():v}function O(K){r.value&&r.value.setMissingHandler(K)}function $(K){return R(),K()}function Z(...K){return r.value?$(()=>Reflect.apply(r.value.t,null,[...K])):$(()=>"")}function Q(...K){return r.value?Reflect.apply(r.value.rt,null,[...K]):""}function se(...K){return r.value?$(()=>Reflect.apply(r.value.d,null,[...K])):$(()=>"")}function ae(...K){return r.value?$(()=>Reflect.apply(r.value.n,null,[...K])):$(()=>"")}function ee(K){return r.value?r.value.tm(K):{}}function V(K,ue){return r.value?r.value.te(K,ue):!1}function W(K){return r.value?r.value.getLocaleMessage(K):{}}function te(K,ue){r.value&&(r.value.setLocaleMessage(K,ue),c.value[K]=ue)}function pe(K,ue){r.value&&r.value.mergeLocaleMessage(K,ue)}function ve(K){return r.value?r.value.getDateTimeFormat(K):{}}function re(K,ue){r.value&&(r.value.setDateTimeFormat(K,ue),u.value[K]=ue)}function ie(K,ue){r.value&&r.value.mergeDateTimeFormat(K,ue)}function j(K){return r.value?r.value.getNumberFormat(K):{}}function me(K,ue){r.value&&(r.value.setNumberFormat(K,ue),d.value[K]=ue)}function oe(K,ue){r.value&&r.value.mergeNumberFormat(K,ue)}const Se={get id(){return r.value?r.value.id:-1},locale:T,fallbackLocale:F,messages:x,datetimeFormats:P,numberFormats:E,get inheritLocale(){return r.value?r.value.inheritLocale:i},set inheritLocale(K){r.value&&(r.value.inheritLocale=K)},get availableLocales(){return r.value?r.value.availableLocales:Object.keys(c.value)},get modifiers(){return r.value?r.value.modifiers:w},get pluralRules(){return r.value?r.value.pluralRules:D},get isGlobal(){return r.value?r.value.isGlobal:!1},get missingWarn(){return r.value?r.value.missingWarn:h},set missingWarn(K){r.value&&(r.value.missingWarn=K)},get fallbackWarn(){return r.value?r.value.fallbackWarn:f},set fallbackWarn(K){r.value&&(r.value.missingWarn=K)},get fallbackRoot(){return r.value?r.value.fallbackRoot:p},set fallbackRoot(K){r.value&&(r.value.fallbackRoot=K)},get fallbackFormat(){return r.value?r.value.fallbackFormat:g},set fallbackFormat(K){r.value&&(r.value.fallbackFormat=K)},get warnHtmlMessage(){return r.value?r.value.warnHtmlMessage:S},set warnHtmlMessage(K){r.value&&(r.value.warnHtmlMessage=K)},get escapeParameter(){return r.value?r.value.escapeParameter:b},set escapeParameter(K){r.value&&(r.value.escapeParameter=K)},t:Z,getPostTranslationHandler:k,setPostTranslationHandler:I,getMissingHandler:M,setMissingHandler:O,rt:Q,d:se,n:ae,tm:ee,te:V,getLocaleMessage:W,setLocaleMessage:te,mergeLocaleMessage:pe,getDateTimeFormat:ve,setDateTimeFormat:re,mergeDateTimeFormat:ie,getNumberFormat:j,setNumberFormat:me,mergeNumberFormat:oe};function U(K){K.locale.value=a.value,K.fallbackLocale.value=l.value,Object.keys(c.value).forEach(ue=>{K.mergeLocaleMessage(ue,c.value[ue])}),Object.keys(u.value).forEach(ue=>{K.mergeDateTimeFormat(ue,u.value[ue])}),Object.keys(d.value).forEach(ue=>{K.mergeNumberFormat(ue,d.value[ue])}),K.escapeParameter=b,K.fallbackFormat=g,K.fallbackRoot=p,K.fallbackWarn=f,K.missingWarn=h,K.warnHtmlMessage=S}return eh(()=>{if(e.proxy==null||e.proxy.$i18n==null)throw Ss(dn.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const K=r.value=e.proxy.$i18n.__composer;t==="global"?(a.value=K.locale.value,l.value=K.fallbackLocale.value,c.value=K.messages.value,u.value=K.datetimeFormats.value,d.value=K.numberFormats.value):o&&U(K)}),Se}const _se=["locale","fallbackLocale","availableLocales"],cN=["t","rt","d","n","tm","te"];function Rse(e,t){const n=Object.create(null);return _se.forEach(o=>{const r=Object.getOwnPropertyDescriptor(t,o);if(!r)throw Ss(dn.UNEXPECTED_ERROR);const i=mn(r.value)?{get(){return r.value.value},set(a){r.value.value=a}}:{get(){return r.get&&r.get()}};Object.defineProperty(n,o,i)}),e.config.globalProperties.$i18n=n,cN.forEach(o=>{const r=Object.getOwnPropertyDescriptor(t,o);if(!r||!r.value)throw Ss(dn.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,r)}),()=>{delete e.config.globalProperties.$i18n,cN.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}if(Une(),__INTLIFY_JIT_COMPILATION__?pM(Ine):pM(Tne),yne(Jte),wne(uM),X.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const e=sa();e.__INTLIFY__=!0,ane(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}X.env.NODE_ENV;const uN={en:{}};function Dse(e){const t=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):null}async function Tse(e,t=10,n=300){for(let s=0;s<t;s++){const o=Dse(e);if(o)return o;await new Promise(r=>setTimeout(r,n))}return null}async function Ise(){const e=await Tse("account.tessr_i18n_file_version_url");if(!e)return{};const t=await fetch(e);if(!t.ok)throw new Error("Failed to load en-error.json");return await t.json()}async function xse(){const e=await Ise();return{...uN,en:{...uN.en,errorMessages:e}}}async function Fse(){return gse({legacy:!1,locale:"en",fallbackLocale:"en",messages:await xse(),formatFallbackMessages:!0})}const Pse=async()=>{const e=await Fse();return $J(e.global),e},Ase={style:{color:"#ff5200"}},dN=Et(ot({__name:"ImportVisual",props:{state:{},errorMessage:{},overwrite:{type:Boolean}},setup(e){return(t,n)=>(z(),le("div",{class:J(t.$style["inform-layout"])},[e.state==="importing"?(z(),le("div",{key:0,class:J(t.$style["import-error"]),style:{width:"500px"}},[he(G(Am),{src:"UploadInProgress","max-height":180,"max-width":180})],2)):e.state==="error"?(z(),le("div",{key:1,class:J(t.$style["import-error"]),style:{width:"500px"}},[he(G(Am),{src:"Unsuccessful1","max-height":180,"max-width":180}),we("span",{class:J(t.$style["step-title"])}," File doesn’t meet requirements. Check file and try again. ",2),we("div",Ase,[we("span",{class:J(t.$style["step-description"])},"Error code",2),we("span",{class:J(t.$style["step-description"])},Ct(e.errorMessage),3)])],2)):e.state==="success"?(z(),le(xt,{key:2},[he(G(Am),{src:"Successful1","max-height":180,"max-width":180}),we("span",{class:J(t.$style["step-title"]),style:{"white-space":"pre-wrap","align-items":"center","text-align":"center"}},Ct(e.overwrite?`Existing data will be overwritten in the background.
198
198
  Refresh to see updates.`:`Work will be created in background.
199
- Refresh to see updates.`),3)],64)):Ze("",!0)],2))}}),[["__cssModules",{$style:{"inform-layout":"_inform-layout_16bpq_1","import-error":"_import-error_16bpq_11","step-title":"_step-title_16bpq_22","step-description":"_step-description_16bpq_27"}}]]),hN=Et(ot({__name:"DateRule",setup(e){const n=(()=>{const o=(h,f,p,g)=>{const v=document.createElement("span");return v.textContent=h,v.style.fontWeight=f,v.style.fontSize=p,v.style.color=g,v},r=document.createElement("div");r.style.display="flex",r.style.flexDirection="column";const i=document.createElement("div"),a=document.createElement("div"),l=o("Valid formats:","normal","14px","#02C39A"),c=o("Invalid formats:","normal","14px","#FF5200"),u=o(" 2025.12.31, 2025-12-31, 2025/12/31 ","normal","14px",""),d=o(" 12.31.2025, 2025.31.12","normal","14px","");return i.appendChild(l),i.appendChild(u),a.appendChild(c),a.appendChild(d),r.appendChild(i),r.appendChild(a),r.outerHTML})(),s=qt;return(o,r)=>(z(),le("div",{class:J(o.$style["date-format-guide"])},[we("span",{class:J(o.$style["step-title-2"])},[r[0]||(r[0]=tt(" Date format guide ",-1)),Ke(he(G(at),{src:"InfoCircle",color:"#A6A6A6"},null,512),[[G(s),{content:G(n)}]])],2),we("div",{class:J(o.$style["date-rule-section"])},[r[3]||(r[3]=we("span",null,"Enter dates in one of these formats:",-1)),we("ul",{class:J(o.$style["step-description"])},[we("li",{class:J(o.$style["date-rule"])},[...r[1]||(r[1]=[we("b",null,"DD MM YYYY",-1),tt(" (Day-Month-Year) ",-1)])],2),we("li",{class:J(o.$style["date-rule"])},[...r[2]||(r[2]=[we("b",null,"YYYY MM DD",-1),tt(" (Year-Month-Day) ",-1)])],2)],2)],2)],2))}}),[["__cssModules",{$style:{"date-format-guide":"_date-format-guide_1clky_1","step-title-2":"_step-title-2_1clky_13","date-rule-section":"_date-rule-section_1clky_25","step-description":"_step-description_1clky_29","date-rule":"_date-rule_1clky_25"}}]]);function fN(e,t,n){return(t=Ose(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ose(e){var t=kse(e,"string");return typeof t=="symbol"?t:t+""}function Rv(e){"@babel/helpers - typeof";return Rv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rv(e)}var kf=function(e){return e.TOOLBOX_EXPORT_DATA="TOOLBOX_EXPORT_DATA",e.SW_APP_LOADER="SW_APP_LOADER",e}({});function pN(e){return Rv(e)==="object"&&e!==null&&!Array.isArray(e)}function gN(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(s){return n.includes(s)})}function Mse(e){return typeof Blob<"u"&&e instanceof Blob}var Nse=function(t){return pN(t)&&gN(t,["file","fileName"])&&Mse(t.file)&&typeof t.fileName=="string"},Lse=function(t){return pN(t)&&gN(t,["scene_id","people_id","openGS","queryParams"])&&(typeof t.scene_id=="string"||t.scene_id===null)&&(typeof t.people_id=="string"||t.people_id===null)&&(typeof t.openGS=="boolean"||t.openGS===null)&&typeof t.queryParams=="string"},Vse=Object.freeze(fN(fN({},kf.TOOLBOX_EXPORT_DATA,Nse),kf.SW_APP_LOADER,Lse));function Bse(e){return Rv(e)==="object"&&e!==null&&!Array.isArray(e)}function $se(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(s){return n.includes(s)})}function Hse(e){if(!Bse(e))return{valid:!1,reason:"Message must be an object."};if(e.version!==1)return{valid:!1,reason:"Unsupported or missing message version."};if(typeof e.type!="string"||!Object.values(kf).includes(e.type))return{valid:!1,reason:"Unknown or missing message type."};if(e.id!==void 0&&typeof e.id!="string")return{valid:!1,reason:"Message id must be a string when provided."};var t=e.id===void 0?["version","type","payload"]:["version","type","payload","id"];if(!$se(e,t))return{valid:!1,reason:"Message contains missing or unexpected fields."};var n=e.type;return Vse[n](e.payload)?{valid:!0,message:e}:{valid:!1,reason:"Payload does not match the ".concat(n," schema.")}}function mN(e){var t=e.target,n=e.allowedOrigins,s=e.onMessage,o=e.onInvalidMessage,r=t??(typeof window>"u"?void 0:window);if(!r)throw new TypeError("A target window is required outside a browser environment.");if(!Array.isArray(n)||n.length===0)throw new TypeError("At least one allowed message origin must be configured.");if(n.some(function(a){return typeof a!="string"||a.length===0||a==="*"}))throw new TypeError("Allowed message origins must be explicit origin strings; wildcards are not allowed.");if(typeof s!="function")throw new TypeError("An onMessage callback is required.");var i=function(l){if(!n.includes(l.origin)){o==null||o(l.data,"Untrusted message origin: ".concat(l.origin),l);return}var c=Hse(l.data);if(c.valid===!1){o==null||o(l.data,c.reason,l);return}s(c.message,l)};return r.addEventListener("message",i),function(){return r.removeEventListener("message",i)}}const Gse={key:1},Use=Et(ot({__name:"PopupCreateScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=B(null),o=e,r=()=>{s.value&&s.value.show()},i=B(""),a=B("idle"),l=Y(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Create new work"})[a.value]),c=B(null),u=B({file:null,format:null}),{apiServices:d}=ns(!1,o),h=async I=>{var O,$;if(((O=d==null?void 0:d.value)==null?void 0:O.getTemplateFlowStatuses)===void 0){console.error("API services not available",($=d==null?void 0:d.value)==null?void 0:$.getTemplateFlowStatuses);return}return await d.value.getTemplateFlowStatuses({workspaceId:o.workspaceId,entityId:o.entityId,...I})},f=Sn("switchInstance"),p=B(!1),g=()=>{f?f("xlsx_toolbox","",{showLoad:!1}):window.appManager.switchInstance("xlsx_toolbox","",{showLoad:!1}),console.log("Toolbox opened")},v=async()=>{p.value=!0;const I=o.workspaceId,M=o.entityId;if(!I||!M||!d.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await d.value.downloadTemplate(I,M))throw new Error("No response from downloadTemplate API")}catch(O){console.error("Error downloading template:",O)}p.value=!1},C=async I=>{var $,Z,Q;const M=new FormData,O=(($=I.name.split(".").pop())==null?void 0:$.toString())||"";if(M.append("file",I),M.append("format",O),M.append("entity_id",o.entityId||""),M.append("template_flow_status_id",T.value||""),!d.value||!o.workspaceId||!o.entityId){console.error("API services not available");return}try{await d.value.addNewSceneViaImportFile(o.workspaceId,o.entityId,M),S()}catch(se){throw console.error("Error uploading file:",se),b(((Q=(Z=se.response)==null?void 0:Z.data)==null?void 0:Q.message)||"An unknown error occurred during file upload."),se}},S=()=>{a.value="success"},b=I=>{i.value=I,a.value="error"},w=n,D=()=>{w("import-success"),E()},R=async()=>{if(!u.value||!u.value.file){console.error("No file to upload");return}a.value="importing",await C(u.value.file)};t({open:r});const T=B(null),F=Y(()=>!u.value.file||!u.value.format||!u.value.isValid||!T.value),x=B(null),P=()=>{var I,M;(I=c.value)==null||I.clear(),i.value="",u.value={file:null,format:null},T.value=null,(M=x==null?void 0:x.value)==null||M.clear(),a.value="idle"},E=()=>{var I;P(),(I=s.value)==null||I.hide()};let k;return sn(()=>{k=mN({target:window,allowedOrigins:["https://child.example"],onMessage:(I,M)=>{var $;if(I.type!==kf.SW_APP_LOADER)return;console.log("Received from:",M.origin),console.log("File name:",I.payload.fileName);const O=I.payload.file;($=c.value)==null||$.setFile(O)},onInvalidMessage:(I,M,O)=>{console.warn("Rejected postMessage:",M,O.origin)}})}),es(()=>{k==null||k()}),(I,M)=>(z(),je(G(jk),{"popup-name":l.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:P},nh({default:ge(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(z(),je(dN,{key:0,state:a.value,"error-message":i.value},null,8,["state","error-message"])):(z(),le("div",Gse,[we("div",{class:J(I.$style["step-section"])},[we("span",{class:J(I.$style["step-title"])},"Step 1: Download sample file",2),we("span",{class:J(I.$style["step-description"])}," Get a sample file with all columns ready for editing. ",2),we("div",{class:J(I.$style["actions-section"])},[he(G(ct),{class:J(I.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:p.value,onHandleClick:v},{prefix:ge(()=>[he(G(at),{src:"Download"})]),default:ge(()=>[M[2]||(M[2]=tt(" Download sample file ",-1))]),_:1},8,["class","disabled"]),he(G(ct),{class:J(I.$style["download-sample-btn"]),size:12,variant:"secondary",onHandleClick:g},{default:ge(()=>[...M[3]||(M[3]=[tt(" Toolbox ",-1)])]),_:1},8,["class"])],2)],2),we("div",{class:J(I.$style["step-section"])},[we("span",{class:J(I.$style["step-title"])},"Step 2: Upload your file (.xlsx, .xls, .csv)",2),he(G(PO),{modelValue:u.value,"onUpdate:modelValue":M[0]||(M[0]=O=>u.value=O),ref_key:"filUploaderRef",ref:c},null,8,["modelValue"])],2),we("div",{class:J(I.$style["step-section"])},[we("span",{class:J(I.$style["step-title"])},"Step 3: Select status",2),we("span",{class:J(I.$style["step-description"])},"Choose a status for the new work.",2),he(G(tee),{ref_key:"statusRef",ref:x,modelValue:T.value,"onUpdate:modelValue":M[1]||(M[1]=O=>T.value=O),"get-status-func":h,"workspace-id":o.workspaceId,id:o.entityId},null,8,["modelValue","workspace-id","id"])],2),we("div",{class:J(I.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[he(hN)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:ge(()=>[he(G(ct),{style:{flex:"1"},variant:"secondary",onClick:E},{default:ge(()=>[...M[4]||(M[4]=[tt(" Cancel ",-1)])]),_:1}),he(G(ct),{disabled:F.value,style:{flex:"1"},variant:"primary",onClick:R},{default:ge(()=>[...M[5]||(M[5]=[tt(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ge(()=>[he(G(ct),{style:{flex:"1"},variant:"primary",onClick:D},{default:ge(()=>[...M[6]||(M[6]=[tt(" Close ",-1)])]),_:1})]),key:"1"}:a.value=="error"?{name:"footer",fn:ge(()=>[he(G(ct),{style:{flex:"1"},variant:"primary",onClick:P},{default:ge(()=>[...M[7]||(M[7]=[tt(" Try Again ",-1)])]),_:1})]),key:"2"}:void 0]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_1ypsy_1","step-title":"_step-title_1ypsy_11","step-title-2":"_step-title-2_1ypsy_17","step-description":"_step-description_1ypsy_23","actions-section":"_actions-section_1ypsy_28","date-format-guide":"_date-format-guide_1ypsy_34","import-error":"_import-error_1ypsy_45","drop-area":"_drop-area_1ypsy_55","is-dragging":"_is-dragging_1ypsy_55","drop-area-content":"_drop-area-content_1ypsy_58",browse:"_browse_1ypsy_67","download-sample-btn":"_download-sample-btn_1ypsy_71"}}]]),vN={text:za,id:void 0,assignees:dJ,status:bJ,dateRange:hJ,isStarted:za,isCompleted:za,lastUpdated:za,completedOn:za,isDeleted:za,isArchived:za,isProcessing:za,name:Gk,options:DY,metric:Wk,__checkboxSelection:void 0,description:qee},Wse={text:!1,id:!1,assignees:!0,status:!0,dateRange:!0,isStarted:!1,isCompleted:!1,lastUpdated:!1,completedOn:!1,isDeleted:!1,isArchived:!1,isProcessing:!1,name:!1,options:!0,metric:!1,__checkboxSelection:!1,description:!1},zse={text:null,id:void 0,assignees:WA,status:$k,dateRange:fJ,isStarted:void 0,isCompleted:void 0,lastUpdated:void 0,completedOn:void 0,isDeleted:void 0,isArchived:void 0,isProcessing:void 0,name:Gk,options:Hk,metric:void 0,__checkboxSelection:void 0,description:void 0},jse={id:[100,100],assignees:[200,200],status:[200,200],dateRange:[255,255],isStarted:[150,150],isCompleted:[150,150],lastUpdated:[180,180],completedOn:[180,180],isDeleted:[void 0,void 0],isArchived:[void 0,void 0],isProcessing:[void 0,void 0],name:[350,500],options:[50,50],metric:[200,300],__checkboxSelection:[50,50],text:[200,300],description:[200,300]},Kse={dateRange:{cellEditorPopupPosition:"under",cellEditorPopup:!1},name:{cellEditorPopupPosition:"over",cellEditor:!1,cellEditorPopup:!1},metric:{suppressKeyboardEvent:void 0,suppressNavigable:!1,suppressMovable:!1,cellClass:"ag-cell-optimized",editable:!0}},qse=e=>{var t,n,s;if(e){if(Number((t=e.metric_type)==null?void 0:t.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number((n=e.metric_type)==null?void 0:n.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number((s=e.metric_type)==null?void 0:s.id)==3)return}},nd=e=>{if(e)return qse(e)};function yN(e,t){var o,r,i,a;const n=(o=t==null?void 0:t.data)==null?void 0:o.permissions;let s={disabled:!1,readOnly:!1,type:void 0};if(!t||!e)s={disabled:!1,readOnly:!0,type:void 0};else if(e==="options")s={disabled:!1,readOnly:!1,type:void 0};else if(e!=null&&e.includes("metric")){const l=`metric_permission_${e==null?void 0:e.replace("metric_","")}`;s={disabled:!1,readOnly:!((t==null?void 0:t.data)&&t.data[l]&&((r=t.data[l])==null?void 0:r.permission)==2&&!((i=t.colDef)!=null&&i.context.formula)&&!t.data.isLocked&&!t.data.isDeleted),type:nd((a=t.colDef)==null?void 0:a.context)}}else{const c={assignees:(n==null?void 0:n.has_update_assignee_permission)??0,completedOn:0,name:(n==null?void 0:n.has_edit_permission)??0,permissions:0,status:(n==null?void 0:n.has_edit_template_flow_status_permission)??0,dateRange:(n==null?void 0:n.has_edit_date_permission)??0,isStarted:0,isDeleted:0,isArchived:0,isLocked:0,isProcessing:0,lastUpdated:0,id:0,isCompleted:0,options:1,disabled:0,description:(n==null?void 0:n.has_edit_permission)??0}[e]??0;s={disabled:c===-1,readOnly:c!==1,type:void 0}}return s}class gE{constructor(){Qn(this,"eGui");Qn(this,"params")}init(t){this.params=t}getGui(){var n,s,o,r,i;const t=document.createElement("div");return(n=this.params)!=null&&n.height&&t.style.setProperty("--height",(s=this.params)==null?void 0:s.height),(o=this.params)!=null&&o.width?t.style.setProperty("--width",(r=this.params)==null?void 0:r.width):(i=this.params)!=null&&i.fullwidth?t.style.setProperty("--width","100%"):t.style.setProperty("--width",`${Math.floor(Math.random()*50)+50}%`),t.className="ag-cell-skeleton",t.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation()}),this.eGui=t,t}refresh(t){return!1}getValue(){var t;return(t=this.params)==null?void 0:t.value}isPopup(t){return!1}getPopupPosition(){}destroy(){}}const wN=new Map;class Of{static initialize(t){this.wrappers=t}static getWrappers(){if(!this.wrappers)throw new Error("CellRendererFactory: Not initialized. Please call CellRendererFactory.initialize() first.");return this.wrappers}static buildCommonCellParams(t,n){var c,u,d;const s=t.data||((c=t.node)==null?void 0:c.data),o=(u=t.colDef)==null?void 0:u.field,r=o&&s?s[o]:void 0,i=yN((d=t.colDef)==null?void 0:d.field,t),a=typeof n=="function"?n(t):n??{};return{...t,value:r,disabled:i==null?void 0:i.disabled,readOnly:i==null?void 0:i.readOnly,type:nd(t.context),...a}}static resolveRendererComponent(t,n){let s;return t.includes("metric")&&vN.metric?nd(n)==="rating"?s=Gee:s=Wk:s=vN[t]??void 0,s}static resolveEditorComponent(t,n){const s=t.includes("metric");let o;const r=nd(n);return s&&["number","dropdown"].includes(r)?o=see:o=zse[t],o}static canEditField(t,n){var r;if(n.data===void 0)return!1;const s=yN((r=n.colDef)==null?void 0:r.field,n),o=Wse[t]??!0;return!(s!=null&&s.disabled)&&!(s!=null&&s.readOnly)&&o&&(s==null?void 0:s.type)!=="rating"}static resolveSize(t){const[n=250,s=300]=jse[t]??[];return{minWidth:n,maxWidth:s}}static buildHeaderComponentParams(t){return n=>typeof t=="function"?t(n):t??{}}static fromType(t){const{wrapVueCellEditor:n}=this.getWrappers(),s=String(t.field??""),o=this.resolveSize(s),r=Kse[s]??{},i=nd(t.context),a=i==="number"||i==="rating",l=i=="rating"?t.context.range*24+20:o.minWidth;return{...t,headerName:t.headerName,...o,...t,cellEditorSelector:u=>{const d=this.resolveEditorComponent(s,t.context);return{component:n(d),params:this.buildCommonCellParams(u,t.cellRendererParams),popup:!a}},singleClickEdit:!0,cellEditorPopup:!a,cellEditorPopupPosition:a?void 0:"under",editable:u=>{let d;return u.data===void 0||u.data.isDeleted||u.node.data===void 0?d=!1:d=this.canEditField(s,u),d},minWidth:l,cellRendererSelector:u=>Yse(u,{component:n(this.resolveRendererComponent(s,t.context)),params:this.buildCommonCellParams(u,t.cellRendererParams)}),headerComponentParams:this.buildHeaderComponentParams(t.headerComponentParams),...r,cellClass:u=>`${i}--${u.colDef.field}`}}}Qn(Of,"wrappers",null);const Yse=(e,t)=>{var o;const n=(o=e.colDef)==null?void 0:o.field,s=`${n}-${e.node.rowIndex}`;return wN.set(s,(wN.get(s)??0)+1),n!=null&&n.includes("metric")?e.value===void 0?{component:gE,params:{fullwidth:!1}}:t:e.data&&e.value!==void 0?t:!n||n==="options"||n==="__checkboxSelection"?e.data?t:{component:gE,params:{fullwidth:!0,width:"24px",height:"24px"}}:!e.data||e.value===void 0?{component:gE,params:{fullwidth:!1}}:t},Xse=Et(ot({__name:"Vue3Wrapper",props:{component:{},params:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},tooltip:{},isNoData:{type:Boolean,default:!1},workspaceId:{},entityId:{},axiosService:{},isSearching:{type:Boolean,default:!1},isFiltering:{type:Boolean,default:!1},sortType:{default:"default"},maxRating:{default:5},config:{}},setup(e,{expose:t}){const n=e,s=B(null),o=Y(()=>{var a;return((a=n.component)==null?void 0:a.name)||"UnknownComponent"}),r=Y(()=>{var a;return((a=n.component)==null?void 0:a.default)||n.component}),i=Y(()=>({params:n.params,disabled:n.disabled,readOnly:n.readOnly,value:n.value,maxRating:n.maxRating,data:n.data,id:n.id,workspaceId:n.workspaceId,entityId:n.entityId,axiosService:n.axiosService,tooltip:n.tooltip,isSearching:n.isSearching,isFiltering:n.isFiltering,isNoData:n.isNoData,config:n.config}));return t({focus:()=>{var a;return(a=s.value)!=null&&a.focus?s.value.focus():console.warn(`Component ${o.value} does not have a focus method.`),!0},blur:()=>{var a,l;return(l=(a=s.value)==null?void 0:a.blur)==null||l.call(a),!0},trigger:(a,l)=>{var c;return(c=s.value)==null||c.$emit(a,l),!0}}),(a,l)=>{const c=eD("loading-skeleton");return z(),le(xt,null,[(z(),je(bw(r.value),Kt(i.value,{ref_key:"componentRef",ref:s}),null,16)),he(c)],64)}}}),[["__cssModules",{$style:{skeleton:"_skeleton_7xde7_1",shimmer:"_shimmer_7xde7_16","skeleton-loading":"_skeleton-loading_7xde7_1"}}]]);function Zse(e){return"stopEditing"in e}const Jse=8,Qse=e=>{if(!e)return;const t=e.__vueParentComponent,n=t==null?void 0:t.exposed;n&&typeof n.triggerFocus=="function"?n.triggerFocus():e.focus()};function CN(e){return class{constructor(){Qn(this,"container");Qn(this,"vNode",null);Qn(this,"componentInstance",null);Qn(this,"componsenExposed",null);Qn(this,"params");Qn(this,"isEditor",!1);Qn(this,"_destroyed",!1)}init(n){var l,c,u,d;if(!n){console.error("[Vue3CellWrapper] Missing params");return}const s=performance.now();this.params=n,this.isEditor=Zse(n),this.container=document.createElement("div"),this.container.classList.add("ag-vue3-cell-wrapper"),this.container.style.width="100%",this.container.style.height="100%";const o=n.context.apiClass,r=n,i={component:e,params:Object.freeze(n),disabled:!1,readOnly:r.readOnly??!1,value:n.value,maxRating:r.maxRating??void 0,data:n.data,id:(l=n==null?void 0:n.data)==null?void 0:l.id,workspaceId:n.context.workspaceId,entityId:n.context.entityId,axiosService:o,tooltip:r.tooltip??void 0,isSearching:r.isSearching??!1,isFiltering:r.isFiltering??!1,isNoData:r.isNoData??!1,config:r.config,sceneId:(r==null?void 0:r.sceneId)||void 0};this.vNode=he(Xse,i),Kw(this.vNode,this.container);const a=performance.now()-s;a>Jse&&console.warn(`[Vue3CellWrapper] Slow render (${a.toFixed(1)}ms) for "${(c=n.colDef)==null?void 0:c.field}"`),this.componentInstance=(u=this.vNode.component)==null?void 0:u.proxy,this.componsenExposed=(d=this.vNode.component)==null?void 0:d.exposed}getGui(){return this.container}refresh(n){return!1}focusUi(){var n;(n=this.componsenExposed)!=null&&n.focus?this.componsenExposed.focus():Qse(this.container)}getValue(){var n,s,o;return this.params._editorValue!==void 0?this.params._editorValue:this.componentInstance?((o=(s=this.componentInstance).getValue)==null?void 0:o.call(s))??this.componentInstance.value:(console.warn("[Vue3CellWrapper] getValue() called but component instance not available"),(n=this.params)==null?void 0:n.value)}isPopup(n){var i,a,l,c,u;const s=(l=(a=(i=this.params)==null?void 0:i.colDef)==null?void 0:a.field)==null?void 0:l.includes("metric"),o=((c=this.params)==null?void 0:c.context)&&nd(this.params.context);return s||(o==="number"||o==="rating")||!this.isEditor?!1:(u=this.componentInstance)!=null&&u.isPopup?this.componentInstance.isPopup():!0}getPopupPosition(){var s,o,r;return this.isEditor?(s=this.componentInstance)!=null&&s.getPopupPosition?this.componentInstance.getPopupPosition():((r=(o=this.params)==null?void 0:o.colDef)==null?void 0:r.cellEditorPopupPosition)??"under":void 0}afterGuiAttached(){!this.isEditor||this.componentInstance}destroy(){if(!this._destroyed&&(this._destroyed=!0,!!this.container))try{const n=this.componentInstance;if(n){try{typeof n.$destroy=="function"&&n.$destroy()}catch(o){console.warn("[Vue3CellWrapper] Error during $destroy:",o)}try{typeof n.destroy=="function"&&n.destroy()}catch(o){console.warn("[Vue3CellWrapper] Error during destroy():",o)}}(typeof queueMicrotask=="function"?queueMicrotask:o=>Promise.resolve().then(o))(()=>{try{Kw(null,this.container)}catch(o){console.warn("[Vue3CellWrapper] Error during unmount:",o)}finally{this.container.textContent=""}})}catch(n){console.error("[Vue3CellWrapper] Error during cleanup:",n)}finally{this.vNode=null,this.componentInstance=null}}}}function Dv(e){return CN(e)}function bN(e){return CN(e)}var fc=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,n){const s=t?this.allAsyncListeners:this.allSyncListeners;let o=s.get(e);return!o&&n&&(o=new Set,s.set(e,o)),o}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,n=!1){this.getListeners(e,n,!0).add(t)}removeEventListener(e,t,n=!1){const s=this.getListeners(e,n,!1);s&&(s.delete(t),s.size===0&&(n?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){this.getGlobalListeners(t).add(e)}removeGlobalListener(e,t=!1){this.getGlobalListeners(t).delete(e)}dispatchEvent(e){this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const n=e.type;if(t&&"event"in e){const a=e.event;a instanceof Event&&(e.eventPath=a.composedPath())}const{frameworkOverrides:s}=this,o=a=>{const l=s?()=>s.wrapIncoming(a):a;t?this.dispatchAsync(l):l()},r=this.getListeners(n,t,!1);if(((r==null?void 0:r.size)??0)>0){const a=new Set(r);for(const l of a)r!=null&&r.has(l)&&o(()=>l(e))}const i=this.getGlobalListeners(t);if(i.size>0){const a=new Set(i);for(const l of a)o(()=>l(n,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}};function ia(e){return e==null||e===""?null:e}function ht(e){return e!=null&&e!==""}function Vn(e){return!ht(e)}function mE(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function Mf(e,t){const n=e?JSON.stringify(e):null,s=t?JSON.stringify(t):null;return n===s}function eoe(e,t,n=!1){const s=e==null,o=t==null;if(e!=null&&e.toNumber&&(e=e.toNumber()),t!=null&&t.toNumber&&(t=t.toNumber()),s&&o)return 0;if(s)return-1;if(o)return 1;function r(i,a){return i>a?1:i<a?-1:0}if(typeof e!="string"||!n)return r(e,t);try{return e.localeCompare(t)}catch{return r(e,t)}}var toe=/[&<>"']/g,noe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function sd(e){return(e==null?void 0:e.toString().toString())??null}function Nf(e){var t;return((t=sd(e))==null?void 0:t.replace(toe,n=>noe[n]))??null}function mi(e){return e.eRootDiv.getRootNode()}function Un(e){return mi(e).activeElement}function Ds(e){const{gos:t,eRootDiv:n}=e;let s=null;const o=t.get("getDocument");return o&&ht(o)?s=o():n&&(s=n.ownerDocument),s&&ht(s)?s:document}function SN(e){const t=Un(e);return t===null||t===Ds(e).body}function EN(e){return Ds(e).defaultView||window}function vE(e){let t=null,n=null;try{t=Ds(e).fullscreenElement}catch{}finally{t||(t=mi(e));const s=t.querySelector("body");s?n=s:t instanceof ShadowRoot?n=t:t instanceof Document?n=t==null?void 0:t.documentElement:n=t}return n}function soe(e){const t=vE(e);return(t==null?void 0:t.clientWidth)??(window.innerWidth||-1)}function ooe(e){const t=vE(e);return(t==null?void 0:t.clientHeight)??(window.innerHeight||-1)}function Vr(e,t,n){n==null||typeof n=="string"&&n==""?_N(e,t):lr(e,t,n)}function lr(e,t,n){e.setAttribute(RN(t),n.toString())}function _N(e,t){e.removeAttribute(RN(t))}function RN(e){return`aria-${e}`}function el(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function roe(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function ioe(e){return e.getAttribute("aria-label")}function od(e,t){Vr(e,"label",t)}function Lf(e,t){Vr(e,"labelledby",t)}function DN(e,t){Vr(e,"live",t)}function aoe(e,t){Vr(e,"atomic",t)}function loe(e,t){Vr(e,"relevant",t)}function coe(e,t){Vr(e,"invalid",t)}function uoe(e,t){Vr(e,"disabled",t)}function TN(e,t){Vr(e,"hidden",t)}function yE(e,t){lr(e,"expanded",t)}function doe(e,t){lr(e,"setsize",t)}function hoe(e,t){lr(e,"posinset",t)}function foe(e,t){lr(e,"multiselectable",t)}function poe(e,t){lr(e,"rowcount",t)}function Tv(e,t){lr(e,"rowindex",t)}function goe(e,t){lr(e,"rowspan",t)}function moe(e,t){lr(e,"colcount",t)}function IN(e,t){lr(e,"colindex",t)}function voe(e,t){lr(e,"colspan",t)}function yoe(e,t){lr(e,"sort",t)}function woe(e){_N(e,"sort")}function xN(e,t){Vr(e,"selected",t)}function Coe(e,t){Vr(e,"controls",t)}function boe(e,t){Coe(e,t.id),Lf(t,e.id)}function FN(e,t){Vr(e,"owns",t)}function Iv(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var Soe="[tabindex], input, select, button, textarea, [href]",PN="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Vf(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(PN)?!1:vi(e)}function Bn(e,t,n={}){const{skipAriaHidden:s}=n;e.classList.toggle("ag-hidden",!t),s||TN(e,!t)}function Eoe(e,t,n={}){const{skipAriaHidden:s}=n;e.classList.toggle("ag-invisible",!t),s||TN(e,!t)}function Bf(e,t){const n="disabled",s=t?r=>r.setAttribute(n,""):r=>r.removeAttribute(n);s(e);const o=e.querySelectorAll("input")??[];for(const r of o)s(r)}function pc(e,t,n){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof n=="number"){if(++s>n)break}else if(e===n)break}return!1}function gc(e){const{height:t,width:n,borderTopWidth:s,borderRightWidth:o,borderBottomWidth:r,borderLeftWidth:i,paddingTop:a,paddingRight:l,paddingBottom:c,paddingLeft:u,marginTop:d,marginRight:h,marginBottom:f,marginLeft:p,boxSizing:g}=window.getComputedStyle(e),v=Number.parseFloat;return{height:v(t||"0"),width:v(n||"0"),borderTopWidth:v(s||"0"),borderRightWidth:v(o||"0"),borderBottomWidth:v(r||"0"),borderLeftWidth:v(i||"0"),paddingTop:v(a||"0"),paddingRight:v(l||"0"),paddingBottom:v(c||"0"),paddingLeft:v(u||"0"),marginTop:v(d||"0"),marginRight:v(h||"0"),marginBottom:v(f||"0"),marginLeft:v(p||"0"),boxSizing:g}}function wE(e){const t=gc(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function $f(e){const t=gc(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function AN(e){const{height:t,marginBottom:n,marginTop:s}=gc(e);return Math.floor(t+n+s)}function xv(e){const{width:t,marginLeft:n,marginRight:s}=gc(e);return Math.floor(t+n+s)}function kN(e){const t=e.getBoundingClientRect(),{borderTopWidth:n,borderLeftWidth:s,borderRightWidth:o,borderBottomWidth:r}=gc(e);return{top:t.top+(n||0),left:t.left+(s||0),right:t.right+(o||0),bottom:t.bottom+(r||0)}}function Fv(e,t){let n=e.scrollLeft;return t&&(n=Math.abs(n)),n}function Pv(e,t,n){n&&(t*=-1),e.scrollLeft=t}function ks(e){for(;e!=null&&e.firstChild;)e.firstChild.remove()}function Br(e){e!=null&&e.parentNode&&e.remove()}function ON(e){return!!e.offsetParent}function vi(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!ON(e)||window.getComputedStyle(e).visibility!=="visible")}function CE(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function MN(e,t,n){n&&n.nextSibling===t||(e.firstChild?n?n.nextSibling?e.insertBefore(t,n.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t):e.appendChild(t))}function NN(e,t){for(let n=0;n<t.length;n++){const s=t[n],o=e.children[n];o!==s&&e.insertBefore(s,o)}}function _oe(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}function Hf(e,t){if(t)for(const n of Object.keys(t)){const s=t[n];if(!(n!=null&&n.length)||s==null)continue;const o=_oe(n),r=s.toString(),i=r.replace(/\s*!important/g,""),a=i.length!=r.length?"important":void 0;e.style.setProperty(o,i,a)}}function Av(e){return()=>{const t=e();return t?bE(t)||LN(t):!0}}function bE(e){return e.clientWidth<e.scrollWidth}function LN(e){return e.clientHeight<e.scrollHeight}function kv(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):yi(e,t)}function yi(e,t){t=SE(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function Gf(e,t){t=SE(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function SE(e){return typeof e=="number"?`${e}px`:e}function EE(e){return e instanceof Node||e instanceof HTMLElement}function Bo(e,t,n){n==null||n===""?e.removeAttribute(t):e.setAttribute(t,n.toString())}function tl(e,t,n){const o=EN(e).ResizeObserver,r=o?new o(n):null;return r==null||r.observe(t),()=>r==null?void 0:r.disconnect()}function aa(e,t){const n=EN(e);n.requestAnimationFrame?n.requestAnimationFrame(t):n.webkitRequestAnimationFrame?n.webkitRequestAnimationFrame(t):n.setTimeout(t,0)}var VN="data-ref",_E;function BN(){return _E??(_E=document.createTextNode(" ")),_E.cloneNode()}function Uf(e){const{attrs:t,children:n,cls:s,ref:o,role:r,tag:i}=e,a=document.createElement(i);if(s&&(a.className=s),o&&a.setAttribute(VN,o),r&&a.setAttribute("role",r),t)for(const l of Object.keys(t))a.setAttribute(l,t[l]);if(n)if(typeof n=="string")a.textContent=n;else{let l=!0;for(const c of n)c&&(typeof c=="string"?(a.appendChild(document.createTextNode(c)),l=!1):typeof c=="function"?a.appendChild(c()):(l&&(a.appendChild(BN()),l=!1),a.append(Uf(c)),a.appendChild(BN())))}return a}var Roe=["touchstart","touchend","touchmove","touchcancel","scroll"],Doe=["wheel"],RE={},$N=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return n=>{if(typeof RE[n]=="boolean")return RE[n];const s=document.createElement(e[n]||"div");return n="on"+n,RE[n]=n in s}})();function Toe(e,t){return!t||!e?!1:xoe(t).indexOf(e)>=0}function Ioe(e){const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentElement;return t}function xoe(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():Ioe(t)}function Foe(e,t,n){const s=Poe(t);let o;s!=null&&(o={passive:s}),e.addEventListener(t,n,o)}var Poe=e=>{const t=Roe.includes(e),n=Doe.includes(e);if(t)return!0;if(n)return!1};function HN(e,t,n){if(n===0)return!1;const s=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(s,o)<=n}var Wf=(e,t)=>{const n=e.identifier;for(let s=0,o=t.length;s<o;++s){const r=t[s];if(r.identifier===n)return r}return null};function zf(e,t){return e.gos.isElementInThisInstance(t.target)}function Aoe(e,t,n){const o=e.getBoundingClientRect().height,r=soe(n)-2,i=ooe(n)-2;if(!e.offsetParent)return;const l=kN(e.offsetParent),{clientY:c,clientX:u}=t;let d=c-l.top-o/2,h=u-l.left-10;const f=Ds(n),p=f.defaultView||window,g=p.pageYOffset||f.documentElement.scrollTop,v=p.pageXOffset||f.documentElement.scrollLeft;r>0&&h+e.clientWidth>r+v&&(h=r+v-e.clientWidth),h<0&&(h=0),i>0&&d+e.clientHeight>i+g&&(d=i+g-e.clientHeight),d<0&&(d=0),e.style.left=`${h}px`,e.style.top=`${d}px`}var Ov=(e,...t)=>{for(const n of t){const[s,o,r,i]=n;s.addEventListener(o,r,i),e.push(n)}},DE=e=>{if(e){for(const[t,n,s,o]of e)t.removeEventListener(n,s,o);e.length=0}},nl=e=>{e.cancelable&&e.preventDefault()};function koe(e,t){return t}function GN(e){return(e==null?void 0:e.getLocaleTextFunc())??koe}function Ooe(e,t,n,s){const o=t[n];return e.getLocaleTextFunc()(n,typeof o=="function"?o(s):o,s)}function Moe(e){return(t,n,s)=>e({key:t,defaultValue:n,variableValues:s})}function Noe(e){return(t,n,s)=>{let o=e==null?void 0:e[t];if(o&&(s!=null&&s.length)){let r=0;for(;!(r>=s.length||o.indexOf("${variable}")===-1);)o=o.replace("${variable}",s[r++])}return o??n}}var wi=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,n){this.localEventService||(this.localEventService=new fc),this.localEventService.addEventListener(e,t,n)}removeEventListener(e,t,n){var s;(s=this.localEventService)==null||s.removeEventListener(e,t,n)}dispatchLocalEvent(e){var t;(t=this.localEventService)==null||t.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventSvc,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const n=[];for(const s of Object.keys(t)){const o=t[s];o&&n.push(this._setupListener(e,s,o))}return n}_setupListener(e,t,n){if(this.destroyed)return()=>null;let s;if(Loe(e))e.__addEventListener(t,n),s=()=>(e.__removeEventListener(t,n),null);else{const o=Voe(e);e instanceof HTMLElement?Foe(e,t,n):o?e.addListener(t,n):e.addEventListener(t,n),s=o?()=>(e.removeListener(t,n),null):()=>(e.removeEventListener(t,n),null)}return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),null)}setupPropertyListener(e,t){const{gos:n}=this;n.addPropertyEventListener(e,t);const s=()=>(n.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const n=e.join("-")+this.propertyListenerId++,s=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[n])return;this.lastChangeSetIdLookup[n]=o.changeSet.id}const r={type:"propertyChanged",changeSet:o.changeSet,source:o.source};t(r)};for(const o of e)this.setupPropertyListener(o,s)}getLocaleTextFunc(){return GN(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const n=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),n}createBean(e,t,n){return(t||this.stubContext).createBean(e,n)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function Loe(e){return e.__addEventListener!==void 0}function Voe(e){return e.eventServiceType==="global"}var We=class extends wi{},UN={};function TE(e,t){UN[t]||(e(),UN[t]=!0)}var Boe={pending:!1,funcs:[]},$oe={pending:!1,funcs:[]};function IE(e,t="setTimeout",n){const s=t==="raf"?$oe:Boe;if(s.funcs.push(e),s.pending)return;s.pending=!0;const o=()=>{const r=s.funcs.slice();s.funcs.length=0,s.pending=!1;for(const i of r)i()};t==="raf"?aa(n,o):window.setTimeout(o,0)}function Os(e,t,n){let s;return function(...o){const r=this;window.clearTimeout(s),s=window.setTimeout(function(){e.isAlive()&&t.apply(r,o)},n)}}function WN(e,t){let n=0;return function(...s){const o=this,r=Date.now();r-n<t||(n=r,e.apply(o,s))}}function Hoe(e,t,n,s=100){const o=Date.now();let r=null,i=!1;const a=()=>{r!=null&&(window.clearInterval(r),r=null)};e.addDestroyFunc(a);const l=()=>{const c=Date.now()-o>s;(t()||c)&&(n(),i=!0,a())};l(),i||(r=window.setInterval(l,10))}var zN=new Set(["__proto__","constructor","prototype"]);function Goe(e,t){if(e!=null){if(Array.isArray(e)){for(let n=0;n<e.length;n++)t(n.toString(),e[n]);return}for(const n of Object.keys(e).filter(s=>!zN.has(s)))t(n,e[n])}}function so(e,t,n=!0,s=!1){ht(t)&&Goe(t,(o,r)=>{let i=e[o];i!==r&&(s&&i==null&&r!=null&&typeof r=="object"&&r.constructor===Object&&(i={},e[o]=i),jN(r)&&jN(i)&&!Array.isArray(i)?so(i,r,n,s):(n||r!==void 0)&&(e[o]=r))})}function jN(e){return typeof e=="object"&&e!==null}var xE=class Ea{static applyGlobalGridOptions(t){if(!Ea.gridOptions)return{...t};let n={};return so(n,Ea.gridOptions,!0,!0),Ea.mergeStrategy==="deep"?so(n,t,!0,!0):n={...n,...t},Ea.gridOptions.context&&(n.context=Ea.gridOptions.context),t.context&&(Ea.mergeStrategy==="deep"&&n.context&&so(t.context,n.context,!0,!0),n.context=t.context),n}static applyGlobalGridOption(t,n){if(Ea.mergeStrategy==="deep"){const s=Uoe(t);if(s&&typeof s=="object"&&typeof n=="object")return Ea.applyGlobalGridOptions({[t]:n})[t]}return n}};xE.gridOptions=void 0,xE.mergeStrategy="shallow";var FE=xE;function Uoe(e){var t;return(t=FE.gridOptions)==null?void 0:t[e]}var Woe={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,rowNumbers:!1,enableFilterHandlers:!1},KN="https://www.ag-grid.com";function sl(e,t,...n){e.get("debug")&&console.log("AG Grid: "+t,...n)}function jf(e,...t){TE(()=>console.warn("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function rd(e,...t){TE(()=>console.error("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}var qN=new Set,Mv={},id={},Nv,YN=!1,XN=!1,zoe=!1;function joe(e){const[t,n]=e.version.split(".")||[],[s,o]=Nv.split(".")||[];return t===s&&n===o}function Koe(e){var s;Nv||(Nv=e.version);const t=o=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${o} Please update all modules to the same version.`;e.version?joe(e)||rd(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${Nv}.`)):rd(t(`'${e.moduleName}' is incompatible.`));const n=(s=e.validate)==null?void 0:s.call(e);n&&!n.isValid&&rd(`${n.message}`)}function Kf(e,t,n=!1){n||(YN=!0),Koe(e);const s=e.rowModels??["all"];qN.add(e);let o;t!==void 0?(XN=!0,id[t]===void 0&&(id[t]={}),o=id[t]):o=Mv;for(const r of s)o[r]===void 0&&(o[r]={}),o[r][e.moduleName]=e;if(e.dependsOn)for(const r of e.dependsOn)Kf(r,t,n)}function qoe(e){delete id[e]}function PE(e,t,n){const s=o=>{var r,i,a;return!!((r=Mv[o])!=null&&r[e])||!!((a=(i=id[t])==null?void 0:i[o])!=null&&a[e])};return s(n)||s("all")}function AE(){return XN}function Yoe(e,t){const n=id[e]??{};return[...Object.values(Mv.all??{}),...Object.values(n.all??{}),...Object.values(Mv[t]??{}),...Object.values(n[t]??{})]}function Xoe(){return new Set(qN)}function Zoe(){return YN}function Joe(){return zoe}var Qoe=class{static register(e){Kf(e,void 0)}static registerModules(e){for(const t of e)Kf(t,void 0)}},ut="34.3.1",ZN=2e3,JN=100,QN="_version_",Lv=null,ad=`${KN}/javascript-data-grid`;function ere(e){Lv=e}function tre(e){ad=e}function eL(e,t,n){return(Lv==null?void 0:Lv(e,t))??[rre(e,t,n)]}function kE(e,t,n,s,o){e(`${s?"warning":"error"} #${t}`,...eL(t,n,o))}function nre(e){if(!e)return String(e);const t={};for(const n of Object.keys(e))typeof e[n]!="object"&&typeof e[n]!="function"&&(t[n]=e[n]);return JSON.stringify(t)}function sre(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=nre(e)),t}function Vv(e){return e===void 0?"undefined":e===null?"null":e}function OE(e,t){return`${e}?${t.toString()}`}function ore(e,t,n){const s=Array.from(t.entries()).sort((r,i)=>i[1].length-r[1].length);let o=OE(e,t);for(const[r,i]of s){if(r===QN)continue;const a=o.length-n;if(a<=0)break;const l="...",c=a+l.length,u=i.length-c>JN?i.slice(0,i.length-c)+l:i.slice(0,JN)+l;t.set(r,u),o=OE(e,t)}return o}function tL(e,t){const n=new URLSearchParams;if(n.append(QN,ut),t)for(const r of Object.keys(t))n.append(r,sre(t[r]));const s=`${ad}/errors/${e}`,o=OE(s,n);return o.length<=ZN?o:ore(s,n,ZN)}var rre=(e,t,n)=>{const s=tL(e,t);return`${`${n?n+`
199
+ Refresh to see updates.`),3)],64)):Ze("",!0)],2))}}),[["__cssModules",{$style:{"inform-layout":"_inform-layout_16bpq_1","import-error":"_import-error_16bpq_11","step-title":"_step-title_16bpq_22","step-description":"_step-description_16bpq_27"}}]]),hN=Et(ot({__name:"DateRule",setup(e){const n=(()=>{const o=(h,f,p,g)=>{const v=document.createElement("span");return v.textContent=h,v.style.fontWeight=f,v.style.fontSize=p,v.style.color=g,v},r=document.createElement("div");r.style.display="flex",r.style.flexDirection="column";const i=document.createElement("div"),a=document.createElement("div"),l=o("Valid formats:","normal","14px","#02C39A"),c=o("Invalid formats:","normal","14px","#FF5200"),u=o(" 2025.12.31, 2025-12-31, 2025/12/31 ","normal","14px",""),d=o(" 12.31.2025, 2025.31.12","normal","14px","");return i.appendChild(l),i.appendChild(u),a.appendChild(c),a.appendChild(d),r.appendChild(i),r.appendChild(a),r.outerHTML})(),s=qt;return(o,r)=>(z(),le("div",{class:J(o.$style["date-format-guide"])},[we("span",{class:J(o.$style["step-title-2"])},[r[0]||(r[0]=tt(" Date format guide ",-1)),Ke(he(G(at),{src:"InfoCircle",color:"#A6A6A6"},null,512),[[G(s),{content:G(n)}]])],2),we("div",{class:J(o.$style["date-rule-section"])},[r[3]||(r[3]=we("span",null,"Enter dates in one of these formats:",-1)),we("ul",{class:J(o.$style["step-description"])},[we("li",{class:J(o.$style["date-rule"])},[...r[1]||(r[1]=[we("b",null,"DD MM YYYY",-1),tt(" (Day-Month-Year) ",-1)])],2),we("li",{class:J(o.$style["date-rule"])},[...r[2]||(r[2]=[we("b",null,"YYYY MM DD",-1),tt(" (Year-Month-Day) ",-1)])],2)],2)],2)],2))}}),[["__cssModules",{$style:{"date-format-guide":"_date-format-guide_1clky_1","step-title-2":"_step-title-2_1clky_13","date-rule-section":"_date-rule-section_1clky_25","step-description":"_step-description_1clky_29","date-rule":"_date-rule_1clky_25"}}]]);function fN(e,t,n){return(t=Ose(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ose(e){var t=kse(e,"string");return typeof t=="symbol"?t:t+""}function Rv(e){"@babel/helpers - typeof";return Rv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rv(e)}var kf=function(e){return e.TOOLBOX_EXPORT_DATA="TOOLBOX_EXPORT_DATA",e.SW_APP_LOADER="SW_APP_LOADER",e}({});function pN(e){return Rv(e)==="object"&&e!==null&&!Array.isArray(e)}function gN(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(s){return n.includes(s)})}function Mse(e){return typeof Blob<"u"&&e instanceof Blob}var Nse=function(t){return pN(t)&&gN(t,["file","fileName"])&&Mse(t.file)&&typeof t.fileName=="string"},Lse=function(t){return pN(t)&&gN(t,["scene_id","people_id","openGS","queryParams"])&&(typeof t.scene_id=="string"||t.scene_id===null)&&(typeof t.people_id=="string"||t.people_id===null)&&(typeof t.openGS=="boolean"||t.openGS===null)&&typeof t.queryParams=="string"},Vse=Object.freeze(fN(fN({},kf.TOOLBOX_EXPORT_DATA,Nse),kf.SW_APP_LOADER,Lse));function Bse(e){return Rv(e)==="object"&&e!==null&&!Array.isArray(e)}function $se(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(s){return n.includes(s)})}function Hse(e){if(!Bse(e))return{valid:!1,reason:"Message must be an object."};if(e.version!==1)return{valid:!1,reason:"Unsupported or missing message version."};if(typeof e.type!="string"||!Object.values(kf).includes(e.type))return{valid:!1,reason:"Unknown or missing message type."};if(e.id!==void 0&&typeof e.id!="string")return{valid:!1,reason:"Message id must be a string when provided."};var t=e.id===void 0?["version","type","payload"]:["version","type","payload","id"];if(!$se(e,t))return{valid:!1,reason:"Message contains missing or unexpected fields."};var n=e.type;return Vse[n](e.payload)?{valid:!0,message:e}:{valid:!1,reason:"Payload does not match the ".concat(n," schema.")}}function mN(e){var t=e.target,n=e.allowedOrigins,s=e.onMessage,o=e.onInvalidMessage,r=t??(typeof window>"u"?void 0:window);if(!r)throw new TypeError("A target window is required outside a browser environment.");if(!Array.isArray(n)||n.length===0)throw new TypeError("At least one allowed message origin must be configured.");if(n.some(function(a){return typeof a!="string"||a.length===0||a==="*"}))throw new TypeError("Allowed message origins must be explicit origin strings; wildcards are not allowed.");if(typeof s!="function")throw new TypeError("An onMessage callback is required.");var i=function(l){if(!n.includes(l.origin)){o==null||o(l.data,"Untrusted message origin: ".concat(l.origin),l);return}var c=Hse(l.data);if(c.valid===!1){o==null||o(l.data,c.reason,l);return}s(c.message,l)};return r.addEventListener("message",i),function(){return r.removeEventListener("message",i)}}const Gse={key:1},Use=Et(ot({__name:"PopupCreateScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=B(null),o=e,r=()=>{s.value&&s.value.show()},i=B(""),a=B("idle"),l=Y(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Create new work"})[a.value]),c=B(null),u=B({file:null,format:null}),{apiServices:d}=ns(!1,o),h=async I=>{var O,$;if(((O=d==null?void 0:d.value)==null?void 0:O.getTemplateFlowStatuses)===void 0){console.error("API services not available",($=d==null?void 0:d.value)==null?void 0:$.getTemplateFlowStatuses);return}return await d.value.getTemplateFlowStatuses({workspaceId:o.workspaceId,entityId:o.entityId,...I})},f=Sn("switchInstance"),p=B(!1),g=()=>{f?f("xlsx_toolbox","",{showLoad:!1}):window.appManager.switchInstance("xlsx_toolbox","",{showLoad:!1}),console.log("Toolbox opened")},v=async()=>{p.value=!0;const I=o.workspaceId,M=o.entityId;if(!I||!M||!d.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await d.value.downloadTemplate(I,M))throw new Error("No response from downloadTemplate API")}catch(O){console.error("Error downloading template:",O)}p.value=!1},C=async I=>{var $,Z,Q;const M=new FormData,O=(($=I.name.split(".").pop())==null?void 0:$.toString())||"";if(M.append("file",I),M.append("format",O),M.append("entity_id",o.entityId||""),M.append("template_flow_status_id",T.value||""),!d.value||!o.workspaceId||!o.entityId){console.error("API services not available");return}try{await d.value.addNewSceneViaImportFile(o.workspaceId,o.entityId,M),S()}catch(se){throw console.error("Error uploading file:",se),b(((Q=(Z=se.response)==null?void 0:Z.data)==null?void 0:Q.message)||"An unknown error occurred during file upload."),se}},S=()=>{a.value="success"},b=I=>{i.value=I,a.value="error"},w=n,D=()=>{w("import-success"),E()},R=async()=>{if(!u.value||!u.value.file){console.error("No file to upload");return}a.value="importing",await C(u.value.file)};t({open:r});const T=B(null),F=Y(()=>!u.value.file||!u.value.format||!u.value.isValid||!T.value),x=B(null),P=()=>{var I,M;(I=c.value)==null||I.clear(),i.value="",u.value={file:null,format:null},T.value=null,(M=x==null?void 0:x.value)==null||M.clear(),a.value="idle"},E=()=>{var I;P(),(I=s.value)==null||I.hide()};let k;return sn(()=>{const I=sessionStorage.getItem("BASE_URL");k=mN({target:window,allowedOrigins:[I||"https://app.arbocollab.com"],onMessage:(M,O)=>{var Z;if(console.log("PopupCreateScenes: Received message:",M),M.type!==kf.SW_APP_LOADER)return;console.log("Received from:",O.origin),console.log("File name:",M.payload.fileName);const $=M.payload.file;(Z=c.value)==null||Z.setFile($)},onInvalidMessage:(M,O,$)=>{console.warn("Rejected postMessage:",O,$.origin)}}),console.log("Listening for messages initialized")}),es(()=>{k==null||k()}),(I,M)=>(z(),je(G(jk),{"popup-name":l.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:P},nh({default:ge(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(z(),je(dN,{key:0,state:a.value,"error-message":i.value},null,8,["state","error-message"])):(z(),le("div",Gse,[we("div",{class:J(I.$style["step-section"])},[we("span",{class:J(I.$style["step-title"])},"Step 1: Download sample file",2),we("span",{class:J(I.$style["step-description"])}," Get a sample file with all columns ready for editing. ",2),we("div",{class:J(I.$style["actions-section"])},[he(G(ct),{class:J(I.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:p.value,onHandleClick:v},{prefix:ge(()=>[he(G(at),{src:"Download"})]),default:ge(()=>[M[2]||(M[2]=tt(" Download sample file ",-1))]),_:1},8,["class","disabled"]),he(G(ct),{class:J(I.$style["download-sample-btn"]),size:12,variant:"secondary",onHandleClick:g},{default:ge(()=>[...M[3]||(M[3]=[tt(" Toolbox ",-1)])]),_:1},8,["class"])],2)],2),we("div",{class:J(I.$style["step-section"])},[we("span",{class:J(I.$style["step-title"])},"Step 2: Upload your file (.xlsx, .xls, .csv)",2),he(G(PO),{modelValue:u.value,"onUpdate:modelValue":M[0]||(M[0]=O=>u.value=O),ref_key:"filUploaderRef",ref:c},null,8,["modelValue"])],2),we("div",{class:J(I.$style["step-section"])},[we("span",{class:J(I.$style["step-title"])},"Step 3: Select status",2),we("span",{class:J(I.$style["step-description"])},"Choose a status for the new work.",2),he(G(tee),{ref_key:"statusRef",ref:x,modelValue:T.value,"onUpdate:modelValue":M[1]||(M[1]=O=>T.value=O),"get-status-func":h,"workspace-id":o.workspaceId,id:o.entityId},null,8,["modelValue","workspace-id","id"])],2),we("div",{class:J(I.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[he(hN)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:ge(()=>[he(G(ct),{style:{flex:"1"},variant:"secondary",onClick:E},{default:ge(()=>[...M[4]||(M[4]=[tt(" Cancel ",-1)])]),_:1}),he(G(ct),{disabled:F.value,style:{flex:"1"},variant:"primary",onClick:R},{default:ge(()=>[...M[5]||(M[5]=[tt(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ge(()=>[he(G(ct),{style:{flex:"1"},variant:"primary",onClick:D},{default:ge(()=>[...M[6]||(M[6]=[tt(" Close ",-1)])]),_:1})]),key:"1"}:a.value=="error"?{name:"footer",fn:ge(()=>[he(G(ct),{style:{flex:"1"},variant:"primary",onClick:P},{default:ge(()=>[...M[7]||(M[7]=[tt(" Try Again ",-1)])]),_:1})]),key:"2"}:void 0]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_1ypsy_1","step-title":"_step-title_1ypsy_11","step-title-2":"_step-title-2_1ypsy_17","step-description":"_step-description_1ypsy_23","actions-section":"_actions-section_1ypsy_28","date-format-guide":"_date-format-guide_1ypsy_34","import-error":"_import-error_1ypsy_45","drop-area":"_drop-area_1ypsy_55","is-dragging":"_is-dragging_1ypsy_55","drop-area-content":"_drop-area-content_1ypsy_58",browse:"_browse_1ypsy_67","download-sample-btn":"_download-sample-btn_1ypsy_71"}}]]),vN={text:za,id:void 0,assignees:dJ,status:bJ,dateRange:hJ,isStarted:za,isCompleted:za,lastUpdated:za,completedOn:za,isDeleted:za,isArchived:za,isProcessing:za,name:Gk,options:DY,metric:Wk,__checkboxSelection:void 0,description:qee},Wse={text:!1,id:!1,assignees:!0,status:!0,dateRange:!0,isStarted:!1,isCompleted:!1,lastUpdated:!1,completedOn:!1,isDeleted:!1,isArchived:!1,isProcessing:!1,name:!1,options:!0,metric:!1,__checkboxSelection:!1,description:!1},zse={text:null,id:void 0,assignees:WA,status:$k,dateRange:fJ,isStarted:void 0,isCompleted:void 0,lastUpdated:void 0,completedOn:void 0,isDeleted:void 0,isArchived:void 0,isProcessing:void 0,name:Gk,options:Hk,metric:void 0,__checkboxSelection:void 0,description:void 0},jse={id:[100,100],assignees:[200,200],status:[200,200],dateRange:[255,255],isStarted:[150,150],isCompleted:[150,150],lastUpdated:[180,180],completedOn:[180,180],isDeleted:[void 0,void 0],isArchived:[void 0,void 0],isProcessing:[void 0,void 0],name:[350,500],options:[50,50],metric:[200,300],__checkboxSelection:[50,50],text:[200,300],description:[200,300]},Kse={dateRange:{cellEditorPopupPosition:"under",cellEditorPopup:!1},name:{cellEditorPopupPosition:"over",cellEditor:!1,cellEditorPopup:!1},metric:{suppressKeyboardEvent:void 0,suppressNavigable:!1,suppressMovable:!1,cellClass:"ag-cell-optimized",editable:!0}},qse=e=>{var t,n,s;if(e){if(Number((t=e.metric_type)==null?void 0:t.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number((n=e.metric_type)==null?void 0:n.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number((s=e.metric_type)==null?void 0:s.id)==3)return}},nd=e=>{if(e)return qse(e)};function yN(e,t){var o,r,i,a;const n=(o=t==null?void 0:t.data)==null?void 0:o.permissions;let s={disabled:!1,readOnly:!1,type:void 0};if(!t||!e)s={disabled:!1,readOnly:!0,type:void 0};else if(e==="options")s={disabled:!1,readOnly:!1,type:void 0};else if(e!=null&&e.includes("metric")){const l=`metric_permission_${e==null?void 0:e.replace("metric_","")}`;s={disabled:!1,readOnly:!((t==null?void 0:t.data)&&t.data[l]&&((r=t.data[l])==null?void 0:r.permission)==2&&!((i=t.colDef)!=null&&i.context.formula)&&!t.data.isLocked&&!t.data.isDeleted),type:nd((a=t.colDef)==null?void 0:a.context)}}else{const c={assignees:(n==null?void 0:n.has_update_assignee_permission)??0,completedOn:0,name:(n==null?void 0:n.has_edit_permission)??0,permissions:0,status:(n==null?void 0:n.has_edit_template_flow_status_permission)??0,dateRange:(n==null?void 0:n.has_edit_date_permission)??0,isStarted:0,isDeleted:0,isArchived:0,isLocked:0,isProcessing:0,lastUpdated:0,id:0,isCompleted:0,options:1,disabled:0,description:(n==null?void 0:n.has_edit_permission)??0}[e]??0;s={disabled:c===-1,readOnly:c!==1,type:void 0}}return s}class gE{constructor(){Qn(this,"eGui");Qn(this,"params")}init(t){this.params=t}getGui(){var n,s,o,r,i;const t=document.createElement("div");return(n=this.params)!=null&&n.height&&t.style.setProperty("--height",(s=this.params)==null?void 0:s.height),(o=this.params)!=null&&o.width?t.style.setProperty("--width",(r=this.params)==null?void 0:r.width):(i=this.params)!=null&&i.fullwidth?t.style.setProperty("--width","100%"):t.style.setProperty("--width",`${Math.floor(Math.random()*50)+50}%`),t.className="ag-cell-skeleton",t.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation()}),this.eGui=t,t}refresh(t){return!1}getValue(){var t;return(t=this.params)==null?void 0:t.value}isPopup(t){return!1}getPopupPosition(){}destroy(){}}const wN=new Map;class Of{static initialize(t){this.wrappers=t}static getWrappers(){if(!this.wrappers)throw new Error("CellRendererFactory: Not initialized. Please call CellRendererFactory.initialize() first.");return this.wrappers}static buildCommonCellParams(t,n){var c,u,d;const s=t.data||((c=t.node)==null?void 0:c.data),o=(u=t.colDef)==null?void 0:u.field,r=o&&s?s[o]:void 0,i=yN((d=t.colDef)==null?void 0:d.field,t),a=typeof n=="function"?n(t):n??{};return{...t,value:r,disabled:i==null?void 0:i.disabled,readOnly:i==null?void 0:i.readOnly,type:nd(t.context),...a}}static resolveRendererComponent(t,n){let s;return t.includes("metric")&&vN.metric?nd(n)==="rating"?s=Gee:s=Wk:s=vN[t]??void 0,s}static resolveEditorComponent(t,n){const s=t.includes("metric");let o;const r=nd(n);return s&&["number","dropdown"].includes(r)?o=see:o=zse[t],o}static canEditField(t,n){var r;if(n.data===void 0)return!1;const s=yN((r=n.colDef)==null?void 0:r.field,n),o=Wse[t]??!0;return!(s!=null&&s.disabled)&&!(s!=null&&s.readOnly)&&o&&(s==null?void 0:s.type)!=="rating"}static resolveSize(t){const[n=250,s=300]=jse[t]??[];return{minWidth:n,maxWidth:s}}static buildHeaderComponentParams(t){return n=>typeof t=="function"?t(n):t??{}}static fromType(t){const{wrapVueCellEditor:n}=this.getWrappers(),s=String(t.field??""),o=this.resolveSize(s),r=Kse[s]??{},i=nd(t.context),a=i==="number"||i==="rating",l=i=="rating"?t.context.range*24+20:o.minWidth;return{...t,headerName:t.headerName,...o,...t,cellEditorSelector:u=>{const d=this.resolveEditorComponent(s,t.context);return{component:n(d),params:this.buildCommonCellParams(u,t.cellRendererParams),popup:!a}},singleClickEdit:!0,cellEditorPopup:!a,cellEditorPopupPosition:a?void 0:"under",editable:u=>{let d;return u.data===void 0||u.data.isDeleted||u.node.data===void 0?d=!1:d=this.canEditField(s,u),d},minWidth:l,cellRendererSelector:u=>Yse(u,{component:n(this.resolveRendererComponent(s,t.context)),params:this.buildCommonCellParams(u,t.cellRendererParams)}),headerComponentParams:this.buildHeaderComponentParams(t.headerComponentParams),...r,cellClass:u=>`${i}--${u.colDef.field}`}}}Qn(Of,"wrappers",null);const Yse=(e,t)=>{var o;const n=(o=e.colDef)==null?void 0:o.field,s=`${n}-${e.node.rowIndex}`;return wN.set(s,(wN.get(s)??0)+1),n!=null&&n.includes("metric")?e.value===void 0?{component:gE,params:{fullwidth:!1}}:t:e.data&&e.value!==void 0?t:!n||n==="options"||n==="__checkboxSelection"?e.data?t:{component:gE,params:{fullwidth:!0,width:"24px",height:"24px"}}:!e.data||e.value===void 0?{component:gE,params:{fullwidth:!1}}:t},Xse=Et(ot({__name:"Vue3Wrapper",props:{component:{},params:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},tooltip:{},isNoData:{type:Boolean,default:!1},workspaceId:{},entityId:{},axiosService:{},isSearching:{type:Boolean,default:!1},isFiltering:{type:Boolean,default:!1},sortType:{default:"default"},maxRating:{default:5},config:{}},setup(e,{expose:t}){const n=e,s=B(null),o=Y(()=>{var a;return((a=n.component)==null?void 0:a.name)||"UnknownComponent"}),r=Y(()=>{var a;return((a=n.component)==null?void 0:a.default)||n.component}),i=Y(()=>({params:n.params,disabled:n.disabled,readOnly:n.readOnly,value:n.value,maxRating:n.maxRating,data:n.data,id:n.id,workspaceId:n.workspaceId,entityId:n.entityId,axiosService:n.axiosService,tooltip:n.tooltip,isSearching:n.isSearching,isFiltering:n.isFiltering,isNoData:n.isNoData,config:n.config}));return t({focus:()=>{var a;return(a=s.value)!=null&&a.focus?s.value.focus():console.warn(`Component ${o.value} does not have a focus method.`),!0},blur:()=>{var a,l;return(l=(a=s.value)==null?void 0:a.blur)==null||l.call(a),!0},trigger:(a,l)=>{var c;return(c=s.value)==null||c.$emit(a,l),!0}}),(a,l)=>{const c=eD("loading-skeleton");return z(),le(xt,null,[(z(),je(bw(r.value),Kt(i.value,{ref_key:"componentRef",ref:s}),null,16)),he(c)],64)}}}),[["__cssModules",{$style:{skeleton:"_skeleton_7xde7_1",shimmer:"_shimmer_7xde7_16","skeleton-loading":"_skeleton-loading_7xde7_1"}}]]);function Zse(e){return"stopEditing"in e}const Jse=8,Qse=e=>{if(!e)return;const t=e.__vueParentComponent,n=t==null?void 0:t.exposed;n&&typeof n.triggerFocus=="function"?n.triggerFocus():e.focus()};function CN(e){return class{constructor(){Qn(this,"container");Qn(this,"vNode",null);Qn(this,"componentInstance",null);Qn(this,"componsenExposed",null);Qn(this,"params");Qn(this,"isEditor",!1);Qn(this,"_destroyed",!1)}init(n){var l,c,u,d;if(!n){console.error("[Vue3CellWrapper] Missing params");return}const s=performance.now();this.params=n,this.isEditor=Zse(n),this.container=document.createElement("div"),this.container.classList.add("ag-vue3-cell-wrapper"),this.container.style.width="100%",this.container.style.height="100%";const o=n.context.apiClass,r=n,i={component:e,params:Object.freeze(n),disabled:!1,readOnly:r.readOnly??!1,value:n.value,maxRating:r.maxRating??void 0,data:n.data,id:(l=n==null?void 0:n.data)==null?void 0:l.id,workspaceId:n.context.workspaceId,entityId:n.context.entityId,axiosService:o,tooltip:r.tooltip??void 0,isSearching:r.isSearching??!1,isFiltering:r.isFiltering??!1,isNoData:r.isNoData??!1,config:r.config,sceneId:(r==null?void 0:r.sceneId)||void 0};this.vNode=he(Xse,i),Kw(this.vNode,this.container);const a=performance.now()-s;a>Jse&&console.warn(`[Vue3CellWrapper] Slow render (${a.toFixed(1)}ms) for "${(c=n.colDef)==null?void 0:c.field}"`),this.componentInstance=(u=this.vNode.component)==null?void 0:u.proxy,this.componsenExposed=(d=this.vNode.component)==null?void 0:d.exposed}getGui(){return this.container}refresh(n){return!1}focusUi(){var n;(n=this.componsenExposed)!=null&&n.focus?this.componsenExposed.focus():Qse(this.container)}getValue(){var n,s,o;return this.params._editorValue!==void 0?this.params._editorValue:this.componentInstance?((o=(s=this.componentInstance).getValue)==null?void 0:o.call(s))??this.componentInstance.value:(console.warn("[Vue3CellWrapper] getValue() called but component instance not available"),(n=this.params)==null?void 0:n.value)}isPopup(n){var i,a,l,c,u;const s=(l=(a=(i=this.params)==null?void 0:i.colDef)==null?void 0:a.field)==null?void 0:l.includes("metric"),o=((c=this.params)==null?void 0:c.context)&&nd(this.params.context);return s||(o==="number"||o==="rating")||!this.isEditor?!1:(u=this.componentInstance)!=null&&u.isPopup?this.componentInstance.isPopup():!0}getPopupPosition(){var s,o,r;return this.isEditor?(s=this.componentInstance)!=null&&s.getPopupPosition?this.componentInstance.getPopupPosition():((r=(o=this.params)==null?void 0:o.colDef)==null?void 0:r.cellEditorPopupPosition)??"under":void 0}afterGuiAttached(){!this.isEditor||this.componentInstance}destroy(){if(!this._destroyed&&(this._destroyed=!0,!!this.container))try{const n=this.componentInstance;if(n){try{typeof n.$destroy=="function"&&n.$destroy()}catch(o){console.warn("[Vue3CellWrapper] Error during $destroy:",o)}try{typeof n.destroy=="function"&&n.destroy()}catch(o){console.warn("[Vue3CellWrapper] Error during destroy():",o)}}(typeof queueMicrotask=="function"?queueMicrotask:o=>Promise.resolve().then(o))(()=>{try{Kw(null,this.container)}catch(o){console.warn("[Vue3CellWrapper] Error during unmount:",o)}finally{this.container.textContent=""}})}catch(n){console.error("[Vue3CellWrapper] Error during cleanup:",n)}finally{this.vNode=null,this.componentInstance=null}}}}function Dv(e){return CN(e)}function bN(e){return CN(e)}var fc=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,n){const s=t?this.allAsyncListeners:this.allSyncListeners;let o=s.get(e);return!o&&n&&(o=new Set,s.set(e,o)),o}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,n=!1){this.getListeners(e,n,!0).add(t)}removeEventListener(e,t,n=!1){const s=this.getListeners(e,n,!1);s&&(s.delete(t),s.size===0&&(n?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){this.getGlobalListeners(t).add(e)}removeGlobalListener(e,t=!1){this.getGlobalListeners(t).delete(e)}dispatchEvent(e){this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const n=e.type;if(t&&"event"in e){const a=e.event;a instanceof Event&&(e.eventPath=a.composedPath())}const{frameworkOverrides:s}=this,o=a=>{const l=s?()=>s.wrapIncoming(a):a;t?this.dispatchAsync(l):l()},r=this.getListeners(n,t,!1);if(((r==null?void 0:r.size)??0)>0){const a=new Set(r);for(const l of a)r!=null&&r.has(l)&&o(()=>l(e))}const i=this.getGlobalListeners(t);if(i.size>0){const a=new Set(i);for(const l of a)o(()=>l(n,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}};function ia(e){return e==null||e===""?null:e}function ht(e){return e!=null&&e!==""}function Vn(e){return!ht(e)}function mE(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function Mf(e,t){const n=e?JSON.stringify(e):null,s=t?JSON.stringify(t):null;return n===s}function eoe(e,t,n=!1){const s=e==null,o=t==null;if(e!=null&&e.toNumber&&(e=e.toNumber()),t!=null&&t.toNumber&&(t=t.toNumber()),s&&o)return 0;if(s)return-1;if(o)return 1;function r(i,a){return i>a?1:i<a?-1:0}if(typeof e!="string"||!n)return r(e,t);try{return e.localeCompare(t)}catch{return r(e,t)}}var toe=/[&<>"']/g,noe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function sd(e){return(e==null?void 0:e.toString().toString())??null}function Nf(e){var t;return((t=sd(e))==null?void 0:t.replace(toe,n=>noe[n]))??null}function mi(e){return e.eRootDiv.getRootNode()}function Un(e){return mi(e).activeElement}function Ds(e){const{gos:t,eRootDiv:n}=e;let s=null;const o=t.get("getDocument");return o&&ht(o)?s=o():n&&(s=n.ownerDocument),s&&ht(s)?s:document}function SN(e){const t=Un(e);return t===null||t===Ds(e).body}function EN(e){return Ds(e).defaultView||window}function vE(e){let t=null,n=null;try{t=Ds(e).fullscreenElement}catch{}finally{t||(t=mi(e));const s=t.querySelector("body");s?n=s:t instanceof ShadowRoot?n=t:t instanceof Document?n=t==null?void 0:t.documentElement:n=t}return n}function soe(e){const t=vE(e);return(t==null?void 0:t.clientWidth)??(window.innerWidth||-1)}function ooe(e){const t=vE(e);return(t==null?void 0:t.clientHeight)??(window.innerHeight||-1)}function Vr(e,t,n){n==null||typeof n=="string"&&n==""?_N(e,t):lr(e,t,n)}function lr(e,t,n){e.setAttribute(RN(t),n.toString())}function _N(e,t){e.removeAttribute(RN(t))}function RN(e){return`aria-${e}`}function el(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function roe(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function ioe(e){return e.getAttribute("aria-label")}function od(e,t){Vr(e,"label",t)}function Lf(e,t){Vr(e,"labelledby",t)}function DN(e,t){Vr(e,"live",t)}function aoe(e,t){Vr(e,"atomic",t)}function loe(e,t){Vr(e,"relevant",t)}function coe(e,t){Vr(e,"invalid",t)}function uoe(e,t){Vr(e,"disabled",t)}function TN(e,t){Vr(e,"hidden",t)}function yE(e,t){lr(e,"expanded",t)}function doe(e,t){lr(e,"setsize",t)}function hoe(e,t){lr(e,"posinset",t)}function foe(e,t){lr(e,"multiselectable",t)}function poe(e,t){lr(e,"rowcount",t)}function Tv(e,t){lr(e,"rowindex",t)}function goe(e,t){lr(e,"rowspan",t)}function moe(e,t){lr(e,"colcount",t)}function IN(e,t){lr(e,"colindex",t)}function voe(e,t){lr(e,"colspan",t)}function yoe(e,t){lr(e,"sort",t)}function woe(e){_N(e,"sort")}function xN(e,t){Vr(e,"selected",t)}function Coe(e,t){Vr(e,"controls",t)}function boe(e,t){Coe(e,t.id),Lf(t,e.id)}function FN(e,t){Vr(e,"owns",t)}function Iv(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var Soe="[tabindex], input, select, button, textarea, [href]",PN="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Vf(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(PN)?!1:vi(e)}function Bn(e,t,n={}){const{skipAriaHidden:s}=n;e.classList.toggle("ag-hidden",!t),s||TN(e,!t)}function Eoe(e,t,n={}){const{skipAriaHidden:s}=n;e.classList.toggle("ag-invisible",!t),s||TN(e,!t)}function Bf(e,t){const n="disabled",s=t?r=>r.setAttribute(n,""):r=>r.removeAttribute(n);s(e);const o=e.querySelectorAll("input")??[];for(const r of o)s(r)}function pc(e,t,n){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof n=="number"){if(++s>n)break}else if(e===n)break}return!1}function gc(e){const{height:t,width:n,borderTopWidth:s,borderRightWidth:o,borderBottomWidth:r,borderLeftWidth:i,paddingTop:a,paddingRight:l,paddingBottom:c,paddingLeft:u,marginTop:d,marginRight:h,marginBottom:f,marginLeft:p,boxSizing:g}=window.getComputedStyle(e),v=Number.parseFloat;return{height:v(t||"0"),width:v(n||"0"),borderTopWidth:v(s||"0"),borderRightWidth:v(o||"0"),borderBottomWidth:v(r||"0"),borderLeftWidth:v(i||"0"),paddingTop:v(a||"0"),paddingRight:v(l||"0"),paddingBottom:v(c||"0"),paddingLeft:v(u||"0"),marginTop:v(d||"0"),marginRight:v(h||"0"),marginBottom:v(f||"0"),marginLeft:v(p||"0"),boxSizing:g}}function wE(e){const t=gc(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function $f(e){const t=gc(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function AN(e){const{height:t,marginBottom:n,marginTop:s}=gc(e);return Math.floor(t+n+s)}function xv(e){const{width:t,marginLeft:n,marginRight:s}=gc(e);return Math.floor(t+n+s)}function kN(e){const t=e.getBoundingClientRect(),{borderTopWidth:n,borderLeftWidth:s,borderRightWidth:o,borderBottomWidth:r}=gc(e);return{top:t.top+(n||0),left:t.left+(s||0),right:t.right+(o||0),bottom:t.bottom+(r||0)}}function Fv(e,t){let n=e.scrollLeft;return t&&(n=Math.abs(n)),n}function Pv(e,t,n){n&&(t*=-1),e.scrollLeft=t}function ks(e){for(;e!=null&&e.firstChild;)e.firstChild.remove()}function Br(e){e!=null&&e.parentNode&&e.remove()}function ON(e){return!!e.offsetParent}function vi(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!ON(e)||window.getComputedStyle(e).visibility!=="visible")}function CE(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function MN(e,t,n){n&&n.nextSibling===t||(e.firstChild?n?n.nextSibling?e.insertBefore(t,n.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t):e.appendChild(t))}function NN(e,t){for(let n=0;n<t.length;n++){const s=t[n],o=e.children[n];o!==s&&e.insertBefore(s,o)}}function _oe(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}function Hf(e,t){if(t)for(const n of Object.keys(t)){const s=t[n];if(!(n!=null&&n.length)||s==null)continue;const o=_oe(n),r=s.toString(),i=r.replace(/\s*!important/g,""),a=i.length!=r.length?"important":void 0;e.style.setProperty(o,i,a)}}function Av(e){return()=>{const t=e();return t?bE(t)||LN(t):!0}}function bE(e){return e.clientWidth<e.scrollWidth}function LN(e){return e.clientHeight<e.scrollHeight}function kv(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):yi(e,t)}function yi(e,t){t=SE(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function Gf(e,t){t=SE(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function SE(e){return typeof e=="number"?`${e}px`:e}function EE(e){return e instanceof Node||e instanceof HTMLElement}function Bo(e,t,n){n==null||n===""?e.removeAttribute(t):e.setAttribute(t,n.toString())}function tl(e,t,n){const o=EN(e).ResizeObserver,r=o?new o(n):null;return r==null||r.observe(t),()=>r==null?void 0:r.disconnect()}function aa(e,t){const n=EN(e);n.requestAnimationFrame?n.requestAnimationFrame(t):n.webkitRequestAnimationFrame?n.webkitRequestAnimationFrame(t):n.setTimeout(t,0)}var VN="data-ref",_E;function BN(){return _E??(_E=document.createTextNode(" ")),_E.cloneNode()}function Uf(e){const{attrs:t,children:n,cls:s,ref:o,role:r,tag:i}=e,a=document.createElement(i);if(s&&(a.className=s),o&&a.setAttribute(VN,o),r&&a.setAttribute("role",r),t)for(const l of Object.keys(t))a.setAttribute(l,t[l]);if(n)if(typeof n=="string")a.textContent=n;else{let l=!0;for(const c of n)c&&(typeof c=="string"?(a.appendChild(document.createTextNode(c)),l=!1):typeof c=="function"?a.appendChild(c()):(l&&(a.appendChild(BN()),l=!1),a.append(Uf(c)),a.appendChild(BN())))}return a}var Roe=["touchstart","touchend","touchmove","touchcancel","scroll"],Doe=["wheel"],RE={},$N=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return n=>{if(typeof RE[n]=="boolean")return RE[n];const s=document.createElement(e[n]||"div");return n="on"+n,RE[n]=n in s}})();function Toe(e,t){return!t||!e?!1:xoe(t).indexOf(e)>=0}function Ioe(e){const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentElement;return t}function xoe(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():Ioe(t)}function Foe(e,t,n){const s=Poe(t);let o;s!=null&&(o={passive:s}),e.addEventListener(t,n,o)}var Poe=e=>{const t=Roe.includes(e),n=Doe.includes(e);if(t)return!0;if(n)return!1};function HN(e,t,n){if(n===0)return!1;const s=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(s,o)<=n}var Wf=(e,t)=>{const n=e.identifier;for(let s=0,o=t.length;s<o;++s){const r=t[s];if(r.identifier===n)return r}return null};function zf(e,t){return e.gos.isElementInThisInstance(t.target)}function Aoe(e,t,n){const o=e.getBoundingClientRect().height,r=soe(n)-2,i=ooe(n)-2;if(!e.offsetParent)return;const l=kN(e.offsetParent),{clientY:c,clientX:u}=t;let d=c-l.top-o/2,h=u-l.left-10;const f=Ds(n),p=f.defaultView||window,g=p.pageYOffset||f.documentElement.scrollTop,v=p.pageXOffset||f.documentElement.scrollLeft;r>0&&h+e.clientWidth>r+v&&(h=r+v-e.clientWidth),h<0&&(h=0),i>0&&d+e.clientHeight>i+g&&(d=i+g-e.clientHeight),d<0&&(d=0),e.style.left=`${h}px`,e.style.top=`${d}px`}var Ov=(e,...t)=>{for(const n of t){const[s,o,r,i]=n;s.addEventListener(o,r,i),e.push(n)}},DE=e=>{if(e){for(const[t,n,s,o]of e)t.removeEventListener(n,s,o);e.length=0}},nl=e=>{e.cancelable&&e.preventDefault()};function koe(e,t){return t}function GN(e){return(e==null?void 0:e.getLocaleTextFunc())??koe}function Ooe(e,t,n,s){const o=t[n];return e.getLocaleTextFunc()(n,typeof o=="function"?o(s):o,s)}function Moe(e){return(t,n,s)=>e({key:t,defaultValue:n,variableValues:s})}function Noe(e){return(t,n,s)=>{let o=e==null?void 0:e[t];if(o&&(s!=null&&s.length)){let r=0;for(;!(r>=s.length||o.indexOf("${variable}")===-1);)o=o.replace("${variable}",s[r++])}return o??n}}var wi=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,n){this.localEventService||(this.localEventService=new fc),this.localEventService.addEventListener(e,t,n)}removeEventListener(e,t,n){var s;(s=this.localEventService)==null||s.removeEventListener(e,t,n)}dispatchLocalEvent(e){var t;(t=this.localEventService)==null||t.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventSvc,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const n=[];for(const s of Object.keys(t)){const o=t[s];o&&n.push(this._setupListener(e,s,o))}return n}_setupListener(e,t,n){if(this.destroyed)return()=>null;let s;if(Loe(e))e.__addEventListener(t,n),s=()=>(e.__removeEventListener(t,n),null);else{const o=Voe(e);e instanceof HTMLElement?Foe(e,t,n):o?e.addListener(t,n):e.addEventListener(t,n),s=o?()=>(e.removeListener(t,n),null):()=>(e.removeEventListener(t,n),null)}return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),null)}setupPropertyListener(e,t){const{gos:n}=this;n.addPropertyEventListener(e,t);const s=()=>(n.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const n=e.join("-")+this.propertyListenerId++,s=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[n])return;this.lastChangeSetIdLookup[n]=o.changeSet.id}const r={type:"propertyChanged",changeSet:o.changeSet,source:o.source};t(r)};for(const o of e)this.setupPropertyListener(o,s)}getLocaleTextFunc(){return GN(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const n=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),n}createBean(e,t,n){return(t||this.stubContext).createBean(e,n)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function Loe(e){return e.__addEventListener!==void 0}function Voe(e){return e.eventServiceType==="global"}var We=class extends wi{},UN={};function TE(e,t){UN[t]||(e(),UN[t]=!0)}var Boe={pending:!1,funcs:[]},$oe={pending:!1,funcs:[]};function IE(e,t="setTimeout",n){const s=t==="raf"?$oe:Boe;if(s.funcs.push(e),s.pending)return;s.pending=!0;const o=()=>{const r=s.funcs.slice();s.funcs.length=0,s.pending=!1;for(const i of r)i()};t==="raf"?aa(n,o):window.setTimeout(o,0)}function Os(e,t,n){let s;return function(...o){const r=this;window.clearTimeout(s),s=window.setTimeout(function(){e.isAlive()&&t.apply(r,o)},n)}}function WN(e,t){let n=0;return function(...s){const o=this,r=Date.now();r-n<t||(n=r,e.apply(o,s))}}function Hoe(e,t,n,s=100){const o=Date.now();let r=null,i=!1;const a=()=>{r!=null&&(window.clearInterval(r),r=null)};e.addDestroyFunc(a);const l=()=>{const c=Date.now()-o>s;(t()||c)&&(n(),i=!0,a())};l(),i||(r=window.setInterval(l,10))}var zN=new Set(["__proto__","constructor","prototype"]);function Goe(e,t){if(e!=null){if(Array.isArray(e)){for(let n=0;n<e.length;n++)t(n.toString(),e[n]);return}for(const n of Object.keys(e).filter(s=>!zN.has(s)))t(n,e[n])}}function so(e,t,n=!0,s=!1){ht(t)&&Goe(t,(o,r)=>{let i=e[o];i!==r&&(s&&i==null&&r!=null&&typeof r=="object"&&r.constructor===Object&&(i={},e[o]=i),jN(r)&&jN(i)&&!Array.isArray(i)?so(i,r,n,s):(n||r!==void 0)&&(e[o]=r))})}function jN(e){return typeof e=="object"&&e!==null}var xE=class Ea{static applyGlobalGridOptions(t){if(!Ea.gridOptions)return{...t};let n={};return so(n,Ea.gridOptions,!0,!0),Ea.mergeStrategy==="deep"?so(n,t,!0,!0):n={...n,...t},Ea.gridOptions.context&&(n.context=Ea.gridOptions.context),t.context&&(Ea.mergeStrategy==="deep"&&n.context&&so(t.context,n.context,!0,!0),n.context=t.context),n}static applyGlobalGridOption(t,n){if(Ea.mergeStrategy==="deep"){const s=Uoe(t);if(s&&typeof s=="object"&&typeof n=="object")return Ea.applyGlobalGridOptions({[t]:n})[t]}return n}};xE.gridOptions=void 0,xE.mergeStrategy="shallow";var FE=xE;function Uoe(e){var t;return(t=FE.gridOptions)==null?void 0:t[e]}var Woe={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,rowNumbers:!1,enableFilterHandlers:!1},KN="https://www.ag-grid.com";function sl(e,t,...n){e.get("debug")&&console.log("AG Grid: "+t,...n)}function jf(e,...t){TE(()=>console.warn("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function rd(e,...t){TE(()=>console.error("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}var qN=new Set,Mv={},id={},Nv,YN=!1,XN=!1,zoe=!1;function joe(e){const[t,n]=e.version.split(".")||[],[s,o]=Nv.split(".")||[];return t===s&&n===o}function Koe(e){var s;Nv||(Nv=e.version);const t=o=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${o} Please update all modules to the same version.`;e.version?joe(e)||rd(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${Nv}.`)):rd(t(`'${e.moduleName}' is incompatible.`));const n=(s=e.validate)==null?void 0:s.call(e);n&&!n.isValid&&rd(`${n.message}`)}function Kf(e,t,n=!1){n||(YN=!0),Koe(e);const s=e.rowModels??["all"];qN.add(e);let o;t!==void 0?(XN=!0,id[t]===void 0&&(id[t]={}),o=id[t]):o=Mv;for(const r of s)o[r]===void 0&&(o[r]={}),o[r][e.moduleName]=e;if(e.dependsOn)for(const r of e.dependsOn)Kf(r,t,n)}function qoe(e){delete id[e]}function PE(e,t,n){const s=o=>{var r,i,a;return!!((r=Mv[o])!=null&&r[e])||!!((a=(i=id[t])==null?void 0:i[o])!=null&&a[e])};return s(n)||s("all")}function AE(){return XN}function Yoe(e,t){const n=id[e]??{};return[...Object.values(Mv.all??{}),...Object.values(n.all??{}),...Object.values(Mv[t]??{}),...Object.values(n[t]??{})]}function Xoe(){return new Set(qN)}function Zoe(){return YN}function Joe(){return zoe}var Qoe=class{static register(e){Kf(e,void 0)}static registerModules(e){for(const t of e)Kf(t,void 0)}},ut="34.3.1",ZN=2e3,JN=100,QN="_version_",Lv=null,ad=`${KN}/javascript-data-grid`;function ere(e){Lv=e}function tre(e){ad=e}function eL(e,t,n){return(Lv==null?void 0:Lv(e,t))??[rre(e,t,n)]}function kE(e,t,n,s,o){e(`${s?"warning":"error"} #${t}`,...eL(t,n,o))}function nre(e){if(!e)return String(e);const t={};for(const n of Object.keys(e))typeof e[n]!="object"&&typeof e[n]!="function"&&(t[n]=e[n]);return JSON.stringify(t)}function sre(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=nre(e)),t}function Vv(e){return e===void 0?"undefined":e===null?"null":e}function OE(e,t){return`${e}?${t.toString()}`}function ore(e,t,n){const s=Array.from(t.entries()).sort((r,i)=>i[1].length-r[1].length);let o=OE(e,t);for(const[r,i]of s){if(r===QN)continue;const a=o.length-n;if(a<=0)break;const l="...",c=a+l.length,u=i.length-c>JN?i.slice(0,i.length-c)+l:i.slice(0,JN)+l;t.set(r,u),o=OE(e,t)}return o}function tL(e,t){const n=new URLSearchParams;if(n.append(QN,ut),t)for(const r of Object.keys(t))n.append(r,sre(t[r]));const s=`${ad}/errors/${e}`,o=OE(s,n);return o.length<=ZN?o:ore(s,n,ZN)}var rre=(e,t,n)=>{const s=tL(e,t);return`${`${n?n+`
200
200
  `:""}Visit ${s}`}${n?"":`
201
201
  Alternatively register the ValidationModule to see the full message in the console.`}`};function Je(...e){kE(jf,e[0],e[1],!0)}function _n(...e){kE(rd,e[0],e[1],!1)}function qf(e,t,n){kE(rd,e,t,!1,n)}function ire(e,t){const n=t[0];return`error #${n} `+eL(n,t[1],e).join(" ")}function Ci(...e){return ire(void 0,e)}function nL(e,t){return e.get("rowModelType")===t}function rs(e,t){return nL(e,"clientSide")}function ld(e,t){return nL(e,"serverSide")}function Ms(e,t){return e.get("domLayout")===t}function mc(e){return Hv(e)!==void 0}function sL(e){return typeof e.get("getRowHeight")=="function"}function are(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function ol(e,t,n=!1,s){const{gos:o,environment:r}=e;if(s==null&&(s=r.getDefaultRowHeight()),sL(o)){if(n)return{height:s,estimated:!0};const l={node:t,data:t.data},c=o.getCallback("getRowHeight")(l);if(ME(c))return c===0&&Je(23),{height:Math.max(1,c),estimated:!1}}if(t.detail&&o.get("masterDetail"))return lre(o);const i=o.get("rowHeight");return{height:i&&ME(i)?i:s,estimated:!1}}function lre(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return ME(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function vc(e){const{environment:t,gos:n}=e,s=n.get("rowHeight");if(!s||Vn(s))return t.getDefaultRowHeight();const o=t.refreshRowHeightVariable();return o!==-1?o:(Je(24),t.getDefaultRowHeight())}function ME(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function oL(e,t,n){const s=t[e.getDomDataKey()];return s?s[n]:void 0}function yc(e,t,n,s){const o=e.getDomDataKey();let r=t[o];Vn(r)&&(r={},t[o]=r),r[n]=s}function cd(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function rL(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||Ms(e,"print"))}function bi(e){const t=e.get("autoGroupColumnDef");return!(t!=null&&t.comparator)&&!e.get("treeData")}function NE(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function iL(e){return e.get("grandTotalRow")}function aL(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function lL(e,t,n){return!!t.group&&!t.footer&&aL(e,n)}function ud(e){const t=e.getCallback("getRowId");return t===void 0?t:n=>{let s=t(n);return typeof s!="string"&&(TE(()=>Je(25,{id:s}),"getRowIdString"),s=String(s)),s}}function cre(e,t){const n=e.get("groupHideParentOfSingleChild");return!!(n===!0||n==="leafGroupsOnly"&&t.leafGroup||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)}function ure(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}function dd(e){return(e==null?void 0:e.checkboxes)??!0}function Bv(e){return(e==null?void 0:e.mode)==="multiRow"&&(e.headerCheckbox??!0)}function $v(e){if(typeof e=="object")return e.checkboxLocation??"selectionColumn"}function LE(e){return(e==null?void 0:e.hideDisabledCheckboxes)??!1}function dre(e){return typeof e.get("rowSelection")!="string"}function la(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function cL(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const n=e.get("suppressRowClickSelection"),s=e.get("suppressRowDeselection");return n&&s?!1:n?"enableDeselection":s?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function hre(e){const t=cL(e);return t===!0||t==="enableSelection"}function fre(e){const t=cL(e);return t===!0||t==="enableDeselection"}function VE(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t==null?void 0:t.isRowSelectable}function Hv(e){const t="beanName"in e&&e.beanName==="gos"?e.get("rowSelection"):e.rowSelection;if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(t==null?void 0:t.mode){case"multiRow":case"singleRow":return t.mode;default:return}}function Yf(e){return Hv(e)==="multiRow"}function pre(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):(t==null?void 0:t.enableSelectionWithoutKeys)??!1}function Gv(e){const t=e.get("rowSelection");if(typeof t=="string"){const n=e.get("groupSelectsChildren"),s=e.get("groupSelectsFiltered");return n&&s?"filteredDescendants":n?"descendants":"self"}return(t==null?void 0:t.mode)==="multiRow"?t.groupSelects:void 0}function uL(e,t=!0){const n=e.get("rowSelection");return typeof n!="object"?t?"all":void 0:n.mode==="multiRow"?n.selectAll:"all"}function gre(e){const t=e.get("rowSelection");return typeof t=="string"?!1:(t==null?void 0:t.mode)==="multiRow"?t.ctrlASelectsRows??!1:!1}function Xf(e){const t=Gv(e);return t==="descendants"||t==="filteredDescendants"}function dL(e){const t=e.get("rowSelection");return typeof t=="object"&&t.masterSelects||"self"}function mre(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function $o(e){return e.get("columnMenu")==="legacy"}function vre(e){return!$o(e)}function yre(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}function Pt(e,t){return e.addCommon(t)}function hL({gos:e},t){return t.button===2||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}var wre={resizable:!0,sortable:!0},Cre=0;function fL(){return Cre++}function rl(e){return e instanceof wc}var wc=class extends We{constructor(e,t,n,s){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=n,this.primary=s,this.isColumn=!0,this.instanceId=fL(),this.autoHeaderHeight=null,this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new fc,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=Nf(n)}destroy(){var e;super.destroy(),(e=this.beans.rowSpanSvc)==null||e.deregister(this)}getInstanceId(){return this.instanceId}setState(){const{colDef:e,beans:{sortSvc:t,pinnedCols:n,colFlex:s}}=this;t==null||t.initCol(this);const o=e.hide;o!==void 0?this.visible=!o:this.visible=!e.initialHide,n==null||n.initCol(this),s==null||s.initCol(this)}setColDef(e,t,n){var o;const s=e.spanRows!==this.colDef.spanRows;this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),s&&((o=this.beans.rowSpanSvc)==null||o.deregister(this),this.initRowSpan()),this.dispatchColEvent("colDefChanged",n)}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.setState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.initRowSpan(),this.addPivotListener()}initDotNotation(){const{gos:e,colDef:{field:t,tooltipField:n}}=this,s=e.get("suppressFieldDotNotation");this.fieldContainsDots=ht(t)&&t.includes(".")&&!s,this.tooltipFieldContainsDots=ht(n)&&n.includes(".")&&!s}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){var e;(e=this.beans.tooltipSvc)==null||e.initCol(this)}initRowSpan(){var e;this.colDef.spanRows&&((e=this.beans.rowSpanSvc)==null||e.register(this))}addPivotListener(){const e=this.beans.pivotColDefSvc,t=this.colDef.pivotValueColumn;!e||!t||this.addManagedListeners(t,{colDefChanged:n=>{const s=e.recreateColDef(this.colDef);this.setColDef(s,s,n.source)}})}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const n=e.width,s=e.initialWidth;return n!=null?t=n:s!=null?t=s:t=200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){var t;return((t=this.beans.showRowGroupCols)==null?void 0:t.isRowGroupDisplayed(this,e))??!1}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}__addEventListener(e,t){this.colEventSvc.addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc.removeEventListener(e,t)}addEventListener(e,t){var s,o,r;this.frameworkEventListenerService=(o=(s=this.beans.frameworkOverrides).createLocalEventListenerWrapper)==null?void 0:o.call(s,this.frameworkEventListenerService,this.colEventSvc);const n=((r=this.frameworkEventListenerService)==null?void 0:r.wrap(e,t))??t;this.colEventSvc.addEventListener(e,n)}removeEventListener(e,t){var s;const n=((s=this.frameworkEventListenerService)==null?void 0:s.unwrap(e,t))??t;this.colEventSvc.removeEventListener(e,n)}createColumnFunctionCallbackParams(e){return Pt(this.gos,{node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){var t;return((t=this.beans.cellNavigation)==null?void 0:t.isSuppressNavigable(this,e))??!1}isCellEditable(e){var t;return((t=this.beans.editSvc)==null?void 0:t.isCellEditable({rowNode:e,column:this}))??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){var t;return((t=this.beans.selectionSvc)==null?void 0:t.isCellCheckboxSelection(this,e))??!1}isSuppressPaste(e){var t;return this.isColumnFunc(e,((t=this.colDef)==null?void 0:t.suppressPaste)??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??wre[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const n=this.createColumnFunctionCallbackParams(e);return t(n)}return!1}createColumnEvent(e,t){return Pt(this.gos,{type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return Vn(this.sort)}isSorting(){return ht(this.sort)}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){var e;return Je(261),!!((e=this.beans.colHover)!=null&&e.isHovered(this))}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.dispatchColEvent("lastLeftPinnedChanged",t))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const n=e===!0;this.visible!==n&&(this.visible=n,this.dispatchColEvent("visibleChanged",t)),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.getColDef().suppressSpanHeaderHeight}getFirstRealParent(){let e=this.getOriginalParent();for(;e!=null&&e.isPadding();)e=e.getOriginalParent();return e}getColumnGroupPaddingInfo(){let e=this.getParent();if(!(e!=null&&e.isPadding()))return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let n=!0;for(;e;){if(!e.isPadding()){n=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:n}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return Pt(this.gos,{node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(Vn(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),n=this.colDef.colSpan(t);return Math.max(n,1)}getRowSpan(e){if(Vn(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),n=this.colDef.rowSpan(t);return Math.max(n,1)}setActualWidth(e,t,n=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex!=null&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),n||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.dispatchColEvent("widthChanged",e)}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}dispatchColEvent(e,t,n){const s=this.createColumnEvent(e,t);n&&so(s,n),this.colEventSvc.dispatchEvent(s)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function Ws(e){return e instanceof Uv}var Uv=class extends We{constructor(e,t,n,s){super(),this.colGroupDef=e,this.groupId=t,this.padding=n,this.level=s,this.isColumn=!1,this.expandable=!1,this.instanceId=fL(),this.expandableListenerRemoveCallback=null,this.expanded=!!(e!=null&&e.openByDefault)}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}forEachLeafColumn(e){if(this.children)for(const t of this.children)rl(t)?e(t):Ws(t)&&t.forEachLeafColumn(e)}addLeafColumns(e){if(this.children)for(const t of this.children)rl(t)?e.push(t):Ws(t)&&t.addLeafColumns(e)}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);for(const t of this.getLeafColumns())t.__addEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=()=>{for(const t of this.getLeafColumns())t.__removeEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,n=!1;const s=this.findChildrenRemovingPadding();for(let r=0,i=s.length;r<i;r++){const a=s[r];if(!a.isVisible())continue;const l=a.getColumnGroupShow();l==="open"?(e=!0,n=!0):l==="closed"?(t=!0,n=!0):(e=!0,t=!0)}const o=e&&t&&n;this.expandable!==o&&(this.expandable=o,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=n=>{for(const s of n)Ws(s)&&s.isPadding()?t(s.children):e.push(s)};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},bre={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function pL(e,t,n){const s={},o=e.gos;return Object.assign(s,o.get("defaultColGroupDef")),Object.assign(s,t),o.validateColDef(s,n),s}var Sre=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=mE(e);let n=0;for(;;){let s=e??t;if(s?n!==0&&(s+="_"+n):s=n,!this.existingKeys[s]){const o=String(s);return e&&n>0&&Je(273,{providedId:e,usedId:o}),this.existingKeys[o]=!0,o}n++}}};function Tn(e){if(e!=null&&e.length)return e[e.length-1]}function il(e,t,n){if(e===t)return!0;if(!e||!t)return e==null&&t==null;const s=e.length;if(s!==t.length)return!1;for(let o=0;o<s;o++)if(e[o]!==t[o]&&!(n!=null&&n(e[o],t[o])))return!1;return!0}function Zf(e,t){if(e)for(const n of e)t(n)}function $r(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function gL(e,t,n){for(let s=0;s<t.length;s++)$r(e,t[s]);for(let s=t.length-1;s>=0;s--)e.splice(n,0,t[s])}var Wv="ag-Grid-AutoColumn",mL="ag-Grid-SelectionColumn",vL="ag-Grid-RowNumbersColumn";function yL(e){const t=[],n=s=>{for(let o=0;o<s.length;o++){const r=s[o];rl(r)?t.push(r):Ws(r)&&n(r.getChildren())}};return n(e),t}function ca(e){return e.reduce((t,n)=>t+n.getActualWidth(),0)}function zv(e,t,n){const s={};if(!t)return;ha(null,t,r=>{s[r.getInstanceId()]=r}),n&&ha(null,n,r=>{s[r.getInstanceId()]=null});const o=Object.values(s).filter(r=>r!=null);e.context.destroyBeans(o)}function BE(e){return e.getId().startsWith(Wv)}function ua(e){const t=typeof e=="string"?e:"getColId"in e?e.getColId():e.colId;return(t==null?void 0:t.startsWith(mL))??!1}function da(e){const t=typeof e=="string"?e:"getColId"in e?e.getColId():e.colId;return(t==null?void 0:t.startsWith(vL))??!1}function Ere(e){return ua(e)||da(e)}function jv(e){let t=[];return e instanceof Array?t=e:typeof e=="string"&&(t=e.split(",")),t}function _re(e,t){return il(e,t,(n,s)=>n.getColId()===s.getColId())}function Rre(e){e.map={};for(const t of e.list)e.map[t.getId()]=t}function hd(e){return e==="optionsUpdated"?"gridOptionsChanged":e}function Jf(e,t){const n=e===t,s=e.getColDef()===t,o=e.getColId()==t;return n||s||o}var Dre=(e,t)=>(n,s)=>{const o={value1:void 0,value2:void 0};let r=!1;return e&&(e[n]!==void 0&&(o.value1=e[n],r=!0),ht(s)&&e[s]!==void 0&&(o.value2=e[s],r=!0)),!r&&t&&(t[n]!==void 0&&(o.value1=t[n]),ht(s)&&t[s]!==void 0&&(o.value2=t[s])),o},Tre=(e,t)=>{Ws(e)&&e.setupExpandable(),e.originalParent=t};function Ire(e,t=null,n,s,o){const r=new Sre,{existingCols:i,existingGroups:a,existingColKeys:l}=xre(s);r.addExistingKeys(l);const c=wL(e,t,0,n,i,r,a,o),{colGroupSvc:u}=e,d=(u==null?void 0:u.findMaxDepth(c,0))??0,h=u?u.balanceColumnTree(c,0,d,r):c;return ha(null,h,Tre),{columnTree:h,treeDepth:d}}function xre(e){const t=[],n=[],s=[];return e&&ha(null,e,o=>{if(Ws(o)){const r=o;n.push(r)}else{const r=o;s.push(r.getId()),t.push(r)}}),{existingCols:t,existingGroups:n,existingColKeys:s}}function wL(e,t,n,s,o,r,i,a){if(!t)return[];const{colGroupSvc:l}=e,c=new Array(t.length);for(let u=0;u<c.length;u++){const d=t[u];l&&Mre(d)?c[u]=l.createProvidedColumnGroup(s,d,n,o,r,i,a):c[u]=Fre(e,s,d,o,r,a)}return c}function Fre(e,t,n,s,o,r){var l;const i=Are(n,s);i&&(s==null||s.splice(i.idx,1));let a=i==null?void 0:i.column;if(a){const c=$E(e,n,a.getColId());a.setColDef(c,n,r),Pre(e,a,c,r)}else{const c=o.getUniqueKey(n.colId,n.field),u=$E(e,n,c);a=new wc(u,n,c,t),e.context.createBean(a)}return(l=e.dataTypeSvc)==null||l.addColumnListeners(a),a}function CL(e,t,n,s,o,r,i,a){const{sortSvc:l,pinnedCols:c,colFlex:u}=e;n!==void 0&&t.setVisible(!n,a),l&&(l.updateColSort(t,s,a),o!==void 0&&l.setColSortIndex(t,o)),r!==void 0&&(c==null||c.setColPinned(t,r)),i!==void 0&&(u==null||u.setColFlex(t,i))}function Pre(e,t,n,s){CL(e,t,n.hide,n.sort,n.sortIndex,n.pinned,n.flex,s);const o=t.getFlex();if(!(o!=null&&o>0))if(n.width!=null)t.setActualWidth(n.width,s);else{const r=t.getActualWidth();t.setActualWidth(r,s)}}function Are(e,t){if(t)for(let n=0;n<t.length;n++){const s=t[n].getUserProvidedColDef();if(!s)continue;if(e.colId!=null){if(t[n].getId()===e.colId)return{idx:n,column:t[n]};continue}if(e.field!=null){if(s.field===e.field)return{idx:n,column:t[n]};continue}if(s===e)return{idx:n,column:t[n]}}}function $E(e,t,n,s){const{gos:o,dataTypeSvc:r}=e,i={},a=o.get("defaultColDef");so(i,a,!1,!0);const l=kre(e,i,t,n);l&&Ore(e,l,i);const c=i.cellDataType;so(i,t,!1,!0),c!==void 0&&(i.cellDataType=c);const u=o.get("autoGroupColumnDef"),d=bi(o);return t.rowGroup&&u&&d&&so(i,{sort:u.sort,initialSort:u.initialSort},!1,!0),r&&(r.postProcess(i),r.validateColDef(i)),o.validateColDef(i,n,s),i}function kre(e,t,n,s){var i;const o=(i=e.dataTypeSvc)==null?void 0:i.updateColDefAndGetColumnType(t,n,s),r=n.type??o??t.type;return t.type=r,r?jv(r):void 0}function Ore(e,t,n){if(!t.length)return;const s=Object.assign({},bre),o=e.gos.get("columnTypes")||{};for(const r of Object.keys(o)){const i=o[r];r in s?Je(34,{key:r}):(i.type&&Je(35),s[r]=i)}for(const r of t){const i=s[r.trim()];i?so(n,i,!1,!0):Je(36,{t:r})}}function Mre(e){return e.children!==void 0}function ha(e,t,n){if(t)for(let s=0;s<t.length;s++){const o=t[s];Ws(o)&&ha(o,o.getChildren(),n),n(o,e)}}function bL(e,t){const n=[],s=[],o=[];return e.forEach(i=>{const a=i.getColDef().lockPosition;a==="right"?o.push(i):a==="left"||a===!0?n.push(i):s.push(i)}),t.get("enableRtl")?[...o,...s,...n]:[...n,...s,...o]}function SL(e,t){let n=!0;return ha(null,t,s=>{if(!Ws(s))return;const o=s,r=o.getColGroupDef();if(!(r==null?void 0:r.marryChildren))return;const a=[];for(const h of o.getLeafColumns()){const f=e.indexOf(h);a.push(f)}const l=Math.max.apply(Math,a),c=Math.min.apply(Math,a),u=l-c,d=o.getLeafColumns().length-1;u>d&&(n=!1)}),n}function EL(e,t){if(!e||e.length==0)return;const n=t(e[0]);for(let s=1;s<e.length;s++)if(n!==t(e[s]))return;return n}function _L(e,t,n){if(!t.length)return;const s=t.length===1?t[0]:null,o=EL(t,r=>r.getPinned());e.dispatchEvent({type:"columnPinned",pinned:o??null,columns:t,column:s,source:n})}function Nre(e,t,n){if(!t.length)return;const s=t.length===1?t[0]:null,o=EL(t,r=>r.isVisible());e.dispatchEvent({type:"columnVisible",visible:o,columns:t,column:s,source:n})}function Lre(e,t,n,s){e.dispatchEvent({type:t,columns:n,column:n&&n.length==1?n[0]:null,source:s})}function fd(e,t,n,s,o=null){t!=null&&t.length&&e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:o,finished:n,source:s})}function Hr(e,t,n){var D;const{colModel:s,rowGroupColsSvc:o,pivotColsSvc:r,autoColSvc:i,selectionColSvc:a,colAnimation:l,visibleCols:c,pivotResultCols:u,environment:d,valueColsSvc:h,eventSvc:f,gos:p}=e,g=s.getColDefCols()??[],v=a==null?void 0:a.getColumns();if(!g.length&&!(v!=null&&v.length))return!1;if(t!=null&&t.state&&!t.state.forEach)return Je(32),!1;const C=(R,T,F,x,P)=>{if(!R)return;const E=Dre(T,t.defaultState),k=E("flex").value1;if(CL(e,R,E("hide").value1,E("sort").value1,E("sortIndex").value1,E("pinned").value1,k,n),k==null){const I=E("width").value1;if(I!=null){const M=R.getColDef().minWidth??d.getDefaultColumnMinWidth();M!=null&&I>=M&&R.setActualWidth(I,n)}}P||!R.isPrimary()||(h==null||h.syncColumnWithState(R,n,E),o==null||o.syncColumnWithState(R,n,E,F),r==null||r.syncColumnWithState(R,n,E,x))},S=(R,T,F)=>{var ee,V;const x=RL(e,n),P=T.slice(),E={},k={},I=[],M=[],O=[];let $=0;const Z=(o==null?void 0:o.columns.slice())??[],Q=(r==null?void 0:r.columns.slice())??[];for(const W of R){const te=W.colId;if(te.startsWith(Wv)){I.push(W),O.push(W);continue}if(ua(te)){M.push(W),O.push(W);continue}const ve=F(te);ve?(C(ve,W,E,k,!1),$r(P,ve)):(O.push(W),$+=1)}const se=W=>C(W,null,E,k,!1);P.forEach(se),o==null||o.sortColumns(TL.bind(o,E,Z)),r==null||r.sortColumns(TL.bind(r,k,Q)),s.refreshCols(!1,n);const ae=(W,te,pe=[])=>{for(const ve of te){const re=W(ve.colId);$r(pe,re),C(re,ve,null,null,!0)}pe.forEach(se)};return ae(W=>(i==null?void 0:i.getColumn(W))??null,I,(ee=i==null?void 0:i.getColumns())==null?void 0:ee.slice()),ae(W=>(a==null?void 0:a.getColumn(W))??null,M,(V=a==null?void 0:a.getColumns())==null?void 0:V.slice()),Bre(t,s,p),c.refresh(n),f.dispatchEvent({type:"columnEverythingChanged",source:n}),x(),{unmatchedAndAutoStates:O,unmatchedCount:$}};l==null||l.start();let{unmatchedAndAutoStates:b,unmatchedCount:w}=S(t.state||[],g,R=>s.getColDefCol(R));if(b.length>0||ht(t.defaultState)){const R=((D=u==null?void 0:u.getPivotResultCols())==null?void 0:D.list)??[];w=S(b,R,T=>(u==null?void 0:u.getPivotResultCol(T))??null).unmatchedCount}return l==null||l.finish(),w===0}function Vre(e,t){var S,b;const{colModel:n,autoColSvc:s,selectionColSvc:o,eventSvc:r,gos:i}=e,a=n.getColDefCols();if(!(a!=null&&a.length))return;const l=n.getColDefColTree(),c=yL(l),u=[];let d=1e3,h=1e3;const f=w=>{const D=DL(w);Vn(D.rowGroupIndex)&&D.rowGroup&&(D.rowGroupIndex=d++),Vn(D.pivotIndex)&&D.pivot&&(D.pivotIndex=h++),u.push(D)};(S=s==null?void 0:s.getColumns())==null||S.forEach(f),(b=o==null?void 0:o.getColumns())==null||b.forEach(f),c==null||c.forEach(f),Hr(e,{state:u},t);const p=(s==null?void 0:s.getColumns())??[],C=[...(o==null?void 0:o.getColumns())??[],...p,...a].map(w=>({colId:w.colId}));Hr(e,{state:C,applyOrder:!0},t),r.dispatchEvent(Pt(i,{type:"columnsReset",source:t}))}function RL(e,t){const{rowGroupColsSvc:n,pivotColsSvc:s,valueColsSvc:o,colModel:r,sortSvc:i,eventSvc:a}=e,l={rowGroupColumns:(n==null?void 0:n.columns.slice())??[],pivotColumns:(s==null?void 0:s.columns.slice())??[],valueColumns:(o==null?void 0:o.columns.slice())??[]},c=Kv(e),u={};for(const d of c)u[d.colId]=d;return()=>{const d=(R,T,F,x)=>{const P=T.map(x),E=F.map(x);if(il(P,E))return;const I=new Set(T);for(const O of F)I.delete(O)||I.add(O);const M=[...I];a.dispatchEvent({type:R,columns:M,column:M.length===1?M[0]:null,source:t})},h=R=>{const T=[];return r.forAllCols(F=>{const x=u[F.getColId()];x&&R(x,F)&&T.push(F)}),T},f=R=>R.getColId();d("columnRowGroupChanged",l.rowGroupColumns,(n==null?void 0:n.columns)??[],f),d("columnPivotChanged",l.pivotColumns,(s==null?void 0:s.columns)??[],f);const g=h((R,T)=>{const F=R.aggFunc!=null,x=F!=T.isValueActive(),P=F&&R.aggFunc!=T.getAggFunc();return x||P});g.length>0&&Lre(a,"columnValueChanged",g,t),fd(a,h((R,T)=>R.width!=T.getActualWidth()),!0,t),_L(a,h((R,T)=>R.pinned!=T.getPinned()),t),Nre(a,h((R,T)=>R.hide==T.isVisible()),t);const w=h((R,T)=>R.sort!=T.getSort()||R.sortIndex!=T.getSortIndex());w.length>0&&(i==null||i.dispatchSortChangedEvents(t,w));const D=Kv(e);Hre(c,D,t,r,a)}}function Kv(e){const{colModel:t,rowGroupColsSvc:n,pivotColsSvc:s}=e,o=t.getColDefCols();if(Vn(o)||!t.isAlive())return[];const r=n==null?void 0:n.columns,i=s==null?void 0:s.columns,a=[],l=u=>{const d=u.isRowGroupActive()&&r?r.indexOf(u):null,h=u.isPivotActive()&&i?i.indexOf(u):null,f=u.isValueActive()?u.getAggFunc():null,p=u.getSort()!=null?u.getSort():null,g=u.getSortIndex()!=null?u.getSortIndex():null;a.push({colId:u.getColId(),width:u.getActualWidth(),hide:!u.isVisible(),pinned:u.getPinned(),sort:p,sortIndex:g,aggFunc:f,rowGroup:u.isRowGroupActive(),rowGroupIndex:d,pivot:u.isPivotActive(),pivotIndex:h,flex:u.getFlex()??null})};t.forAllCols(u=>l(u));const c=new Map(t.getCols().map((u,d)=>[u.getColId(),d]));return a.sort((u,d)=>{const h=c.has(u.colId)?c.get(u.colId):-1,f=c.has(d.colId)?c.get(d.colId):-1;return h-f}),a}function DL(e){const t=(p,g)=>p??g??null,n=e.getColDef(),s=t(n.sort,n.initialSort),o=t(n.sortIndex,n.initialSortIndex),r=t(n.hide,n.initialHide),i=t(n.pinned,n.initialPinned),a=t(n.width,n.initialWidth),l=t(n.flex,n.initialFlex);let c=t(n.rowGroupIndex,n.initialRowGroupIndex),u=t(n.rowGroup,n.initialRowGroup);c==null&&!u&&(c=null,u=null);let d=t(n.pivotIndex,n.initialPivotIndex),h=t(n.pivot,n.initialPivot);d==null&&!h&&(d=null,h=null);const f=t(n.aggFunc,n.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:o,hide:r,pinned:i,width:a,flex:l,rowGroup:u,rowGroupIndex:c,pivot:h,pivotIndex:d,aggFunc:f}}function Bre(e,t,n){if(!e.applyOrder||!e.state)return;const s=[];for(const o of e.state)o.colId!=null&&s.push(o.colId);$re(t.cols,s,t,n)}function $re(e,t,n,s){if(e==null)return;let o=[];const r={};for(const a of t){if(r[a])continue;const l=e.map[a];l&&(o.push(l),r[a]=!0)}let i=0;for(const a of e.list){const l=a.getColId();if(r[l]!=null)continue;l.startsWith(Wv)?o.splice(i++,0,a):o.push(a)}if(o=bL(o,s),!SL(o,n.getColTree())){Je(39);return}e.list=o}function Hre(e,t,n,s,o){const r={};for(const u of t)r[u.colId]=u;const i={};for(const u of e)r[u.colId]&&(i[u.colId]=!0);const a=e.filter(u=>i[u.colId]),l=t.filter(u=>i[u.colId]),c=[];l.forEach((u,d)=>{const h=a==null?void 0:a[d];if(h&&h.colId!==u.colId){const f=s.getCol(h.colId);f&&c.push(f)}}),c.length&&o.dispatchEvent({type:"columnMoved",columns:c,column:c.length===1?c[0]:null,finished:!0,source:n})}var TL=(e,t,n,s)=>{const o=e[n.getId()],r=e[s.getId()],i=o!=null,a=r!=null;if(i&&a)return o-r;if(i)return-1;if(a)return 1;const l=t.indexOf(n),c=t.indexOf(s),u=l>=0,d=c>=0;return u&&d?l-c:u?-1:1},Gre=class extends We{constructor(){super(...arguments),this.beanName="colModel",this.pivotMode=!1,this.ready=!1,this.changeEventsDispatching=!1}postConstruct(){this.pivotMode=this.gos.get("pivotMode"),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents","rowNumbers","hidePaddedHeaderRows"],e=>this.refreshAll(hd(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),hd(e.source)))}createColsFromColDefs(e){var S,b,w;const{beans:t}=this,{valueCache:n,colAutosize:s,rowGroupColsSvc:o,pivotColsSvc:r,valueColsSvc:i,visibleCols:a,eventSvc:l,groupHierarchyColSvc:c}=t,u=this.colDefs?RL(t,e):void 0;n==null||n.expire();const d=(S=this.colDefCols)==null?void 0:S.list,h=(b=this.colDefCols)==null?void 0:b.tree,f=Ire(t,this.colDefs,!0,h,e);zv(t,(w=this.colDefCols)==null?void 0:w.tree,f.columnTree);const p=f.columnTree,g=f.treeDepth,v=yL(p),C={};for(const D of v)C[D.getId()]=D;this.colDefCols={tree:p,treeDepth:g,list:v,map:C},this.createColumnsForService([c],this.colDefCols,e),o==null||o.extractCols(e,d),r==null||r.extractCols(e,d),i==null||i.extractCols(e,d),this.ready=!0,this.refreshCols(!0,e),a.refresh(e),l.dispatchEvent({type:"columnEverythingChanged",source:e}),u&&(this.changeEventsDispatching=!0,u(),this.changeEventsDispatching=!1),l.dispatchEvent({type:"newColumnsLoaded",source:e}),e==="gridInitializing"&&(s==null||s.applyAutosizeStrategy())}refreshCols(e,t){var v;if(!this.colDefCols)return;const n=(v=this.cols)==null?void 0:v.tree;this.saveColOrder();const{autoColSvc:s,selectionColSvc:o,rowNumbersSvc:r,quickFilter:i,pivotResultCols:a,showRowGroupCols:l,rowAutoHeight:c,visibleCols:u,colViewport:d,eventSvc:h}=this.beans,f=this.selectCols(a,this.colDefCols);this.createColumnsForService([s,o,r],f,t);const p=are(this.gos,this.showingPivotResult);(!e||p)&&this.restoreColOrder(f),this.positionLockedCols(f),l==null||l.refresh(),i==null||i.refreshCols(),this.setColSpanActive(),c==null||c.setAutoHeightActive(f),u.clear(),d.clear(),!il(n,this.cols.tree)&&h.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(e,t,n){for(const s of e)s&&(s.createColumns(t,o=>{this.lastOrder=o(this.lastOrder),this.lastPivotOrder=o(this.lastPivotOrder)},n),s.addColumns(t))}selectCols(e,t){const n=(e==null?void 0:e.getPivotResultCols())??null;this.showingPivotResult=n!=null;const{map:s,list:o,tree:r,treeDepth:i}=n??t;return this.cols={list:o.slice(),map:{...s},tree:r.slice(),treeDepth:i},n&&(n.list.some(l=>{var c;return((c=this.cols)==null?void 0:c.map[l.getColId()])!==void 0})||(this.lastPivotOrder=null)),this.cols}getColsToShow(){if(!this.cols)return[];const{valueColsSvc:e,selectionColSvc:t,gos:n}=this.beans,s=this.isPivotMode()&&!this.showingPivotResult,o=t==null?void 0:t.isSelectionColumnEnabled(),r=n.get("rowNumbers"),i=e==null?void 0:e.columns;return this.cols.list.filter(l=>{const c=BE(l);if(s){const u=i==null?void 0:i.includes(l);return c||u||o&&ua(l)||r&&da(l)}else return c||l.isVisible()})}refreshAll(e){this.ready&&(this.refreshCols(!1,e),this.beans.visibleCols.refresh(e))}setColsVisible(e,t=!1,n){Hr(this.beans,{state:e.map(s=>({colId:typeof s=="string"?s:s.getColId(),hide:!t}))},n)}restoreColOrder(e){const t=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!t)return;const n=t.filter(d=>e.map[d.getId()]!=null);if(n.length===0)return;if(n.length===e.list.length){e.list=n;return}const s=d=>{const h=d.getOriginalParent();return h?h.getChildren().length>1?!0:s(h):!1};if(!n.some(d=>s(d))){const d=new Set(n);for(const h of e.list)d.has(h)||n.push(h);e.list=n;return}const o=new Map;for(let d=0;d<n.length;d++){const h=n[d];o.set(h,d)}const r=e.list.filter(d=>!o.has(d));if(r.length===0){e.list=n;return}const i=(d,h)=>{const f=h?h.getOriginalParent():d.getOriginalParent();if(!f)return null;let p=null,g=null;for(const v of f.getChildren())if(!(v===h||v===d)){if(v instanceof wc){const C=o.get(v);if(C==null)continue;(p==null||p<C)&&(p=C,g=v);continue}v.forEachLeafColumn(C=>{const S=o.get(C);S!=null&&(p==null||p<S)&&(p=S,g=C)})}return g??i(d,f)},a=[],l=new Map;for(const d of r){const h=i(d,null);if(h==null){a.push(d);continue}const f=l.get(h);f===void 0?l.set(h,d):Array.isArray(f)?f.push(d):l.set(h,[f,d])}const c=new Array(e.list.length);let u=c.length-1;for(let d=a.length-1;d>=0;d--)c[u--]=a[d];for(let d=n.length-1;d>=0;d--){const h=n[d],f=l.get(h);if(f)if(Array.isArray(f))for(let p=f.length-1;p>=0;p--){const g=f[p];c[u--]=g}else c[u--]=f;c[u--]=h}e.list=c}positionLockedCols(e){e.list=bL(e.list,this.gos)}saveColOrder(){var e,t;this.showingPivotResult?this.lastPivotOrder=((e=this.cols)==null?void 0:e.list)??null:this.lastOrder=((t=this.cols)==null?void 0:t.list)??null}getColumnDefs(e){var t,n;return this.colDefCols&&((n=this.beans.colDefFactory)==null?void 0:n.getColumnDefs(this.colDefCols.list,this.showingPivotResult,this.lastOrder,((t=this.cols)==null?void 0:t.list)??[],e))}setColSpanActive(){var e;this.colSpanActive=!!((e=this.cols)!=null&&e.list.some(t=>t.getColDef().colSpan!=null))}isPivotMode(){return this.pivotMode}setPivotMode(e,t){if(e===this.pivotMode||(this.pivotMode=e,!this.ready))return;this.refreshCols(!1,t);const{visibleCols:n,eventSvc:s}=this.beans;n.refresh(t),s.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){var t;const e=(t=this.beans.pivotColsSvc)==null?void 0:t.columns;return this.pivotMode&&!!(e!=null&&e.length)}recreateColumnDefs(e){var n;if(!this.cols)return;(n=this.beans.autoColSvc)==null||n.updateColumns(e);const t=hd(e.source);this.createColsFromColDefs(t)}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){var e;zv(this.beans,(e=this.colDefCols)==null?void 0:e.tree),super.destroy()}getColTree(){var e;return((e=this.cols)==null?void 0:e.tree)??[]}getColDefColTree(){var e;return((e=this.colDefCols)==null?void 0:e.tree)??[]}getColDefCols(){var e;return((e=this.colDefCols)==null?void 0:e.list)??null}getCols(){var e;return((e=this.cols)==null?void 0:e.list)??[]}forAllCols(e){var r,i,a,l,c;const{pivotResultCols:t,autoColSvc:n,selectionColSvc:s,groupHierarchyColSvc:o}=this.beans;Zf((r=this.colDefCols)==null?void 0:r.list,e),Zf((i=n==null?void 0:n.columns)==null?void 0:i.list,e),Zf((a=s==null?void 0:s.columns)==null?void 0:a.list,e),Zf((l=o==null?void 0:o.columns)==null?void 0:l.list,e),Zf((c=t==null?void 0:t.getPivotResultCols())==null?void 0:c.list,e)}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){var t;return(t=this.colDefCols)!=null&&t.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)}getColById(e){var t;return((t=this.cols)==null?void 0:t.map[e])??null}getColFromCollection(e,t){if(t==null)return null;const{map:n,list:s}=t;if(typeof e=="string"&&n[e])return n[e];for(let a=0;a<s.length;a++)if(Jf(s[a],e))return s[a];const{autoColSvc:o,selectionColSvc:r,groupHierarchyColSvc:i}=this.beans;return(o==null?void 0:o.getColumn(e))??(r==null?void 0:r.getColumn(e))??(i==null?void 0:i.getColumn(e))??null}},IL=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let n;return typeof t!="number"?n=0:n=t+1,this.existingIds[e]=n,n}};function Qf(e,t,n){return n&&e.addDestroyFunc(()=>t.destroyBean(n)),n??e}var dt=null;function xL(e){return typeof(e==null?void 0:e.getGui)=="function"}var FL=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){var s;if(!e)return;if(e.indexOf(" ")>=0){const o=(e||"").split(" ");if(o.length>1){for(const r of o)this.toggleCss(r,t);return}}this.cssClassStates[e]!==t&&e.length&&((s=this.getGui())==null||s.classList.toggle(e,t),this.cssClassStates[e]=t)}},Ure=0,ep=class extends wi{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=Ure++,this.cssManager=new FL(()=>this.eGui),this.componentSelectors=new Map((t??[]).map(n=>[n.selector,n])),e&&this.setTemplate(e)}preConstruct(){var t,n;this.wireTemplate(this.getGui());const e="component-"+((n=(t=Object.getPrototypeOf(this))==null?void 0:t.constructor)==null?void 0:n.name);for(const s of this.css??[])this.beans.environment.addGlobalCSS(s,e)}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getDataRefAttribute(e){return e.getAttribute?e.getAttribute(VN):null}applyElementsToComponent(e,t,n,s=null){if(t===void 0&&(t=this.getDataRefAttribute(e)),t){const o=this[t];if(o===dt)this[t]=s??e;else{const r=n==null?void 0:n[t];if(!this.suppressDataRefValidation&&!r)throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${o}`)}}}createChildComponentsFromTags(e,t){const n=[];for(const s of e.childNodes??[])n.push(s);for(const s of n){if(!(s instanceof HTMLElement))continue;const o=this.createComponentFromElement(s,r=>{const i=r.getGui();if(i)for(const a of s.attributes??[])i.setAttribute(a.name,a.value)},t);if(o){if(o.addItems&&s.children.length){this.createChildComponentsFromTags(s,t);const r=Array.prototype.slice.call(s.children);o.addItems(r)}this.swapComponentForNode(o,e,s)}else s.childNodes&&this.createChildComponentsFromTags(s,t)}}createComponentFromElement(e,t,n){const s=e.nodeName,o=this.getDataRefAttribute(e),r=s.indexOf("AG-")===0,i=r?this.componentSelectors.get(s):null;let a=null;if(i){const l=n&&o?n[o]:void 0;a=new i.component(l),a.setParentComponent(this),this.createBean(a,null,t)}else if(r)throw new Error(`selector: ${s}`);return this.applyElementsToComponent(e,o,n,a),a}swapComponentForNode(e,t,n){const s=e.getGui();t.replaceChild(s,n),t.insertBefore(document.createComment(n.nodeName),s),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e){const t=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui());for(const n of e)n.setAttribute("tabindex",t.toString())}setTemplate(e,t,n){let s;typeof e=="string"||e==null?s=CE(e):s=Uf(e),this.setTemplateFromElement(s,t,n)}setTemplateFromElement(e,t,n,s=!1){if(this.eGui=e,this.suppressDataRefValidation=s,t)for(let o=0;o<t.length;o++){const r=t[o];this.componentSelectors.set(r.selector,r)}this.wireTemplate(e,n)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}getContainerAndElement(e,t){let n=t;return e==null?null:(n||(n=this.eGui),EE(e)?{element:e,parent:n}:{element:e.getGui(),parent:n})}prependChild(e,t){const{element:n,parent:s}=this.getContainerAndElement(e,t)||{};!n||!s||s.insertAdjacentElement("afterbegin",n)}appendChild(e,t){const{element:n,parent:s}=this.getContainerAndElement(e,t)||{};!n||!s||s.appendChild(n)}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:n}=t;Eoe(this.eGui,e,{skipAriaHidden:n})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:n}=t;Bn(this.eGui,e,{skipAriaHidden:n});const s={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(s)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),super.destroy()}addGuiEventListener(e,t,n){this.eGui.addEventListener(e,t,n),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,t))}addCss(e){this.cssManager.toggleCss(e,!0)}removeCss(e){this.cssManager.toggleCss(e,!1)}toggleCss(e,t){this.cssManager.toggleCss(e,t)}registerCSS(e){this.css||(this.css=[]),this.css.push(e)}},Cn=class extends ep{};function PL(e){return typeof e=="object"&&!!e.component}function Wre(e,t){return new jn(n=>{n(window.setInterval(e,t))})}var jn=class xp{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(n=>this.onDone(n),n=>this.onReject(n))}static all(t){return t.length?new xp(n=>{let s=t.length;const o=new Array(s);t.forEach((r,i)=>{r.then(a=>{o[i]=a,s--,s===0&&n(o)})})}):xp.resolve()}static resolve(t=null){return new xp(n=>n(t))}then(t){return new xp(n=>{this.status===1?n(t(this.resolution)):this.waiters.push(s=>n(t(s)))})}onDone(t){this.status=1,this.resolution=t;for(const n of this.waiters)n(t)}onReject(t){}};function zre(e){return e?e.prototype&&"getGui"in e.prototype:!1}function AL(e,t,n,s){const{name:o}=n;let r,i,a,l,c,u;if(t){const d=t,h=d[o+"Selector"],f=h?h(s):null,p=g=>{typeof g=="string"?r=g:g!=null&&g!==!0&&(e.isFrameworkComponent(g)?a=g:i=g)};f?(p(f.component),l=f.params,c=f.popup,u=f.popupPosition):p(d[o])}return{compName:r,jsComp:i,fwComp:a,paramsFromSelector:l,popupFromSelector:c,popupPositionFromSelector:u}}var jre=class extends We{constructor(){super(...arguments),this.beanName="userCompFactory"}wireBeans(e){this.agCompUtils=e.agCompUtils,this.registry=e.registry,this.frameworkCompWrapper=e.frameworkCompWrapper,this.gridOptions=e.gridOptions}getCompDetailsFromGridOptions(e,t,n,s=!1){return this.getCompDetails(this.gridOptions,e,t,n,s)}getCompDetails(e,t,n,s,o=!1){var b;const{name:r,cellRenderer:i}=t;let{compName:a,jsComp:l,fwComp:c,paramsFromSelector:u,popupFromSelector:d,popupPositionFromSelector:h}=AL(this.beans.frameworkOverrides,e,t,s),f,p;const g=w=>{const D=this.registry.getUserComponent(r,w);D&&(l=D.componentFromFramework?void 0:D.component,c=D.componentFromFramework?D.component:void 0,f=D.params,p=D.processParams)};if(a!=null&&g(a),l==null&&c==null&&n!=null&&g(n),l&&i&&!zre(l)&&(l=(b=this.agCompUtils)==null?void 0:b.adaptFunction(t,l)),!l&&!c){const{validation:w}=this.beans;o&&(a!==n||!n)?a?w!=null&&w.isProvidedUserComp(a)||_n(50,{compName:a}):n?w||_n(260,{...this.gos.getModuleErrorParams(),propName:r,compName:n}):_n(216,{name:r}):n&&!w&&_n(146,{comp:n});return}const v=this.mergeParams(e,t,s,u,f,p),C=l==null,S=l??c;return{componentFromFramework:C,componentClass:S,params:v,type:t,popupFromSelector:d,popupPositionFromSelector:h,newAgStackInstance:()=>this.newAgStackInstance(S,C,v,t)}}newAgStackInstance(e,t,n,s){var a;const o=!t;let r;o?r=new e:r=this.frameworkCompWrapper.wrap(e,s.mandatoryMethods,s.optionalMethods,s),this.createBean(r);const i=(a=r.init)==null?void 0:a.call(r,n);return i==null?jn.resolve(r):i.then(()=>r)}mergeParams(e,t,n,s=null,o,r){const i={...n,...o},a=e,l=a==null?void 0:a[t.name+"Params"];if(typeof l=="function"){const c=l(n);so(i,c)}else typeof l=="object"&&so(i,l);return so(i,s),r?r(i):i}},Kre={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},qre={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},Yre={name:"headerComponent",optionalMethods:["refresh"]},Xre={name:"innerHeaderComponent"},Zre={name:"innerHeaderGroupComponent"},Jre={name:"headerGroupComponent"},Qre={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},eie={name:"loadingCellRenderer",cellRenderer:!0},tie={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},nie={name:"loadingOverlayComponent",optionalMethods:["refresh"]},sie={name:"noRowsOverlayComponent",optionalMethods:["refresh"]},oie={name:"tooltipComponent"},HE={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},rie={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},iie={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},aie={name:"loadingCellRenderer",cellRenderer:!0},lie={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},cie={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function uie(e,t){return e.getCompDetailsFromGridOptions(qre,"agDragAndDropImage",t,!0)}function die(e,t,n){return e.getCompDetails(t,Yre,"agColumnHeader",n)}function hie(e,t,n){return e.getCompDetails(t,Xre,void 0,n)}function fie(e,t){const n=t.columnGroup.getColGroupDef();return e.getCompDetails(n,Jre,"agColumnGroupHeader",t)}function pie(e,t,n){return e.getCompDetails(t,Zre,void 0,n)}function gie(e,t){return e.getCompDetailsFromGridOptions(iie,void 0,t,!0)}function mie(e,t){return e.getCompDetailsFromGridOptions(aie,"agLoadingCellRenderer",t,!0)}function vie(e,t){return e.getCompDetailsFromGridOptions(lie,"agGroupRowRenderer",t,!0)}function yie(e,t){return e.getCompDetailsFromGridOptions(cie,"agDetailCellRenderer",t,!0)}function kL(e,t,n){return e.getCompDetails(t,Qre,void 0,n)}function OL(e,t,n){return e.getCompDetails(t,eie,"agSkeletonCellRenderer",n,!0)}function ML(e,t,n){return e.getCompDetails(t,tie,"agCellEditor",n,!0)}function wie(e,t,n,s){const o=t.filter;return PL(o)&&(t={filter:o.component,filterParams:t.filterParams}),e.getCompDetails(t,HE,s,n,!0)}function Cie(e,t,n){return e.getCompDetails(t,Kre,"agDateInput",n,!0)}function bie(e,t){return e.getCompDetailsFromGridOptions(nie,"agLoadingOverlay",t,!0)}function Sie(e,t){return e.getCompDetailsFromGridOptions(sie,"agNoRowsOverlay",t,!0)}function Eie(e,t){return e.getCompDetails(t.colDef,oie,"agTooltipComponent",t,!0)}function _ie(e,t,n,s){return e.getCompDetails(t,rie,s,n)}function NL(e,t){return AL(e,t,HE)}function GE(e,t,n){return e.mergeParams(t,HE,n)}function tp(e){const t=e;return(t==null?void 0:t.getFrameworkComponentInstance)!=null?t.getFrameworkComponentInstance():e}function Rie(e){return typeof e=="object"&&!!e.getComp}var Oe={BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",SPACE:" ",LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown",DELETE:"Delete",F2:"F2",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",PAGE_HOME:"Home",PAGE_END:"End",A:"KeyA",C:"KeyC",D:"KeyD",V:"KeyV",X:"KeyX",Y:"KeyY",Z:"KeyZ"},UE=class extends ep{isPopup(){return!0}setParentComponent(e){e.addCss("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;(e==null?void 0:e.isAlive())&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},WE,zE,jE,KE,qE,YE,XE;function al(){return WE===void 0&&(WE=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),WE}function LL(){return zE===void 0&&(zE=/(firefox)/i.test(navigator.userAgent)),zE}function VL(){return jE===void 0&&(jE=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),jE}function Cc(){return KE===void 0&&(KE=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),KE}function ZE(e){if(!e)return null;const t=e.tabIndex,n=e.getAttribute("tabIndex");return t===-1&&(n===null||n===""&&!LL())?null:t.toString()}function Die(){if(XE!==void 0)return XE;if(!document.body)return-1;let e=1e6;const t=LL()?6e6:1e9,n=document.createElement("div");for(document.body.appendChild(n);;){const s=e*2;if(n.style.height=s+"px",s>t||n.clientHeight!==s)break;e=s}return n.remove(),XE=e,e}function Tie(){return YE==null&&BL(),YE}function BL(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let n=t.offsetWidth-t.clientWidth;n===0&&t.clientWidth===0&&(n=null),t.parentNode&&t.remove(),n!=null&&(YE=n,qE=n===0)}function $L(){return qE==null&&BL(),qE}var JE="T",Iie=new RegExp(`[${JE} ]`),xie=new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${JE}\\d{2}:\\d{2}:\\d{2}\\D?)?`);function Si(e,t){return e.toString().padStart(t,"0")}function Ho(e,t=!0,n=JE){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(o=>Si(o,2)).join("-");return t&&(s+=n+[e.getHours(),e.getMinutes(),e.getSeconds()].map(o=>Si(o,2)).join(":")),s}function qv(e,t=!0){return e?t?[String(e.getFullYear()),String(e.getMonth()+1),Si(e.getDate(),2),Si(e.getHours(),2),`:${Si(e.getMinutes(),2)}`,`:${Si(e.getSeconds(),2)}`]:[e.getFullYear(),e.getMonth()+1,Si(e.getDate(),2)].map(String):null}var QE=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"},HL=["January","February","March","April","May","June","July","August","September","October","November","December"],e0=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function t0(e,t){if(t==null)return Ho(e,!1);const n=Si(e.getFullYear(),4),s={YYYY:()=>n.slice(n.length-4,n.length),YY:()=>n.slice(n.length-2,n.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>HL[e.getMonth()],MMM:()=>HL[e.getMonth()].slice(0,3),MM:()=>Si(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${QE(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${QE(e.getDate())}`,DD:()=>Si(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>e0[e.getDay()],ddd:()=>e0[e.getDay()].slice(0,3),dd:()=>e0[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${QE(e.getDay())}`,d:()=>`${e.getDay()}`},o=new RegExp(Object.keys(s).join("|"),"g");return t.replace(o,r=>r in s?s[r]():r)}function Yv(e,t=!1){return!!vo(e,t)}function Fie(e){return Yv(e,!0)}function vo(e,t=!1,n){if(!e||!n&&!xie.test(e))return null;const[s,o]=e.split(Iie);if(!s)return null;const r=s.split("-").map(f=>Number.parseInt(f,10));if(r.filter(f=>!isNaN(f)).length!==3)return null;const[i,a,l]=r,c=new Date(i,a-1,l);if(c.getFullYear()!==i||c.getMonth()!==a-1||c.getDate()!==l||!o&&t)return null;if(!o||o==="00:00:00")return c;const[u,d,h]=o.split(":").map(f=>Number.parseInt(f,10));if(u>=0&&u<24)c.setHours(u);else if(t)return null;if(d>=0&&d<60)c.setMinutes(d);else if(t)return null;if(h>=0&&h<60)c.setSeconds(h);else if(t)return null;return c}function n0(e){const{inputValue:t,allSuggestions:n,hideIrrelevant:s,filterByPercentageOfBestMatch:o}=e;let r=(n??[]).map((l,c)=>({value:l,relevance:Pie(t,l),idx:c}));if(r.sort((l,c)=>l.relevance-c.relevance),s&&(r=r.filter(l=>l.relevance<Math.max(l.value.length,t.length))),r.length>0&&o&&o>0){const c=r[0].relevance*o;r=r.filter(u=>c-u.relevance<0)}const i=[],a=[];for(const l of r)i.push(l.value),a.push(l.idx);return{values:i,indices:a}}function Pie(e,t){e.length<t.length&&([e,t]=[t,e]);let n=[],s=[];const o=e.length,r=t.length;for(let a=0;a<=r;a++)n[a]=a;let i=0;for(let a=1;a<=o;a++){s[0]=a;for(let l=1;l<=r;l++){const c=e[a-1],u=t[l-1];if(c.toLocaleLowerCase()===u.toLocaleLowerCase())++i,c===u&&++i,a>1&&l>1&&e[a-2].toLocaleLowerCase()===t[l-2].toLocaleLowerCase()&&(++i,e[a-2]===t[l-2]&&++i),a<o/2-10&&++i,s[l]=n[l-1];else{const d=s[l-1],h=n[l],f=n[l-1];s[l]=1+Math.min(d,h,f)}}[n,s]=[s,n]}return n[r]/(i+1)}function GL(e){var n;return e.altKey||e.ctrlKey||e.metaKey?!1:((n=e.key)==null?void 0:n.length)===1}var s0=!1,Xv=0;function Aie(e){Xv>0||(e.addEventListener("keydown",Zv),e.addEventListener("mousedown",Zv))}function kie(e){Xv>0||(e.removeEventListener("keydown",Zv),e.removeEventListener("mousedown",Zv))}function Zv(e){const t=s0,n=e.type==="keydown";n&&(e.ctrlKey||e.metaKey||e.altKey)||t!==n&&(s0=n)}function Oie(e){const t=Ds(e);return Aie(t),Xv++,()=>{Xv--,kie(t)}}function Mie(){return s0}function pd(e,t,n=!1){const s=Soe;let o=PN;t&&(o+=", "+t),n&&(o+=', [tabindex="-1"]');const r=Array.prototype.slice.apply(e.querySelectorAll(s)).filter(l=>vi(l)),i=Array.prototype.slice.apply(e.querySelectorAll(o));return i.length?((l,c)=>l.filter(u=>c.indexOf(u)===-1))(r,i):r}function bc(e,t=!1,n=!1,s=!1){const o=pd(e,s?".ag-tab-guard":null,n),r=t?Tn(o):o[0];return r?(r.focus({preventScroll:!0}),!0):!1}function Sc(e,t,n,s){const o=pd(t,n?':not([tabindex="-1"])':null),r=Un(e);let i;n?i=o.findIndex(l=>l.contains(r)):i=o.indexOf(r);const a=i+(s?-1:1);return a<0||a>=o.length?null:o[a]}function UL(e,t=5){let n=0;for(;e&&ZE(e)===null&&++n<=t;)e=e.parentElement;return ZE(e)===null?null:e}var Nie=".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}.ag-label-align-right>*{flex:none}.ag-label-align-top{align-items:flex-start;flex-direction:column;>*{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}",Lie=class extends ep{constructor(e,t,n){super(t,n),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{},this.registerCSS(Nie)}postConstruct(){this.addCss("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:n,labelAlignment:s,disabled:o}=this.config;o!=null&&this.setDisabled(o),e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),n!=null&&this.setLabelWidth(n),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){const{label:e,eLabel:t}=this;ks(t),typeof e=="string"?t.innerText=e+this.labelSeparator:e&&t.appendChild(e),e===""?(Bn(t,!1),el(t,"presentation")):(Bn(t,!0),el(t,null))}setLabelSeparator(e){return this.labelSeparator===e?this:(this.labelSeparator=e,this.label!=null&&this.refreshLabel(),this)}getLabelId(){const e=this.eLabel;return e.id=e.id||`ag-${this.getCompId()}-label`,e.id}getLabel(){return this.label}setLabel(e){return this.label===e?this:(this.label=e,this.refreshLabel(),this)}setLabelAlignment(e){const n=this.getGui().classList;return n.toggle("ag-label-align-left",e==="left"),n.toggle("ag-label-align-right",e==="right"),n.toggle("ag-label-align-top",e==="top"),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return this.label==null?this:(kv(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return Bf(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},WL=class extends Lie{constructor(e,t,n,s){super(e,t,n),this.className=s}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:n}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),n!=null&&this.onValueChange(n),this.className&&this.addCss(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),n=this.getLabel();n==null||n==""||ioe(e)!==null?Lf(e,""):Lf(e,t??"")}setAriaLabel(e){return od(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return yi(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e?this:(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}};function Vie(e){return{tag:"div",role:"presentation",children:[{tag:"div",ref:"eLabel",cls:"ag-input-field-label"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-input-wrapper",role:"presentation",children:[{tag:e,ref:"eInput",cls:"ag-input-field-input"}]}]}}var Ec=class extends WL{constructor(e,t,n="text",s="input"){super(e,(e==null?void 0:e.template)??Vie(s),[],t),this.inputType=n,this.displayFieldTag=s,this.eLabel=dt,this.eWrapper=dt,this.eInput=dt}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);const{eLabel:e,eWrapper:t,eInput:n,className:s}=this;e.classList.add(`${s}-label`),t.classList.add(`${s}-input-wrapper`),n.classList.add(`${s}-input`),this.addCss("ag-input-field"),n.id=n.id||`ag-${this.getCompId()}-input`;const{inputName:o,inputWidth:r}=this.config;o!=null&&this.setInputName(o),r!=null&&this.setInputWidth(r),this.addInputListeners(),this.activateTabIndex([n])}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(e){this.displayFieldTag==="input"&&(this.inputType=e,Bo(this.eInput,"type",e))}getInputElement(){return this.eInput}setInputWidth(e){return kv(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){const t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return Bo(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return od(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return Bf(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)Bo(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";Bo(this.eInput,"autocomplete",t)}return this}},o0=class extends Ec{constructor(e,t="ag-checkbox",n="checkbox"){super(e,t,n),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;typeof e=="boolean"&&this.setReadOnly(e),typeof t=="boolean"&&this.setPassive(t)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){const t=this.getInputElement();return t.name=e,this}isSelected(){return this.selected}setSelected(e,t){if(this.isSelected()===e)return;this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0;const n=this.eInput;n.checked=e,n.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue)}dispatchChange(e,t,n){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:n});const s=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:s.id,name:s.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),n=this.selected=e.target.checked;this.refreshSelectedClass(n),this.dispatchChange(n,t,e)}refreshSelectedClass(e){const t=this.eWrapper.classList;t.toggle("ag-checked",e===!0),t.toggle("ag-indeterminate",e==null)}},r0={selector:"AG-CHECKBOX",component:o0},Bie=class extends o0{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedEventListeners({checkboxChanged:this.onChange.bind(this)})}onChange(e){const t=this.eInput;e.selected&&e.name&&t.name&&t.name===e.name&&e.id&&t.id!==e.id&&this.setValue(!1,!0)}},_c=class extends Ec{constructor(e,t="ag-text-field",n="text"){super(e,t,n)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){const n=this.eInput;return n.value!==e&&(n.value=ht(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`),t=n=>{GL(n)&&n.key&&!e.test(n.key)&&n.preventDefault()};this.addManagedListeners(this.eInput,{keydown:t,paste:n=>{var o;const s=(o=n.clipboardData)==null?void 0:o.getData("text");s!=null&&s.split("").some(r=>!e.test(r))&&n.preventDefault()}})}},Jv={selector:"AG-INPUT-TEXT-FIELD",component:_c},$ie=class extends Ec{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const n=super.setValue(e,t);return this.eInput.value=e,n}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},Hie={selector:"AG-INPUT-TEXT-AREA",component:$ie},i0=class extends _c{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct();const e=this.eInput;this.addManagedListeners(e,{blur:()=>{const r=Number.parseFloat(e.value),i=isNaN(r)?"":this.normalizeValue(r.toString());this.value!==i&&this.setValue(i)},wheel:this.onWheel.bind(this)}),e.step="any";const{precision:t,min:n,max:s,step:o}=this.config;typeof t=="number"&&this.setPrecision(t),typeof n=="number"&&this.setMin(n),typeof s=="number"&&this.setMax(s),typeof o=="number"&&this.setStep(o)}onWheel(e){Un(this.beans)===this.eInput&&e.preventDefault()}normalizeValue(e){return e===""?"":(this.precision!=null&&(e=this.adjustPrecision(e)),e)}adjustPrecision(e,t){const n=this.precision;if(n==null)return e;if(t){const o=Number.parseFloat(e).toFixed(n);return Number.parseFloat(o).toString()}const s=String(e).split(".");if(s.length>1){if(s[1].length<=n)return e;if(n>0)return`${s[0]}.${s[1].slice(0,n)}`}return s[0]}setMin(e){return this.min===e?this:(this.min=e,Bo(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,Bo(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,Bo(this.eInput,"step",e),this)}setValue(e,t){return this.setValueOrInputValue(n=>super.setValue(n,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(t=>super.setValue(t,!0),t=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,n){if(ht(n)){let s=this.isScientificNotation(n);if(s&&this.eInput.validity.valid)return e(n);if(!s){n=this.adjustPrecision(n);const o=this.normalizeValue(n);s=n!=o}if(s)return t(n)}return e(n)}getValue(){const e=this.eInput;if(!e.validity.valid)return;const t=e.value;return this.isScientificNotation(t)?this.adjustPrecision(t,!0):super.getValue()}isScientificNotation(e){return typeof e=="string"&&e.includes("e")}},Gie={selector:"AG-INPUT-NUMBER-FIELD",component:i0},Uie=class extends _c{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=al();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){Un(this.beans)===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?Ho(e??null,!!this.includeTime)??void 0:e;return this.min===t?this:(this.min=t,Bo(this.eInput,"min",t),this)}setMax(e){const t=e instanceof Date?Ho(e??null,!!this.includeTime)??void 0:e;return this.max===t?this:(this.max=t,Bo(this.eInput,"max",t),this)}setStep(e){return this.step===e?this:(this.step=e,Bo(this.eInput,"step",e),this)}setIncludeTime(e){return this.includeTime===e?this:(this.includeTime=e,super.setInputType(e?"datetime-local":"date"),e&&this.setStep(1),this)}getDate(){if(this.eInput.validity.valid)return vo(this.getValue())??void 0}setDate(e,t){this.setValue(Ho(e??null,this.includeTime),t)}},zL={selector:"AG-INPUT-DATE-FIELD",component:Uie},Wie=".ag-list-item{align-items:center;display:flex;height:var(--ag-list-item-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&.ag-active-item{background-color:var(--ag-row-hover-color)}}",zie="ag-active-item",jie=(e,t)=>({tag:"div",cls:`ag-list-item ag-${e}-list-item`,attrs:{role:"option"},children:[{tag:"span",ref:"eText",children:t}]}),Kie=class extends ep{constructor(e,t,n){super(jie(e,t)),this.label=t,this.value=n,this.eText=dt}postConstruct(){this.createTooltip(),this.addEventListeners()}setHighlighted(e){const t=this.getGui();t.classList.toggle(zie,e),xN(t,e),this.dispatchLocalEvent({type:"itemHighlighted",highlighted:e})}getHeight(){return this.getGui().clientHeight}setIndex(e,t){const n=this.getGui();hoe(n,e),doe(n,t)}createTooltip(){const e={getTooltipValue:()=>this.label,getGui:()=>this.getGui(),getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>bE(this.eText)},t=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("highlightTooltipFeature",!1,e,this));t&&(this.tooltipFeature=t)}addEventListeners(){const e=this.getParentComponent();e&&(this.addGuiEventListener("mouseover",()=>{e.highlightItem(this)}),this.addGuiEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),e.setValue(this.value)}))}},qie=class extends ep{constructor(e="default"){super({tag:"div",cls:`ag-list ag-${e}-list`}),this.cssIdentifier=e,this.options=[],this.listItems=[],this.highlightedItem=null,this.registerCSS(Wie)}postConstruct(){const e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()})}handleKeyDown(e){const t=e.key;switch(t){case Oe.ENTER:if(!this.highlightedItem)this.setValue(this.getValue());else{const n=this.listItems.indexOf(this.highlightedItem);this.setValueByIndex(n)}break;case Oe.DOWN:case Oe.UP:e.preventDefault(),this.navigate(t);break;case Oe.PAGE_DOWN:case Oe.PAGE_UP:case Oe.PAGE_HOME:case Oe.PAGE_END:e.preventDefault(),this.navigateToPage(t);break}}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){const{value:t,text:n}=e,s=n??t;return this.options.push({value:t,text:s}),this.renderOption(t,s),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0);for(const e of this.listItems)e.destroy();ks(this.getGui()),this.listItems=[],this.refreshAriaRole()}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(t),this;const n=this.options.findIndex(s=>s.value===e);if(n!==-1){const s=this.options[n];this.value=s.value,this.displayValue=s.text,this.highlightItem(this.listItems[n]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(t=>t.value===this.value);e!==-1&&this.highlightItem(this.listItems[e])}highlightItem(e){const t=e.getGui();if(!vi(t))return;this.clearHighlighted(),e.setHighlighted(!0),this.highlightedItem=e;const n=this.getGui(),{scrollTop:s,clientHeight:o}=n,{offsetTop:r,offsetHeight:i}=t;(r+i>s+o||r<s)&&t.scrollIntoView({block:"nearest"})}hideItemTooltip(){var e,t;(t=(e=this.highlightedItem)==null?void 0:e.tooltipFeature)==null||t.attemptToHideTooltip()}destroy(){this.hideItemTooltip(),super.destroy()}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}clearHighlighted(){var e;(e=this.highlightedItem)==null||e.setHighlighted(!1),this.highlightedItem=null}renderOption(e,t){const n=new Kie(this.cssIdentifier,t,e);n.setParentComponent(this);const s=this.createManagedBean(n);this.listItems.push(s),this.getGui().appendChild(s.getGui())}navigate(e){const t=e===Oe.DOWN;let n;const{listItems:s,highlightedItem:o}=this;if(!o)n=t?s[0]:Tn(s);else{let i=s.indexOf(o)+(t?1:-1);i=Math.min(Math.max(i,0),s.length-1),n=s[i]}this.highlightItem(n)}navigateToPage(e){const{listItems:t,highlightedItem:n}=this;if(!n||t.length===0)return;const s=t.indexOf(n),o=this.options.length-1,r=t[0].getHeight(),i=Math.floor(this.getGui().clientHeight/r);let a=-1;e===Oe.PAGE_HOME?a=0:e===Oe.PAGE_END?a=o:e===Oe.PAGE_DOWN?a=Math.min(s+i,o):e===Oe.PAGE_UP&&(a=Math.max(s-i,0)),a!==-1&&this.highlightItem(t[a])}refreshAriaRole(){el(this.getGui(),this.options.length===0?"presentation":"listbox")}updateIndices(){this.refreshAriaRole();const e=this.listItems,t=e.length;e.forEach((n,s)=>{n.setIndex(s+1,t)})}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},Yie=".ag-picker-field-display{flex:1 1 auto}.ag-picker-field{align-items:center;display:flex}.ag-picker-field-icon{border:0;cursor:pointer;display:flex;margin:0;padding:0}.ag-picker-field-wrapper{background-color:var(--ag-picker-button-background-color);border:var(--ag-picker-button-border);border-radius:5px;min-height:max(var(--ag-list-item-height),calc(var(--ag-spacing)*4));overflow:hidden;&:where(.ag-picker-has-focus),&:where(:focus-within){background-color:var(--ag-picker-button-focus-background-color);border:var(--ag-picker-button-focus-border);box-shadow:var(--ag-focus-shadow);&:where(.invalid){box-shadow:var(--ag-focus-error-shadow)}}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:disabled{opacity:.5}}",Xie={tag:"div",cls:"ag-picker-field",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-picker-field-wrapper ag-picker-collapsed",children:[{tag:"div",ref:"eDisplayField",cls:"ag-picker-field-display"},{tag:"div",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},Zie=class extends WL{constructor(e){if(super(e,(e==null?void 0:e.template)||Xie,(e==null?void 0:e.agComponents)||[],e==null?void 0:e.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=dt,this.eWrapper=dt,this.eDisplayField=dt,this.eIcon=dt,this.registerCSS(Yie),this.ariaRole=e==null?void 0:e.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:n,variableWidth:s,minPickerWidth:o,maxPickerWidth:r}=e;t!=null&&(this.pickerGap=t),this.variableWidth=!!s,n!=null&&this.setPickerMaxHeight(n),o!=null&&this.setPickerMinWidth(o),r!=null&&this.setPickerMaxWidth(r)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:n,inputWidth:s}=this.config;if(n){const o=this.beans.iconSvc.createIconNoSpan(n);o&&this.eIcon.appendChild(o)}s!=null&&this.setInputWidth(s)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),yE(e,!1),this.ariaRole&&el(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&(e==null?void 0:e.target)===t)return;e.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case Oe.UP:case Oe.DOWN:case Oe.ENTER:case Oe.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case Oe.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker());break}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const t=this.getLocaleTextFunc(),{config:{pickerAriaLabelKey:n,pickerAriaLabelValue:s,modalPicker:o=!0},maxPickerHeight:r,minPickerWidth:i,maxPickerWidth:a,variableWidth:l,beans:c,eWrapper:u}=this,d={modal:o,eChild:e,closeOnEsc:!0,closedCallback:()=>{const g=SN(c);this.beforeHidePicker(),g&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:t(n,s),anchorToElement:u};e.style.position="absolute";const h=c.popupSvc,f=h.addPopup(d);l?(i&&(e.style.minWidth=i),e.style.width=SE(xv(u)),a&&(e.style.maxWidth=a)):kv(e,a??xv(u));const p=r??`${wE(h.getPopupParent())}px`;return e.style.setProperty("max-height",p),this.alignPickerToComponent(),f.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerGap:e,config:{pickerType:t},beans:{popupSvc:n,gos:s},eWrapper:o,pickerComponent:r}=this,i=s.get("enableRtl")?"right":"left";n.positionPopupByComponent({type:t,eventSource:o,ePopup:r.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:e})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;const t=this.getAriaElement();yE(t,e);const n=this.eWrapper.classList;n.toggle("ag-picker-expanded",e),n.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){var t;(t=this.pickerComponent)!=null&&t.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&(this.hideCurrentPicker(),this.dispatchLocalEvent({type:"pickerHidden"}))}setInputWidth(e){return kv(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return typeof e=="number"&&(e=`${e}px`),this.minPickerWidth=e??void 0,this}setPickerMaxWidth(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerWidth=e??void 0,this}setPickerMaxHeight(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerHeight=e??void 0,this}destroy(){this.hidePicker(),super.destroy()}},Jie=".ag-select{align-items:center;display:flex;&.ag-disabled{opacity:.5}}:where(.ag-select){.ag-picker-field-wrapper{cursor:default}&.ag-disabled .ag-picker-field-wrapper:focus{box-shadow:none}&:not(.ag-cell-editor,.ag-label-align-top){min-height:var(--ag-list-item-height)}.ag-picker-field-display{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-picker-field-icon{align-items:center;display:flex}}:where(.ag-ltr) :where(.ag-select){.ag-picker-field-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding)/2);padding-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-select){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:calc(var(--ag-cell-horizontal-padding)/2)}}.ag-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);overflow:hidden auto}.ag-select-list-item{cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;:where(span){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}:where(.ag-ltr) .ag-select-list-item{padding-left:calc(var(--ag-cell-horizontal-padding)/2)}:where(.ag-rtl) .ag-select-list-item{padding-right:calc(var(--ag-cell-horizontal-padding)/2)}",a0=class extends Zie{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"selectOpen",ariaRole:"combobox",...e}),this.registerCSS(Jie)}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{shouldDisplayTooltip:Av(()=>this.eDisplayField),getGui:()=>this.getGui()})),super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:n}=this.config;e!=null&&this.addOptions(e),t!=null&&this.setValue(t,!0),n&&t==null&&(this.eDisplayField.textContent=n),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){const e=this.createBean(new qie("select"));this.listComponent=e,e.setParentComponent(this);const t=e.getAriaElement(),n=`ag-select-list-${e.getCompId()}`;t.setAttribute("id",n),boe(this.getAriaElement(),t),e.addManagedElementListeners(e.getGui(),{mousedown:s=>{s==null||s.preventDefault()}}),e.addManagedListeners(e,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})},fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}beforeHidePicker(){var e;(e=this.listComponent)==null||e.hideItemTooltip(),super.beforeHidePicker()}onKeyDown(e){var n;const{key:t}=e;switch(t===Oe.TAB&&this.hidePicker(),t){case Oe.ENTER:case Oe.UP:case Oe.DOWN:case Oe.PAGE_UP:case Oe.PAGE_DOWN:case Oe.PAGE_HOME:case Oe.PAGE_END:e.preventDefault(),this.isPickerDisplayed?(n=this.listComponent)==null||n.handleKeyDown(e):super.onKeyDown(e);break;case Oe.ESCAPE:super.onKeyDown(e);break;case Oe.SPACE:this.isPickerDisplayed?e.preventDefault():super.onKeyDown(e);break}}showPicker(){const e=this.listComponent;e&&(super.showPicker(),e.refreshHighlighted())}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){var e;return(e=this.listComponent)==null||e.clearOptions(),this.setValue(void 0,!0),this}setValue(e,t,n){const{listComponent:s,config:{placeholder:o},eDisplayField:r,tooltipFeature:i}=this;if(this.value===e||!s)return this;if(n||s.setValue(e,!0),s.getValue()===this.getValue())return this;let l=s.getDisplayValue();return l==null&&o&&(l=o),r.textContent=l,i==null||i.setTooltipAndRefresh(l??null),super.setValue(e,t)}destroy(){this.listComponent=this.destroyBean(this.listComponent),super.destroy()}},Qie={selector:"AG-SELECT",component:a0},eae=':where(.ag-root-wrapper,.ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart),:where(.ag-root-wrapper,.ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart) :where([class^=ag-]){box-sizing:border-box;&:after,&:before{box-sizing:border-box}&:where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}&:where(button){color:inherit}}:where(.ag-root-wrapper,ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart) :where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-popup-child{top:0;z-index:5;&:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-chart,.ag-dnd-ghost,.ag-external,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);--ag-indentation-level:0}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled,[disabled]{.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}',l0=typeof window!="object"||!((zB=(WB=window==null?void 0:window.document)==null?void 0:WB.fonts)!=null&&zB.forEach),gd=(e,t,n,s,o,r)=>{if(l0)return;s&&(e=`@layer ${CSS.escape(s)} { ${e} }`);let i=md.map.get(t);if(i||(i=[],md.map.set(t,i)),i.some(u=>u.css===e))return;const a=document.createElement("style");r&&a.setAttribute("nonce",r),a.dataset.agGlobalCss=n,a.textContent=e;const l={css:e,el:a,priority:o};let c;for(const u of i){if(u.priority>o)break;c=u}if(c){c.el.insertAdjacentElement("afterend",a);const u=i.indexOf(c);i.splice(u+1,0,l)}else t.insertBefore(a,t.querySelector(":not(title, meta)")),i.push(l)},jL=(e,t,n,s)=>{gd(eae,e,"shared",t,0,n),s==null||s.forEach((o,r)=>o.forEach(i=>gd(i,e,r,t,0,n)))},tae=e=>{md.grids.add(e)},nae=e=>{if(md.grids.delete(e),md.grids.size===0){md.map=new WeakMap;for(const t of document.head.querySelectorAll("style[data-ag-global-css]"))t.remove()}},KL,md=(KL=typeof window=="object"?window:{}).agStyleInjectionState??(KL.agStyleInjectionState={map:new WeakMap,grids:new Set}),Ei=e=>new qL(e),ll="$default",sae=0,qL=class{constructor({feature:e,params:t,modeParams:n={},css:s,cssImports:o}){this.feature=e,this.css=s,this.cssImports=o,this.modeParams={[ll]:{...n[ll]??{},...t??{}},...n}}use(e,t,n){let s=this._inject;if(s==null){let{css:o}=this;if(o){const r=`ag-theme-${this.feature??"part"}-${++sae}`;typeof o=="function"&&(o=o()),o=`:where(.${r}) {
202
202
  ${o}
@@ -256,5 +256,5 @@ See ${tL(e,t)}`;return Array.isArray(s)?s.concat(r):[s,r]}var Ige={1:"Charting A
256
256
  `)}checkProperties(e,t,n,s,o){const r=["__ob__","__v_skip","__metadata__"],i=Yge(Object.getOwnPropertyNames(e),[...r,...t,...n],n),a=Object.keys(i);for(const l of a){const c=i[l];let u=`invalid ${s} property '${l}' did you mean any of these: ${c.slice(0,8).join(", ")}.`;n.includes("context")&&(u+=`
257
257
  If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),jf(u)}if(a.length>0&&o){const l=this.beans.frameworkOverrides.getDocLink(o);jf(`to see all the valid ${s} properties please check: ${l}`)}}};function Yge(e,t,n){const s={},o=e.filter(r=>!t.some(i=>i===r));if(o.length>0)for(const r of o)s[r]=n0({inputValue:r,allSuggestions:n}).values;return s}var Xge=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),Zge={moduleName:"Validation",version:ut,beans:[qge]};function eB(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var Jge=class extends We{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){var n;const t=!!((n=this.filterManager)!=null&&n.isChildFilterPresent());this.filterNodes(t,e)}filterNodes(e,t){const n=(s,o)=>{s.hasChildren()&&e&&!o?s.childrenAfterFilter=s.childrenAfterGroup.filter(r=>{const i=r.childrenAfterFilter&&r.childrenAfterFilter.length>0,a=r.data&&this.filterManager.doesRowPassFilter({rowNode:r});return i||a}):s.childrenAfterFilter=s.childrenAfterGroup,eB(s)};if(this.doingTreeDataFiltering()){const s=(r,i)=>{if(r.childrenAfterGroup)for(let a=0;a<r.childrenAfterGroup.length;a++){const l=r.childrenAfterGroup[a],c=i||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?s(r.childrenAfterGroup[a],c):n(l,c)}n(r,i)},o=r=>s(r,!1);t.executeFromRootNode(o)}else{const s=o=>n(o,!1);t.forEachChangedNodeDepthFirst(s,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},Qge=class extends A0{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,n,s,o){this.comp=e;const r=Qf(this,this.beans.context,o);this.eButtonShowMainFilter=n,this.eFloatingFilterBody=s,this.setGui(t,r),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(r),this.setupLeft(r),this.setupHover(r),this.setupFocus(r),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(r),this.setupUi(),r.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(r);const i=()=>this.onColDefChanged(r);r.addManagedListeners(this.column,{colDefChanged:i}),r.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&i()}}),r.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,n=e.colDef;return Pt(t.gos,{colDef:n,column:e,floatingFilter:!0})}setupActive(){const e=this.column.getColDef(),t=!!e.filter,n=!!e.floatingFilter;this.active=t&&n}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=hr("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new wd(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.getLocaleTextFunc();od(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){var i;const{beans:t}=this;if(Un(t)===this.eGui)return;const o=Sc(t,this.eGui,null,e.shiftKey);if(o){(i=t.headerNavigation)==null||i.scrollToColumn(this.column),e.preventDefault(),o.focus();return}const r=this.findNextColumnWithFloatingFilter(e.shiftKey);r&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:r},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let n=this.column;do if(n=e?t.getColBefore(n):t.getColAfter(n),!n)break;while(!n.getColDef().filter||!n.getColDef().floatingFilter);return n}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case Oe.UP:case Oe.DOWN:case Oe.LEFT:case Oe.RIGHT:if(t)return;Rc(e);case Oe.ENTER:t&&bc(this.eGui)&&e.preventDefault();break;case Oe.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const n=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),s=!!e.relatedTarget&&pc(e.relatedTarget,"ag-floating-filter");if(n&&s&&e.target===this.eGui){const o=this.lastFocusEvent,r=!!(o&&o.key===Oe.TAB);if(o&&r){const i=o.shiftKey;bc(this.eGui,i)}}this.focusThis()}setupHover(e){var t;(t=this.beans.colHover)==null||t.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new P0(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){var e;this.suppressFilterButton=!((e=this.beans.menuSvc)!=null&&e.isFloatingFilterButtonEnabled(this.column)),this.highlightFilterButtonWhenActive=!$o(this.gos)}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.colFilter)==null?void 0:t.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){var t;const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;(t=this.beans.menuSvc)==null||t.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:n,gos:s}=this,o=r=>{if((r==null?void 0:r.source)==="filterDestroyed"&&(!this.isAlive()||!(t!=null&&t.isAlive())))return;const i=this.comp.getFloatingFilterComp();i&&i.then(a=>{if(a){if(s.get("enableFilterHandlers")){const u=r;let d="filter";u!=null&&u.afterFloatingFilter?d="ui":u!=null&&u.afterDataChange?d="dataChanged":(r==null?void 0:r.source)==="api"&&(d="api"),this.updateFloatingFilterParams(this.userCompDetails,d);return}const l=t==null?void 0:t.getCurrentFloatingFilterParentModel(n),c=r?{...r,columns:r.columns??[],source:r.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,c)}})};[this.destroySyncListener]=e.addManagedListeners(n,{filterChanged:o}),t!=null&&t.isFilterActive(n)&&o(null)}setupWidth(e){const t=()=>{const n=`${this.column.getActualWidth()}px`;this.comp.setWidth(n)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){var e;if(!this.suppressFilterButton&&this.comp){const t=!!((e=this.beans.filterManager)!=null&&e.isFilterAllowed(this.column));this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const n=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const s=this.beans.colFilter,o=this.active?s==null?void 0:s.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,r=this.comp.getFloatingFilterComp();!r||!o?this.updateCompDetails(e,o,n):r.then(i=>{!i||s!=null&&s.areFilterCompsDifferent(this.userCompDetails??null,o)?this.updateCompDetails(e,o,n):this.updateFloatingFilterParams(o,"colDef")})}updateCompDetails(e,t,n){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),n&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){var s;if(!e)return;let n=e.params;(s=this.comp.getFloatingFilterComp())==null||s.then(o=>{var r;typeof(o==null?void 0:o.refresh)=="function"&&(this.gos.get("enableFilterHandlers")&&(n={...n,model:Ts(((r=this.beans.colFilter)==null?void 0:r.model)??{},this.column.getColId()),source:t}),o.refresh(n))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function eme(e,t){var s;const n=e.colModel.getCol(t);if(!n){_n(12,{colKey:t});return}(s=e.menuSvc)==null||s.showColumnMenu({column:n,positionBy:"auto"})}function tme(e){var t;(t=e.menuSvc)==null||t.hidePopupMenu()}var nme={moduleName:"SharedMenu",version:ut,beans:[fce],apiFunctions:{showColumnMenu:eme,hidePopupMenu:tme}},sme=class extends Oae{postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getDefaultPopupParent(){return this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:n,event:s}=e,o=t.getBoundingClientRect(),r=this.getParentRect();this.setAlignedTo(t,n);let i=!1;const a=()=>{const l=this.keepXYWithinBounds(n,o.top-r.top,0),c=n.clientWidth>0?n.clientWidth:200;i||(n.style.minWidth=`${c}px`,i=!0);const d=r.right-r.left-c;let h;return this.gos.get("enableRtl")?(h=p(),h<0&&(h=f(),this.setAlignedStyles(n,"left")),h>d&&(h=0,this.setAlignedStyles(n,"right"))):(h=f(),h>d&&(h=p(),this.setAlignedStyles(n,"right")),h<0&&(h=0,this.setAlignedStyles(n,"left"))),{x:h,y:l};function f(){return o.right-r.left-2}function p(){return o.left-r.left-c}};this.positionPopup({ePopup:n,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",n,t,s instanceof MouseEvent?s:void 0)})}callPostProcessPopup(e,t,n,s,o){const r=this.gos.getCallback("postProcessPopup");if(r){const{column:i,rowNode:a}=e;r({column:i,rowNode:a,ePopup:n,type:t,eventSource:s,mouseEvent:o})}}getActivePopups(){return this.popupList.map(e=>e.element)}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const n of this.popupList)t.applyThemeClasses(n.wrapper)}}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return ga(e)}},Ry={moduleName:"Popup",version:ut,beans:[sme]},ome=".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;>*{cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper,:where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}:where(.ag-floating-filter-full-body)>div{flex:1 1 auto}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>*{flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));&>*{margin-bottom:var(--ag-widget-vertical-spacing)}:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}";function rme(e){const t=e.filterManager;return!!(t!=null&&t.isColumnFilterPresent())||!!(t!=null&&t.isAggregateFilterPresent())}function ime(e,t){var n;return((n=e.filterManager)==null?void 0:n.getColumnFilterInstance(t))??Promise.resolve(void 0)}function ame(e,t){var s;const n=e.colModel.getColDefCol(t);if(n)return(s=e.colFilter)==null?void 0:s.destroyFilter(n,"api")}function lme(e,t){e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=e.filterManager)==null?void 0:n.setFilterModel(t)})}function cme(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function ume(e,t,n){const{gos:s,colModel:o,colFilter:r}=e;n&&!s.get("enableFilterHandlers")&&(Je(288),n=!1);const i=o.getColDefCol(t);return i?(r==null?void 0:r.getModelForColumn(i,n))??null:null}function dme(e,t,n){var s;return((s=e.filterManager)==null?void 0:s.setColumnFilterModel(t,n))??Promise.resolve()}function hme(e,t){var s;const n=e.colModel.getCol(t);if(!n){_n(12,{colKey:t});return}(s=e.menuSvc)==null||s.showFilterMenu({column:n,containerType:"columnFilter",positionBy:"auto"})}function fme(e){var t;(t=e.menuSvc)==null||t.hideFilterMenu()}function pme(e,t){var s;const n=e.colModel.getCol(t);if(!n){_n(12,{colKey:t});return}return(s=e.colFilter)==null?void 0:s.getHandler(n,!0)}function gme(e,t){const{colModel:n,colFilter:s,gos:o}=e;if(!o.get("enableFilterHandlers")){Je(287);return}const{colId:r,action:i}=t;if(r){const a=n.getColById(r);a&&(s==null||s.updateModel(a,i))}else s==null||s.updateAllModels(i)}var mme={filterHandler:()=>({doesFilterPass:()=>!0})},vme=class extends We{constructor(){super(...arguments),this.beanName="colFilter",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=new Map,this.handlerMap={...dV},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){var n,s;this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)});const e=this.gos,t={...((s=(n=e.get("initialState"))==null?void 0:n.filter)==null?void 0:s.filterModel)??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",n){const{colModel:s,dataTypeSvc:o,filterManager:r}=this.beans;if(o!=null&&o.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const i=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,u)=>{const d=e[u];i.push(this.setModelOnFilterWrapper(c,d)),l.delete(u)}),l.forEach(c=>{const u=s.getColDefCol(c)||s.getCol(c);if(!u){Je(62,{colId:c});return}if(!u.isFilterAllowed()){Je(63,{colId:c});return}const d=this.getOrCreateFilterWrapper(u,!0);if(!d){Je(64,{colId:c});return}i.push(this.setModelOnFilterWrapper(d,e[c],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{i.push(this.setModelOnFilterWrapper(l,null))});jn.all(i).then(()=>{const l=this.getModel(!0),c=[];this.allColumnFilters.forEach((u,d)=>{const h=a?a[d]:null,f=l?l[d]:null;Mf(h,f)||c.push(u.column)}),c.length>0?r==null||r.onFilterChanged({columns:c,source:t}):n&&this.updateActive("filterChanged")})}getModel(e){var r;const t={},{allColumnFilters:n,initialModel:s,beans:{colModel:o}}=this;if(n.forEach((i,a)=>{const l=this.getModelFromFilterWrapper(i);ht(l)&&(t[a]=l)}),!e)for(const i of Object.keys(s)){const a=s[i];ht(a)&&!n.has(i)&&((r=o.getCol(i))!=null&&r.isFilterAllowed())&&(t[i]=a)}return t}setState(e,t,n="api"){if(this.state.clear(),t)for(const s of Object.keys(t)){const o=t[s];this.state.set(s,{model:Ts(this.model,s),state:o})}this.setModel(e,n,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let n=!1;return e.forEach((s,o)=>{const r=s.state;r!=null&&(n=!0,t[o]=r)}),n?t:void 0}getModelFromFilterWrapper(e){const n=e.column.getColId();if(e.isHandler)return Ts(this.model,n);const s=e.filter;return s?typeof s.getModel!="function"?(Je(66),null):s.getModel():Ts(this.initialModel,n)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return e.size?(e.forEach(t=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),!0):!1}updateActiveFilters(){const e=c=>c?c.isFilterActive?c.isFilterActive():(Je(67),!1):!1,{colModel:t,gos:n}=this.beans,s=!!NE(n),o=c=>{if(!c.isPrimary())return!0;const d=!t.isPivotActive();return!c.isValueActive()||!d?!1:t.isPivotMode()?!0:s},r=[],i=[],a=(c,u,d)=>{u&&(o(c)?r.push(d):i.push(d))},l=[];return this.allColumnFilters.forEach(c=>{const u=c.column,d=u.getColId();if(c.isHandler)l.push(jn.resolve().then(()=>{a(u,this.isHandlerActive(u),{colId:d,isHandler:!0,handler:c.handler,handlerParams:c.handlerParams})}));else{const h=ul(c);h&&l.push(h.then(f=>{a(u,e(f),{colId:d,isHandler:!1,comp:f})}))}}),jn.all(l).then(()=>{this.activeAggregateFilters=r,this.activeColumnFilters=i})}updateFilterFlagInColumns(e,t){var s;const n=[];return this.allColumnFilters.forEach(o=>{const r=o.column;if(o.isHandler)n.push(jn.resolve().then(()=>{this.setColFilterActive(r,this.isHandlerActive(r),e,t)}));else{const i=ul(o);i&&n.push(i.then(a=>{this.setColFilterActive(r,a.isFilterActive(),e,t)}))}}),(s=this.beans.groupFilter)==null||s.updateFilterFlags(e,t),jn.all(n)}doFiltersPass(e,t,n){const{data:s,aggData:o}=e,r=n?this.activeAggregateFilters:this.activeColumnFilters,i=n?o:s,a=this.model;for(let l=0;l<r.length;l++){const c=r[l],{colId:u,isHandler:d}=c;if(u!==t)if(d){const{handler:h,handlerParams:f}=c;if(!h.doesFilterPass({node:e,data:i,model:Ts(a,u),handlerParams:f}))return!1}else{const h=c.comp;if(typeof h.doesFilterPass!="function"){_n(91);continue}if(!h.doesFilterPass({node:e,data:i}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t!=null&&t.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:n}=this.beans,s=()=>{this.isAlive()&&(n==null||n.onFilterChanged(e))};t.isRefreshInProgress()?setTimeout(s,0):s()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:n}=e,s=t==null?void 0:t.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",n).then(()=>{this.allColumnFilters.forEach(o=>{var a,l,c;const{column:r,isHandler:i}=o;s!==r.getColId()&&(i&&((l=(a=o.handler).onAnyFilterChanged)==null||l.call(a)),(c=ul(o,i))==null||c.then(u=>{typeof(u==null?void 0:u.onAnyFilterChanged)=="function"&&u.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(n=>{var r,i;const s=n.isHandler;s&&((i=(r=n.handler).onNewRowsLoaded)==null||i.call(r));const o=ul(n,s);o&&t.push(o.then(a=>{var l;(l=a.onNewRowsLoaded)==null||l.call(a)}))}),jn.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:n,colModel:s}=this.beans;return(o,r)=>{const i=r?s.getCol(r):e;return i?n.getValue(i,o,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t!=null&&t.isHandler)return this.isHandlerActive(e);const n=t==null?void 0:t.filter;return n?n.isFilterActive():Ts(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=ht(Ts(this.model,e.getColId()));if(t)return t;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterActive(e):!1}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?ul(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const n=ul(t);return n?n.then(s=>({comp:s,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const n=this.getOrCreateFilterWrapper(e,t);return n!=null&&n.isHandler?n.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let n=this.cachedFilter(e);return!n&&t&&(n=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,n)),n}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>{var n;return(n=this.beans.dataTypeSvc)==null?void 0:n.getBaseDataType(e)},t)}getDefaultFilterFromDataType(e,t=!1){return mre(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":ole(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,n,s,o,r){const i=()=>{const c=this.createFilterCompParams(e,o,r),u=s(c,o);return wie(this.beans.userCompFactory,t,u,n)},a=i();return a?{compDetails:a,createFilterUi:c=>(c?i():a).newAgStackInstance()}:null}createFilterInstance(e,t,n,s){var d,h;const o=this.beans.selectableFilter;o!=null&&o.isSelectable(t)&&(t=o.getFilterDef(e,t));const{handler:r,handlerParams:i,handlerGenerator:a}=this.createHandler(e,t,n)??{},l=this.createFilterComp(e,t,n,s,!!r,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:r,handlerGenerator:a,handlerParams:i};const{compDetails:c,createFilterUi:u}=l;return this.isGlobalButtons&&((h=(d=c.params)==null?void 0:d.buttons)!=null&&h.length||Je(281,{colId:e.getColId()})),{compDetails:c,handler:r,handlerGenerator:a,handlerParams:i,createFilterUi:u}}createBaseFilterParams(e,t){const{filterManager:n,rowModel:s}=this.beans;return Pt(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:o=>(n==null?void 0:n.doesRowPassOtherFilters(e.getColId(),o))??!0,rowModel:s})}createFilterCompParams(e,t,n,s){const o=this.filterChangedCallbackFactory(e),r=this.createBaseFilterParams(e,s);if(r.filterChangedCallback=o,r.filterModifiedCallback=s?()=>{}:i=>this.filterModified(e,i),t){const i=r,a=e.getColId(),l=Ts(this.model,a);i.model=l,i.state=this.state.get(a)??{model:l},i.onModelChange=(c,u)=>{this.updateStoredModel(a,c),this.refreshHandlerAndUi(e,c,"ui",!1,u).then(()=>{o({...u,source:"columnFilter"})})},i.onStateChange=c=>{this.updateState(e,c),this.updateOrRefreshFilterUi(e)},i.onAction=(c,u,d)=>{this.updateModel(e,c,u),this.dispatchLocalEvent({type:"filterAction",column:e,action:c,event:d})},i.getHandler=()=>this.getHandler(e,!0),i.onUiChange=c=>this.filterUiChanged(e,c),i.source=n}return r}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,n){const s=t(),o={created:!0,create:t,filterParams:e.params,compDetails:e,promise:s};return s.then(n),o}createFilterWrapper(e){var a;const{compDetails:t,handler:n,handlerGenerator:s,handlerParams:o,createFilterUi:r}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),l=>l),i=e.getColId();if(n)return delete this.initialModel[i],(a=n.init)==null||a.call(n,{...o,source:"init",model:Ts(this.model,i)}),{column:e,isHandler:!0,handler:n,handlerGenerator:s,handlerParams:o,filterUi:this.createFilterUiForHandler(t,r)};if(r){const l={column:e,filterUi:null,isHandler:!1};return l.filterUi=this.createFilterUiLegacy(t,r,c=>{l.filter=c??void 0}),l}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,n){var f;const{gos:s,frameworkOverrides:o,registry:r}=this.beans;let i;const a=p=>{const g=p.filter;if(PL(g)){const v=g.handler;return v||(i=g.doesFilterPass,i?()=>({doesFilterPass:i}):void 0)}return typeof g=="string"?g:void 0},l=s.get("enableFilterHandlers"),c=l?a(t):void 0,u=p=>()=>this.createBean(r.createDynamicBean(p,!0));let d,h;if(typeof c=="string"){const p=(f=s.get("filterHandlers"))==null?void 0:f[c];p!=null?d=p:jae.has(c)&&(d=u(c),h=c)}else d=c;if(!d){let p;const{compName:g,jsComp:v,fwComp:C}=NL(o,t);g?p=g:v==null&&C==null&&t.filter===!0&&(p=n),h=this.handlerMap[p],h&&(d=u(h))}return d?{filterHandler:d,handlerNameOrCallback:i??h}:l?(rs(s)&&Je(277,{colId:e.getColId()}),mme):void 0}createHandler(e,t,n){const s=this.createHandlerFunc(e,t,n);if(!s)return;const o=GE(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:r,filterHandler:i}=s,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,i,o);return{handler:a,handlerParams:l,handlerGenerator:r??i}}createHandlerFromFunc(e,t,n){const s=e.getColDef(),o=t(Pt(this.gos,{column:e,colDef:s})),r=this.createHandlerParams(e,n);return{handler:o,handlerParams:r}}createHandlerParams(e,t){const n=e.getColDef(),s=e.getColId(),o=this.filterChangedCallbackFactory(e);return Pt(this.gos,{colDef:n,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:r=>{var i;return((i=this.beans.filterManager)==null?void 0:i.doesRowPassOtherFilters(s,r))??!0},onModelChange:(r,i)=>{this.updateStoredModel(s,r),this.refreshHandlerAndUi(e,r,"handler",!1,i).then(()=>{o({...i,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:n,groupFilter:s}=this.beans;this.allColumnFilters.forEach((r,i)=>{let a;r.column.isPrimary()?a=t.getColDefCol(i):a=t.getCol(i),!(a&&a===r.column)&&(e.push(r.column),this.disposeFilterWrapper(r,"columnChanged"),this.disposeColumnListener(i))});const o=s&&e.every(r=>s.isGroupFilter(r));e.length>0&&!o&&(n==null||n.onFilterChanged({columns:e,source:"api"}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:n,frameworkOverrides:s,selectableFilter:o}=this.beans,r=h=>{const f=this.getOrCreateFilterUi(e);f!=null&&f.then(p=>{h(tp(p))})},i=e.getColDef(),a=o!=null&&o.isSelectable(i)?o.getFilterDef(e,i):i,l=cle(s,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",c=this.gos.get("enableFilterHandlers"),u=GE(n,a,this.createFilterCompParams(e,c,"init",!0)),d=Pt(this.gos,{column:e,filterParams:u,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:r,showParentFilter:t});if(c){const h=d,f=e.getColId(),p=this.filterChangedCallbackFactory(e);h.onUiChange=g=>this.floatingFilterUiChanged(e,g),h.model=Ts(this.model,f),h.onModelChange=(g,v)=>{this.updateStoredModel(f,g),this.refreshHandlerAndUi(e,g,"floating",!0,v).then(()=>{p({...v,source:"columnFilter"})})},h.getHandler=()=>this.getHandler(e,!0),h.source="init"}return _ie(n,i,d,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,n,s){const o="paramsUpdated";if(e.isHandler){const r=t.getColId();delete this.initialModel[r],this.state.delete(r);const i=e.filterUi,a=this.createFilterUiForHandler(n,s);e.filterUi=a;const l=this.eventSvc;i!=null&&i.created?i.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:o,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:o,column:t})}else this.destroyFilter(t,o)}destroyFilter(e,t="api"){const n=e.getColId(),s=this.allColumnFilters.get(n);this.disposeColumnListener(n),delete this.initialModel[n],s&&this.disposeFilterWrapper(s,t).then(o=>{var r;o&&this.isAlive()&&((r=this.beans.filterManager)==null||r.onFilterChanged({columns:[e],source:"api"}))})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let n=!1;const{column:s,isHandler:o,filterUi:r}=e,i=s.getColId();o&&(n=this.isHandlerActive(s),this.destroyBean(e.handler),delete this.model[i],this.state.delete(i));const a=()=>{this.setColFilterActive(s,!1,"filterDestroyed"),this.allColumnFilters.delete(i),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:s})};if(r){if(r.created)return r.promise.then(l=>(n=o?n:!!(l!=null&&l.isFilterActive()),this.destroyBean(l),a(),n));a()}return jn.resolve(n)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:(t==null?void 0:t.source)??"columnFilter"})}}filterParamsChanged(e,t="api"){var v,C,S,b,w,D;const n=this.allColumnFilters.get(e);if(!n)return;const s=this.beans,o=n.column,r=o.getColDef(),i=o.isFilterAllowed(),a=this.getDefaultFilter(o),l=s.selectableFilter,c=l!=null&&l.isSelectable(r)?l.getFilterDef(o,r):r,u=i?this.createHandlerFunc(o,c,this.getDefaultFilter(o)):void 0,d=!!u,h=n.isHandler;if(h!=d){this.destroyFilter(o,"paramsUpdated");return}const{compDetails:f,createFilterUi:p}=(i?this.createFilterComp(o,c,a,R=>R,d,"colDef"):null)??{compDetails:null,createFilterUi:null},g=(f==null?void 0:f.params)??GE(s.userCompFactory,c,this.createFilterCompParams(o,d,"colDef"));if(h){const R=(u==null?void 0:u.handlerNameOrCallback)??(u==null?void 0:u.filterHandler),T=Ts(this.model,e);if(n.handlerGenerator!=R){const F=n.handler,{handler:x,handlerParams:P}=this.createHandlerFromFunc(o,u.filterHandler,g);n.handler=x,n.handlerParams=P,n.handlerGenerator=R,delete this.model[e],(v=x.init)==null||v.call(x,{...P,source:"init",model:null}),this.destroyBean(F),T!=null&&((C=this.beans.filterManager)==null||C.onFilterChanged({columns:[o],source:t}))}else{const F=this.createHandlerParams(o,f==null?void 0:f.params);n.handlerParams=F,(b=(S=n.handler).refresh)==null||b.call(S,{...F,source:"colDef",model:T})}}if(this.areFilterCompsDifferent(((w=n.filterUi)==null?void 0:w.compDetails)??null,f)||!n.filterUi||!f){this.destroyFilterUi(n,o,f,p);return}n.filterUi.filterParams=g,(D=ul(n,h))==null||D.then(R=>{(R!=null&&R.refresh?R.refresh(g):!0)===!1?this.destroyFilterUi(n,o,f,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:o,params:g})})}refreshHandlerAndUi(e,t,n,s,o){const r=this.cachedFilter(e);if(!r)return s&&this.getOrCreateFilterWrapper(e,!0),jn.resolve();if(!r.isHandler)return jn.resolve();const{filterUi:i,handler:a,handlerParams:l}=r;return Kae(()=>{if(i){const{created:c,filterParams:u}=i;if(c)return i.promise.then(d=>d?{filter:d,filterParams:u}:void 0);i.refreshed=!0}return jn.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},n,o)}setColumnFilterWrapper(e,t){const n=e.getColId();this.allColumnFilters.set(n,t),this.allColumnListeners.set(n,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(n)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:n}=e,{componentClass:s}=t;return!(n===s||(n==null?void 0:n.render)&&(s==null?void 0:s.render)&&n.render===s.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const n=this.getOrCreateFilterUi(t);return n?new Promise(s=>{n.then(o=>{s(tp(o))})}):Promise.resolve(null)}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:e,source:t})=>this.setModel(e,t)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:e,model:t,resolve:n})=>{this.setModelForColumn(e,t).then(()=>n())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:s,model:o}=this,r=e.getColId(),i=s.get(r);return i?i.model??null:Ts(o,r)}const n=this.cachedFilter(e);return n?this.getModelFromFilterWrapper(n):null}setModelForColumn(e,t){var n;if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){let s=()=>{};const o=new Promise(r=>{s=r});return this.columnModelUpdates.push({key:e,model:t,resolve:s}),o}return new Promise(s=>{this.setModelForColumnLegacy(e,t).then(o=>s(o))})}getStateForColumn(e){return this.state.get(e)??{model:Ts(this.model,e)}}setModelForColumnLegacy(e,t){const n=this.beans.colModel.getColDefCol(e),s=n?this.getOrCreateFilterWrapper(n,!0):null;return s?this.setModelOnFilterWrapper(s,t):jn.resolve()}setColDefPropsForDataType(e,t,n){var u;const s=e.filter,o=s===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):s;if(typeof o!="string")return;let r,i;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;o==="agMultiColumnFilter"?{filterParams:r,filterValueGetter:i}=((u=a.multiFilter)==null?void 0:u.getParamsForDataType(l,c,t,n))??{}:{filterParams:r,filterValueGetter:i}=tle(o,l,c,t,n,a,this.getLocaleTextFunc()),e.filterParams=r,i&&(e.filterValueGetter=i)}setColFilterActive(e,t,n,s){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",n)),e.dispatchColEvent("filterChanged",n,s)}setModelOnFilterWrapper(e,t,n){return new jn(s=>{if(e.isHandler){const r=e.column,i=r.getColId(),a=this.model[i];if(this.updateStoredModel(i,t),n&&t===a){s();return}this.refreshHandlerAndUi(r,t,"api").then(()=>s());return}const o=ul(e);if(o){o.then(r=>{if(typeof(r==null?void 0:r.setModel)!="function"){Je(65),s();return}(r.setModel(t)||jn.resolve()).then(()=>s())});return}s()})}updateStoredModel(e,t){ht(t)?this.model[e]=t:delete this.model[e];const n=this.state.get(e),s={model:t,state:n==null?void 0:n.state};this.state.set(e,s)}filterModified(e,t){var n;(n=this.getOrCreateFilterUi(e))==null||n.then(s=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:s,...t})})}filterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"filterUiChanged",column:e,...t})}floatingFilterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:e,...t})}updateModel(e,t,n){var i;const s=e.getColId(),o=this.cachedFilter(e),r=()=>o==null?void 0:o.filterUi;pV(t,r,()=>Ts(this.model,s),()=>this.state.get(s),a=>this.updateState(e,a),a=>{var l,c;return(c=(l=r())==null?void 0:l.filterParams)==null?void 0:c.onModelChange(a,n)},o!=null&&o.isHandler?(i=o.handler.processModelToApply)==null?void 0:i.bind(o.handler):void 0)}updateAllModels(e,t){const n=[];this.allColumnFilters.forEach((s,o)=>{var i;const r=this.beans.colModel.getColDefCol(o);r&&pV(e,()=>s.filterUi,()=>Ts(this.model,o),()=>this.state.get(o),a=>this.updateState(r,a),a=>{this.updateStoredModel(o,a),this.dispatchLocalEvent({type:"filterAction",column:r,action:e}),n.push(this.refreshHandlerAndUi(r,a,"ui"))},s!=null&&s.isHandler?(i=s.handler.processModelToApply)==null?void 0:i.bind(s.handler):void 0)}),n.length&&jn.all(n).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();fV(()=>{var n;return(n=this.cachedFilter(e))==null?void 0:n.filterUi},()=>Ts(this.model,t),()=>this.state.get(t))}updateState(e,t){this.state.set(e.getColId(),t),this.dispatchLocalEvent({type:"filterStateChanged",column:e,state:t})}canApplyAll(){const{state:e,model:t,activeFilterComps:n}=this;for(const o of n)if(o.source==="COLUMN_MENU")return!1;let s=!1;for(const o of e.keys()){const r=e.get(o);if(r.valid===!1)return!1;(r.model??null)!==Ts(t,o)&&(s=!0)}return s}hasUnappliedModel(e){var s;const{model:t,state:n}=this;return(((s=n.get(e))==null?void 0:s.model)??null)!==Ts(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;const n=this.beans.filterPanelSvc;return n!=null&&n.isActive?!!n.getState(e.getColId()):!1}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function yme(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function wme(e,t="api"){var n;(n=e.filterManager)==null||n.onFilterChanged({source:t})}var Cme=class extends We{constructor(){super(...arguments),this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(e){this.quickFilter=e.quickFilter,this.advancedFilter=e.advancedFilter,this.colFilter=e.colFilter}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:s})=>this.onAdvFilterEnabledChanged(s),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter&&this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});const{gos:n}=this;this.alwaysPassFilter=n.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=n.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"&&t(e)}setFilterState(e,t,n="api"){var s;this.isAdvFilterEnabled()||(s=this.colFilter)==null||s.setState(e,t,n)}setFilterModel(e,t="api",n){var s;if(this.isAdvFilterEnabled()){n||this.warnAdvFilters();return}(s=this.colFilter)==null||s.setModel(e,t)}getFilterModel(){var e;return((e=this.colFilter)==null?void 0:e.getModel())??{}}getFilterState(){var e;return(e=this.colFilter)==null?void 0:e.getState()}isColumnFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isFilterPresent())}isAggregateFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isAggFilterPresent())}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(e){var t,n;e?(t=this.colFilter)!=null&&t.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):(n=this.advancedFilter)!=null&&n.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){var e;return!!((e=this.advancedFilter)!=null&&e.isEnabled())}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){NE(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:n,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):jn.resolve()).then(()=>{var r;const o={source:t,type:"filterChanged",columns:s};n&&so(o,n),this.eventSvc.dispatchEvent(o),(r=this.colFilter)==null||r.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.colFilter)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilter)!=null&&e.isFilterPresent())}updateAggFiltering(){this.aggFiltering=!!NE(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,colIdToSkip:e})}doesRowPassAggregateFilters(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.externalFilterPresent&&!this.doesExternalFilterPass(t)||this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip)||this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(t))}isFilterAllowed(e){var t;return this.isAdvFilterEnabled()?!1:!!((t=this.colFilter)!=null&&t.isFilterAllowed(e))}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){var n;if(this.isAdvFilterEnabled()){if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){this.advFilterModelUpdateQueue.push(e);return}this.advancedFilter.setModel(e??null),this.onFilterChanged({source:t})}}toggleAdvFilterBuilder(e,t){this.isAdvFilterEnabled()&&this.advancedFilter.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvFilterColumns(){this.isAdvFilterEnabled()&&this.advancedFilter.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){var e;return this.isAdvFilterEnabled()?!1:!!((e=this.colFilter)!=null&&e.hasFloatingFilters())}getColumnFilterInstance(e){var t;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):((t=this.colFilter)==null?void 0:t.getFilterInstance(e))??Promise.resolve(void 0)}warnAdvFilters(){Je(68)}setupAdvFilterHeaderComp(e){var t;(t=this.advancedFilter)==null||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(const e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){var n;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):((n=this.colFilter)==null?void 0:n.setModelForColumn(e,t))??Promise.resolve()}},bme=class extends We{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){var e;(e=this.hidePopup)==null||e.call(this)}showMenuAfterMouseEvent(e,t,n,s){e&&!e.isColumn||this.showPopup(e,o=>{var r;(r=this.popupSvc)==null||r.positionPopupUnderMouseEvent({column:e,type:n,mouseEvent:t,ePopup:o})},n,t.target,$o(this.gos),s)}showMenuAfterButtonClick(e,t,n,s){if(e&&!e.isColumn)return;let o=-1,r="left";const i=$o(this.gos);!i&&this.gos.get("enableRtl")&&(o=1,r="right");const a=i?void 0:4*o,l=i?void 0:4;this.showPopup(e,c=>{var u;(u=this.popupSvc)==null||u.positionPopupByComponent({type:n,eventSource:t,ePopup:c,nudgeX:a,nudgeY:l,alignSide:r,keepWithinBounds:!0,position:"under",column:e})},n,t,i,s)}showPopup(e,t,n,s,o,r){var g;const i=e?this.createBean(new Qae(e,"COLUMN_MENU")):void 0;if(this.activeMenu=i,!(i!=null&&i.hasFilter())||!e){_n(57);return}const a=as({tag:"div",cls:`ag-menu${o?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:v=>this.trapFocusWithin(v,a)}),a.appendChild(i==null?void 0:i.getGui());let l;const c=()=>i==null?void 0:i.afterGuiDetached(),u=vre(this.gos)?s??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,d=v=>{VV(e,!1,"contextMenu");const C=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),C&&s&&vi(s)){const S=UL(s);S==null||S.focus({preventScroll:!0})}c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,n,e),r==null||r()},h=this.getLocaleTextFunc(),f=o&&n!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),p=(g=this.popupSvc)==null?void 0:g.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:d,positionCallback:()=>t(a),anchorToElement:u,ariaLabel:f});p&&(this.hidePopup=l=p.hideFunc),i.afterInit().then(()=>{t(a),i.afterGuiAttached({container:n,hidePopup:l})}),VV(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,n,e)}trapFocusWithin(e,t){e.key!==Oe.TAB||e.defaultPrevented||Sc(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),bc(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,n){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:n??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},Sme=class extends We{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,n){if(!t)return;const s=e.getColDef(),{selectableFilter:o,valueSvc:r}=this.beans,i=n??(o==null?void 0:o.getFilterValueGetter(e.getColId()))??s.filterValueGetter;return i?this.executeFilterValueGetter(i,t.data,e,t,s):r.getValue(e,t)}executeFilterValueGetter(e,t,n,s,o){const{expressionSvc:r,valueSvc:i}=this.beans,a=Pt(this.gos,{data:t,node:s,column:n,colDef:o,getValue:i.getValueCallback.bind(i,s)});return typeof e=="function"?e(a):r==null?void 0:r.evaluate(e,a)}},Eme={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},_me=class extends Cn{constructor(){super(Eme,[Jv]),this.eFloatingFilterText=dt}init(e){this.params=e;const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0);if(this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const n=e,s=n.getHandler();if(s.getModelAsString){const o=s.getModelAsString(n.model);this.eFloatingFilterText.setValue(o)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const n=t.getModelAsString(e);this.eFloatingFilterText.setValue(n)}})}refresh(e){this.init(e)}},c_=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const n=e.filterOptions??t;this.filterOptions!==n&&(this.filterOptions=n,this.customFilterOptions={},this.mapCustomOptions()),this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){const{filterOptions:e}=this;if(e)for(const t of e){if(typeof t=="string")continue;const n=[["displayKey"],["displayName"],["predicate","test"]],s=o=>o.some(r=>t[r]!=null)?!0:(Je(72,{keys:o}),!1);if(!n.every(s)){this.filterOptions=e.filter(o=>o===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const n=t[0];if(typeof n=="string")return n;if(n.displayKey)return n.displayKey;Je(73)}else Je(74)}getCustomOption(e){return this.customFilterOptions[e]}};function pp(e,t,n){return n==null?e.splice(t):e.splice(t,n)}function Dy(e){return e==null||typeof e=="string"&&e.trim().length===0}function Rme(e){return e==="AND"||e==="OR"?e:"AND"}function Dme(e,t,n){if(e==null)return;const{predicate:s}=e;if(s!=null&&!t.some(o=>o==null))return s(t,n)}function Tme(e,t){let n=e.length;return n>t&&(e.splice(t),Je(78),n=t),n}function gp(e,t){const n=t.getCustomOption(e);if(n){const{numberOfInputs:o}=n;return o??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}var u_=class extends lle{constructor(e,t,n){super(e,"simple-filter"),this.mapValuesFromModel=t,this.defaultOptions=n,this.eTypes=[],this.eJoinPanels=[],this.eJoinAnds=[],this.eJoinOrs=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}setParams(e){super.setParams(e);const t=new c_;this.optionsFactory=t,t.init(e,this.defaultOptions),this.commonUpdateSimpleParams(e),this.createOption(),this.createMissingConditionsAndOperators()}updateParams(e,t){this.optionsFactory.refresh(e,this.defaultOptions),super.updateParams(e,t),this.commonUpdateSimpleParams(e)}commonUpdateSimpleParams(e){this.setNumConditions(e),this.defaultJoinOperator=Rme(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions();const t=this.getGui();this.isReadOnly()?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex")}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,n)=>{const s=n===0?e:this.optionsFactory.defaultOption;t.setValue(s,!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){const n=!e.operator,s=!t.operator;if(!n&&s||n&&!s)return!1;let r;if(n){const i=e,a=t;r=this.areSimpleModelsEqual(i,a)}else{const i=e,a=t;r=i.operator===a.operator&&il(i.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return r}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),jn.resolve();if(e.operator){const s=e;let o=s.conditions;o==null&&(o=[],Je(77));const r=Tme(o,this.maxNumConditions),i=this.getNumConditions();if(r<i)this.removeConditionsAndOperators(r);else if(r>i)for(let l=i;l<r;l++)this.createJoinOperatorPanel(),this.createOption();const a=s.operator==="OR";this.eJoinAnds.forEach(l=>l.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),o.forEach((l,c)=>{this.eTypes[c].setValue(l.type,!0),this.setConditionIntoUi(l,c)})}else{const s=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(s.type,!0),this.setConditionIntoUi(s,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),jn.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(Je(79),t=1),this.maxNumConditions=t;let n=e.numAlwaysVisibleConditions??1;n<1&&(Je(80),n=1),n>t&&(Je(81),n=t),this.numAlwaysVisibleConditions=n}createOption(){const e=this.getGui(),t=this.createManagedBean(new a0);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const n=this.createEValue();this.eConditionBodies.push(n),e.appendChild(n),this.putOptionsIntoDropdown(t),this.resetType(t);const s=this.getNumConditions()-1;this.forEachPositionInput(s,o=>this.resetInput(o)),this.addChangedListeners(t,s)}createJoinOperatorPanel(){const e=as({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),n=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const s=this.eJoinPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,o),this.resetJoinOperatorOr(n,s,o),this.isReadOnly()||(t.onValueChange(this.listener),n.onValueChange(this.listener))}createJoinOperator(e,t,n){const s=this.createManagedBean(new Bie);e.push(s);const o="ag-filter-condition-operator";return s.addCss(o),s.addCss(`${o}-${n}`),t.appendChild(s.getGui()),s}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map(e=>typeof e=="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const n of t)e.addOption(n);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,n=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:n?this.getLocaleTextFunc()(n.displayKey,n.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let n=0;n<this.getNumConditions();n++)this.isConditionUiComplete(n)?e=n:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const n=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<n){this.removeConditionsAndOperators(n+1);const s=e+1,o=n-s;o>0&&this.removeConditionsAndOperators(s,o),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((s,o)=>{const r=this.isConditionDisabled(o,e);s.setDisabled(r||this.filterListOptions.length<=1),o===1&&(Bf(this.eJoinPanels[0],r),this.eJoinAnds[0].setDisabled(r),this.eJoinOrs[0].setDisabled(r))}),this.eConditionBodies.forEach((s,o)=>{Bn(s,this.isConditionBodyVisible(o))});const n=(t??this.getJoinOperator())==="OR";for(const s of this.eJoinAnds)s.setValue(!n,!0);for(const s of this.eJoinOrs)s.setValue(n,!0);this.forEachInput((s,o,r,i)=>{this.setElementDisplayed(s,o<i),this.setElementDisabled(s,this.isConditionDisabled(r,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:n,eConditionBodies:s,eJoinPanels:o,eJoinAnds:r,eJoinOrs:i}=this;this.removeComponents(n,e,t),this.removeElements(s,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(o,a,t),this.removeComponents(r,a,t),this.removeComponents(i,a,t)}removeElements(e,t,n){const s=pp(e,t,n);for(const o of s)Br(o)}removeComponents(e,t,n){const s=pp(e,t,n);for(const o of s)Br(o.getGui()),this.destroyBean(o)}afterGuiAttached(e){var t;if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus)){let n;if(!this.isReadOnly()){const s=this.getInputs(0)[0];s instanceof Ec&&this.isConditionBodyVisible(0)?n=s.getInputElement():n=(t=this.eTypes[0])==null?void 0:t.getFocusableElement()}(n??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){var i;super.afterGuiDetached();const e=this.params;if((i=this.beans.colFilter)!=null&&i.shouldKeepStateOnDetach(e.column))return;e.onStateChange({model:e.model});let t=-1,n=-1,s=!1;const o=this.getJoinOperator();for(let a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))t===-1&&(t=a,n=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),c=a<t;(l||c)&&(this.removeConditionsAndOperators(a,1),s=!0,c&&n--)}let r=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),r=!0),this.shouldAddNewConditionAtEnd(n===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),r=!0),r&&this.updateConditionStatusesAndValues(n,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=n}getModelAsString(e){var t,n;return((n=(t=this.params.getHandler())==null?void 0:t.getModelAsString)==null?void 0:n.call(t,e))??""}getPlaceholderText(e,t){let n=this.translate(e);if(typeof this.filterPlaceholder=="function"){const s=this.eTypes[t].getValue(),o=this.translate(s);n=this.filterPlaceholder({filterOptionKey:s,filterOption:o,placeholder:n})}else typeof this.filterPlaceholder=="string"&&(n=this.filterPlaceholder);return n}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,n,s,o)=>{if(!(t instanceof Ec))return;const r=n===0&&o>1?"inRangeStart":n===0?"filterOoo":"inRangeEnd",i=n===0&&o>1?e("ariaFilterFromValue","Filter from value"):n===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(r,s)),t.setInputAriaLabel(i)})}setElementValue(e,t,n){e instanceof Ec&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){xL(e)&&Bn(e.getGui(),t)}setElementDisabled(e,t){xL(e)&&Bf(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Ec&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,n)=>{this.forEachPositionTypeInput(n,t,e)})}forEachPositionInput(e,t){const n=this.getConditionType(e);this.forEachPositionTypeInput(e,n,t)}forEachPositionTypeInput(e,t,n){const s=gp(t,this.optionsFactory),o=this.getInputs(e);for(let r=0;r<o.length;r++){const i=o[r];i!=null&&n(i,r,e,s)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return gp(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(n=>n==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinAnds.forEach((t,n)=>this.resetJoinOperatorAnd(t,n,this.joinOperatorId+n)),this.eJoinOrs.forEach((t,n)=>this.resetJoinOperatorOr(t,n,this.joinOperatorId+n)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.updateUiVisibility(),e||this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){const n=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(n).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),n)}resetJoinOperatorOr(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),n)}resetJoinOperator(e,t,n,s,o){this.updateJoinOperatorDisabled(e.setValue(n,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(s),t)}updateJoinOperatorsDisabled(){const e=(t,n)=>this.updateJoinOperatorDisabled(t,n);this.eJoinAnds.forEach(e),this.eJoinOrs.forEach(e)}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const n=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((s,o,r)=>{r===t&&this.setElementValue(s,n[o]!=null?n[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,n,s)=>{this.setElementValue(t,n===0&&s===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,n=>{this.attachElementOnChange(n,this.listener)}))}hasInvalidInputs(){return!1}isReadOnly(){return!!this.params.readOnly}},tB=class{constructor(e,t,n,s,o,r){this.alive=!0,this.context=e,this.eParent=o;const i=Cie(t,n,s);i&&i.newAgStackInstance().then(a=>{var u,d;if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;o.appendChild(a.getGui()),(u=a==null?void 0:a.afterGuiAttached)==null||u.call(a);const{tempValue:l,disabled:c}=this;l&&a.setDate(l),c!=null&&((d=a.setDisabled)==null||d.call(a,c)),r==null||r(this)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){const t=this.dateComp;t?t.setDate(e):this.tempValue=e}setDisabled(e){var n;const t=this.dateComp;t?(n=t.setDisabled)==null||n.call(t,e):this.disabled=e}setDisplayed(e){Bn(this.eParent,e)}setInputPlaceholder(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputPlaceholder)==null||n.call(t,e)}setInputAriaLabel(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputAriaLabel)==null||n.call(t,e)}afterGuiAttached(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.afterGuiAttached)==null||n.call(t,e)}updateParams(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.refresh)==null||n.call(t,e)}},d_=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function nB(e,t){const{dateFrom:n,dateTo:s,type:o}=e||{};return[n&&vo(n,void 0,!0)||null,s&&vo(s,void 0,!0)||null].slice(0,gp(o,t))}var sB=1e3,oB=1/0,Ime=class extends u_{constructor(){super("dateFilter",nB,d_),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=sB,this.maxValidYear=oB,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=(l,c)=>{const u=e[l];if(u!=null)if(isNaN(u))Je(82,{param:l});else return u==null?c:Number(u);return c},n=t("minValidYear",sB),s=t("maxValidYear",oB);this.minValidYear=n,this.maxValidYear=s,n>s&&Je(83);const{minValidDate:o,maxValidDate:r}=e,i=o instanceof Date?o:vo(o);this.minValidDate=i;const a=r instanceof Date?r:vo(r);this.maxValidDate=a,i&&a&&i>a&&Je(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:n,gos:s},params:o}=this,r=new tB(n,t,o.colDef,Pt(s,{onDateChanged:()=>this.onUiChanged(),filterParams:o,location:"filter"}),e);return this.addDestroyFunc(()=>r.destroy()),r}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=as({tag:"div",cls:"ag-filter-body"});return this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,n,s){const o=as({tag:"div",cls:`ag-filter-${s} ag-filter-date-${s}`});t.push(o),e.appendChild(o),n.push(this.createDateCompWrapper(o))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),pp(this.eConditionPanelsFrom,e,t),pp(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,n){const s=pp(e,t,n);for(const o of s)o.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:n,minValidYear:s,maxValidYear:o}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<s)return!1;if(n){if(e>n)return!1}else if(e.getUTCFullYear()>o)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((n,s,o,r)=>{o!==e||!t||s>=r||(t=t&&this.isValidDateValue(n.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),n={},s=this.getValues(e),o=this.params.useIsoSeparator?"T":" ";return s.length>0&&(n.dateFrom=Ho(s[0],!0,o)),s.length>1&&(n.dateTo=Ho(s[1],!0,o)),{dateFrom:null,dateTo:null,filterType:this.filterType,type:t,...n}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),n=e("ariaFilterValue","Filter Value");this.forEachInput(s=>{s.setInputPlaceholder(t),s.setInputAriaLabel(n)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,r)=>{s<r&&t.push(n.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},rB=class extends We{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,n=new c_;this.optionsFactory=n,n.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(n,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,n=this.optionsFactory;n.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:n,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(t==null)return!0;const{operator:n}=t,s=[];if(n){const i=t;s.push(...i.conditions??[])}else s.push(t);const o=n&&n==="OR"?"some":"every",r=this.params.getValue(e.node);return s[o](i=>this.individualConditionPasses(e,i,r))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:n,maxNumConditions:s}}=e;if(t==null)return;let r=CV(t)?t.conditions:[t];const i=(n==null?void 0:n.map(u=>typeof u=="string"?u:u.displayKey))??this.defaultOptions;if(!(!r||r.every(u=>i.find(d=>d===u.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const c=this.filterType;if((r&&!r.every(u=>u.filterType===c)||t.filterType!==c)&&(r=r.map(u=>({...u,filterType:c})),l=!0),typeof s=="number"&&r&&r.length>s&&(r=r.slice(0,s),l=!0),l){const u=r.length>1?{...t,filterType:c,conditions:r}:{...r[0],filterType:c};this.params={...e,model:u},e.onModelChange(u)}}individualConditionPasses(e,t,n){const s=this.optionsFactory,o=this.mapValuesFromModel(t,s),r=s.getCustomOption(t.type),i=Dme(r,o,n);return i??(n==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(o,n,t,e))}},iB=class extends rB{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:n,includeBlanksInGreaterThan:s,includeBlanksInLessThan:o,includeBlanksInRange:r}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(n)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(s)return!0;break;case"lessThan":case"lessThanOrEqual":if(o)return!0;break;case"inRange":if(r)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,n){const s=n.type;if(!this.isValid(t))return s==="notEqual"||s==="notBlank";const o=this.comparator(),r=e[0]!=null?o(e[0],t):0;switch(s){case"equals":return r===0;case"notEqual":return r!==0;case"greaterThan":return r>0;case"greaterThanOrEqual":return r>=0;case"lessThan":return r<0;case"lessThanOrEqual":return r<=0;case"inRange":{const i=o(e[1],t);return this.params.filterParams.inRangeInclusive?r>=0&&i<=0:r>0&&i<0}case"blank":return Dy(t);case"notBlank":return!Dy(t);default:return Je(76,{filterModelType:s}),!0}}},aB={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},xme={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},h_=class extends We{constructor(e,t,n){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=n}getModelAsString(e,t){const n=this.getLocaleTextFunc(),s=t==="filterToolPanel";if(!e)return s?dl(this,"filterSummaryInactive"):null;if(e.operator!=null){const r=e,a=(r.conditions??[]).map(c=>this.getModelAsString(c,t)),l=r.operator==="AND"?"andCondition":"orCondition";return a.join(` ${dl(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return s?dl(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):n(e.type,e.type);{const r=e,i=this.optionsFactory.getCustomOption(r.type),{displayKey:a,displayName:l,numberOfInputs:c}=i||{};return a&&l&&c===0?n(a,l):this.conditionToString(r,s,r.type==="inRange"||c===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:n}=e;this.optionsFactory=t,this.filterParams=n}conditionForToolPanel(e,t,n,s,o,r){let i;const a=this.getTypeKey(e);return a&&(i=dl(this,a)),o&&r&&(i=this.getLocaleTextFunc()(o,r)),i!=null?t?`${i} ${dl(this,"filterSummaryInRangeValues",[n(),s()])}`:`${i} ${n()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.valueFormatter;return t?t(e??null)??"":String(e)}},lB=class extends h_{constructor(e,t){super(e,t,n=>{const{dataTypeSvc:s,valueSvc:o}=this.beans,r=t.column,i=s==null?void 0:s.getDateFormatterFunction(r),a=i?i(n??void 0):n;return o.formatValue(r,null,a)}),this.filterTypeKeys=aB}conditionToString(e,t,n,s,o){const{type:r}=e,i=vo(e.dateFrom),a=vo(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>t0(h,l),u=()=>i!==null?c(i):"null",d=()=>a!==null?c(a):"null";if(t){const h=this.conditionForToolPanel(r,n,u,d,s,o);if(h!=null)return h}return n?`${u()}-${d()}`:i!=null?c(i):`${r}`}};function Fme(e,t){const n=t;return n<e?-1:n>e?1:0}var Pme=class extends iB{constructor(){super(nB,d_),this.filterType="date",this.FilterModelFormatterClass=lB}comparator(){return this.params.filterParams.comparator??Fme}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},cB=class extends Cn{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}const t=e.operator;let n;t?n=e.conditions[0]:n=e,this.lastType=n.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const n=e;return this.isTypeEditable(n.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const n=e;this.onModelUpdated(n.model)}}setParams(e){const t=new c_;this.optionsFactory=t,t.init(e.filterParams,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(t,e.filterParams)),this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){const n=this.optionsFactory.defaultOption;t||(this.lastType=n),this.readOnly=!!e.filterParams.readOnly;const s=this.isTypeEditable(n);this.setEditable(s)}refresh(e){this.params=e;const t=e,n=this.reactive;if((!n||t.source==="colDef")&&this.updateParams(e),n){const{source:s,model:o}=t;if(s==="dataChanged"||s==="ui")return;this.onModelUpdated(o)}}updateParams(e){const t=this.optionsFactory;t.refresh(e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){t!=null&&t.afterFloatingFilter||t!=null&&t.afterDataChange||this.onModelUpdated(e)}hasSingleInput(e){var n;const t=(n=this.optionsFactory.getCustomOption(e))==null?void 0:n.numberOfInputs;return t==null||t==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.readOnly&&this.hasSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},Ame={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eReadOnlyText"},{tag:"div",ref:"eDateWrapper",cls:"ag-date-floating-filter-wrapper"}]},kme=class extends cB{constructor(){super(Ame,[Jv]),this.eReadOnlyText=dt,this.eDateWrapper=dt,this.FilterModelFormatterClass=lB,this.filterType="date",this.defaultOptions=d_}setParams(e){super.setParams(e),this.createDateComponent();const t=this.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}updateParams(e){super.updateParams(e),this.dateComp.updateParams(this.getDateComponentParams()),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.readOnly&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){const n=e?vo(e.dateFrom):null;this.dateComp.setDate(n),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){Bn(this.eDateWrapper,e),Bn(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){const e=this.dateComp.getDate();if(this.reactive){const t=this.params;t.onUiChange();const n=t.model,s=Ho(e),o=s==null?null:{...n??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:s};t.onModelChange(o,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t==null||t.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=m0(e,this.defaultDebounceMs);return Pt(this.gos,{onDateChanged:Os(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:n,params:s}=this;this.dateComp=new tB(e,t,s.column.getColDef(),this.getDateComponentParams(),n,o=>{o.setInputAriaLabel(this.getAriaLabel(s))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},Ome={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},Mme=class extends Cn{constructor(){super(Ome,[Jv]),this.eDateInput=dt,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled()){if(this.isApply){this.applyOnFocusOut=!e,e&&this.params.onDateChanged();return}e||this.params.onDateChanged()}}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}setParams(e){var h;const t=this.eDateInput.getInputElement(),n=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=n&&al();const{minValidYear:s,maxValidYear:o,minValidDate:r,maxValidDate:i,buttons:a,includeTime:l,colDef:c}=e.filterParams||{},u=this.beans.dataTypeSvc,d=l??((h=u==null?void 0:u.getDateIncludesTimeFlag)==null?void 0:h.call(u,c.cellDataType))??!1;if(n?d?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",r&&s&&Je(85),i&&o&&Je(86),r&&i){const[f,p]=[r,i].map(g=>g instanceof Date?g:vo(g));f&&p&&f.getTime()>p.getTime()&&Je(87)}r?r instanceof Date?t.min=t0(r):t.min=r:s&&(t.min=`${s}-01-01`),i?i instanceof Date?t.max=t0(i):t.max=i:o&&(t.max=`${o}-12-31`),this.isApply=e.location==="floatingFilter"&&!!(a!=null&&a.includes("apply"))}refresh(e){this.params=e,this.setParams(e)}getDate(){return vo(this.eDateInput.getValue())}setDate(e){var s;const t=this.params.filterParams.colDef.cellDataType,n=((s=this.beans.dataTypeSvc)==null?void 0:s.getDateIncludesTimeFlag(t))??!1;this.eDateInput.setValue(Ho(e,n))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e!=null&&e.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){var t;return((t=e==null?void 0:e.filterParams)==null?void 0:t.browserDatePicker)??!0}},f_=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function p_(e){const{allowedCharPattern:t}=e??{};return t??null}function g_(e){return e==null||isNaN(e)?null:e}function uB(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[g_(n),g_(s)].slice(0,gp(o,t))}var Nme=class extends u_{constructor(){super("numberFilter",uB,f_),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}setElementValue(e,t,n){const{numberFormatter:s}=this.params,o=!n&&s?s(t??null):t;super.setElementValue(e,o)}createEValue(){const e=p_(this.params),t=as({tag:"div",cls:"ag-filter-body",role:"presentation"});return this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,n,s){const o=this.createManagedBean(s?new _c({allowedCharPattern:s}):new i0);o.addCss(`ag-filter-${n}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const n=s=>this.removeComponents(s,e,t);n(this.eValuesFrom),n(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,r)=>{s<r&&t.push(g_(this.stringToFloat(n.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}stringToFloat(e){if(typeof e=="number")return e;let t=ia(e);t!=null&&t.trim()===""&&(t=null);const n=this.params.numberParser;return n?n(t):t==null||t.trim()==="-"?null:Number.parseFloat(t)}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},s=this.getValues(e);return s.length>0&&(n.filter=s[0]),s.length>1&&(n.filterTo=s[1]),n}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}},dB=class extends h_{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=aB}conditionToString(e,t,n,s,o){const{filter:r,filterTo:i,type:a}=e,l=this.formatValue.bind(this);if(t){const c=this.conditionForToolPanel(a,n,()=>l(r),()=>l(i),s,o);if(c!=null)return c}return n?`${l(r)}-${l(i)}`:r!=null?l(r):`${a}`}},Lme=class extends iB{constructor(){super(uB,f_),this.filterType="number",this.FilterModelFormatterClass=dB}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},hB=class extends We{constructor(e){super(),this.params=e,this.eInput=dt,this.onValueChanged=()=>{}}setupGui(e){var s;this.eInput=this.createManagedBean(new _c((s=this.params)==null?void 0:s.config));const t=this.eInput.getGui();e.appendChild(t);const n=o=>this.onValueChanged(o);this.addManagedListeners(t,{input:n,keydown:n})}setEditable(e){this.eInput.setDisabled(!e)}getValue(){return this.eInput.getValue()}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setParams({ariaLabel:e,autoComplete:t}){const{eInput:n}=this;n.setInputAriaLabel(e),t!==void 0&&n.setAutoComplete(t)}};function m_(e){const t=e==null?void 0:e.trim();return t===""?e:t}function fB(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[n||null,s||null].slice(0,gp(o,t))}var Vme={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},pB=class extends cB{constructor(){super(...arguments),this.eFloatingFilterInputContainer=dt,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(Vme)}onModelUpdated(e){this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(e))}setParams(e){this.setupFloatingFilterInputService(e),super.setParams(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.inputSvc=this.createFloatingFilterInputService(e),this.inputSvc.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){const t=e.browserAutoComplete??!1,{inputSvc:n,defaultDebounceMs:s,readOnly:o}=this;if(n.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=sy(e.filterParams),!o){const r=m0(e.filterParams,s),i=Os(this,this.syncUpWithParentFilter.bind(this),r);n.setValueChangedListener(i)}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,n=t.getValue();ks(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(n,!0)}syncUpWithParentFilter(e){const t=e.key===Oe.ENTER,n=this.reactive;if(n&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:s,params:o,lastType:r}=this;let i=s.getValue();if(o.filterParams.trimInput&&(i=m_(i),s.setValue(i,!0)),n){const a=o,l=a.model,c=this.convertValue(i),u=c==null?null:{...l??{filterType:this.filterType,type:r??this.optionsFactory.defaultOption},filter:c};a.onModelChange(u,{afterFloatingFilter:!0})}else o.parentFilterInstance(a=>{a==null||a.onFloatingFilterChanged(r||null,i||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},Bme=class extends We{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new i0),this.eTextInput=this.createManagedBean(new _c),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),n=this.eTextInput.getGui();e.appendChild(t),e.appendChild(n),this.setupListeners(t,s=>this.onValueChanged(s)),this.setupListeners(n,s=>this.onValueChanged(s))}setEditable(e){this.numberInputActive=e,this.eNumberInput.setDisplayed(this.numberInputActive),this.eTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eNumberInput.setAutoComplete(e),this.eTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}setValueChangedListener(e){this.onValueChanged=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},$me=class extends pB{constructor(){super(...arguments),this.FilterModelFormatterClass=dB,this.filterType="number",this.defaultOptions=f_}updateParams(e){p_(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=p_(e.filterParams),this.allowedCharPattern?this.createManagedBean(new hB({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new Bme)}convertValue(e){return e?Number(e):null}},v_=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],Hme=class extends u_{constructor(){super("textFilter",fB,v_),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},s=this.getValues(e);return s.length>0&&(n.filter=s[0]),s.length>1&&(n.filterTo=s[1]),n}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,r)=>{s<r&&t.push(ia(n.getValue()))}),t}createEValue(){const e=as({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:n}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,n,"to"),e}createFromToElement(e,t,n){const s=this.createManagedBean(new _c);s.addCss(`ag-filter-${n}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeEValues(e,t){const n=r=>this.removeComponents(r,e,t),{eValuesFrom:s,eValuesTo:o}=this;n(s),n(o)}},gB=class extends h_{constructor(){super(...arguments),this.filterTypeKeys=xme}conditionToString(e,t,n,s,o){const{filter:r,filterTo:i,type:a}=e;if(t){const l=u=>()=>dl(this,"filterSummaryTextQuote",[u]),c=this.conditionForToolPanel(a,n,l(r),l(i),s,o);if(c!=null)return c}return n?`${r}-${i}`:r!=null?`${r}`:`${a}`}},Gme=({filterOption:e,value:t,filterText:n})=>{if(n==null)return!1;switch(e){case"contains":return t.includes(n);case"notContains":return!t.includes(n);case"equals":return t===n;case"notEqual":return t!=n;case"startsWith":return t.indexOf(n)===0;case"endsWith":{const s=t.lastIndexOf(n);return s>=0&&s===t.length-n.length}default:return!1}},Ume=e=>e,Wme=e=>e==null?null:e.toString().toLowerCase(),zme=class extends rB{constructor(){super(fB,v_),this.filterType="text",this.FilterModelFormatterClass=gB}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??Gme,this.formatter=t.textFormatter??(t.caseSensitive?Ume:Wme)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,n,s){const o=e.map(h=>this.formatter(h))||[],r=this.formatter(t),{api:i,colDef:a,column:l,context:c,filterParams:{textFormatter:u}}=this.params;if(n.type==="blank")return Dy(t);if(n.type==="notBlank")return!Dy(t);const d={api:i,colDef:a,column:l,context:c,node:s.node,data:s.data,filterOption:n.type,value:r,textFormatter:u};return o.some(h=>this.matcher({...d,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=n=>{const s={...n},{filter:o,filterTo:r}=n;return o&&(s.filter=m_(o)??null),r&&(s.filterTo=m_(r)??null),s};return CV(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},jme=class extends pB{constructor(){super(...arguments),this.FilterModelFormatterClass=gB,this.filterType="text",this.defaultOptions=v_}createFloatingFilterInputService(){return this.createManagedBean(new hB)}};function Kme(e){var t;return!!((t=e.quickFilter)!=null&&t.isFilterPresent())}function qme(e){var t;return(t=e.quickFilter)==null?void 0:t.getText()}function Yme(e){var t;(t=e.quickFilter)==null||t.resetCache()}var Xme=class extends We{constructor(){super(...arguments),this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){const e=this.resetCache.bind(this),t=this.gos;this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{t.get("includeHiddenColumnsInQuickFilter")||this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",n=>this.setFilter(n.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(t.get("quickFilterText")),this.parser=t.get("quickFilterParser"),this.matcher=t.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){var l;const{autoColSvc:e,colModel:t,gos:n,pivotResultCols:s}=this.beans,o=t.isPivotMode(),r=e==null?void 0:e.getColumns(),i=t.getColDefCols();let a=(o&&!n.get("applyQuickFilterBeforePivotOrAgg")?(l=s==null?void 0:s.getPivotResultCols())==null?void 0:l.list:i)??[];r&&(a=a.concat(r)),this.colsToUse=n.get("includeHiddenColumnsInQuickFilter")?a:a.filter(c=>c.isVisible()||c.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(n=>t?this.doesRowPassCache(e,n):this.doesRowPassNoCache(e,n))}resetCache(){this.beans.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseFilter(e){return ht(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){Je(70,{newFilter:e});return}const t=this.parseFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),n=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,n&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(n=>{const s=this.getTextForColumn(n,e);return ht(s)&&s.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let n;e?(this.checkGenerateAggText(t),n=t.quickFilterAggregateText):n=this.getAggText(t);const{quickFilterParts:s,matcher:o}=this;return o(s,n)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let n=this.beans.filterValueSvc.getValue(e,t);const s=e.getColDef();if(s.getQuickFilterText){const o=Pt(this.gos,{value:n,node:t,data:t.data,column:e,colDef:s});n=s.getQuickFilterText(o)}return ht(n)?n.toString().toUpperCase():null}getAggText(e){const t=[];for(const n of this.colsToUse){const s=this.getTextForColumn(n,e);ht(s)&&t.push(s)}return t.join(`
258
258
  `)}},Zme={moduleName:"ClientSideRowModelFilter",version:ut,rowModels:["clientSide"],beans:[Jge]},y_={moduleName:"FilterCore",version:ut,beans:[Cme],apiFunctions:{isAnyFilterPresent:yme,onFilterChanged:wme},css:[ome],dependsOn:[Zme]},mB={moduleName:"FilterValue",version:ut,beans:[Sme]},Ty={moduleName:"ColumnFilter",version:ut,beans:[vme,bme],dynamicBeans:{headerFilterCellCtrl:Qge},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:rme,getColumnFilterInstance:ime,destroyFilter:ame,setFilterModel:lme,getFilterModel:cme,getColumnFilterModel:ume,setColumnFilterModel:dme,showColumnFilter:hme,hideColumnFilter:fme,getColumnFilterHandler:pme,doFilterAction:gme},dependsOn:[y_,Ry,mB,nme]},Jme={moduleName:"CustomFilter",version:ut,userComponents:{agReadOnlyFloatingFilter:_me},dependsOn:[Ty]},Qme={moduleName:"TextFilter",version:ut,dependsOn:[Ty],userComponents:{agTextColumnFilter:{classImp:Hme,params:{useForm:!0}},agTextColumnFloatingFilter:jme},dynamicBeans:{agTextColumnFilterHandler:zme}},eve={moduleName:"NumberFilter",version:ut,dependsOn:[Ty],userComponents:{agNumberColumnFilter:{classImp:Nme,params:{useForm:!0}},agNumberColumnFloatingFilter:$me},dynamicBeans:{agNumberColumnFilterHandler:Lme}},tve={moduleName:"DateFilter",version:ut,dependsOn:[Ty],userComponents:{agDateColumnFilter:{classImp:Ime,params:{useForm:!0}},agDateInput:Mme,agDateColumnFloatingFilter:kme},dynamicBeans:{agDateColumnFilterHandler:Pme}},nve={moduleName:"QuickFilterCore",version:ut,rowModels:["clientSide"],beans:[Xme],dependsOn:[y_,mB]},sve={moduleName:"QuickFilter",version:ut,apiFunctions:{isQuickFilterPresent:Kme,getQuickFilter:qme,resetQuickFilter:Yme},dependsOn:[nve]},ove={moduleName:"ExternalFilter",version:ut,dependsOn:[y_]},rve=".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}",w_=(e,t,n)=>{var a,l,c;const{editModelSvc:s}=e,o=(l=(a=s==null?void 0:s.getCellValidationModel())==null?void 0:a.getCellValidation(t))==null?void 0:l.errorMessages,r=(c=s==null?void 0:s.getRowValidationModel().getRowValidation(t))==null?void 0:c.errorMessages,i=o||r;return i!=null&&i.length?i.join(n("tooltipValidationErrorSeparator",". ")):void 0},ive=class extends We{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,r=l_(o),{column:i,eGui:a}=t,l=i.getColDef();!s&&r&&!l.headerComponent&&(s=Av(()=>a.querySelector(".ag-header-cell-text")));const c="header",d=this.beans.colNames.getDisplayNameForColumn(i,"header",!0),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Pt(o,{location:c,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>({column:i,colDef:i.getColDef()})};let p=this.createTooltipFeature(f);return p&&(p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip())),p}setupHeaderGroupTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,r=l_(o),{column:i,eGui:a}=t,l=i.getColGroupDef();!s&&r&&!(l!=null&&l.headerGroupComponent)&&(s=Av(()=>a.querySelector(".ag-header-group-text")));const c="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(i,"header"),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Pt(o,{location:c,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>{const g={column:i};return l&&(g.colDef=l),g}},p=this.createTooltipFeature(f);return p&&t.createBean(p)}enableCellTooltipFeature(e,t,n){const{beans:s}=this,{gos:o,editSvc:r}=s,{column:i,rowNode:a}=e;let l="cell";const c=()=>{const f=!!!(r!=null&&r.isEditing(e))&&w_(s,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=i.getColDef(),g=a.data;if(p.tooltipField&&ht(g))return up(g,p.tooltipField,i.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(Pt(o,{location:"cell",colDef:i.getColDef(),column:i,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},u=l_(o);n||(u&&!e.isCellRenderer()?n=()=>{const h=!!(r!=null&&r.isEditing(e));if(!h&&w_(s,e,this.getLocaleTextFunc()))return!0;if(!i.isTooltipEnabled())return!1;const g=Av(()=>{const v=e.eGui;return v.children.length===0?v:v.querySelector(".ag-cell-value")});return!h&&g()}:n=()=>!(r!=null&&r.isEditing(e)));const d={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:c,shouldDisplayTooltip:n,getAdditionalParams:()=>({column:i,colDef:i.getColDef(),rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(d,s)}setupFullWidthRowTooltip(e,t,n,s){const o={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>n,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:s},r=this.beans,i=r.context;e&&t.destroyBean(e,i);const a=this.createTooltipFeature(o,r);if(a)return t.createBean(a,i)}setupCellEditorTooltip(e,t){var a,l;const{beans:n}=this,{context:s}=n,o=((a=t.getValidationElement)==null?void 0:a.call(t,!0))||!((l=t.isPopup)!=null&&l.call(t))&&e.eGui;if(!o)return;const r={getGui:()=>o,getTooltipValue:()=>w_(n,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{var p,g;const{editModelSvc:c}=n,u=(p=c==null?void 0:c.getRowValidationModel())==null?void 0:p.getRowValidationMap(),d=(g=c==null?void 0:c.getCellValidationModel())==null?void 0:g.getCellValidationMap(),h=!!u&&u.size>0,f=!!d&&d.size>0;return h||f}},i=this.createTooltipFeature(r,n);if(i)return e.createBean(i,s)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=ht(t.tooltipField)||ht(t.tooltipValueGetter)||ht(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},ave=class extends Pae{createTooltipComp(e,t){const n=Eie(this.beans.userCompFactory,e);n==null||n.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){var e;(e=this.onColumnMovedEventCallback)==null||e.call(this),this.onColumnMovedEventCallback=void 0}},vB={moduleName:"Tooltip",version:ut,beans:[ive],dynamicBeans:{tooltipFeature:sV,highlightTooltipFeature:Aae,tooltipStateManager:ave},userComponents:{agTooltipComponent:Mae},dependsOn:[Ry],css:[rve]},Td=class{constructor(e){this.cellValueChanges=e}},C_=class extends Td{constructor(e,t,n,s){super(e),this.initialRange=t,this.finalRange=n,this.ranges=s}},lve=10,yB=class{constructor(e){this.actionStack=[],this.maxStackSize=e||lve,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}},cve=class extends We{constructor(){super(...arguments),this.beanName="undoRedo",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.batchEditing=!1,this.bulkEditing=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},n=this.activeCellEdit!==null&&e2(this.activeCellEdit,t),s=this.activeRowEdit!==null&&Aue(this.activeRowEdit,t);if(!(n||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:i,column:a,oldValue:l,value:c}=e,u={rowPinned:r,rowIndex:i,columnId:a.getColId(),newValue:c,oldValue:l};this.cellValueChanges.push(u)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const n=e.get("undoRedoCellEditingLimit");if(n<=0)return;this.undoStack=new yB(n),this.redoStack=new yB(n),this.addListeners();const s=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:o=>{o.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:s,newColumnsLoaded:s,columnGroupOpened:s,columnRowGroupChanged:s,columnMoved:s,columnPinned:s,columnVisible:s,rowDragEnd:s}),t.whenReady(this,o=>{this.gridBodyCtrl=o.gridBodyCtrl})}getCurrentUndoStackSize(){var e;return((e=this.undoStack)==null?void 0:e.getCurrentStackSize())??0}getCurrentRedoStackSize(){var e;return((e=this.redoStack)==null?void 0:e.getCurrentStackSize())??0}undo(e){const{eventSvc:t,undoStack:n,redoStack:s}=this;t.dispatchEvent({type:"undoStarted",source:e});const o=this.undoRedo(n,s,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:o})}redo(e){const{eventSvc:t,undoStack:n,redoStack:s}=this;t.dispatchEvent({type:"redoStarted",source:e});const o=this.undoRedo(s,n,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:o})}undoRedo(e,t,n,s,o){if(!e)return!1;const r=e.pop();return r!=null&&r.cellValueChanges?(this.processAction(r,i=>i[s],o),r instanceof C_?this.processRange(r.ranges||[r[n]]):this.processCell(r.cellValueChanges),t.push(r),!0):!1}processAction(e,t,n){for(const s of e.cellValueChanges){const{rowIndex:o,rowPinned:r,columnId:i}=s,a={rowIndex:o,rowPinned:r},l=ma(this.beans,a);l.displayed&&l.setDataValue(i,t(s),n)}}processRange(e){let t;const n=this.beans.rangeSvc;n.removeAllCellRanges(!0),e.forEach((s,o)=>{if(!s)return;const r=s.startRow,i=s.endRow;o===e.length-1&&(t={rowPinned:r.rowPinned,rowIndex:r.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:i.rowIndex,rowEndPinned:i.rowPinned,columnStart:s.startColumn,columns:s.columns};n.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:n,rowPinned:s}=t,o={rowIndex:n,rowPinned:s},r=ma(this.beans,o),i={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(i)}setLastFocusedCell(e){const{rowIndex:t,columnId:n,rowPinned:s}=e,{colModel:o,focusSvc:r,rangeSvc:i}=this.beans,a=o.getCol(n);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:s};r.setFocusedCell({...c,forceBrowserFocus:!0}),i==null||i.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Td(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const n=new Td(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Td(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new C_(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;const{rangeSvc:t,gos:n}=this.beans;t&&la(n)?e=new C_(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new Td(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1},batchEditingStarted:()=>this.startBigChange("batchEditing"),batchEditingStopped:({changes:e})=>this.stopBigChange("batchEditing",e),bulkEditingStarted:()=>this.startBigChange("bulkEditing"),bulkEditingStopped:({changes:e})=>this.stopBigChange("bulkEditing",e)})}startBigChange(e){this.updateBigChange(e,!0)}updateBigChange(e,t){e==="bulkEditing"?this.bulkEditing=t:this.batchEditing=t}stopBigChange(e,t){if(e==="bulkEditing"&&!this.bulkEditing||e==="batchEditing"&&!this.batchEditing||(this.updateBigChange(e,!1),(t==null?void 0:t.length)===0))return;const n=new Td(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},uve=".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) textarea{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}",dve={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},hve=class extends py{constructor(){super(dve,[r0]),this.eEditor=dt}initialiseEditor(e){const t=e.value??void 0,n=this.eEditor;n.setValue(t),n.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(n,{fieldValueChanged:o=>this.setAriaLabel(o.selected)})}getValue(){return this.eEditor.getValue()}focusIn(){this.eEditor.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.getLocaleTextFunc(),n=Iv(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${s} (${n})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,n=this.getValue();return t?t({value:n,internalErrors:null,cellEditorParams:e}):null}},Iy=class extends py{constructor(e){super(),this.cellEditorInput=e,this.eEditor=dt}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:n}=this,{cellStartedEdit:s,eventKey:o,suppressPreventDefault:r}=e;n.getInputElement().setAttribute("title",""),t.init(n,e);let i,a=!0;s?(this.focusAfterAttached=!0,o===Oe.BACKSPACE||o===Oe.DELETE?i="":o&&o.length===1?r?a=!1:i=o:(i=t.getStartValue(),o!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,i=t.getStartValue()),a&&i!=null&&n.setStartValue(i),this.addGuiEventListener("keydown",l=>{const{key:c}=l;(c===Oe.PAGE_UP||c===Oe.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){var s,o;const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;al()||t.getFocusableElement().focus();const n=t.getInputElement();this.highlightAllOnFocus?n.select():(o=(s=this.cellEditorInput).setCaret)==null||o.call(s)}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),n=e.getInputElement();t.focus(),n.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},fve={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},pve=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return fve}getAgComponents(){return[zL]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:r}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:n}=this,{min:s,max:o,getValidationErrors:r}=n;let i=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(s){const l=s instanceof Date?s:new Date(s);if(t<l){const c=l.toLocaleDateString();i.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(o){const l=o instanceof Date?o:new Date(o);if(t>l){const c=l.toLocaleDateString();i.push(a("maxDateValidation",`Date must be before ${c}`,[c]))}}}return i.length||(i=null),r?r({value:t,cellEditorParams:n,internalErrors:i}):i}getValue(){const{eEditor:e,params:t}=this,n=e.getDate();return!ht(n)&&!ht(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Ho(e,this.includeTime??!1)}},gve=class extends Iy{constructor(){super(new pve(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},mve={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},vve=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return mve}getAgComponents(){return[zL]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:r}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,n=e.getInputElement().value,s=this.formatDate(this.parseDate(n??void 0)),{min:o,max:r,getValidationErrors:i}=t;let a=[];if(s){const l=new Date(s),c=this.getLocaleTextFunc();if(o){const u=new Date(o);if(l<u){const d=u.toLocaleDateString();a.push(c("minDateValidation",`Date must be after ${d}`,[d]))}}if(r){const u=new Date(r);if(l>u){const d=u.toLocaleDateString();a.push(c("maxDateValidation",`Date must be before ${d}`,[d]))}}}return a.length||(a=null),i?i({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,n=this.formatDate(t.getDate());return!ht(n)&&!ht(e.value)?e.value:e.parseValue(n??"")}getStartValue(){return Ho(this.parseDate(this.params.value??void 0)??null,this.includeTime??!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):vo(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Ho(e??null,this.includeTime??!1)??void 0}},yve=class extends Iy{constructor(){super(new vve(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},wve={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},Cve=class extends py{constructor(){super(wve,[Hie]),this.eEditor=dt}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:n,eventKey:s,maxLength:o,cols:r,rows:i}=e;this.focusAfterAttached=n,t.getInputElement().setAttribute("title",""),t.setMaxLength(o||200).setCols(r||60).setRows(i||10);let a;n?(this.focusAfterAttached=!0,s===Oe.BACKSPACE||s===Oe.DELETE?a="":s&&s.length===1?a=s:(a=this.getStartValue(e),s!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,a=this.getStartValue(e)),a!=null&&t.setValue(a,!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}getStartValue(e){const{value:t}=e;return(t==null?void 0:t.toString())??t}onKeyDown(e){const t=e.key;(t===Oe.LEFT||t===Oe.UP||t===Oe.RIGHT||t===Oe.DOWN||e.shiftKey&&t===Oe.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:n}=this,s=this.getLocaleTextFunc();e.setInputAriaLabel(s("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),n&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:n}=t,s=e.getValue();return!ht(s)&&!ht(n)?n:t.parseValue(s)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,s=this.getLocaleTextFunc(),o=this.getValue();let r=[];return typeof o=="string"&&t!=null&&o.length>t&&r.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:o,internalErrors:r,cellEditorParams:e}):r}},bve={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},Sve=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return bve}getAgComponents(){return[Gie]}init(e,t){this.eEditor=e,this.params=t;const{max:n,min:s,precision:o,step:r}=t;n!=null&&e.setMax(n),s!=null&&e.setMin(s),o!=null&&e.setPrecision(o),r!=null&&e.setStep(r);const i=e.getInputElement();t.preventStepping?e.addManagedElementListeners(i,{keydown:this.preventStepping}):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:n,getValidationErrors:s}=e,r=this.eEditor.getInputElement().valueAsNumber,i=this.getLocaleTextFunc();let a=[];return typeof r=="number"&&(t!=null&&r<t&&a.push(i("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),n!=null&&r>n&&a.push(i("maxValueValidation",`Must be less than or equal to ${n}.`,[String(n)]))),a.length||(a=null),s?s({value:r,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===Oe.UP||e.key===Oe.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!ht(n)&&!ht(t.value))return t.value;let s=t.parseValue(n);if(s==null)return s;if(typeof s=="string"){if(s==="")return null;s=Number(s)}return isNaN(s)?null:s}getStartValue(){return this.params.value}setCaret(){al()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},Eve=class extends Iy{constructor(){super(new Sve(()=>this.getLocaleTextFunc()))}},_ve={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},Rve=class extends py{constructor(){super(_ve,[Qie]),this.eEditor=dt,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:n,gos:s}=this,{values:o,value:r,eventKey:i}=e;if(Vn(o)){Je(58);return}this.startedByEnter=i!=null?i===Oe.ENTER:!1;let a=!1;o.forEach(d=>{const h={value:d},f=n.formatValue(e.column,null,d),p=f!=null;h.text=p?f:d,t.addOption(h),a=a||r===d}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:u}=e;l!=null&&t.setPickerGap(l),u!=null&&t.setPickerMaxHeight(u),c!=null&&t.setPickerMaxWidth(c),s.get("editType")!=="fullRow"&&this.addManagedListeners(this.eEditor,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eEditor.showPicker()})}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:n}=e,s=this.getValue();let o=[];if(t&&!t.includes(s)){const r=this.getLocaleTextFunc();o.push(r("invalidSelectionValidation","Invalid selection."))}else o=null;return n?n({value:s,internalErrors:o,cellEditorParams:e}):o}},Dve={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},Tve=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Dve}getAgComponents(){return[Jv]}init(e,t){this.eEditor=e,this.params=t;const n=t.maxLength;n!=null&&e.setMaxLength(n)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,s=this.getValue(),o=this.getLocaleTextFunc();let r=[];return t!=null&&typeof s=="string"&&s.length>t&&r.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:s,cellEditorParams:e,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();return!ht(n)&&!ht(t.value)?t.value:t.parseValue(n)}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){al()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),n=ht(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},wB=class extends Iy{constructor(){super(new Tve(()=>this.getLocaleTextFunc()))}};function Ive(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function xve(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function CB(e,t,n="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,n),"ensureVisible")}function bB(e,t,n){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,n),"ensureVisible")}function Fve(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function Pve(e){var t;(t=e.undoRedo)==null||t.undo("api")}function Ave(e){var t;(t=e.undoRedo)==null||t.redo("api")}function kve(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function Ove(e){var s;const t=(s=e.editModelSvc)==null?void 0:s.getEditMap(),n=[];return t==null||t.forEach((o,r)=>{const{rowIndex:i,rowPinned:a}=r;o.forEach((l,c)=>{const{editorValue:u,pendingValue:d,sourceValue:h,state:f}=l,p=va(l);let g=u??d;g===pr&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:c,colId:c.getColId(),colKey:c.getColId(),rowIndex:i,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function Mve(e,t=!1){var s;const{editSvc:n}=e;if(n!=null&&n.isBatchEditing()){if(t)for(const o of((s=e.editModelSvc)==null?void 0:s.getEditPositions())??[])o.state==="editing"&&n.revertSingleCellEdit(o);else xc(e,{persist:!0});_d(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function Nve(e,t){var s;const n=Wn(e,t);return((s=e.editSvc)==null?void 0:s.isEditing(n))??!1}function Lve(e,t){const{key:n,colKey:s,rowIndex:o,rowPinned:r}=t,{editSvc:i,colModel:a}=e,l=a.getCol(s);if(!l){Je(12,{colKey:s});return}const u=ma(e,{rowIndex:o,rowPinned:r||null});if(!u){Je(290,{rowIndex:o,rowPinned:r});return}if(!l.isCellEditable(u))return;r==null&&bB(e,o),CB(e,s),i==null||i.startEditing({rowNode:u,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function Vve(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function Bve(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function $ve(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var Hve={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},Gve=class extends UE{constructor(e){super(Hve),this.params=e}postConstruct(){yc(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=s=>{_0(this.gos,s,t.node,t.column,!0)||t.onKeyDown(s)};this.addManagedElementListeners(e,{keydown:n})}};function Uve(e,{column:t},n,s,o="ui"){var c;if(n instanceof KeyboardEvent&&(n.key===Oe.TAB||n.key===Oe.ENTER||n.key===Oe.F2||n.key===Oe.BACKSPACE&&s))return!0;if((n==null?void 0:n.shiftKey)&&((c=e.rangeSvc)==null?void 0:c.getCellRanges().length)!=0)return!1;const i=t==null?void 0:t.getColDef(),a=Wve(e.gos,i),l=n==null?void 0:n.type;return l==="click"&&(n==null?void 0:n.detail)===1&&a===1||l==="dblclick"&&(n==null?void 0:n.detail)===2&&a===2?!0:o==="api"?s??!1:!1}function Wve(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function b_(e,{rowNode:t,column:n},s="ui"){const o=n.getColDef().editable,r=e.editModelSvc;return n.isColumnFunc(t,o)||!!r&&r.hasEdits({rowNode:t,column:n},{withOpenEditor:!0})}function zve(e,t,n="ui"){const s=b_(e,t,n);return s===!0||n==="ui"?s:e.colModel.getCols().some(r=>b_(e,{rowNode:t.rowNode,column:r},n))}var xy=(e,t=!1)=>{if(e!==void 0)return va(e)||t&&e.state==="editing"};function SB(e,t,n=!1){var s;return xy((s=e.editModelSvc)==null?void 0:s.getEdit(t),n)}var EB=(e,t,n)=>{if(e)for(let s=0,o=e.length;s<o;++s){const r=e[s];if(r.data&&(xy(t==null?void 0:t.getEdit({rowNode:r,column:n}))||xy(t==null?void 0:t.getEdit({rowNode:r.pinnedSibling,column:n})))||EB(r.childrenAfterGroup,t,n))return!0}};function _B(e,t){const{column:n,rowNode:s}=t;return e.gos.get("groupTotalRow")&&!(s!=null&&s.footer)?!1:EB(s==null?void 0:s.childrenAfterGroup,e.editModelSvc,n)}function RB(e,{rowNode:t,column:n}){var s;if(t=t.pinnedSibling,!!t)return xy((s=e.editModelSvc)==null?void 0:s.getEdit({rowNode:t,column:n}))}var jve=class extends We{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}setComp(e){this.cellComp=e,this.applyCellStyles()}applyCellStyles(){var o;const{cellCtrl:e,editSvc:t,beans:n}=this;if(t!=null&&t.isBatchEditing()&&t.isEditing()){const r=SB(n,e)||_B(n,e)||RB(n,e);this.applyBatchingStyle(r)}else this.applyBatchingStyle(!1);const s=!!((o=this.editModelSvc)!=null&&o.getCellValidationModel().hasCellValidation(this.cellCtrl));this.cellComp.toggleCss("ag-cell-editing-error",s)}applyBatchingStyle(e){var t;this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&((t=this.editSvc)==null?void 0:t.isBatchEditing()))??!1)}},Kve=class extends We{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){var i;const{rowCtrl:e,editModelSvc:t,beans:n}=this;let s=e.rowNode,o=t==null?void 0:t.getEditRow(s);const r=(i=this.editModelSvc)==null?void 0:i.getRowValidationModel().hasRowValidation({rowNode:s});if(!o&&s.pinnedSibling&&(s=s.pinnedSibling,o=t==null?void 0:t.getEditRow(s)),o){const a=Array.from(o.keys()).some(l=>{const c={rowNode:s,column:l};return SB(n,c,!0)||_B(n,c)||RB(n,c)});this.applyStyle(r,a);return}this.applyStyle(r)}applyStyle(e=!1,t=!1){var o,r;const n=((o=this.editSvc)==null?void 0:o.isBatchEditing())??!1,s=this.gos.get("editType")==="fullRow";(r=this.rowCtrl)==null||r.forEachGui(void 0,({rowComp:i})=>{i.toggleCss("ag-row-editing",s&&t),i.toggleCss("ag-row-batch-edit",s&&t&&n),i.toggleCss("ag-row-inline-editing",t),i.toggleCss("ag-row-not-inline-editing",!t),i.toggleCss("ag-row-editing-invalid",s&&t&&e)})}},qve=({rowModel:e,pinnedRowModel:t,editModelSvc:n},s)=>{const o=new Set;e.forEachNode(r=>s.has(r)&&o.add(r)),t==null||t.forEachPinnedRow("top",r=>s.has(r)&&o.add(r)),t==null||t.forEachPinnedRow("bottom",r=>s.has(r)&&o.add(r));for(const r of s)o.has(r)||n.removeEdits({rowNode:r});return o},Yve=({editModelSvc:e},t,n)=>{var s;for(const o of t)(s=e==null?void 0:e.getEditRow(o))==null||s.forEach((r,i)=>!n.has(i)&&e.removeEdits({rowNode:o,column:i}))},Xve=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),s=new Set(n.keys());Yve(e,qve(e,s),t)},Zve=new Set(["undo","redo","paste","bulk","rangeSvc"]),Jve=new Set(["ui","api"]),DB={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},Qve=new Set(Object.keys(DB)),eye=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Fy={cancel:!0,source:"api"},tye={cancel:!1,source:"api"},Id={checkSiblings:!0},mp={force:!0,suppressFlash:!0},nye=class extends We{constructor(){super(...arguments),this.beanName="editSvc",this.batch=!1,this.stopping=!1,this.committing=!1}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:s})=>{this.stopEditing(void 0,Fy),this.createStrategy(s)});const t=Xve(e),n=()=>{const s=this.model.getCellValidationModel().getCellValidationMap().size>0,o=this.model.getRowValidationModel().getRowValidationMap().size>0;return s||o?this.stopEditing(void 0,Fy):this.isEditing()&&(this.isBatchEditing()?_d(e,this.model.getEditPositions()):this.stopEditing(void 0,tye)),!1};this.addManagedEventListeners({columnPinned:t,columnVisible:t,columnRowGroupChanged:t,rowExpansionStateChanged:t,pinnedRowsChanged:t,displayedRowsChanged:t,sortChanged:n,filterChanged:n,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}setBatchEditing(e){e?(this.batch=!0,this.stopEditing(void 0,Fy)):(this.stopEditing(void 0,Fy),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:s}=this,o=TB(n,e);if(s){if(s.beanName===o)return s;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(o,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,n,s="ui"){const o=Uve(this.beans,e,t,n,s);return o&&(this.strategy??(this.strategy=this.createStrategy())),o}shouldStopEditing(e,t,n="ui"){var s;return((s=this.strategy)==null?void 0:s.shouldStop(e,t,n))??null}shouldCancelEditing(e,t,n="ui"){var s;return((s=this.strategy)==null?void 0:s.shouldCancel(e,t,n))??null}validateEdit(){return vpe(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??Id)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:n=!0,event:s=null,source:o="ui",ignoreEventKey:r=!1,silent:i}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=Wn(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,s,n,o);if(l===!1&&o!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,o)&&!t.continueEditing&&this.stopEditing(void 0,{source:o}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:s,source:o,ignoreEventKey:r,startedEdit:n,silent:i})}stopEditing(e,t){var v,C,S;const{event:n,cancel:s,source:o="ui",forceCancel:r,forceStop:i}=t||{},{beans:a,model:l}=this;if(Qve.has(o)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const c=this.committing?DB[o]:o;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,Id))||!this.strategy||this.stopping)return!1;this.stopping=!0;const d=Wn(a,e);d&&(d.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),f=!1;const p=!s&&(!!this.shouldStopEditing(e,n,c)||this.committing&&!this.batch)||(i??!1),g=s&&!!this.shouldCancelEditing(e,n,c)||(r??!1);if(p||g){xc(a,{persist:!0,isCancelling:g||s,isStopping:p});const b=l.getEditMap(),w=this.processEdits(b,s,o);(v=this.strategy)==null||v.stop(s,n);for(const D of w)l.clearEditValue(D);this.bulkRefresh(void 0,h);for(const D of l.getEditPositions(b)){const R=Wn(a,D),T=va(D);R==null||R.refreshCell({force:!0,suppressFlash:!T})}h=b,f||(f=p)}else if(n instanceof KeyboardEvent&&this.batch&&((C=this.strategy)!=null&&C.midBatchInputsAllowed(e))&&this.isEditing(e,{withOpenEditor:!0})){const{key:b}=n,w=b===Oe.ENTER,D=b===Oe.ESCAPE,R=b===Oe.TAB;(w||R||D)&&(w||R?xc(a,{persist:!0}):D&&this.revertSingleCellEdit(d),this.isBatchEditing()?(S=this.strategy)==null||S.cleanupEditors():_d(a,l.getEditPositions(),{event:n,cancel:D}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else xc(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),e_(a),this.model.hasEdits()||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()),this.bulkRefresh(),g&&this.beans.rowRenderer.refreshRows({rowNodes:Array.from(h.keys())}),this.isBatchEditing()&&(this.beans.rowRenderer.refreshRows({suppressFlash:!0,force:!0}),f&&p&&this.dispatchBatchEvent("batchEditingStopped",h)),this.stopping=!1,f}navigateAfterEdit(e,t){var c;if(!e||!t)return;const{event:n,suppressNavigateAfterEdit:s}=e;if(!(n instanceof KeyboardEvent)||s)return;const{key:r,shiftKey:i}=n,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(r!==Oe.ENTER||!a)return;const l=i?Oe.UP:Oe.DOWN;(c=this.beans.navigation)==null||c.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,n){const s=Array.from(e.keys()),o=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,r=[];for(const i of s){const a=e.get(i);for(const l of a.keys()){const c=a.get(l),u={rowNode:i,column:l},d=va(c);!t&&d&&!o&&(this.setNodeDataValue(i,l,c.pendingValue,void 0,n)||r.push(u))}}return r}setNodeDataValue(e,t,n,s,o="edit"){const{beans:r}=this,i=Wn(r,{rowNode:e,column:t}),a=Jve.has(o)?"edit":o;i&&(i.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,n,a);return i&&(i.suppressRefreshCell=!1),s&&(i==null||i.refreshCell(mp)),l}setEditMap(e,t){var s;this.strategy??(this.strategy=this.createStrategy()),(s=this.strategy)==null||s.setEditMap(e,t),this.bulkRefresh();let n=mp;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...sye(e),...mp}),this.beans.rowRenderer.refreshCells(n)}dispatchEditValuesChanged({rowNode:e,column:t},n={}){if(!e||!t||!n)return;const{pendingValue:s,sourceValue:o}=n,{rowIndex:r,rowPinned:i,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:r,rowPinned:i,column:t,source:"api",data:a,newValue:s,oldValue:o,value:s,colDef:t.getColDef()})}bulkRefresh(e={},t,n={}){var a;const{beans:s,gos:o}=this,{editModelSvc:r,rowModel:i}=s;rs(o)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),n):t&&((a=r==null?void 0:r.getEditMap(!1))==null||a.forEach((l,c)=>{for(const u of l.keys())this.refCell({rowNode:c,column:u},l.get(u),n)})))}refCell({rowNode:e,column:t},n,s={}){var d,h,f;const{beans:o,gos:r}=this,i=new Set([e]),a=new Set,l=e.pinnedSibling;l&&i.add(l);const c=e.sibling;c&&a.add(c);let u=e.parent;for(;u;)(d=u.sibling)!=null&&d.footer&&r.get("groupTotalRow")||!u.parent&&u.sibling&&r.get("grandTotalRow")?a.add(u.sibling):a.add(u),u=u.parent;for(const p of i)this.dispatchEditValuesChanged({rowNode:p,column:t},n);for(const p of i)(h=Wn(o,{rowNode:p,column:t}))==null||h.refreshCell(s);for(const p of a)(f=Wn(o,{rowNode:p,column:t}))==null||f.refreshCell(s)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:n}=e,{gos:s,beans:o}=this;if(n.group){if(s.get("treeData")){if(!n.data&&!s.get("enableGroupEdit"))return!1}else if(!s.get("enableGroupEdit"))return!1}const r=TB(s)==="fullRow"?zve(o,e,t):b_(o,e,t);return r&&(this.strategy??(this.strategy=this.createStrategy())),r}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,n=!0){var s,o,r,i;if(this.hasValidationErrors(e)){const a=Wn(this.beans,e);return this.cellEditingInvalidCommitBlocks()?((s=t==null?void 0:t.preventDefault)==null||s.call(t),n&&(!(a!=null&&a.hasBrowserFocus())&&(a==null||a.focusCell()),(i=(r=(o=a==null?void 0:a.comp)==null?void 0:o.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)),"block-stop"):(a&&this.revertSingleCellEdit(a),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){var s,o,r,i;const n=Wn(this.beans,e);(s=n==null?void 0:n.comp)!=null&&s.getCellEditor()&&(_d(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),Ed(this.beans,e,{silent:!0}),Fc(this.beans),n==null||n.refreshCell(mp),t&&(n==null||n.focusCell(),(i=(r=(o=n==null?void 0:n.comp)==null?void 0:o.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)))}hasValidationErrors(e){var s;Fc(this.beans);const t=Wn(this.beans,e);t&&(t.refreshCell(mp),(s=t.rowCtrl.rowEditStyleFeature)==null||s.applyRowStyles());let n=!1;return e!=null&&e.rowNode?(n||(n=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(n||(n=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(n||(n=this.model.getCellValidationModel().getCellValidationMap().size>0),n||(n=this.model.getRowValidationModel().getRowValidationMap().size>0)),n}moveToNextCell(e,t,n,s="ui"){var a;let o;const r=this.isEditing(),i=r&&this.checkNavWithValidation(void 0,n)==="block-stop";return e instanceof Rd&&r&&(o=(a=this.strategy)==null?void 0:a.moveToNextEditingCell(e,t,n,s,i)),o===null||(o=o||!!this.beans.focusSvc.focusedHeader,o===!1&&!i&&this.stopEditing()),o}getCellDataValue({rowNode:e,column:t},n=!0){if(!e||!t)return;let s=this.model.getEdit({rowNode:e,column:t});const o=e.pinnedSibling;if(o){const i=this.model.getEdit({rowNode:o,column:t});i&&(s=i)}const r=n?(s==null?void 0:s.editorValue)??(s==null?void 0:s.pendingValue):s==null?void 0:s.pendingValue;return r===pr||!s?(s==null?void 0:s.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):r}addStopEditingWhenGridLosesFocus(e){dpe(this,this.beans,e)}createPopupEditorWrapper(e){return new Gve(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var s;try{if((!this.isEditing()||this.committing)&&!eye.has(n))return;const{beans:o}=this;this.strategy??(this.strategy=this.createStrategy());const r=this.isBatchEditing()?"ui":this.committing?n??"api":"api";if(!n||Zve.has(n))return by(o,e,t,n,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,n);const i=this.model.getEdit(e);if(i){if(i.pendingValue===t)return!1;if(i.sourceValue!==t)return by(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0;if(i.sourceValue===t)return(s=o.editModelSvc)==null||s.removeEdits(e),this.dispatchEditValuesChanged(e,{...i,pendingValue:t}),!0}return by(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){ppe(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,Id))return;const{rowNode:s,column:o}=e,{compDetails:r,valueToDisplay:i}=t;if(r){const{params:l}=r;return l.data=this.model.getEditRowDataValue(s,Id),{compDetails:r}}const a=this.model.getEditRow(e.rowNode,Id);if(i!==void 0&&(a!=null&&a.has(o)))return{valueToDisplay:this.valueSvc.getValue(o,s)}}cleanupEditors(){var e;(e=this.strategy)==null||e.cleanupEditors()}dispatchCellEvent(e,t,n,s){var o;(o=this.strategy)==null||o.dispatchCellEvent(e,t,n,s)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return Pt(this.gos,{type:e,...e==="batchEditingStopped"?{changes:this.toEventChangeList(t)}:{}})}toEventChangeList(e){return this.model.getEditPositions(e).map(t=>({rowIndex:t.rowNode.rowIndex,rowPinned:t.rowNode.rowPinned,columnId:t.column.getColId(),newValue:t.pendingValue,oldValue:t.sourceValue}))}applyBulkEdit({rowNode:e,column:t},n){var c,u;if(!n||n.length===0)return;const{beans:s,rangeSvc:o,valueSvc:r}=this;xc(s,{persist:!0});const i=this.model.getEditMap(!0),a=(u=(c=i.get(e))==null?void 0:c.get(t))==null?void 0:u.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(o==null||o.forEachRowInRange(d,h=>{const f=ma(s,h);if(f===void 0)return;const p=i.get(f)??new Map;for(const g of d.columns)if(g&&this.isCellEditable({rowNode:f,column:g},"api")){const v=r.getValue(g,f,!0,"api");let C=r.parseValue(g,f??null,a,v);Number.isNaN(C)&&(C=null),p.set(g,{editorValue:void 0,pendingValue:C,sourceValue:v,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}p.size>0&&i.set(f,p)}),this.setEditMap(i),this.batch){this.cleanupEditors(),e_(s),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(i)})}),this.bulkRefresh();const l=Wn(s,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new jve(e,t)}createRowStyleFeature(e,t){return new Kve(e,t)}setEditingCells(e,t){const{beans:n}=this,{colModel:s,valueSvc:o}=n,r=new Map;for(let{colId:i,column:a,colKey:l,rowIndex:c,rowPinned:u,newValue:d,state:h}of e){const f=i?s.getCol(i):l?s.getCol(l):a;if(!f)continue;const p=ma(n,{rowIndex:c,rowPinned:u});if(!p)continue;const g=o.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!va({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=r.get(p);v||(v=new Map,r.set(p,v)),d===void 0&&(d=pr),v.set(f,{editorValue:void 0,pendingValue:d,sourceValue:g,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(r,t)}onCellFocused(e){var r;const t=Wn(this.beans,e);if(!t||!this.isEditing(t,Id))return;const n=this.model.getEdit(t);if(!n||!va(n))return;const o=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(r=this.beans.ariaAnnounce)==null||r.announceValue(o,"pendingChange")}allowedFocusTargetOnValidation(e){return Wn(this.beans,e)}};function sye(e){return{rowNodes:e?Array.from(e.keys()):void 0,columns:e?[...new Set(Array.from(e.values()).flatMap(t=>Array.from(t.keys())))]:void 0}}function TB(e,t){return t??e.get("editType")??"singleCell"}var IB=class extends We{postConstruct(){var e,t;this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:(e=this.onCellFocusChanged)==null?void 0:e.bind(this),cellFocusCleared:(t=this.onCellFocusChanged)==null?void 0:t.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const n=e.previousParams,{editSvc:s,beans:o}=this,r=e.type==="cellFocused"?e.sourceEvent:null;n&&(t=Wn(o,n));const{gos:i,editModelSvc:a}=o,l=e.type==="cellFocusCleared";if(s.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:u,rowPinned:d}=e,h={column:c,rowNode:ma(o,{rowIndex:u,rowPinned:d})},f=i.get("invalidEditValueMode")==="block";if(f)return;const p=!f,g=!!(a!=null&&a.getCellValidationModel().hasCellValidation(h)),v=p&&g;(n||l?s.stopEditing(void 0,{cancel:v,source:l&&p?"api":void 0,event:r}):!0)||(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"}))}t==null||t.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){var o,r;const n=this.model.getEditPositions(),s={all:[],pass:[],fail:[]};for(const i of n){s.all.push(i);const a=this.model.getCellValidationModel().getCellValidation(i);if((((o=a==null?void 0:a.errorMessages)==null?void 0:o.length)??0)>0){s.fail.push(i);continue}s.pass.push(i)}if(e)for(const i of n)Sy(this.beans,i,{cancel:e}),this.model.stop(i);else{const i=this.processValidationResults(s);if(i.destroy.length>0)for(const a of i.destroy)Sy(this.beans,a,{event:t,cancel:e}),this.model.stop(a);if(i.keep.length>0)for(const a of i.keep){const l=Wn(this.beans,a);(r=this.editSvc)!=null&&r.cellEditingInvalidCommitBlocks()||l&&this.editSvc.revertSingleCellEdit(l)}}return!0}cleanupEditors({rowNode:e}={},t){xc(this.beans,{persist:!1});const n=this.model.getEditPositions(),s=[];if(e)for(const o of n)o.rowNode!==e&&s.push(o);else for(const o of n)s.push(o);_d(this.beans,s),e_(this.beans,t)}setFocusOutOnEditor(e){var t,n,s;(s=(n=(t=e.comp)==null?void 0:t.getCellEditor())==null?void 0:n.focusOut)==null||s.call(n)}setFocusInOnEditor(e){const t=e.comp,n=t==null?void 0:t.getCellEditor();if(n!=null&&n.focusIn)n.focusIn();else{const s=this.beans.gos.get("editType")==="fullRow";e.focusCell(s),e.onEditorAttachedFuncs.push(()=>{var o,r;return(r=(o=t==null?void 0:t.getCellEditor())==null?void 0:o.focusIn)==null?void 0:r.call(o)})}}setupEditors(e){const{event:t,ignoreEventKey:n=!1,startedEdit:s,position:o,cells:r=this.model.getEditPositions()}=e,i=t instanceof KeyboardEvent&&!n&&t.key||void 0;fpe(this.beans,r,o,i,t,s)}dispatchCellEvent(e,t,n,s){const o=Wn(this.beans,e);o&&this.eventSvc.dispatchEvent({...o.createEvent(t??null,n),...s})}dispatchRowEvent(e,t,n){if(n)return;const s=J0(this.beans,e);s&&this.eventSvc.dispatchEvent(s.createRowEvent(t))}shouldStop(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return s&&n==="api"?!0:s&&(n==="ui"||n==="edit")?!1:n==="api"?!0:t instanceof KeyboardEvent&&!s?t.key===Oe.ENTER:null}shouldCancel(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!s&&t.key===Oe.ESCAPE||s&&n==="api"||n==="api")}setEditMap(e,t){var s;t!=null&&t.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const n=[];if(e.forEach((o,r)=>{o.forEach((i,a)=>{i.state==="editing"&&n.push({...i,rowNode:r,column:a})})}),t!=null&&t.update&&(e=new Map([...this.model.getEditMap(),...e])),(s=this.model)==null||s.setEditMap(e),n.length>0){const o=n.at(-1),r=o.pendingValue===pr?void 0:o.pendingValue;this.start({position:o,event:new KeyboardEvent("keydown",{key:r}),source:"api"});const i=Wn(this.beans,o);i&&this.setFocusInOnEditor(i)}}destroy(){this.cleanupEditors(),super.destroy()}},oye=class extends IB{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:s}=e||{};if(!J0(this.beans,{rowNode:this.rowNode}))return!0;const r=super.shouldStop({rowNode:this.rowNode},t,n);return r!==null?r:this.rowNode?s!==this.rowNode:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:n,startedEdit:s,event:o,ignoreEventKey:r}=e,{rowNode:i}=t;this.rowNode!==i&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],c=[];for(const u of a)u.isCellEditable(i)&&c.push(u);if(c.length!=0){this.dispatchRowEvent({rowNode:i},"rowEditingStarted",n),this.startedRows.push(i);for(const u of c){const d={rowNode:i,column:u};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=i,this.setupEditors({cells:l,position:t,startedEdit:s,event:o,ignoreEventKey:r})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){var o;const{rowNode:n}=this;if(n&&!this.model.hasRowEdits(n))return!1;const s=[];if(e||this.model.getEditMap().forEach((r,i)=>{if(!(!r||r.size===0)){for(const a of r.values())if(va(a)){s.push(i);break}}}),Fc(this.beans),!e&&((o=this.editSvc)==null?void 0:o.checkNavWithValidation({rowNode:n}))==="block-stop")return!1;super.stop(e,t);for(const r of s)this.dispatchRowEvent({rowNode:r},"rowValueChanged");return this.cleanupEditors({rowNode:n},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,n=e.previousParams;if((n==null?void 0:n.rowIndex)===t||e.sourceEvent instanceof KeyboardEvent)return;const s=Wn(this.beans,n);this.gos.get("invalidEditValueMode")==="block"&&s&&(this.model.getCellValidationModel().getCellValidation(s)||this.model.getRowValidationModel().getRowValidation(s))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);for(const n of this.startedRows)this.dispatchRowEvent({rowNode:n},"rowEditingStopped");this.startedRows.length=0}moveToNextEditingCell(e,t,n,s="ui",o=!1){var h,f,p,g;const r=e.cellPosition;let i;this.model.suspend(!0);try{i=(h=this.beans.navigation)==null?void 0:h.findNextCellToFocusOn(r,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(i===!1)return null;if(i==null)return!1;const a=i.cellPosition,l=e.isCellEditable(),c=i.isCellEditable(),u=a&&r.rowIndex===a.rowIndex&&r.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return c&&!o?d?i.focusCell(!0,n):((f=i.comp)!=null&&f.getCellEditor()||Ed(this.beans,i,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(i),i.focusCell(!1,n)):(c&&o&&this.setFocusInOnEditor(i),i.focusCell(!0,n)),!u&&!o&&((p=this.editSvc)==null||p.stopEditing({rowNode:e.rowNode},{event:n}),this.cleanupEditors(i,!0),d?i.focusCell(!0,n):this.editSvc.startEditing(i,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),(g=e.rowCtrl)==null||g.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:n},s)=>{var r;if(n!=="editing")return;const o=Wn(this.beans,{rowNode:t,column:s});o&&!((r=o.comp)!=null&&r.getCellEditor())&&Ed(this.beans,o,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},rye=class extends IB{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,n="ui"){const s=super.shouldStop(e,t,n);if(s!==null)return s;const{rowNode:o,column:r}=e||{};return(!this.rowNode||!this.column)&&o&&r?null:this.rowNode!==o||this.column!==r}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:n,event:s,ignoreEventKey:o}=e;(this.rowNode!==t.rowNode||this.column!==t.column)&&super.cleanupEditors(),this.rowNode=t.rowNode,this.column=t.column,this.model.start(t),this.setupEditors({cells:[t],position:t,startedEdit:n,event:s,ignoreEventKey:o})}dispatchRowEvent(e,t,n){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){return super.stop(e,t),this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:n}=this.beans,{rowIndex:s,column:o,rowPinned:r}=e,i=ma(this.beans,{rowIndex:s,rowPinned:r}),a=Q0(o),l=t.getCol(a),c=e.previousParams;if(c){const u=Q0(c.column);if((c==null?void 0:c.rowIndex)===s&&u===a&&(c==null?void 0:c.rowPinned)===r)return}n!=null&&n.isEditing({rowNode:i,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,n,s="ui",o=!1){var p,g,v,C,S,b;const r=this.beans.focusSvc.getFocusedCell();r&&(e=bd(this.beans,r)??e);const i=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),o||(e.eGui.focus(),(g=this.editSvc)==null||g.stopEditing(e,{source:(p=this.editSvc)!=null&&p.isBatchEditing()?"ui":"api",event:n}));try{a=(v=this.beans.navigation)==null?void 0:v.findNextCellToFocusOn(i,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,u=e.isCellEditable(),d=a.isCellEditable(),h=c&&i.rowIndex===c.rowIndex&&i.rowPinned===c.rowPinned;u&&!o&&this.setFocusOutOnEditor(e);const f=this.gos.get("suppressStartEditOnTab");if(!h&&!o&&(super.cleanupEditors(a,!0),f?a.focusCell(!0,n):this.editSvc.startEditing(a,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),d&&!o){if(a.focusCell(!1,n),f)a.focusCell(!0,n);else if(!((C=a.comp)!=null&&C.getCellEditor())){const w=(S=this.editSvc)==null?void 0:S.isEditing(a,{withOpenEditor:!0});Ed(this.beans,a,{event:n,cellStartedEdit:!0,silent:w}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else d&&o&&this.setFocusInOnEditor(a),a.focusCell(!0,n);return(b=e.rowCtrl)==null||b.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},gl={moduleName:"EditCore",version:ut,beans:[upe,nye],apiFunctions:{getEditingCells:Ove,getEditRowValues:kve,getCellEditorInstances:hpe,startEditingCell:Lve,stopEditing:Mve,isEditing:Nve,validateEdit:Vve},dynamicBeans:{singleCell:rye,fullRow:oye},dependsOn:[Ry,vB],css:[uve]},iye={moduleName:"UndoRedoEdit",version:ut,beans:[cve],apiFunctions:{undoCellEditing:Pve,redoCellEditing:Ave,getCurrentUndoSize:Bve,getCurrentRedoSize:$ve},dependsOn:[gl]},aye={moduleName:"TextEditor",version:ut,userComponents:{agCellEditor:wB,agTextCellEditor:wB},dependsOn:[gl]},lye={moduleName:"NumberEditor",version:ut,userComponents:{agNumberCellEditor:{classImp:Eve}},dependsOn:[gl]},cye={moduleName:"DateEditor",version:ut,userComponents:{agDateCellEditor:gve,agDateStringCellEditor:yve},dependsOn:[gl]},uye={moduleName:"CheckboxEditor",version:ut,userComponents:{agCheckboxCellEditor:hve},dependsOn:[gl]},dye={moduleName:"SelectEditor",version:ut,userComponents:{agSelectCellEditor:Rve},dependsOn:[gl]},hye={moduleName:"LargeTextEditor",version:ut,userComponents:{agLargeTextCellEditor:Cve},dependsOn:[gl]},fye={moduleName:"CustomEditor",version:ut,dependsOn:[gl]},pye=class extends We{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,hd(e.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(e){const t=this.columns;t!=null&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),Rre(e))}createColumns(e,t){var h,f;const n=()=>{var p;zv(this.beans,(p=this.columns)==null?void 0:p.tree),this.columns=null},s=e.treeDepth,r=(((h=this.columns)==null?void 0:h.treeDepth)??-1)==s,i=this.generateSelectionCols();if(_re(i,((f=this.columns)==null?void 0:f.list)??[])&&r)return;n();const{colGroupSvc:l}=this.beans,c=(l==null?void 0:l.findDepth(e.tree))??0,u=(l==null?void 0:l.balanceTreeForAutoCols(i,c))??[];this.columns={list:i,tree:u,treeDepth:c,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!ua(v));return[...i,...g]})}updateColumns(e){var n;const t=hd(e.source);for(const s of((n=this.columns)==null?void 0:n.list)??[]){const o=this.createSelectionColDef(e.currentValue);s.setColDef(o,null,t),Hr(this.beans,{state:[{...o,colId:s.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>Jf(n,e)))??null}getColumns(){var e;return((e=this.columns)==null?void 0:e.list)??null}isSelectionColumnEnabled(){var i,a;const{gos:e,beans:t}=this,n=e.get("rowSelection");if(typeof n!="object"||!mc(e))return!1;const s=(((a=(i=t.autoColSvc)==null?void 0:i.getColumns())==null?void 0:a.length)??0)>0;if(n.checkboxLocation==="autoGroupColumn"&&s)return!1;const o=!!dd(n),r=Bv(n);return o||r}createSelectionColDef(e){const{gos:t}=this,n=e??t.get("selectionColumnDef"),s=t.get("enableRtl"),{rowSpan:o,spanRows:r,...i}=n??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:s?"right":"left",comparator(a,l,c,u){const d=c.isSelected(),h=u.isSelected();return d===h?0:d?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...i,colId:mL,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new wc(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const s=t&&typeof t!="string"?dd(t):void 0,o=e&&typeof e!="string"?dd(e):void 0,r=s!==o,i=t&&typeof t!="string"?Bv(t):void 0,a=e&&typeof e!="string"?Bv(e):void 0,l=i!==a,c=$v(e),u=$v(t);(r||l||c!==u)&&this.beans.colModel.refreshAll(n)}destroy(){var e;zv(this.beans,(e=this.columns)==null?void 0:e.tree),super.destroy()}refreshVisibility(e,t,n){var l,c;if(!((l=this.columns)!=null&&l.list.length))return;const s=e.length+t.length+n.length;if(s===0)return;const o=this.columns.list[0];if(!o.isVisible())return;const r=()=>{let u;switch(o.pinned){case"left":case!0:u=e;break;case"right":u=n;break;default:u=t}u&&$r(u,o)};(((c=this.beans.rowNumbersSvc)==null?void 0:c.getColumn(vL))?2:1)===s&&r()}};function gye(e,t){var i;if(!t.nodes.every(a=>a.rowPinned&&!ap(a)?(Je(59),!1):a.id===void 0?(Je(60),!1):!0))return;const{nodes:s,source:o,newValue:r}=t;(i=e.selectionSvc)==null||i.setNodesSelected({nodes:s,source:o??"api",newValue:r})}function mye(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.selectAllRowNodes({source:n,selectAll:t})}function vye(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.deselectAllRowNodes({source:n,selectAll:t})}function yye(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function wye(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function Cye(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function bye(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function Sye(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function Eye(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var _ye=class extends Lce{constructor(){super(...arguments),this.beanName="selectionSvc",this.selectedNodes=new Map,this.detailSelection=new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();const{gos:e}=this;this.mode=Hv(e),this.groupSelectsDescendants=Xf(e),this.groupSelectsFiltered=Gv(e)==="filteredDescendants",this.masterSelectsDetail=dL(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=Xf(e),n=Hv(e),s=Gv(e)==="filteredDescendants";this.masterSelectsDetail=dL(e)==="detail",(t!==this.groupSelectsDescendants||s!==this.groupSelectsFiltered||n!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=s,this.mode=n)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,n){if(this.isRowSelectionBlocked(t))return 0;const s=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,n);if(s==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in s)return s.reset?this.resetNodes():this.selectRange(s.deselect,!1,n),this.selectRange(s.select,!0,n);{const o=s.checkFilteredNodes?FB(s.node):s.newValue;return this.setNodesSelected({nodes:[s.node],newValue:o,clearSelection:s.clearSelection,keepDescendants:s.keepDescendants,event:e,source:n})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:n,nodes:s,event:o,source:r,keepDescendants:i=!1}){var c;if(s.length===0)return 0;const{gos:a}=this;if(!mc(a)&&e)return Je(132),0;if(s.length>1&&!this.isMultiSelect())return Je(130),0;let l=0;for(let u=0;u<s.length;u++){const d=s[u],h=xd(d);if(h.rowPinned&&!ap(h)){Je(59);continue}if(h.id===void 0){Je(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,o,r)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((c=h.childrenAfterGroup)!=null&&c.length)&&(l+=this.selectChildren(h,e,r))}return n||(s.length===1&&r==="api"&&this.selectionCtx.setRoot(xd(s[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(xd(s[0]),i,r)),l>0&&(this.updateGroupsFromChildrenSelections(r),this.dispatchSelectionChanged(r))),l}selectRange(e,t,n){let s=0;return e.forEach(o=>{const r=xd(o);if(r.group&&this.groupSelectsDescendants)return;this.selectRowNode(r,t,void 0,n)&&s++}),s>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n)),s}selectChildren(e,t,n){const s=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return s?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:n,nodes:s}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((n,s)=>{e(n)&&t.set(s,n)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:n,rowModel:s}=this.beans;if(!rs(n))return!1;const o=s.rootNode;if(!o)return!1;t||(t=new cp(!0,o),t.active=!1);let r=!1;return t.forEachChangedNodeDepthFirst(i=>{if(i!==o){const a=this.calculateSelectedFromChildren(i);r=this.selectRowNode(i,a===null?!1:a,void 0,e)||r}}),r}clearOtherNodes(e,t,n){const s=new Map;let o=0;return this.selectedNodes.forEach(r=>{const i=r.id==e.id;if((t?!Dye(e,r):!0)&&!i){const l=this.selectedNodes.get(r.id);o+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:n}),this.groupSelectsDescendants&&r.parent&&s.set(r.parent.id,r.parent)}}),s.forEach(r=>{const i=this.calculateSelectedFromChildren(r);this.selectRowNode(r,i===null?!1:i,void 0,n)}),o}onRowSelected(e){const t=e.node;this.groupSelectsDescendants&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}createDaemonNode(e){if(!e.id)return;const t=new cl(this.beans);return t.id=e.id,t.data=e.data,t.__selected=e.__selected,t.level=e.level,t}syncInOldRowNode(e,t){t&&e.id!==t.id&&this.selectedNodes.get(t.id)==e&&this.selectedNodes.set(t.id,t)}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.__selected=!0,this.selectedNodes.set(e.id,e)):e.__selected=!1}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes.forEach(e=>{this.selectRowNode(e,!1)}),this.selectedNodes.clear()}getBestCostNodeSelection(){const{gos:e,rowModel:t}=this.beans;if(!rs(e))return;const n=t.getTopLevelNodes();if(n===null)return;const s=[];function o(r){for(let i=0,a=r.length;i<a;i++){const l=r[i];l.isSelected()?s.push(l):l.group&&l.childrenAfterGroup&&o(l.childrenAfterGroup)}}return o(n),s}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const n=rs(this.gos);let s=!1;const o=r=>{const i=this.selectRowNode(xd(r),!1,void 0,e);s||(s=i)};if(t==="currentPage"||t==="filtered"){if(!n){_n(102);return}this.getNodesToSelect(t).forEach(o)}else this.selectedNodes.forEach(o),this.reset(e);if(this.selectionCtx.selectAll=!1,n&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(e);s||(s=r)}s&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,n=0;return this.getNodesToSelect(e).forEach(s=>{this.groupSelectsDescendants&&s.group||(s.isSelected()?t++:s.selectable&&n++)}),{selectedCount:t,notSelectedCount:n}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:n}=this.getSelectedCounts(e);return xB(t,n)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],n=o=>t.push(o);if(e==="currentPage")return this.forEachNodeOnPage(o=>{if(!o.group){n(o);return}if(!o.expanded&&!o.footer){const r=i=>{var a;n(i),(a=i.childrenAfterFilter)==null||a.forEach(r)};r(o);return}this.groupSelectsDescendants||n(o)}),t;const s=this.beans.rowModel;return e==="filtered"?(s.forEachNodeAfterFilter(n),t):(s.forEachNode(n),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:n}=this.beans,s=t.getFirstRow(),o=t.getLastRow();for(let r=s;r<=o;r++){const i=n.getRow(r);i&&e(i)}}selectAllRowNodes(e){const{gos:t,selectionCtx:n}=this;if(!mc(t)){Je(132);return}if(dre(t)&&!Yf(t)){Je(130);return}if(!this.canSelectAll())return;const{source:s,selectAll:o}=e;let r=!1;if(this.getNodesToSelect(o).forEach(i=>{const a=this.selectRowNode(xd(i),!0,void 0,s);r||(r=a)}),n.selectAll=!0,rs(t)&&this.groupSelectsDescendants){const i=this.updateGroupsFromChildrenSelections(s);r||(r=i)}r&&this.dispatchSelectionChanged(s)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,n){if(e||(e=[]),!Array.isArray(e)){_n(103);return}const s=new Set(e),o=[];this.beans.rowModel.forEachNode(r=>{s.has(r.id)&&o.push(r)}),n&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:o,source:t})}canSelectAll(){return rs(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!mc(t))return;const s="selectableChanged",o=e!==void 0,r=rs(t)&&this.groupSelectsDescendants,i=[],a=c=>{var d;if(o&&!c.group)return;if(r&&c.group){const h=((d=c.childrenAfterGroup)==null?void 0:d.some(f=>f.selectable))??!1;this.setRowSelectable(c,h,!0);return}!this.updateRowSelectable(c,!0)&&c.isSelected()&&i.push(c)};if(r){if(e===void 0){const c=n.rootNode;e=c?new cp(!1,c):void 0}e==null||e.forEachChangedNodeDepthFirst(a,!o,!o)}else n.forEachNode(a);i.length&&this.setNodesSelected({nodes:i,newValue:!1,source:s}),!o&&r&&((l=this.updateGroupsFromChildrenSelections)==null||l.call(this,s))}updateSelectableAfterGrouping(e){var t;this.updateSelectable(e),this.groupSelectsDescendants&&((t=this.updateGroupsFromChildrenSelections)!=null&&t.call(this,"rowGroupChanged",e))&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){var r,i;if(!this.masterSelectsDetail)return;const n=(i=(r=e.detailNode)==null?void 0:r.detailGridInfo)==null?void 0:i.api;if(!n)return;const s=Rye(n);if(e.isSelected()!==s&&this.selectRowNode(e,s,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!s){const a=this.detailSelection.get(e.id)??new Set;for(const l of n.getSelectedNodes())a.add(l.id);this.detailSelection.set(e.id,a)}}setDetailSelectionState(e,t,n){if(this.masterSelectsDetail){if(!Yf(t)){Je(269);return}switch(e.isSelected()){case!0:{n.selectAll();break}case!1:{n.deselectAll();break}case void 0:{const s=this.detailSelection.get(e.id);if(s){const o=[];for(const r of s){const i=n.getRowNode(r);i&&o.push(i)}n.setNodesSelected({nodes:o,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function xd(e){return ap(e)?e.pinnedSibling:e.footer?e.sibling:e}function Rye(e){let t=0,n=0;return e.forEachNode(s=>{s.isSelected()?t++:s.selectable&&n++}),xB(t,n)}function xB(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function Dye(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function FB(e){var s;const t=e.isSelected()===!1,n=((s=e.childrenAfterFilter)==null?void 0:s.some(FB))??!1;return t||n}var Tye={moduleName:"SharedRowSelection",version:ut,beans:[pye],apiFunctions:{setNodesSelected:gye,selectAll:mye,deselectAll:vye,selectAllFiltered:yye,deselectAllFiltered:wye,selectAllOnCurrentPage:Cye,deselectAllOnCurrentPage:bye,getSelectedNodes:Sye,getSelectedRows:Eye}},Iye={moduleName:"RowSelection",version:ut,rowModels:["clientSide","infinite","viewport"],beans:[_ye],dependsOn:[Tye]};function xye(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function Fye(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function PB(e){var t;(t=e.rowModel)==null||t.onRowHeightChanged()}function AB(e){var t,n;if((t=e.rowAutoHeight)!=null&&t.active){Je(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function Pye(e,t,n){var o,r;const s=Age(e);if(s){if(((o=e.rowGroupColsSvc)==null?void 0:o.columns.length)===0){if(t<0){_n(238);return}s.setRowCount(t,n);return}_n(28);return}(r=_y(e))==null||r.setRowCount(t,n)}function Aye(e){var t;return ld(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function kye(e){return e.rowModel.isLastRowIndexKnown()}var Oye={moduleName:"CsrmSsrmSharedApi",version:ut,apiFunctions:{expandAll:xye,collapseAll:Fye}},Mye={moduleName:"RowModelSharedApi",version:ut,apiFunctions:{onRowHeightChanged:PB,resetRowHeights:AB}},Nye={moduleName:"SsrmInfiniteSharedApi",version:ut,apiFunctions:{setRowCount:Pye,getCacheBlockState:Aye,isLastRowIndexKnown:kye}},Lye=class extends We{constructor(){super(...arguments),this.beanName="alignedGridsSvc",this.consuming=!1}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";return typeof e=="function"&&(e=e()),e.map(s=>{var r;if(!s){_n(18),t||_n(20);return}if(this.isGridApi(s))return s;const o=s;return"current"in o?(r=o.current)==null?void 0:r.api:(o.api||_n(19),o.api)}).filter(s=>!!s&&!s.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){if(!this.consuming)for(const t of this.getAlignedGridApis())t.isDestroyed()||t.dispatchEvent(e)}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const n=[];return e.columns?e.columns.forEach(s=>{n.push(t(s))}):e.column&&n.push(t(e.column)),n}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":Je(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const n of e.columnGroups){let s=null;n&&(s=t.getProvidedColGroup(n.getGroupId())),!(n&&!s)&&t.setColumnGroupOpened(s,n.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let n=null;const s=this.beans,{colResize:o,ctrlsSvc:r,colModel:i}=s;if(t&&(n=i.getColDefCol(t.getColId())),t&&!n)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const d=e.api.getColumnState().map(h=>({colId:h.colId}));Hr(s,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));Hr(s,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));Hr(s,{state:d},"alignedGridChanged")}break;case"columnResized":{const u=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of u.flexColumns??[])d[h.getId()]&&delete d[h.getId()];o==null||o.setColumnWidths(Object.values(d),!1,u.finished,"alignedGridChanged");break}}const c=r.getGridBodyCtrl().isVerticalScrollShowing();for(const u of this.getAlignedGridApis())u.setGridOption("alwaysShowVerticalScroll",c)}},Vye={moduleName:"AlignedGrids",version:ut,beans:[Lye],dependsOn:[m2]},Bye=class extends We{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},kB(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:n,groupStage:s}=this.beans;t==null||t.reset("rowDataChanged"),n!=null&&n.isManual()&&n.reset(),this.dispatchRowDataUpdateStarted(e),this.allNodesMap=Object.create(null),this.nextId=0;const o=kB(this.rootNode),r=new Array(e.length);o._leafs=r;let i=0;const a=s==null?void 0:s.getNestedDataGetter(),l=a?new Set:null,c=(u,d)=>{const h=u.level+1;for(let f=0,p=d.length;f<p;++f){const g=d[f];if(!g)continue;const v=this.createRowNode(g,h);if(v.sourceRowIndex=i,r[i++]=v,l&&!l.has(g)){l.add(g),v.treeParent=u;const C=a(g);C&&c(v,C)}}};c(o,e),r.length=i}setImmutableRowData(e,t){var C;const{rootNode:n,gos:s}=this;this.dispatchRowDataUpdateStarted(t);const o=ud(s),r=e.changedRowNodes,{adds:i,updates:a}=r,l=new Set,c=[],u=(C=this.beans.groupStage)==null?void 0:C.getNestedDataGetter();let d=s.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,f=!1;const p=(S,b)=>{if(!d&&d!==void 0){const w=S.sourceRowIndex;d=w<=h,h=w}S.data!==b&&(S.updateData(b),i.has(S)||a.add(S),!S.selectable&&S.isSelected()&&c.push(S))},g=(S,b,w)=>{for(let D=0,R=b.length;D<R;++D){const T=b[D];if(!T)continue;let F=this.getRowNode(o({data:T,level:w}));if(F?(p(F,T),f||(f=!!u&&F.treeParent!==S)):(F=this.createRowNode(T,w),i.add(F)),!u||l.has(F)){l.add(F);continue}l.add(F),F.treeParent=S;const x=u(T);x&&g(F,x,w+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,r,c)||d||i.size>0;if(v){const S=n._leafs??(n._leafs=[]);d===void 0?Wye(S,l,r):Uye(S,l)&&(r.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},n){const s=this.rootNode._leafs;for(let o=0,r=s.length;o<r;o++){const i=s[o];e.has(i)||(t.add(i),i.isSelected()&&n.push(i),this.deleteNode(i))}return t.size>0}updateRowData(e,t){var a;if(this.dispatchRowDataUpdateStarted(e.add),(a=this.beans.groupStage)!=null&&a.getNestedDataGetter())return Je(268),{remove:[],update:[],add:[]};const n=[],s=ud(this.gos),o=this.executeRemove(s,e,t,n),r=this.executeUpdate(s,e,t,n),i=this.executeAdd(e,t);return this.deselect(n),{remove:o,update:r,add:i}}executeRemove(e,{remove:t},{adds:n,updates:s,removals:o},r){const i=this.rootNode._leafs,a=i==null?void 0:i.length,l=t==null?void 0:t.length;if(!l||!a)return[];let c=0,u=a,d=0,h;const f=new Array(l);for(let p=0;p<l;++p){const g=this.lookupNode(e,t[p]);if(!g)continue;const v=g.sourceRowIndex;v<u&&(u=v),v>d&&(d=v),g.isSelected()&&r.push(g),this.deleteNode(g),n.delete(g)?(h??(h=new Set),h.add(g)):(s.delete(g),o.add(g)),f[c++]=g}return f.length=c,c&&Gye(i,u,d,o,h),f}executeUpdate(e,{update:t},{adds:n,updates:s},o){const r=t==null?void 0:t.length;if(!r)return[];const i=new Array(r);let a=0;for(let l=0;l<r;l++){const c=t[l],u=this.lookupNode(e,c);u&&(u.updateData(c),!u.selectable&&u.isSelected()&&o.push(u),i[a++]=u,n.has(u)||s.add(u))}return i.length=a,i}executeAdd(e,t){var n;const s=(n=this.rootNode)._leafs??(n._leafs=[]),o=s.length,r=e.add,i=r==null?void 0:r.length;if(!i)return[];const a=o+i;let l=this.sanitizeAddIndex(s,e.addIndex);if(l<o){for(let d=o-1,h=a-1;d>=l;--d){const f=s[d];f.sourceRowIndex=h,s[h--]=f}t.reordered=!0}s.length=a;const c=new Array(i),u=t.adds;for(let d=0;d<i;d++){const h=this.createRowNode(r[d],0);u.add(h),h.sourceRowIndex=l,s[l]=h,c[d]=h,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}deselect(e){var s;const t="rowDataChanged",n=this.beans.selectionSvc;e.length&&(n==null||n.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t})),(s=n==null?void 0:n.updateGroupsFromChildrenSelections)==null||s.call(n,t),e.length&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t,selectedNodes:(n==null?void 0:n.getSelectedNodes())??null,serverSideState:null})}createRowNode(e,t){const n=new cl(this.beans);n.parent=this.rootNode,n.level=t,n.group=!1,n.expanded=!1,n.setDataAndId(e,String(this.nextId++));const s=n.id,o=this.allNodesMap;return o[s]&&Je(2,{nodeId:s}),o[s]=n,n}deleteNode(e){var o;e.clearRowTopAndRowIndex();const t=e.id,n=this.allNodesMap;n[t]===e&&delete n[t];const s=e.pinnedSibling;s&&((o=this.beans.pinnedRowModel)==null||o.pinRow(s,null))}lookupNode(e,t){if(!e)return Hye(this.rootNode._leafs,t);const n=e({data:t,level:0}),s=this.allNodesMap[n];return s||(_n(4,{id:n}),null)}sanitizeAddIndex(e,t){const n=e.length;if(typeof t!="number"||t<0||t>=n||Number.isNaN(t))return n;t=Math.ceil(t);const s=this.gos;return t>0&&s.get("treeData")&&s.get("getDataPath")&&(t=$ye(e,t)),t}},$ye=(e,t)=>{for(let n=0,s=e.length;n<s;n++){const o=e[n];if((o==null?void 0:o.rowIndex)==t-1)return n+1}return t},kB=e=>{var i;e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",((i=e._leafs)==null?void 0:i.length)!==0&&(e._leafs=[]);const t=[],n=[],s=[],o=[];e.childrenAfterGroup=t,e.childrenAfterSort=n,e.childrenAfterAggFilter=s,e.childrenAfterFilter=o;const r=e.sibling;return r&&(r.childrenAfterGroup=t,r.childrenAfterSort=n,r.childrenAfterAggFilter=s,r.childrenAfterFilter=o,r.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},Hye=(e,t)=>{if(e)for(let n=0,s=e.length;n<s;n++){const o=e[n];if(o.data===t)return o}return _n(5,{data:t}),null},Gye=(e,t,n,s,o)=>{t=Math.max(0,t);for(let r=t,i=e.length;r<i;++r){const a=e[r];r<=n&&(s.has(a)||o!=null&&o.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},Uye=(e,t)=>{const n=t.size;e.length=n;let s=0,o=!1,r=!1;for(const i of t){const a=i.sourceRowIndex;a===s?r||(r=o):(a>=0?r=!0:o=!0,i.sourceRowIndex=s,e[s]=i),++s}return r},Wye=(e,t,{removals:n,adds:s})=>{const o=e.length;e.length=t.size;let r=0;for(let i=0;i<o;++i){const a=e[i];n.has(a)||(r!==i&&(a.sourceRowIndex=r,e[r]=a),++r)}for(const i of s)i.sourceRowIndex<0&&(i.sourceRowIndex=r,e[r++]=i);e.length=r},OB=e=>{const t=e.childrenAfterSort,n=e.sibling;if(n&&(n.childrenAfterSort=t),!!t)for(let s=0,o=t.length-1;s<=o;s++){const r=t[s],i=s===0,a=s===o;r.firstChild!==i&&(r.firstChild=i,r.dispatchRowEvent("firstChildChanged")),r.lastChild!==a&&(r.lastChild=a,r.dispatchRowEvent("lastChildChanged")),r.childIndex!==s&&(r.childIndex=s,r.dispatchRowEvent("childIndexChanged"))}},zye=class extends We{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e){const t=this.beans.sortSvc.getSortOptions(),n=t.length>0&&!!e.changedRowNodes&&this.gos.get("deltaSort");this.sort(t,n,e.changedRowNodes,e.changedPath)}sort(e,t,n,s){const{gos:o,colModel:r,rowGroupColsSvc:i,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,u=o.get("groupMaintainOrder"),d=r.getCols().some(S=>S.isRowGroupActive()),h=i==null?void 0:i.columns,f=r.isPivotMode(),p=o.getCallback("postSortRows");let g=!1,v;const C=S=>{var R,T;const b=f&&S.leafGroup;let w=u&&d&&!S.leafGroup;w&&(v??(v=this.shouldSortContainsGroupCols(e)),w&&(w=!v));let D=null;if(w){let F=!1;if(h){const x=S.level+1;x<h.length&&(F=h[x].getSort()===null)}F||(D=qye(S))}else!e.length||b||(t&&n?D=jye(a,S,n,s,e):D=a.doFullSort(S.childrenAfterAggFilter,e));if(D||(D=((R=S.childrenAfterAggFilter)==null?void 0:R.slice(0))??[]),g||(g=((T=S.childrenAfterSort)==null?void 0:T[0])!==D[0]),S.childrenAfterSort=D,OB(S),p){const F={nodes:S.childrenAfterSort};p(F)}};if(s==null||s.forEachChangedNodeDepthFirst(C),g&&o.get("groupHideOpenParents")){const S=c==null?void 0:c.getShowRowGroupCols();S!=null&&S.length&&l.refreshCells({columns:S,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(bi(this.gos)){for(let n=0;n<t;++n){const s=e[n].column;if(s.isPrimary()&&s.isRowGroupActive())return!0}return!1}for(let n=0;n<t;++n)if(e[n].column.getColDef().showRowGroup)return!0;return!1}},jye=(e,t,n,s,o)=>{const r=t.childrenAfterAggFilter,i=t.childrenAfterSort;if(!i)return e.doFullSort(r,o);const a=new Set,l=[],{updates:c,adds:u}=n;for(let h=0,f=r.length;h<f;++h){const p=r[h];c.has(p)||u.has(p)||s&&!s.canSkip(p)?l.push({currentPos:l.length,rowNode:p}):a.add(p)}const d=i.filter(h=>a.has(h)).map((h,f)=>({currentPos:f,rowNode:h}));return l.sort((h,f)=>e.compareRowNodes(o,h,f)),Kye(e,o,l,d)},Kye=(e,t,n,s)=>{let o=0,r=0;const i=n.length,a=s.length,l=new Array(i+a);let c=0;for(;o<i&&r<a;){const u=n[o],d=s[r];e.compareRowNodes(t,u,d)<0?(l[c++]=u.rowNode,++o):(l[c++]=d.rowNode,++r)}for(;o<i;)l[c++]=n[o++].rowNode;for(;r<a;)l[c++]=s[r++].rowNode;return l},qye=e=>{const t=e.childrenAfterSort,n=e.childrenAfterAggFilter,s=t==null?void 0:t.length,o=n==null?void 0:n.length;if(!s||!o)return null;const r=new Array(o),i=new Set;for(let l=0;l<o;++l)i.add(n[l]);let a=0;for(let l=0;l<s;++l){const c=t[l];i.delete(c)&&(r[a++]=c)}if(i.size===0&&a===s)return t;for(const l of i)r[a++]=l;return r.length=a,r},Yye=class extends We{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.rowCountReady=!1,this.nodeManager=void 0,this.rowsToDisplay=[],this.rowDataUpdatedPending=!1,this.asyncTransactions=null,this.asyncTransactionsTimer=0,this.started=!1,this.refreshingModel=!1,this.rowNodesCountReady=!1,this.stages=[],this.stagesRefreshProps=new Map,this.onRowHeightChanged_debounced=Os(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new cl(e);this.rootNode=t,this.nodeManager=this.createBean(new Bye(t));const n=this.refreshModel.bind(this,{step:"group"}),s=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:s,columnRowGroupChanged:n,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:n,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,n=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(s=>!!s);this.stages=n;for(let s=n.length-1;s>=0;--s)for(const o of n[s].refreshProps)t.set(o,s);this.addManagedPropertyListeners([...t.keys()],s=>{var r;const o=(r=s.changeSet)==null?void 0:r.properties;o&&this.onPropChange(o)}),this.addManagedPropertyListener("rowData",()=>this.onPropChange(["rowData"])),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.started=!0,this.rowNodesCountReady?this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0}):this.setInitialData()}setInitialData(){this.gos.get("rowData")&&this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,n,s){let o,r=!1;do{o=!1;const i=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(i,n),c=Math.min(a,s);for(let u=l;u<=c;u++){const d=this.getRow(u);if(d.rowHeightEstimated){const h=ol(this.beans,d);d.setRowHeight(h.height),o=!0,r=!0}}o&&this.setRowTopAndRowIndex()}while(o);return r}onPropChange(e){const{nodeManager:t,gos:n,beans:s}=this,o=s.groupStage;if(!t)return;const r=new Set(e),i=o==null?void 0:o.onPropChange(r);let a;r.has("rowData")?a=n.get("rowData"):i&&(a=o==null?void 0:o.extractData()),a&&!Array.isArray(a)&&(a=null,Je(1));const l={step:"nothing",changedProps:r};a&&(!i&&!this.isEmpty()&&a.length>0&&n.exists("getRowId")&&!n.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!n.get("suppressAnimationFrame"),l.changedRowNodes=new my,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const c=l.rowDataUpdated?"group":this.getRefreshedStage(e);c&&(l.step=c,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:n}=this,s=t.length;let o=s;for(let r=0,i=e.length;r<i&&o;++r)o=Math.min(o,n.get(e[r])??o);return o<s?t[o].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:n}=this,s=t.environment.getDefaultRowHeight();let o=0;const r=Ms(this.gos,"normal");for(let i=0,a=n.length;i<a;++i){const l=n[i],c=l.id;if(c!=null&&(e==null||e.add(c)),l.rowHeight==null){const u=ol(t,l,r,s);l.setRowHeight(u.height,u.estimated)}l.setRowTop(o),l.setRowIndex(i),o+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const n=e.active,s=i=>{(i==null?void 0:i.id)!=null&&!t.has(i.id)&&i.clearRowTopAndRowIndex()},o=i=>{s(i),s(i.detailNode),s(i.sibling);const a=i.childrenAfterGroup;if(!i.hasChildren()||!a)return;const l=i.level==-1;if(!(n&&!l&&!i.expanded))for(let u=0,d=a.length;u<d;++u)o(a[u])},r=this.rootNode;r&&o(r)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){var o,r;const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const s=(o=e.sibling)!=null&&o.displayed?1:0;return(((r=e.childrenAfterSort)==null?void 0:r.length)??0)+s}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:n,rowsToDisplay:s}=this;if(!n||!s.length||s[0]===n)return e;const r=n.childrenAfterSort,i=l=>{let c=r[l];if(this.gos.get("groupHideOpenParents"))for(;c.expanded&&c.childrenAfterSort&&c.childrenAfterSort.length>0;)c=c.childrenAfterSort[0];return c.rowIndex},a=t.footerSvc;return a?a==null?void 0:a.getTopDisplayIndex(s,e,r,i):i(e)}getTopLevelIndexFromDisplayedIndex(e){var a;const{rootNode:t,rowsToDisplay:n}=this;if(!t||!n.length||n[0]===t)return e;let o=this.getRow(e);o.footer&&(o=o.sibling);let r=o.parent;for(;r&&r!==t;)o=r,r=o.parent;const i=((a=t.childrenAfterSort)==null?void 0:a.indexOf(o))??-1;return i>=0?i:e}getRowBounds(e){const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:cd(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const s=t.length===0||t.some(o=>o.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:s,keepRenderedRows:!0,animate:cd(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:cd(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new cp(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:n,rowDataUpdated:s}=e;return!(!t||n||!s||t.removals.size||t.adds.size)}refreshModel(e){var c,u;const{nodeManager:t,beans:n,eventSvc:s,started:o,refreshingModel:r}=this;if(!t)return;const i=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&i));if(o&&i&&s.dispatchEvent({type:"rowDataUpdated"}),!o||r||n.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=i);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,(c=n.masterDetailSvc)==null||c.refreshModel(e),i&&e.step!=="group"&&((u=n.colFilter)==null||u.refreshModel()),e.step){case"group":this.doGrouping(e);case"filter":this.doFilter(a);case"pivot":this.doPivot(a);case"aggregate":this.doAggregate(a);case"filter_aggregates":this.doFilterAggregates(a);case"sort":this.doSort(e.changedRowNodes,a);case"map":this.doRowsToDisplay()}const l=new Set;this.setRowTopAndRowIndex(l),this.clearRowTopAndRowIndex(a,l),this.refreshingModel=!1,s.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}isEmpty(){var e,t,n;return!((t=(e=this.rootNode)==null?void 0:e._leafs)!=null&&t.length)||!((n=this.beans.colModel)!=null&&n.ready)}isRowsToRender(){return this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let n=!1,s=!1;const o=[],r=Xf(this.gos);return this.forEachNodeAfterFilterAndSort(i=>{if(s)return;if(n&&(i===t||i===e)&&(s=!0,r&&i.group)){MB(o,i);return}if(!n){if(i!==t&&i!==e)return;n=!0,t===e&&(s=!0)}(!i.group||!r)&&o.push(i)}),o}getTopLevelNodes(){var e;return((e=this.rootNode)==null?void 0:e.childrenAfterGroup)??null}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,n=t.length;if(this.isEmpty()||n===0)return-1;let s=0,o=n-1;if(e<=0)return 0;if(t[o].rowTop<=e)return o;let i=-1,a=-1;for(;;){const l=Math.floor((s+o)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTop<e?s=l+1:c.rowTop>e&&(o=l-1),i===s&&a===o))return l;i=s,a=o}}isRowInPixel(e,t){const n=e.rowTop,s=n+e.rowHeight;return n<=t&&s>t}forEachLeafNode(e){var n;const t=(n=this.rootNode)==null?void 0:n._leafs;if(t)for(let s=0,o=t.length;s<o;++s)e(t[s],s)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let n=0,s=t.length;n<s;++n)e(t[n],n)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterSort)}forEachPivotNode(e,t,n){const{colModel:s,rowGroupColsSvc:o}=this.beans;if(!s.isPivotMode())return;if(!(o!=null&&o.columns.length)){e(this.rootNode,0);return}const r=n?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,i=>i.leafGroup?null:i[r])}depthFirstSearchRowNodes(e,t=!1,n=r=>r.childrenAfterGroup,s=this.rootNode,o=0){let r=o;if(!s)return r;const i=s===this.rootNode;if(i||e(s,r++),s.hasChildren()&&!s.footer){const a=n(s);if(a){const l=this.beans.footerSvc;r=(l==null?void 0:l.addTotalRows(r,s,e,t,i,"top"))??r;for(const c of a)r=this.depthFirstSearchRowNodes(e,t,n,c,r);return(l==null?void 0:l.addTotalRows(r,s,e,t,i,"bottom"))??r}}return r}doAggregate(e){var n;const t=this.rootNode;t&&((n=this.beans.aggStage)==null||n.execute({rowNode:t,changedPath:e}))}doFilterAggregates(e){const t=this.rootNode,n=this.beans.filterAggStage;if(n){n.execute({rowNode:t,changedPath:e});return}t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const n=this.beans.sortStage;if(n){n.execute({rowNode:this.rootNode,changedRowNodes:e,changedPath:t});return}t.forEachChangedNodeDepthFirst(s=>{s.childrenAfterSort=s.childrenAfterAggFilter.slice(0),OB(s)})}doGrouping(e){var o;const t=this.rootNode,n=this.beans.groupStage,s=n==null?void 0:n.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(s===void 0){const r=t._leafs;t.childrenAfterGroup=r,t.updateHasChildren();const i=t.sibling;i&&(i.childrenAfterGroup=r)}(s||e.rowDataUpdated)&&((o=this.beans.colFilter)==null||o.refreshModel()),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;if(t){t.execute({rowNode:this.rootNode,changedPath:e});return}e.forEachChangedNodeDepthFirst(n=>{n.childrenAfterFilter=n.childrenAfterGroup,eB(n)},!0)}doPivot(e){var t;(t=this.beans.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getRowNode(e){var s,o;const t=(s=this.nodeManager)==null?void 0:s.getRowNode(e);return typeof t=="object"?t:typeof e=="string"&&e.indexOf(f0)===0?(o=this.beans.groupStage)==null?void 0:o.getNode(e):void 0}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const n=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),n)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var a;const{nodeManager:e,beans:t,eventSvc:n,asyncTransactions:s}=this;if(!e)return;(a=t.valueCache)==null||a.onDataChanged();const o=[],r=[],i=new my;for(const{rowDataTransaction:l,callback:c}of s??[]){this.rowNodesCountReady=!0;const u=e.updateRowData(l,i);o.push(u),c&&r.push(c.bind(null,u))}this.commitTransactions(i),r.length>0&&setTimeout(()=>{for(let l=0,c=r.length;l<c;l++)r[l]()},0),o.length>0&&n.dispatchEvent({type:"asyncTransactionsFlushed",results:o}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){var o;const t=this.nodeManager;if(!t)return null;(o=this.beans.valueCache)==null||o.onDataChanged(),this.rowNodesCountReady=!0;const n=new my,s=t.updateRowData(e,n);return this.commitTransactions(n),s}commitTransactions(e){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:e,changedPath:this.createChangePath(!0)})}doRowsToDisplay(){const{beans:e,rootNode:t}=this,n=e.flattenStage;if(n){this.rowsToDisplay=n.execute({rowNode:t});return}const s=this.rootNode.childrenAfterSort??[];for(const o of s)o.setUiLevel(0);this.rowsToDisplay=s}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){const e=this.rootNode;if(!e)return;const t=this.resetRowHeightsForAllRowNodes();e.setRowHeight(e.rowHeight,!0);const n=e.sibling;n==null||n.setRowHeight(n.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const n=t.detailNode;n==null||n.setRowHeight(n.rowHeight,!0);const s=t.sibling;s==null||s.setRowHeight(s.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){var t;e.rowHeightChanged&&!((t=this.beans.rowAutoHeight)!=null&&t.active)&&this.resetRowHeights()}onGridReady(){this.started||this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},MB=(e,t)=>{const n=t.childrenAfterGroup;if(n)for(let s=0,o=n.length;s<o;++s){const r=n[s];r.data&&e.push(r),r.group&&MB(e,r)}};function Xye(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function Zye(e,t){const n=pl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function Jye(e){var t;return((t=pl(e))==null?void 0:t.isEmpty())??!0}function Qye(e,t){var n;(n=pl(e))==null||n.forEachLeafNode(t)}function ewe(e,t){var n;(n=pl(e))==null||n.forEachNodeAfterFilter(t)}function twe(e,t){var n;(n=pl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function nwe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=pl(e))==null?void 0:n.updateRowData(t)})}function swe(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var s;return(s=pl(e))==null?void 0:s.batchUpdateRowData(t,n)})}function owe(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=pl(e))==null?void 0:t.flushAsyncTransactions()})}function rwe(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var NB={moduleName:"ClientSideRowModel",version:ut,rowModels:["clientSide"],beans:[Yye,zye],dependsOn:[z2]},iwe={moduleName:"ClientSideRowModelApi",version:ut,apiFunctions:{onGroupExpandedOrCollapsed:Xye,refreshClientSideRowModel:Zye,isRowDataEmpty:Jye,forEachLeafNode:Qye,forEachNodeAfterFilter:ewe,forEachNodeAfterFilterAndSort:twe,applyTransaction:nwe,applyTransactionAsync:swe,flushAsyncTransactions:owe,getBestCostNodeSelection:rwe,resetRowHeights:AB,onRowHeightChanged:PB},dependsOn:[Oye,Mye]},awe=class extends We{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel}serialize(e,t={}){const{allColumns:n,columnKeys:s,skipRowGroups:o,exportRowNumbers:r}=t,i=this.getColumnsToExport({allColumns:n,skipRowGroups:o,columnKeys:s,exportRowNumbers:r});return[this.prepareSession(i),this.prependContent(t),this.exportColumnGroups(t,i),this.exportHeaders(t,i),this.processPinnedTopRows(t,i),this.processRows(t,i),this.processPinnedBottomRows(t,i),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,n,s){var p;const o=t.shouldRowBeSkipped||(()=>!1),i=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!i,l=this.colModel.isPivotMode()?s.leafGroup:!s.group,c=!!s.footer,u=s.allChildrenCount===1&&((p=s.childrenAfterGroup)==null?void 0:p.length)===1&&cre(this.gos,s);if(!l&&!c&&(t.skipRowGroups||u||a)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.stub||s.level===-1&&!l&&!c||o(Pt(this.gos,{node:s})))return;const f=e.onNewBodyRow(s);if(n.forEach((g,v)=>{f.onColumn(g,v,s)}),t.getCustomContentBelowRow){const g=t.getCustomContentBelowRow(Pt(this.gos,{node:s}));g&&e.addCustomContent(g)}}appendContent(e){return t=>{const n=e.appendContent;return n&&t.addCustomContent(n),t}}prependContent(e){return t=>{const n=e.prependContent;return n&&t.addCustomContent(n),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return n=>{if(!e.skipColumnGroupHeaders){const s=new IL,{colGroupSvc:o}=this.beans,r=o?o.createColumnGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(r,n,e.processGroupHeaderCallback)}return n}}exportHeaders(e,t){return n=>{if(!e.skipColumnHeaders){const s=n.onNewHeaderRow();t.forEach((o,r)=>{s.onColumn(o,r,void 0)})}return n}}processPinnedTopRows(e,t){return n=>{var o,r;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="top").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedTopRow(i.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("top",s),n}}processRows(e,t){return n=>{var c;const s=this.rowModel,o=rs(this.gos),r=ld(this.gos),i=!o&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(u=>u.rowPinned==null).sort((u,d)=>u.rowIndex-d.rowIndex).map(u=>s.getRow(u.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())o?s.forEachPivotNode(a,!0,l==="filteredAndSorted"):r?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||i){const u=((c=this.beans.selectionSvc)==null?void 0:c.getSelectedNodes())??[];this.replicateSortedOrder(u),u.forEach(a)}else l==="all"?s.forEachNode(a):o||r?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return n}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:n}=this.beans;if(!t||!n)return;const s=t.getSortOptions(),o=(r,i)=>{var a,l;return r.rowIndex!=null&&i.rowIndex!=null?r.rowIndex-i.rowIndex:r.level===i.level?((a=r.parent)==null?void 0:a.id)===((l=i.parent)==null?void 0:l.id)?n.compareRowNodes(s,{rowNode:r,currentPos:r.rowIndex??-1},{rowNode:i,currentPos:i.rowIndex??-1}):o(r.parent,i.parent):r.level>i.level?o(r.parent,i):o(r,i.parent)};e.sort(o)}processPinnedBottomRows(e,t){return n=>{var o,r;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="bottom").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedBottomRow(i.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("bottom",s),n}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:n=!1,exportRowNumbers:s=!1,columnKeys:o}=e,{colModel:r,gos:i,visibleCols:a}=this,l=r.isPivotMode(),c=h=>ua(h)?!1:!da(h)||s;if(o!=null&&o.length)return r.getColsForKeys(o).filter(c);const u=i.get("treeData");let d=[];return t&&!l?d=r.getCols():d=a.allCols,d=d.filter(h=>c(h)&&(n&&!u?!BE(h):!0)),d}recursivelyAddHeaderGroups(e,t,n){const s=[];for(const o of e){const r=o;if(r.getChildren)for(const i of r.getChildren()??[])s.push(i)}e.length>0&&is(e[0])&&this.doAddHeaderHeader(t,e,n),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,n)}doAddHeaderHeader(e,t,n){const s=e.onNewHeaderGroupingRow();let o=0;for(const r of t){const i=r;let a;n?a=n(Pt(this.gos,{columnGroup:i})):a=this.beans.colNames.getDisplayNameForColumnGroup(i,"header");const c=(i.isExpandable()?i.getLeafColumns():[]).reduce((u,d,h,f)=>{let p=Tn(u);return d.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],u.push(p)):p&&p[1]==null&&(p[1]=h-1),h===f.length-1&&p&&p[1]==null&&(p[1]=h),u},[]);s.onColumn(i,a||"",o++,i.getLeafColumns().length-1,c)}}},lwe={moduleName:"SharedExport",version:ut,beans:[awe]},LB=`\r
259
- `,cwe=class extends Vge{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:n}=e;this.suppressQuotes=t,this.columnSeparator=n}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,LB),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,s)=>{s!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,s){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,n){t!=0&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(s.valueFormatted??s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(Je(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=LB),this.isFirstLine=!1}},uwe=class extends Lge{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){Je(51);return}const t=this.getMergedParams(e),n=this.getData(t),s=new Blob(["\uFEFF",n],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(Pt(this.gos,{})):t.fileName;Bge(this.getFileName(o),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:s,valueSvc:o,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new cwe({colModel:t,colNames:n,valueSvc:o,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:s})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function dwe(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function hwe(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var fwe={moduleName:"CsvExport",version:ut,beans:[uwe],apiFunctions:{getDataAsCsv:dwe,exportDataAsCsv:hwe},dependsOn:[lwe]},pwe=class extends We{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:s,rowNodes:o}=this;for(let r=0;r<e;r++){const i=n+r,a=new cl(s);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),o.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:s}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:s}}}setDataAndId(e,t,n){ht(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Vn(this.params.datasource.getRows)){Je(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:s,filterModel:o},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:s,filterModel:o,context:Pt(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((s,o)=>{this.startRow+o<n&&e(s,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((o,r)=>{const i=e.rowData?e.rowData[r]:void 0;!o.id&&o.alreadyRendered&&i&&(t[r]=new cl(n),t[r].setRowIndex(o.rowIndex),t[r].setRowTop(o.rowTop),t[r].setRowHeight(o.rowHeight),o.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const s=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,s)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},gwe=2,mwe=class extends We{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let s=this.blocks[n];if(!s){if(t)return;s=this.createBlock(n)}return s.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new pwe(e,this,t));return this.blocks[n.id]=n,this.blockCount++,this.purgeBlocksIfNeeded(n),t.rowNodeBlockLoader.addBlock(n),n}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(sl(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(i=>i!=e),n=(i,a)=>a.lastAccessed-i.lastAccessed;t.sort(n);const s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,r=gwe-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,c=s?a>=o:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(i)||this.isBlockFocused(i))return;this.removeBlockFromCache(i)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:s}=e;return t.rowIndex>=n&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:s}=this.params,r=(e.id+1)*n+s;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,ht(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,s)=>n.id-s.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let s=-1,o=!1;const r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(o&&s+1!==l.id){i=!0;continue}s=l.id,l.forEachNode(c=>{const u=c===e||c===t;(o||u)&&n.push(c),u&&(o=!o)},r,this.rowCount)}return i||o?[]:n}},vwe=class extends We{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new cl(e);this.rootNode=t,t.level=-1,this.rowHeight=vc(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=vc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Mf(this.cacheParams.sortModel,((t=this.beans.sortSvc)==null?void 0:t.getSortModel())??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){var n;return((n=this.infiniteCache)==null?void 0:n.getRowNodesInRange(e,t))??[]}reset(){var n;if(!this.datasource)return;ud(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:s,eventSvc:o,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:s,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:vc(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new mwe(this.cacheParams)),o.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function ywe(e){var t;(t=_y(e))==null||t.refreshCache()}function wwe(e){var t;(t=_y(e))==null||t.purgeCache()}function Cwe(e){var t;return(t=_y(e))==null?void 0:t.getRowCount()}var bwe=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=ure(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Os(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){$r(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){sl(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:s}=t.getBlockStateJson();e[n]=s}),e}printCacheStatus(){sl(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},Swe={moduleName:"InfiniteRowModelCore",version:ut,rowModels:["infinite"],beans:[vwe,bwe]},Ewe={moduleName:"InfiniteRowModel",version:ut,apiFunctions:{refreshInfiniteCache:ywe,purgeInfiniteCache:wwe,getInfiniteRowCount:Cwe},dependsOn:[Swe,Nye]},_we="↑",Rwe="↓",Dwe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},Twe=class extends Cn{constructor(){super(Dwe),this.eValue=dt,this.eDelta=dt,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),s=e.formatValue(n),o=ht(s)?s:n,r=t>=0,i=this.eDelta;r?i.textContent=_we+o:i.textContent=Rwe+o,i.classList.toggle("ag-value-change-delta-up",r),i.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),ks(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:s}=e,{eValue:o,lastValue:r,beans:i}=this;if(n===r||(ht(s)?o.textContent=s:ht(n)?o.textContent=n:ks(o),(c=i.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=r&&typeof r=="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return r&&o.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},Iwe=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",xwe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},Fwe=class extends Cn{constructor(){super(xwe),this.eCurrent=dt,this.refreshCount=0,this.registerCSS(Iwe)}init(e){this.refresh(e,!0)}addSlideAnimation(){var o;this.refreshCount++;const e=this.refreshCount;(o=this.ePrevious)==null||o.remove();const{beans:t,eCurrent:n}=this,s=as({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=s,s.textContent=n.textContent,this.getGui().insertBefore(s,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var r;e===this.refreshCount&&((r=this.ePrevious)==null||r.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var o;let n=e.value;if(Vn(n)&&(n=""),n===this.lastValue||(o=this.beans.filterManager)!=null&&o.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const s=this.eCurrent;return ht(e.valueFormatted)?s.textContent=e.valueFormatted:ht(e.value)?s.textContent=n:ks(s),!0}},Pwe=class extends We{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),s=this.beans.gos.get("cellFadeDuration")){const o=this.animations[t];o.delete(e);const r=Date.now(),i=r+n,a=r+n+s,l={phase:"flash",flashEndTime:i,fadeEndTime:a};o.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&i+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=i)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const s=this.animations[n],o=`ag-cell-${n}`,r=`${o}-animation`;for(const[i,a]of s){if(!i.isAlive()||!i.comp){s.delete(i);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=i;switch(l){case"flash":f.toggleCss(o,!1),f.toggleCss(r,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(o,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),s.delete(i);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=Fue(e.cellPosition);t.cells[n]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t==null?void 0:t.flashDuration,t==null?void 0:t.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function Awe(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const s of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(s,t)})}var kwe={moduleName:"HighlightChanges",version:ut,beans:[Pwe],userComponents:{agAnimateShowChangeCellRenderer:Twe,agAnimateSlideCellRenderer:Fwe},apiFunctions:{flashCells:Awe}};function Owe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Mwe(e,t,n){var s;return(s=e.stateSvc)==null?void 0:s.setState(t,n)}function VB(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=Nwe(e)),e.version=ut,e}function Nwe(e){return e.cellSelection=Lwe(e,"rangeSelection"),e}function Lwe(e,t){if(e&&typeof e=="object")return e[t]}var Vwe=class extends We{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Os(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Os(this,()=>{this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(this.updateCachedState("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowGroupExpansion",void 0)):(this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("ssrmRowGroupExpansion",void 0))},0),this.onRowSelectedDebounced=Os(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:n}=this.beans;this.isClientSideRowModel=rs(e);const s=VB(e.get("initialState")??{}),o=s.partialColumnState;delete s.partialColumnState,this.cachedState=s;const r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(s))),(s.columnOrder||s.columnVisibility||s.columnSizing||s.columnPinning||s.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(s,!!o),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(s))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(s))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=VB(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const s="api",o=t?new Set(t):void 0;this.setGridReadyState(n,s,o),this.setColumnsInitialisedState(n,s,!!o,o),this.setRowCountState(n,s,o),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,s,o),this.stopSuppressEvents(s)})}setGridReadyState(e,t,n){var s,o;t==="api"&&!(n!=null&&n.has("sideBar"))&&((o=(s=this.beans.sideBar)==null?void 0:s.comp)==null||o.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,s){this.setColumnState(e,t,n,s),this.setColumnGroupState(e,t,s),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=s=>()=>this.updateColumnState([s]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:s,rowGroupExpansion:o,ssrmRowGroupExpansion:r,rowSelection:i,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",s)&&this.setFilterState(s),l("rowGroupExpansion",o)&&this.setRowGroupExpansionState(r,o,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},s=()=>t("filter",this.getFilterState()),{gos:o,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:s,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(o.get("groupDefaultExpanded")!==0||o.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:i=>{(i.newPage||i.newPageSize)&&t("pagination",this.getPaginationState())}}),r&&this.addManagedListeners(r,{filterStateChanged:s})}setFirstDataRenderedState(e,t,n){const{scroll:s,cellSelection:o,focusedCell:r,columnOrder:i,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",o)&&this.setCellSelectionState(o),l("scroll",s)&&this.setScrollState(s),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:s=>{if(s.finished){const o=this.getRangeSelectionState();t("rangeSelection",o),t("cellSelection",o)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return Oge(Kv(e),e.colModel.isPivotMode())}setColumnState(e,t,n,s){const{sort:o,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(E,k)=>{const I=!(s!=null&&s.has(E))&&!!(k||t==="api");return h||(h=I),I},p={},g=E=>{let k=p[E];return k||(k={colId:E},p[E]=k,k)},v={},C=f("sort",o);C&&(o==null||o.sortModel.forEach(({colId:E,sort:k},I)=>{const M=g(E);M.sort=k,M.sortIndex=I})),(C||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((E,k)=>{const I=g(E);I.rowGroup=!0,I.rowGroupIndex=k})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:E,aggFunc:k})=>{g(E).aggFunc=k})),(b||!n)&&(v.aggFunc=null);const w=f("pivot",a);w&&(a==null||a.pivotColIds.forEach((E,k)=>{const I=g(E);I.pivot=!0,I.pivotIndex=k}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(w||!n)&&(v.pivot=null,v.pivotIndex=null);const D=f("columnPinning",l);if(D){for(const E of(l==null?void 0:l.leftColIds)??[])g(E).pinned="left";for(const E of(l==null?void 0:l.rightColIds)??[])g(E).pinned="right"}(D||!n)&&(v.pinned=null);const R=f("columnVisibility",c);if(R)for(const E of(c==null?void 0:c.hiddenColIds)??[])g(E).hide=!0;(R||!n)&&(v.hide=null);const T=f("columnSizing",u);if(T)for(const{colId:E,flex:k,width:I}of(u==null?void 0:u.columnSizingModel)??[]){const M=g(E);M.flex=k??null,M.width=I}(T||!n)&&(v.flex=null);const F=d==null?void 0:d.orderedColIds,x=!!(F!=null&&F.length)&&!(s!=null&&s.has("columnOrder")),P=x?F.map(E=>g(E)):Object.values(p);(P.length||h)&&(this.columnStates=P,Hr(this.beans,{state:P,applyOrder:x,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const s=this.columnGroupStates;this.columnGroupStates=void 0;const o=this.beans,{pivotResultCols:r,colGroupSvc:i}=o;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);Hr(o,{state:a,applyOrder:e},t)}s&&(i==null||i.setColumnGroupState(s,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Mge(t)}setColumnGroupState(e,t,n){var a;const s=this.beans.colGroupSvc;if(!s||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const o=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=s.getColumnGroupState().map(({groupId:l})=>{const c=o.has(l);return c&&o.delete(l),{groupId:l,open:c}});for(const l of o)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),s.setColumnGroupState(i,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),s=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||s||n?{filterModel:t,columnFilterState:n,advancedFilterModel:s}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:s,advancedFilterModel:o}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||s!==void 0)&&(t==null||t.setFilterState(n??null,s??null,"columnFilter")),o!==void 0&&(t==null||t.setAdvFilterModel(o??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:s,type:o,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:s,type:o,startRow:r,endRow:i,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:s,visibleCols:o}=this.beans;if(!la(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of i.colIds){const u=s.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=s.getCol(i.startColId);if(!l){const c=o.allCols,u=new Set(a);l=c.find(d=>u.has(d))}r.push({...i,columns:a,startColumn:l})}n.setCellRanges(r)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:s,rowRenderer:o,animationFrameSvc:r,ctrlsSvc:i}=this.beans;s.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),o.redraw({afterScroll:!0}),r==null||r.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:s,rowIndex:o,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(s),rowIndex:o,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),s=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!s))return{page:n,pageSize:s}}setPaginationState(e,t){const{pagination:n,gos:s}=this.beans;if(!n)return;const{pageSize:o,page:r}=e??{page:0,pageSize:s.get("paginationPageSize")},i=t==="gridInitializing";o&&!s.get("paginationAutoPageSize")&&n.setPageSize(o,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var s;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((s=t==null?void 0:t.toggledNodes)!=null&&s.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const s=this.beans.expansionSvc;if(!s)return;const o=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};s.setExpansionState(o,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const s=this.cachedState;for(const o of Object.keys(t)){const r=t[o];Mf(r,s[o])||(n=!0)}this.cachedState={...s,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Mf(t,n)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){var e;this.suppressEvents=!0,(e=this.beans.colAnimation)==null||e.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{var t;this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&((t=this.beans.colAnimation)==null||t.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},Bwe={moduleName:"GridState",version:ut,beans:[Vwe],apiFunctions:{getState:Owe,setState:Mwe}};function $we(e){return e.rowModel.isLastRowIndexKnown()}function Hwe(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Gwe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function Uwe(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function Wwe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function zwe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function jwe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function Kwe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function qwe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Ywe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var Xwe=class extends We{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const s=Math.max(vc(t),1),o=Math.floor(e/s);t.pagination.setPageSize(o,"autoCalculated")};this.isBodyRendered?Os(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},vp="paginationPageSizeSelector",Zwe={tag:"span",cls:"ag-paging-page-size"},Jwe=class extends Cn{constructor(){super(Zwe),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(vp,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.pagination.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){ks(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(vp)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const o=this.gos.exists("paginationPageSize"),r=this.gos.get(vp)!==!0;Je(94,{pageSizeSet:o,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Je(95,{paginationPageSizeOption:t,paginationPageSizeSelector:vp}),e.unshift("")}const s=String(n?"":t);this.selectPageSizeComp?(il(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(s,!0)):this.createPageSizeSelectorComp(e,s),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),s=n("pageSizeSelectorLabel","Page Size:"),o=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new a0).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(o).setLabel(s).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(vp);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,s)=>n-s)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},Qwe={selector:"AG-PAGE-SIZE-SELECTOR",component:Jwe},eCe=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}",tCe=class extends YV{constructor(){super(),this.btFirst=dt,this.btPrevious=dt,this.btNext=dt,this.btLast=dt,this.lbRecordCount=dt,this.lbFirstRowOnPage=dt,this.lbLastRowOnPage=dt,this.lbCurrent=dt,this.lbTotal=dt,this.pageSizeComp=dt,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(eCe)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[Qwe]);const{btFirst:t,btPrevious:n,btNext:s,btLast:o}=this;this.activateTabIndex([t,n,s,o]),t.insertAdjacentElement("afterbegin",hr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",hr(e?"next":"previous",this.beans)),s.insertAdjacentElement("afterbegin",hr(e?"previous":"next",this.beans)),o.insertAdjacentElement("afterbegin",hr(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(r):Xle(this.beans,r),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:s=>{(s.key===Oe.ENTER||s.key===Oe.SPACE)&&(s.preventDefault(),n())}})}Yle(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):Nge(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),o=e===n-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){uoe(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),s=e?n:null,o=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*o+1,a=i+r-1,e&&a>s&&(a=s));const l=i+r-1,c=!e&&n<l,u=this.formatNumber(i);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?o+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,C;if(e)v=this.formatNumber(t),C=this.formatNumber(s);else{const S=h("more","more");v=S,C=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=C,this.announceAriaStatus(u,d,C,g,v)}announceAriaStatus(e,t,n,s,o){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${i} ${s} ${l} ${o}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},nCe={selector:"AG-PAGINATION",component:tCe},sCe=class extends We{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return nCe}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,s;if(!this.active)return;let t=e;this.paginateChildRows||(t=((s=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:s.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ht(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ht(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ht(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ht(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,s=t-1;this.totalPages=Math.floor(s/n)+1,this.adjustCurrentPageIfInvalid();const o=this.currentPage,r=n*o;let i=n*(o+1)-1;if(i>s&&(i=s),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===s)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,s=e-1;this.totalPages=Math.floor(s/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>s&&(this.bottomDisplayedRowIndex=s)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:s=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:s,keepRenderedRows:t})}},oCe={moduleName:"Pagination",version:ut,beans:[sCe,Xwe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:$we,paginationGetPageSize:Hwe,paginationGetCurrentPage:Gwe,paginationGetTotalPages:Uwe,paginationGetRowCount:Wwe,paginationGoToNextPage:zwe,paginationGoToPreviousPage:jwe,paginationGoToFirstPage:Kwe,paginationGoToLastPage:qwe,paginationGoToPage:Ywe},dependsOn:[Ry]};function rCe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function BB(e,t,n,s,o){t&&(s&&t.parent&&t.parent.level!==-1&&BB(e,t.parent,n,s,o),t.setExpanded(n,void 0,o))}function iCe(e,t){return e.rowModel.getRowNode(t)}function aCe(e,t,n,s){e.rowRenderer.addRenderedRowListener(t,n,s)}function lCe(e){return e.rowRenderer.getRenderedNodes()}function cCe(e,t,n){e.rowModel.forEachNode(t,n)}function uCe(e){return e.rowRenderer.firstRenderedRow}function dCe(e){return e.rowRenderer.lastRenderedRow}function hCe(e,t){return e.rowModel.getRow(t)}function fCe(e){return e.rowModel.getRowCount()}var pCe={moduleName:"RowApi",version:ut,apiFunctions:{redrawRows:rCe,setRowNodeExpanded:BB,getRowNode:iCe,addRenderedRowListener:aCe,getRenderedNodes:lCe,forEachNode:cCe,getFirstDisplayedRowIndex:uCe,getLastDisplayedRowIndex:dCe,getDisplayedRowAtIndex:hCe,getDisplayedRowCount:fCe}},gCe={moduleName:"ScrollApi",version:ut,apiFunctions:{getVerticalPixelRange:Ive,getHorizontalPixelRange:xve,ensureColumnVisible:CB,ensureIndexVisible:bB,ensureNodeVisible:Fve}};function mCe(e,t,n){if(!t)return;const s=e.ctrlsSvc.getGridBodyCtrl().eGridBody,o=`aria-${t}`;n===null?s.removeAttribute(o):s.setAttribute(o,n)}function vCe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function yCe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function wCe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function CCe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function bCe(e){return{rowHeight:vc(e),headerHeight:op(e)}}function SCe(e,t={}){var r;const n=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=i.getCellRenderer();a!=null&&n.push(tp(a))}if((r=t.columns)!=null&&r.length)return n;const s=[],o=o_(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(o&&!r_(i.rowNode,o)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&s.push(tp(c))}}return[...s,...n]}var ECe={moduleName:"RenderApi",version:ut,apiFunctions:{setGridAriaProperty:mCe,refreshCells:vCe,refreshHeader:yCe,isAnimationFrameQueueEmpty:wCe,flushAllAnimationFrames:CCe,getSizesForCurrentTheme:bCe,getCellRendererInstances:SCe}};function _Ce(e,t){var n,s;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(s=e.colAutosize)==null||s.sizeColumnsToFitGridBody(t)}function $B({colAutosize:e,visibleCols:t},n,s){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:s,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function RCe(e,t){var n;t&&typeof t=="object"?$B(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var DCe=class extends We{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");s=r!=null&&r.length>0&&rs(e)}s&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(o))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(s=>{var c;const o=u=>fd(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return o(s);const r=HB(this.beans),i=u=>n.leftCols.some(d=>Jf(d,u)),a=u=>n.rightCols.some(d=>Jf(d,u)),l=e.colKeys.filter(u=>!ua(u)&&!da(u)&&!i(u)&&!a(u));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),o(s)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:s,skipHeader:o,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let C=-1;const S=Object.fromEntries(c.map(({colId:D,...R})=>[D,R])),b=o??this.gos.get("skipHeaderOnAutoSize"),w=r??b;for(;C!==0;){C=0;const D=[];for(const R of s){if(!R||Ere(R))continue;const T=f.getCol(R);if(!T||v.has(T))continue;const F=p.getPreferredWidthForColumn(T,b);if(F>0){const x=S[T.colId]??{};x.minWidth??(x.minWidth=l),x.maxWidth??(x.maxWidth=a);const P=TCe(T,F,x);T.setActualWidth(P,u),v.add(T),C++}D.push(T)}D.length&&g.refresh(u)}w||this.autoSizeColumnGroupsByColumns(s,u,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:s,ctrlsSvc:o}=this.beans,r=new Set,i=s.getColsForKeys(e);for(const l of i){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||r.add(c),c=c.getParent()}let a;for(const l of r){for(const c of o.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),s=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",s);const o=new Tc(e);return o.addEventListener("doubleTap",s),()=>{e.removeEventListener("dblclick",s),o.destroy()}}addColumnGroupResize(e,t,n){const s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{const r=[],i=t.getDisplayedLeafColumns();for(const a of i)a.getColDef().suppressAutoSize||r.push(a.getColId());r.length>0&&this.autoSizeCols({colKeys:r,skipHeader:s,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",o),()=>e.removeEventListener("dblclick",o)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=HB(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):Je(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,s){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,s));return}const o={};for(const{key:v,...C}of(s==null?void 0:s.columnLimits)??[])o[typeof v=="string"?v:v.getColId()]=C;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=ca(r);if(s!=null&&s.onlyScaleUp&&i>e||e===i&&r.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const S=o==null?void 0:o[C.getId()],b=(S==null?void 0:S.minWidth)??(s==null?void 0:s.defaultMinWidth),w=(S==null?void 0:S.maxWidth)??(s==null?void 0:s.defaultMaxWidth),D=C.getActualWidth();return(b==null||D>=b)&&(w==null||D<=w)}))return;const l=[],c=[];for(const v of r){const C=((p=s==null?void 0:s.colKeys)==null?void 0:p.some(S=>Jf(v,S)))??!0;v.getColDef().suppressSizeToFit||!C?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{$r(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const C=o==null?void 0:o[v.getId()],S=(C==null?void 0:C.minWidth)??(s==null?void 0:s.defaultMinWidth),b=(C==null?void 0:C.maxWidth)??(s==null?void 0:s.defaultMaxWidth),w=v.getActualWidth();typeof S=="number"&&w<S?v.setActualWidth(S,t,!0):typeof b=="number"&&w>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-ca(c);if(v<=0)for(const C of l){const S=((g=o==null?void 0:o[C.getId()])==null?void 0:g.minWidth)??(s==null?void 0:s.defaultMinWidth)??C.minWidth;C.setActualWidth(S,t,!0)}else{const C=v/ca(l);let S=v;for(let b=l.length-1;b>=0;b--){const w=l[b],D=o==null?void 0:o[w.getId()],R=(D==null?void 0:D.minWidth)??(s==null?void 0:s.defaultMinWidth),T=(D==null?void 0:D.maxWidth)??(s==null?void 0:s.defaultMaxWidth),F=w.getMinWidth(),x=w.getMaxWidth(),P=typeof R=="number"&&R>F?R:F,E=typeof T=="number"&&T<x?T:x;let k=Math.round(w.getActualWidth()*C);k<P?(k=P,h(w),d=!1):k>E?(k=E,h(w),d=!1):b===0&&(k=S),w.setActualWidth(k,t,!0),S-=k}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&fd(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const s=n.type;if(s==="fitGridWidth"){const{columnLimits:o,defaultMinWidth:r,defaultMaxWidth:i}=n,a=o==null?void 0:o.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else s==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(s)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var s;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(s=this.beans.colDelayRenderSvc)==null||s.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function TCe(e,t,n={}){const s=n.minWidth??e.getMinWidth();t<s&&(t=s);const o=n.maxWidth??e.getMaxWidth();return t>o&&(t=o),t}function HB({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),o=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return $f(n.eGridBody)-o}var ICe={moduleName:"ColumnAutoSize",version:ut,beans:[DCe],apiFunctions:{sizeColumnsToFit:_Ce,autoSizeColumns:$B,autoSizeAllColumns:RCe},dependsOn:[h2]},xCe=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function FCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function PCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function ACe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function kCe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function OCe(e,t,n){var s;return(s=e.pinnedRowModel)==null?void 0:s.forEachPinnedRow(t,n)}var MCe={moduleName:"PinnedRow",version:ut,beans:[Ace],css:[xCe],apiFunctions:{getPinnedTopRowCount:FCe,getPinnedBottomRowCount:PCe,getPinnedTopRow:ACe,getPinnedBottomRow:kCe,forEachPinnedRow:OCe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},NCe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const s of this.spannedNodes)s!==this.lastNode&&(t+=s.rowHeight);return e-t}},LCe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:s,rowModel:o,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const C=(w,D)=>{p=w,g=null,v=D},S=w=>{const D=!w.isExpandable()&&!w.group&&!w.detail&&(u?!u({rowNode:w}):!0);if(w.rowIndex==null||!D){C(null,null);return}if(p==null||w.level!==p.level||w.footer||g&&w.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){C(w,r.getValue(t,w));return}const R=r.getValue(t,w);if(f){const T=Pt(n,{valueA:v,nodeA:p,valueB:R,nodeB:w,column:t,colDef:a});if(!h(T)){C(w,R);return}}else if(d?!d(v,R):v!==R){C(w,R);return}if(!g){const T=l==null?void 0:l.get(p);(T==null?void 0:T.firstNode)===p?(T.reset(),g=T):g=new NCe(t,p),c.set(p,g)}g.addSpannedNode(w),c.set(w,g)};switch(e){case"center":(b=o.forEachDisplayedNode)==null||b.call(o,w=>{(!i||i.isRowInPage(w.rowIndex))&&S(w)}),this.centerValueNodeMap=c;break;case"top":s==null||s.forEachPinnedRow("top",S),this.topValueNodeMap=c;break;case"bottom":s==null||s.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},VCe=class extends We{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Os(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Os(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const n=this.createManagedBean(new LCe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,s=e.column,o=e.rowIndex,r=this.spanningColumns.get(s);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(o);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(o);break;default:i=n.getRow(o)}if(i)return r.getCellSpan(i)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,s]of this.spanningColumns)if(s.isCellSpanning(e)){const o=s.getCellSpan(e);t(n,o)}}destroy(){super.destroy(),this.spanningColumns.clear()}},BCe=class extends Rd{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,s,o,r,i){this.eWrapper=n,super.setComp(e,t,n,s,o,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||Tv(e,t.rowIndex)}setAriaRowSpan(){goe(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(fy(t)){this.focusedCellPosition=void 0;return}const n=this.isCellFocused();n||(this.focusedCellPosition=void 0),e&&n&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},$Ce=class extends Ey{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new BCe(t,this,this.beans)}isCorrectCtrlForSpan(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},HCe=class extends We{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),s=n.size,o=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of o)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(r.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){r.set(u.firstNode,d),n.delete(u.firstNode);return}i=!0;const h=new $Ce(u.firstNode,this.beans,!1,!1,!1);r.set(u.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===s;if(!(!i&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const s=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(s)return s.getAllCellCtrls().find(o=>o.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},GCe={moduleName:"CellSpan",version:ut,beans:[VCe,HCe]},UCe=class extends We{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,n=e.colDef,s=n.cellClassRules,o=this.getCellClassParams(e,n);n_(this.beans.expressionSvc,s===this.cellClassRules?void 0:this.cellClassRules,s,o,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=s}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let s;if(typeof n=="function"){const o=this.getCellClassParams(e,t);s=n(o)}else s=n;s&&this.cellComp.setUserStyles(s)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,s=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const o=this.beans.cellStyles.getStaticCellClasses(n,s);this.staticClasses=o;for(const r of o)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:s}=this.cellCtrl;return Pt(this.beans.gos,{value:n,data:s.data,node:s,colDef:t,column:e,rowIndex:s.rowIndex})}},WCe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,s){n_(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,s),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let s;return typeof n=="function"?s=n(t):s=n,typeof s=="string"&&(s=[s]),s||[]}createCellCustomStyleFeature(e,t){return new UCe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(o=>{n(o)})}},zCe={moduleName:"CellStyle",version:ut,beans:[WCe]},jCe={moduleName:"RowStyle",version:ut,beans:[Ape]};function KCe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var qCe=class extends We{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:s,gos:o,element:r,columns:i}=this,a=s.colHover;if(n??!!o.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},YCe="ag-column-hover",XCe=class extends We{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const s=()=>{const o=this.isHovered(n);t.toggleCss("ag-column-hover",o)};e.addManagedEventListeners({columnHoverChanged:s}),s()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(YCe,n)}addHeaderFilterColumnHoverListener(e,t,n,s){this.createHoverFeature(e,[n],s);const o=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:o}),o()}createHoverFeature(e,t,n){e.createManagedBean(new qCe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},ZCe={moduleName:"ColumnHover",version:ut,beans:[XCe],apiFunctions:{isColumnHovered:KCe}},JCe=class extends We{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var r;const n=((r=this.wrapSvc)==null?void 0:r.wrap(e,t))??t,s=!Cy.has(e),o=s?this.asyncListeners:this.syncListeners;o.has(e)||o.set(e,new Set),o.get(e).add(n),this.eventSvc.addListener(e,n,s)}removeListener(e,t){var r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,s=this.asyncListeners.get(e),o=!!(s!=null&&s.delete(n));o||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,o)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{Cy.has(i)&&t(i,a)},s=(i,a)=>{Cy.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:s});const o=this.eventSvc;o.addGlobalListener(n,!1),o.addGlobalListener(s,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:s}=this,o=(n==null?void 0:n.unwrapGlobal(e))??e;if(s.has(o)){const{syncListener:i,asyncListener:a}=s.get(o);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),s.delete(e)}else this.syncGlobalListeners.delete(o),t.removeGlobalListener(o,!1)}destroyEventListeners(e,t){e.forEach((n,s)=>{n.forEach(o=>this.eventSvc.removeListener(s,o,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:s})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(s,!0)}),e.clear()}};function QCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.addListener(t,n)}function ebe(e,t,n){var s;(s=e.apiEventSvc)==null||s.removeListener(t,n)}function tbe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function nbe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var sbe={moduleName:"EventApi",version:ut,apiFunctions:{addEventListener:QCe,addGlobalListener:tbe,removeEventListener:ebe,removeGlobalListener:nbe},beans:[JCe]},obe={moduleName:"Locale",version:ut,beans:[kge]},rbe=class extends We{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Os(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:s}=this.beans,o=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=ol(this.beans,d).height;for(const g of o){let v=h==null?void 0:h[g.getColId()];const C=n==null?void 0:n.getCellSpan(g,d);if(C){if(C.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),r=!0)};(a=s==null?void 0:s.forEachPinnedRow)==null||a.call(s,"top",i),(l=s==null?void 0:s.forEachPinnedRow)==null||l.call(s,"bottom",i),(c=t.forEachDisplayedNode)==null||c.call(t,i),r&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const s=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,s!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:s,visibleCols:o}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=o.getLeftColsForRow(t);break;case"right":r=o.getRightColsForRow(t);break;case null:r=s.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const s=t.parentElement,{rowNode:o,column:r}=e,i=this.beans,a=u=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=gc(s),g=d+h+f+p,C=t.offsetHeight+g;if(u<5){const b=Ds(i),w=!(b!=null&&b.contains(t)),D=C==0;if(w||D){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(o,C,r)},l=()=>a(0);l();const c=tl(i,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(o,void 0,r)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(o=>o.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const s of t){const o=n.__autoHeights[s.getColId()];if(!o||n.rowHeight<o)return!1}}return!0}},ibe={moduleName:"RowAutoHeight",version:ut,beans:[rbe]},abe={moduleName:"AllCommunity",version:ut,dependsOn:[NB,fwe,Ewe,Zge,aye,lye,cye,uye,dye,hye,fye,iye,Qme,eve,tve,Jme,sve,ove,Bwe,Vye,oCe,m2,pCe,gCe,ECe,ICe,jue,MCe,Iye,pge,zCe,ZCe,jCe,sbe,vge,kwe,vB,obe,ibe,zue,iwe,GCe]};let GB=!1;GB||(Qoe.registerModules([abe,NB]),GB=!0);class lbe{constructor(t,n){Qn(this,"gridApi",null);Qn(this,"container");Qn(this,"config");Qn(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:s,onRowSelected:o,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{s&&s(a)},onRowSelected:a=>{o&&o(a)}};return this.gridApi=xge(this.container,i),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const s={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const s={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(s=>{var o;(o=this.gridApi)==null||o.removeEventListener(n,s)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const cbe=S2.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),ube=ot({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const s=e,o=n,r=B(null);tS(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=B(null),a=Y(()=>({width:"100%",height:s.height||"500px"})),l=Y(()=>({...s,theme:cbe}));function c(){if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:s.height};i.value=new lbe(r.value,g),i.value.init(),u()}function u(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;o("onGridReady",g)}function d(g){var C,S;if(!g)return;(C=i.value)==null||C.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width}:null).filter(b=>b!==null);(S=i.value)==null||S.setColumnWidth(v)}function h(){var g;(g=i.value)==null||g.destroy(),i.value=null}function f(){var g;return((g=i.value)==null?void 0:g.getApi())||void 0}function p(){return i.value||null}return et(()=>s.columnDefs,(g,v)=>{const C=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");C!==S&&d(g)},{deep:!0}),es(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),sn(()=>{c()}),es(()=>{h()}),(g,v)=>(z(),le("div",{ref_key:"gridContainerRef",ref:r,style:hn(a.value),class:J(["ag-theme-quartz",["ag-table-container",s.isSorting?"is-sorting":""]])},null,6))}});function Fd(e){return bN(e)}const dbe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:Fd(ac),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!1},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:Fd(ac)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:Fd(ac)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:Fd(ac)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:Fd(ac),cellRendererParams:n=>{var s,o,r;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated.value,tooltip:((r=(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:Fd(ac),cellRendererParams:n=>{var s,o,r;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.completedOn.value,tooltip:((r=(o=n==null?void 0:n.data)==null?void 0:o.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>Of.fromType(n))],Py={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},hbe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:Py.WIDTH,minWidth:Py.WIDTH,maxWidth:Py.WIDTH,cellClass:"ag-checkbox-cell",headerClass:Py.HEADER_CLASS,headerComponent:Dv(wJ),suppressMovable:!0}),fbe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},pbe=(e,t,n)=>{const{getCachedValue:s,setCachedValue:o}=Rh({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const u=await s(t);if(u&&typeof u=="string")try{return JSON.parse(u)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},i=B([]),a=hbe(),l=async u=>{const d=await r(),h=new Map;d==null||d.forEach(k=>{k.width&&h.set(k.field,k.width)});const f=dbe(),p=Of.fromType(fbe),v=((u==null?void 0:u.map(k=>{var I;return{headerName:k.name,field:`metric_${k.id}`,editable:((I=k==null?void 0:k.auth_permission)==null?void 0:I.permission)==2,sortable:!0,filter:!1,flex:1,context:{...k},hide:!(k.is_primary||k.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:Dv(ac),headerComponentParams:M=>({headerType:k.metric_type.code=="number"||k.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${k.id}`)}}))||[]).map(k=>Of.fromType(k)),C=[a,...f,...v,p],S=C.filter(k=>k.pinned==="left"),b=C.filter(k=>k.pinned==="right"||k.field==="blank"),w=C.filter(k=>!k.pinned&&k.field!=="blank");if(!d||d.length===0){i.value=C;return}const D=new Map(d.map(k=>[k.field,k])),R=new Map(w.map(k=>[k.field,k])),T=[];for(const k of d)if(k.field&&R.has(k.field)){const I=R.get(k.field);T.push({...I,hide:k.hide,width:k.width}),R.delete(k.field)}const F=Array.from(R.values()),x=[...T,...F].map(k=>({...k,lockPinned:!0})),P=S.map(k=>{const I=D.get(k.field);return I!=null&&I.width?{...k,width:I.width}:k}),E=b.map(k=>{const I=D.get(k.field);return I!=null&&I.width?{...k,width:I.width}:k});i.value=[...P,...x,...E]};et(e,u=>l(u),{immediate:!0});const c=Tr((u,d)=>{var C,S;if(u.source!==void 0)if(["uiColumnResized","uiColumnMoved","api"].indexOf(u.source)===-1){console.warn("Skipping saveColumnConfig for source:",u.source);return}else console.warn("Executing saveColumnConfig for source:",u.source);else console.warn("Executing saveColumnConfig for source:",u);const h=(C=n==null?void 0:n.value)==null?void 0:C.getColumnDefs(),f=(S=n==null?void 0:n.value)==null?void 0:S.getColumnState().reduce((b,w)=>(b[w.colId]=Number(w.width),b),{}),p=new Map;Object.entries(f||{}).forEach(([b,w])=>{p.set(b,w)}),i.value=h||i.value;const g=h==null?void 0:h.filter(b=>!b.pinned&&b.field!=="blank"),v=(g==null?void 0:g.map(b=>({field:b.field,hide:b.hide,width:p.get(b.field)||b.width,pinned:b.pinned})))||[];d&&o(t,JSON.stringify(v))},ai);return{columnDefs:i,checkboxColumn:a,saveColumnConfig:c}},gbe=()=>{const e=un.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},mbe=e=>{var k,I,M;const{showMessage:t,showErrorNetMessage:n}=gf(),s=ts(),o={domainApi:gbe(),wsCode:un.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(M=(I=(k=s==null?void 0:s.appContext)==null?void 0:k.config)==null?void 0:I.globalProperties)==null?void 0:M.apiConfig;if(!r||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new Vk(r,o);i.on("call-api",O=>{O.success?t(O.apiCode,"success"):n(O)});const a=lo({}),l=B([]),c=B(!1),u=B(null),d=B(null),h=B(1),f=B(20);let p=Promise.resolve();const{setCachedUsers:g}=j9(),v=O=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:O}),C=50,S=async(O,$,Z)=>{if(!O.length)return[];const Q=r5(O,$);return(await Promise.all(Q.map(Z))).flat()},b=async O=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:O})).data.map(Z=>[Z==null?void 0:Z.id,Z.permission])}catch($){return console.error("Failed to fetch item permissions chunk:",$),[]}},w=async(O,$)=>{try{const Z=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:O,per_page:O.length*$.length,metric_ids:$}),Q=Z.data.map(ae=>{const ee=new Map(ae.item_metrics.map(W=>[W.metric_id,{value:W.value,auth_permission:W==null?void 0:W.auth_permission}])),V=Object.fromEntries($.map(W=>[W,ee.get(W)??null]));return[ae==null?void 0:ae.id,V]}),se=new Set(Z.data.map(ae=>ae==null?void 0:ae.id));for(const ae of O)if(!se.has(ae)){const ee=Object.fromEntries($.map(V=>[V,{value:null,auth_permission:void 0}]));Q.push([ae,ee])}return Q}catch(Z){return console.error("Failed to fetch a chunk of metric values:",Z),O.map(se=>[se,Object.fromEntries($.map(ae=>[ae,void 0]))])}},D=async O=>{try{const $=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:O,per_page:O.length}),Z=$.data.flatMap(Q=>Q.assignees);return g(Z),$.data.map(Q=>[Q==null?void 0:Q.id,Q==null?void 0:Q.assignees])}catch($){return console.error("Failed to fetch a chunk of assigned users:",$),[]}},R=async O=>{if(!O.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const $=await S(O,C,b);return Object.fromEntries($)}catch($){return console.error("Failed to fetch item permissions:",$),{}}},T=async(O,$)=>!O.length||!$.length?{}:(p=p.then(async()=>{try{const se=[];let ae=0;for(let V=0;V<$.length;V+=5){ae++;const W=$.slice(V,V+5),te=[];for(let ve=0;ve<W.length;ve++){const re=W[ve],ie=await S(O,C,j=>w(j,[re]));te.push(ie),await new Promise(j=>setTimeout(j,500))}se.push(...te);const pe=V+5>=$.length}const ee={};for(const V of se.flat()){const[W,te]=V;ee[W]||(ee[W]={}),Object.assign(ee[W],te)}return ee}catch(Z){return console.error("Failed to fetch metric values:",Z),{}}}),p),F=async O=>{if(!O.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const $=await S(O,C,D);return Object.fromEntries($)}catch($){return console.error("Failed to fetch assigned users:",$),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async O=>{const{cursor:$,offset:Z,size:Q,searchQuery:se}=O;let ae=[];c.value=!0,u.value=null;try{const ee=await i.getAllItem_cursor({...O,cursor:$||void 0,offset:Z||void 0,pageSize:Q||f.value,...v(se),sortBy:O.sort_by});return l.value=ee.data,d.value=ee.meta,h.value=ee.meta.current_page||0,ae=ee.data.map(V=>V==null?void 0:V.id),ee}catch(ee){throw u.value=ee,console.error("Failed to fetch items (cursor):",ee),ee}finally{const ee=async()=>{try{const[V,W]=await Promise.all([F(ae),R(ae)]);e.value.updateItemData({assignees:V,permission:W},ae);const te=await T(ae,e.value.metricIds);e.value.setMetricValues(te,new Set(ae),e.value.metricIds)}catch(V){console.error("Post-fetch processing failed:",V)}};c.value=!1,setTimeout(ee)}},getAssignableStatus:async O=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:O})}catch($){throw console.error("Failed to fetch assignable status:",$),$}},getMetricList:async O=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:O})}catch($){throw console.error("Failed to fetch metric list:",$),$}},getMetricValues:T,getAssignedUsers:F}};function vbe(e){return{updateRowData:(s,o)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);o.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(r.push(u),s.assignees){const h=A9((s.assignees[c]||[]).map(IF));u.data.assignees=h,i.add("assignees")}s.permission&&(u.data.permissions=s.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),i.add("description"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(s,o,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(o).map(c=>[c,new Map(r.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(s).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=i.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&i.refreshCells({rowNodes:l,columns:Array.from(r).map(c=>`metric_${c}`),force:!0})}}}function ybe(e,t,n,s,o){let r=!0;return{async getRows(i){try{s(!0),r&&(o(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,u),s(!1),o(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),s(!1),o(!1)}}}}function wbe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:s,gridApi:o,fetcher:r}=e,i=B(!0),a=B(!0),l=B(!1),c=()=>{n.value=!n.value},u=v=>{if(i.value=!1,o.value=v,!v)return null;const{addEventListener:C,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=ybe(r,e.perPage,()=>s.value,w=>{i.value=w},w=>{a.value=w});return S==null||S("datasource",b),C==null||C("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var C,S;if((C=o.value)==null||C.hideOverlay(),v!==void 0&&(s.value=v),(S=o.value)==null||S.deselectAll(),t.value=[],i.value=!0,!o.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,o.value.purgeInfiniteCache(),o.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=o.value)==null||v.deselectAll(),t.value=[]},f=Tr(v=>{d(v)},ai),p=()=>{o.value},g=B(!1);return{isLoading:i,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const Cbe={changelog:{"1.0.1":{date:"2024-06-20",changes:["Fixed styling issues for archived and deleted rows."]},"1.0.0":{date:"2024-06-15",changes:["Initial release of the Item Table package."]},"0.0.1-alpha.8":{date:"2024-06-10",changes:["Improved performance of row updates.","Added support for custom cell renderers.","Add row hover effect for better UX.","Add loading skeleton for filter","Beta release with core functionalities implemented."]},"0.0.1-alpha.9":{date:"2024-06-05",changes:["Add row selection feature.","Fix bug with column resizing.","Optimize rendering for large datasets.","Implement getLog function to retrieve changelog entries based on version.","Display app version and changelog in the Item Table component tooltip.","Clean up unused autocomplete and memoized config composables.","Update styles for better consistency and readability."]},"0.0.1-alpha.11":{date:"2024-06-18",changes:["Add bulk process status display: items now show an hourglass icon and tooltip when being processed.","Update data model: added isProcessing and bulk_process properties to track item status.","Improve row focus: focused rows now flash for better visibility.","Set 'Last Updated' and 'Completed On' columns as read-only.","Fix: resolve visual fetching issue in useRemoteFiles composable.","Fix: use correct upload icon in PopupCreateScenes component.","Enhance data conversion to include processing status in item rows."]},"0.0.1-alpha.12":{date:"2024-06-12",changes:["feat: enhance Snackbar component and notification handling","Refactor Snackbar.vue for improved readability and styling, including color adjustments for icons and text.","Add showMessage function in notifications store to display messages based on API keys, improving notification management.","Introduce notificationMessage constant to centralize notification messages for various API actions, enhancing maintainability.","Remove unnecessary console logs from useRemoteFiles and improve logging in notification store for better debugging."]},"0.0.1-alpha.16":{date:"2024-06-20",changes:["Add onboarding tour feature and enhance UI components with new dependencies","Refactor UI components for improved styling and functionality","Updated RatingComponent.vue to streamline class bindings and improve accessibility attributes.","Enhanced SearchBox.vue by adding a clear event handler and simplifying icon rendering.","Modified AssigneeGroupEditor.vue and AssigneeGroupRenderer.vue to remove unnecessary size attributes from icons.","Adjusted DateRangeRenderer.vue to remove size attributes from icons for consistency.","Updated HeaderCheckbox.vue to set dropdown placement to 'bottom-start'.","Refined HeaderSorting.vue to simplify sort option labels and improve sorting logic.","Enhanced HeaderWrapper.vue to utilize reactive properties for sorting state.","Improved HyperLinkEditor.vue and HyperLinkInlineEditor.vue by removing size attributes from icons.","Updated PopupLayout.vue to use a CSS variable for box-shadow styling.","Refined Snackbar.vue to standardize icon colors and improve styling consistency.","Adjusted useTippy.ts to set default placement and arrow visibility for tooltips.","Modified notificationMessage.ts to remove error messages for list fetching.","Cleaned up notifications.ts by removing console logs for a cleaner codebase.","Updated sortStore.ts to comment out unnecessary console logs for better performance.","Enhanced styles.scss by defining new icon size variables and standardizing box-shadow styles."]},"0.0.99":{date:"2024-06-24",changes:["Fix: resolve issue with incorrect version display in Item Table component.","Update changelog retrieval logic to ensure accurate version matching.","Enhance tooltip display for app version and changelog in Item Table component."]}}},bbe=e=>{var t;return(t=Object.entries(Cbe.changelog).find(([n,s])=>n===e))==null?void 0:t[1].changes},Sbe={key:1},Ebe=Et(ot({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=B(null),o=e,r=()=>{s.value&&s.value.show()},i=B(""),a=B("idle"),l=B({file:null,format:null}),{apiServices:c}=ns(!1,{}),u=B(!1),d=async()=>{u.value=!0;const P=o.workspaceId,E=o.entityId;if(!P||!E||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(P,E))throw new Error("No response from downloadTemplate API")}catch(k){console.error("Error downloading template:",k)}u.value=!1},h=n,f=()=>{h("import-success"),S()},p=async P=>{var I,M,O;const E=new FormData,k=((I=P.name.split(".").pop())==null?void 0:I.toString())||"";if(E.append("file",P),E.append("format",k),E.append("entity_id",o.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,E),g()}catch($){throw console.error("Error uploading file:",$),v(((O=(M=$.response)==null?void 0:M.data)==null?void 0:O.message)||"An unknown error occurred during file upload."),$}},g=()=>{a.value="success"},v=P=>{i.value=P,a.value="error"},C=async()=>{!l.value||!l.value.file||await p(l.value.file)},S=()=>{var P;R(),(P=s.value)==null||P.hide()};t({close:S,open:r});const b=Y(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),w=Y(()=>l.value.file?!1:(console.error("No file selected"),!0)),D=B(null),R=()=>{var P;(P=D.value)==null||P.clear(),i.value="",l.value={file:null,format:null},a.value="idle"},T=Sn("switchInstance"),F=()=>{T?T("xlsx_toolbox","",{showLoad:!1}):window.appManager.switchInstance("xlsx_toolbox","",{showLoad:!1}),console.log("Toolbox opened")};let x;return sn(()=>{x=mN({target:window,allowedOrigins:["https://child.example"],onMessage:(P,E)=>{var I;if(P.type!==kf.SW_APP_LOADER)return;console.log("Received from:",E.origin),console.log("File name:",P.payload.fileName);const k=P.payload.file;(I=D.value)==null||I.setFile(k)},onInvalidMessage:(P,E,k)=>{console.warn("Rejected postMessage:",E,k.origin)}})}),es(()=>{x==null||x()}),(P,E)=>(z(),je(G(jk),{"popup-name":b.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:R},nh({default:ge(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(z(),je(dN,{key:0,state:a.value,"error-message":i.value,overwrite:!0},null,8,["state","error-message"])):(z(),le("div",Sbe,[we("div",{class:J(P.$style["step-section"])},[we("span",{class:J(P.$style["step-title"])},"Step 1: Download current data",2),we("span",{class:J(P.$style["step-description"])},[...E[1]||(E[1]=[tt(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),we("br",null,null,-1),we("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),we("div",{class:J(P.$style["actions-section"])},[he(G(ct),{class:J(P.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:ge(()=>[he(G(at),{src:"Download"})]),default:ge(()=>[E[2]||(E[2]=tt(" Download file ",-1))]),_:1},8,["class","disabled"]),he(G(ct),{class:J(P.$style["download-sample-btn"]),size:12,variant:"secondary",onHandleClick:F},{default:ge(()=>[...E[3]||(E[3]=[tt(" Toolbox ",-1)])]),_:1},8,["class"])],2)],2),we("div",{class:J(P.$style["step-section"])},[we("span",{class:J(P.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),he(G(PO),{modelValue:l.value,"onUpdate:modelValue":E[0]||(E[0]=k=>l.value=k),ref_key:"filUploaderRef",ref:D},null,8,["modelValue"])],2),we("div",{class:J(P.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[he(hN)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:ge(()=>[he(G(ct),{style:{flex:"1"},variant:"secondary",onClick:S},{default:ge(()=>[...E[4]||(E[4]=[tt(" Cancel ",-1)])]),_:1}),he(G(ct),{disabled:w.value,style:{flex:"1"},variant:"primary",onClick:C},{default:ge(()=>[...E[5]||(E[5]=[tt(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ge(()=>[he(G(ct),{style:{flex:"1"},variant:"primary",onClick:f},{default:ge(()=>[...E[6]||(E[6]=[tt(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:ge(()=>[he(G(ct),{style:{flex:"1"},variant:"primary",onClick:R},{default:ge(()=>[...E[7]||(E[7]=[tt(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_1hsaq_1","step-title":"_step-title_1hsaq_11","step-title-2":"_step-title-2_1hsaq_17","step-description":"_step-description_1hsaq_23","date-format-guide":"_date-format-guide_1hsaq_28","import-error":"_import-error_1hsaq_39","drop-area":"_drop-area_1hsaq_49","is-dragging":"_is-dragging_1hsaq_49","drop-area-content":"_drop-area-content_1hsaq_52",browse:"_browse_1hsaq_61","download-sample-btn":"_download-sample-btn_1hsaq_65","actions-section":"_actions-section_1hsaq_69"}}]]),_be=Et(ot({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=To,s=Zb(),{setUserPermissions:o,setEntityPermissions:r}=s,{entityPermissions:i}=Qs(s),a=qt,l=B(null),c={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},u=B(""),d=Y(()=>{var Ye;const ke=((Ye=i.value)==null?void 0:Ye.has_create_item_permission)==1||!1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!ke},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!ke,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!ke,id:"overwrite_scenes_option"}]}),h=e;Of.initialize({wrapVueCellRenderer:Dv,wrapVueCellEditor:bN});const f=ef(),{switchInstanceFunc:p}=Qs(f);sn(()=>{const ke=ts();p.value=ke==null?void 0:ke.appContext.config.globalProperties.switchInstance;const Ye=new BroadcastChannel("focusable_channel");vt(()=>{setTimeout(()=>{Ye.postMessage("Focusable elements updated")},7e3)})});const g=B(null),v=B([]),C=zm(),{rowCount:S}=Qs(C),b=B(!1),w=B(""),D=B(),R=jA(),{metricList:T}=Qs(R),F=B(""),x=B(!1),P=B(new Set),E=B(new Map),{apiServices:k}=ns(!1,h),{columnDefs:I,checkboxColumn:M,saveColumnConfig:O}=pbe(T,h.entityId,g),$=B();et(()=>I,()=>{var ke;(ke=$.value)==null||ke.updateColumnDefs(I.value)},{deep:!0});const Z=(ke,Ye)=>{O(ke,Ye)},{updateRowData:Q,setMetricValues:se}=vbe(g),ae=Y(()=>({isSearching:w.value.length>0,isFiltering:!(Object.keys(Ae.value||{}).length==1&&Object.keys(Ae.value)[0]=="preflight_status")&&Object.keys(Ae.value||{}).length>0})),ee=Y(dm),V=Y(()=>I.value.filter(ke=>{var Ye;return((Ye=ke.field)==null?void 0:Ye.startsWith("metric_"))&&!ke.hide}).map(ke=>{var Ye;return((Ye=ke.field)==null?void 0:Ye.replace("metric_",""))||""}));Zr("timezone",ee);const W=Y(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:V.value,updateItemData:Q,setMetricValues:se})),{fetchItems:te,getMetricList:pe,cusorMap:ve,getMetricValues:re}=mbe(W),ie=Y(()=>{if(!g.value)return!1;const ke=g.value.getSelectedRows().length;return ke>0&&ke>=S.value.total}),j=Y(()=>{var ke;return((ke=l.value)==null?void 0:ke.name)||"Items"}),me=ke=>{setTimeout(()=>{vt(()=>{var Ye,Qt;g.value&&(ke?(Ye=g.value)==null||Ye.showNoRowsOverlay():(Qt=g.value)==null||Qt.hideOverlay())})},500)},oe=(ke,Ye)=>{var Qt;S.value.total=ke.meta.total??0,(Qt=ke.meta.next)!=null&&Qt.cursor&&(ve[Ye+1]=ke.meta.next.cursor),F.value=ke.meta["X-Tsr-signature"]||"",ke.meta.total===0?me(!0):me(!1)},Se=FO(),U=B(null),{sortingAPIConfiguration:K,isSortingRunning:ue}=Qs(Se),Ae=B({preflight_status:"1"}),Fe=Y(()=>({...Ae.value,search:w.value}));Zr("filterParams",Fe);const Le=B([]),ye=async({page:ke,pageSize:Ye,filterText:Qt})=>{var Go;(Go=g.value)==null||Go.hideOverlay();const Zt=ve[ke],Co=!Zt&&ke>1?(ke-1)*Ye:void 0,wa=K.value;wa.length>0&&(ue.value=!0);try{const Ca={cursor:Zt,size:Ye,searchQuery:Qt,offset:Co,sort_by:wa,...Ae.value},oo=await te(Ca);if(!oo)return{rows:[],total:0};const yp=(Kn=>{const Ai=Kn.data.map(bo=>FF(bo,ee.value));return Ai.forEach(bo=>{P.value.add(String(bo.id)),E.value.set(String(bo.id),{})}),Ai})(oo);return oe(oo,ke),{rows:yp,total:S.value.total}}catch(Ca){return console.error("Failed to fetch items:",Ca),{rows:[],total:0}}finally{ue.value=!1}},{isLoading:N,toggleSidebar:H,onGridReady:ce,handleUnSelect:Ge,handleSelectAll:Ce,onSearch:ze,firstLoad:Ue}=wbe({selectRowData:B([]),isSidebarOpen:b,quickFilterText:w,gridApi:g,perPage:c.ROWS_PER_PAGE,fetcher:ye}),_e=B([]),Ve=()=>{var ke;_e.value=((ke=g.value)==null?void 0:ke.getSelectedRows())||[]},gt=lo({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),kt=Y(()=>({blockLoadDebounceMillis:1e3,columnDefs:I.value,rowModelType:"infinite",cacheBlockSize:c.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:c.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:c.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:Ut,noRowsOverlayComponent:Dv(oee),noRowsOverlayComponentParams:()=>ae.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:ke=>ke.data.id,getRowClass:ke=>{if(!ke.data)return["row-empty"];const Ye=["row-highlight"];return ke.data.id||Ye.push("row-inactive"),ke.data.isDeleted&&Ye.push("row-deleted"),ke.data.disabled&&Ye.push("row-deleted"),ke.data.isArchived&&Ye.push("row-archived"),ke.data.isLocked&&Ye.push("row-locked"),Ye},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:k.value,sorting:ue.value},onCellKeyDown:ke=>{var Ye,Qt,Zt;if(ke.data.isDeleted)return!1;if(((Ye=ke==null?void 0:ke.event)==null?void 0:Ye.key)==="Enter"){const{api:Co,node:wa,column:Go}=ke,Ca=Co.getCellRendererInstances({rowNodes:[wa],columns:[Go]});if(Ca.length>0){const oo=Ca[0];oo&&typeof((Qt=oo.componsenExposed)==null?void 0:Qt.focus)=="function"&&((Zt=oo.componsenExposed)==null||Zt.focus())}}},isRowSelectable:ke=>!ke.group,suppressKeyboardEvent:ke=>{var Zt;if((Zt=ke.data)!=null&&Zt.isDeleted)return!0;const Ye=ke.event.key,Qt=ke.editing;return Qt&&Ye==="Tab"?!0:Qt&&Ye==="Enter"?!1:Ye==="Enter"?(ke.event.preventDefault(),ke.event.stopPropagation(),!0):Ye==="ArrowUp"||Ye==="ArrowDown"||Ye==="ArrowLeft"||Ye==="ArrowRight"||Ye==="Tab"||Ye==="Enter"},navigateToNextCell:()=>null,onBodyScroll:ke=>{const Ye=ke.api.getFirstDisplayedRowIndex(),Qt=ke.api.getLastDisplayedRowIndex();gt.rowsDisplay.fromIndex=Ye,gt.rowsDisplay.toIndex=Qt,gt.columnsDisplay=ke.api.getAllDisplayedVirtualColumns().map(Zt=>Zt.getColId())},onViewportChanged:ke=>{gt.columnsDisplay=ke.api.getAllDisplayedVirtualColumns().map(Ye=>Ye.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(ke){if(ke.data.isDeleted&&ke.api.stopEditing(),ke.colDef.field=="options"){const Ye=ke.api.getCellRendererInstances({rowNodes:[ke.node],columns:[ke.column]});Ye.length>0&&Ye[0].focusUi()}},tabToNextCell:ke=>{let Ye=ke.nextCellPosition;if(Ye&&Ye.column.getColId()==="ag-Grid-SelectionColumn"){const Qt=ke.api.getAllDisplayedColumns(),Zt=Qt.indexOf(Ye.column),Co=ke.backwards?-1:1,wa=Qt[Zt+Co];if(wa)return{rowIndex:Ye.rowIndex,column:wa,rowPinned:Ye.rowPinned}}return Ye}}));function Ut(){if(!g.value)return;let ke=0;g.value.forEachNode(Ye=>{Ye.data&&ke++}),S.value.loaded=Math.min(ke,S.value.total)}et(()=>K,()=>{g.value&&(F.value="",P.value.clear(),g.value.deselectAll(),Object.keys(ve).forEach(ke=>delete ve[Number(ke)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const en=B(),zt=B(),Ne=()=>{var ke;(ke=zt.value)==null||ke.open()},qe=()=>{var ke;(ke=en.value)==null||ke.open()},wt=async()=>{Ue.value=!0,g.value&&(F.value="",P.value.clear(),Object.keys(ve).forEach(ke=>delete ve[Number(ke)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},Nt=Y(()=>un.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Wt=B();Y(()=>{var ke;return(ke=bbe(Nt.value))==null?void 0:ke.map(Ye=>`<div>• ${Ye}</div>`).join(`
260
- `)});function st(ke){var Ye;ke==="new_scene"?(Ye=Wt.value)==null||Ye.show():ke==="import_scenes"?qe():ke==="overwrite_scenes"&&Ne()}const Is=ke=>{v.value=ke.api.getSelectedRows().map(Ye=>Ye.id)},Ur=ke=>{const Ye=ce(ke);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",Zt=>Z(Zt,!0)),Ye.addEventListener("columnResized",Zt=>Z(Zt,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport"))||ke==null||ke.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),Ye},xi=()=>{var ke;u.value=(((ke=document.getElementById("item-table-layout-id"))==null?void 0:ke.clientHeight)??0)-78+"px"};sn(()=>{vt(()=>{xi()}),window.addEventListener("resize",xi);function ke(){requestAnimationFrame(ke)}ke()}),es(()=>{window.removeEventListener("resize",xi)});const gr=async({code:ke,name:Ye})=>{await ze(ke),setTimeout(()=>{var Qt;(Qt=D.value)==null||Qt.setValue(Ye)},300)},ya=ke=>{if(!g.value)return;const Ye=g.value.getRowNode(ke);Ye?(g.value.ensureIndexVisible(Number(Ye.rowIndex),"middle"),g.value.flashCells({rowNodes:[Ye],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(S.value.total-1,"bottom")},ml=ke=>ke.metric_type.code==="number"?"number":"default",Fi=async()=>{if(h.entityId)try{const ke=await pe(h.entityId);T.value=ke.data.map(Ye=>({...Ye,sortType:ml(Ye)}))}catch(ke){console.error("Failed to initialize metric list:",ke),T.value=[]}},Pi=async()=>{if(k.value)try{const ke=await k.value.getUserPermission(h.workspaceId);o(ke)}catch(ke){console.error("Failed to fetch user permissions:",ke)}},mr=async()=>{if(k.value)try{const ke=await k.value.getEntityDetail(h.workspaceId,h.entityId);r(ke.permission),l.value=ke}catch(ke){console.error("Failed to fetch entity details:",ke)}},Wr=fv(),{setUser:Pd}=Wr,kn=async()=>{if(k.value)try{const ke=await k.value.getMe();return Pd(ke),ke}catch(ke){console.error("Failed to fetch user details:",ke)}},ps=async()=>{var ke;if(k.value)try{const Ye=await k.value.getWorkspaces(h.workspaceId),Qt=(ke=Ye.data[0])==null?void 0:ke.ws_user_role_id;return Qt&&Wr.setUserRoleId(Qt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};et(()=>[h.entityId,h.workspaceId],async([ke,Ye])=>{!ke||!Ye||(kn(),ps(),Fi(),Pi(),mr())},{immediate:!0,deep:!0}),et(V,(ke,Ye)=>{const Qt=ke.filter(Zt=>!(Ye!=null&&Ye.includes(Zt)));Qt.length>0&&re(Array.from(P.value),Qt).then(Zt=>{se(Zt,P.value,Qt)})},{immediate:!0,deep:!0}),et(F,(ke,Ye)=>{x.value=!!(Ye&&ke&&Ye!==ke)}),t({refreshTable:wt});const E_=ke=>{Ae.value=ke,wt()},Ad=ke=>{Le.value=ke,wt()},kd=ke=>{I.value=ke||[],Z({},!0)},Od=Y(()=>{var Zt;const ke=un.getInstance().getItem("ws.terminology"),Ye=ke?JSON.parse(ke):null;return`New ${((Zt=Ye==null?void 0:Ye.find(Co=>Co.code==="scene"))==null?void 0:Zt.name)||"Scene"}`});return B('<p><br>Here is template notess..</p><p><strong>this is Bold</strong>,<i> this is Italic</i>,<u> this is underline</u><br>this is hightlight ,&nbsp;<br>1</p><p>1</p><ul class="todo-list"><li data-list-item-id="ed7bc572523bb0f35972903183a9d7346"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">1</span></li><li data-list-item-id="ef5b3e469bed2b79951b489fd3a25ffaa"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">2</span></li><li data-list-item-id="ed25bcd78b8b608ed432f01164608cb0d"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">3</span></li><li data-list-item-id="e05c8f5e183d4de144c2a6a8059691d5f"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">4</span></li></ul><p>This is list</p><ul><li data-list-item-id="ed6b9c0b0b97baf09030ee79ea57c40a9">1</li><li data-list-item-id="ef1fc34bceeb4a82abc8c61fe28972c9b">2</li><li data-list-item-id="e950cf66600b9cc40f130a396a6831a75">3</li><li data-list-item-id="e64b6e87f244f9268e45b32b785308a6e">4</li></ul><p>&nbsp;</p>'),(ke,Ye)=>{const Qt=Eo("focusable");return z(),je(G(pJ),{"is-sidebar-open":b.value,onCloseSidebar:G(H),onSidebarClear:G(H),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:G(H)},{"header-left":ge(()=>{var Zt;return[((Zt=G(i))==null?void 0:Zt.has_create_item_permission)==1?(z(),je(G(mS),{key:0,variant:["primary"],options:d.value,onSelect:st,onHandleClick:Ye[1]||(Ye[1]=Co=>st("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ge(()=>[Ke(he(G(ct),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Co=>st("new_scene")),label:Od.value},null,8,["label"]),[[Qt,1]])]),_:1},8,["options"])):Ze("",!0)]}),"header-actions":ge(()=>[he(G(Hee),{"onUpdate:assignees":Ad,onApplyFilter:E_,loading:G(Ue),entityId:h.entityId},null,8,["loading","entityId"]),Ke(he(G(sS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=Zt=>w.value=Zt),onSearch:G(ze),class:J(ke.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=Zt=>G(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:D},null,8,["modelValue","onSearch","class"]),[[G(n),{isLoading:G(Ue),fullwidth:!0}]]),Ke((z(),je(G($A),{status:G(N)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:ge(()=>[Ke((z(),je(G(ct),{variant:["secondary","icon"],disabled:G(N),onClick:wt},{default:ge(()=>[he(G(at),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[Qt,5],[G(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[G(n),{isLoading:G(Ue),fullwidth:!0}]]),Ke(he(G($Q),{"model-value":G(I),onChange:Ye[4]||(Ye[4]=Zt=>kd(Zt)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:$,"checkbox-column":G(M),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[G(n),{isLoading:G(Ue),fullwidth:!0}]])]),grid:ge(({availableHeight:Zt})=>[he(G(ube),Kt({id:"item_table_main",ref_key:"agGrid",ref:U},kt.value,{height:Zt+"px",isSorting:G(ue),onOnGridReady:Ur,onSelectionChanged:Is}),null,16,["height","isSorting"])]),footer:ge(()=>[we("div",{class:J(ke.$style.tableFooter),id:"table_footer"},[we("span",null,[Ye[5]||(Ye[5]=tt(" Showing ",-1)),we("b",null,Ct(G(S).loaded)+" of "+Ct(G(S).total),1)])],2)]),"new-row":ge(()=>[he(G(vee),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:gr,onFocusOnId:ya},null,512)]),"bulk-update-actions":ge(()=>[!b.value&&v.value.length>0?Ke((z(),je(G(iJ),{key:0,selectRowData:_e.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:G(Ge),onSelectAll:G(Ce),"take-name":j.value,"selected-all":ie.value,"total-rows":G(S).total,"visible-rows":G(S).loaded,onUpdated:Ve,loading:G(N)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ko,!b.value&&v.value.length>0]]):Ze("",!0)]),snackbar:ge(()=>[he(G(YJ))]),popup:ge(()=>[he(Use,{ref_key:"popupCreateSceneRef",ref:en,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"]),he(Ebe,{ref_key:"popupOverwriteScenesRef",ref:zt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"])}}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),UB="0.1.136",Rbe={key:0},Dbe=Et(ot({__name:"app",setup(e){const t=Y(()=>n.id.length===0||n.workspaceId.length===0),n=lo({id:"",workspaceId:"",apiConfig:{}}),s=gf(),{showMessage:o,showErrorNetMessage:r}=s,i=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=B(null),c=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};eh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",UB);try{if(l.value=ts(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||un.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:un.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new Vk(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),es(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=Y(()=>n.id),d=Y(()=>n.workspaceId);return Zr("workspaceId",d),Zr("entityId",u),(h,f)=>(z(),le("div",{class:J(h.$style.dashboardPluginWrapper)},[t.value?(z(),le("span",Rbe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(z(),je(G(_be),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ze("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),S_=async(e={},t={})=>{const n=_T(Dbe),s=vY();n.use(s);const o=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,o.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${UB}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",qt),n.directive("focusable",Wi);const i=await Pse();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=S_),On.default=S_,On.initDashboard=S_,Object.defineProperties(On,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
259
+ `,cwe=class extends Vge{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:n}=e;this.suppressQuotes=t,this.columnSeparator=n}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,LB),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,s)=>{s!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,s){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,n){t!=0&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(s.valueFormatted??s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(Je(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=LB),this.isFirstLine=!1}},uwe=class extends Lge{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){Je(51);return}const t=this.getMergedParams(e),n=this.getData(t),s=new Blob(["\uFEFF",n],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(Pt(this.gos,{})):t.fileName;Bge(this.getFileName(o),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:s,valueSvc:o,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new cwe({colModel:t,colNames:n,valueSvc:o,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:s})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function dwe(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function hwe(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var fwe={moduleName:"CsvExport",version:ut,beans:[uwe],apiFunctions:{getDataAsCsv:dwe,exportDataAsCsv:hwe},dependsOn:[lwe]},pwe=class extends We{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:s,rowNodes:o}=this;for(let r=0;r<e;r++){const i=n+r,a=new cl(s);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),o.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:s}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:s}}}setDataAndId(e,t,n){ht(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Vn(this.params.datasource.getRows)){Je(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:s,filterModel:o},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:s,filterModel:o,context:Pt(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((s,o)=>{this.startRow+o<n&&e(s,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((o,r)=>{const i=e.rowData?e.rowData[r]:void 0;!o.id&&o.alreadyRendered&&i&&(t[r]=new cl(n),t[r].setRowIndex(o.rowIndex),t[r].setRowTop(o.rowTop),t[r].setRowHeight(o.rowHeight),o.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const s=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,s)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},gwe=2,mwe=class extends We{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let s=this.blocks[n];if(!s){if(t)return;s=this.createBlock(n)}return s.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new pwe(e,this,t));return this.blocks[n.id]=n,this.blockCount++,this.purgeBlocksIfNeeded(n),t.rowNodeBlockLoader.addBlock(n),n}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(sl(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(i=>i!=e),n=(i,a)=>a.lastAccessed-i.lastAccessed;t.sort(n);const s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,r=gwe-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,c=s?a>=o:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(i)||this.isBlockFocused(i))return;this.removeBlockFromCache(i)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:s}=e;return t.rowIndex>=n&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:s}=this.params,r=(e.id+1)*n+s;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,ht(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,s)=>n.id-s.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let s=-1,o=!1;const r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(o&&s+1!==l.id){i=!0;continue}s=l.id,l.forEachNode(c=>{const u=c===e||c===t;(o||u)&&n.push(c),u&&(o=!o)},r,this.rowCount)}return i||o?[]:n}},vwe=class extends We{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new cl(e);this.rootNode=t,t.level=-1,this.rowHeight=vc(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=vc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Mf(this.cacheParams.sortModel,((t=this.beans.sortSvc)==null?void 0:t.getSortModel())??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){var n;return((n=this.infiniteCache)==null?void 0:n.getRowNodesInRange(e,t))??[]}reset(){var n;if(!this.datasource)return;ud(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:s,eventSvc:o,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:s,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:vc(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new mwe(this.cacheParams)),o.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function ywe(e){var t;(t=_y(e))==null||t.refreshCache()}function wwe(e){var t;(t=_y(e))==null||t.purgeCache()}function Cwe(e){var t;return(t=_y(e))==null?void 0:t.getRowCount()}var bwe=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=ure(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Os(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){$r(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){sl(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:s}=t.getBlockStateJson();e[n]=s}),e}printCacheStatus(){sl(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},Swe={moduleName:"InfiniteRowModelCore",version:ut,rowModels:["infinite"],beans:[vwe,bwe]},Ewe={moduleName:"InfiniteRowModel",version:ut,apiFunctions:{refreshInfiniteCache:ywe,purgeInfiniteCache:wwe,getInfiniteRowCount:Cwe},dependsOn:[Swe,Nye]},_we="↑",Rwe="↓",Dwe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},Twe=class extends Cn{constructor(){super(Dwe),this.eValue=dt,this.eDelta=dt,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),s=e.formatValue(n),o=ht(s)?s:n,r=t>=0,i=this.eDelta;r?i.textContent=_we+o:i.textContent=Rwe+o,i.classList.toggle("ag-value-change-delta-up",r),i.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),ks(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:s}=e,{eValue:o,lastValue:r,beans:i}=this;if(n===r||(ht(s)?o.textContent=s:ht(n)?o.textContent=n:ks(o),(c=i.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=r&&typeof r=="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return r&&o.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},Iwe=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",xwe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},Fwe=class extends Cn{constructor(){super(xwe),this.eCurrent=dt,this.refreshCount=0,this.registerCSS(Iwe)}init(e){this.refresh(e,!0)}addSlideAnimation(){var o;this.refreshCount++;const e=this.refreshCount;(o=this.ePrevious)==null||o.remove();const{beans:t,eCurrent:n}=this,s=as({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=s,s.textContent=n.textContent,this.getGui().insertBefore(s,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var r;e===this.refreshCount&&((r=this.ePrevious)==null||r.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var o;let n=e.value;if(Vn(n)&&(n=""),n===this.lastValue||(o=this.beans.filterManager)!=null&&o.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const s=this.eCurrent;return ht(e.valueFormatted)?s.textContent=e.valueFormatted:ht(e.value)?s.textContent=n:ks(s),!0}},Pwe=class extends We{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),s=this.beans.gos.get("cellFadeDuration")){const o=this.animations[t];o.delete(e);const r=Date.now(),i=r+n,a=r+n+s,l={phase:"flash",flashEndTime:i,fadeEndTime:a};o.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&i+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=i)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const s=this.animations[n],o=`ag-cell-${n}`,r=`${o}-animation`;for(const[i,a]of s){if(!i.isAlive()||!i.comp){s.delete(i);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=i;switch(l){case"flash":f.toggleCss(o,!1),f.toggleCss(r,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(o,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),s.delete(i);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=Fue(e.cellPosition);t.cells[n]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t==null?void 0:t.flashDuration,t==null?void 0:t.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function Awe(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const s of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(s,t)})}var kwe={moduleName:"HighlightChanges",version:ut,beans:[Pwe],userComponents:{agAnimateShowChangeCellRenderer:Twe,agAnimateSlideCellRenderer:Fwe},apiFunctions:{flashCells:Awe}};function Owe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Mwe(e,t,n){var s;return(s=e.stateSvc)==null?void 0:s.setState(t,n)}function VB(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=Nwe(e)),e.version=ut,e}function Nwe(e){return e.cellSelection=Lwe(e,"rangeSelection"),e}function Lwe(e,t){if(e&&typeof e=="object")return e[t]}var Vwe=class extends We{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Os(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Os(this,()=>{this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(this.updateCachedState("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowGroupExpansion",void 0)):(this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("ssrmRowGroupExpansion",void 0))},0),this.onRowSelectedDebounced=Os(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:n}=this.beans;this.isClientSideRowModel=rs(e);const s=VB(e.get("initialState")??{}),o=s.partialColumnState;delete s.partialColumnState,this.cachedState=s;const r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(s))),(s.columnOrder||s.columnVisibility||s.columnSizing||s.columnPinning||s.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(s,!!o),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(s))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(s))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=VB(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const s="api",o=t?new Set(t):void 0;this.setGridReadyState(n,s,o),this.setColumnsInitialisedState(n,s,!!o,o),this.setRowCountState(n,s,o),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,s,o),this.stopSuppressEvents(s)})}setGridReadyState(e,t,n){var s,o;t==="api"&&!(n!=null&&n.has("sideBar"))&&((o=(s=this.beans.sideBar)==null?void 0:s.comp)==null||o.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,s){this.setColumnState(e,t,n,s),this.setColumnGroupState(e,t,s),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=s=>()=>this.updateColumnState([s]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:s,rowGroupExpansion:o,ssrmRowGroupExpansion:r,rowSelection:i,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",s)&&this.setFilterState(s),l("rowGroupExpansion",o)&&this.setRowGroupExpansionState(r,o,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},s=()=>t("filter",this.getFilterState()),{gos:o,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:s,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(o.get("groupDefaultExpanded")!==0||o.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:i=>{(i.newPage||i.newPageSize)&&t("pagination",this.getPaginationState())}}),r&&this.addManagedListeners(r,{filterStateChanged:s})}setFirstDataRenderedState(e,t,n){const{scroll:s,cellSelection:o,focusedCell:r,columnOrder:i,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",o)&&this.setCellSelectionState(o),l("scroll",s)&&this.setScrollState(s),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:s=>{if(s.finished){const o=this.getRangeSelectionState();t("rangeSelection",o),t("cellSelection",o)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return Oge(Kv(e),e.colModel.isPivotMode())}setColumnState(e,t,n,s){const{sort:o,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(E,k)=>{const I=!(s!=null&&s.has(E))&&!!(k||t==="api");return h||(h=I),I},p={},g=E=>{let k=p[E];return k||(k={colId:E},p[E]=k,k)},v={},C=f("sort",o);C&&(o==null||o.sortModel.forEach(({colId:E,sort:k},I)=>{const M=g(E);M.sort=k,M.sortIndex=I})),(C||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((E,k)=>{const I=g(E);I.rowGroup=!0,I.rowGroupIndex=k})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:E,aggFunc:k})=>{g(E).aggFunc=k})),(b||!n)&&(v.aggFunc=null);const w=f("pivot",a);w&&(a==null||a.pivotColIds.forEach((E,k)=>{const I=g(E);I.pivot=!0,I.pivotIndex=k}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(w||!n)&&(v.pivot=null,v.pivotIndex=null);const D=f("columnPinning",l);if(D){for(const E of(l==null?void 0:l.leftColIds)??[])g(E).pinned="left";for(const E of(l==null?void 0:l.rightColIds)??[])g(E).pinned="right"}(D||!n)&&(v.pinned=null);const R=f("columnVisibility",c);if(R)for(const E of(c==null?void 0:c.hiddenColIds)??[])g(E).hide=!0;(R||!n)&&(v.hide=null);const T=f("columnSizing",u);if(T)for(const{colId:E,flex:k,width:I}of(u==null?void 0:u.columnSizingModel)??[]){const M=g(E);M.flex=k??null,M.width=I}(T||!n)&&(v.flex=null);const F=d==null?void 0:d.orderedColIds,x=!!(F!=null&&F.length)&&!(s!=null&&s.has("columnOrder")),P=x?F.map(E=>g(E)):Object.values(p);(P.length||h)&&(this.columnStates=P,Hr(this.beans,{state:P,applyOrder:x,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const s=this.columnGroupStates;this.columnGroupStates=void 0;const o=this.beans,{pivotResultCols:r,colGroupSvc:i}=o;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);Hr(o,{state:a,applyOrder:e},t)}s&&(i==null||i.setColumnGroupState(s,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Mge(t)}setColumnGroupState(e,t,n){var a;const s=this.beans.colGroupSvc;if(!s||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const o=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=s.getColumnGroupState().map(({groupId:l})=>{const c=o.has(l);return c&&o.delete(l),{groupId:l,open:c}});for(const l of o)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),s.setColumnGroupState(i,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),s=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||s||n?{filterModel:t,columnFilterState:n,advancedFilterModel:s}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:s,advancedFilterModel:o}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||s!==void 0)&&(t==null||t.setFilterState(n??null,s??null,"columnFilter")),o!==void 0&&(t==null||t.setAdvFilterModel(o??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:s,type:o,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:s,type:o,startRow:r,endRow:i,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:s,visibleCols:o}=this.beans;if(!la(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of i.colIds){const u=s.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=s.getCol(i.startColId);if(!l){const c=o.allCols,u=new Set(a);l=c.find(d=>u.has(d))}r.push({...i,columns:a,startColumn:l})}n.setCellRanges(r)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:s,rowRenderer:o,animationFrameSvc:r,ctrlsSvc:i}=this.beans;s.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),o.redraw({afterScroll:!0}),r==null||r.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:s,rowIndex:o,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(s),rowIndex:o,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),s=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!s))return{page:n,pageSize:s}}setPaginationState(e,t){const{pagination:n,gos:s}=this.beans;if(!n)return;const{pageSize:o,page:r}=e??{page:0,pageSize:s.get("paginationPageSize")},i=t==="gridInitializing";o&&!s.get("paginationAutoPageSize")&&n.setPageSize(o,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var s;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((s=t==null?void 0:t.toggledNodes)!=null&&s.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const s=this.beans.expansionSvc;if(!s)return;const o=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};s.setExpansionState(o,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const s=this.cachedState;for(const o of Object.keys(t)){const r=t[o];Mf(r,s[o])||(n=!0)}this.cachedState={...s,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Mf(t,n)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){var e;this.suppressEvents=!0,(e=this.beans.colAnimation)==null||e.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{var t;this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&((t=this.beans.colAnimation)==null||t.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},Bwe={moduleName:"GridState",version:ut,beans:[Vwe],apiFunctions:{getState:Owe,setState:Mwe}};function $we(e){return e.rowModel.isLastRowIndexKnown()}function Hwe(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Gwe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function Uwe(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function Wwe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function zwe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function jwe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function Kwe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function qwe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Ywe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var Xwe=class extends We{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const s=Math.max(vc(t),1),o=Math.floor(e/s);t.pagination.setPageSize(o,"autoCalculated")};this.isBodyRendered?Os(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},vp="paginationPageSizeSelector",Zwe={tag:"span",cls:"ag-paging-page-size"},Jwe=class extends Cn{constructor(){super(Zwe),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(vp,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.pagination.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){ks(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(vp)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const o=this.gos.exists("paginationPageSize"),r=this.gos.get(vp)!==!0;Je(94,{pageSizeSet:o,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Je(95,{paginationPageSizeOption:t,paginationPageSizeSelector:vp}),e.unshift("")}const s=String(n?"":t);this.selectPageSizeComp?(il(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(s,!0)):this.createPageSizeSelectorComp(e,s),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),s=n("pageSizeSelectorLabel","Page Size:"),o=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new a0).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(o).setLabel(s).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(vp);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,s)=>n-s)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},Qwe={selector:"AG-PAGE-SIZE-SELECTOR",component:Jwe},eCe=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}",tCe=class extends YV{constructor(){super(),this.btFirst=dt,this.btPrevious=dt,this.btNext=dt,this.btLast=dt,this.lbRecordCount=dt,this.lbFirstRowOnPage=dt,this.lbLastRowOnPage=dt,this.lbCurrent=dt,this.lbTotal=dt,this.pageSizeComp=dt,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(eCe)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[Qwe]);const{btFirst:t,btPrevious:n,btNext:s,btLast:o}=this;this.activateTabIndex([t,n,s,o]),t.insertAdjacentElement("afterbegin",hr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",hr(e?"next":"previous",this.beans)),s.insertAdjacentElement("afterbegin",hr(e?"previous":"next",this.beans)),o.insertAdjacentElement("afterbegin",hr(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(r):Xle(this.beans,r),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:s=>{(s.key===Oe.ENTER||s.key===Oe.SPACE)&&(s.preventDefault(),n())}})}Yle(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):Nge(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),o=e===n-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){uoe(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),s=e?n:null,o=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*o+1,a=i+r-1,e&&a>s&&(a=s));const l=i+r-1,c=!e&&n<l,u=this.formatNumber(i);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?o+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,C;if(e)v=this.formatNumber(t),C=this.formatNumber(s);else{const S=h("more","more");v=S,C=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=C,this.announceAriaStatus(u,d,C,g,v)}announceAriaStatus(e,t,n,s,o){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${i} ${s} ${l} ${o}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},nCe={selector:"AG-PAGINATION",component:tCe},sCe=class extends We{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return nCe}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,s;if(!this.active)return;let t=e;this.paginateChildRows||(t=((s=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:s.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ht(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ht(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ht(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ht(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,s=t-1;this.totalPages=Math.floor(s/n)+1,this.adjustCurrentPageIfInvalid();const o=this.currentPage,r=n*o;let i=n*(o+1)-1;if(i>s&&(i=s),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===s)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,s=e-1;this.totalPages=Math.floor(s/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>s&&(this.bottomDisplayedRowIndex=s)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:s=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:s,keepRenderedRows:t})}},oCe={moduleName:"Pagination",version:ut,beans:[sCe,Xwe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:$we,paginationGetPageSize:Hwe,paginationGetCurrentPage:Gwe,paginationGetTotalPages:Uwe,paginationGetRowCount:Wwe,paginationGoToNextPage:zwe,paginationGoToPreviousPage:jwe,paginationGoToFirstPage:Kwe,paginationGoToLastPage:qwe,paginationGoToPage:Ywe},dependsOn:[Ry]};function rCe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function BB(e,t,n,s,o){t&&(s&&t.parent&&t.parent.level!==-1&&BB(e,t.parent,n,s,o),t.setExpanded(n,void 0,o))}function iCe(e,t){return e.rowModel.getRowNode(t)}function aCe(e,t,n,s){e.rowRenderer.addRenderedRowListener(t,n,s)}function lCe(e){return e.rowRenderer.getRenderedNodes()}function cCe(e,t,n){e.rowModel.forEachNode(t,n)}function uCe(e){return e.rowRenderer.firstRenderedRow}function dCe(e){return e.rowRenderer.lastRenderedRow}function hCe(e,t){return e.rowModel.getRow(t)}function fCe(e){return e.rowModel.getRowCount()}var pCe={moduleName:"RowApi",version:ut,apiFunctions:{redrawRows:rCe,setRowNodeExpanded:BB,getRowNode:iCe,addRenderedRowListener:aCe,getRenderedNodes:lCe,forEachNode:cCe,getFirstDisplayedRowIndex:uCe,getLastDisplayedRowIndex:dCe,getDisplayedRowAtIndex:hCe,getDisplayedRowCount:fCe}},gCe={moduleName:"ScrollApi",version:ut,apiFunctions:{getVerticalPixelRange:Ive,getHorizontalPixelRange:xve,ensureColumnVisible:CB,ensureIndexVisible:bB,ensureNodeVisible:Fve}};function mCe(e,t,n){if(!t)return;const s=e.ctrlsSvc.getGridBodyCtrl().eGridBody,o=`aria-${t}`;n===null?s.removeAttribute(o):s.setAttribute(o,n)}function vCe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function yCe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function wCe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function CCe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function bCe(e){return{rowHeight:vc(e),headerHeight:op(e)}}function SCe(e,t={}){var r;const n=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=i.getCellRenderer();a!=null&&n.push(tp(a))}if((r=t.columns)!=null&&r.length)return n;const s=[],o=o_(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(o&&!r_(i.rowNode,o)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&s.push(tp(c))}}return[...s,...n]}var ECe={moduleName:"RenderApi",version:ut,apiFunctions:{setGridAriaProperty:mCe,refreshCells:vCe,refreshHeader:yCe,isAnimationFrameQueueEmpty:wCe,flushAllAnimationFrames:CCe,getSizesForCurrentTheme:bCe,getCellRendererInstances:SCe}};function _Ce(e,t){var n,s;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(s=e.colAutosize)==null||s.sizeColumnsToFitGridBody(t)}function $B({colAutosize:e,visibleCols:t},n,s){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:s,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function RCe(e,t){var n;t&&typeof t=="object"?$B(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var DCe=class extends We{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");s=r!=null&&r.length>0&&rs(e)}s&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(o))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(s=>{var c;const o=u=>fd(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return o(s);const r=HB(this.beans),i=u=>n.leftCols.some(d=>Jf(d,u)),a=u=>n.rightCols.some(d=>Jf(d,u)),l=e.colKeys.filter(u=>!ua(u)&&!da(u)&&!i(u)&&!a(u));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),o(s)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:s,skipHeader:o,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let C=-1;const S=Object.fromEntries(c.map(({colId:D,...R})=>[D,R])),b=o??this.gos.get("skipHeaderOnAutoSize"),w=r??b;for(;C!==0;){C=0;const D=[];for(const R of s){if(!R||Ere(R))continue;const T=f.getCol(R);if(!T||v.has(T))continue;const F=p.getPreferredWidthForColumn(T,b);if(F>0){const x=S[T.colId]??{};x.minWidth??(x.minWidth=l),x.maxWidth??(x.maxWidth=a);const P=TCe(T,F,x);T.setActualWidth(P,u),v.add(T),C++}D.push(T)}D.length&&g.refresh(u)}w||this.autoSizeColumnGroupsByColumns(s,u,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:s,ctrlsSvc:o}=this.beans,r=new Set,i=s.getColsForKeys(e);for(const l of i){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||r.add(c),c=c.getParent()}let a;for(const l of r){for(const c of o.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),s=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",s);const o=new Tc(e);return o.addEventListener("doubleTap",s),()=>{e.removeEventListener("dblclick",s),o.destroy()}}addColumnGroupResize(e,t,n){const s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{const r=[],i=t.getDisplayedLeafColumns();for(const a of i)a.getColDef().suppressAutoSize||r.push(a.getColId());r.length>0&&this.autoSizeCols({colKeys:r,skipHeader:s,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",o),()=>e.removeEventListener("dblclick",o)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=HB(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):Je(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,s){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,s));return}const o={};for(const{key:v,...C}of(s==null?void 0:s.columnLimits)??[])o[typeof v=="string"?v:v.getColId()]=C;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=ca(r);if(s!=null&&s.onlyScaleUp&&i>e||e===i&&r.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const S=o==null?void 0:o[C.getId()],b=(S==null?void 0:S.minWidth)??(s==null?void 0:s.defaultMinWidth),w=(S==null?void 0:S.maxWidth)??(s==null?void 0:s.defaultMaxWidth),D=C.getActualWidth();return(b==null||D>=b)&&(w==null||D<=w)}))return;const l=[],c=[];for(const v of r){const C=((p=s==null?void 0:s.colKeys)==null?void 0:p.some(S=>Jf(v,S)))??!0;v.getColDef().suppressSizeToFit||!C?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{$r(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const C=o==null?void 0:o[v.getId()],S=(C==null?void 0:C.minWidth)??(s==null?void 0:s.defaultMinWidth),b=(C==null?void 0:C.maxWidth)??(s==null?void 0:s.defaultMaxWidth),w=v.getActualWidth();typeof S=="number"&&w<S?v.setActualWidth(S,t,!0):typeof b=="number"&&w>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-ca(c);if(v<=0)for(const C of l){const S=((g=o==null?void 0:o[C.getId()])==null?void 0:g.minWidth)??(s==null?void 0:s.defaultMinWidth)??C.minWidth;C.setActualWidth(S,t,!0)}else{const C=v/ca(l);let S=v;for(let b=l.length-1;b>=0;b--){const w=l[b],D=o==null?void 0:o[w.getId()],R=(D==null?void 0:D.minWidth)??(s==null?void 0:s.defaultMinWidth),T=(D==null?void 0:D.maxWidth)??(s==null?void 0:s.defaultMaxWidth),F=w.getMinWidth(),x=w.getMaxWidth(),P=typeof R=="number"&&R>F?R:F,E=typeof T=="number"&&T<x?T:x;let k=Math.round(w.getActualWidth()*C);k<P?(k=P,h(w),d=!1):k>E?(k=E,h(w),d=!1):b===0&&(k=S),w.setActualWidth(k,t,!0),S-=k}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&fd(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const s=n.type;if(s==="fitGridWidth"){const{columnLimits:o,defaultMinWidth:r,defaultMaxWidth:i}=n,a=o==null?void 0:o.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else s==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(s)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var s;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(s=this.beans.colDelayRenderSvc)==null||s.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function TCe(e,t,n={}){const s=n.minWidth??e.getMinWidth();t<s&&(t=s);const o=n.maxWidth??e.getMaxWidth();return t>o&&(t=o),t}function HB({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),o=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return $f(n.eGridBody)-o}var ICe={moduleName:"ColumnAutoSize",version:ut,beans:[DCe],apiFunctions:{sizeColumnsToFit:_Ce,autoSizeColumns:$B,autoSizeAllColumns:RCe},dependsOn:[h2]},xCe=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function FCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function PCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function ACe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function kCe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function OCe(e,t,n){var s;return(s=e.pinnedRowModel)==null?void 0:s.forEachPinnedRow(t,n)}var MCe={moduleName:"PinnedRow",version:ut,beans:[Ace],css:[xCe],apiFunctions:{getPinnedTopRowCount:FCe,getPinnedBottomRowCount:PCe,getPinnedTopRow:ACe,getPinnedBottomRow:kCe,forEachPinnedRow:OCe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},NCe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const s of this.spannedNodes)s!==this.lastNode&&(t+=s.rowHeight);return e-t}},LCe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:s,rowModel:o,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const C=(w,D)=>{p=w,g=null,v=D},S=w=>{const D=!w.isExpandable()&&!w.group&&!w.detail&&(u?!u({rowNode:w}):!0);if(w.rowIndex==null||!D){C(null,null);return}if(p==null||w.level!==p.level||w.footer||g&&w.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){C(w,r.getValue(t,w));return}const R=r.getValue(t,w);if(f){const T=Pt(n,{valueA:v,nodeA:p,valueB:R,nodeB:w,column:t,colDef:a});if(!h(T)){C(w,R);return}}else if(d?!d(v,R):v!==R){C(w,R);return}if(!g){const T=l==null?void 0:l.get(p);(T==null?void 0:T.firstNode)===p?(T.reset(),g=T):g=new NCe(t,p),c.set(p,g)}g.addSpannedNode(w),c.set(w,g)};switch(e){case"center":(b=o.forEachDisplayedNode)==null||b.call(o,w=>{(!i||i.isRowInPage(w.rowIndex))&&S(w)}),this.centerValueNodeMap=c;break;case"top":s==null||s.forEachPinnedRow("top",S),this.topValueNodeMap=c;break;case"bottom":s==null||s.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},VCe=class extends We{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Os(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Os(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const n=this.createManagedBean(new LCe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,s=e.column,o=e.rowIndex,r=this.spanningColumns.get(s);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(o);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(o);break;default:i=n.getRow(o)}if(i)return r.getCellSpan(i)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,s]of this.spanningColumns)if(s.isCellSpanning(e)){const o=s.getCellSpan(e);t(n,o)}}destroy(){super.destroy(),this.spanningColumns.clear()}},BCe=class extends Rd{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,s,o,r,i){this.eWrapper=n,super.setComp(e,t,n,s,o,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||Tv(e,t.rowIndex)}setAriaRowSpan(){goe(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(fy(t)){this.focusedCellPosition=void 0;return}const n=this.isCellFocused();n||(this.focusedCellPosition=void 0),e&&n&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},$Ce=class extends Ey{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new BCe(t,this,this.beans)}isCorrectCtrlForSpan(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},HCe=class extends We{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),s=n.size,o=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of o)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(r.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){r.set(u.firstNode,d),n.delete(u.firstNode);return}i=!0;const h=new $Ce(u.firstNode,this.beans,!1,!1,!1);r.set(u.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===s;if(!(!i&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const s=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(s)return s.getAllCellCtrls().find(o=>o.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},GCe={moduleName:"CellSpan",version:ut,beans:[VCe,HCe]},UCe=class extends We{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,n=e.colDef,s=n.cellClassRules,o=this.getCellClassParams(e,n);n_(this.beans.expressionSvc,s===this.cellClassRules?void 0:this.cellClassRules,s,o,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=s}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let s;if(typeof n=="function"){const o=this.getCellClassParams(e,t);s=n(o)}else s=n;s&&this.cellComp.setUserStyles(s)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,s=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const o=this.beans.cellStyles.getStaticCellClasses(n,s);this.staticClasses=o;for(const r of o)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:s}=this.cellCtrl;return Pt(this.beans.gos,{value:n,data:s.data,node:s,colDef:t,column:e,rowIndex:s.rowIndex})}},WCe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,s){n_(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,s),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let s;return typeof n=="function"?s=n(t):s=n,typeof s=="string"&&(s=[s]),s||[]}createCellCustomStyleFeature(e,t){return new UCe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(o=>{n(o)})}},zCe={moduleName:"CellStyle",version:ut,beans:[WCe]},jCe={moduleName:"RowStyle",version:ut,beans:[Ape]};function KCe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var qCe=class extends We{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:s,gos:o,element:r,columns:i}=this,a=s.colHover;if(n??!!o.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},YCe="ag-column-hover",XCe=class extends We{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const s=()=>{const o=this.isHovered(n);t.toggleCss("ag-column-hover",o)};e.addManagedEventListeners({columnHoverChanged:s}),s()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(YCe,n)}addHeaderFilterColumnHoverListener(e,t,n,s){this.createHoverFeature(e,[n],s);const o=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:o}),o()}createHoverFeature(e,t,n){e.createManagedBean(new qCe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},ZCe={moduleName:"ColumnHover",version:ut,beans:[XCe],apiFunctions:{isColumnHovered:KCe}},JCe=class extends We{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var r;const n=((r=this.wrapSvc)==null?void 0:r.wrap(e,t))??t,s=!Cy.has(e),o=s?this.asyncListeners:this.syncListeners;o.has(e)||o.set(e,new Set),o.get(e).add(n),this.eventSvc.addListener(e,n,s)}removeListener(e,t){var r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,s=this.asyncListeners.get(e),o=!!(s!=null&&s.delete(n));o||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,o)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{Cy.has(i)&&t(i,a)},s=(i,a)=>{Cy.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:s});const o=this.eventSvc;o.addGlobalListener(n,!1),o.addGlobalListener(s,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:s}=this,o=(n==null?void 0:n.unwrapGlobal(e))??e;if(s.has(o)){const{syncListener:i,asyncListener:a}=s.get(o);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),s.delete(e)}else this.syncGlobalListeners.delete(o),t.removeGlobalListener(o,!1)}destroyEventListeners(e,t){e.forEach((n,s)=>{n.forEach(o=>this.eventSvc.removeListener(s,o,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:s})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(s,!0)}),e.clear()}};function QCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.addListener(t,n)}function ebe(e,t,n){var s;(s=e.apiEventSvc)==null||s.removeListener(t,n)}function tbe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function nbe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var sbe={moduleName:"EventApi",version:ut,apiFunctions:{addEventListener:QCe,addGlobalListener:tbe,removeEventListener:ebe,removeGlobalListener:nbe},beans:[JCe]},obe={moduleName:"Locale",version:ut,beans:[kge]},rbe=class extends We{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Os(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:s}=this.beans,o=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=ol(this.beans,d).height;for(const g of o){let v=h==null?void 0:h[g.getColId()];const C=n==null?void 0:n.getCellSpan(g,d);if(C){if(C.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),r=!0)};(a=s==null?void 0:s.forEachPinnedRow)==null||a.call(s,"top",i),(l=s==null?void 0:s.forEachPinnedRow)==null||l.call(s,"bottom",i),(c=t.forEachDisplayedNode)==null||c.call(t,i),r&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const s=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,s!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:s,visibleCols:o}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=o.getLeftColsForRow(t);break;case"right":r=o.getRightColsForRow(t);break;case null:r=s.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const s=t.parentElement,{rowNode:o,column:r}=e,i=this.beans,a=u=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=gc(s),g=d+h+f+p,C=t.offsetHeight+g;if(u<5){const b=Ds(i),w=!(b!=null&&b.contains(t)),D=C==0;if(w||D){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(o,C,r)},l=()=>a(0);l();const c=tl(i,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(o,void 0,r)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(o=>o.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const s of t){const o=n.__autoHeights[s.getColId()];if(!o||n.rowHeight<o)return!1}}return!0}},ibe={moduleName:"RowAutoHeight",version:ut,beans:[rbe]},abe={moduleName:"AllCommunity",version:ut,dependsOn:[NB,fwe,Ewe,Zge,aye,lye,cye,uye,dye,hye,fye,iye,Qme,eve,tve,Jme,sve,ove,Bwe,Vye,oCe,m2,pCe,gCe,ECe,ICe,jue,MCe,Iye,pge,zCe,ZCe,jCe,sbe,vge,kwe,vB,obe,ibe,zue,iwe,GCe]};let GB=!1;GB||(Qoe.registerModules([abe,NB]),GB=!0);class lbe{constructor(t,n){Qn(this,"gridApi",null);Qn(this,"container");Qn(this,"config");Qn(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:s,onRowSelected:o,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{s&&s(a)},onRowSelected:a=>{o&&o(a)}};return this.gridApi=xge(this.container,i),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const s={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const s={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(s=>{var o;(o=this.gridApi)==null||o.removeEventListener(n,s)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const cbe=S2.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),ube=ot({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const s=e,o=n,r=B(null);tS(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=B(null),a=Y(()=>({width:"100%",height:s.height||"500px"})),l=Y(()=>({...s,theme:cbe}));function c(){if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:s.height};i.value=new lbe(r.value,g),i.value.init(),u()}function u(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;o("onGridReady",g)}function d(g){var C,S;if(!g)return;(C=i.value)==null||C.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width}:null).filter(b=>b!==null);(S=i.value)==null||S.setColumnWidth(v)}function h(){var g;(g=i.value)==null||g.destroy(),i.value=null}function f(){var g;return((g=i.value)==null?void 0:g.getApi())||void 0}function p(){return i.value||null}return et(()=>s.columnDefs,(g,v)=>{const C=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");C!==S&&d(g)},{deep:!0}),es(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),sn(()=>{c()}),es(()=>{h()}),(g,v)=>(z(),le("div",{ref_key:"gridContainerRef",ref:r,style:hn(a.value),class:J(["ag-theme-quartz",["ag-table-container",s.isSorting?"is-sorting":""]])},null,6))}});function Fd(e){return bN(e)}const dbe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:Fd(ac),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!1},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:Fd(ac)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:Fd(ac)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:Fd(ac)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:Fd(ac),cellRendererParams:n=>{var s,o,r;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated.value,tooltip:((r=(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:Fd(ac),cellRendererParams:n=>{var s,o,r;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.completedOn.value,tooltip:((r=(o=n==null?void 0:n.data)==null?void 0:o.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>Of.fromType(n))],Py={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},hbe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:Py.WIDTH,minWidth:Py.WIDTH,maxWidth:Py.WIDTH,cellClass:"ag-checkbox-cell",headerClass:Py.HEADER_CLASS,headerComponent:Dv(wJ),suppressMovable:!0}),fbe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},pbe=(e,t,n)=>{const{getCachedValue:s,setCachedValue:o}=Rh({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const u=await s(t);if(u&&typeof u=="string")try{return JSON.parse(u)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},i=B([]),a=hbe(),l=async u=>{const d=await r(),h=new Map;d==null||d.forEach(k=>{k.width&&h.set(k.field,k.width)});const f=dbe(),p=Of.fromType(fbe),v=((u==null?void 0:u.map(k=>{var I;return{headerName:k.name,field:`metric_${k.id}`,editable:((I=k==null?void 0:k.auth_permission)==null?void 0:I.permission)==2,sortable:!0,filter:!1,flex:1,context:{...k},hide:!(k.is_primary||k.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:Dv(ac),headerComponentParams:M=>({headerType:k.metric_type.code=="number"||k.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${k.id}`)}}))||[]).map(k=>Of.fromType(k)),C=[a,...f,...v,p],S=C.filter(k=>k.pinned==="left"),b=C.filter(k=>k.pinned==="right"||k.field==="blank"),w=C.filter(k=>!k.pinned&&k.field!=="blank");if(!d||d.length===0){i.value=C;return}const D=new Map(d.map(k=>[k.field,k])),R=new Map(w.map(k=>[k.field,k])),T=[];for(const k of d)if(k.field&&R.has(k.field)){const I=R.get(k.field);T.push({...I,hide:k.hide,width:k.width}),R.delete(k.field)}const F=Array.from(R.values()),x=[...T,...F].map(k=>({...k,lockPinned:!0})),P=S.map(k=>{const I=D.get(k.field);return I!=null&&I.width?{...k,width:I.width}:k}),E=b.map(k=>{const I=D.get(k.field);return I!=null&&I.width?{...k,width:I.width}:k});i.value=[...P,...x,...E]};et(e,u=>l(u),{immediate:!0});const c=Tr((u,d)=>{var C,S;if(u.source!==void 0)if(["uiColumnResized","uiColumnMoved","api"].indexOf(u.source)===-1){console.warn("Skipping saveColumnConfig for source:",u.source);return}else console.warn("Executing saveColumnConfig for source:",u.source);else console.warn("Executing saveColumnConfig for source:",u);const h=(C=n==null?void 0:n.value)==null?void 0:C.getColumnDefs(),f=(S=n==null?void 0:n.value)==null?void 0:S.getColumnState().reduce((b,w)=>(b[w.colId]=Number(w.width),b),{}),p=new Map;Object.entries(f||{}).forEach(([b,w])=>{p.set(b,w)}),i.value=h||i.value;const g=h==null?void 0:h.filter(b=>!b.pinned&&b.field!=="blank"),v=(g==null?void 0:g.map(b=>({field:b.field,hide:b.hide,width:p.get(b.field)||b.width,pinned:b.pinned})))||[];d&&o(t,JSON.stringify(v))},ai);return{columnDefs:i,checkboxColumn:a,saveColumnConfig:c}},gbe=()=>{const e=un.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},mbe=e=>{var k,I,M;const{showMessage:t,showErrorNetMessage:n}=gf(),s=ts(),o={domainApi:gbe(),wsCode:un.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(M=(I=(k=s==null?void 0:s.appContext)==null?void 0:k.config)==null?void 0:I.globalProperties)==null?void 0:M.apiConfig;if(!r||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new Vk(r,o);i.on("call-api",O=>{O.success?t(O.apiCode,"success"):n(O)});const a=lo({}),l=B([]),c=B(!1),u=B(null),d=B(null),h=B(1),f=B(20);let p=Promise.resolve();const{setCachedUsers:g}=j9(),v=O=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:O}),C=50,S=async(O,$,Z)=>{if(!O.length)return[];const Q=r5(O,$);return(await Promise.all(Q.map(Z))).flat()},b=async O=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:O})).data.map(Z=>[Z==null?void 0:Z.id,Z.permission])}catch($){return console.error("Failed to fetch item permissions chunk:",$),[]}},w=async(O,$)=>{try{const Z=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:O,per_page:O.length*$.length,metric_ids:$}),Q=Z.data.map(ae=>{const ee=new Map(ae.item_metrics.map(W=>[W.metric_id,{value:W.value,auth_permission:W==null?void 0:W.auth_permission}])),V=Object.fromEntries($.map(W=>[W,ee.get(W)??null]));return[ae==null?void 0:ae.id,V]}),se=new Set(Z.data.map(ae=>ae==null?void 0:ae.id));for(const ae of O)if(!se.has(ae)){const ee=Object.fromEntries($.map(V=>[V,{value:null,auth_permission:void 0}]));Q.push([ae,ee])}return Q}catch(Z){return console.error("Failed to fetch a chunk of metric values:",Z),O.map(se=>[se,Object.fromEntries($.map(ae=>[ae,void 0]))])}},D=async O=>{try{const $=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:O,per_page:O.length}),Z=$.data.flatMap(Q=>Q.assignees);return g(Z),$.data.map(Q=>[Q==null?void 0:Q.id,Q==null?void 0:Q.assignees])}catch($){return console.error("Failed to fetch a chunk of assigned users:",$),[]}},R=async O=>{if(!O.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const $=await S(O,C,b);return Object.fromEntries($)}catch($){return console.error("Failed to fetch item permissions:",$),{}}},T=async(O,$)=>!O.length||!$.length?{}:(p=p.then(async()=>{try{const se=[];let ae=0;for(let V=0;V<$.length;V+=5){ae++;const W=$.slice(V,V+5),te=[];for(let ve=0;ve<W.length;ve++){const re=W[ve],ie=await S(O,C,j=>w(j,[re]));te.push(ie),await new Promise(j=>setTimeout(j,500))}se.push(...te);const pe=V+5>=$.length}const ee={};for(const V of se.flat()){const[W,te]=V;ee[W]||(ee[W]={}),Object.assign(ee[W],te)}return ee}catch(Z){return console.error("Failed to fetch metric values:",Z),{}}}),p),F=async O=>{if(!O.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const $=await S(O,C,D);return Object.fromEntries($)}catch($){return console.error("Failed to fetch assigned users:",$),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async O=>{const{cursor:$,offset:Z,size:Q,searchQuery:se}=O;let ae=[];c.value=!0,u.value=null;try{const ee=await i.getAllItem_cursor({...O,cursor:$||void 0,offset:Z||void 0,pageSize:Q||f.value,...v(se),sortBy:O.sort_by});return l.value=ee.data,d.value=ee.meta,h.value=ee.meta.current_page||0,ae=ee.data.map(V=>V==null?void 0:V.id),ee}catch(ee){throw u.value=ee,console.error("Failed to fetch items (cursor):",ee),ee}finally{const ee=async()=>{try{const[V,W]=await Promise.all([F(ae),R(ae)]);e.value.updateItemData({assignees:V,permission:W},ae);const te=await T(ae,e.value.metricIds);e.value.setMetricValues(te,new Set(ae),e.value.metricIds)}catch(V){console.error("Post-fetch processing failed:",V)}};c.value=!1,setTimeout(ee)}},getAssignableStatus:async O=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:O})}catch($){throw console.error("Failed to fetch assignable status:",$),$}},getMetricList:async O=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:O})}catch($){throw console.error("Failed to fetch metric list:",$),$}},getMetricValues:T,getAssignedUsers:F}};function vbe(e){return{updateRowData:(s,o)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);o.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(r.push(u),s.assignees){const h=A9((s.assignees[c]||[]).map(IF));u.data.assignees=h,i.add("assignees")}s.permission&&(u.data.permissions=s.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),i.add("description"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(s,o,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(o).map(c=>[c,new Map(r.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(s).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=i.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&i.refreshCells({rowNodes:l,columns:Array.from(r).map(c=>`metric_${c}`),force:!0})}}}function ybe(e,t,n,s,o){let r=!0;return{async getRows(i){try{s(!0),r&&(o(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,u),s(!1),o(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),s(!1),o(!1)}}}}function wbe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:s,gridApi:o,fetcher:r}=e,i=B(!0),a=B(!0),l=B(!1),c=()=>{n.value=!n.value},u=v=>{if(i.value=!1,o.value=v,!v)return null;const{addEventListener:C,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=ybe(r,e.perPage,()=>s.value,w=>{i.value=w},w=>{a.value=w});return S==null||S("datasource",b),C==null||C("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var C,S;if((C=o.value)==null||C.hideOverlay(),v!==void 0&&(s.value=v),(S=o.value)==null||S.deselectAll(),t.value=[],i.value=!0,!o.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,o.value.purgeInfiniteCache(),o.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=o.value)==null||v.deselectAll(),t.value=[]},f=Tr(v=>{d(v)},ai),p=()=>{o.value},g=B(!1);return{isLoading:i,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const Cbe={changelog:{"1.0.1":{date:"2024-06-20",changes:["Fixed styling issues for archived and deleted rows."]},"1.0.0":{date:"2024-06-15",changes:["Initial release of the Item Table package."]},"0.0.1-alpha.8":{date:"2024-06-10",changes:["Improved performance of row updates.","Added support for custom cell renderers.","Add row hover effect for better UX.","Add loading skeleton for filter","Beta release with core functionalities implemented."]},"0.0.1-alpha.9":{date:"2024-06-05",changes:["Add row selection feature.","Fix bug with column resizing.","Optimize rendering for large datasets.","Implement getLog function to retrieve changelog entries based on version.","Display app version and changelog in the Item Table component tooltip.","Clean up unused autocomplete and memoized config composables.","Update styles for better consistency and readability."]},"0.0.1-alpha.11":{date:"2024-06-18",changes:["Add bulk process status display: items now show an hourglass icon and tooltip when being processed.","Update data model: added isProcessing and bulk_process properties to track item status.","Improve row focus: focused rows now flash for better visibility.","Set 'Last Updated' and 'Completed On' columns as read-only.","Fix: resolve visual fetching issue in useRemoteFiles composable.","Fix: use correct upload icon in PopupCreateScenes component.","Enhance data conversion to include processing status in item rows."]},"0.0.1-alpha.12":{date:"2024-06-12",changes:["feat: enhance Snackbar component and notification handling","Refactor Snackbar.vue for improved readability and styling, including color adjustments for icons and text.","Add showMessage function in notifications store to display messages based on API keys, improving notification management.","Introduce notificationMessage constant to centralize notification messages for various API actions, enhancing maintainability.","Remove unnecessary console logs from useRemoteFiles and improve logging in notification store for better debugging."]},"0.0.1-alpha.16":{date:"2024-06-20",changes:["Add onboarding tour feature and enhance UI components with new dependencies","Refactor UI components for improved styling and functionality","Updated RatingComponent.vue to streamline class bindings and improve accessibility attributes.","Enhanced SearchBox.vue by adding a clear event handler and simplifying icon rendering.","Modified AssigneeGroupEditor.vue and AssigneeGroupRenderer.vue to remove unnecessary size attributes from icons.","Adjusted DateRangeRenderer.vue to remove size attributes from icons for consistency.","Updated HeaderCheckbox.vue to set dropdown placement to 'bottom-start'.","Refined HeaderSorting.vue to simplify sort option labels and improve sorting logic.","Enhanced HeaderWrapper.vue to utilize reactive properties for sorting state.","Improved HyperLinkEditor.vue and HyperLinkInlineEditor.vue by removing size attributes from icons.","Updated PopupLayout.vue to use a CSS variable for box-shadow styling.","Refined Snackbar.vue to standardize icon colors and improve styling consistency.","Adjusted useTippy.ts to set default placement and arrow visibility for tooltips.","Modified notificationMessage.ts to remove error messages for list fetching.","Cleaned up notifications.ts by removing console logs for a cleaner codebase.","Updated sortStore.ts to comment out unnecessary console logs for better performance.","Enhanced styles.scss by defining new icon size variables and standardizing box-shadow styles."]},"0.0.99":{date:"2024-06-24",changes:["Fix: resolve issue with incorrect version display in Item Table component.","Update changelog retrieval logic to ensure accurate version matching.","Enhance tooltip display for app version and changelog in Item Table component."]}}},bbe=e=>{var t;return(t=Object.entries(Cbe.changelog).find(([n,s])=>n===e))==null?void 0:t[1].changes},Sbe={key:1},Ebe=Et(ot({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=B(null),o=e,r=()=>{s.value&&s.value.show()},i=B(""),a=B("idle"),l=B({file:null,format:null}),{apiServices:c}=ns(!1,{}),u=B(!1),d=async()=>{u.value=!0;const P=o.workspaceId,E=o.entityId;if(!P||!E||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(P,E))throw new Error("No response from downloadTemplate API")}catch(k){console.error("Error downloading template:",k)}u.value=!1},h=n,f=()=>{h("import-success"),S()},p=async P=>{var I,M,O;const E=new FormData,k=((I=P.name.split(".").pop())==null?void 0:I.toString())||"";if(E.append("file",P),E.append("format",k),E.append("entity_id",o.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,E),g()}catch($){throw console.error("Error uploading file:",$),v(((O=(M=$.response)==null?void 0:M.data)==null?void 0:O.message)||"An unknown error occurred during file upload."),$}},g=()=>{a.value="success"},v=P=>{i.value=P,a.value="error"},C=async()=>{!l.value||!l.value.file||await p(l.value.file)},S=()=>{var P;R(),(P=s.value)==null||P.hide()};t({close:S,open:r});const b=Y(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),w=Y(()=>l.value.file?!1:(console.error("No file selected"),!0)),D=B(null),R=()=>{var P;(P=D.value)==null||P.clear(),i.value="",l.value={file:null,format:null},a.value="idle"},T=Sn("switchInstance"),F=()=>{T?T("xlsx_toolbox","",{showLoad:!1}):window.appManager.switchInstance("xlsx_toolbox","",{showLoad:!1}),console.log("Toolbox opened")};let x;return sn(()=>{const P=sessionStorage.getItem("BASE_URL");x=mN({target:window,allowedOrigins:[P||"https://app.arbocollab.com"],onMessage:(E,k)=>{var M;if(E.type!==kf.SW_APP_LOADER)return;console.log("Received from:",k.origin),console.log("File name:",E.payload.fileName);const I=E.payload.file;(M=D.value)==null||M.setFile(I)},onInvalidMessage:(E,k,I)=>{console.warn("Rejected postMessage:",k,I.origin)}})}),es(()=>{x==null||x()}),(P,E)=>(z(),je(G(jk),{"popup-name":b.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:R},nh({default:ge(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(z(),je(dN,{key:0,state:a.value,"error-message":i.value,overwrite:!0},null,8,["state","error-message"])):(z(),le("div",Sbe,[we("div",{class:J(P.$style["step-section"])},[we("span",{class:J(P.$style["step-title"])},"Step 1: Download current data",2),we("span",{class:J(P.$style["step-description"])},[...E[1]||(E[1]=[tt(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),we("br",null,null,-1),we("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),we("div",{class:J(P.$style["actions-section"])},[he(G(ct),{class:J(P.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:ge(()=>[he(G(at),{src:"Download"})]),default:ge(()=>[E[2]||(E[2]=tt(" Download file ",-1))]),_:1},8,["class","disabled"]),he(G(ct),{class:J(P.$style["download-sample-btn"]),size:12,variant:"secondary",onHandleClick:F},{default:ge(()=>[...E[3]||(E[3]=[tt(" Toolbox ",-1)])]),_:1},8,["class"])],2)],2),we("div",{class:J(P.$style["step-section"])},[we("span",{class:J(P.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),he(G(PO),{modelValue:l.value,"onUpdate:modelValue":E[0]||(E[0]=k=>l.value=k),ref_key:"filUploaderRef",ref:D},null,8,["modelValue"])],2),we("div",{class:J(P.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[he(hN)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:ge(()=>[he(G(ct),{style:{flex:"1"},variant:"secondary",onClick:S},{default:ge(()=>[...E[4]||(E[4]=[tt(" Cancel ",-1)])]),_:1}),he(G(ct),{disabled:w.value,style:{flex:"1"},variant:"primary",onClick:C},{default:ge(()=>[...E[5]||(E[5]=[tt(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ge(()=>[he(G(ct),{style:{flex:"1"},variant:"primary",onClick:f},{default:ge(()=>[...E[6]||(E[6]=[tt(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:ge(()=>[he(G(ct),{style:{flex:"1"},variant:"primary",onClick:R},{default:ge(()=>[...E[7]||(E[7]=[tt(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_1hsaq_1","step-title":"_step-title_1hsaq_11","step-title-2":"_step-title-2_1hsaq_17","step-description":"_step-description_1hsaq_23","date-format-guide":"_date-format-guide_1hsaq_28","import-error":"_import-error_1hsaq_39","drop-area":"_drop-area_1hsaq_49","is-dragging":"_is-dragging_1hsaq_49","drop-area-content":"_drop-area-content_1hsaq_52",browse:"_browse_1hsaq_61","download-sample-btn":"_download-sample-btn_1hsaq_65","actions-section":"_actions-section_1hsaq_69"}}]]),_be=Et(ot({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=To,s=Zb(),{setUserPermissions:o,setEntityPermissions:r}=s,{entityPermissions:i}=Qs(s),a=qt,l=B(null),c={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},u=B(""),d=Y(()=>{var Ye;const ke=((Ye=i.value)==null?void 0:Ye.has_create_item_permission)==1||!1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!ke},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!ke,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!ke,id:"overwrite_scenes_option"}]}),h=e;Of.initialize({wrapVueCellRenderer:Dv,wrapVueCellEditor:bN});const f=ef(),{switchInstanceFunc:p}=Qs(f);sn(()=>{const ke=ts();p.value=ke==null?void 0:ke.appContext.config.globalProperties.switchInstance;const Ye=new BroadcastChannel("focusable_channel");vt(()=>{setTimeout(()=>{Ye.postMessage("Focusable elements updated")},7e3)})});const g=B(null),v=B([]),C=zm(),{rowCount:S}=Qs(C),b=B(!1),w=B(""),D=B(),R=jA(),{metricList:T}=Qs(R),F=B(""),x=B(!1),P=B(new Set),E=B(new Map),{apiServices:k}=ns(!1,h),{columnDefs:I,checkboxColumn:M,saveColumnConfig:O}=pbe(T,h.entityId,g),$=B();et(()=>I,()=>{var ke;(ke=$.value)==null||ke.updateColumnDefs(I.value)},{deep:!0});const Z=(ke,Ye)=>{O(ke,Ye)},{updateRowData:Q,setMetricValues:se}=vbe(g),ae=Y(()=>({isSearching:w.value.length>0,isFiltering:!(Object.keys(Ae.value||{}).length==1&&Object.keys(Ae.value)[0]=="preflight_status")&&Object.keys(Ae.value||{}).length>0})),ee=Y(dm),V=Y(()=>I.value.filter(ke=>{var Ye;return((Ye=ke.field)==null?void 0:Ye.startsWith("metric_"))&&!ke.hide}).map(ke=>{var Ye;return((Ye=ke.field)==null?void 0:Ye.replace("metric_",""))||""}));Zr("timezone",ee);const W=Y(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:V.value,updateItemData:Q,setMetricValues:se})),{fetchItems:te,getMetricList:pe,cusorMap:ve,getMetricValues:re}=mbe(W),ie=Y(()=>{if(!g.value)return!1;const ke=g.value.getSelectedRows().length;return ke>0&&ke>=S.value.total}),j=Y(()=>{var ke;return((ke=l.value)==null?void 0:ke.name)||"Items"}),me=ke=>{setTimeout(()=>{vt(()=>{var Ye,Qt;g.value&&(ke?(Ye=g.value)==null||Ye.showNoRowsOverlay():(Qt=g.value)==null||Qt.hideOverlay())})},500)},oe=(ke,Ye)=>{var Qt;S.value.total=ke.meta.total??0,(Qt=ke.meta.next)!=null&&Qt.cursor&&(ve[Ye+1]=ke.meta.next.cursor),F.value=ke.meta["X-Tsr-signature"]||"",ke.meta.total===0?me(!0):me(!1)},Se=FO(),U=B(null),{sortingAPIConfiguration:K,isSortingRunning:ue}=Qs(Se),Ae=B({preflight_status:"1"}),Fe=Y(()=>({...Ae.value,search:w.value}));Zr("filterParams",Fe);const Le=B([]),ye=async({page:ke,pageSize:Ye,filterText:Qt})=>{var Go;(Go=g.value)==null||Go.hideOverlay();const Zt=ve[ke],Co=!Zt&&ke>1?(ke-1)*Ye:void 0,wa=K.value;wa.length>0&&(ue.value=!0);try{const Ca={cursor:Zt,size:Ye,searchQuery:Qt,offset:Co,sort_by:wa,...Ae.value},oo=await te(Ca);if(!oo)return{rows:[],total:0};const yp=(Kn=>{const Ai=Kn.data.map(bo=>FF(bo,ee.value));return Ai.forEach(bo=>{P.value.add(String(bo.id)),E.value.set(String(bo.id),{})}),Ai})(oo);return oe(oo,ke),{rows:yp,total:S.value.total}}catch(Ca){return console.error("Failed to fetch items:",Ca),{rows:[],total:0}}finally{ue.value=!1}},{isLoading:N,toggleSidebar:H,onGridReady:ce,handleUnSelect:Ge,handleSelectAll:Ce,onSearch:ze,firstLoad:Ue}=wbe({selectRowData:B([]),isSidebarOpen:b,quickFilterText:w,gridApi:g,perPage:c.ROWS_PER_PAGE,fetcher:ye}),_e=B([]),Ve=()=>{var ke;_e.value=((ke=g.value)==null?void 0:ke.getSelectedRows())||[]},gt=lo({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),kt=Y(()=>({blockLoadDebounceMillis:1e3,columnDefs:I.value,rowModelType:"infinite",cacheBlockSize:c.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:c.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:c.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:Ut,noRowsOverlayComponent:Dv(oee),noRowsOverlayComponentParams:()=>ae.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:ke=>ke.data.id,getRowClass:ke=>{if(!ke.data)return["row-empty"];const Ye=["row-highlight"];return ke.data.id||Ye.push("row-inactive"),ke.data.isDeleted&&Ye.push("row-deleted"),ke.data.disabled&&Ye.push("row-deleted"),ke.data.isArchived&&Ye.push("row-archived"),ke.data.isLocked&&Ye.push("row-locked"),Ye},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:k.value,sorting:ue.value},onCellKeyDown:ke=>{var Ye,Qt,Zt;if(ke.data.isDeleted)return!1;if(((Ye=ke==null?void 0:ke.event)==null?void 0:Ye.key)==="Enter"){const{api:Co,node:wa,column:Go}=ke,Ca=Co.getCellRendererInstances({rowNodes:[wa],columns:[Go]});if(Ca.length>0){const oo=Ca[0];oo&&typeof((Qt=oo.componsenExposed)==null?void 0:Qt.focus)=="function"&&((Zt=oo.componsenExposed)==null||Zt.focus())}}},isRowSelectable:ke=>!ke.group,suppressKeyboardEvent:ke=>{var Zt;if((Zt=ke.data)!=null&&Zt.isDeleted)return!0;const Ye=ke.event.key,Qt=ke.editing;return Qt&&Ye==="Tab"?!0:Qt&&Ye==="Enter"?!1:Ye==="Enter"?(ke.event.preventDefault(),ke.event.stopPropagation(),!0):Ye==="ArrowUp"||Ye==="ArrowDown"||Ye==="ArrowLeft"||Ye==="ArrowRight"||Ye==="Tab"||Ye==="Enter"},navigateToNextCell:()=>null,onBodyScroll:ke=>{const Ye=ke.api.getFirstDisplayedRowIndex(),Qt=ke.api.getLastDisplayedRowIndex();gt.rowsDisplay.fromIndex=Ye,gt.rowsDisplay.toIndex=Qt,gt.columnsDisplay=ke.api.getAllDisplayedVirtualColumns().map(Zt=>Zt.getColId())},onViewportChanged:ke=>{gt.columnsDisplay=ke.api.getAllDisplayedVirtualColumns().map(Ye=>Ye.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(ke){if(ke.data.isDeleted&&ke.api.stopEditing(),ke.colDef.field=="options"){const Ye=ke.api.getCellRendererInstances({rowNodes:[ke.node],columns:[ke.column]});Ye.length>0&&Ye[0].focusUi()}},tabToNextCell:ke=>{let Ye=ke.nextCellPosition;if(Ye&&Ye.column.getColId()==="ag-Grid-SelectionColumn"){const Qt=ke.api.getAllDisplayedColumns(),Zt=Qt.indexOf(Ye.column),Co=ke.backwards?-1:1,wa=Qt[Zt+Co];if(wa)return{rowIndex:Ye.rowIndex,column:wa,rowPinned:Ye.rowPinned}}return Ye}}));function Ut(){if(!g.value)return;let ke=0;g.value.forEachNode(Ye=>{Ye.data&&ke++}),S.value.loaded=Math.min(ke,S.value.total)}et(()=>K,()=>{g.value&&(F.value="",P.value.clear(),g.value.deselectAll(),Object.keys(ve).forEach(ke=>delete ve[Number(ke)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const en=B(),zt=B(),Ne=()=>{var ke;(ke=zt.value)==null||ke.open()},qe=()=>{var ke;(ke=en.value)==null||ke.open()},wt=async()=>{Ue.value=!0,g.value&&(F.value="",P.value.clear(),Object.keys(ve).forEach(ke=>delete ve[Number(ke)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},Nt=Y(()=>un.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Wt=B();Y(()=>{var ke;return(ke=bbe(Nt.value))==null?void 0:ke.map(Ye=>`<div>• ${Ye}</div>`).join(`
260
+ `)});function st(ke){var Ye;ke==="new_scene"?(Ye=Wt.value)==null||Ye.show():ke==="import_scenes"?qe():ke==="overwrite_scenes"&&Ne()}const Is=ke=>{v.value=ke.api.getSelectedRows().map(Ye=>Ye.id)},Ur=ke=>{const Ye=ce(ke);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",Zt=>Z(Zt,!0)),Ye.addEventListener("columnResized",Zt=>Z(Zt,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport"))||ke==null||ke.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),Ye},xi=()=>{var ke;u.value=(((ke=document.getElementById("item-table-layout-id"))==null?void 0:ke.clientHeight)??0)-78+"px"};sn(()=>{vt(()=>{xi()}),window.addEventListener("resize",xi);function ke(){requestAnimationFrame(ke)}ke()}),es(()=>{window.removeEventListener("resize",xi)});const gr=async({code:ke,name:Ye})=>{await ze(ke),setTimeout(()=>{var Qt;(Qt=D.value)==null||Qt.setValue(Ye)},300)},ya=ke=>{if(!g.value)return;const Ye=g.value.getRowNode(ke);Ye?(g.value.ensureIndexVisible(Number(Ye.rowIndex),"middle"),g.value.flashCells({rowNodes:[Ye],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(S.value.total-1,"bottom")},ml=ke=>ke.metric_type.code==="number"?"number":"default",Fi=async()=>{if(h.entityId)try{const ke=await pe(h.entityId);T.value=ke.data.map(Ye=>({...Ye,sortType:ml(Ye)}))}catch(ke){console.error("Failed to initialize metric list:",ke),T.value=[]}},Pi=async()=>{if(k.value)try{const ke=await k.value.getUserPermission(h.workspaceId);o(ke)}catch(ke){console.error("Failed to fetch user permissions:",ke)}},mr=async()=>{if(k.value)try{const ke=await k.value.getEntityDetail(h.workspaceId,h.entityId);r(ke.permission),l.value=ke}catch(ke){console.error("Failed to fetch entity details:",ke)}},Wr=fv(),{setUser:Pd}=Wr,kn=async()=>{if(k.value)try{const ke=await k.value.getMe();return Pd(ke),ke}catch(ke){console.error("Failed to fetch user details:",ke)}},ps=async()=>{var ke;if(k.value)try{const Ye=await k.value.getWorkspaces(h.workspaceId),Qt=(ke=Ye.data[0])==null?void 0:ke.ws_user_role_id;return Qt&&Wr.setUserRoleId(Qt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};et(()=>[h.entityId,h.workspaceId],async([ke,Ye])=>{!ke||!Ye||(kn(),ps(),Fi(),Pi(),mr())},{immediate:!0,deep:!0}),et(V,(ke,Ye)=>{const Qt=ke.filter(Zt=>!(Ye!=null&&Ye.includes(Zt)));Qt.length>0&&re(Array.from(P.value),Qt).then(Zt=>{se(Zt,P.value,Qt)})},{immediate:!0,deep:!0}),et(F,(ke,Ye)=>{x.value=!!(Ye&&ke&&Ye!==ke)}),t({refreshTable:wt});const E_=ke=>{Ae.value=ke,wt()},Ad=ke=>{Le.value=ke,wt()},kd=ke=>{I.value=ke||[],Z({},!0)},Od=Y(()=>{var Zt;const ke=un.getInstance().getItem("ws.terminology"),Ye=ke?JSON.parse(ke):null;return`New ${((Zt=Ye==null?void 0:Ye.find(Co=>Co.code==="scene"))==null?void 0:Zt.name)||"Scene"}`});return B('<p><br>Here is template notess..</p><p><strong>this is Bold</strong>,<i> this is Italic</i>,<u> this is underline</u><br>this is hightlight ,&nbsp;<br>1</p><p>1</p><ul class="todo-list"><li data-list-item-id="ed7bc572523bb0f35972903183a9d7346"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">1</span></li><li data-list-item-id="ef5b3e469bed2b79951b489fd3a25ffaa"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">2</span></li><li data-list-item-id="ed25bcd78b8b608ed432f01164608cb0d"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">3</span></li><li data-list-item-id="e05c8f5e183d4de144c2a6a8059691d5f"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">4</span></li></ul><p>This is list</p><ul><li data-list-item-id="ed6b9c0b0b97baf09030ee79ea57c40a9">1</li><li data-list-item-id="ef1fc34bceeb4a82abc8c61fe28972c9b">2</li><li data-list-item-id="e950cf66600b9cc40f130a396a6831a75">3</li><li data-list-item-id="e64b6e87f244f9268e45b32b785308a6e">4</li></ul><p>&nbsp;</p>'),(ke,Ye)=>{const Qt=Eo("focusable");return z(),je(G(pJ),{"is-sidebar-open":b.value,onCloseSidebar:G(H),onSidebarClear:G(H),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:G(H)},{"header-left":ge(()=>{var Zt;return[((Zt=G(i))==null?void 0:Zt.has_create_item_permission)==1?(z(),je(G(mS),{key:0,variant:["primary"],options:d.value,onSelect:st,onHandleClick:Ye[1]||(Ye[1]=Co=>st("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ge(()=>[Ke(he(G(ct),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Co=>st("new_scene")),label:Od.value},null,8,["label"]),[[Qt,1]])]),_:1},8,["options"])):Ze("",!0)]}),"header-actions":ge(()=>[he(G(Hee),{"onUpdate:assignees":Ad,onApplyFilter:E_,loading:G(Ue),entityId:h.entityId},null,8,["loading","entityId"]),Ke(he(G(sS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=Zt=>w.value=Zt),onSearch:G(ze),class:J(ke.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=Zt=>G(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:D},null,8,["modelValue","onSearch","class"]),[[G(n),{isLoading:G(Ue),fullwidth:!0}]]),Ke((z(),je(G($A),{status:G(N)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:ge(()=>[Ke((z(),je(G(ct),{variant:["secondary","icon"],disabled:G(N),onClick:wt},{default:ge(()=>[he(G(at),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[Qt,5],[G(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[G(n),{isLoading:G(Ue),fullwidth:!0}]]),Ke(he(G($Q),{"model-value":G(I),onChange:Ye[4]||(Ye[4]=Zt=>kd(Zt)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:$,"checkbox-column":G(M),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[G(n),{isLoading:G(Ue),fullwidth:!0}]])]),grid:ge(({availableHeight:Zt})=>[he(G(ube),Kt({id:"item_table_main",ref_key:"agGrid",ref:U},kt.value,{height:Zt+"px",isSorting:G(ue),onOnGridReady:Ur,onSelectionChanged:Is}),null,16,["height","isSorting"])]),footer:ge(()=>[we("div",{class:J(ke.$style.tableFooter),id:"table_footer"},[we("span",null,[Ye[5]||(Ye[5]=tt(" Showing ",-1)),we("b",null,Ct(G(S).loaded)+" of "+Ct(G(S).total),1)])],2)]),"new-row":ge(()=>[he(G(vee),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:gr,onFocusOnId:ya},null,512)]),"bulk-update-actions":ge(()=>[!b.value&&v.value.length>0?Ke((z(),je(G(iJ),{key:0,selectRowData:_e.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:G(Ge),onSelectAll:G(Ce),"take-name":j.value,"selected-all":ie.value,"total-rows":G(S).total,"visible-rows":G(S).loaded,onUpdated:Ve,loading:G(N)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ko,!b.value&&v.value.length>0]]):Ze("",!0)]),snackbar:ge(()=>[he(G(YJ))]),popup:ge(()=>[he(Use,{ref_key:"popupCreateSceneRef",ref:en,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"]),he(Ebe,{ref_key:"popupOverwriteScenesRef",ref:zt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"])}}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),UB="0.1.137",Rbe={key:0},Dbe=Et(ot({__name:"app",setup(e){const t=Y(()=>n.id.length===0||n.workspaceId.length===0),n=lo({id:"",workspaceId:"",apiConfig:{}}),s=gf(),{showMessage:o,showErrorNetMessage:r}=s,i=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=B(null),c=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};eh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",UB);try{if(l.value=ts(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||un.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:un.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new Vk(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),es(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=Y(()=>n.id),d=Y(()=>n.workspaceId);return Zr("workspaceId",d),Zr("entityId",u),(h,f)=>(z(),le("div",{class:J(h.$style.dashboardPluginWrapper)},[t.value?(z(),le("span",Rbe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(z(),je(G(_be),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ze("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),S_=async(e={},t={})=>{const n=_T(Dbe),s=vY();n.use(s);const o=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,o.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${UB}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",qt),n.directive("focusable",Wi);const i=await Pse();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=S_),On.default=S_,On.initDashboard=S_,Object.defineProperties(On,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});