@arbocollab/arbo-plugin-item-table 0.1.101 → 0.1.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/es/index.es.js +12 -12
- package/lib/style.css +1 -1
- package/lib/umd/index.umd.js +2 -2
- package/package.json +1 -1
package/lib/umd/index.umd.js
CHANGED
|
@@ -143,7 +143,7 @@ This will fail in production.`);r=Zl,r._s.has(e)||(o?Jb(e,t,s,r):VA(e,s,r),K.env
|
|
|
143
143
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(o=>s.set(o)),s}static accessor(t){const s=(this[pk]=this[pk]={accessors:{}}).accessors,o=this.prototype;function i(r){const a=cf(r);s[a]||(fX(o,r),s[a]=!0)}return Be.isArray(t)?t.forEach(i):i(t),this}};po.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Be.reduceDescriptors(po.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}}),Be.freezeMethods(po);function pS(e,t){const n=this||uf,s=t||n,o=po.from(s.headers);let i=s.data;return Be.forEach(e,function(a){i=a.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function gk(e){return!!(e&&e.__CANCEL__)}function Vc(e,t,n){qt.call(this,e??"canceled",qt.ERR_CANCELED,t,n),this.name="CanceledError"}Be.inherits(Vc,qt,{__CANCEL__:!0});function mk(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new qt("Request failed with status code "+n.status,[qt.ERR_BAD_REQUEST,qt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function pX(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function gX(e,t){e=e||10;const n=new Array(e),s=new Array(e);let o=0,i=0,r;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),c=s[i];r||(r=u),n[o]=l,s[o]=u;let d=i,h=0;for(;d!==o;)h+=n[d++],d=d%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),u-r<t)return;const f=c&&u-c;return f?Math.round(h*1e3/f):void 0}}function mX(e,t){let n=0,s=1e3/t,o,i;const r=(u,c=Date.now())=>{n=c,o=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const c=Date.now(),d=c-n;d>=s?r(u,c):(o=u,i||(i=setTimeout(()=>{i=null,r(o)},s-d)))},()=>o&&r(o)]}const Bm=(e,t,n=3)=>{let s=0;const o=gX(50,250);return mX(i=>{const r=i.loaded,a=i.lengthComputable?i.total:void 0,l=r-s,u=o(l),c=r<=a;s=r;const d={loaded:r,total:a,progress:a?r/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&c?(a-r)/u:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},vk=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},yk=e=>(...t)=>Be.asap(()=>e(...t)),vX=Gs.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Gs.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Gs.origin),Gs.navigator&&/(msie|trident)/i.test(Gs.navigator.userAgent)):()=>!0,yX=Gs.hasStandardBrowserEnv?{write(e,t,n,s,o,i,r){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];Be.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Be.isString(s)&&a.push(`path=${s}`),Be.isString(o)&&a.push(`domain=${o}`),i===!0&&a.push("secure"),Be.isString(r)&&a.push(`SameSite=${r}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function wX(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function CX(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function wk(e,t,n){let s=!wX(t);return e&&(s||n==!1)?CX(e,t):t}const Ck=e=>e instanceof po?{...e}:e;function nu(e,t){t=t||{};const n={};function s(u,c,d,h){return Be.isPlainObject(u)&&Be.isPlainObject(c)?Be.merge.call({caseless:h},u,c):Be.isPlainObject(c)?Be.merge({},c):Be.isArray(c)?c.slice():c}function o(u,c,d,h){if(Be.isUndefined(c)){if(!Be.isUndefined(u))return s(void 0,u,d,h)}else return s(u,c,d,h)}function i(u,c){if(!Be.isUndefined(c))return s(void 0,c)}function r(u,c){if(Be.isUndefined(c)){if(!Be.isUndefined(u))return s(void 0,u)}else return s(void 0,c)}function a(u,c,d){if(d in t)return s(u,c);if(d in e)return s(void 0,u)}const l={url:i,method:i,data:i,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(u,c,d)=>o(Ck(u),Ck(c),d,!0)};return Be.forEach(Object.keys({...e,...t}),function(c){const d=l[c]||o,h=d(e[c],t[c],c);Be.isUndefined(h)&&d!==a||(n[c]=h)}),n}const bk=e=>{const t=nu({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:o,xsrfCookieName:i,headers:r,auth:a}=t;if(t.headers=r=po.from(r),t.url=ck(wk(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&r.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Be.isFormData(n)){if(Gs.hasStandardBrowserEnv||Gs.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(Be.isFunction(n.getHeaders)){const l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([c,d])=>{u.includes(c.toLowerCase())&&r.set(c,d)})}}if(Gs.hasStandardBrowserEnv&&(s&&Be.isFunction(s)&&(s=s(t)),s||s!==!1&&vX(t.url))){const l=o&&i&&yX.read(i);l&&r.set(o,l)}return t},bX=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,s){const o=bk(e);let i=o.data;const r=po.from(o.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:u}=o,c,d,h,f,p;function g(){f&&f(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(c),o.signal&&o.signal.removeEventListener("abort",c)}let v=new XMLHttpRequest;v.open(o.method.toUpperCase(),o.url,!0),v.timeout=o.timeout;function C(){if(!v)return;const b=po.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),_={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:b,config:e,request:v};mk(function(T){n(T),g()},function(T){s(T),g()},_),v=null}"onloadend"in v?v.onloadend=C:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(C)},v.onabort=function(){v&&(s(new qt("Request aborted",qt.ECONNABORTED,e,v)),v=null)},v.onerror=function(w){const _=w&&w.message?w.message:"Network Error",R=new qt(_,qt.ERR_NETWORK,e,v);R.event=w||null,s(R),v=null},v.ontimeout=function(){let w=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||hk;o.timeoutErrorMessage&&(w=o.timeoutErrorMessage),s(new qt(w,_.clarifyTimeoutError?qt.ETIMEDOUT:qt.ECONNABORTED,e,v)),v=null},i===void 0&&r.setContentType(null),"setRequestHeader"in v&&Be.forEach(r.toJSON(),function(w,_){v.setRequestHeader(_,w)}),Be.isUndefined(o.withCredentials)||(v.withCredentials=!!o.withCredentials),a&&a!=="json"&&(v.responseType=o.responseType),u&&([h,p]=Bm(u,!0),v.addEventListener("progress",h)),l&&v.upload&&([d,f]=Bm(l),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",f)),(o.cancelToken||o.signal)&&(c=b=>{v&&(s(!b||b.type?new Vc(null,e,v):b),v.abort(),v=null)},o.cancelToken&&o.cancelToken.subscribe(c),o.signal&&(o.signal.aborted?c():o.signal.addEventListener("abort",c)));const S=pX(o.url);if(S&&Gs.protocols.indexOf(S)===-1){s(new qt("Unsupported protocol "+S+":",qt.ERR_BAD_REQUEST,e));return}v.send(i||null)})},SX=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,o;const i=function(u){if(!o){o=!0,a();const c=u instanceof Error?u:this.reason;s.abort(c instanceof qt?c:new Vc(c instanceof Error?c.message:c))}};let r=t&&setTimeout(()=>{r=null,i(new qt(`timeout ${t} of ms exceeded`,qt.ETIMEDOUT))},t);const a=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:l}=s;return l.unsubscribe=()=>Be.asap(a),l}},EX=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let s=0,o;for(;s<n;)o=s+t,yield e.slice(s,o),s=o},_X=async function*(e,t){for await(const n of RX(e))yield*EX(n,t)},RX=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:s}=await t.read();if(n)break;yield s}}finally{await t.cancel()}},Sk=(e,t,n,s)=>{const o=_X(e,t);let i=0,r,a=l=>{r||(r=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await o.next();if(u){a(),l.close();return}let d=c.byteLength;if(n){let h=i+=d;n(h)}l.enqueue(new Uint8Array(c))}catch(u){throw a(u),u}},cancel(l){return a(l),o.return()}},{highWaterMark:2})},Ek=64*1024,{isFunction:$m}=Be,DX=(({Request:e,Response:t})=>({Request:e,Response:t}))(Be.global),{ReadableStream:_k,TextEncoder:Rk}=Be.global,Dk=(e,...t)=>{try{return!!e(...t)}catch{return!1}},TX=e=>{e=Be.merge.call({skipUndefined:!0},DX,e);const{fetch:t,Request:n,Response:s}=e,o=t?$m(t):typeof fetch=="function",i=$m(n),r=$m(s);if(!o)return!1;const a=o&&$m(_k),l=o&&(typeof Rk=="function"?(p=>g=>p.encode(g))(new Rk):async p=>new Uint8Array(await new n(p).arrayBuffer())),u=i&&a&&Dk(()=>{let p=!1;const g=new n(Gs.origin,{body:new _k,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),c=r&&a&&Dk(()=>Be.isReadableStream(new s("").body)),d={stream:c&&(p=>p.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(g,v)=>{let C=g&&g[p];if(C)return C.call(g);throw new qt(`Response type '${p}' is not supported`,qt.ERR_NOT_SUPPORT,v)})});const h=async p=>{if(p==null)return 0;if(Be.isBlob(p))return p.size;if(Be.isSpecCompliantForm(p))return(await new n(Gs.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(Be.isArrayBufferView(p)||Be.isArrayBuffer(p))return p.byteLength;if(Be.isURLSearchParams(p)&&(p=p+""),Be.isString(p))return(await l(p)).byteLength},f=async(p,g)=>{const v=Be.toFiniteNumber(p.getContentLength());return v??h(g)};return async p=>{let{url:g,method:v,data:C,signal:S,cancelToken:b,timeout:w,onDownloadProgress:_,onUploadProgress:R,responseType:T,headers:I,withCredentials:x="same-origin",fetchOptions:P}=bk(p),D=t||fetch;T=T?(T+"").toLowerCase():"text";let F=SX([S,b&&b.toAbortSignal()],w),k=null;const O=F&&F.unsubscribe&&(()=>{F.unsubscribe()});let B;try{if(R&&u&&v!=="get"&&v!=="head"&&(B=await f(I,C))!==0){let ne=new n(g,{method:"POST",body:C,duplex:"half"}),L;if(Be.isFormData(C)&&(L=ne.headers.get("content-type"))&&I.setContentType(L),ne.body){const[H,te]=vk(B,Bm(yk(R)));C=Sk(ne.body,Ek,H,te)}}Be.isString(x)||(x=x?"include":"omit");const Z=i&&"credentials"in n.prototype,J={...P,signal:F,method:v.toUpperCase(),headers:I.normalize().toJSON(),body:C,duplex:"half",credentials:Z?x:void 0};k=i&&new n(g,J);let ee=await(i?D(k,P):D(g,J));const X=c&&(T==="stream"||T==="response");if(c&&(_||X&&O)){const ne={};["status","statusText","headers"].forEach(he=>{ne[he]=ee[he]});const L=Be.toFiniteNumber(ee.headers.get("content-length")),[H,te]=_&&vk(L,Bm(yk(_),!0))||[];ee=new s(Sk(ee.body,Ek,H,()=>{te&&te(),O&&O()}),ne)}T=T||"text";let ve=await d[Be.findKey(d,T)||"text"](ee,p);return!X&&O&&O(),await new Promise((ne,L)=>{mk(ne,L,{data:ve,headers:po.from(ee.headers),status:ee.status,statusText:ee.statusText,config:p,request:k})})}catch(Z){throw O&&O(),Z&&Z.name==="TypeError"&&/Load failed|fetch/i.test(Z.message)?Object.assign(new qt("Network Error",qt.ERR_NETWORK,p,k),{cause:Z.cause||Z}):qt.from(Z,Z&&Z.code,p,k)}}},IX=new Map,Tk=e=>{let t=e&&e.env||{};const{fetch:n,Request:s,Response:o}=t,i=[s,o,n];let r=i.length,a=r,l,u,c=IX;for(;a--;)l=i[a],u=c.get(l),u===void 0&&c.set(l,u=a?new Map:TX(t)),c=u;return u};Tk();const gS={http:ZZ,xhr:bX,fetch:{get:Tk}};Be.forEach(gS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ik=e=>`- ${e}`,xX=e=>Be.isFunction(e)||e===null||e===!1;function FX(e,t){e=Be.isArray(e)?e:[e];const{length:n}=e;let s,o;const i={};for(let r=0;r<n;r++){s=e[r];let a;if(o=s,!xX(s)&&(o=gS[(a=String(s)).toLowerCase()],o===void 0))throw new qt(`Unknown adapter '${a}'`);if(o&&(Be.isFunction(o)||(o=o.get(t))))break;i[a||"#"+r]=o}if(!o){const r=Object.entries(i).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=n?r.length>1?`since :
|
|
144
144
|
`+r.map(Ik).join(`
|
|
145
145
|
`):" "+Ik(r[0]):"as no adapter specified";throw new qt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const xk={getAdapter:FX,adapters:gS};function mS(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Vc(null,e)}function Fk(e){return mS(e),e.headers=po.from(e.headers),e.data=pS.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),xk.getAdapter(e.adapter||uf.adapter,e)(e).then(function(s){return mS(e),s.data=pS.call(e,e.transformResponse,s),s.headers=po.from(s.headers),s},function(s){return gk(s)||(mS(e),s&&s.response&&(s.response.data=pS.call(e,e.transformResponse,s.response),s.response.headers=po.from(s.response.headers))),Promise.reject(s)})}const Pk="1.13.2",Hm={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Hm[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Ak={};Hm.transitional=function(t,n,s){function o(i,r){return"[Axios v"+Pk+"] Transitional option '"+i+"'"+r+(s?". "+s:"")}return(i,r,a)=>{if(t===!1)throw new qt(o(r," has been removed"+(n?" in "+n:"")),qt.ERR_DEPRECATED);return n&&!Ak[r]&&(Ak[r]=!0,console.warn(o(r," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,r,a):!0}},Hm.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function PX(e,t,n){if(typeof e!="object")throw new qt("options must be an object",qt.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let o=s.length;for(;o-- >0;){const i=s[o],r=t[i];if(r){const a=e[i],l=a===void 0||r(a,i,e);if(l!==!0)throw new qt("option "+i+" must be "+l,qt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new qt("Unknown option "+i,qt.ERR_BAD_OPTION)}}const Gm={assertOptions:PX,validators:Hm},ur=Gm.validators;let su=class{constructor(t){this.defaults=t||{},this.interceptors={request:new dk,response:new dk}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
146
|
-
`+i):s.stack=i}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=nu(this.defaults,n);const{transitional:s,paramsSerializer:o,headers:i}=n;s!==void 0&&Gm.assertOptions(s,{silentJSONParsing:ur.transitional(ur.boolean),forcedJSONParsing:ur.transitional(ur.boolean),clarifyTimeoutError:ur.transitional(ur.boolean)},!1),o!=null&&(Be.isFunction(o)?n.paramsSerializer={serialize:o}:Gm.assertOptions(o,{encode:ur.function,serialize:ur.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Gm.assertOptions(n,{baseUrl:ur.spelling("baseURL"),withXsrfToken:ur.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=i&&Be.merge(i.common,i[n.method]);i&&Be.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=po.concat(r,i);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,d=0,h;if(!l){const p=[Fk.bind(this),void 0];for(p.unshift(...a),p.push(...u),h=p.length,c=Promise.resolve(n);d<h;)c=c.then(p[d++],p[d++]);return c}h=a.length;let f=n;for(;d<h;){const p=a[d++],g=a[d++];try{f=p(f)}catch(v){g.call(this,v);break}}try{c=Fk.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=u.length;d<h;)c=c.then(u[d++],u[d++]);return c}getUri(t){t=nu(this.defaults,t);const n=wk(t.baseURL,t.url,t.allowAbsoluteUrls);return ck(n,t.params,t.paramsSerializer)}};Be.forEach(["delete","get","head","options"],function(t){su.prototype[t]=function(n,s){return this.request(nu(s||{},{method:t,url:n,data:(s||{}).data}))}}),Be.forEach(["post","put","patch"],function(t){function n(s){return function(i,r,a){return this.request(nu(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}su.prototype[t]=n(),su.prototype[t+"Form"]=n(!0)});let AX=class c${constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(o=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](o);s._listeners=null}),this.promise.then=o=>{let i;const r=new Promise(a=>{s.subscribe(a),i=a}).then(o);return r.cancel=function(){s.unsubscribe(i)},r},t(function(i,r,a){s.reason||(s.reason=new Vc(i,r,a),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new c$(function(o){t=o}),cancel:t}}};function kX(e){return function(n){return e.apply(null,n)}}function OX(e){return Be.isObject(e)&&e.isAxiosError===!0}const vS={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(vS).forEach(([e,t])=>{vS[t]=e});function kk(e){const t=new su(e),n=YA(su.prototype.request,t);return Be.extend(n,su.prototype,t,{allOwnKeys:!0}),Be.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return kk(nu(e,o))},n}const ns=kk(uf);ns.Axios=su,ns.CanceledError=Vc,ns.CancelToken=AX,ns.isCancel=gk,ns.VERSION=Pk,ns.toFormData=Lm,ns.AxiosError=qt,ns.Cancel=ns.CanceledError,ns.all=function(t){return Promise.all(t)},ns.spread=kX,ns.isAxiosError=OX,ns.mergeConfig=nu,ns.AxiosHeaders=po,ns.formToJSON=e=>fk(Be.isHTMLForm(e)?new FormData(e):e),ns.getAdapter=xk.getAdapter,ns.HttpStatusCode=vS,ns.default=ns;const{Axios:s0e,AxiosError:o0e,CanceledError:i0e,isCancel:r0e,CancelToken:a0e,VERSION:l0e,all:u0e,Cancel:c0e,isAxiosError:MX,spread:d0e,toFormData:h0e,AxiosHeaders:f0e,HttpStatusCode:p0e,formToJSON:g0e,getAdapter:m0e,mergeConfig:v0e}=ns,NX=e=>{const n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2){const s=n.pop();return(s==null?void 0:s.split(";").shift())??null}return null},LX=6e4,Ok=e=>({[`/api/v1/workspace/${e}/item/2`]:1,[`/api/v1/workspace/${e}/item/2/metrics`]:5,default:5}),Um=new Map,Mk=e=>{const t=e.match(/\/api\/v1\/workspace\/([^/]+)/);return t?t[1]:null},VX=e=>{const t=Mk(e),n=Ok(t||"none"),o=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&o===a)||"default";Um.has(i)||Um.set(i,{ongoing:0,queue:[]});const r=Um.get(i);return new Promise(a=>{r?r.ongoing<n[i]?(r.ongoing++,a()):r.queue.push(()=>{r.ongoing++,a()}):a()})},Nk=e=>{const t=Mk(e),n=Ok(t||"none"),o=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&o===a)||"default",r=Um.get(i);if(r&&(r.ongoing--,r.queue.length>0)){const a=r.queue.shift();setTimeout(()=>{a==null||a()},1e3)}},BX=(()=>{const e=ns.create({timeout:LX,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(async t=>{const n=t.url||"";await VX(n);const s=NX("account.token");return s&&t.headers&&(t.headers.Authorization=`Bearer ${s}`),t.headers&&(t.headers["Access-Control-Allow-Origin"]="*",t.headers["Access-Control-Allow-Headers"]="*",t.headers["Accept-Language"]="*"),t},t=>Promise.reject(t)),e.interceptors.response.use(t=>(Nk(t.config.url||""),t),async t=>{var s,o,i;if(((s=t.response)==null?void 0:s.status)===401){const r=sessionStorage.getItem("BASE_URL")||"";(()=>{const l=`${r}/start`;window.postMessage({type:"TOKEN_EXPIRED",message:"Authentication token has expired"},"*"),window.location.replace(l)})()}if(t.config&&Nk(t.config.url||""),t.code==="ERR_NETWORK"||!navigator.onLine)return Promise.reject(t);const n=t.config;if(((o=t.response)==null?void 0:o.status)===429&&(!n._retryCount||n._retryCount<3)){n._retryCount=(n._retryCount||0)+1;const r=t.response.headers["retry-after"],a=r?parseInt(r)*1e3:Math.pow(2,n._retryCount)*1e3;return await new Promise(l=>setTimeout(l,a)),e(n)}return((i=t.response)==null?void 0:i.status)===401&&!n._retry&&(n._retry=!0),Promise.reject(t)}),e})();class df extends Error{constructor(t,n,s,o,i){super(t),this.name="ApiError",this.statusCode=n,this.code=s,this.details=o,this.type=i,Object.setPrototypeOf(this,df.prototype)}}const hf=e=>{var t,n;if(MX(e)){const s=(t=e.response)==null?void 0:t.status,o=(n=e.response)==null?void 0:n.data,i=(o==null?void 0:o.message)||e.message||"An unexpected error occurred",r=(o==null?void 0:o.code)||e.code,a=(o==null?void 0:o.details)||o;let l="UNKNOWN";return!s||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":s>=500?l="SERVER":s===Mc.UNAUTHORIZED||s===Mc.FORBIDDEN?l="AUTH":s===Mc.UNPROCESSABLE_ENTITY||s===Mc.BAD_REQUEST?l="VALIDATION":s>=Mc.BAD_REQUEST&&(l="CLIENT"),new df(i,s,r,a,l)}return e instanceof Error?new df(e.message,void 0,void 0,void 0,"UNKNOWN"):new df("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class $X{constructor(){this.axios=BX}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n??""}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([o,i])=>{i!=null&&i!==""&&(Array.isArray(i)?i.forEach(r=>n.append(o,String(r))):typeof i=="object"?n.append(o,JSON.stringify(i)):n.append(o,String(i)))});const s=n.toString();return s?`?${s}`:""}async get(t="",n,s){try{const o=this.buildUrl(t),i=n?this.buildQueryParams(n):"";return(await this.axios.get(`${o}${i}`,s)).data}catch(o){throw hf(o)}}async post(t="",n,s,o){try{const i=this.buildUrl(t),r=n?this.buildQueryParams(n):"";return(await this.axios.post(`${i}${r}`,s,o)).data}catch(i){throw hf(i)}}async put(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.put(o,n,s)).data}catch(o){throw hf(o)}}async patch(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.patch(o,n,s)).data}catch(o){throw hf(o)}}async delete(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.delete(o,{data:n,...s})).data}catch(o){throw hf(o)}}}const HX=({domainApi:e,wsCode:t,entityId:n})=>({list_cursor:{url:`${e}/v1/workspace/${t}/item/2`,method:"post",code:"list_cursor"},assignedUser:{url:`${e}/v1/workspace/${t}/item/2/assigned-users`,method:"post",code:"assignedUser"},metricValues:{url:`${e}/v1/workspace/${t}/item/2/metrics`,method:"post",code:"metricValues"},multipleAssignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"multipleAssignableUser"},assignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"assignableUser"},assignableStatus:{url:`${e}/v1/workspace/${t}/item/2/assignable-statuses`,method:"post",code:"assignableStatus"},delete_rendition:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-rendition`,method:"delete",code:"delete_rendition"},delete_thumbnail:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-thumbnail`,method:"delete",code:"delete_thumbnail"},archive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"archive_item"},unarchive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"unarchive_item"},removeAssignee:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-assignee`,method:"delete",code:"removeAssignee"},basicInfor:{url:`${e}/v1/workspace/${t}/tile/people/ws-user-roles/{userId}/basic-info`,method:"get",code:"basicInfor"},bulkDelete:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete`,method:"delete",code:"bulkDelete"},bulkArchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkArchive"},bulkDateUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-date-update`,method:"put",code:"bulkDateUpdate"},bulkAssignUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-assignee-update`,method:"put",code:"bulkAssignUpdate"},bulkStatusUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-status-update`,method:"put",code:"bulkStatusUpdate"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"},getPermission:{url:`${e}/v1/workspace/${t}/item/2/permissions`,method:"post",code:"getPermission"},getUserPermission:{url:`${e}/v1/workspace/${t}/permissions`,method:"get",code:"getUserPermission"},bulkUnarchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkUnarchive"},downloadTemplate:{url:`${e}/v1/workspace/${t}/item/2/download-sample`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/v1/workspace/${t}/item/2/import-from-file`,method:"post",code:"importItems"},exportItems:{url:`${e}/v1/workspace/${t}/item/2/export`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/v1/workspace/${t}/item/2/update-from-file`,method:"post",code:"updateFromFile"},metricList:{url:`${e}/workspace/${t}/entities/${n}/metric`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/v1/workspace/${t}/item/2/update`,method:"put",code:"item"},me:{url:`${e}/v1/me`,method:"get",code:"me"},workspaces:{url:`${e}/v1/workspaces`,method:"get",code:"workspaces"},entityUserRoles:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"entityUserRoles"},templateFlowStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"templateFlowStatuses"},createNewItem:{url:`${e}/v1/workspace/${t}/item/2/new?entity_id=${n}`,method:"post",code:"createNewItem"},getAssignableStatuses:{url:`${e}/v1/workspace/${t}/entity/2/assignable-statuses`,method:"get",code:"getAssignableStatuses"},getAssignableAssignees:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"getAssignableAssignees"},getFilterStatuses:{url:`${e}/v1/workspace/${t}/entity/2/statuses`,method:"get",code:"getFilterStatuses"}}),GX=(e,t)=>{const n=new Blob([e]),s=globalThis.URL.createObjectURL(n),o=document.createElement("a");o.href=s,o.download=t,document.body.appendChild(o),o.click(),o.remove(),globalThis.URL.revokeObjectURL(s)};class Lk extends $X{constructor(t,n){const s=n==null?void 0:n.domainApi,o=n==null?void 0:n.wsCode,i=(n==null?void 0:n.entityId)||"";super(),this.events=Object.create(null);const r=HX({domainApi:s,wsCode:o,entityId:i}),a={};Object.entries(r).forEach(([l,u])=>{const c=l;t[c]?a[c]=t[c]:(console.warn(`API config for ${c} is missing, using base config.`),a[c]=u)}),this.apiConfig=a}on(t,n){var s;((s=this.events)[t]??(s[t]=[])).push(n)}off(t,n){const s=this.events[t];s&&(this.events[t]=s.filter(o=>o!==n))}emit(t,...n){const s=this.events[t];s!=null&&s.length&&s.forEach(o=>{try{o(...n)}catch(i){console.error(`Error in event listener for ${t}:`,i)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:s,payload:o,code:i,responseType:r}){var u,c;const a=this.buildHeaders(o);let l;try{if(l=await this.axios.request({method:t,url:n,params:s,data:o,headers:a,responseType:r}),(((u=l.headers)==null?void 0:u["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const h=((c=l.headers)==null?void 0:c["content-disposition"])||"",f=h.includes("filename=")?h.split("filename=")[1]:"exported_items.xlsx";GX(l.data,f)}if(l.status>=400&&l.status<=500)throw new Error(`Client error (${l.status}): ${l.statusText}`);return this.emit("call-api",{apiCode:i,path:n,params:s,payload:o,res:l,success:!0}),l.data}catch(d){throw console.error("API Request Error:",d),d.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:s,payload:o,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:s,payload:o,error:d,success:!1,apiCode:i,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let s=t;return Object.entries(n).forEach(([o,i])=>{s=s.replace(`{${o}}`,String(i))}),s}async request(t,n,s={}){const{url:o,code:i,method:r}=this.apiConfig[t],a=this.generateUrl(o,n);return this._requestHandler({method:r,path:a,params:s.params,payload:s.payload,code:i,responseType:s.responseType})}async getAllItem_cursor(t){var i;const n=t.workspaceId,s={entity_ids:((i=t.entityIds)==null?void 0:i.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,search:t.search||t.q||void 0,include_signature:1,include:"last_updated_by,property,last_completed_by",include_permission:"{include_permission}",assignee_any_ina:(t==null?void 0:t.assignee_any_ina)||"",assignee_all_ina:(t==null?void 0:t.assignee_all_ina)||void 0,with_not_assigned:t.with_not_assigned||void 0,status_ina:t.status_ina||void 0,status_eq:t.status_eq||void 0,start_date_gte:t.start_date_gte||void 0,start_date_lte:t.start_date_lte||void 0,start_date_btw:t.start_date_btw||void 0,due_date_gte:t.due_date_gte||void 0,due_date_lte:t.due_date_lte||void 0,due_date_btw:t.due_date_btw||void 0,condition_combine_type:t.condition_combine_type||"or",preflight_status:t.preflight_status||void 0},o=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:s,payload:{sort_by:o}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},s={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:s,payload:n})}async getMetricList({workspaceId:t,entityId:n,page:s,query:o,per_page:i}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:i||100,page:s||1,name_like:o||void 0}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:s,metric_ids:o}){const i={item_ids:n,metric_ids:o};return this.request("metricValues",{workspaceId:t},{params:{per_page:s,include_permission:1},payload:i})}async multipleAssignableUser(t){const n=t.workspaceId,s=t.itemIds,o={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:s||[]};return this.request("multipleAssignableUser",{workspaceId:n},{payload:o})}async getAssignableStatus(t){const n=t.workspaceId,s={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return this.request("assignableStatus",{workspaceId:n||""},{payload:s})}async updateSceneName({workspaceId:t,entityId:n,itemId:s,name:o}){const i={item_id:s,entity_id:n,name:o,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:s},{payload:i})}async deleteScene(t,n,s){const o={item_ids:[s]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:o})}async deleteThumbnail({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("delete_thumbnail",{workspaceId:t},{payload:o})}async deleteRendition({workspaceId:t,itemIds:n,deleteAll:s=!1,entityId:o}){const i={item_ids:n,delete_all:s?1:void 0,entity_id:o};return!n||n.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:i})}async archiveScene(t,n,s){const o={item_ids:s,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:o})}async changeDate({workspaceId:t,itemIds:n,startDate:s,dueDate:o,entityId:i,filterParams:r}){const a={item_ids:n,start_date:s,due_date:o,entity_id:i};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:r})}async updateAssignee(t){const{workspaceId:n,itemIds:s,userIds:o,entityId:i}=t,r={item_ids:s,ws_user_role_ids:o,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:s,entityId:o}=t,i={item_ids:n,ws_user_role_ids:s,entity_id:o};return!n||n.length===0?(i.item_ids=void 0,i.entity_id=o):(i.item_ids=n,i.entity_id=void 0),i}async removeAssignee(t){const n=this.createUpdateEntityPayload(t);return this.request("removeAssignee",{workspaceId:t.workspaceId},{payload:n,params:t.filterParams})}async replaceAssignee(t){const{workspaceId:n,itemIds:s,userIds:o,entityId:i}=t,r={item_ids:s,ws_user_role_ids:o,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:r})}async addAssignee({workspaceId:t,itemIds:n,userIds:s,entityId:o,filterParams:i}){const r={item_ids:n,ws_user_role_ids:s,entity_id:o};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:r,params:i})}async unAssignAll(t){const{workspaceId:n,entityId:s,itemIds:o,filterParams:i}=t,r={item_ids:o,entity_id:s,ws_user_role_ids:[]};return!o||o.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(s)},{payload:r,params:i})}async updateItemStatus(t){const{workspaceId:n,itemIds:s=[],statusId:o,entityId:i}=t,r={item_ids:s,template_flow_status_id:o};return s.length||(r.item_ids=void 0,r.entity_id=i),this.request("bulkStatusUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkDelete",{workspaceId:t},{payload:o})}async bulkUnarchiveItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,status:1,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkUnarchive",{workspaceId:t},{payload:o})}async bulkArchiveItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,status:0,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkArchive",{workspaceId:t},{payload:o})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:s,metricId:o,value:i,clear:r}=t,a={item_ids:s,metric_id:o,metric_value:i,clear:r??(i==null?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete a.item_ids,a.entity_id=String(t.entityId)):(a.item_ids=s,a.entity_id=void 0),this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams})}async getPermissionForItems({workspaceId:t,itemIds:n}){const s={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:s,params:{per_page:50}})}async unarchiveScene(t,n,s){const o={item_ids:s,status:1};return this.request("unarchive_item",{workspaceId:t,entityId:n},{payload:o})}async getUserPermission(t){return this.request("getUserPermission",{workspaceId:t})}async getEntityDetail(t,n){return this.request("getEntityDetail",{workspaceId:t,entityId:n})}async downloadTemplate(t,n){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async downloadExportedItemsFile(t,n){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async addNewSceneViaImportFile(t,n,s){return this.request("importItems",{workspaceId:t,entityId:n},{payload:s})}async overwriteScenesViaImportFile(t,n,s){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:s})}async getMe(){return this.request("me",{})}async getWorkspaces(t){const n={page:1,per_page:1,"ws_user_role>status_eq":1,include:"owner",include_ws:t};return this.request("workspaces",{},{params:n})}async getEntityUserRoles(t){const{workspaceId:n,page:s,per_page:o,display_name_like:i,entity_ids:r}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:s,per_page:o,display_name_like:i,entity_ids:r}})}async getTemplateFlowStatuses(t){const{workspaceId:n,entityId:s}=t;return this.request("templateFlowStatuses",{workspaceId:n,entityId:s},{params:{per_page:100,page:t.page??1,all:1,name_like:t.name_like}})}async addNewItem(t,n,s){return this.request("createNewItem",{workspaceId:t,entityId:n},{payload:s})}async getFilterStatuses(t,n,s){return this.request("getFilterStatuses",{workspaceId:t,entityId:n},{params:s})}async getAssignableStatuses(t,n){return console.log("getAssignableStatuses options",n),this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return console.log("getAssignableAssignees options",n),this.request("getAssignableAssignees",{workspaceId:t},{params:n})}}const UX=(e,t,n,s,o,i,r)=>{const{apiServices:a}=ts(n,s),l=V(!1),u=()=>{l.value=!0},c=()=>{mt(()=>{setTimeout(()=>{l.value=!1},500)})},d=Y(()=>!!(o!=null&&o.value&&(i!=null&&i.value))),h=_n("filterParams",null);return{isUpdating:l,handleUpdate:async p=>{var v;const g=p.value;u();try{const C={itemIds:e.value.itemIds,metricId:p.id,workspaceId:String(e.value.workspaceId),filterParams:h!=null&&h.value?h.value:void 0};p.value==null?C.clear=1:C.value=g,d.value?(delete C.itemIds,C.entityId=String(s.entityId)):C.itemIds=e.value.itemIds;const S=await((v=a.value)==null?void 0:v.bulkUpdateMetric(C));(S==null?void 0:S.message)=="Done"&&t(p)}catch(C){console.error("Error during bulk metric update:",C)}c()}}},WX=_t(rt({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{},disabled:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=zA(),s=V([]),o=e,i=t,r=V([]),a=V(null),l=J=>{var ve,ne,L;const ee=s.value.findIndex(H=>H.id===J.id);a.value=ee;const X=(ve=r.value[ee])==null?void 0:ve.$el;(ne=_.value)==null||ne.scrollTo(ee*30),X&&X.scrollIntoView({behavior:"smooth",block:"center"}),u(ee),(L=r.value[ee])==null||L.show()},u=J=>{a.value=J,r.value.forEach((ee,X)=>{X!==J&&ee&&ee.hide()})},c=V(""),d=()=>{c.value="",r.value.forEach(J=>{J==null||J.hide()}),a.value=null},h=Y(()=>o.selectedIds||[]),f=Y(()=>({itemIds:h.value,workspaceId:String(o.workspaceId)})),p=_n("isSelectAll",V(!1)),g=_n("bulkUpdate",V(!1)),v=V(null),{handleUpdate:C,isUpdating:S}=UX(f,J=>{var ee;i("update",J),d(),(ee=v.value)==null||ee.hide()},!1,o,g,p),b=async J=>{var ee;i("update-start");try{await C(J),i("update-completed")}catch{i("update-failed"),(ee=v.value)==null||ee.open()}},w=J=>{d(),mt(()=>{var ee;(ee=_.value)==null||ee.focus()})},_=V(null),R=(J,ee)=>{var X;J?(X=_.value)==null||X.focus():d(),J&&ee!==J&&Z("")},T=V(!0),I=V(!0),{apiServices:x}=ts(!1,o),P=async(J,ee,X)=>{var ve;try{return X?I.value=!0:T.value=!0,await((ve=x.value)==null?void 0:ve.getMetricList({workspaceId:o.workspaceId||"",entityId:o.entityId||"",page:J,query:ee,per_page:10}))}catch(ne){throw console.error("Failed to fetch metric list:",ne),ne}finally{T.value=!1,I.value=!1}},D=V(0),F=V(!0),k=J=>({id:String(J.id),label:String(J.name),value:String(J.id),description:J.morpheme_value?`${String(J.morpheme_value)}`:"",type:n.checkEditType(J),metricConfig:J}),O=J=>J.filter(ee=>!ee.formula).filter(ee=>{var X;return((X=ee==null?void 0:ee.auth_permission)==null?void 0:X.permission)==2}).map(k),B=async()=>{D.value+=1;const J=await P(D.value,c.value,!0);if(J&&J.data){const ee=O(J.data);s.value=[...s.value,...ee],F.value=J.meta.last_page!=J.meta.current_page}else F.value=!1},Z=async J=>{c.value=J,D.value=1;try{const ee=await P(D.value,c.value);ee&&ee.data?(s.value=O(ee.data),F.value=ee.meta.last_page!=ee.meta.current_page):s.value=[]}catch{s.value=[]}};return(J,ee)=>(j(),qe(sf,{ref_key:"wrapperRef",ref:v,isUpdating:U(S),disabled:o.disabled||U(S),onOnVisibleChange:R},{trigger:ge(({hide:X,disabled:ve})=>[fe(vt,{variant:o.variant,loading:U(S),disabled:ve,onEscape:X},{default:ge(()=>[fe(lt,{src:"SquareRootVariable",class:"icon"}),ee[1]||(ee[1]=nt(" Metric ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ge(({isVisible:X,popupRef:ve,hide:ne})=>[Ke(fe(Jr,{ref_key:"searchListRef",ref:_,style:{width:"320px"},options:s.value,loading:T.value,"loading-more":I.value,"selected-id":void 0,"has-more":F.value,onSearch:Z,onSelect:l,onLoadMore:ee[0]||(ee[0]=()=>B()),onCancel:ne},{item:ge(({item:L,index:H,selectedIndex:te})=>[fe(dZ,{ref:he=>r.value[H]=he,label:L.label,type:L.type,morpheme:L.description||"",onFocusOnSearch:w,onOpen:he=>u(H),attachTo:ve,config:L.metricConfig,onHandleUpdate:b,class:Q(["metric-update-item",{selected:a.value===H||te===H}])},null,8,["label","type","morpheme","onOpen","attachTo","config","class"])]),"extra-item":ge(()=>[...ee[2]||(ee[2]=[Re("div",{style:{width:"250px"}},null,-1)])]),"empty-list":ge(()=>[...ee[3]||(ee[3]=[nt("No options available.",-1)])]),_:2},1032,["options","loading","loading-more","has-more","onCancel"]),[[jo,X]])]),default:ge(()=>[ee[4]||(ee[4]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),[["__scopeId","data-v-f5df50e8"]]),Wm=Ql("bulkUpdate",()=>{const e=V(Mt.UNCHECK),t=ao({loaded:0,total:0}),n=c=>{t.total=c},s=c=>{t.loaded=c},o=ao({isBulkUpdating:!1});function i(c){o.isBulkUpdating=c}const r=V({}),a=c=>{r.value=c},l=(c,d)=>{r.value[c]=d},u=c=>{e.value=c};return{bulkUpdateState:o,setIsBulkUpdating:i,selectionIds:r,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:u,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:s,handelSelectAll:()=>{u(Mt.CHECKED)}}}),zX={class:"status-label"},Vk=_t(rt({__name:"StatusItem",props:{status:{},selected:{type:Boolean},focused:{type:Boolean},hovered:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=Jt,s=e,o=t,i=a=>{o("select",a)},r=a=>new Nn(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(j(),ue("div",{class:Q(["status-option",{selected:s.selected,focused:s.focused,hovered:s.hovered}]),onClick:l[0]||(l[0]=u=>i(e.status.id))},[Re("div",{class:"status-color",style:dn({backgroundColor:e.status.color,borderColor:r(e.status.color)})},null,4),Ke((j(),ue("div",zX,[Tt(a.$slots,"label",{},()=>[nt(Ct(e.status.name),1)],!0)])),[[U(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-aeaa75a4"]]),jX=["innerHTML"],Bk=_t(rt({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},callback:{type:Function}},emits:["updated","error","cancel","start-update","finish-update"],setup(e,{expose:t,emit:n}){const s={PER_PAGE:50,INITIAL_PAGE:1},o=e,i=n,r=V([]),a=V(!1),l=V(!1),u=V(null),c=V(s.INITIAL_PAGE),d=V(!0),h=V(0),f=V(""),p=Y(()=>{var O;return(O=o.value)==null?void 0:O.id}),g=Y(()=>!!(o.id||o.ids&&o.ids.length>0)),v=O=>({label:O.name,value:O.id,selected:p.value===O.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:O,id:O.id,color:O.color}),C=Y(()=>{const O=new Set;return o.id&&O.add(String(o.id)),o.ids&&o.ids.forEach(B=>{B&&O.add(String(B))}),Array.from(O)}),S=_n("bulkUpdate",!1),{apiServices:b}=ts(!S,o),w=Wm(),{selectionStatus:_}=Qs(w),R=_n("filterParams",null),T=async(O=s.INITIAL_PAGE,B="",Z=!1)=>{var J,ee,X,ve;if(!g.value){console.error("Missing required props",o);return}Z?l.value=!0:a.value=!0,u.value=null;try{const ne={workspaceId:String(o.workspaceId),itemIds:C.value,page:O,perPage:s.PER_PAGE,name_like:B.trim(),...R||{}};if(((J=b.value)==null?void 0:J.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const L=await((ee=b.value)==null?void 0:ee.getAssignableStatus(ne));if(!(L!=null&&L.data)){Z||(r.value=[]),d.value=!1;return}const H=L.data.map(v);r.value=Z?[...r.value,...H]:H,h.value=((X=L.meta)==null?void 0:X.total)??L.data.length,d.value=!((ve=L.meta)!=null&&ve.on_last_page),c.value=O}catch(ne){console.error("Error fetching statuses:",ne),u.value="Failed to load statuses",Z||(r.value=[]),d.value=!1,i("error",u.value)}finally{a.value=!1,l.value=!1}},I=Di(async O=>{f.value=O,c.value=s.INITIAL_PAGE,await T(s.INITIAL_PAGE,O,!1)},rr),x=async()=>{!d.value||l.value||await T(c.value+1,f.value,!0)},P=()=>{var O;i("cancel"),(O=o.params)==null||O.api.stopEditing()},D=async O=>{var B,Z,J;if(!g.value){console.error("Missing required props for updating status",o);return}try{const ee={workspaceId:String(o.workspaceId),itemIds:C.value,statusId:String(O.value),entityId:String(o.entityId),filterParams:R!=null&&R.value?R==null?void 0:R.value:void 0};if(_.value==Mt.CHECKED&&S&&(ee.itemIds=void 0,ee.entityId=String(o.entityId)),i("start-update"),!await b.value.updateItemStatus(ee))throw new Error("Status update failed: empty response");const ve={workspaceId:String(o.workspaceId),itemIds:C.value,data:{id:O.id,name:O.label,color:O.color}};i("updated",ve),o.params&&((Z=o.params)==null||Z.node.setData({...(B=o.params)==null?void 0:B.node.data,status:{id:O.id,name:O.label,color:O.color}}),(J=o.params)==null||J.api.stopEditing()),i("finish-update")}catch(ee){console.error("Error updating status:",ee),u.value="Failed to update status",i("error",u.value)}},F=Y(()=>r.value.map(O=>({...O})));et([()=>o.id,()=>o.workspaceId,()=>o.ids],()=>{T()},{deep:!0,immediate:!0});const k=V(null);return nn(()=>{mt(()=>{var O;(O=k.value)==null||O.focus()})}),t({refresh:()=>T(s.INITIAL_PAGE,f.value,!1),loadMore:x,focus:()=>{var O;return(O=k.value)==null?void 0:O.focus()}}),(O,B)=>{var Z;return j(),qe(Jr,Xt({ref_key:"popupRef",ref:k},o,{"selected-id":(Z=o.value)==null?void 0:Z.id,options:F.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:u.value,onSearch:U(I),onSelect:D,onLoadMore:x,onCancel:P,onClose:P}),{item:ge(({item:J,selectedIndex:ee,isSelected:X,handleItemHover:ve,getHighlightedLabel:ne,query:L,idx:H})=>[(j(),qe(Vk,{key:J.value,status:J.data,selected:X(J),onMouseover:te=>ve(H),onSelect:te=>D(J),hovered:H===ee},{label:ge(()=>[L?(j(),ue("span",{key:0,class:Q([O.$style["item-label"],O.$style.match]),style:{flex:"1"},innerHTML:ne(J.label)},null,10,jX)):(j(),ue("span",{key:1,class:Q(O.$style["item-label"]),style:{flex:"1"}},Ct(J.label),3))]),_:2},1032,["status","selected","onMouseover","onSelect","hovered"]))]),_:1},16,["selected-id","options","loading","loading-more","has-more","error","onSearch"])}}}),[["__cssModules",{$style:{"item-label":"_item-label_7ir12_1"}}]]),KX=rt({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},disabled:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e,s=Y(()=>{const f=Yn();return f==null?void 0:f.appContext.config.globalProperties.apiServices}),o=t,i=V(!1),r=V(null),a=f=>{i.value=!1,o("updated",f)},l=Y(()=>({apiServices:s.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId}));Zi("bulkUpdate",!0);const u=f=>{var p,g;console.log("Update completed with success:",f),i.value=!1,f?(o("update-completed"),(p=r.value)==null||p.destroy()):(o("update-failed"),(g=r.value)==null||g.open())},c=V(null),d=(f,p)=>{var g;f&&((g=c.value)==null||g.focus())},h=()=>{var f;(f=r.value)==null||f.hide(),i.value=!0,o("update-start")};return et(()=>n.ids,()=>{var f;(f=r.value)==null||f.destroy()}),(f,p)=>(j(),qe(sf,{ref_key:"wrapperRef",ref:r,isUpdating:i.value,disabled:n.disabled||i.value,onOnVisibleChange:d},{trigger:ge(({hide:g,disabled:v})=>[fe(vt,{variant:n.variant,loading:i.value,disabled:v,onEscape:g},{default:ge(()=>[fe(lt,{src:"Square",class:"icon"}),p[2]||(p[2]=nt(" Status ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ge(({hide:g})=>[fe(Bk,Xt({disabled:i.value,ref_key:"statusRef",ref:c},l.value,{onUpdated:a,onCancel:g,onStartUpdate:h,onFinishUpdate:p[0]||(p[0]=v=>u(!0)),onError:p[1]||(p[1]=v=>u(!1)),callback:()=>{}}),null,16,["disabled","onCancel"])]),default:ge(()=>[p[3]||(p[3]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),$k=_t(rt({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0},focusableIndex:{}},emits:["actionExecuted"],setup(e,{expose:t,emit:n}){const s=Ur,o=e,i=Y(()=>(o==null?void 0:o.workspaceId)||""),r=Y(()=>(o==null?void 0:o.entityId)||""),a=()=>{var O,B,Z;return(Z=(O=o.params)==null?void 0:O.api)==null?void 0:Z.getCellRendererInstances({columns:["options"],rowNodes:(B=o.params)!=null&&B.node?[o.params.node]:[]})[0]},l=()=>{var B,Z,J,ee;const O=a();(Z=(B=O==null?void 0:O.componsenExposed)==null?void 0:B.blur)==null||Z.call(B),(ee=(J=O==null?void 0:O.container)==null?void 0:J.parentElement)==null||ee.classList.remove("ag-cell-focus")},u=()=>{var Z,J,ee;(J=(Z=o.params)==null?void 0:Z.api)==null||J.stopEditing(),l();const O=`scene-name-${o.id}`,B=document.getElementById(O);(ee=B==null?void 0:B.__sceneNameEditor)==null||ee.startEdit()},{apiServices:c}=ts(!0,o),d=Y(()=>{var O;return{ws_code:i.value,entity_id:r.value,scene_id:o.id,axiosService:c,optionBlock:o.optionBlock,permissions:(O=o.data)==null?void 0:O.permissions}}),h=O=>{var Z,J,ee,X,ve,ne;let B=(J=(Z=o.params)==null?void 0:Z.api)==null?void 0:J.getRowNode(String(o.id));if(B){const L={...B.data,isDeleted:O==="deleted",isArchived:O==="archived"?!0:B.data.isArchived,isLocked:O==="locked"?!0:B.data.isLocked,disabled:!1};O=="deleted"&&(L.isLocked=!1,L.disabled=!0),O=="unarchived"&&(L.isArchived=!1),(X=(ee=o.params)==null?void 0:ee.api)==null||X.redrawRows({rowNodes:[B]}),B.setData(L),(ne=(ve=o.params)==null?void 0:ve.api)==null||ne.redrawRows({rowNodes:[B]})}},f=tf(),{openSceneHub:p}=f,g=()=>{mt(()=>{var Z,J,ee,X,ve,ne;const O=((J=(Z=o.params)==null?void 0:Z.node)==null?void 0:J.rowIndex)||0,B=((X=(ee=o.params)==null?void 0:ee.column)==null?void 0:X.getColId())||"";(ne=(ve=o.params)==null?void 0:ve.api)==null||ne.setFocusedCell(O,B)})};Y(()=>{var B,Z;const O=(Z=(B=o.params)==null?void 0:B.api)==null?void 0:Z.getRowNode(String(o.id));return O==null?void 0:O.data});const{options:v}=pY(d,h,u,p,g),C=n,S=()=>{var O,B,Z,J,ee,X;console.trace("Focusing current cell for row:",o.id),(X=(O=o.params)==null?void 0:O.api)==null||X.setFocusedCell(((Z=(B=o.params)==null?void 0:B.node)==null?void 0:Z.rowIndex)||0,((ee=(J=o.params)==null?void 0:J.column)==null?void 0:ee.getColId())||"")},b=Y(()=>{var O;return(O=o.params)==null?void 0:O.api}),w=(O,B)=>{var Z,J,ee,X,ve,ne,L,H;if(C("actionExecuted",O),O.id=="copy-link"){(ve=b.value)==null||ve.startEditingCell({rowIndex:(J=(Z=o.params)==null?void 0:Z.node)==null?void 0:J.rowIndex,colKey:(X=(ee=o.params)==null?void 0:ee.column)==null?void 0:X.getColId()});return}else{if(O.id!=="copy-link"&&((ne=b.value)==null||ne.stopEditing()),O.id==="rename")(L=b.value)==null||L.stopEditing(),(H=b.value)==null||H.clearFocusedCell(),l();else if(O.id==="copy-link"){const te=document.getElementById(B);setTimeout(()=>{var he,me,re;(re=(me=(he=te==null?void 0:te.__vueParentComponent)==null?void 0:he.exposed)==null?void 0:me.focus)==null||re.call(me)},300)}else if(["delete-rendition","delete-thumbnail"].includes(O.id)){setTimeout(()=>{S()},300);return}setTimeout(()=>{var te,he;(he=(te=o.params)==null?void 0:te.api)==null||he.clearFocusedCell()},300)}},_=()=>{var O,B;(B=(O=o.params)==null?void 0:O.api)==null||B.stopEditing()},R=O=>{var B,Z,J,ee;return O==="archive"?!((Z=(B=o.params)==null?void 0:B.data)!=null&&Z.isArchived):O==="unarchive"?(ee=(J=o.params)==null?void 0:J.data)==null?void 0:ee.isArchived:!0},T=Y(()=>v.value.map(O=>({...O,options:O.options.filter(B=>!B.hide&&R(B.id))})).filter(O=>O.options.length>0)),I=V({}),x=V(null),P=Y(()=>{var B,Z;if(o.focusableIndex)return o.focusableIndex;const O=(Z=(B=o.params)==null?void 0:B.api)==null?void 0:Z.getRowNode(String(o.id));return`${((O==null?void 0:O.rowIndex)??0)+10}`}),D=(O,B)=>`${P.value}.${O*10+B}`,F=(O,B)=>{if(B&&"focus"in B){I.value[O]=B;return}delete I.value[O]},k=O=>{O.preventDefault(),O.stopPropagation(),O.stopImmediatePropagation()};return nn(()=>{var O;(O=x.value)==null||O.focus()}),t({focus(){var Z;const O=`${P.value}.0`,B=I.value[O];B&&B.focus?B.focus():(Z=x.value)==null||Z.focus()}}),(O,B)=>Ke((j(),ue("div",{onKeydown:k,class:Q([O.$style["more-option-section"],{[O.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:x,tabindex:"0",role:"menu"},[(j(!0),ue(xt,null,xn(T.value,(Z,J)=>(j(),ue("div",{key:Z.id,style:dn({"--g-number":Math.min(Z.options.length,4),"--g-size":Z.type==="column"?"36px":"auto"}),class:Q([O.$style["option-block"],O.$style[Z.type]])},[(j(!0),ue(xt,null,xn(Z.options,(ee,X)=>(j(),ue("div",{key:ee.id,class:Q(O.$style["option-item"])},[fe(YX,{layer:o.layer,"scene-id":String(o.id),option:ee,type:Z.type,onActionExecuted:ve=>w(ve,`more-action-${ve.id}-${o.id}`),focusableIndex:D(J,X),ref_for:!0,ref:ve=>F(D(J,X),ve),onHandleHide:_,id:`more-action-${ee.id}-${o.id}`,label:ee.label},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id","label"])],2))),128))],6))),128))],34)),[[U(s),P.value]])}}),[["__cssModules",{$style:{"more-option-section":"_more-option-section_1jg4p_1","option-block":"_option-block_1jg4p_8","option-item":"_option-item_1jg4p_15",row:"_row_1jg4p_19",column:"_column_1jg4p_25",block:"_block_1jg4p_29"}}]]),qX={key:0,style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center"}},YX=_t(rt({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const s=Ur,o=Jt,i=e,r=V(!1),a=V(!1),l=(I,x)=>{if(!x){p();return}const P=x.target;P.closest(".tippy-content")||P.closest(".tippy-box")||P.closest("[data-tippy-root]")||P.closest(".option-item")||p()},u=V(null),{triggerRef:c,popupRef:d,show:h,isVisible:f,hide:p}=Fs({toggleOnClick:!0,interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:l,appendTo:u.value||void 0}),g=n,v=async I=>{var x,P;if(!a.value){a.value=!0;try{await((P=(x=i.option).action)==null?void 0:P.call(x,I)),g("actionExecuted",i.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1,r.value=!1}}},C=async I=>{var x,P;if(I.preventDefault(),I.stopPropagation(),!a.value){if(i.option.isDanger){r.value=!r.value;return}if(i.option.subMenu)h();else{a.value=!0;try{await((P=(x=i.option).action)==null?void 0:P.call(x,I)),g("actionExecuted",i.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1}return}}},S=I=>{g("actionExecuted",I),p()},b=I=>{I.key==="Escape"&&p()},w=I=>({row:"small",column:"medium",block:"small"})[I]||"medium",_=I=>{const x=i.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...x],column:["menu-item",...x],block:["secondary",...x]}[I]||[]},R=()=>{r.value?r.value=!1:f.value?p():g("handleHide")};t({focus:()=>{mt(()=>{c.value instanceof HTMLElement?c.value.focus():c.value&&"$el"in c.value?c.value.$el.focus():console.warn("Trigger ref is not an HTMLElement:",c.value)})},escape:()=>{p()},select:()=>{C(new MouseEvent("click"))}});const T=I=>{var x;I.stopPropagation(),I.preventDefault(),r.value=!1,(x=c.value)==null||x.focus()};return(I,x)=>{var P;return Ke((j(),ue("div",{ref_key:"wrapperRef",ref:u,class:Q(I.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:Pt(C,["stop","prevent"])},[Ke((j(),qe(vt,{ref_key:"triggerRef",ref:c,class:Q(I.$style["option-item"]),disabled:e.option.disabled||a.value,actived:U(f)||r.value,size:w(e.type),variant:_(e.type),onClick:Pt(C,["stop","prevent"]),onKeydown:b,onEscape:R,label:e.option.label},{prefix:ge(()=>[e.option.icon?(j(),ue("div",qX,[fe(lt,{size:"14",src:e.option.icon,color:e.option.isDanger?void 0:"#a6a6a6",source:"remote"},null,8,["src","color"])])):Je("",!0)]),suffix:ge(()=>[e.option.subMenu?(j(),qe(lt,{key:0,src:"Play",source:"remote"})):Je("",!0),e.option.isDanger&&r.value?(j(),ue("div",{key:1,class:Q(I.$style["confirm-action"])},[Ke((j(),qe(vt,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:T},{default:ge(()=>[fe(lt,{src:"XMarkSolid",source:"remote"})]),_:1})),[[U(s),`${i.focusableIndex}.0`],[U(o),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((j(),qe(vt,{variant:["danger","primary","icon"],size:"small",onClick:Pt(v,["stop","prevent"]),onEscape:x[0]||(x[0]=D=>r.value=!1)},{default:ge(()=>[fe(lt,{src:"Check",source:"remote"})]),_:1})),[[U(s),`${i.focusableIndex}.1`],[U(o),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Je("",!0)]),_:1},8,["class","disabled","actived","size","variant","label"])),[[U(s),i.focusableIndex]]),e.option.subMenu?(j(),ue("div",{key:0,ref_key:"popupRef",ref:d,class:Q(I.$style["submenu-container"])},[fe($k,{focusableIndex:i.focusableIndex,layer:i.layer+1,ref:"submenuRef","option-block":[((P=e.option)==null?void 0:P.subMenu)||[]],"is-submenu":!1,onActionExecuted:S},null,8,["focusableIndex","layer","option-block"])],2)):Je("",!0)],2)),[[U(o),{content:e.option.description,contentClass:["extra-padding"],theme:e.option.isDanger?"warning":"arbo",hideOnClick:!1,delay:[300,0]}]])}}}),[["__cssModules",{$style:{"option-item":"_option-item_8a5qn_1","icon-wrapper":"_icon-wrapper_8a5qn_11","confirm-action":"_confirm-action_8a5qn_19"}}]]),ZX={style:{"max-width":"225px","line-height":"14px"}},XX={style:{"max-width":"100px","line-height":"14px"}},JX=_t(rt({__name:"BulkUpdate",props:{selectRowData:{},workspaceId:{},entityId:{},gridApi:{},selectedAll:{type:Boolean},takeName:{},totalRows:{},visibleRows:{},loading:{type:Boolean}},emits:["close","assignStatus","assignAssignee","assignDate","assignMetric","moreActions","deleteSelected","unselect","updated","selectAll"],setup(e,{emit:t}){const n=Jt,s=Ur,o=e,i=t,r=Wm(),{handelSelectAll:a}=r,{selectionStatus:l}=Qs(r),u=Y(()=>l.value===Mt.CHECKED),c=Y(()=>o.selectRowData.map(me=>me.id)),d=Y(()=>o.selectRowData.length>0);Zi("bulkUpdate",d),Zi("isSelectAll",u);const h=({itemIds:me,data:re})=>{const oe=o.gridApi;me.forEach(z=>{if(!oe){console.error("Grid API is undefined");return}const pe=oe.getRowNode(z);if(pe){const ie={...pe.data,status:re};pe.setData(ie)}})},f=Y(()=>o.selectRowData),p=({itemIds:me,data:re})=>{const oe=o.gridApi;if(!oe){console.error("Grid API is undefined");return}me.forEach(z=>{const pe=oe.getRowNode(z);if(pe){const ie=pe.data.dateRange||[null,null];"startDate"in re&&re.startDate!==void 0&&(ie[0]=re.startDate?new Date(re.startDate):null),"dueDate"in re&&re.dueDate!==void 0&&(ie[1]=re.dueDate?new Date(re.dueDate):null);const be={...pe.data,dateRange:ie};pe.setData(be)}}),i("updated")},g=Y(()=>o.selectRowData.map(me=>me.id)),v=me=>{const re=o.gridApi,{id:oe,value:z}=me;if(!re){console.error("Grid API is undefined");return}g.value.forEach(pe=>{const ie=re.getRowNode(pe);if(ie){const be={...ie.data,[`metric_${oe}`]:z};ie.setData(be)}}),i("updated")},C=["primary"],S=[{label:"Delete Thumbnail",icon:"Image",id:"delete-thumbnail",type:"icon",value:"delete-thumbnail"},{label:"Delete Rendition",icon:"Film",id:"delete-rendition",type:"icon",value:"delete-rendition"},{label:"Unarchive",value:"UnBoxArchive",type:"icon",icon:"BoxArchive",id:"unarchive",clickable:!0},{label:"Archive",value:"BoxArchive",type:"icon",icon:"BoxArchive",id:"archive",clickable:!0},{label:"Delete",value:"delete",type:"icon",icon:"TrashCan",id:"delete",danger:!0,clickable:!0}],b=()=>{i("unselect")},w=Qb(),{userPermissions:_}=Qs(w),R=Y(()=>_.value.includes(eS)),T=Y(()=>{if(!R.value){console.error("User does not have permission to open review.");return}if(l.value==Mt.CHECKED)return ho({type:"review_take",config:{reviewDomain:En.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,take_id:o.entityId}}).url;const me=o.selectRowData.map(oe=>oe.id).join(",");return ho({type:"review_multiple_scenes",config:{reviewDomain:En.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,scene_ids:me}}).url}),I=me=>{console.log("Updating assignees with params:",me);const{assignees:re,type:oe}=me,z=o.gridApi;if(!z){console.error("Grid API is not available for bulk update.");return}o.selectRowData.map(ie=>{const be=z.getRowNode(ie.id);if(!be)return null;const G=be.data.assignees||[];let q=[];switch(oe){case"add":{const ce=new Set(G.map(Fe=>Fe.id)),ke=re.filter(Fe=>!ce.has(Fe.id));q=[...G,...ke];break}case"overwrite":{q=re;break}case"remove":{const ce=new Set(re.map(ke=>ke.id));q=G.filter(ke=>!ce.has(ke.id));break}case"removeAll":{q=[];break}}return{...be.data,assignees:q}}).filter(ie=>ie!==null).forEach(ie=>{const be=z.getRowNode(ie.id);be&&be.setData(ie)})},{apiServices:x}=ts(!1,o),P=async()=>{var z;const me=o.selectRowData.map(pe=>pe.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk delete.");return}const oe=await((z=x.value)==null?void 0:z.bulkDeleteItems(O.value));(oe==null?void 0:oe.message)=="Done"&&(me.forEach(pe=>{const ie=re.getRowNode(pe);if(ie){const be={...ie.data,isDeleted:!0,disabled:!0};ie.setData(be)}}),re.deselectAll())},D=V(null),F=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id);if(!o.gridApi){console.error("Grid API is not available for bulk unarchive.");return}const oe=await((z=x.value)==null?void 0:z.bulkUnarchiveItems(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to unarchive items."),(pe=D.value)==null||pe.open();return}Z(me,"isArchived",!1),(ie=D.value)==null||ie.hide()},k=_n("filterParams",void 0),O=Y(()=>({workspaceId:String(o.workspaceId),itemIds:d.value&&u.value?[]:o.selectRowData.map(me=>me.id),entityId:o.entityId,filterParams:k!=null&&k.value?k.value:void 0})),B=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id);if(!o.gridApi){console.error("Grid API is not available for bulk archive.");return}const oe=await((z=x.value)==null?void 0:z.bulkArchiveItems(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to archive items."),(pe=D.value)==null||pe.open();return}Z(me,"isArchived",!0),(ie=D.value)==null||ie.hide()},Z=(me,re,oe)=>{const z=o.gridApi;if(!z){console.error("Grid API is not available for bulk update.");return}const pe=me.map(ie=>{const be=z.getRowNode(ie);if(be){const G={...be.data,[re]:oe};be.setData(G)}return be}).filter(ie=>ie!=null);console.log("Updated row nodes:",{idsToUpdate:me,rowNodes:pe}),z.redrawRows({rowNodes:pe})},J=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk thumbnail deletion.");return}const oe=await((z=x.value)==null?void 0:z.deleteThumbnail(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to delete thumbnails."),(pe=D.value)==null||pe.open();return}me.forEach(be=>{const G=re.getRowNode(be);if(G){const q={...G.data,thumbnail:null};G.setData(q)}}),(ie=D.value)==null||ie.hide()},ee=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk rendition deletion.");return}const oe=await((z=x.value)==null?void 0:z.deleteRendition(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to delete renditions."),(pe=D.value)==null||pe.open();return}me.forEach(be=>{const G=re.getRowNode(be);if(G){const q={...G.data,rendition:null};G.setData(q)}}),(ie=D.value)==null||ie.hide()},X=V(!1),ve=V(null),ne=async me=>{var re,oe;try{switch(H.value=!0,X.value=!0,me.id){case"unarchive":await F();break;case"delete":await P();break;case"archive":await B();break;case"delete-thumbnail":await J();break;case"delete-rendition":await ee();break;default:console.error("Unknown action:",me.id),X.value=!1;break}}catch(z){console.error("Error performing action:",z),(re=D.value)==null||re.open()}finally{(oe=ve.value)==null||oe.focus(),mt(()=>{H.value=!1,X.value=!1})}},L=(me,re)=>{var oe;!me&&re&&((oe=ve.value)==null||oe.focus())},H=V(!0),te=me=>{mt(()=>{H.value=me})};et(()=>o.selectRowData,me=>{H.value=!1},{deep:!0,immediate:!0});const he=Y(()=>({workspaceId:o.workspaceId,entityId:o.entityId,variant:C,disabled:H.value,ids:c.value}));return(me,re)=>Ke((j(),ue("div",{class:Q(me.$style["bulk-update-action"])},[Re("div",{class:Q(me.$style["left-actions"])},[Re("div",{class:Q(me.$style["selection-track"])},[fe(vt,{class:Q(me.$style["btn-close"]),variant:["tertiary","icon"],onClick:b,style:{background:"transparent"}},{prefix:ge(()=>[fe(lt,{src:"XMarkSolid",source:"remote"})]),_:1},8,["class"]),U(l)==U(Mt).INDETERMINATE?(j(),ue("span",{key:0,class:Q(me.$style["selected-count"])},Ct(e.selectRowData.length)+" selected ",3)):Je("",!0),U(l)==U(Mt).CHECKED?(j(),ue("span",{key:1,class:Q(me.$style["selected-count"]),style:{"line-height":"14px"}},[re[12]||(re[12]=nt(' All in " ',-1)),Ke((j(),ue("span",ZX,[nt(Ct(e.takeName),1)])),[[U(n),{content:e.takeName}]]),re[13]||(re[13]=nt(' " ',-1))],2)):Je("",!0),!e.loading&&U(l)==U(Mt).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(j(),qe(vt,{key:2,variant:"secondary",onHandleClick:U(a)},{default:ge(()=>[Re("span",{class:Q(me.$style["selected-count"]),style:{"line-height":"14px"}},[re[14]||(re[14]=nt(' Select all in " ',-1)),Ke((j(),ue("span",XX,[nt(Ct(e.takeName),1)])),[[U(n),{content:e.takeName}]]),re[15]||(re[15]=nt(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Je("",!0),Re("span",{class:Q(me.$style.divider)},null,2)],2),fe(KX,Xt(he.value,{onUpdated:h,onUpdateStart:re[0]||(re[0]=oe=>H.value=!0),onUpdateCompleted:re[1]||(re[1]=oe=>te(!1)),onUpdateFailed:re[2]||(re[2]=oe=>te(!1))}),null,16),fe(VY,Xt({onUpdate:I,onUpdateStart:re[3]||(re[3]=oe=>H.value=!0),onUpdateCompleted:re[4]||(re[4]=oe=>te(!1)),onUpdateFailed:re[5]||(re[5]=oe=>te(!1))},he.value),null,16),fe(XY,Xt({"row-selected":f.value},he.value,{onUpdated:p,onUpdateStart:re[6]||(re[6]=oe=>H.value=!0),onUpdateCompleted:re[7]||(re[7]=oe=>te(!1)),onUpdateFailed:re[8]||(re[8]=oe=>te(!1))}),null,16,["row-selected"]),fe(WX,{disabled:H.value,onUpdate:v,onUpdateStart:re[9]||(re[9]=oe=>H.value=!0),onUpdateCompleted:re[10]||(re[10]=oe=>te(!1)),onUpdateFailed:re[11]||(re[11]=oe=>te(!1)),selectedIds:c.value,"workspace-id":e.workspaceId,variant:C,"entity-id":e.entityId},null,8,["disabled","selectedIds","workspace-id","entity-id"]),Re("span",{class:Q(me.$style.divider)},null,2),Ke((j(),ue("div",null,[R.value?(j(),qe(vt,{key:0,class:Q(me.$style["action-button"]),variant:[...C,"icon"],href:T.value,disabled:o.selectRowData.length>40&&U(l)!=U(Mt).CHECKED},{default:ge(()=>[fe(lt,{src:"PenRuler",class:Q(me.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","href","disabled"])):Je("",!0)])),[[U(n),o.selectRowData.length<=40||U(l)==U(Mt).CHECKED?"Open in Review":"Select fewer than 40 items to open in Review"]]),Re("span",{class:Q(me.$style.divider)},null,2),fe(sf,{ref_key:"wrapperRef",ref:D,isUpdating:H.value,disabled:H.value,onOnVisibleChange:L},{trigger:ge(({hide:oe,toggle:z,isVisible:pe,disabled:ie})=>[Ke((j(),qe(vt,{onEscape:oe,actived:pe,ref_key:"moreActionRef",ref:ve,class:Q(me.$style["action-button"]),variant:["secondary","icon"],loading:X.value,disabled:ie||H.value,onClick:Pt(z,["stop"])},{default:ge(()=>[fe(lt,{src:"EllipsisVertical",class:Q(me.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","loading","disabled","onClick"])),[[U(s),"99999"],[U(n),{content:"More actions"}]])]),popup:ge(({isVisible:oe,hide:z})=>[(j(),ue(xt,null,xn(S,(pe,ie)=>fe(eu,Xt({clickable:!0,key:pe.id},{ref_for:!0},pe,{show:oe,style:{borderLeft:0},"focus-index":"99999."+ie,onClick:()=>{ne(pe)},onEscape:z}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1},8,["isUpdating","disabled"])],2)],2)),[[jo,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_1c92i_1","left-actions":"_left-actions_1c92i_19","right-actions":"_right-actions_1c92i_20","selection-track":"_selection-track_1c92i_25","btn-close":"_btn-close_1c92i_31","close-icon":"_close-icon_1c92i_37","selected-count":"_selected-count_1c92i_41",divider:"_divider_1c92i_47","more-button":"_more-button_1c92i_52",dropdown:"_dropdown_1c92i_56","dropdown-content":"_dropdown-content_1c92i_59",delete:"_delete_1c92i_82","icon-btn":"_icon-btn_1c92i_89","selected-list":"_selected-list_1c92i_93"}}]]),Ua=_t(rt({name:"LabelRenderer",__name:"LabelRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=To,n=Jt,s=e,o=Y(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:s.value===void 0||s.value===null||s.value==="",clickable:!0})),{argsMain:i}=ws(o),r=Y(()=>{var u,c,d;return!!((u=s.params)!=null&&u.api||(c=s.params)!=null&&c.node||(d=s.params)!=null&&d.context)}),a=Y(()=>{if(s.tooltip){if(typeof s.tooltip=="string")return{content:s.tooltip};if(typeof s.tooltip=="object"&&"display_name"in s.tooltip){const u=s.tooltip,c=document.createElement("div");c.classList.add("tooltip-user-info"),c.style.display="flex",c.style.alignItems="center",c.style.gap="4px";const d=document.createElement("div"),h=fe(Ih,{id:u.id,name:u.display_name,profile_image:u.profile_image,size:20,initial:u.initial,color:u.color});Yw(h,d);const f=document.createElement("span");f.innerText=u.display_name,f.classList.add("tooltip-user-name");const p=document.createElement("span");p.style.whiteSpace="nowrap",p.innerText="By",c.appendChild(p),c.appendChild(d),c.appendChild(f);const g=document.getElementById("item-table-layout-id");return{content:c,allowHtml:!0,appendTo:g||document.body}}}return{content:void 0}}),l=Y(()=>s.value===void 0);return(u,c)=>Ke((j(),qe(Cs,iR(Lw(U(i))),{default:ge(()=>[Re("span",{class:Q(u.$style["item-table-label-renderer"])},Ct(s.value||"-"),3)]),_:1},16)),[[U(t),{isLoading:l.value||!r.value}],[U(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),QX=["placeholder","maxlength"],eJ={key:0,class:"wrapper-suffix"},tJ=_t(rt({name:"LabelEditor",__name:"LabelEditor",props:{value:{},placeholder:{default:"Enter name"},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},saveOnBlur:{type:Boolean,default:!0},bordered:{type:Boolean},keyboardFocusing:{type:Boolean}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const s=To,o=Jt,i=e,r=n,a=V(i.value),l=V(null),u=V(null),c=V(i.value||""),d=V(!1),h=V(!1),f=Y(()=>{var F;return{disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((F=i.value)==null?void 0:F.length)===0,inputRef:l,wrapperRef:u,clickable:!0,focused:d.value||i.keyboardFocusing}}),{argsMain:p,isHover:g}=ws(f),v=F=>{const k=document.createElement("div");return k.textContent=F,k.innerHTML},C=()=>c.value!==a.value,S=()=>{h.value=!0,d.value=!1,c.value=a.value,r("update:value",a.value),setTimeout(()=>{h.value=!1},100)},b=()=>{if(!d.value||!l.value)return;const F=v(l.value.value);if(!C()){d.value=!1;return}a.value=F,r("update:value",F),r("enter",F),d.value=!1},w=()=>{h.value||(i.saveOnBlur?b():S(),r("blur",c.value))},_=F=>{var k;if(F.key==="ArrowLeft"||F.key==="ArrowRight"){F.stopPropagation();return}F.ctrlKey&&(F.key=="a"||F.key=="A")?(F.stopPropagation(),(k=l.value)==null||k.select()):F.key==="Enter"?(F.preventDefault(),F.stopPropagation(),b()):F.key==="Escape"&&(F.preventDefault(),F.stopPropagation(),S())},R=()=>{a.value=i.value,c.value=i.value,d.value=!0,mt(()=>{var F,k;(F=l.value)==null||F.click(),(k=l.value)==null||k.focus()})},T=()=>{var F;d.value?S():(F=l.value)==null||F.blur(),r("blur",c.value)},I={focus:()=>{R()}};nn(()=>{var k;const F=(k=u.value)==null?void 0:k.$el;F&&(F.__sceneNameEditor=I)}),vs(()=>{const F=u.value;F&&delete F.__sceneNameEditor});const x=V(null),P=V(null);t({focus:R,blur:()=>{var F;return(F=l.value)==null?void 0:F.blur()},save:b,cancel:S,focusEditButton:()=>{mt(()=>{var F;(F=x.value)==null||F.focus()})},focusCancelButton:()=>{mt(()=>{var F;(F=P.value)==null||F.focus()})},startEdit:R});const D=Y(()=>i.value===void 0);return sS(u,()=>{d.value&&w()}),(F,k)=>Ke((j(),qe(U(Cs),Xt(U(p),{ref_key:"wrapperRef",ref:u,bordered:i.bordered,style:{paddingTop:"0px",paddingBottom:"0px"}}),nh({default:ge(()=>[d.value?Je("",!0):Tt(F.$slots,"default",{key:0,isEditting:d.value,isHover:U(g)},()=>[Ke((j(),ue("span",{class:Q(F.$style["label-renderer"])},[nt(Ct(c.value),1)],2)),[[U(o),{content:c.value||void 0}]])]),Ke(Re("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":k[0]||(k[0]=O=>c.value=O),class:Q(F.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:_,onBlur:w},null,42,QX),[[jo,d.value],[ST,c.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:ge(({hovered:O,focused:B})=>[O?(j(),ue("div",eJ,[O&&!B?Ke((j(),qe(vt,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(R,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:x,onKeydown:[zn(Pt(R,["prevent","stop"]),["enter"]),zn(Pt(T,["prevent","stop"]),["escape"])]},{default:ge(()=>[fe(U(lt),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[U(o),"Edit"]]):Je("",!0)])):Je("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[U(s),{isLoading:D.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),nJ=["tabindex"],Hk=_t(rt({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const s=Jt,o=To,i=e,r=n,a=V(i.value),l=V(i.value),u=V(null),c=V(null),d=_n("bulkUpdate",!1),{apiServices:h}=ts(!d,i),f=Y(()=>{var X;return{componentType:void 0,disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((X=a==null?void 0:a.value)==null?void 0:X.length)===0,inputRef:u,wrapperRef:c,clickable:!0}}),{isFocus:p}=ws(f),g=Y(()=>{const X=En.getInstance().getItem("ws.code"),ve=En.getInstance().getItem("BASE_URL"),ne=X||i.workspaceId;return ho({type:"scene_hub",config:{baseDomain:ve,ws_code:ne,scene_id:String(i.id)}}).url}),v=Y(()=>{var X,ve,ne;return((ve=(X=i.data)==null?void 0:X.isProcessing)==null?void 0:ve.state)==0||((ne=i.data)==null?void 0:ne.isDeleted)==!0}),C=Y(()=>i.readOnly||R.value),S=Y(()=>{var X,ve,ne,L,H;return((X=i.data)==null?void 0:X.isDeleted)==!0||((ne=(ve=i.data)==null?void 0:ve.isProcessing)==null?void 0:ne.state)==0||((H=(L=i.data)==null?void 0:L.isProcessing)==null?void 0:H.state)==1}),b=Y(()=>{var X,ve;return(ve=(X=i.data)==null?void 0:X.isProcessing)==null?void 0:ve.message}),w=Y(()=>{var X;return((X=i.data)==null?void 0:X.isArchived)==1}),_=Y(()=>{var X;return((X=i.data)==null?void 0:X.isLocked)==1}),R=Y(()=>i.value===void 0),T=async X=>{var ve,ne,L,H,te,he,me,re,oe,z;a.value=X,p.value=!1;try{const pe=await((ne=(ve=h.value)==null?void 0:ve.updateSceneName)==null?void 0:ne.call(ve,{workspaceId:i.workspaceId,entityId:i.entityId,itemId:i.id,name:a.value})),ie=MF.get(TF)||"UTC";if(pe){const be=PF(pe,ie),G={...i.data,...be};(L=i.params)==null||L.api.clearFocusedCell();const q=((te=(H=i.params)==null?void 0:H.column)==null?void 0:te.getColId())||"",ce=((me=(he=i.params)==null?void 0:he.node)==null?void 0:me.rowIndex)||0;(re=i.params)==null||re.api.setFocusedCell(ce,q),(z=(oe=i.params)==null?void 0:oe.node)==null||z.setData(G),l.value=a.value,r("enter")}else a.value=l.value}catch(pe){console.error("Failed to update scene name:",pe),a.value=l.value}},I={focus:()=>{p.value=!0,mt(()=>{var X;return(X=c.value)==null?void 0:X.focus()})},startEdit:()=>{var X;(X=c.value)==null||X.startEdit()}},x=()=>c.value?"$el"in c.value?c.value.$el:c.value:null;et(()=>i.value,X=>{a.value=X,l.value=X}),nn(()=>{const X=x();X&&(X.__sceneNameEditor=I)}),vs(()=>{const X=c.value,ve=X&&"$el"in X?X.$el:X;ve&&delete ve.__sceneNameEditor});const P=tf(),{openSceneHub:D}=P,F=X=>{try{if(X.ctrlKey||X.metaKey){window.open(g.value,"_blank");return}D(String(i.id))}catch{window.open(g.value,"_blank")}finally{J()}},k=()=>{setTimeout(()=>{ee.value=!0,O.value=0,mt(()=>{var X;(X=B.value)==null||X.focus()})},300)},O=V(-1),B=V(null);t({focus:k,trigerFocus:k,startEdit:()=>{var X;(X=c.value)==null||X.startEdit()}});const Z=X=>{if(X.key==="Enter"){X.preventDefault(),F(X);return}if(X.key==="Escape"){X.preventDefault(),J();return}X.key==="Tab"&&(X.preventDefault(),X.stopPropagation(),X.stopImmediatePropagation(),mt(()=>{var ve;(ve=c.value)==null||ve.focusEditButton()}))},J=()=>{var ne,L,H,te,he,me;ee.value=!1,O.value=-1,(ne=i.params)==null||ne.api.clearFocusedCell();const X=((H=(L=i.params)==null?void 0:L.column)==null?void 0:H.getColId())||"",ve=((he=(te=i.params)==null?void 0:te.node)==null?void 0:he.rowIndex)||0;(me=i.params)==null||me.api.setFocusedCell(ve,X)},ee=V(!1);return(X,ve)=>Ke((j(),qe(tJ,{"save-on-blur":!0,ref_key:"wrapperRef",ref:c,disabled:i.disabled,"read-only":C.value,placeholder:i.placeholder,value:a.value,"onUpdate:value":ve[0]||(ve[0]=ne=>a.value=ne),id:`scene-name-${i.id}`,onEnter:T,"max-length":255,bordered:!0,keyboardFocusing:ee.value,onBlur:J},{default:ge(({isHover:ne,isEditting:L})=>[Ke(Re("div",{class:Q(X.$style["scene-name-display"])},[Ke((j(),ue("a",{tabindex:O.value,ref_key:"nameRef",ref:B,onClick:Pt(F,["prevent"]),onKeydown:Z,target:"_blank",class:Q(X.$style["scene-name-text"]),style:{lineHeight:"28px"}},[nt(Ct(a.value),1)],42,nJ)),[[U(s),{content:a.value,delay:[1e3,0]}]]),C.value||!ne&&!L&&!C.value?(j(),ue(xt,{key:0},[_.value?Ke((j(),ue("div",{key:0,class:Q([X.$style["icon-processing"],X.$style.isLocked])},[fe(lt,{src:"Lock"})],2)),[[U(s),{content:"Locked",delay:[1e3,0]}]]):Je("",!0),w.value?Ke((j(),ue("div",{key:1,class:Q([X.$style["icon-processing"],X.$style.archived])},[fe(lt,{src:"BoxArchive"})],2)),[[U(s),{content:"Archived",delay:[1e3,0]}]]):Je("",!0),S.value?Ke((j(),ue("div",{key:2,class:Q([X.$style["icon-processing"],X.$style.processing,v.value&&X.$style["icon-red"]])},[fe(lt,{src:"AnimatedHourglass",color:"inherit"})],2)),[[U(s),b.value]]):Je("",!0)],64)):Je("",!0)],2),[[jo,!U(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[U(o),{isLoading:R.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_1ws9s_1","scene-name-display":"_scene-name-display_1ws9s_11","icon-processing":"_icon-processing_1ws9s_18",archived:"_archived_1ws9s_28",locked:"_locked_1ws9s_31",processing:"_processing_1ws9s_34","icon-red":"_icon-red_1ws9s_38","scene-name-text":"_scene-name-text_1ws9s_43"}}]]),yS=_t(rt({__name:"ButtonDropdown",props:{label:{},value:{},variant:{},options:{default:()=>[]},size:{},placement:{default:"bottom"},disabled:{type:Boolean},readOnly:{type:Boolean},tabIndex:{}},emits:["select","handleClick"],setup(e,{expose:t,emit:n}){const s=Ur,o=V([]),i=e,r=V(null),a=Y(()=>typeof i.size=="number"?`${i.size}px`:{small:"24px",medium:"32px",large:"48px"}[i.size]??"32px"),l=Y(()=>{let C=[];return typeof i.variant=="string"?C.push(i.variant):Array.isArray(i.variant)&&(C=[...i.variant]),[...C,"icon"]}),u=n,{hide:c,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=Fs({toggleOnClick:!0,offset:[0,0]});function v(C){u("select",C),c()}return th(()=>{g.value&&g.value.setProps({placement:i.placement})}),t({show:h,hide:c,hideDropdown:()=>{c()},popupRef:p}),et(d,C=>{var S;C&&((S=p.value)==null||S.focus())}),(C,S)=>(j(),ue("div",{class:Q(C.$style["button-dropdown-wrapper"]),style:dn({"--button-size":a.value})},[Re("div",{class:Q(C.$style["button-group"])},[Tt(C.$slots,"prefix"),Re("div",{ref_key:"triggerRef",ref:f,class:Q(U(d)?C.$style.open:"")},[Tt(C.$slots,"triggerDropdown",{open:U(d)},()=>[i.readOnly?Je("",!0):Ke((j(),qe(vt,{key:0,onEscape:U(c),ref_key:"mainButton",ref:r,actived:U(d),class:Q(C.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:i.disabled},{default:ge(()=>[Tt(C.$slots,"iconDropdown",{},()=>[fe(lt,{class:Q(C.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[U(s),e.tabIndex]])])],2)],2),Re("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:Q(C.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(j(!0),ue(xt,null,xn(e.options,(b,w)=>Ke((j(),qe(eu,Xt({ref_for:!0,ref:_=>o.value[w]=_,key:b.value},{ref_for:!0},{...b},{"icon-name":b.icon,onClick:Pt(_=>v(b.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:ge(()=>[nt(Ct(b.label),1)]),_:2},1040,["icon-name","onClick"])),[[U(s),`${e.tabIndex}.${w}`]])),128))],2)],6))}}),[["__cssModules",{$style:{"button-dropdown-wrapper":"_button-dropdown-wrapper_1g99p_1","button-group":"_button-group_1g99p_7","overflow-elipsis":"_overflow-elipsis_1g99p_26","button-dropdown-list":"_button-dropdown-list_1g99p_33",show:"_show_1g99p_38","button-dropdown-item":"_button-dropdown-item_1g99p_41","icon-dropdown":"_icon-dropdown_1g99p_48",open:"_open_1g99p_51"}}]]),ff=_t(rt({__name:"CloseBadgeWrapper",props:{disableRemove:{type:Boolean,default:!0},tooltip:{default:"Unassign"}},emits:["clear"],setup(e,{emit:t}){const n=Jt,s=e,o=t,i=a=>{a.preventDefault(),a.stopImmediatePropagation(),a.stopPropagation(),o("clear")},r=Y(()=>({content:s.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(j(),ue("div",{class:Q(a.$style["close-wrapper"])},[e.disableRemove?Je("",!0):(j(),ue("div",{key:0,class:Q(a.$style["close-button"])},[Ke((j(),qe(vt,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:i,size:16,rounded:!0},{default:ge(()=>[fe(lt,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[U(n),r.value]])],2)),Tt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_15u1e_1","close-button":"_close-button_15u1e_5"}}]]),sJ=_t(rt({name:"AssigneeGroupRenderer",__name:"AssigneeGroupRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},maxVisible:{default:4}},setup(e){const t=Jt,n=To,s=e,{isEditing:o}=Ac(s),i=V(s.value),r=V(null),a=V(null),{apiServices:l}=ts(!0,s),u=V(!0),c=()=>{u.value=s.value===void 0};eh(()=>{c()}),nn(()=>{c()}),et(()=>s.value,I=>{c()});const d=Y(()=>({disabled:s.disabled,readOnly:s.readOnly,error:s.error,inputRef:r,wrapperRef:a,clickable:!(s.readOnly||u.value),active:o})),{argsMain:h,isHover:f}=ws(d),p=Y(()=>{var I;return((I=i.value)==null?void 0:I.slice(0,s.maxVisible))||[]}),g=Y(()=>{var I;return Math.max(0,(((I=i.value)==null?void 0:I.length)||0)-s.maxVisible)}),v=Y(()=>{var I;return g.value<=0?"":((I=i.value)==null?void 0:I.slice(s.maxVisible).map(x=>x.name).join(", "))||""}),C=Y(()=>p.value.map(I=>({id:I.id,name:I.name,initial:I.initial,avatarId:I.id,profile_image:I.profile_image,color:I.color,size:24,user:I}))),S=Y(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));et(()=>s.value,I=>{i.value=I},{immediate:!0,deep:!0});const b=async I=>{var P,D,F;await T(I)&&(i.value=(P=i.value)==null?void 0:P.filter(k=>k.id!==I),(F=s.params)==null||F.node.setData({...(D=s.params)==null?void 0:D.node.data,assignees:i.value}))},w=I=>{var P;const x=En.getInstance().getItem("ws.code");return((P=l.value)==null?void 0:P.getUserInformation(x,I))||Promise.resolve(null)},{id:_}=Up(s),R=I=>{var P,D;const x=(D=(P=s.params)==null?void 0:P.api)==null?void 0:D.getRowNode(String(_.value));x==null||x.setDataValue("assignees",$I(I.assignees))},{removeAssignee:T}=mm({...s,entityId:s.entityId,updateRowData:R,value:s.value,errorCallback:()=>{}});return(I,x)=>Ke((j(),qe(Cs,Xt(U(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:ge(()=>{var P;return[Re("div",{class:Q(I.$style.assigneeGroupRenderer)},[((P=i.value)==null?void 0:P.length)===0?(j(),qe(lt,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:dn(S.value)},null,8,["style"])):Je("",!0),(j(!0),ue(xt,null,xn(C.value,D=>(j(),qe(ff,{key:D.id,"disable-remove":s.readOnly||s.disabled,onClear:F=>b(D.id),style:{marginLeft:"0"}},{default:ge(()=>[fe(Oc,{user:D.user,"show-profile":!0,apiUpdateFunction:w,class:Q(I.$style["ib-assignee-avatar"])},null,8,["user","class"])]),_:2},1032,["disable-remove","onClear"]))),128)),g.value>0?Ke((j(),ue("div",{key:1,class:Q(I.$style["extra-avatars"])},[nt(" +"+Ct(g.value),1)],2)),[[U(t),v.value]]):Je("",!0)],2)]}),_:1},16)),[[U(n),{isLoading:u.value}]])}}),[["__cssModules",{$style:{assigneeGroupRenderer:"_assigneeGroupRenderer_14fiu_1","ib-assignee-group-renderer":"_ib-assignee-group-renderer_14fiu_7","ib-assignee-avatar":"_ib-assignee-avatar_14fiu_16","assignee-wrapper":"_assignee-wrapper_14fiu_20","extra-avatars":"_extra-avatars_14fiu_27"}}]]),oJ=_t(rt({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!1},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var R,T;const t=Jt,n=To,s=Eb(),o=e,i=V(null),r=V(null),{isEditing:a}=Ac(o),l=I=>{if(I){if(typeof I=="string")return I;if(I instanceof Date)return I.toISOString()}},u=Y(()=>o.value===void 0),c=Y(()=>{var I;return(I=o.data)==null?void 0:I.isStarted}),d=Y(()=>{var I;return(I=o.data)==null?void 0:I.isCompleted}),h=Y(()=>!!(o.value&&(o.value[0]||o.value[1]))),f=Y(()=>h.value?o.disabled&&!o.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=Y(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,inputRef:i,wrapperRef:r,clickable:!0,active:a})),{argsMain:g}=ws(p),{startDate:v,endDate:C,startClasses:S,endClasses:b,fullStartDate:w,fullEndDate:_}=O7({start:l((R=o.value)==null?void 0:R[0]),end:l((T=o.value)==null?void 0:T[1]),isStarted:c.value,isEnded:d.value,timezone:o.timezone||s});return(I,x)=>Ke((j(),qe(Cs,Xt(U(g),{ref_key:"wrapperRef",ref:r,bordered:!0}),{default:ge(()=>[u.value?Je("",!0):(j(),ue("div",{key:0,class:Q(I.$style.dateRangeRenderer)},[h.value?Je("",!0):(j(),qe(lt,{key:0,src:"Calendar",class:Q(I.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(j(),ue(xt,{key:1},[Ke((j(),ue("span",{class:Q([I.$style.dateLabelDisplay,...U(S).map(P=>I.$style[P])])},[nt(Ct(U(v)),1)],2)),[[U(t),U(w)]]),x[0]||(x[0]=Re("span",null,"→",-1)),Ke((j(),ue("span",{class:Q([I.$style.dateLabelDisplay,...U(b).map(P=>I.$style[P])])},[nt(Ct(U(C)),1)],2)),[[U(t),U(_)]])],64)):Je("",!0)],2))]),_:1},16)),[[U(n),{isLoading:u.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_1hon8_1",calendarIcon:"_calendarIcon_1hon8_7",dateSection:"_dateSection_1hon8_11",dateLabelDisplay:"_dateLabelDisplay_1hon8_18",empty:"_empty_1hon8_28","end-today":"_end-today_1hon8_34",actual:"_actual_1hon8_37","end-tomorrow":"_end-tomorrow_1hon8_40","end-yesterday":"_end-yesterday_1hon8_46","end-past":"_end-past_1hon8_52","end-future":"_end-future_1hon8_58","start-today":"_start-today_1hon8_61","start-tomorrow":"_start-tomorrow_1hon8_67","start-yesterday":"_start-yesterday_1hon8_73","start-past":"_start-past_1hon8_79","start-future":"_start-future_1hon8_85"}}]]),iJ=rt({__name:"DateRangeEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{default:void 0},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{default:Eb()}},emits:["closed"],setup(e,{expose:t,emit:n}){const s=V(null);nn(()=>{mt(()=>{s.value&&s.value.focus()})});const o=e,i=n,r=()=>{var C;(C=o.params)==null||C.api.stopEditing(),i("closed")},a=C=>`${bt.fromJSDate(C,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,l=async C=>{await v({startDate:C[0]?a(C[0]):null,dueDate:C[1]?a(C[1]):null})},u=async()=>{await v({startDate:null})},c=async()=>{await v({dueDate:null})},d=async C=>{await v({startDate:C?a(C):null})},h=async C=>{await v({dueDate:C?a(C):null})},f=async()=>{await v({startDate:null,dueDate:null})},p=_n("bulkUpdate",!1),{apiServices:g}=ts(!p,o),v=async C=>{var S,b,w,_,R;try{const T=(S=s.value)==null?void 0:S.getValues(),I=await((w=(b=g.value)==null?void 0:b.changeDate)==null?void 0:w.call(b,{workspaceId:o.workspaceId,itemIds:[o.id],startDate:C.startDate,dueDate:C.dueDate}));I!=null&&I.message&&((R=o.params)==null||R.node.setData({...(_=o.params)==null?void 0:_.node.data,dateRange:T==null?void 0:T.dateRange}))}catch(T){console.error("Failed to update scene name:",T)}};return t({focus:()=>{mt(()=>{var C;(C=s.value)==null||C.focus()})}}),(C,S)=>(j(),qe(Am,Xt(o,{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:c,onClearStart:u,onClosed:r,ref_key:"calendarRef",ref:s}),null,16))}}),rJ=_t(rt({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=V(null),s=V(0);let o=null;nn(()=>{n.value&&(o=new ResizeObserver(r=>{for(const a of r)s.value=a.contentRect.height}),o.observe(n.value))}),Il(()=>{o&&n.value&&o.unobserve(n.value)});const i=Y(()=>{const r=s.value;return r>120?r-42-36:0});return(r,a)=>(j(),ue("div",{class:Q(r.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[Re("div",{class:Q(r.$style["item-header"])},[Re("div",{class:Q(r.$style["item-header__left"])},[Tt(r.$slots,"header-left",{},()=>[Re("h1",{class:Q(r.$style["item-header__title"])},[Tt(r.$slots,"title",{},()=>[a[0]||(a[0]=nt("Items",-1))])],2)])],2),Re("div",{class:Q(r.$style["item-header__spacer"])},null,2),Re("div",{class:Q(r.$style["item-header__actions"])},[Tt(r.$slots,"header-actions")],2)],2),Tt(r.$slots,"grid",{availableHeight:i.value}),Re("div",{class:Q(r.$style.footer)},[Tt(r.$slots,"footer")],2),Tt(r.$slots,"new-row"),Tt(r.$slots,"bulk-update-actions"),Tt(r.$slots,"snackbar"),Tt(r.$slots,"popup")],2))}}),[["__cssModules",{$style:{"item-table-wrapper":"_item-table-wrapper_1uqb9_1","item-header":"_item-header_1uqb9_14","item-header__left":"_item-header__left_1uqb9_22","item-header__title":"_item-header__title_1uqb9_27","item-header__spacer":"_item-header__spacer_1uqb9_32","item-header__actions":"_item-header__actions_1uqb9_35","main-content":"_main-content_1uqb9_41",sidebar:"_sidebar_1uqb9_48","is-open":"_is-open_1uqb9_64","sidebar-header":"_sidebar-header_1uqb9_68","sidebar-footer":"_sidebar-footer_1uqb9_69","sidebar-content":"_sidebar-content_1uqb9_89",footer:"_footer_1uqb9_94"}}]]),Gk=(e,t)=>{const n=V(Number(e.value.value)),s=Y(()=>e.value.metricConfig),o=Y(()=>{var g,v;const l=s.value,u=t.value,c=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,d=!!e.value.error,h=(l==null?void 0:l.format_type)==="icon",{disabled:f}=e.value;return{pendingCalculation:e.value.value=="N/A"||c&&((g=l==null?void 0:l.metric_type)==null?void 0:g.code)==="formula",isEmpty:c,isError:d,hasPrefix:!c&&!d&&(l==null?void 0:l.morpheme_type)==="prefix",hasSuffix:!c&&!d&&(l==null?void 0:l.morpheme_type)==="suffix",isDropdown:(l==null?void 0:l.format_type)==="dropdown",isFormula:((v=l==null?void 0:l.metric_type)==null?void 0:v.code)==="formula",isLoading:e.value.value===void 0,isRating:h,showActions:u&&!c&&!f}}),i=17,r=Y(()=>{var l;return{maxRating:((l=s.value)==null?void 0:l.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:i}});return{componentState:o,metricConfig:s,ICON_SIZE:i,ratingParams:r,standardNameforIcon:()=>{var u;return(((u=s.value)==null?void 0:u.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},aJ=["aria-label"],Uk=_t(rt({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=To,s=Jt,o=e,i=Gp(!1),r=V(null),a=V(null),{isEditing:l}=Ac(o),u=Y(()=>{var B,Z;return{value:o.value,metricConfig:((Z=(B=o.params)==null?void 0:B.colDef)==null?void 0:Z.context)||o.config,error:o.error,hovered:i.value,readOnly:o.readOnly,disabled:o.disabled,active:l}}),{componentState:c,metricConfig:d,internalValue:h}=Gk(u,i),f=Y(()=>{var Z,J;let B=!1;if(["number","formula"].includes(d.value.metric_type.code)){const ee=Number(o.value),X=Number((Z=d.value)==null?void 0:Z.format_value);Number.isFinite(X)&&X>=0&&(B=(((J=ee.toString().split(".")[1])==null?void 0:J.length)||0)>X)}return B}),p=Y(()=>{var B;return!!((B=d.value)!=null&&B.morpheme_value)||c.value.isEmpty||f.value}),g=Y(()=>{var J,ee,X;if(c.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(c.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(c.value.isEmpty)return;const B=x.value,Z=(J=d.value)==null?void 0:J.morpheme_type;return Z==="prefix"?`${((ee=d.value)==null?void 0:ee.morpheme_value)||""} ${B}`.trim():Z==="suffix"?`${B} ${((X=d.value)==null?void 0:X.morpheme_value)||""}`.trim():B}),v=Y(()=>{const{format_type:B,format_value:Z}=d.value;if(B==="dropdown"&&typeof Z=="string"&&Z.startsWith("["))try{return JSON.parse(Z)}catch{return[]}return[]}),C=Y(()=>({disabled:o.disabled,error:c.value.isError,inputRef:r,wrapperRef:a,clickable:!I.value,readOnly:o.readOnly||I.value,isEmpty:c.value.isEmpty})),{argsMain:S,isHover:b}=ws(C),w=(B,Z,J="en-US")=>new Intl.NumberFormat(J,{minimumFractionDigits:Z,maximumFractionDigits:Z}).format(B),_=Y(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const B=o.value,{format_type:Z,format_value:J,mapping:ee}=d.value;if(ee&&typeof ee=="object"&&!Array.isArray(ee)){const X=ee[`!${B}`];if(X)return X}if(Z==="dropdown"){const X=v.value.find(ve=>String(ve.name)===String(B));if(X)return X.name}if(typeof B=="string"){const X=Number(B);return Number.isNaN(X)?B:B.replace(/[.-]/g,"").length>16?R(B,J):R(X,J)}return typeof B=="number"?R(B,J):String(B)}),R=(B,Z)=>{const J=Number.parseInt(String(Z)||"2",10),ee=Number.isFinite(J)&&J>=0?J:2;try{if(typeof B=="string"){const X=B.split("."),ve=X[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ne=X[1]?X[1].substring(0,ee).padEnd(ee,"0"):"0".repeat(ee);return ee>0?`${ve}.${ne}`:ve}return w(B,ee)}catch(X){return console.error("Error formatting metric value:",X,{num:B,decimals:ee}),String(B)}},T=(B,Z)=>{const J=Number.parseInt(String(Z)||"2",10),ee=Number.isFinite(J)&&J>=0?J:2;try{if(typeof B=="string"){const X=B.split("."),ve=X[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ne=X[1]?X[1].length:0,L=Math.max(ee,ne),H=X[1]?X[1].padEnd(L,"0"):"0".repeat(L);return L>0?`${ve}.${H}`:ve}return new Intl.NumberFormat("en-US",{minimumFractionDigits:ee,maximumFractionDigits:20}).format(B)}catch(X){return console.error("Error formatting exact metric value:",X,{num:B,decimals:ee}),String(B)}},I=Y(()=>{var B;return((B=d.value)==null?void 0:B.metric_type.code)==="formula"}),x=Y(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const B=o.value,{format_type:Z,format_value:J,mapping:ee}=d.value;if(ee&&typeof ee=="object"&&!Array.isArray(ee)){const X=ee[`!${B}`];if(X)return X}if(Z==="dropdown"){const X=v.value.find(ve=>String(ve.name)===String(B));if(X)return X.name}if(typeof B=="string"){const X=Number(B);return Number.isNaN(X)?B:B.replace(/[.-]/g,"").length>16?T(B,J):T(X,J)}return typeof B=="number"?T(B,J):String(B)}),{tooltip:P}=NF(""),D=async B=>{B.stopPropagation(),B.preventDefault(),B.stopImmediatePropagation();try{await navigator.clipboard.writeText(x.value),P.value="Copied",setTimeout(()=>{P.value="Copy"},3e3)}catch(Z){console.error("Failed to copy text:",Z),P.value="Copy failed",setTimeout(()=>{P.value="Copy"},3e3)}};et(()=>o.value,(B,Z)=>{const J=Number(B);Number.isFinite(J)&&J!==h.value?h.value=J:B==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const k=()=>{i.value=!0},O=()=>{i.value=!1};return(B,Z)=>Ke((j(),qe(Cs,Xt(U(S),{onMouseenter:k,style:{"--icon-size":"24px"},onMouseleave:O,ref_key:"wrapperRef",ref:a,actived:U(l),bordered:!0}),{suffix:ge(()=>[o.disabled?Je("",!0):(j(),ue("div",{key:0,class:Q([B.$style.suffix,"wrapper-suffix"])},[i.value&&!U(c).isEmpty&&!U(c).isError?Ke((j(),qe(vt,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(D,["prevent","stop"])},{default:ge(()=>[fe(lt,{src:"Copy",source:"remote",size:12})]),_:1})),[[U(s),{content:U(P),hideOnClick:!1,contentClass:"extra-padding"}]]):Je("",!0)],2))]),default:ge(()=>[Re("div",{class:Q(B.$style["metric-wrapper"]),"aria-label":U(d).format_value||void 0},[Re("div",{class:Q([B.$style["metric-content"],o.disabled?B.$style.disabled:""])},[!U(c).isError&&U(c).isEmpty?(j(),ue(xt,{key:0},[U(c).pendingCalculation?Ke((j(),ue("span",{key:0,class:Q(B.$style["metric-empty"])},[...Z[0]||(Z[0]=[nt(" - ",-1)])],2)),[[U(s),"Can’t calculate yet. Complete required fields."]]):U(c).isEmpty?(j(),ue("span",{key:1,class:Q(B.$style["metric-empty"])}," - ",2)):Je("",!0)],64)):Je("",!0),U(c).isError?Ke((j(),ue("div",{key:1,class:Q(B.$style["metric-error"])},[...Z[1]||(Z[1]=[nt(" Error ",-1)])],2)),[[U(s),"Something went wrong. Review formula, inputs and retry."]]):Je("",!0),!U(c).isEmpty&&!U(c).isError?Ke((j(),ue("span",{key:2,class:Q([B.$style["metric-value"],U(b)?B.$style.hovered:"",{[B.$style.disabled]:o.disabled}])},[nt(Ct(_.value),1)],2)),[[U(s),{content:g.value,bypassOverflowCheck:p.value}]]):Je("",!0)],2)],10,aJ)]),_:1},16,["actived"])),[[U(n),{isLoading:U(c).isLoading}]])}}),[["__cssModules",{$style:{"metric-wrapper":"_metric-wrapper_7otc0_1","metric-content":"_metric-content_7otc0_5",disabled:"_disabled_7otc0_15","metric-value":"_metric-value_7otc0_19",hovered:"_hovered_7otc0_19","metric-error":"_metric-error_7otc0_23","with-morpheme":"_with-morpheme_7otc0_38","with-formula-icon":"_with-formula-icon_7otc0_41","metric-value--number":"_metric-value--number_7otc0_47","metric-value--currency":"_metric-value--currency_7otc0_47","metric-value--percentage":"_metric-value--percentage_7otc0_47","metric-morpheme":"_metric-morpheme_7otc0_51","metric-empty":"_metric-empty_7otc0_64","metric-icon":"_metric-icon_7otc0_71"}}]]),lJ={key:0,style:{color:"#6b6b6b"}},uJ=_t(rt({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue"],setup(e,{emit:t}){const n=Jt,s={START_ASC:{value:"start_asc",label:"Soonest to furthest start",id:"start_asc"},START_DESC:{value:"start_desc",label:"Furthest to soonest start",id:"start_desc"},DUE_ASC:{value:"due_asc",label:"Soonest to furthest due",id:"due_asc"},DUE_DESC:{value:"due_desc",label:"Furthest to soonest due",id:"due_desc"}},o={desc:{value:"desc",label:"Newest to oldest",id:"desc"},asc:{value:"asc",label:"Oldest to newest",id:"asc"}},i={asc:{value:"asc",label:"Smallest to largest",id:"asc"},desc:{value:"desc",label:"Largest to smallest",id:"desc"}},r={asc:{value:"asc",label:"Ascending",id:"asc"},desc:{value:"desc",label:"Descending",id:"desc"}},a=e,l={assignees:"default",completedOn:"date",dateRange:"dateRange",id:"number",isArchived:"default",isCompleted:"default",isDeleted:"default",isProcessing:"default",isStarted:"default",lastUpdated:"date",name:"default",status:"default",permissions:"default",options:"default",disabled:"number"},u=Y(()=>{var F,k;if(a.headerType)return a.headerType;if(((k=(F=a.params)==null?void 0:F.column)==null?void 0:k.getColId()).includes("metric"))return"default";const D=a.headerType??a.params.column.getColId();return l[D]||"default"}),c=V(),d=()=>{var D,F,k;const P=(F=(D=a.params)==null?void 0:D.column)==null?void 0:F.getColDef();if((k=P.colId)!=null&&k.includes("metric")){if(P.context.is_primary==1)return"primary";if(P.context.is_point_metric==1)return"secondary"}};th(()=>{c.value=d()}),nn(()=>{c.value=d()});const h=Y(()=>{var P,D;return((D=(P=a.params)==null?void 0:P.column.getColDef().context)==null?void 0:D.morpheme_value)||void 0}),f=Y(()=>{var P;return(P=a.params)==null?void 0:P.displayName}),p=Y(()=>{let P=[];switch(u.value){case"dateRange":P=Object.values(s).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;case"date":P=Object.values(o).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;case"number":P=Object.values(i).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;default:P=Object.values(r).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break}return v.value!=="none"&&P.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:T.value=="none"}),P}),g=Y(()=>String(v.value).endsWith("asc")?"SortUp":String(v.value).endsWith("desc")?"SortDown":"Sort"),v=V(a.modelValue??"none"),C=P=>{_("update:modelValue",P),_("sort-changed",P)},S=P=>{v.value=P},b=Di(()=>{if(u.value==="date"||u.value==="default"||u.value==="number"){let P;v.value==="none"?P="asc":v.value==="asc"?P="desc":P="none",v.value=P}else{const P=[s.START_ASC.value,s.START_DESC.value,s.DUE_ASC.value,s.DUE_DESC.value,"none"],F=(P.indexOf(v.value)+1)%P.length;v.value=P[F]}},rr),w=Y(()=>{if(v.value==="none")return"No sorting applied";const P=p.value.find(D=>D.value===v.value);return(P==null?void 0:P.label)||""}),_=t,R=Y(()=>{if(a.disabled&&!a.readOnly)return"var(--disabled-color)";if(v.value!=="none")return"var(--primary-color-hover)"});et(()=>a.modelValue,P=>{P!=v.value&&(v.value=P)}),et(v,P=>{P!==a.modelValue&&C(P)});const T=V(v.value);et(()=>v.value,P=>{T.value=P});const I=P=>{var O,B;if(a.readOnly||a.disabled)return;let D=0;P.key==="ArrowDown"?D=1:P.key==="ArrowUp"&&(D=-1);const F=p.value.findIndex(Z=>Z.value===T.value),k=p.value.length;if(P.key==="Enter"||P.key===" ")P.preventDefault(),v.value=T.value,(O=x.value)==null||O.hide();else if(D!==0){P.preventDefault();let Z=(F+D+k)%k;T.value=p.value[Z].value}else P.key==="Escape"&&((B=x.value)==null||B.hide())},x=V(null);return nn(()=>{var P,D;(D=(P=x.value)==null?void 0:P.$el)==null||D.addEventListener("keydown",I)}),Il(()=>{var P,D;(D=(P=x.value)==null?void 0:P.$el)==null||D.removeEventListener("keydown",I)}),(P,D)=>(j(),qe(yS,{ref_key:"dropdownRef",ref:x,options:p.value,label:f.value,readOnly:a.readOnly,disabled:a.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:U(b),onSelect:D[0]||(D[0]=F=>S(F))},{prefix:ge(()=>[fe(vt,{variant:["text"],onClick:U(b),size:"small"},{default:ge(()=>[Ke((j(),ue("b",null,[nt(Ct(f.value),1)])),[[U(n),{content:f.value}]]),h.value?(j(),ue("small",lJ," ("+Ct(h.value)+") ",1)):Je("",!0),c.value=="primary"?Ke((j(),ue("div",{key:1,class:Q(P.$style["icon-metric"])},[fe(lt,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[U(n),"Woohoo metric"]]):Je("",!0),c.value=="secondary"?Ke((j(),ue("div",{key:2,class:Q(P.$style["icon-metric"])},[fe(lt,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[U(n),"Point Metric"]]):Je("",!0)]),_:1},8,["onClick"])]),iconDropdown:ge(()=>[Ke(fe(lt,{src:g.value,source:"remote",color:R.value},null,8,["src","color"]),[[U(n),w.value]])]),_:1},8,["options","label","readOnly","disabled","onHandleClick"]))}}),[["__cssModules",{$style:{"icon-metric":"_icon-metric_nh30n_1",iconSorting:"_iconSorting_nh30n_9","button-group":"_button-group_nh30n_15","ab-table-button":"_ab-table-button_nh30n_26","button-main":"_button-main_nh30n_32","button-dropdown-trigger":"_button-dropdown-trigger_nh30n_37",headerSorting:"_headerSorting_nh30n_47"}}]]),cJ=["disabled","readonly","checked","indeterminate"],Wk=_t(rt({__name:"Checkbox",props:{modelValue:{},disabled:{type:Boolean},readOnly:{type:Boolean},focusIndex:{},tooltipText:{},allowIndeterminate:{type:Boolean},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=Jt,s=Ur,o=e,i=t,r=Y(()=>{if(typeof o.size=="string"){if(["small","medium","large"].includes(o.size))switch(o.size){case"small":return"14px";case"large":return"24px";case"medium":default:return"20px"}if(o.size.endsWith("px"))return o.size}return typeof o.size=="number"?`${o.size}px`:"20px"}),a=Y(()=>o.allowIndeterminate?[Mt.UNCHECK,Mt.INDETERMINATE,Mt.CHECKED]:[Mt.UNCHECK,Mt.CHECKED]),l=Y(()=>{if(typeof o.tooltipText=="string"||!o.tooltipText)return o.tooltipText||"";switch(c.value){case Mt.UNCHECK:return o.tooltipText.unchecked;case Mt.INDETERMINATE:return o.tooltipText.indeterminate;case Mt.CHECKED:return o.tooltipText.checked;default:return""}}),u=()=>{if(h.value)return;const p=(a.value.indexOf(c.value)+1)%a.value.length;c.value=a.value[p]},c=V(typeof o.modelValue=="boolean"?o.modelValue?Mt.CHECKED:Mt.UNCHECK:o.modelValue),d=Y(()=>({checked:c.value===Mt.CHECKED,indeterminate:c.value===Mt.INDETERMINATE,none:c.value===Mt.UNCHECK})),h=Y(()=>o.disabled||o.readOnly);return et(()=>c.value,f=>{i("update:modelValue",f===Mt.CHECKED)}),(f,p)=>Ke((j(),ue("input",{disabled:o.disabled,key:c.value,readonly:o.readOnly,type:"checkbox",class:Q([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:u,"aria-label":"Select All Items",style:dn({"--input-size":r.value})},null,46,cJ)),[[U(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[U(s),o.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_npdz3_84",large:"_large_npdz3_87",medium:"_medium_npdz3_90"}}]]),dJ=_t(rt({name:"HeaderCheckbox",__name:"HeaderCheckbox",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=e,n=Jt,s=Wm(),{setSelectionStatus:o}=s,{rowCount:i,selectionStatus:r}=Qs(s),a=V(new Set);et(r,w=>{o(w)},{immediate:!0});const l=Y(()=>r.value!==Mt.UNCHECK),u=Y(()=>({checked:r.value===Mt.CHECKED,indeterminate:r.value===Mt.INDETERMINATE,UNCHECK:r.value===Mt.UNCHECK})),c=Y(()=>({[Mt.UNCHECK]:"Click to select all",[Mt.INDETERMINATE]:"Click to clear selection",[Mt.CHECKED]:"Click to clear selection"})[r.value]||"Select items"),d=Y(()=>{const w=[{label:"Select all",value:"INDETERMINATE",type:"text",clickable:!0,id:"indeterminate"}];return l.value&&w.push({label:"None",value:"UNCHECK",type:"text",clickable:!0,id:"uncheck"}),w}),h=w=>({selected:w.getSelectedRows().length,total:i.value.total,loaded:i.value.loaded}),f=({api:w,state:_})=>{if(w)if(_===Mt.UNCHECK)w.deselectAll(),a.value.clear(),r.value=_;else if(_===Mt.CHECKED){const R=new Set;w.forEachNode(T=>{T.isSelected()&&R.add(T.id||"")}),a.value=R,w.forEachNode(T=>T.setSelected(!0)),r.value=_}else w.forEachNode(R=>R.setSelected(!0)),r.value=_},p=()=>{var R;const w=(R=t.params)==null?void 0:R.api;if(!w){console.error("[HeaderCheckbox] There is no API available");return}const _={[Mt.UNCHECK]:Mt.INDETERMINATE,[Mt.INDETERMINATE]:Mt.UNCHECK,[Mt.CHECKED]:Mt.UNCHECK};f({api:w,state:_[r.value]})},g=w=>{var T;const _=(T=t.params)==null?void 0:T.api;if(!_){console.error("no api");return}const R={INDETERMINATE:Mt.INDETERMINATE,GLOBAL:Mt.CHECKED,UNCHECK:Mt.UNCHECK};f({api:_,state:R[w]})},v=Di(w=>{const{selected:_,total:R}=h(w);if(R==0){r.value=Mt.UNCHECK;return}_===R?r.value=Mt.CHECKED:_===0?r.value=Mt.UNCHECK:r.value=Mt.INDETERMINATE},300);let C=[];const S=w=>{v(w)};nn(()=>{var I;const w=(I=t.params)==null?void 0:I.api;if(!w)return;const _=x=>v(x.api),R=()=>S(w),T=()=>S(w);w.addEventListener("selectionChanged",_),w.addEventListener("rowDataUpdated",R),w.addEventListener("modelUpdated",R),C=[()=>w.removeEventListener("selectionChanged",_),()=>w.removeEventListener("rowDataUpdated",R),()=>w.removeEventListener("modelUpdated",T)]}),vs(()=>{C.forEach(w=>w())});const b=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(w,_)=>(j(),qe(yS,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:ge(()=>[Ke((j(),qe(Wk,{"tab-index":"8",id:b,disabled:t.disabled,key:U(r),readonly:t.readOnly,type:"checkbox",checked:u.value.checked,indeterminate:u.value.indeterminate,modelValue:U(r),"onUpdate:modelValue":_[0]||(_[0]=R=>gn(r)?r.value=R:null),onChange:p,"aria-label":U(r)===U(Mt).CHECKED?"All items selected":"Select visible items",class:Q(w.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[U(n),{content:c.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_uj7ro_1","button-group":"_button-group_uj7ro_62","button-main":"_button-main_uj7ro_62",headerCheckbox:"_headerCheckbox_uj7ro_66"}}]]),hJ={key:1},fJ=_t(rt({name:"StatusRenderer",__name:"StatusRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=To,n=Jt,s=e,{isEditing:o}=Ac(s),i=V(null),r=V(null),a=Y(()=>s.value),l=Y(()=>a.value===void 0),u=Y(()=>{var g;return((g=a.value)==null?void 0:g.name)||"No status"}),c=Y(()=>{var g;return{disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:Cj((g=a.value)==null?void 0:g.label),inputRef:i,wrapperRef:r,clickable:!s.disabled&&!s.readOnly,active:o}}),{argsMain:d,isHover:h}=ws(c),f=Y(()=>{var g;return((g=a.value)==null?void 0:g.color)||"red"}),p=Y(()=>new Nn(f.value).isLight()?"#000":"#fff");return(g,v)=>Ke((j(),qe(U(Cs),Xt(U(d),{ref_key:"wrapperRef",ref:r,bordered:!0,style:{background:`${f.value} !important`,color:p.value,"--border-color":!U(o)&&!U(h)?"#f3f5f8":void 0}}),{default:ge(()=>[l.value?Je("",!0):(j(),ue("div",{key:0,class:Q(g.$style["status-renderer"])},[a.value?Ke((j(),ue("div",{key:0,class:Q(g.$style["status-renderer__status-name"])},[nt(Ct(u.value),1)],2)),[[U(n),{content:u.value,delay:[1e3,0]}]]):l.value?Je("",!0):(j(),ue("div",hJ,"No status"))],2))]),_:1},16,["style"])),[[U(t),{isLoading:l.value}]])}}),[["__cssModules",{$style:{"status-renderer":"_status-renderer_108pu_1","status-renderer__color-code":"_status-renderer__color-code_108pu_10","status-renderer__status-name":"_status-renderer__status-name_108pu_20"}}]]),zk=_t(rt({__name:"PopupLayout",props:{popupName:{},showOverlay:{type:Boolean,default:!0},overlayOpacity:{default:.5},closeOnOverlayClick:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0}},emits:["shown","hidden"],setup(e,{expose:t,emit:n}){const s=e,{popupRef:o,show:i,hide:r,isVisible:a}=$7({useTrigger:!1,arrow:!1,centered:!0,showOverlay:s.showOverlay,overlayOpacity:s.overlayOpacity,closeOnOverlayClick:s.closeOnOverlayClick,appendTo(c){return document.body}}),l=c=>{s.closeOnEscape&&c.key==="Escape"&&a.value&&r()};nn(()=>{document.addEventListener("keydown",l)}),vs(()=>{document.removeEventListener("keydown",l)}),t({show:i,hide:r,isVisible:a});const u=n;return et(()=>a.value,c=>{u(c?"shown":"hidden")}),(c,d)=>{const h=_o("tooltip");return j(),ue("div",{ref_key:"popupRef",ref:o,class:Q(c.$style.popupContainer)},[Re("div",{class:Q(c.$style.popupWrapper)},[Re("div",{class:Q(c.$style.header)},[Re("span",{class:Q(c.$style["header-title"])},Ct(e.popupName),3),Ke((j(),qe(vt,{style:{position:"absolute",top:"0",right:"0"},variant:"text",onClick:U(r),"aria-label":"Close popup"},{default:ge(()=>[fe(lt,{src:"Xmark"})]),_:1},8,["onClick"])),[[h,"Close"]])],2),Re("div",{class:Q(c.$style.body)},[Tt(c.$slots,"default")],2),Re("div",{class:Q(c.$style.footer)},[Tt(c.$slots,"footer")],2)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_73gw5_1",popupWrapper:"_popupWrapper_73gw5_5",popupFadeIn:"_popupFadeIn_73gw5_1",header:"_header_73gw5_19","header-title":"_header-title_73gw5_28",body:"_body_73gw5_38",footer:"_footer_73gw5_43"}}]]),pJ={...{list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch basic information."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{success:"Deletion successful.",error:"Deletion failed. Please try again."},delete_thumbnail:{success:"Deletion successful.",error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{success:"Deletion successful.",error:"Deletion failed. Please try again."},bulkArchive:{error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."},createNewItem:{},getAssignableAssignees:{},getAssignableStatuses:{},getFilterStatuses:{}},offline:{error:"You are currently offline. Please check your network connection."}};class gJ extends Error{}class Wa extends gJ{constructor(){super("Zone is an abstract class")}}class jk{get type(){throw new Wa}get name(){throw new Wa}get ianaName(){return this.name}get isUniversal(){throw new Wa}offsetName(t,n){throw new Wa}formatOffset(t,n){throw new Wa}offset(t){throw new Wa}equals(t){throw new Wa}get isValid(){throw new Wa}}const wS=new Map;function mJ(e){let t=wS.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),wS.set(e,t)),t}const vJ={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function yJ(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,r,a,l,u,c]=s;return[r,o,i,a,l,u,c]}function wJ(e,t){const n=e.formatToParts(t),s=[];for(let o=0;o<n.length;o++){const{type:i,value:r}=n[o],a=vJ[i];i==="era"?s[a]=r:jm(a)||(s[a]=parseInt(r,10))}return s}const CS=new Map;class zm extends jk{static create(t){let n=CS.get(t);return n===void 0&&CS.set(t,n=new zm(t)),n}static resetCache(){CS.clear(),wS.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=zm.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return SJ(t,n,s,this.name)}formatOffset(t,n){return qm(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const s=mJ(this.name);let[o,i,r,a,l,u,c]=s.formatToParts?wJ(s,n):yJ(s,n);a==="BC"&&(o=-Math.abs(o)+1);const h=bJ({year:o,month:i,day:r,hour:l===24?0:l,minute:u,second:c,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let bS=null;class Bc extends jk{static get utcInstance(){return bS===null&&(bS=new Bc(0)),bS}static instance(t){return t===0?Bc.utcInstance:new Bc(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Bc(qk(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${qm(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${qm(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return qm(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function jm(e){return typeof e>"u"}function Km(e,t=2){const n=e<0;let s;return n?s="-"+(""+-e).padStart(t,"0"):s=(""+e).padStart(t,"0"),s}function Kk(e){if(!(jm(e)||e===null||e===""))return parseInt(e,10)}function CJ(e){if(!(jm(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function bJ(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function SJ(e,t,n,s=null){const o=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const r={timeZoneName:t,...i},a=new Intl.DateTimeFormat(n,r).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function qk(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const s=parseInt(t,10)||0,o=n<0||Object.is(n,-0)?-s:s;return n*60+o}function qm(e,t){const n=Math.trunc(Math.abs(e/60)),s=Math.trunc(Math.abs(e%60)),o=e>=0?"+":"-";switch(t){case"short":return`${o}${Km(n,2)}:${Km(s,2)}`;case"narrow":return`${o}${n}${s>0?`:${s}`:""}`;case"techie":return`${o}${Km(n,2)}${Km(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const Yk=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function $c(...e){const t=e.reduce((n,s)=>n+s.source,"");return RegExp(`^${t}$`)}function Hc(...e){return t=>e.reduce(([n,s,o],i)=>{const[r,a,l]=i(t,o);return[{...n,...r},a||s,l]},[{},null,1]).slice(0,2)}function Zk(...e){return(t,n)=>{const s={};let o;for(o=0;o<e.length;o++)s[e[o]]=Kk(t[n+o]);return[s,null,n+o]}}const Xk=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,EJ=`(?:${Xk.source}?(?:\\[(${Yk.source})\\])?)?`,Jk=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Qk=RegExp(`${Jk.source}${EJ}`),SS=RegExp(`(?:[Tt]${Qk.source})?`),_J=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,RJ=/(\d{4})-?W(\d\d)(?:-?(\d))?/,DJ=/(\d{4})-?(\d{3})/,TJ=Zk("weekYear","weekNumber","weekDay"),IJ=Zk("year","ordinal"),xJ=/(\d{4})-(\d\d)-(\d\d)/,eO=RegExp(`${Jk.source} ?(?:${Xk.source}|(${Yk.source}))?`),FJ=RegExp(`(?: ${eO.source})?`);function Gc(e,t,n){const s=e[t];return jm(s)?n:Kk(s)}function PJ(e,t){return[{year:Gc(e,t),month:Gc(e,t+1,1),day:Gc(e,t+2,1)},null,t+3]}function Uc(e,t){return[{hours:Gc(e,t,0),minutes:Gc(e,t+1,0),seconds:Gc(e,t+2,0),milliseconds:CJ(e[t+3])},null,t+4]}function pf(e,t){const n=!e[t]&&!e[t+1],s=qk(e[t+1],e[t+2]),o=n?null:Bc.instance(s);return[{},o,t+3]}function gf(e,t){const n=e[t]?zm.create(e[t]):null;return[{},n,t+1]}$c(_J,SS),$c(RJ,SS),$c(DJ,SS),$c(Qk),Hc(PJ,Uc,pf,gf),Hc(TJ,Uc,pf,gf),Hc(IJ,Uc,pf,gf),Hc(Uc,pf,gf),Hc(Uc),$c(xJ,FJ),$c(eO),Hc(Uc,pf,gf);function Wc(e){"@babel/helpers - typeof";return Wc=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},Wc(e)}var bs;(function(e){e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}"})(bs||(bs={})),bs.review,bs.review_take,bs.review_scene,bs.review_rendition,bs.review_frame,bs.review_rendition_comment,bs.review_comment,bs.scene_hub,bs.hub_rendition,bs.hub_comment,bs.people_insight,bs.people_detail,bs.project,bs.woohoo,bs.update,bs.core,bs.project_focusMode;var ES=null;function AJ(e){ES=e}function Ym(){if(!ES)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return ES}function tO(){try{var e=Ym();return e.t("errorMessages.fallback.unknownError")}catch{return"An error occurred. Please try again or contact support."}}function kJ(e,t,n,s){var o=e.replace(/{field}/g,t);if(s&&Wc(s)==="object")Object.keys(s).forEach(function(r){var a="{".concat(r,"}"),l=s[r];Array.isArray(l)?l=l.join(", "):r==="value"&&(s.min||s.max)&&(l="".concat(s.min||s.value," and ").concat(s.max||s.value)),o=o.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var i=n[0]||"";n.length>1?i="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(i=n[0].join(", ")),o=o.replace(/{value}/g,i)}return o}function OJ(e,t){for(var n=Object.keys(t),s=0,o=n;s<o.length;s++){var i=o[s],r=Array.isArray(t[i])?t[i].join(", "):String(t[i]);e=e.replace(new RegExp("\\{".concat(i,"\\}"),"g"),r)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function nO(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function sO(e,t){if(!e||Wc(e)!=="object")return null;try{var n=Ym();if(e.validation&&e.validation.fields)for(var s=e.validation.fields,o=Object.keys(s),i=0,r=o;i<r.length;i++){var a=r[i],l=s[a];if(l&&l.rule){var u=l.rule,c=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var C,S=t.toUpperCase();v=(C=p[g])===null||C===void 0||(C=C.errorMessages)===null||C===void 0||(C=C[S])===null||C===void 0||(C=C.validation_rules)===null||C===void 0?void 0:C[u]}if(!v){var b;v=(b=p[g])===null||b===void 0||(b=b.errorMessages)===null||b===void 0||(b=b.GEN)===null||b===void 0||(b=b.validation_rules)===null||b===void 0?void 0:b[u]}if(v&&typeof v=="string")return kJ(v,a,c,d)}catch(w){console.error("Error in validation rules",w)}}}}catch(w){return console.error("Error in getValidationErrorMessage:",w),null}return null}function MJ(e){if(!e)return tO();var t=e.code,n=e.error,s=e.details,o=e.message;if(nO(s)&&s){var i=sO(s,n==null?void 0:n.type);if(console.log("[Error Utils Debug]",i),i)return t!==""?"[".concat(t,"] ").concat(i):i;try{var r=Ym();return r.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(n&&Wc(n)==="object"&&n.type&&n.key){var a=n.type.toUpperCase();try{var l,u,c,d="errorMessages.".concat(a,".").concat(n.key),h=Ym(),f=((l=h.messages)===null||l===void 0?void 0:l.value)||h.messages,p=((u=h.locale)===null||u===void 0?void 0:u.value)||h.locale,g=(c=f[p])===null||c===void 0||(c=c.errorMessages)===null||c===void 0||(c=c[a])===null||c===void 0?void 0:c[n.key];if(g&&typeof g=="string"){var v=g;return s!=null&&s.context&&(v=OJ(v,s.context),console.log("[Error Utils Debug]",v)),t!==""?"[".concat(t,"] ").concat(v):v}}catch(S){console.error("[Error Utils Debug]",S)}}if(n&&Wc(n)!=="object"&&nO(s)){var C=sO(s);if(C)return t!==""?"[".concat(t,"] ").concat(C):C}return o||tO()}var NJ={GEN:{general_error:"General Error",validation_error:"Validation error occurred.",data_locked:"Update failed. Record(s) are locked or currently being updated. You may try again later.",unauthenticated:"Authentication required. Please log in to continue.",unauthorized:"Access denied. You don’t have permission to view this.",not_found:"Resource not found. Check link or try again.",server_error:"Something went wrong on our end. Please try again later.",validation_rules:{required:"The {field} field is required",unique:"The {field} field must be unique",email:"{field} must be a valid email address",emails:"Invalid email(s) pattern",email_exists:"{field} already exists in workspace {value}",regex:"The {field} format is invalid",min:"{field} must be at least {value} characters",max:"{field} cannot exceed {value} characters",between:"{field} must be between {value} characters",numeric:"The {field} must be a number",integer:"The {field} must be an integer",date:"The {field} must be a valid date",after:"The {field} must be after {value}",before:"The {field} must be before {value}",image:"The {field} must be an image",mimes:"The {field} must be a file of type: {value}",max_file_size:"The {field} size cannot exceed {value}MB",confirmed:"The {field} confirmation does not match",same:"The {field} must match {value}",exists:"The Selected {field} is invalid",password_requirements:"The {field} does not meet security requirements",decimal:"Update failed. Maximum allowed decimal places is {value}.",before_or_equal:"{field} must be a date before or equal {value}.",after_or_equal:"{field} must be a date after or equal {value}."}},MRC:{validation_rules:{not_in:"Update failed. These values are not allowed: {value}.",in:"Update failed. Only these values are allowed: {value}.",between:"Update failed. Enter a value between {value}."},excess_decimal_places:"Update failed. Maximum allowed decimal places is {value}."},PPL:{invite_deleted_user:"Invitation failed. Users deleted from the workspace can't be re-invited. Please contact support.",insufficient_seats:"Invitation failed. No seats remaining. Purchase seat(s) to continue."},TM:{NO_ENTITY_TO_UNDEPLOY:"Undeploy failed. No entity specified.",NO_TEAM_EDITOR_ROLE:"No team editor role."},DIR:{has_project_admin_access:"Update failed. User has project access by default.",NO_EDIT_ENTITY_TEAM_ACCESS:"No permission to edit entity team."},AS:{"invalid_field (TBD)":"Something went wrong with account creation. Please contact support."},custom_default_msg:{general:{invalid_data:"Invalid data provided",retry:"Try again later."},network:{offline:"You are currently offline. Please check your network connection.",request_timeout:"Your request has timed out. Please ensure your internet connection is stable.",network_problem:"Network problem. Request timed out. Please try again later.",network_connection_lost:"Network connection lost",gateway_timeout:"Gateway Timeout"},auth:{token_expired:"Token refresh failed"},storage:{storage_limit:"Storage limit exceeded.",thumbnail_size_limit:"Thumbnail picture size can not exceed 2MB!",thumbnail_picture_format:"Thumbnail picture must be image format!",upload_limit:"Your upload exceeds the maximum allowed size"}},fallback:{unknownError:"An error occurred. Please try again or contact support."}};const mf=Ql("toast",()=>{const e=l=>{var u;if((l==null?void 0:l.apiCode)==="offline")o({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const c=MJ((u=l==null?void 0:l.res)==null?void 0:u.data);o({id:l==null?void 0:l.apiCode,type:"error",message:c})}},t=V([]),n=(l,u)=>{const c=pJ[l];if(c){const d=c[u];if(d){o({id:l,type:u,message:d});return}}else o({id:l,type:u,message:l})},s=new Map,o=(l,u=5e3)=>{const c={...l,id:l.id??Date.now()+Math.random()};if(t.value.push(c),u>0){const d=Date.now(),h=setTimeout(()=>{i(c.id),s.delete(c.id)},u);s.set(c.id,{timeoutId:h,remainingTime:u,startTime:d})}};function i(l){t.value=t.value.filter(c=>c.id!==l);const u=s.get(l);u&&(clearTimeout(u.timeoutId),s.delete(l))}function r(l){const u=s.get(l);if(u){clearTimeout(u.timeoutId);const c=Date.now()-u.startTime;u.remainingTime=Math.max(0,u.remainingTime-c)}}function a(l){const u=s.get(l);if(u&&u.remainingTime>0){const c=setTimeout(()=>{i(l),s.delete(l)},u.remainingTime);u.timeoutId=c,u.startTime=Date.now()}}return{notifications:t,addNotification:o,removeNotification:i,showMessage:n,showErrorNetMessage:e,pauseAutoDismiss:r,resumeAutoDismiss:a}}),LJ=["onMouseenter","onMouseleave"],VJ=["innerHTML"],BJ=["innerHTML"],$J=["data-tooltip"],HJ={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},GJ=_t(rt({__name:"Snackbar",setup(e){const t=Jt,n=EU,s=mf(),{removeNotification:o}=s,{notifications:i}=Qs(s),r=f=>f.trim().startsWith("<svg"),a=V("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},u=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},c=V(new Set),d=f=>{var p;c.value.add(f),(p=s.pauseAutoDismiss)==null||p.call(s,f)},h=f=>{var p;c.value.delete(f),(p=s.resumeAutoDismiss)==null||p.call(s,f)};return(f,p)=>(j(),qe(rU,{name:"list",tag:"div",class:Q(["notification-center",f.$style["notification-wrapper"]])},{default:ge(()=>[(j(!0),ue(xt,null,xn(U(i),g=>{var v;return Ke((j(),ue("div",{key:g.id,class:Q([f.$style["notification-item"],f.$style[`notification--${g.type||"info"}`],!(g!=null&&g.actions)||((v=g==null?void 0:g.actions)==null?void 0:v.length)==0?f.$style["snackbar-type"]:""]),onMouseenter:C=>d(g.id),onMouseleave:C=>h(g.id)},[Re("p",{class:Q(f.$style.snackbar__message)},[Re("span",{class:Q(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(j(),qe(lt,{key:0,src:"CircleCheck",source:"remote"})):Je("",!0),!g.icon&&g.type=="interactive"?(j(),qe(lt,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(j(),qe(lt,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&r(g.icon)?(j(),ue("i",{key:3,class:Q(f.$style["icon-draw"]),innerHTML:g.icon},null,10,VJ)):g.icon&&!r(g.icon)?(j(),qe(lt,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Je("",!0)],2),Re("span",{class:Q(f.$style["error-message"])},[Re("span",{class:Q(f.$style.message),innerHTML:g.message},null,10,BJ)],2)],2),g.actions?(j(),ue("div",{key:0,class:Q(f.$style["actions-notification"]),"data-notification":"true"},[(j(!0),ue(xt,null,xn(g.actions,C=>(j(),qe(vt,Xt({key:C.label},{ref_for:!0},C,{onClick:Pt(C.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:ge(()=>[C.btnIcon?(j(),qe(lt,{key:0,src:C.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Je("",!0)]),_:2},1040,["onClick"]))),128))],2)):Je("",!0),g.type!=="interactive"?Ke((j(),ue("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[fe(vt,{variant:"secondary",onClick:C=>u(g.message),class:Q(f.$style["copy-btn"])},{prefix:ge(()=>[fe(lt,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,$J)),[[U(t),a.value]]):Je("",!0),g.type=="interactive"?Ke((j(),ue("div",HJ,[fe(vt,{variant:"tertiary",onClick:C=>U(o)(g.id),class:Q(f.$style["close-btn"]),size:18},{default:ge(()=>[fe(lt,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[U(t),"Close"]]):Je("",!0)],42,LJ)),[[U(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_egqq4_1","notification-item":"_notification-item_egqq4_15","notification--success":"_notification--success_egqq4_30","notification--error":"_notification--error_egqq4_36","close-btn":"_close-btn_egqq4_42","notification--info":"_notification--info_egqq4_45","notification--warning":"_notification--warning_egqq4_52","notification--interactive":"_notification--interactive_egqq4_59","snackbar-type":"_snackbar-type_egqq4_67",snackbar__message:"_snackbar__message_egqq4_76",message:"_message_egqq4_89","error-message":"_error-message_egqq4_97",snackbar__icon:"_snackbar__icon_egqq4_103","actions-notification":"_actions-notification_egqq4_112","icon-draw":"_icon-draw_egqq4_120","copy-btn":"_copy-btn_egqq4_128"}}]]);/*!
|
|
146
|
+
`+i):s.stack=i}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=nu(this.defaults,n);const{transitional:s,paramsSerializer:o,headers:i}=n;s!==void 0&&Gm.assertOptions(s,{silentJSONParsing:ur.transitional(ur.boolean),forcedJSONParsing:ur.transitional(ur.boolean),clarifyTimeoutError:ur.transitional(ur.boolean)},!1),o!=null&&(Be.isFunction(o)?n.paramsSerializer={serialize:o}:Gm.assertOptions(o,{encode:ur.function,serialize:ur.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Gm.assertOptions(n,{baseUrl:ur.spelling("baseURL"),withXsrfToken:ur.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=i&&Be.merge(i.common,i[n.method]);i&&Be.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=po.concat(r,i);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,d=0,h;if(!l){const p=[Fk.bind(this),void 0];for(p.unshift(...a),p.push(...u),h=p.length,c=Promise.resolve(n);d<h;)c=c.then(p[d++],p[d++]);return c}h=a.length;let f=n;for(;d<h;){const p=a[d++],g=a[d++];try{f=p(f)}catch(v){g.call(this,v);break}}try{c=Fk.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=u.length;d<h;)c=c.then(u[d++],u[d++]);return c}getUri(t){t=nu(this.defaults,t);const n=wk(t.baseURL,t.url,t.allowAbsoluteUrls);return ck(n,t.params,t.paramsSerializer)}};Be.forEach(["delete","get","head","options"],function(t){su.prototype[t]=function(n,s){return this.request(nu(s||{},{method:t,url:n,data:(s||{}).data}))}}),Be.forEach(["post","put","patch"],function(t){function n(s){return function(i,r,a){return this.request(nu(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}su.prototype[t]=n(),su.prototype[t+"Form"]=n(!0)});let AX=class c${constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(o=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](o);s._listeners=null}),this.promise.then=o=>{let i;const r=new Promise(a=>{s.subscribe(a),i=a}).then(o);return r.cancel=function(){s.unsubscribe(i)},r},t(function(i,r,a){s.reason||(s.reason=new Vc(i,r,a),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new c$(function(o){t=o}),cancel:t}}};function kX(e){return function(n){return e.apply(null,n)}}function OX(e){return Be.isObject(e)&&e.isAxiosError===!0}const vS={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(vS).forEach(([e,t])=>{vS[t]=e});function kk(e){const t=new su(e),n=YA(su.prototype.request,t);return Be.extend(n,su.prototype,t,{allOwnKeys:!0}),Be.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return kk(nu(e,o))},n}const ns=kk(uf);ns.Axios=su,ns.CanceledError=Vc,ns.CancelToken=AX,ns.isCancel=gk,ns.VERSION=Pk,ns.toFormData=Lm,ns.AxiosError=qt,ns.Cancel=ns.CanceledError,ns.all=function(t){return Promise.all(t)},ns.spread=kX,ns.isAxiosError=OX,ns.mergeConfig=nu,ns.AxiosHeaders=po,ns.formToJSON=e=>fk(Be.isHTMLForm(e)?new FormData(e):e),ns.getAdapter=xk.getAdapter,ns.HttpStatusCode=vS,ns.default=ns;const{Axios:s0e,AxiosError:o0e,CanceledError:i0e,isCancel:r0e,CancelToken:a0e,VERSION:l0e,all:u0e,Cancel:c0e,isAxiosError:MX,spread:d0e,toFormData:h0e,AxiosHeaders:f0e,HttpStatusCode:p0e,formToJSON:g0e,getAdapter:m0e,mergeConfig:v0e}=ns,NX=e=>{const n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2){const s=n.pop();return(s==null?void 0:s.split(";").shift())??null}return null},LX=6e4,Ok=e=>({[`/api/v1/workspace/${e}/item/2`]:1,[`/api/v1/workspace/${e}/item/2/metrics`]:5,default:5}),Um=new Map,Mk=e=>{const t=e.match(/\/api\/v1\/workspace\/([^/]+)/);return t?t[1]:null},VX=e=>{const t=Mk(e),n=Ok(t||"none"),o=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&o===a)||"default";Um.has(i)||Um.set(i,{ongoing:0,queue:[]});const r=Um.get(i);return new Promise(a=>{r?r.ongoing<n[i]?(r.ongoing++,a()):r.queue.push(()=>{r.ongoing++,a()}):a()})},Nk=e=>{const t=Mk(e),n=Ok(t||"none"),o=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&o===a)||"default",r=Um.get(i);if(r&&(r.ongoing--,r.queue.length>0)){const a=r.queue.shift();setTimeout(()=>{a==null||a()},1e3)}},BX=(()=>{const e=ns.create({timeout:LX,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(async t=>{const n=t.url||"";await VX(n);const s=NX("account.token");return s&&t.headers&&(t.headers.Authorization=`Bearer ${s}`),t.headers&&(t.headers["Access-Control-Allow-Origin"]="*",t.headers["Access-Control-Allow-Headers"]="*",t.headers["Accept-Language"]="*"),t},t=>Promise.reject(t)),e.interceptors.response.use(t=>(Nk(t.config.url||""),t),async t=>{var s,o,i;if(((s=t.response)==null?void 0:s.status)===401){const r=sessionStorage.getItem("BASE_URL")||"";(()=>{const l=`${r}/start`;window.postMessage({type:"TOKEN_EXPIRED",message:"Authentication token has expired"},"*"),window.location.replace(l)})()}if(t.config&&Nk(t.config.url||""),t.code==="ERR_NETWORK"||!navigator.onLine)return Promise.reject(t);const n=t.config;if(((o=t.response)==null?void 0:o.status)===429&&(!n._retryCount||n._retryCount<3)){n._retryCount=(n._retryCount||0)+1;const r=t.response.headers["retry-after"],a=r?parseInt(r)*1e3:Math.pow(2,n._retryCount)*1e3;return await new Promise(l=>setTimeout(l,a)),e(n)}return((i=t.response)==null?void 0:i.status)===401&&!n._retry&&(n._retry=!0),Promise.reject(t)}),e})();class df extends Error{constructor(t,n,s,o,i){super(t),this.name="ApiError",this.statusCode=n,this.code=s,this.details=o,this.type=i,Object.setPrototypeOf(this,df.prototype)}}const hf=e=>{var t,n;if(MX(e)){const s=(t=e.response)==null?void 0:t.status,o=(n=e.response)==null?void 0:n.data,i=(o==null?void 0:o.message)||e.message||"An unexpected error occurred",r=(o==null?void 0:o.code)||e.code,a=(o==null?void 0:o.details)||o;let l="UNKNOWN";return!s||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":s>=500?l="SERVER":s===Mc.UNAUTHORIZED||s===Mc.FORBIDDEN?l="AUTH":s===Mc.UNPROCESSABLE_ENTITY||s===Mc.BAD_REQUEST?l="VALIDATION":s>=Mc.BAD_REQUEST&&(l="CLIENT"),new df(i,s,r,a,l)}return e instanceof Error?new df(e.message,void 0,void 0,void 0,"UNKNOWN"):new df("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class $X{constructor(){this.axios=BX}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n??""}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([o,i])=>{i!=null&&i!==""&&(Array.isArray(i)?i.forEach(r=>n.append(o,String(r))):typeof i=="object"?n.append(o,JSON.stringify(i)):n.append(o,String(i)))});const s=n.toString();return s?`?${s}`:""}async get(t="",n,s){try{const o=this.buildUrl(t),i=n?this.buildQueryParams(n):"";return(await this.axios.get(`${o}${i}`,s)).data}catch(o){throw hf(o)}}async post(t="",n,s,o){try{const i=this.buildUrl(t),r=n?this.buildQueryParams(n):"";return(await this.axios.post(`${i}${r}`,s,o)).data}catch(i){throw hf(i)}}async put(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.put(o,n,s)).data}catch(o){throw hf(o)}}async patch(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.patch(o,n,s)).data}catch(o){throw hf(o)}}async delete(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.delete(o,{data:n,...s})).data}catch(o){throw hf(o)}}}const HX=({domainApi:e,wsCode:t,entityId:n})=>({list_cursor:{url:`${e}/v1/workspace/${t}/item/2`,method:"post",code:"list_cursor"},assignedUser:{url:`${e}/v1/workspace/${t}/item/2/assigned-users`,method:"post",code:"assignedUser"},metricValues:{url:`${e}/v1/workspace/${t}/item/2/metrics`,method:"post",code:"metricValues"},multipleAssignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"multipleAssignableUser"},assignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"assignableUser"},assignableStatus:{url:`${e}/v1/workspace/${t}/item/2/assignable-statuses`,method:"post",code:"assignableStatus"},delete_rendition:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-rendition`,method:"delete",code:"delete_rendition"},delete_thumbnail:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-thumbnail`,method:"delete",code:"delete_thumbnail"},archive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"archive_item"},unarchive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"unarchive_item"},removeAssignee:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-assignee`,method:"delete",code:"removeAssignee"},basicInfor:{url:`${e}/v1/workspace/${t}/tile/people/ws-user-roles/{userId}/basic-info`,method:"get",code:"basicInfor"},bulkDelete:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete`,method:"delete",code:"bulkDelete"},bulkArchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkArchive"},bulkDateUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-date-update`,method:"put",code:"bulkDateUpdate"},bulkAssignUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-assignee-update`,method:"put",code:"bulkAssignUpdate"},bulkStatusUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-status-update`,method:"put",code:"bulkStatusUpdate"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"},getPermission:{url:`${e}/v1/workspace/${t}/item/2/permissions`,method:"post",code:"getPermission"},getUserPermission:{url:`${e}/v1/workspace/${t}/permissions`,method:"get",code:"getUserPermission"},bulkUnarchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkUnarchive"},downloadTemplate:{url:`${e}/v1/workspace/${t}/item/2/download-sample`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/v1/workspace/${t}/item/2/import-from-file`,method:"post",code:"importItems"},exportItems:{url:`${e}/v1/workspace/${t}/item/2/export`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/v1/workspace/${t}/item/2/update-from-file`,method:"post",code:"updateFromFile"},metricList:{url:`${e}/workspace/${t}/entities/${n}/metric`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/v1/workspace/${t}/item/2/update`,method:"put",code:"item"},me:{url:`${e}/v1/me`,method:"get",code:"me"},workspaces:{url:`${e}/v1/workspaces`,method:"get",code:"workspaces"},entityUserRoles:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"entityUserRoles"},templateFlowStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"templateFlowStatuses"},createNewItem:{url:`${e}/v1/workspace/${t}/item/2/new?entity_id=${n}`,method:"post",code:"createNewItem"},getAssignableStatuses:{url:`${e}/v1/workspace/${t}/entity/2/assignable-statuses`,method:"get",code:"getAssignableStatuses"},getAssignableAssignees:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"getAssignableAssignees"},getFilterStatuses:{url:`${e}/v1/workspace/${t}/entity/2/statuses`,method:"get",code:"getFilterStatuses"}}),GX=(e,t)=>{const n=new Blob([e]),s=globalThis.URL.createObjectURL(n),o=document.createElement("a");o.href=s,o.download=t,document.body.appendChild(o),o.click(),o.remove(),globalThis.URL.revokeObjectURL(s)};class Lk extends $X{constructor(t,n){const s=n==null?void 0:n.domainApi,o=n==null?void 0:n.wsCode,i=(n==null?void 0:n.entityId)||"";super(),this.events=Object.create(null);const r=HX({domainApi:s,wsCode:o,entityId:i}),a={};Object.entries(r).forEach(([l,u])=>{const c=l;t[c]?a[c]=t[c]:(console.warn(`API config for ${c} is missing, using base config.`),a[c]=u)}),this.apiConfig=a}on(t,n){var s;((s=this.events)[t]??(s[t]=[])).push(n)}off(t,n){const s=this.events[t];s&&(this.events[t]=s.filter(o=>o!==n))}emit(t,...n){const s=this.events[t];s!=null&&s.length&&s.forEach(o=>{try{o(...n)}catch(i){console.error(`Error in event listener for ${t}:`,i)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:s,payload:o,code:i,responseType:r}){var u,c;const a=this.buildHeaders(o);let l;try{if(l=await this.axios.request({method:t,url:n,params:s,data:o,headers:a,responseType:r}),(((u=l.headers)==null?void 0:u["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const h=((c=l.headers)==null?void 0:c["content-disposition"])||"",f=h.includes("filename=")?h.split("filename=")[1]:"exported_items.xlsx";GX(l.data,f)}if(l.status>=400&&l.status<=500)throw new Error(`Client error (${l.status}): ${l.statusText}`);return this.emit("call-api",{apiCode:i,path:n,params:s,payload:o,res:l,success:!0}),l.data}catch(d){throw console.error("API Request Error:",d),d.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:s,payload:o,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:s,payload:o,error:d,success:!1,apiCode:i,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let s=t;return Object.entries(n).forEach(([o,i])=>{s=s.replace(`{${o}}`,String(i))}),s}async request(t,n,s={}){const{url:o,code:i,method:r}=this.apiConfig[t],a=this.generateUrl(o,n);return this._requestHandler({method:r,path:a,params:s.params,payload:s.payload,code:i,responseType:s.responseType})}async getAllItem_cursor(t){var i;const n=t.workspaceId,s={entity_ids:((i=t.entityIds)==null?void 0:i.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,search:t.search||t.q||void 0,include_signature:1,include:"last_updated_by,property,last_completed_by",include_permission:"{include_permission}",assignee_any_ina:(t==null?void 0:t.assignee_any_ina)||"",assignee_all_ina:(t==null?void 0:t.assignee_all_ina)||void 0,with_not_assigned:t.with_not_assigned||void 0,status_ina:t.status_ina||void 0,status_eq:t.status_eq||void 0,start_date_gte:t.start_date_gte||void 0,start_date_lte:t.start_date_lte||void 0,start_date_btw:t.start_date_btw||void 0,due_date_gte:t.due_date_gte||void 0,due_date_lte:t.due_date_lte||void 0,due_date_btw:t.due_date_btw||void 0,condition_combine_type:t.condition_combine_type||"or",preflight_status:t.preflight_status||void 0},o=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:s,payload:{sort_by:o}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},s={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:s,payload:n})}async getMetricList({workspaceId:t,entityId:n,page:s,query:o,per_page:i}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:i||100,page:s||1,name_like:o||void 0}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:s,metric_ids:o}){const i={item_ids:n,metric_ids:o};return this.request("metricValues",{workspaceId:t},{params:{per_page:s,include_permission:1},payload:i})}async multipleAssignableUser(t){const n=t.workspaceId,s=t.itemIds,o={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:s||[]};return this.request("multipleAssignableUser",{workspaceId:n},{payload:o})}async getAssignableStatus(t){const n=t.workspaceId,s={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return this.request("assignableStatus",{workspaceId:n||""},{payload:s})}async updateSceneName({workspaceId:t,entityId:n,itemId:s,name:o}){const i={item_id:s,entity_id:n,name:o,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:s},{payload:i})}async deleteScene(t,n,s){const o={item_ids:[s]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:o})}async deleteThumbnail({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("delete_thumbnail",{workspaceId:t},{payload:o})}async deleteRendition({workspaceId:t,itemIds:n,deleteAll:s=!1,entityId:o}){const i={item_ids:n,delete_all:s?1:void 0,entity_id:o};return!n||n.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:i})}async archiveScene(t,n,s){const o={item_ids:s,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:o})}async changeDate({workspaceId:t,itemIds:n,startDate:s,dueDate:o,entityId:i,filterParams:r}){const a={item_ids:n,start_date:s,due_date:o,entity_id:i};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:r})}async updateAssignee(t){const{workspaceId:n,itemIds:s,userIds:o,entityId:i}=t,r={item_ids:s,ws_user_role_ids:o,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:s,entityId:o}=t,i={item_ids:n,ws_user_role_ids:s,entity_id:o};return!n||n.length===0?(i.item_ids=void 0,i.entity_id=o):(i.item_ids=n,i.entity_id=void 0),i}async removeAssignee(t){const n=this.createUpdateEntityPayload(t);return this.request("removeAssignee",{workspaceId:t.workspaceId},{payload:n,params:t.filterParams})}async replaceAssignee(t){const{workspaceId:n,itemIds:s,userIds:o,entityId:i}=t,r={item_ids:s,ws_user_role_ids:o,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:r})}async addAssignee({workspaceId:t,itemIds:n,userIds:s,entityId:o,filterParams:i}){const r={item_ids:n,ws_user_role_ids:s,entity_id:o};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:r,params:i})}async unAssignAll(t){const{workspaceId:n,entityId:s,itemIds:o,filterParams:i}=t,r={item_ids:o,entity_id:s,ws_user_role_ids:[]};return!o||o.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(s)},{payload:r,params:i})}async updateItemStatus(t){const{workspaceId:n,itemIds:s=[],statusId:o,entityId:i}=t,r={item_ids:s,template_flow_status_id:o};return s.length||(r.item_ids=void 0,r.entity_id=i),this.request("bulkStatusUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkDelete",{workspaceId:t},{payload:o})}async bulkUnarchiveItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,status:1,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkUnarchive",{workspaceId:t},{payload:o})}async bulkArchiveItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,status:0,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkArchive",{workspaceId:t},{payload:o})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:s,metricId:o,value:i,clear:r}=t,a={item_ids:s,metric_id:o,metric_value:i,clear:r??(i==null?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete a.item_ids,a.entity_id=String(t.entityId)):(a.item_ids=s,a.entity_id=void 0),this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams})}async getPermissionForItems({workspaceId:t,itemIds:n}){const s={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:s,params:{per_page:50}})}async unarchiveScene(t,n,s){const o={item_ids:s,status:1};return this.request("unarchive_item",{workspaceId:t,entityId:n},{payload:o})}async getUserPermission(t){return this.request("getUserPermission",{workspaceId:t})}async getEntityDetail(t,n){return this.request("getEntityDetail",{workspaceId:t,entityId:n})}async downloadTemplate(t,n){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async downloadExportedItemsFile(t,n){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async addNewSceneViaImportFile(t,n,s){return this.request("importItems",{workspaceId:t,entityId:n},{payload:s})}async overwriteScenesViaImportFile(t,n,s){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:s})}async getMe(){return this.request("me",{})}async getWorkspaces(t){const n={page:1,per_page:1,"ws_user_role>status_eq":1,include:"owner",include_ws:t};return this.request("workspaces",{},{params:n})}async getEntityUserRoles(t){const{workspaceId:n,page:s,per_page:o,display_name_like:i,entity_ids:r}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:s,per_page:o,display_name_like:i,entity_ids:r}})}async getTemplateFlowStatuses(t){const{workspaceId:n,entityId:s}=t;return this.request("templateFlowStatuses",{workspaceId:n,entityId:s},{params:{per_page:100,page:t.page??1,all:1,name_like:t.name_like}})}async addNewItem(t,n,s){return this.request("createNewItem",{workspaceId:t,entityId:n},{payload:s})}async getFilterStatuses(t,n,s){return this.request("getFilterStatuses",{workspaceId:t,entityId:n},{params:s})}async getAssignableStatuses(t,n){return console.log("getAssignableStatuses options",n),this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return console.log("getAssignableAssignees options",n),this.request("getAssignableAssignees",{workspaceId:t},{params:n})}}const UX=(e,t,n,s,o,i,r)=>{const{apiServices:a}=ts(n,s),l=V(!1),u=()=>{l.value=!0},c=()=>{mt(()=>{setTimeout(()=>{l.value=!1},500)})},d=Y(()=>!!(o!=null&&o.value&&(i!=null&&i.value))),h=_n("filterParams",null);return{isUpdating:l,handleUpdate:async p=>{var v;const g=p.value;u();try{const C={itemIds:e.value.itemIds,metricId:p.id,workspaceId:String(e.value.workspaceId),filterParams:h!=null&&h.value?h.value:void 0};p.value==null?C.clear=1:C.value=g,d.value?(delete C.itemIds,C.entityId=String(s.entityId)):C.itemIds=e.value.itemIds;const S=await((v=a.value)==null?void 0:v.bulkUpdateMetric(C));(S==null?void 0:S.message)=="Done"&&t(p)}catch(C){console.error("Error during bulk metric update:",C)}c()}}},WX=_t(rt({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{},disabled:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=zA(),s=V([]),o=e,i=t,r=V([]),a=V(null),l=J=>{var ve,ne,L;const ee=s.value.findIndex(H=>H.id===J.id);a.value=ee;const X=(ve=r.value[ee])==null?void 0:ve.$el;(ne=_.value)==null||ne.scrollTo(ee*30),X&&X.scrollIntoView({behavior:"smooth",block:"center"}),u(ee),(L=r.value[ee])==null||L.show()},u=J=>{a.value=J,r.value.forEach((ee,X)=>{X!==J&&ee&&ee.hide()})},c=V(""),d=()=>{c.value="",r.value.forEach(J=>{J==null||J.hide()}),a.value=null},h=Y(()=>o.selectedIds||[]),f=Y(()=>({itemIds:h.value,workspaceId:String(o.workspaceId)})),p=_n("isSelectAll",V(!1)),g=_n("bulkUpdate",V(!1)),v=V(null),{handleUpdate:C,isUpdating:S}=UX(f,J=>{var ee;i("update",J),d(),(ee=v.value)==null||ee.hide()},!1,o,g,p),b=async J=>{var ee;i("update-start");try{await C(J),i("update-completed")}catch{i("update-failed"),(ee=v.value)==null||ee.open()}},w=J=>{d(),mt(()=>{var ee;(ee=_.value)==null||ee.focus()})},_=V(null),R=(J,ee)=>{var X;J?(X=_.value)==null||X.focus():d(),J&&ee!==J&&Z("")},T=V(!0),I=V(!0),{apiServices:x}=ts(!1,o),P=async(J,ee,X)=>{var ve;try{return X?I.value=!0:T.value=!0,await((ve=x.value)==null?void 0:ve.getMetricList({workspaceId:o.workspaceId||"",entityId:o.entityId||"",page:J,query:ee,per_page:10}))}catch(ne){throw console.error("Failed to fetch metric list:",ne),ne}finally{T.value=!1,I.value=!1}},D=V(0),F=V(!0),k=J=>({id:String(J.id),label:String(J.name),value:String(J.id),description:J.morpheme_value?`${String(J.morpheme_value)}`:"",type:n.checkEditType(J),metricConfig:J}),O=J=>J.filter(ee=>!ee.formula).filter(ee=>{var X;return((X=ee==null?void 0:ee.auth_permission)==null?void 0:X.permission)==2}).map(k),B=async()=>{D.value+=1;const J=await P(D.value,c.value,!0);if(J&&J.data){const ee=O(J.data);s.value=[...s.value,...ee],F.value=J.meta.last_page!=J.meta.current_page}else F.value=!1},Z=async J=>{c.value=J,D.value=1;try{const ee=await P(D.value,c.value);ee&&ee.data?(s.value=O(ee.data),F.value=ee.meta.last_page!=ee.meta.current_page):s.value=[]}catch{s.value=[]}};return(J,ee)=>(j(),qe(sf,{ref_key:"wrapperRef",ref:v,isUpdating:U(S),disabled:o.disabled||U(S),onOnVisibleChange:R},{trigger:ge(({hide:X,disabled:ve})=>[fe(vt,{variant:o.variant,loading:U(S),disabled:ve,onEscape:X},{default:ge(()=>[fe(lt,{src:"SquareRootVariable",class:"icon"}),ee[1]||(ee[1]=nt(" Metric ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ge(({isVisible:X,popupRef:ve,hide:ne})=>[Ke(fe(Jr,{ref_key:"searchListRef",ref:_,style:{width:"320px"},options:s.value,loading:T.value,"loading-more":I.value,"selected-id":void 0,"has-more":F.value,onSearch:Z,onSelect:l,onLoadMore:ee[0]||(ee[0]=()=>B()),onCancel:ne},{item:ge(({item:L,index:H,selectedIndex:te})=>[fe(dZ,{ref:he=>r.value[H]=he,label:L.label,type:L.type,morpheme:L.description||"",onFocusOnSearch:w,onOpen:he=>u(H),attachTo:ve,config:L.metricConfig,onHandleUpdate:b,class:Q(["metric-update-item",{selected:a.value===H||te===H}])},null,8,["label","type","morpheme","onOpen","attachTo","config","class"])]),"extra-item":ge(()=>[...ee[2]||(ee[2]=[Re("div",{style:{width:"250px"}},null,-1)])]),"empty-list":ge(()=>[...ee[3]||(ee[3]=[nt("No options available.",-1)])]),_:2},1032,["options","loading","loading-more","has-more","onCancel"]),[[jo,X]])]),default:ge(()=>[ee[4]||(ee[4]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),[["__scopeId","data-v-f5df50e8"]]),Wm=Ql("bulkUpdate",()=>{const e=V(Mt.UNCHECK),t=ao({loaded:0,total:0}),n=c=>{t.total=c},s=c=>{t.loaded=c},o=ao({isBulkUpdating:!1});function i(c){o.isBulkUpdating=c}const r=V({}),a=c=>{r.value=c},l=(c,d)=>{r.value[c]=d},u=c=>{e.value=c};return{bulkUpdateState:o,setIsBulkUpdating:i,selectionIds:r,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:u,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:s,handelSelectAll:()=>{u(Mt.CHECKED)}}}),zX={class:"status-label"},Vk=_t(rt({__name:"StatusItem",props:{status:{},selected:{type:Boolean},focused:{type:Boolean},hovered:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=Jt,s=e,o=t,i=a=>{o("select",a)},r=a=>new Nn(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(j(),ue("div",{class:Q(["status-option",{selected:s.selected,focused:s.focused,hovered:s.hovered}]),onClick:l[0]||(l[0]=u=>i(e.status.id))},[Re("div",{class:"status-color",style:dn({backgroundColor:e.status.color,borderColor:r(e.status.color)})},null,4),Ke((j(),ue("div",zX,[Tt(a.$slots,"label",{},()=>[nt(Ct(e.status.name),1)],!0)])),[[U(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-aeaa75a4"]]),jX=["innerHTML"],Bk=_t(rt({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},callback:{type:Function}},emits:["updated","error","cancel","start-update","finish-update"],setup(e,{expose:t,emit:n}){const s={PER_PAGE:50,INITIAL_PAGE:1},o=e,i=n,r=V([]),a=V(!1),l=V(!1),u=V(null),c=V(s.INITIAL_PAGE),d=V(!0),h=V(0),f=V(""),p=Y(()=>{var O;return(O=o.value)==null?void 0:O.id}),g=Y(()=>!!(o.id||o.ids&&o.ids.length>0)),v=O=>({label:O.name,value:O.id,selected:p.value===O.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:O,id:O.id,color:O.color}),C=Y(()=>{const O=new Set;return o.id&&O.add(String(o.id)),o.ids&&o.ids.forEach(B=>{B&&O.add(String(B))}),Array.from(O)}),S=_n("bulkUpdate",!1),{apiServices:b}=ts(!S,o),w=Wm(),{selectionStatus:_}=Qs(w),R=_n("filterParams",null),T=async(O=s.INITIAL_PAGE,B="",Z=!1)=>{var J,ee,X,ve;if(!g.value){console.error("Missing required props",o);return}Z?l.value=!0:a.value=!0,u.value=null;try{const ne={workspaceId:String(o.workspaceId),itemIds:C.value,page:O,perPage:s.PER_PAGE,name_like:B.trim(),...R||{}};if(((J=b.value)==null?void 0:J.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const L=await((ee=b.value)==null?void 0:ee.getAssignableStatus(ne));if(!(L!=null&&L.data)){Z||(r.value=[]),d.value=!1;return}const H=L.data.map(v);r.value=Z?[...r.value,...H]:H,h.value=((X=L.meta)==null?void 0:X.total)??L.data.length,d.value=!((ve=L.meta)!=null&&ve.on_last_page),c.value=O}catch(ne){console.error("Error fetching statuses:",ne),u.value="Failed to load statuses",Z||(r.value=[]),d.value=!1,i("error",u.value)}finally{a.value=!1,l.value=!1}},I=Di(async O=>{f.value=O,c.value=s.INITIAL_PAGE,await T(s.INITIAL_PAGE,O,!1)},rr),x=async()=>{!d.value||l.value||await T(c.value+1,f.value,!0)},P=()=>{var O;i("cancel"),(O=o.params)==null||O.api.stopEditing()},D=async O=>{var B,Z,J;if(!g.value){console.error("Missing required props for updating status",o);return}try{const ee={workspaceId:String(o.workspaceId),itemIds:C.value,statusId:String(O.value),entityId:String(o.entityId),filterParams:R!=null&&R.value?R==null?void 0:R.value:void 0};if(_.value==Mt.CHECKED&&S&&(ee.itemIds=void 0,ee.entityId=String(o.entityId)),i("start-update"),!await b.value.updateItemStatus(ee))throw new Error("Status update failed: empty response");const ve={workspaceId:String(o.workspaceId),itemIds:C.value,data:{id:O.id,name:O.label,color:O.color}};i("updated",ve),o.params&&((Z=o.params)==null||Z.node.setData({...(B=o.params)==null?void 0:B.node.data,status:{id:O.id,name:O.label,color:O.color}}),(J=o.params)==null||J.api.stopEditing()),i("finish-update")}catch(ee){console.error("Error updating status:",ee),u.value="Failed to update status",i("error",u.value)}},F=Y(()=>r.value.map(O=>({...O})));et([()=>o.id,()=>o.workspaceId,()=>o.ids],()=>{T()},{deep:!0,immediate:!0});const k=V(null);return nn(()=>{mt(()=>{var O;(O=k.value)==null||O.focus()})}),t({refresh:()=>T(s.INITIAL_PAGE,f.value,!1),loadMore:x,focus:()=>{var O;return(O=k.value)==null?void 0:O.focus()}}),(O,B)=>{var Z;return j(),qe(Jr,Xt({ref_key:"popupRef",ref:k},o,{"selected-id":(Z=o.value)==null?void 0:Z.id,options:F.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:u.value,onSearch:U(I),onSelect:D,onLoadMore:x,onCancel:P,onClose:P}),{item:ge(({item:J,selectedIndex:ee,isSelected:X,handleItemHover:ve,getHighlightedLabel:ne,query:L,idx:H})=>[(j(),qe(Vk,{key:J.value,status:J.data,selected:X(J),onMouseover:te=>ve(H),onSelect:te=>D(J),hovered:H===ee},{label:ge(()=>[L?(j(),ue("span",{key:0,class:Q([O.$style["item-label"],O.$style.match]),style:{flex:"1"},innerHTML:ne(J.label)},null,10,jX)):(j(),ue("span",{key:1,class:Q(O.$style["item-label"]),style:{flex:"1"}},Ct(J.label),3))]),_:2},1032,["status","selected","onMouseover","onSelect","hovered"]))]),_:1},16,["selected-id","options","loading","loading-more","has-more","error","onSearch"])}}}),[["__cssModules",{$style:{"item-label":"_item-label_7ir12_1"}}]]),KX=rt({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},disabled:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e,s=Y(()=>{const f=Yn();return f==null?void 0:f.appContext.config.globalProperties.apiServices}),o=t,i=V(!1),r=V(null),a=f=>{i.value=!1,o("updated",f)},l=Y(()=>({apiServices:s.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId}));Zi("bulkUpdate",!0);const u=f=>{var p,g;console.log("Update completed with success:",f),i.value=!1,f?(o("update-completed"),(p=r.value)==null||p.destroy()):(o("update-failed"),(g=r.value)==null||g.open())},c=V(null),d=(f,p)=>{var g;f&&((g=c.value)==null||g.focus())},h=()=>{var f;(f=r.value)==null||f.hide(),i.value=!0,o("update-start")};return et(()=>n.ids,()=>{var f;(f=r.value)==null||f.destroy()}),(f,p)=>(j(),qe(sf,{ref_key:"wrapperRef",ref:r,isUpdating:i.value,disabled:n.disabled||i.value,onOnVisibleChange:d},{trigger:ge(({hide:g,disabled:v})=>[fe(vt,{variant:n.variant,loading:i.value,disabled:v,onEscape:g},{default:ge(()=>[fe(lt,{src:"Square",class:"icon"}),p[2]||(p[2]=nt(" Status ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ge(({hide:g})=>[fe(Bk,Xt({disabled:i.value,ref_key:"statusRef",ref:c},l.value,{onUpdated:a,onCancel:g,onStartUpdate:h,onFinishUpdate:p[0]||(p[0]=v=>u(!0)),onError:p[1]||(p[1]=v=>u(!1)),callback:()=>{}}),null,16,["disabled","onCancel"])]),default:ge(()=>[p[3]||(p[3]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),$k=_t(rt({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0},focusableIndex:{}},emits:["actionExecuted"],setup(e,{expose:t,emit:n}){const s=Ur,o=e,i=Y(()=>(o==null?void 0:o.workspaceId)||""),r=Y(()=>(o==null?void 0:o.entityId)||""),a=()=>{var O,B,Z;return(Z=(O=o.params)==null?void 0:O.api)==null?void 0:Z.getCellRendererInstances({columns:["options"],rowNodes:(B=o.params)!=null&&B.node?[o.params.node]:[]})[0]},l=()=>{var B,Z,J,ee;const O=a();(Z=(B=O==null?void 0:O.componsenExposed)==null?void 0:B.blur)==null||Z.call(B),(ee=(J=O==null?void 0:O.container)==null?void 0:J.parentElement)==null||ee.classList.remove("ag-cell-focus")},u=()=>{var Z,J,ee;(J=(Z=o.params)==null?void 0:Z.api)==null||J.stopEditing(),l();const O=`scene-name-${o.id}`,B=document.getElementById(O);(ee=B==null?void 0:B.__sceneNameEditor)==null||ee.startEdit()},{apiServices:c}=ts(!0,o),d=Y(()=>{var O;return{ws_code:i.value,entity_id:r.value,scene_id:o.id,axiosService:c,optionBlock:o.optionBlock,permissions:(O=o.data)==null?void 0:O.permissions}}),h=O=>{var Z,J,ee,X,ve,ne;let B=(J=(Z=o.params)==null?void 0:Z.api)==null?void 0:J.getRowNode(String(o.id));if(B){const L={...B.data,isDeleted:O==="deleted",isArchived:O==="archived"?!0:B.data.isArchived,isLocked:O==="locked"?!0:B.data.isLocked,disabled:!1};O=="deleted"&&(L.isLocked=!1,L.disabled=!0),O=="unarchived"&&(L.isArchived=!1),(X=(ee=o.params)==null?void 0:ee.api)==null||X.redrawRows({rowNodes:[B]}),B.setData(L),(ne=(ve=o.params)==null?void 0:ve.api)==null||ne.redrawRows({rowNodes:[B]})}},f=tf(),{openSceneHub:p}=f,g=()=>{mt(()=>{var Z,J,ee,X,ve,ne;const O=((J=(Z=o.params)==null?void 0:Z.node)==null?void 0:J.rowIndex)||0,B=((X=(ee=o.params)==null?void 0:ee.column)==null?void 0:X.getColId())||"";(ne=(ve=o.params)==null?void 0:ve.api)==null||ne.setFocusedCell(O,B)})};Y(()=>{var B,Z;const O=(Z=(B=o.params)==null?void 0:B.api)==null?void 0:Z.getRowNode(String(o.id));return O==null?void 0:O.data});const{options:v}=pY(d,h,u,p,g),C=n,S=()=>{var O,B,Z,J,ee,X;console.trace("Focusing current cell for row:",o.id),(X=(O=o.params)==null?void 0:O.api)==null||X.setFocusedCell(((Z=(B=o.params)==null?void 0:B.node)==null?void 0:Z.rowIndex)||0,((ee=(J=o.params)==null?void 0:J.column)==null?void 0:ee.getColId())||"")},b=Y(()=>{var O;return(O=o.params)==null?void 0:O.api}),w=(O,B)=>{var Z,J,ee,X,ve,ne,L,H;if(C("actionExecuted",O),O.id=="copy-link"){(ve=b.value)==null||ve.startEditingCell({rowIndex:(J=(Z=o.params)==null?void 0:Z.node)==null?void 0:J.rowIndex,colKey:(X=(ee=o.params)==null?void 0:ee.column)==null?void 0:X.getColId()});return}else{if(O.id!=="copy-link"&&((ne=b.value)==null||ne.stopEditing()),O.id==="rename")(L=b.value)==null||L.stopEditing(),(H=b.value)==null||H.clearFocusedCell(),l();else if(O.id==="copy-link"){const te=document.getElementById(B);setTimeout(()=>{var he,me,re;(re=(me=(he=te==null?void 0:te.__vueParentComponent)==null?void 0:he.exposed)==null?void 0:me.focus)==null||re.call(me)},300)}else if(["delete-rendition","delete-thumbnail"].includes(O.id)){setTimeout(()=>{S()},300);return}setTimeout(()=>{var te,he;(he=(te=o.params)==null?void 0:te.api)==null||he.clearFocusedCell()},300)}},_=()=>{var O,B;(B=(O=o.params)==null?void 0:O.api)==null||B.stopEditing()},R=O=>{var B,Z,J,ee;return O==="archive"?!((Z=(B=o.params)==null?void 0:B.data)!=null&&Z.isArchived):O==="unarchive"?(ee=(J=o.params)==null?void 0:J.data)==null?void 0:ee.isArchived:!0},T=Y(()=>v.value.map(O=>({...O,options:O.options.filter(B=>!B.hide&&R(B.id))})).filter(O=>O.options.length>0)),I=V({}),x=V(null),P=Y(()=>{var B,Z;if(o.focusableIndex)return o.focusableIndex;const O=(Z=(B=o.params)==null?void 0:B.api)==null?void 0:Z.getRowNode(String(o.id));return`${((O==null?void 0:O.rowIndex)??0)+10}`}),D=(O,B)=>`${P.value}.${O*10+B}`,F=(O,B)=>{if(B&&"focus"in B){I.value[O]=B;return}delete I.value[O]},k=O=>{O.preventDefault(),O.stopPropagation(),O.stopImmediatePropagation()};return nn(()=>{var O;(O=x.value)==null||O.focus()}),t({focus(){var Z;const O=`${P.value}.0`,B=I.value[O];B&&B.focus?B.focus():(Z=x.value)==null||Z.focus()}}),(O,B)=>Ke((j(),ue("div",{onKeydown:k,class:Q([O.$style["more-option-section"],{[O.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:x,tabindex:"0",role:"menu"},[(j(!0),ue(xt,null,xn(T.value,(Z,J)=>(j(),ue("div",{key:Z.id,style:dn({"--g-number":Math.min(Z.options.length,4),"--g-size":Z.type==="column"?"36px":"auto"}),class:Q([O.$style["option-block"],O.$style[Z.type]])},[(j(!0),ue(xt,null,xn(Z.options,(ee,X)=>(j(),ue("div",{key:ee.id,class:Q(O.$style["option-item"])},[fe(YX,{layer:o.layer,"scene-id":String(o.id),option:ee,type:Z.type,onActionExecuted:ve=>w(ve,`more-action-${ve.id}-${o.id}`),focusableIndex:D(J,X),ref_for:!0,ref:ve=>F(D(J,X),ve),onHandleHide:_,id:`more-action-${ee.id}-${o.id}`,label:ee.label},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id","label"])],2))),128))],6))),128))],34)),[[U(s),P.value]])}}),[["__cssModules",{$style:{"more-option-section":"_more-option-section_1jg4p_1","option-block":"_option-block_1jg4p_8","option-item":"_option-item_1jg4p_15",row:"_row_1jg4p_19",column:"_column_1jg4p_25",block:"_block_1jg4p_29"}}]]),qX={key:0,style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center"}},YX=_t(rt({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const s=Ur,o=Jt,i=e,r=V(!1),a=V(!1),l=(I,x)=>{if(!x){p();return}const P=x.target;P.closest(".tippy-content")||P.closest(".tippy-box")||P.closest("[data-tippy-root]")||P.closest(".option-item")||p()},u=V(null),{triggerRef:c,popupRef:d,show:h,isVisible:f,hide:p}=Fs({toggleOnClick:!0,interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:l,appendTo:u.value||void 0}),g=n,v=async I=>{var x,P;if(!a.value){a.value=!0;try{await((P=(x=i.option).action)==null?void 0:P.call(x,I)),g("actionExecuted",i.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1,r.value=!1}}},C=async I=>{var x,P;if(I.preventDefault(),I.stopPropagation(),!a.value){if(i.option.isDanger){r.value=!r.value;return}if(i.option.subMenu)h();else{a.value=!0;try{await((P=(x=i.option).action)==null?void 0:P.call(x,I)),g("actionExecuted",i.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1}return}}},S=I=>{g("actionExecuted",I),p()},b=I=>{I.key==="Escape"&&p()},w=I=>({row:"small",column:"medium",block:"small"})[I]||"medium",_=I=>{const x=i.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...x],column:["menu-item",...x],block:["secondary",...x]}[I]||[]},R=()=>{r.value?r.value=!1:f.value?p():g("handleHide")};t({focus:()=>{mt(()=>{c.value instanceof HTMLElement?c.value.focus():c.value&&"$el"in c.value?c.value.$el.focus():console.warn("Trigger ref is not an HTMLElement:",c.value)})},escape:()=>{p()},select:()=>{C(new MouseEvent("click"))}});const T=I=>{var x;I.stopPropagation(),I.preventDefault(),r.value=!1,(x=c.value)==null||x.focus()};return(I,x)=>{var P;return Ke((j(),ue("div",{ref_key:"wrapperRef",ref:u,class:Q(I.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:Pt(C,["stop","prevent"])},[Ke((j(),qe(vt,{ref_key:"triggerRef",ref:c,class:Q(I.$style["option-item"]),disabled:e.option.disabled||a.value,actived:U(f)||r.value,size:w(e.type),variant:_(e.type),onClick:Pt(C,["stop","prevent"]),onKeydown:b,onEscape:R,label:e.option.label},{prefix:ge(()=>[e.option.icon?(j(),ue("div",qX,[fe(lt,{size:"14",src:e.option.icon,color:e.option.isDanger?void 0:"#a6a6a6",source:"remote"},null,8,["src","color"])])):Je("",!0)]),suffix:ge(()=>[e.option.subMenu?(j(),qe(lt,{key:0,src:"Play",source:"remote"})):Je("",!0),e.option.isDanger&&r.value?(j(),ue("div",{key:1,class:Q(I.$style["confirm-action"])},[Ke((j(),qe(vt,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:T},{default:ge(()=>[fe(lt,{src:"XMarkSolid",source:"remote"})]),_:1})),[[U(s),`${i.focusableIndex}.0`],[U(o),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((j(),qe(vt,{variant:["danger","primary","icon"],size:"small",onClick:Pt(v,["stop","prevent"]),onEscape:x[0]||(x[0]=D=>r.value=!1)},{default:ge(()=>[fe(lt,{src:"Check",source:"remote"})]),_:1})),[[U(s),`${i.focusableIndex}.1`],[U(o),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Je("",!0)]),_:1},8,["class","disabled","actived","size","variant","label"])),[[U(s),i.focusableIndex]]),e.option.subMenu?(j(),ue("div",{key:0,ref_key:"popupRef",ref:d,class:Q(I.$style["submenu-container"])},[fe($k,{focusableIndex:i.focusableIndex,layer:i.layer+1,ref:"submenuRef","option-block":[((P=e.option)==null?void 0:P.subMenu)||[]],"is-submenu":!1,onActionExecuted:S},null,8,["focusableIndex","layer","option-block"])],2)):Je("",!0)],2)),[[U(o),{content:e.option.description,contentClass:["extra-padding"],theme:e.option.isDanger?"warning":"arbo",hideOnClick:!1,delay:[300,0]}]])}}}),[["__cssModules",{$style:{"option-item":"_option-item_8a5qn_1","icon-wrapper":"_icon-wrapper_8a5qn_11","confirm-action":"_confirm-action_8a5qn_19"}}]]),ZX={style:{"max-width":"225px","line-height":"14px"}},XX={style:{"max-width":"100px","line-height":"14px"}},JX=_t(rt({__name:"BulkUpdate",props:{selectRowData:{},workspaceId:{},entityId:{},gridApi:{},selectedAll:{type:Boolean},takeName:{},totalRows:{},visibleRows:{},loading:{type:Boolean}},emits:["close","assignStatus","assignAssignee","assignDate","assignMetric","moreActions","deleteSelected","unselect","updated","selectAll"],setup(e,{emit:t}){const n=Jt,s=Ur,o=e,i=t,r=Wm(),{handelSelectAll:a}=r,{selectionStatus:l}=Qs(r),u=Y(()=>l.value===Mt.CHECKED),c=Y(()=>o.selectRowData.map(me=>me.id)),d=Y(()=>o.selectRowData.length>0);Zi("bulkUpdate",d),Zi("isSelectAll",u);const h=({itemIds:me,data:re})=>{const oe=o.gridApi;me.forEach(z=>{if(!oe){console.error("Grid API is undefined");return}const pe=oe.getRowNode(z);if(pe){const ie={...pe.data,status:re};pe.setData(ie)}})},f=Y(()=>o.selectRowData),p=({itemIds:me,data:re})=>{const oe=o.gridApi;if(!oe){console.error("Grid API is undefined");return}me.forEach(z=>{const pe=oe.getRowNode(z);if(pe){const ie=pe.data.dateRange||[null,null];"startDate"in re&&re.startDate!==void 0&&(ie[0]=re.startDate?new Date(re.startDate):null),"dueDate"in re&&re.dueDate!==void 0&&(ie[1]=re.dueDate?new Date(re.dueDate):null);const be={...pe.data,dateRange:ie};pe.setData(be)}}),i("updated")},g=Y(()=>o.selectRowData.map(me=>me.id)),v=me=>{const re=o.gridApi,{id:oe,value:z}=me;if(!re){console.error("Grid API is undefined");return}g.value.forEach(pe=>{const ie=re.getRowNode(pe);if(ie){const be={...ie.data,[`metric_${oe}`]:z};ie.setData(be)}}),i("updated")},C=["primary"],S=[{label:"Delete Thumbnail",icon:"Image",id:"delete-thumbnail",type:"icon",value:"delete-thumbnail"},{label:"Delete Rendition",icon:"Film",id:"delete-rendition",type:"icon",value:"delete-rendition"},{label:"Unarchive",value:"UnBoxArchive",type:"icon",icon:"BoxArchive",id:"unarchive",clickable:!0},{label:"Archive",value:"BoxArchive",type:"icon",icon:"BoxArchive",id:"archive",clickable:!0},{label:"Delete",value:"delete",type:"icon",icon:"TrashCan",id:"delete",danger:!0,clickable:!0}],b=()=>{i("unselect")},w=Qb(),{userPermissions:_}=Qs(w),R=Y(()=>_.value.includes(eS)),T=Y(()=>{if(!R.value){console.error("User does not have permission to open review.");return}if(l.value==Mt.CHECKED)return ho({type:"review_take",config:{reviewDomain:En.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,take_id:o.entityId}}).url;const me=o.selectRowData.map(oe=>oe.id).join(",");return ho({type:"review_multiple_scenes",config:{reviewDomain:En.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,scene_ids:me}}).url}),I=me=>{console.log("Updating assignees with params:",me);const{assignees:re,type:oe}=me,z=o.gridApi;if(!z){console.error("Grid API is not available for bulk update.");return}o.selectRowData.map(ie=>{const be=z.getRowNode(ie.id);if(!be)return null;const G=be.data.assignees||[];let q=[];switch(oe){case"add":{const ce=new Set(G.map(Fe=>Fe.id)),ke=re.filter(Fe=>!ce.has(Fe.id));q=[...G,...ke];break}case"overwrite":{q=re;break}case"remove":{const ce=new Set(re.map(ke=>ke.id));q=G.filter(ke=>!ce.has(ke.id));break}case"removeAll":{q=[];break}}return{...be.data,assignees:q}}).filter(ie=>ie!==null).forEach(ie=>{const be=z.getRowNode(ie.id);be&&be.setData(ie)})},{apiServices:x}=ts(!1,o),P=async()=>{var z;const me=o.selectRowData.map(pe=>pe.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk delete.");return}const oe=await((z=x.value)==null?void 0:z.bulkDeleteItems(O.value));(oe==null?void 0:oe.message)=="Done"&&(me.forEach(pe=>{const ie=re.getRowNode(pe);if(ie){const be={...ie.data,isDeleted:!0,disabled:!0};ie.setData(be)}}),re.deselectAll())},D=V(null),F=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id);if(!o.gridApi){console.error("Grid API is not available for bulk unarchive.");return}const oe=await((z=x.value)==null?void 0:z.bulkUnarchiveItems(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to unarchive items."),(pe=D.value)==null||pe.open();return}Z(me,"isArchived",!1),(ie=D.value)==null||ie.hide()},k=_n("filterParams",void 0),O=Y(()=>({workspaceId:String(o.workspaceId),itemIds:d.value&&u.value?[]:o.selectRowData.map(me=>me.id),entityId:o.entityId,filterParams:k!=null&&k.value?k.value:void 0})),B=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id);if(!o.gridApi){console.error("Grid API is not available for bulk archive.");return}const oe=await((z=x.value)==null?void 0:z.bulkArchiveItems(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to archive items."),(pe=D.value)==null||pe.open();return}Z(me,"isArchived",!0),(ie=D.value)==null||ie.hide()},Z=(me,re,oe)=>{const z=o.gridApi;if(!z){console.error("Grid API is not available for bulk update.");return}const pe=me.map(ie=>{const be=z.getRowNode(ie);if(be){const G={...be.data,[re]:oe};be.setData(G)}return be}).filter(ie=>ie!=null);console.log("Updated row nodes:",{idsToUpdate:me,rowNodes:pe}),z.redrawRows({rowNodes:pe})},J=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk thumbnail deletion.");return}const oe=await((z=x.value)==null?void 0:z.deleteThumbnail(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to delete thumbnails."),(pe=D.value)==null||pe.open();return}me.forEach(be=>{const G=re.getRowNode(be);if(G){const q={...G.data,thumbnail:null};G.setData(q)}}),(ie=D.value)==null||ie.hide()},ee=async()=>{var z,pe,ie;const me=o.selectRowData.map(be=>be.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk rendition deletion.");return}const oe=await((z=x.value)==null?void 0:z.deleteRendition(O.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to delete renditions."),(pe=D.value)==null||pe.open();return}me.forEach(be=>{const G=re.getRowNode(be);if(G){const q={...G.data,rendition:null};G.setData(q)}}),(ie=D.value)==null||ie.hide()},X=V(!1),ve=V(null),ne=async me=>{var re,oe;try{switch(H.value=!0,X.value=!0,me.id){case"unarchive":await F();break;case"delete":await P();break;case"archive":await B();break;case"delete-thumbnail":await J();break;case"delete-rendition":await ee();break;default:console.error("Unknown action:",me.id),X.value=!1;break}}catch(z){console.error("Error performing action:",z),(re=D.value)==null||re.open()}finally{(oe=ve.value)==null||oe.focus(),mt(()=>{H.value=!1,X.value=!1})}},L=(me,re)=>{var oe;!me&&re&&((oe=ve.value)==null||oe.focus())},H=V(!0),te=me=>{mt(()=>{H.value=me})};et(()=>o.selectRowData,me=>{H.value=!1},{deep:!0,immediate:!0});const he=Y(()=>({workspaceId:o.workspaceId,entityId:o.entityId,variant:C,disabled:H.value,ids:c.value}));return(me,re)=>Ke((j(),ue("div",{class:Q(me.$style["bulk-update-action"])},[Re("div",{class:Q(me.$style["left-actions"])},[Re("div",{class:Q(me.$style["selection-track"])},[fe(vt,{class:Q(me.$style["btn-close"]),variant:["tertiary","icon"],onClick:b,style:{background:"transparent"}},{prefix:ge(()=>[fe(lt,{src:"XMarkSolid",source:"remote"})]),_:1},8,["class"]),U(l)==U(Mt).INDETERMINATE?(j(),ue("span",{key:0,class:Q(me.$style["selected-count"])},Ct(e.selectRowData.length)+" selected ",3)):Je("",!0),U(l)==U(Mt).CHECKED?(j(),ue("span",{key:1,class:Q(me.$style["selected-count"]),style:{"line-height":"14px"}},[re[12]||(re[12]=nt(' All in " ',-1)),Ke((j(),ue("span",ZX,[nt(Ct(e.takeName),1)])),[[U(n),{content:e.takeName}]]),re[13]||(re[13]=nt(' " ',-1))],2)):Je("",!0),!e.loading&&U(l)==U(Mt).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(j(),qe(vt,{key:2,variant:"secondary",onHandleClick:U(a)},{default:ge(()=>[Re("span",{class:Q(me.$style["selected-count"]),style:{"line-height":"14px"}},[re[14]||(re[14]=nt(' Select all in " ',-1)),Ke((j(),ue("span",XX,[nt(Ct(e.takeName),1)])),[[U(n),{content:e.takeName}]]),re[15]||(re[15]=nt(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Je("",!0),Re("span",{class:Q(me.$style.divider)},null,2)],2),fe(KX,Xt(he.value,{onUpdated:h,onUpdateStart:re[0]||(re[0]=oe=>H.value=!0),onUpdateCompleted:re[1]||(re[1]=oe=>te(!1)),onUpdateFailed:re[2]||(re[2]=oe=>te(!1))}),null,16),fe(VY,Xt({onUpdate:I,onUpdateStart:re[3]||(re[3]=oe=>H.value=!0),onUpdateCompleted:re[4]||(re[4]=oe=>te(!1)),onUpdateFailed:re[5]||(re[5]=oe=>te(!1))},he.value),null,16),fe(XY,Xt({"row-selected":f.value},he.value,{onUpdated:p,onUpdateStart:re[6]||(re[6]=oe=>H.value=!0),onUpdateCompleted:re[7]||(re[7]=oe=>te(!1)),onUpdateFailed:re[8]||(re[8]=oe=>te(!1))}),null,16,["row-selected"]),fe(WX,{disabled:H.value,onUpdate:v,onUpdateStart:re[9]||(re[9]=oe=>H.value=!0),onUpdateCompleted:re[10]||(re[10]=oe=>te(!1)),onUpdateFailed:re[11]||(re[11]=oe=>te(!1)),selectedIds:c.value,"workspace-id":e.workspaceId,variant:C,"entity-id":e.entityId},null,8,["disabled","selectedIds","workspace-id","entity-id"]),Re("span",{class:Q(me.$style.divider)},null,2),Ke((j(),ue("div",null,[R.value?(j(),qe(vt,{key:0,class:Q(me.$style["action-button"]),variant:[...C,"icon"],href:T.value,disabled:o.selectRowData.length>40&&U(l)!=U(Mt).CHECKED},{default:ge(()=>[fe(lt,{src:"PenRuler",class:Q(me.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","href","disabled"])):Je("",!0)])),[[U(n),o.selectRowData.length<=40||U(l)==U(Mt).CHECKED?"Open in Review":"Select fewer than 40 items to open in Review"]]),Re("span",{class:Q(me.$style.divider)},null,2),fe(sf,{ref_key:"wrapperRef",ref:D,isUpdating:H.value,disabled:H.value,onOnVisibleChange:L},{trigger:ge(({hide:oe,toggle:z,isVisible:pe,disabled:ie})=>[Ke((j(),qe(vt,{onEscape:oe,actived:pe,ref_key:"moreActionRef",ref:ve,class:Q(me.$style["action-button"]),variant:["secondary","icon"],loading:X.value,disabled:ie||H.value,onClick:Pt(z,["stop"])},{default:ge(()=>[fe(lt,{src:"EllipsisVertical",class:Q(me.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","loading","disabled","onClick"])),[[U(s),"99999"],[U(n),{content:"More actions"}]])]),popup:ge(({isVisible:oe,hide:z})=>[(j(),ue(xt,null,xn(S,(pe,ie)=>fe(eu,Xt({clickable:!0,key:pe.id},{ref_for:!0},pe,{show:oe,style:{borderLeft:0},"focus-index":"99999."+ie,onClick:()=>{ne(pe)},onEscape:z}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1},8,["isUpdating","disabled"])],2)],2)),[[jo,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_1c92i_1","left-actions":"_left-actions_1c92i_19","right-actions":"_right-actions_1c92i_20","selection-track":"_selection-track_1c92i_25","btn-close":"_btn-close_1c92i_31","close-icon":"_close-icon_1c92i_37","selected-count":"_selected-count_1c92i_41",divider:"_divider_1c92i_47","more-button":"_more-button_1c92i_52",dropdown:"_dropdown_1c92i_56","dropdown-content":"_dropdown-content_1c92i_59",delete:"_delete_1c92i_82","icon-btn":"_icon-btn_1c92i_89","selected-list":"_selected-list_1c92i_93"}}]]),Ua=_t(rt({name:"LabelRenderer",__name:"LabelRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=To,n=Jt,s=e,o=Y(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:s.value===void 0||s.value===null||s.value==="",clickable:!0})),{argsMain:i}=ws(o),r=Y(()=>{var u,c,d;return!!((u=s.params)!=null&&u.api||(c=s.params)!=null&&c.node||(d=s.params)!=null&&d.context)}),a=Y(()=>{if(s.tooltip){if(typeof s.tooltip=="string")return{content:s.tooltip};if(typeof s.tooltip=="object"&&"display_name"in s.tooltip){const u=s.tooltip,c=document.createElement("div");c.classList.add("tooltip-user-info"),c.style.display="flex",c.style.alignItems="center",c.style.gap="4px";const d=document.createElement("div"),h=fe(Ih,{id:u.id,name:u.display_name,profile_image:u.profile_image,size:20,initial:u.initial,color:u.color});Yw(h,d);const f=document.createElement("span");f.innerText=u.display_name,f.classList.add("tooltip-user-name");const p=document.createElement("span");p.style.whiteSpace="nowrap",p.innerText="By",c.appendChild(p),c.appendChild(d),c.appendChild(f);const g=document.getElementById("item-table-layout-id");return{content:c,allowHtml:!0,appendTo:g||document.body}}}return{content:void 0}}),l=Y(()=>s.value===void 0);return(u,c)=>Ke((j(),qe(Cs,iR(Lw(U(i))),{default:ge(()=>[Re("span",{class:Q(u.$style["item-table-label-renderer"])},Ct(s.value||"-"),3)]),_:1},16)),[[U(t),{isLoading:l.value||!r.value}],[U(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),QX=["placeholder","maxlength"],eJ={key:0,class:"wrapper-suffix"},tJ=_t(rt({name:"LabelEditor",__name:"LabelEditor",props:{value:{},placeholder:{default:"Enter name"},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},saveOnBlur:{type:Boolean,default:!0},bordered:{type:Boolean},keyboardFocusing:{type:Boolean}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const s=To,o=Jt,i=e,r=n,a=V(i.value),l=V(null),u=V(null),c=V(i.value||""),d=V(!1),h=V(!1),f=Y(()=>{var F;return{disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((F=i.value)==null?void 0:F.length)===0,inputRef:l,wrapperRef:u,clickable:!0,focused:d.value||i.keyboardFocusing}}),{argsMain:p,isHover:g}=ws(f),v=F=>{const k=document.createElement("div");return k.textContent=F,k.innerHTML},C=()=>c.value!==a.value,S=()=>{h.value=!0,d.value=!1,c.value=a.value,r("update:value",a.value),setTimeout(()=>{h.value=!1},100)},b=()=>{if(!d.value||!l.value)return;const F=v(l.value.value);if(!C()){d.value=!1;return}a.value=F,r("update:value",F),r("enter",F),d.value=!1},w=()=>{h.value||(i.saveOnBlur?b():S(),r("blur",c.value))},_=F=>{var k;if(F.key==="ArrowLeft"||F.key==="ArrowRight"){F.stopPropagation();return}F.ctrlKey&&(F.key=="a"||F.key=="A")?(F.stopPropagation(),(k=l.value)==null||k.select()):F.key==="Enter"?(F.preventDefault(),F.stopPropagation(),b()):F.key==="Escape"&&(F.preventDefault(),F.stopPropagation(),S())},R=()=>{a.value=i.value,c.value=i.value,d.value=!0,mt(()=>{var F,k;(F=l.value)==null||F.click(),(k=l.value)==null||k.focus()})},T=()=>{var F;d.value?S():(F=l.value)==null||F.blur(),r("blur",c.value)},I={focus:()=>{R()}};nn(()=>{var k;const F=(k=u.value)==null?void 0:k.$el;F&&(F.__sceneNameEditor=I)}),vs(()=>{const F=u.value;F&&delete F.__sceneNameEditor});const x=V(null),P=V(null);t({focus:R,blur:()=>{var F;return(F=l.value)==null?void 0:F.blur()},save:b,cancel:S,focusEditButton:()=>{mt(()=>{var F;(F=x.value)==null||F.focus()})},focusCancelButton:()=>{mt(()=>{var F;(F=P.value)==null||F.focus()})},startEdit:R});const D=Y(()=>i.value===void 0);return sS(u,()=>{d.value&&w()}),(F,k)=>Ke((j(),qe(U(Cs),Xt(U(p),{ref_key:"wrapperRef",ref:u,bordered:i.bordered,style:{paddingTop:"0px",paddingBottom:"0px"}}),nh({default:ge(()=>[d.value?Je("",!0):Tt(F.$slots,"default",{key:0,isEditting:d.value,isHover:U(g)},()=>[Ke((j(),ue("span",{class:Q(F.$style["label-renderer"])},[nt(Ct(c.value),1)],2)),[[U(o),{content:c.value||void 0}]])]),Ke(Re("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":k[0]||(k[0]=O=>c.value=O),class:Q(F.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:_,onBlur:w},null,42,QX),[[jo,d.value],[ST,c.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:ge(({hovered:O,focused:B})=>[O?(j(),ue("div",eJ,[O&&!B?Ke((j(),qe(vt,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(R,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:x,onKeydown:[zn(Pt(R,["prevent","stop"]),["enter"]),zn(Pt(T,["prevent","stop"]),["escape"])]},{default:ge(()=>[fe(U(lt),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[U(o),"Edit"]]):Je("",!0)])):Je("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[U(s),{isLoading:D.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),nJ=["tabindex"],Hk=_t(rt({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const s=Jt,o=To,i=e,r=n,a=V(i.value),l=V(i.value),u=V(null),c=V(null),d=_n("bulkUpdate",!1),{apiServices:h}=ts(!d,i),f=Y(()=>{var X;return{componentType:void 0,disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((X=a==null?void 0:a.value)==null?void 0:X.length)===0,inputRef:u,wrapperRef:c,clickable:!0}}),{isFocus:p}=ws(f),g=Y(()=>{const X=En.getInstance().getItem("ws.code"),ve=En.getInstance().getItem("BASE_URL"),ne=X||i.workspaceId;return ho({type:"scene_hub",config:{baseDomain:ve,ws_code:ne,scene_id:String(i.id)}}).url}),v=Y(()=>{var X,ve,ne;return((ve=(X=i.data)==null?void 0:X.isProcessing)==null?void 0:ve.state)==0||((ne=i.data)==null?void 0:ne.isDeleted)==!0}),C=Y(()=>i.readOnly||R.value),S=Y(()=>{var X,ve,ne,L,H;return((X=i.data)==null?void 0:X.isDeleted)==!0||((ne=(ve=i.data)==null?void 0:ve.isProcessing)==null?void 0:ne.state)==0||((H=(L=i.data)==null?void 0:L.isProcessing)==null?void 0:H.state)==1}),b=Y(()=>{var X,ve;return(ve=(X=i.data)==null?void 0:X.isProcessing)==null?void 0:ve.message}),w=Y(()=>{var X;return((X=i.data)==null?void 0:X.isArchived)==1}),_=Y(()=>{var X;return((X=i.data)==null?void 0:X.isLocked)==1}),R=Y(()=>i.value===void 0),T=async X=>{var ve,ne,L,H,te,he,me,re,oe,z;a.value=X,p.value=!1;try{const pe=await((ne=(ve=h.value)==null?void 0:ve.updateSceneName)==null?void 0:ne.call(ve,{workspaceId:i.workspaceId,entityId:i.entityId,itemId:i.id,name:a.value})),ie=MF.get(TF)||"UTC";if(pe){const be=PF(pe,ie),G={...i.data,...be};(L=i.params)==null||L.api.clearFocusedCell();const q=((te=(H=i.params)==null?void 0:H.column)==null?void 0:te.getColId())||"",ce=((me=(he=i.params)==null?void 0:he.node)==null?void 0:me.rowIndex)||0;(re=i.params)==null||re.api.setFocusedCell(ce,q),(z=(oe=i.params)==null?void 0:oe.node)==null||z.setData(G),l.value=a.value,r("enter")}else a.value=l.value}catch(pe){console.error("Failed to update scene name:",pe),a.value=l.value}},I={focus:()=>{p.value=!0,mt(()=>{var X;return(X=c.value)==null?void 0:X.focus()})},startEdit:()=>{var X;(X=c.value)==null||X.startEdit()}},x=()=>c.value?"$el"in c.value?c.value.$el:c.value:null;et(()=>i.value,X=>{a.value=X,l.value=X}),nn(()=>{const X=x();X&&(X.__sceneNameEditor=I)}),vs(()=>{const X=c.value,ve=X&&"$el"in X?X.$el:X;ve&&delete ve.__sceneNameEditor});const P=tf(),{openSceneHub:D}=P,F=X=>{try{if(X.ctrlKey||X.metaKey){window.open(g.value,"_blank");return}D(String(i.id))}catch{window.open(g.value,"_blank")}finally{J()}},k=()=>{setTimeout(()=>{ee.value=!0,O.value=0,mt(()=>{var X;(X=B.value)==null||X.focus()})},300)},O=V(-1),B=V(null);t({focus:k,trigerFocus:k,startEdit:()=>{var X;(X=c.value)==null||X.startEdit()}});const Z=X=>{if(X.key==="Enter"){X.preventDefault(),F(X);return}if(X.key==="Escape"){X.preventDefault(),J();return}X.key==="Tab"&&(X.preventDefault(),X.stopPropagation(),X.stopImmediatePropagation(),mt(()=>{var ve;(ve=c.value)==null||ve.focusEditButton()}))},J=()=>{var ne,L,H,te,he,me;ee.value=!1,O.value=-1,(ne=i.params)==null||ne.api.clearFocusedCell();const X=((H=(L=i.params)==null?void 0:L.column)==null?void 0:H.getColId())||"",ve=((he=(te=i.params)==null?void 0:te.node)==null?void 0:he.rowIndex)||0;(me=i.params)==null||me.api.setFocusedCell(ve,X)},ee=V(!1);return(X,ve)=>Ke((j(),qe(tJ,{"save-on-blur":!0,ref_key:"wrapperRef",ref:c,disabled:i.disabled,"read-only":C.value,placeholder:i.placeholder,value:a.value,"onUpdate:value":ve[0]||(ve[0]=ne=>a.value=ne),id:`scene-name-${i.id}`,onEnter:T,"max-length":255,bordered:!0,keyboardFocusing:ee.value,onBlur:J},{default:ge(({isHover:ne,isEditting:L})=>[Ke(Re("div",{class:Q(X.$style["scene-name-display"])},[Ke((j(),ue("a",{tabindex:O.value,ref_key:"nameRef",ref:B,onClick:Pt(F,["prevent"]),onKeydown:Z,target:"_blank",class:Q(X.$style["scene-name-text"]),style:{lineHeight:"28px"}},[nt(Ct(a.value),1)],42,nJ)),[[U(s),{content:a.value,delay:[1e3,0]}]]),C.value||!ne&&!L&&!C.value?(j(),ue(xt,{key:0},[_.value?Ke((j(),ue("div",{key:0,class:Q([X.$style["icon-processing"],X.$style.isLocked])},[fe(lt,{src:"Lock"})],2)),[[U(s),{content:"Locked",delay:[1e3,0]}]]):Je("",!0),w.value?Ke((j(),ue("div",{key:1,class:Q([X.$style["icon-processing"],X.$style.archived])},[fe(lt,{src:"BoxArchive"})],2)),[[U(s),{content:"Archived",delay:[1e3,0]}]]):Je("",!0),S.value?Ke((j(),ue("div",{key:2,class:Q([X.$style["icon-processing"],X.$style.processing,v.value&&X.$style["icon-red"]])},[fe(lt,{src:"AnimatedHourglass",color:"inherit"})],2)),[[U(s),b.value]]):Je("",!0)],64)):Je("",!0)],2),[[jo,!U(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[U(o),{isLoading:R.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_1ws9s_1","scene-name-display":"_scene-name-display_1ws9s_11","icon-processing":"_icon-processing_1ws9s_18",archived:"_archived_1ws9s_28",locked:"_locked_1ws9s_31",processing:"_processing_1ws9s_34","icon-red":"_icon-red_1ws9s_38","scene-name-text":"_scene-name-text_1ws9s_43"}}]]),yS=_t(rt({__name:"ButtonDropdown",props:{label:{},value:{},variant:{},options:{default:()=>[]},size:{},placement:{default:"bottom"},disabled:{type:Boolean},readOnly:{type:Boolean},tabIndex:{}},emits:["select","handleClick"],setup(e,{expose:t,emit:n}){const s=Ur,o=V([]),i=e,r=V(null),a=Y(()=>typeof i.size=="number"?`${i.size}px`:{small:"24px",medium:"32px",large:"48px"}[i.size]??"32px"),l=Y(()=>{let C=[];return typeof i.variant=="string"?C.push(i.variant):Array.isArray(i.variant)&&(C=[...i.variant]),[...C,"icon"]}),u=n,{hide:c,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=Fs({toggleOnClick:!0,offset:[0,0]});function v(C){u("select",C),c()}return th(()=>{g.value&&g.value.setProps({placement:i.placement})}),t({show:h,hide:c,hideDropdown:()=>{c()},popupRef:p}),et(d,C=>{var S;C&&((S=p.value)==null||S.focus())}),(C,S)=>(j(),ue("div",{class:Q(C.$style["button-dropdown-wrapper"]),style:dn({"--button-size":a.value})},[Re("div",{class:Q(C.$style["button-group"])},[Tt(C.$slots,"prefix"),Re("div",{ref_key:"triggerRef",ref:f,class:Q(U(d)?C.$style.open:"")},[Tt(C.$slots,"triggerDropdown",{open:U(d)},()=>[i.readOnly?Je("",!0):Ke((j(),qe(vt,{key:0,onEscape:U(c),ref_key:"mainButton",ref:r,actived:U(d),class:Q(C.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:i.disabled},{default:ge(()=>[Tt(C.$slots,"iconDropdown",{},()=>[fe(lt,{class:Q(C.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[U(s),e.tabIndex]])])],2)],2),Re("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:Q(C.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(j(!0),ue(xt,null,xn(e.options,(b,w)=>Ke((j(),qe(eu,Xt({ref_for:!0,ref:_=>o.value[w]=_,key:b.value},{ref_for:!0},{...b},{"icon-name":b.icon,onClick:Pt(_=>v(b.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:ge(()=>[nt(Ct(b.label),1)]),_:2},1040,["icon-name","onClick"])),[[U(s),`${e.tabIndex}.${w}`]])),128))],2)],6))}}),[["__cssModules",{$style:{"button-dropdown-wrapper":"_button-dropdown-wrapper_1g99p_1","button-group":"_button-group_1g99p_7","overflow-elipsis":"_overflow-elipsis_1g99p_26","button-dropdown-list":"_button-dropdown-list_1g99p_33",show:"_show_1g99p_38","button-dropdown-item":"_button-dropdown-item_1g99p_41","icon-dropdown":"_icon-dropdown_1g99p_48",open:"_open_1g99p_51"}}]]),ff=_t(rt({__name:"CloseBadgeWrapper",props:{disableRemove:{type:Boolean,default:!0},tooltip:{default:"Unassign"}},emits:["clear"],setup(e,{emit:t}){const n=Jt,s=e,o=t,i=a=>{a.preventDefault(),a.stopImmediatePropagation(),a.stopPropagation(),o("clear")},r=Y(()=>({content:s.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(j(),ue("div",{class:Q(a.$style["close-wrapper"])},[e.disableRemove?Je("",!0):(j(),ue("div",{key:0,class:Q(a.$style["close-button"])},[Ke((j(),qe(vt,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:i,size:16,rounded:!0},{default:ge(()=>[fe(lt,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[U(n),r.value]])],2)),Tt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_15u1e_1","close-button":"_close-button_15u1e_5"}}]]),sJ=_t(rt({name:"AssigneeGroupRenderer",__name:"AssigneeGroupRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},maxVisible:{default:4}},setup(e){const t=Jt,n=To,s=e,{isEditing:o}=Ac(s),i=V(s.value),r=V(null),a=V(null),{apiServices:l}=ts(!0,s),u=V(!0),c=()=>{u.value=s.value===void 0};eh(()=>{c()}),nn(()=>{c()}),et(()=>s.value,I=>{c()});const d=Y(()=>({disabled:s.disabled,readOnly:s.readOnly,error:s.error,inputRef:r,wrapperRef:a,clickable:!(s.readOnly||u.value),active:o})),{argsMain:h,isHover:f}=ws(d),p=Y(()=>{var I;return((I=i.value)==null?void 0:I.slice(0,s.maxVisible))||[]}),g=Y(()=>{var I;return Math.max(0,(((I=i.value)==null?void 0:I.length)||0)-s.maxVisible)}),v=Y(()=>{var I;return g.value<=0?"":((I=i.value)==null?void 0:I.slice(s.maxVisible).map(x=>x.name).join(", "))||""}),C=Y(()=>p.value.map(I=>({id:I.id,name:I.name,initial:I.initial,avatarId:I.id,profile_image:I.profile_image,color:I.color,size:24,user:I}))),S=Y(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));et(()=>s.value,I=>{i.value=I},{immediate:!0,deep:!0});const b=async I=>{var P,D,F;await T(I)&&(i.value=(P=i.value)==null?void 0:P.filter(k=>k.id!==I),(F=s.params)==null||F.node.setData({...(D=s.params)==null?void 0:D.node.data,assignees:i.value}))},w=I=>{var P;const x=En.getInstance().getItem("ws.code");return((P=l.value)==null?void 0:P.getUserInformation(x,I))||Promise.resolve(null)},{id:_}=Up(s),R=I=>{var P,D;const x=(D=(P=s.params)==null?void 0:P.api)==null?void 0:D.getRowNode(String(_.value));x==null||x.setDataValue("assignees",$I(I.assignees))},{removeAssignee:T}=mm({...s,entityId:s.entityId,updateRowData:R,value:s.value,errorCallback:()=>{}});return(I,x)=>Ke((j(),qe(Cs,Xt(U(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:ge(()=>{var P;return[Re("div",{class:Q(I.$style.assigneeGroupRenderer)},[((P=i.value)==null?void 0:P.length)===0?(j(),qe(lt,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:dn(S.value)},null,8,["style"])):Je("",!0),(j(!0),ue(xt,null,xn(C.value,D=>(j(),qe(ff,{key:D.id,"disable-remove":s.readOnly||s.disabled,onClear:F=>b(D.id),style:{marginLeft:"0"}},{default:ge(()=>[fe(Oc,{user:D.user,"show-profile":!0,apiUpdateFunction:w,class:Q(I.$style["ib-assignee-avatar"])},null,8,["user","class"])]),_:2},1032,["disable-remove","onClear"]))),128)),g.value>0?Ke((j(),ue("div",{key:1,class:Q(I.$style["extra-avatars"])},[nt(" +"+Ct(g.value),1)],2)),[[U(t),v.value]]):Je("",!0)],2)]}),_:1},16)),[[U(n),{isLoading:u.value}]])}}),[["__cssModules",{$style:{assigneeGroupRenderer:"_assigneeGroupRenderer_14fiu_1","ib-assignee-group-renderer":"_ib-assignee-group-renderer_14fiu_7","ib-assignee-avatar":"_ib-assignee-avatar_14fiu_16","assignee-wrapper":"_assignee-wrapper_14fiu_20","extra-avatars":"_extra-avatars_14fiu_27"}}]]),oJ=_t(rt({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!1},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var R,T;const t=Jt,n=To,s=Eb(),o=e,i=V(null),r=V(null),{isEditing:a}=Ac(o),l=I=>{if(I){if(typeof I=="string")return I;if(I instanceof Date)return I.toISOString()}},u=Y(()=>o.value===void 0),c=Y(()=>{var I;return(I=o.data)==null?void 0:I.isStarted}),d=Y(()=>{var I;return(I=o.data)==null?void 0:I.isCompleted}),h=Y(()=>!!(o.value&&(o.value[0]||o.value[1]))),f=Y(()=>h.value?o.disabled&&!o.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=Y(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,inputRef:i,wrapperRef:r,clickable:!0,active:a})),{argsMain:g}=ws(p),{startDate:v,endDate:C,startClasses:S,endClasses:b,fullStartDate:w,fullEndDate:_}=O7({start:l((R=o.value)==null?void 0:R[0]),end:l((T=o.value)==null?void 0:T[1]),isStarted:c.value,isEnded:d.value,timezone:o.timezone||s});return(I,x)=>Ke((j(),qe(Cs,Xt(U(g),{ref_key:"wrapperRef",ref:r,bordered:!0}),{default:ge(()=>[u.value?Je("",!0):(j(),ue("div",{key:0,class:Q(I.$style.dateRangeRenderer)},[h.value?Je("",!0):(j(),qe(lt,{key:0,src:"Calendar",class:Q(I.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(j(),ue(xt,{key:1},[Ke((j(),ue("span",{class:Q([I.$style.dateLabelDisplay,...U(S).map(P=>I.$style[P])])},[nt(Ct(U(v)),1)],2)),[[U(t),U(w)]]),x[0]||(x[0]=Re("span",null,"→",-1)),Ke((j(),ue("span",{class:Q([I.$style.dateLabelDisplay,...U(b).map(P=>I.$style[P])])},[nt(Ct(U(C)),1)],2)),[[U(t),U(_)]])],64)):Je("",!0)],2))]),_:1},16)),[[U(n),{isLoading:u.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_19wu5_1",calendarIcon:"_calendarIcon_19wu5_8",dateSection:"_dateSection_19wu5_12",dateLabelDisplay:"_dateLabelDisplay_19wu5_19",empty:"_empty_19wu5_29","end-today":"_end-today_19wu5_35",actual:"_actual_19wu5_38","end-tomorrow":"_end-tomorrow_19wu5_41","end-yesterday":"_end-yesterday_19wu5_47","end-past":"_end-past_19wu5_53","end-future":"_end-future_19wu5_59","start-today":"_start-today_19wu5_62","start-tomorrow":"_start-tomorrow_19wu5_68","start-yesterday":"_start-yesterday_19wu5_74","start-past":"_start-past_19wu5_80","start-future":"_start-future_19wu5_86"}}]]),iJ=rt({__name:"DateRangeEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{default:void 0},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{default:Eb()}},emits:["closed"],setup(e,{expose:t,emit:n}){const s=V(null);nn(()=>{mt(()=>{s.value&&s.value.focus()})});const o=e,i=n,r=()=>{var C;(C=o.params)==null||C.api.stopEditing(),i("closed")},a=C=>`${bt.fromJSDate(C,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,l=async C=>{await v({startDate:C[0]?a(C[0]):null,dueDate:C[1]?a(C[1]):null})},u=async()=>{await v({startDate:null})},c=async()=>{await v({dueDate:null})},d=async C=>{await v({startDate:C?a(C):null})},h=async C=>{await v({dueDate:C?a(C):null})},f=async()=>{await v({startDate:null,dueDate:null})},p=_n("bulkUpdate",!1),{apiServices:g}=ts(!p,o),v=async C=>{var S,b,w,_,R;try{const T=(S=s.value)==null?void 0:S.getValues(),I=await((w=(b=g.value)==null?void 0:b.changeDate)==null?void 0:w.call(b,{workspaceId:o.workspaceId,itemIds:[o.id],startDate:C.startDate,dueDate:C.dueDate}));I!=null&&I.message&&((R=o.params)==null||R.node.setData({...(_=o.params)==null?void 0:_.node.data,dateRange:T==null?void 0:T.dateRange}))}catch(T){console.error("Failed to update scene name:",T)}};return t({focus:()=>{mt(()=>{var C;(C=s.value)==null||C.focus()})}}),(C,S)=>(j(),qe(Am,Xt(o,{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:c,onClearStart:u,onClosed:r,ref_key:"calendarRef",ref:s}),null,16))}}),rJ=_t(rt({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=V(null),s=V(0);let o=null;nn(()=>{n.value&&(o=new ResizeObserver(r=>{for(const a of r)s.value=a.contentRect.height}),o.observe(n.value))}),Il(()=>{o&&n.value&&o.unobserve(n.value)});const i=Y(()=>{const r=s.value;return r>120?r-42-36:0});return(r,a)=>(j(),ue("div",{class:Q(r.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[Re("div",{class:Q(r.$style["item-header"])},[Re("div",{class:Q(r.$style["item-header__left"])},[Tt(r.$slots,"header-left",{},()=>[Re("h1",{class:Q(r.$style["item-header__title"])},[Tt(r.$slots,"title",{},()=>[a[0]||(a[0]=nt("Items",-1))])],2)])],2),Re("div",{class:Q(r.$style["item-header__spacer"])},null,2),Re("div",{class:Q(r.$style["item-header__actions"])},[Tt(r.$slots,"header-actions")],2)],2),Tt(r.$slots,"grid",{availableHeight:i.value}),Re("div",{class:Q(r.$style.footer)},[Tt(r.$slots,"footer")],2),Tt(r.$slots,"new-row"),Tt(r.$slots,"bulk-update-actions"),Tt(r.$slots,"snackbar"),Tt(r.$slots,"popup")],2))}}),[["__cssModules",{$style:{"item-table-wrapper":"_item-table-wrapper_1uqb9_1","item-header":"_item-header_1uqb9_14","item-header__left":"_item-header__left_1uqb9_22","item-header__title":"_item-header__title_1uqb9_27","item-header__spacer":"_item-header__spacer_1uqb9_32","item-header__actions":"_item-header__actions_1uqb9_35","main-content":"_main-content_1uqb9_41",sidebar:"_sidebar_1uqb9_48","is-open":"_is-open_1uqb9_64","sidebar-header":"_sidebar-header_1uqb9_68","sidebar-footer":"_sidebar-footer_1uqb9_69","sidebar-content":"_sidebar-content_1uqb9_89",footer:"_footer_1uqb9_94"}}]]),Gk=(e,t)=>{const n=V(Number(e.value.value)),s=Y(()=>e.value.metricConfig),o=Y(()=>{var g,v;const l=s.value,u=t.value,c=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,d=!!e.value.error,h=(l==null?void 0:l.format_type)==="icon",{disabled:f}=e.value;return{pendingCalculation:e.value.value=="N/A"||c&&((g=l==null?void 0:l.metric_type)==null?void 0:g.code)==="formula",isEmpty:c,isError:d,hasPrefix:!c&&!d&&(l==null?void 0:l.morpheme_type)==="prefix",hasSuffix:!c&&!d&&(l==null?void 0:l.morpheme_type)==="suffix",isDropdown:(l==null?void 0:l.format_type)==="dropdown",isFormula:((v=l==null?void 0:l.metric_type)==null?void 0:v.code)==="formula",isLoading:e.value.value===void 0,isRating:h,showActions:u&&!c&&!f}}),i=17,r=Y(()=>{var l;return{maxRating:((l=s.value)==null?void 0:l.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:i}});return{componentState:o,metricConfig:s,ICON_SIZE:i,ratingParams:r,standardNameforIcon:()=>{var u;return(((u=s.value)==null?void 0:u.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},aJ=["aria-label"],Uk=_t(rt({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=To,s=Jt,o=e,i=Gp(!1),r=V(null),a=V(null),{isEditing:l}=Ac(o),u=Y(()=>{var B,Z;return{value:o.value,metricConfig:((Z=(B=o.params)==null?void 0:B.colDef)==null?void 0:Z.context)||o.config,error:o.error,hovered:i.value,readOnly:o.readOnly,disabled:o.disabled,active:l}}),{componentState:c,metricConfig:d,internalValue:h}=Gk(u,i),f=Y(()=>{var Z,J;let B=!1;if(["number","formula"].includes(d.value.metric_type.code)){const ee=Number(o.value),X=Number((Z=d.value)==null?void 0:Z.format_value);Number.isFinite(X)&&X>=0&&(B=(((J=ee.toString().split(".")[1])==null?void 0:J.length)||0)>X)}return B}),p=Y(()=>{var B;return!!((B=d.value)!=null&&B.morpheme_value)||c.value.isEmpty||f.value}),g=Y(()=>{var J,ee,X;if(c.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(c.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(c.value.isEmpty)return;const B=x.value,Z=(J=d.value)==null?void 0:J.morpheme_type;return Z==="prefix"?`${((ee=d.value)==null?void 0:ee.morpheme_value)||""} ${B}`.trim():Z==="suffix"?`${B} ${((X=d.value)==null?void 0:X.morpheme_value)||""}`.trim():B}),v=Y(()=>{const{format_type:B,format_value:Z}=d.value;if(B==="dropdown"&&typeof Z=="string"&&Z.startsWith("["))try{return JSON.parse(Z)}catch{return[]}return[]}),C=Y(()=>({disabled:o.disabled,error:c.value.isError,inputRef:r,wrapperRef:a,clickable:!I.value,readOnly:o.readOnly||I.value,isEmpty:c.value.isEmpty})),{argsMain:S,isHover:b}=ws(C),w=(B,Z,J="en-US")=>new Intl.NumberFormat(J,{minimumFractionDigits:Z,maximumFractionDigits:Z}).format(B),_=Y(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const B=o.value,{format_type:Z,format_value:J,mapping:ee}=d.value;if(ee&&typeof ee=="object"&&!Array.isArray(ee)){const X=ee[`!${B}`];if(X)return X}if(Z==="dropdown"){const X=v.value.find(ve=>String(ve.name)===String(B));if(X)return X.name}if(typeof B=="string"){const X=Number(B);return Number.isNaN(X)?B:B.replace(/[.-]/g,"").length>16?R(B,J):R(X,J)}return typeof B=="number"?R(B,J):String(B)}),R=(B,Z)=>{const J=Number.parseInt(String(Z)||"2",10),ee=Number.isFinite(J)&&J>=0?J:2;try{if(typeof B=="string"){const X=B.split("."),ve=X[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ne=X[1]?X[1].substring(0,ee).padEnd(ee,"0"):"0".repeat(ee);return ee>0?`${ve}.${ne}`:ve}return w(B,ee)}catch(X){return console.error("Error formatting metric value:",X,{num:B,decimals:ee}),String(B)}},T=(B,Z)=>{const J=Number.parseInt(String(Z)||"2",10),ee=Number.isFinite(J)&&J>=0?J:2;try{if(typeof B=="string"){const X=B.split("."),ve=X[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ne=X[1]?X[1].length:0,L=Math.max(ee,ne),H=X[1]?X[1].padEnd(L,"0"):"0".repeat(L);return L>0?`${ve}.${H}`:ve}return new Intl.NumberFormat("en-US",{minimumFractionDigits:ee,maximumFractionDigits:20}).format(B)}catch(X){return console.error("Error formatting exact metric value:",X,{num:B,decimals:ee}),String(B)}},I=Y(()=>{var B;return((B=d.value)==null?void 0:B.metric_type.code)==="formula"}),x=Y(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const B=o.value,{format_type:Z,format_value:J,mapping:ee}=d.value;if(ee&&typeof ee=="object"&&!Array.isArray(ee)){const X=ee[`!${B}`];if(X)return X}if(Z==="dropdown"){const X=v.value.find(ve=>String(ve.name)===String(B));if(X)return X.name}if(typeof B=="string"){const X=Number(B);return Number.isNaN(X)?B:B.replace(/[.-]/g,"").length>16?T(B,J):T(X,J)}return typeof B=="number"?T(B,J):String(B)}),{tooltip:P}=NF(""),D=async B=>{B.stopPropagation(),B.preventDefault(),B.stopImmediatePropagation();try{await navigator.clipboard.writeText(x.value),P.value="Copied",setTimeout(()=>{P.value="Copy"},3e3)}catch(Z){console.error("Failed to copy text:",Z),P.value="Copy failed",setTimeout(()=>{P.value="Copy"},3e3)}};et(()=>o.value,(B,Z)=>{const J=Number(B);Number.isFinite(J)&&J!==h.value?h.value=J:B==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const k=()=>{i.value=!0},O=()=>{i.value=!1};return(B,Z)=>Ke((j(),qe(Cs,Xt(U(S),{onMouseenter:k,style:{"--icon-size":"24px"},onMouseleave:O,ref_key:"wrapperRef",ref:a,actived:U(l),bordered:!0}),{suffix:ge(()=>[o.disabled?Je("",!0):(j(),ue("div",{key:0,class:Q([B.$style.suffix,"wrapper-suffix"])},[i.value&&!U(c).isEmpty&&!U(c).isError?Ke((j(),qe(vt,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(D,["prevent","stop"])},{default:ge(()=>[fe(lt,{src:"Copy",source:"remote",size:12})]),_:1})),[[U(s),{content:U(P),hideOnClick:!1,contentClass:"extra-padding"}]]):Je("",!0)],2))]),default:ge(()=>[Re("div",{class:Q(B.$style["metric-wrapper"]),"aria-label":U(d).format_value||void 0},[Re("div",{class:Q([B.$style["metric-content"],o.disabled?B.$style.disabled:""])},[!U(c).isError&&U(c).isEmpty?(j(),ue(xt,{key:0},[U(c).pendingCalculation?Ke((j(),ue("span",{key:0,class:Q(B.$style["metric-empty"])},[...Z[0]||(Z[0]=[nt(" - ",-1)])],2)),[[U(s),"Can’t calculate yet. Complete required fields."]]):U(c).isEmpty?(j(),ue("span",{key:1,class:Q(B.$style["metric-empty"])}," - ",2)):Je("",!0)],64)):Je("",!0),U(c).isError?Ke((j(),ue("div",{key:1,class:Q(B.$style["metric-error"])},[...Z[1]||(Z[1]=[nt(" Error ",-1)])],2)),[[U(s),"Something went wrong. Review formula, inputs and retry."]]):Je("",!0),!U(c).isEmpty&&!U(c).isError?Ke((j(),ue("span",{key:2,class:Q([B.$style["metric-value"],U(b)?B.$style.hovered:"",{[B.$style.disabled]:o.disabled}])},[nt(Ct(_.value),1)],2)),[[U(s),{content:g.value,bypassOverflowCheck:p.value}]]):Je("",!0)],2)],10,aJ)]),_:1},16,["actived"])),[[U(n),{isLoading:U(c).isLoading}]])}}),[["__cssModules",{$style:{"metric-wrapper":"_metric-wrapper_7otc0_1","metric-content":"_metric-content_7otc0_5",disabled:"_disabled_7otc0_15","metric-value":"_metric-value_7otc0_19",hovered:"_hovered_7otc0_19","metric-error":"_metric-error_7otc0_23","with-morpheme":"_with-morpheme_7otc0_38","with-formula-icon":"_with-formula-icon_7otc0_41","metric-value--number":"_metric-value--number_7otc0_47","metric-value--currency":"_metric-value--currency_7otc0_47","metric-value--percentage":"_metric-value--percentage_7otc0_47","metric-morpheme":"_metric-morpheme_7otc0_51","metric-empty":"_metric-empty_7otc0_64","metric-icon":"_metric-icon_7otc0_71"}}]]),lJ={key:0,style:{color:"#6b6b6b"}},uJ=_t(rt({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue"],setup(e,{emit:t}){const n=Jt,s={START_ASC:{value:"start_asc",label:"Soonest to furthest start",id:"start_asc"},START_DESC:{value:"start_desc",label:"Furthest to soonest start",id:"start_desc"},DUE_ASC:{value:"due_asc",label:"Soonest to furthest due",id:"due_asc"},DUE_DESC:{value:"due_desc",label:"Furthest to soonest due",id:"due_desc"}},o={desc:{value:"desc",label:"Newest to oldest",id:"desc"},asc:{value:"asc",label:"Oldest to newest",id:"asc"}},i={asc:{value:"asc",label:"Smallest to largest",id:"asc"},desc:{value:"desc",label:"Largest to smallest",id:"desc"}},r={asc:{value:"asc",label:"Ascending",id:"asc"},desc:{value:"desc",label:"Descending",id:"desc"}},a=e,l={assignees:"default",completedOn:"date",dateRange:"dateRange",id:"number",isArchived:"default",isCompleted:"default",isDeleted:"default",isProcessing:"default",isStarted:"default",lastUpdated:"date",name:"default",status:"default",permissions:"default",options:"default",disabled:"number"},u=Y(()=>{var F,k;if(a.headerType)return a.headerType;if(((k=(F=a.params)==null?void 0:F.column)==null?void 0:k.getColId()).includes("metric"))return"default";const D=a.headerType??a.params.column.getColId();return l[D]||"default"}),c=V(),d=()=>{var D,F,k;const P=(F=(D=a.params)==null?void 0:D.column)==null?void 0:F.getColDef();if((k=P.colId)!=null&&k.includes("metric")){if(P.context.is_primary==1)return"primary";if(P.context.is_point_metric==1)return"secondary"}};th(()=>{c.value=d()}),nn(()=>{c.value=d()});const h=Y(()=>{var P,D;return((D=(P=a.params)==null?void 0:P.column.getColDef().context)==null?void 0:D.morpheme_value)||void 0}),f=Y(()=>{var P;return(P=a.params)==null?void 0:P.displayName}),p=Y(()=>{let P=[];switch(u.value){case"dateRange":P=Object.values(s).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;case"date":P=Object.values(o).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;case"number":P=Object.values(i).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;default:P=Object.values(r).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break}return v.value!=="none"&&P.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:T.value=="none"}),P}),g=Y(()=>String(v.value).endsWith("asc")?"SortUp":String(v.value).endsWith("desc")?"SortDown":"Sort"),v=V(a.modelValue??"none"),C=P=>{_("update:modelValue",P),_("sort-changed",P)},S=P=>{v.value=P},b=Di(()=>{if(u.value==="date"||u.value==="default"||u.value==="number"){let P;v.value==="none"?P="asc":v.value==="asc"?P="desc":P="none",v.value=P}else{const P=[s.START_ASC.value,s.START_DESC.value,s.DUE_ASC.value,s.DUE_DESC.value,"none"],F=(P.indexOf(v.value)+1)%P.length;v.value=P[F]}},rr),w=Y(()=>{if(v.value==="none")return"No sorting applied";const P=p.value.find(D=>D.value===v.value);return(P==null?void 0:P.label)||""}),_=t,R=Y(()=>{if(a.disabled&&!a.readOnly)return"var(--disabled-color)";if(v.value!=="none")return"var(--primary-color-hover)"});et(()=>a.modelValue,P=>{P!=v.value&&(v.value=P)}),et(v,P=>{P!==a.modelValue&&C(P)});const T=V(v.value);et(()=>v.value,P=>{T.value=P});const I=P=>{var O,B;if(a.readOnly||a.disabled)return;let D=0;P.key==="ArrowDown"?D=1:P.key==="ArrowUp"&&(D=-1);const F=p.value.findIndex(Z=>Z.value===T.value),k=p.value.length;if(P.key==="Enter"||P.key===" ")P.preventDefault(),v.value=T.value,(O=x.value)==null||O.hide();else if(D!==0){P.preventDefault();let Z=(F+D+k)%k;T.value=p.value[Z].value}else P.key==="Escape"&&((B=x.value)==null||B.hide())},x=V(null);return nn(()=>{var P,D;(D=(P=x.value)==null?void 0:P.$el)==null||D.addEventListener("keydown",I)}),Il(()=>{var P,D;(D=(P=x.value)==null?void 0:P.$el)==null||D.removeEventListener("keydown",I)}),(P,D)=>(j(),qe(yS,{ref_key:"dropdownRef",ref:x,options:p.value,label:f.value,readOnly:a.readOnly,disabled:a.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:U(b),onSelect:D[0]||(D[0]=F=>S(F))},{prefix:ge(()=>[fe(vt,{variant:["text"],onClick:U(b),size:"small"},{default:ge(()=>[Ke((j(),ue("b",null,[nt(Ct(f.value),1)])),[[U(n),{content:f.value}]]),h.value?(j(),ue("small",lJ," ("+Ct(h.value)+") ",1)):Je("",!0),c.value=="primary"?Ke((j(),ue("div",{key:1,class:Q(P.$style["icon-metric"])},[fe(lt,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[U(n),"Woohoo metric"]]):Je("",!0),c.value=="secondary"?Ke((j(),ue("div",{key:2,class:Q(P.$style["icon-metric"])},[fe(lt,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[U(n),"Point Metric"]]):Je("",!0)]),_:1},8,["onClick"])]),iconDropdown:ge(()=>[Ke(fe(lt,{src:g.value,source:"remote",color:R.value},null,8,["src","color"]),[[U(n),w.value]])]),_:1},8,["options","label","readOnly","disabled","onHandleClick"]))}}),[["__cssModules",{$style:{"icon-metric":"_icon-metric_nh30n_1",iconSorting:"_iconSorting_nh30n_9","button-group":"_button-group_nh30n_15","ab-table-button":"_ab-table-button_nh30n_26","button-main":"_button-main_nh30n_32","button-dropdown-trigger":"_button-dropdown-trigger_nh30n_37",headerSorting:"_headerSorting_nh30n_47"}}]]),cJ=["disabled","readonly","checked","indeterminate"],Wk=_t(rt({__name:"Checkbox",props:{modelValue:{},disabled:{type:Boolean},readOnly:{type:Boolean},focusIndex:{},tooltipText:{},allowIndeterminate:{type:Boolean},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=Jt,s=Ur,o=e,i=t,r=Y(()=>{if(typeof o.size=="string"){if(["small","medium","large"].includes(o.size))switch(o.size){case"small":return"14px";case"large":return"24px";case"medium":default:return"20px"}if(o.size.endsWith("px"))return o.size}return typeof o.size=="number"?`${o.size}px`:"20px"}),a=Y(()=>o.allowIndeterminate?[Mt.UNCHECK,Mt.INDETERMINATE,Mt.CHECKED]:[Mt.UNCHECK,Mt.CHECKED]),l=Y(()=>{if(typeof o.tooltipText=="string"||!o.tooltipText)return o.tooltipText||"";switch(c.value){case Mt.UNCHECK:return o.tooltipText.unchecked;case Mt.INDETERMINATE:return o.tooltipText.indeterminate;case Mt.CHECKED:return o.tooltipText.checked;default:return""}}),u=()=>{if(h.value)return;const p=(a.value.indexOf(c.value)+1)%a.value.length;c.value=a.value[p]},c=V(typeof o.modelValue=="boolean"?o.modelValue?Mt.CHECKED:Mt.UNCHECK:o.modelValue),d=Y(()=>({checked:c.value===Mt.CHECKED,indeterminate:c.value===Mt.INDETERMINATE,none:c.value===Mt.UNCHECK})),h=Y(()=>o.disabled||o.readOnly);return et(()=>c.value,f=>{i("update:modelValue",f===Mt.CHECKED)}),(f,p)=>Ke((j(),ue("input",{disabled:o.disabled,key:c.value,readonly:o.readOnly,type:"checkbox",class:Q([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:u,"aria-label":"Select All Items",style:dn({"--input-size":r.value})},null,46,cJ)),[[U(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[U(s),o.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_npdz3_84",large:"_large_npdz3_87",medium:"_medium_npdz3_90"}}]]),dJ=_t(rt({name:"HeaderCheckbox",__name:"HeaderCheckbox",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=e,n=Jt,s=Wm(),{setSelectionStatus:o}=s,{rowCount:i,selectionStatus:r}=Qs(s),a=V(new Set);et(r,w=>{o(w)},{immediate:!0});const l=Y(()=>r.value!==Mt.UNCHECK),u=Y(()=>({checked:r.value===Mt.CHECKED,indeterminate:r.value===Mt.INDETERMINATE,UNCHECK:r.value===Mt.UNCHECK})),c=Y(()=>({[Mt.UNCHECK]:"Click to select all",[Mt.INDETERMINATE]:"Click to clear selection",[Mt.CHECKED]:"Click to clear selection"})[r.value]||"Select items"),d=Y(()=>{const w=[{label:"Select all",value:"INDETERMINATE",type:"text",clickable:!0,id:"indeterminate"}];return l.value&&w.push({label:"None",value:"UNCHECK",type:"text",clickable:!0,id:"uncheck"}),w}),h=w=>({selected:w.getSelectedRows().length,total:i.value.total,loaded:i.value.loaded}),f=({api:w,state:_})=>{if(w)if(_===Mt.UNCHECK)w.deselectAll(),a.value.clear(),r.value=_;else if(_===Mt.CHECKED){const R=new Set;w.forEachNode(T=>{T.isSelected()&&R.add(T.id||"")}),a.value=R,w.forEachNode(T=>T.setSelected(!0)),r.value=_}else w.forEachNode(R=>R.setSelected(!0)),r.value=_},p=()=>{var R;const w=(R=t.params)==null?void 0:R.api;if(!w){console.error("[HeaderCheckbox] There is no API available");return}const _={[Mt.UNCHECK]:Mt.INDETERMINATE,[Mt.INDETERMINATE]:Mt.UNCHECK,[Mt.CHECKED]:Mt.UNCHECK};f({api:w,state:_[r.value]})},g=w=>{var T;const _=(T=t.params)==null?void 0:T.api;if(!_){console.error("no api");return}const R={INDETERMINATE:Mt.INDETERMINATE,GLOBAL:Mt.CHECKED,UNCHECK:Mt.UNCHECK};f({api:_,state:R[w]})},v=Di(w=>{const{selected:_,total:R}=h(w);if(R==0){r.value=Mt.UNCHECK;return}_===R?r.value=Mt.CHECKED:_===0?r.value=Mt.UNCHECK:r.value=Mt.INDETERMINATE},300);let C=[];const S=w=>{v(w)};nn(()=>{var I;const w=(I=t.params)==null?void 0:I.api;if(!w)return;const _=x=>v(x.api),R=()=>S(w),T=()=>S(w);w.addEventListener("selectionChanged",_),w.addEventListener("rowDataUpdated",R),w.addEventListener("modelUpdated",R),C=[()=>w.removeEventListener("selectionChanged",_),()=>w.removeEventListener("rowDataUpdated",R),()=>w.removeEventListener("modelUpdated",T)]}),vs(()=>{C.forEach(w=>w())});const b=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(w,_)=>(j(),qe(yS,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:ge(()=>[Ke((j(),qe(Wk,{"tab-index":"8",id:b,disabled:t.disabled,key:U(r),readonly:t.readOnly,type:"checkbox",checked:u.value.checked,indeterminate:u.value.indeterminate,modelValue:U(r),"onUpdate:modelValue":_[0]||(_[0]=R=>gn(r)?r.value=R:null),onChange:p,"aria-label":U(r)===U(Mt).CHECKED?"All items selected":"Select visible items",class:Q(w.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[U(n),{content:c.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_uj7ro_1","button-group":"_button-group_uj7ro_62","button-main":"_button-main_uj7ro_62",headerCheckbox:"_headerCheckbox_uj7ro_66"}}]]),hJ={key:1},fJ=_t(rt({name:"StatusRenderer",__name:"StatusRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=To,n=Jt,s=e,{isEditing:o}=Ac(s),i=V(null),r=V(null),a=Y(()=>s.value),l=Y(()=>a.value===void 0),u=Y(()=>{var g;return((g=a.value)==null?void 0:g.name)||"No status"}),c=Y(()=>{var g;return{disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:Cj((g=a.value)==null?void 0:g.label),inputRef:i,wrapperRef:r,clickable:!s.disabled&&!s.readOnly,active:o}}),{argsMain:d,isHover:h}=ws(c),f=Y(()=>{var g;return((g=a.value)==null?void 0:g.color)||"red"}),p=Y(()=>new Nn(f.value).isLight()?"#000":"#fff");return(g,v)=>Ke((j(),qe(U(Cs),Xt(U(d),{ref_key:"wrapperRef",ref:r,bordered:!0,style:{background:`${f.value} !important`,color:p.value,"--border-color":!U(o)&&!U(h)?"#f3f5f8":void 0}}),{default:ge(()=>[l.value?Je("",!0):(j(),ue("div",{key:0,class:Q(g.$style["status-renderer"])},[a.value?Ke((j(),ue("div",{key:0,class:Q(g.$style["status-renderer__status-name"])},[nt(Ct(u.value),1)],2)),[[U(n),{content:u.value,delay:[1e3,0]}]]):l.value?Je("",!0):(j(),ue("div",hJ,"No status"))],2))]),_:1},16,["style"])),[[U(t),{isLoading:l.value}]])}}),[["__cssModules",{$style:{"status-renderer":"_status-renderer_108pu_1","status-renderer__color-code":"_status-renderer__color-code_108pu_10","status-renderer__status-name":"_status-renderer__status-name_108pu_20"}}]]),zk=_t(rt({__name:"PopupLayout",props:{popupName:{},showOverlay:{type:Boolean,default:!0},overlayOpacity:{default:.5},closeOnOverlayClick:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0}},emits:["shown","hidden"],setup(e,{expose:t,emit:n}){const s=e,{popupRef:o,show:i,hide:r,isVisible:a}=$7({useTrigger:!1,arrow:!1,centered:!0,showOverlay:s.showOverlay,overlayOpacity:s.overlayOpacity,closeOnOverlayClick:s.closeOnOverlayClick,appendTo(c){return document.body}}),l=c=>{s.closeOnEscape&&c.key==="Escape"&&a.value&&r()};nn(()=>{document.addEventListener("keydown",l)}),vs(()=>{document.removeEventListener("keydown",l)}),t({show:i,hide:r,isVisible:a});const u=n;return et(()=>a.value,c=>{u(c?"shown":"hidden")}),(c,d)=>{const h=_o("tooltip");return j(),ue("div",{ref_key:"popupRef",ref:o,class:Q(c.$style.popupContainer)},[Re("div",{class:Q(c.$style.popupWrapper)},[Re("div",{class:Q(c.$style.header)},[Re("span",{class:Q(c.$style["header-title"])},Ct(e.popupName),3),Ke((j(),qe(vt,{style:{position:"absolute",top:"0",right:"0"},variant:"text",onClick:U(r),"aria-label":"Close popup"},{default:ge(()=>[fe(lt,{src:"Xmark"})]),_:1},8,["onClick"])),[[h,"Close"]])],2),Re("div",{class:Q(c.$style.body)},[Tt(c.$slots,"default")],2),Re("div",{class:Q(c.$style.footer)},[Tt(c.$slots,"footer")],2)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_73gw5_1",popupWrapper:"_popupWrapper_73gw5_5",popupFadeIn:"_popupFadeIn_73gw5_1",header:"_header_73gw5_19","header-title":"_header-title_73gw5_28",body:"_body_73gw5_38",footer:"_footer_73gw5_43"}}]]),pJ={...{list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch basic information."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{success:"Deletion successful.",error:"Deletion failed. Please try again."},delete_thumbnail:{success:"Deletion successful.",error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{success:"Deletion successful.",error:"Deletion failed. Please try again."},bulkArchive:{error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."},createNewItem:{},getAssignableAssignees:{},getAssignableStatuses:{},getFilterStatuses:{}},offline:{error:"You are currently offline. Please check your network connection."}};class gJ extends Error{}class Wa extends gJ{constructor(){super("Zone is an abstract class")}}class jk{get type(){throw new Wa}get name(){throw new Wa}get ianaName(){return this.name}get isUniversal(){throw new Wa}offsetName(t,n){throw new Wa}formatOffset(t,n){throw new Wa}offset(t){throw new Wa}equals(t){throw new Wa}get isValid(){throw new Wa}}const wS=new Map;function mJ(e){let t=wS.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),wS.set(e,t)),t}const vJ={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function yJ(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,r,a,l,u,c]=s;return[r,o,i,a,l,u,c]}function wJ(e,t){const n=e.formatToParts(t),s=[];for(let o=0;o<n.length;o++){const{type:i,value:r}=n[o],a=vJ[i];i==="era"?s[a]=r:jm(a)||(s[a]=parseInt(r,10))}return s}const CS=new Map;class zm extends jk{static create(t){let n=CS.get(t);return n===void 0&&CS.set(t,n=new zm(t)),n}static resetCache(){CS.clear(),wS.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=zm.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return SJ(t,n,s,this.name)}formatOffset(t,n){return qm(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const s=mJ(this.name);let[o,i,r,a,l,u,c]=s.formatToParts?wJ(s,n):yJ(s,n);a==="BC"&&(o=-Math.abs(o)+1);const h=bJ({year:o,month:i,day:r,hour:l===24?0:l,minute:u,second:c,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let bS=null;class Bc extends jk{static get utcInstance(){return bS===null&&(bS=new Bc(0)),bS}static instance(t){return t===0?Bc.utcInstance:new Bc(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Bc(qk(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${qm(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${qm(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return qm(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function jm(e){return typeof e>"u"}function Km(e,t=2){const n=e<0;let s;return n?s="-"+(""+-e).padStart(t,"0"):s=(""+e).padStart(t,"0"),s}function Kk(e){if(!(jm(e)||e===null||e===""))return parseInt(e,10)}function CJ(e){if(!(jm(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function bJ(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function SJ(e,t,n,s=null){const o=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const r={timeZoneName:t,...i},a=new Intl.DateTimeFormat(n,r).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function qk(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const s=parseInt(t,10)||0,o=n<0||Object.is(n,-0)?-s:s;return n*60+o}function qm(e,t){const n=Math.trunc(Math.abs(e/60)),s=Math.trunc(Math.abs(e%60)),o=e>=0?"+":"-";switch(t){case"short":return`${o}${Km(n,2)}:${Km(s,2)}`;case"narrow":return`${o}${n}${s>0?`:${s}`:""}`;case"techie":return`${o}${Km(n,2)}${Km(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const Yk=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function $c(...e){const t=e.reduce((n,s)=>n+s.source,"");return RegExp(`^${t}$`)}function Hc(...e){return t=>e.reduce(([n,s,o],i)=>{const[r,a,l]=i(t,o);return[{...n,...r},a||s,l]},[{},null,1]).slice(0,2)}function Zk(...e){return(t,n)=>{const s={};let o;for(o=0;o<e.length;o++)s[e[o]]=Kk(t[n+o]);return[s,null,n+o]}}const Xk=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,EJ=`(?:${Xk.source}?(?:\\[(${Yk.source})\\])?)?`,Jk=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Qk=RegExp(`${Jk.source}${EJ}`),SS=RegExp(`(?:[Tt]${Qk.source})?`),_J=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,RJ=/(\d{4})-?W(\d\d)(?:-?(\d))?/,DJ=/(\d{4})-?(\d{3})/,TJ=Zk("weekYear","weekNumber","weekDay"),IJ=Zk("year","ordinal"),xJ=/(\d{4})-(\d\d)-(\d\d)/,eO=RegExp(`${Jk.source} ?(?:${Xk.source}|(${Yk.source}))?`),FJ=RegExp(`(?: ${eO.source})?`);function Gc(e,t,n){const s=e[t];return jm(s)?n:Kk(s)}function PJ(e,t){return[{year:Gc(e,t),month:Gc(e,t+1,1),day:Gc(e,t+2,1)},null,t+3]}function Uc(e,t){return[{hours:Gc(e,t,0),minutes:Gc(e,t+1,0),seconds:Gc(e,t+2,0),milliseconds:CJ(e[t+3])},null,t+4]}function pf(e,t){const n=!e[t]&&!e[t+1],s=qk(e[t+1],e[t+2]),o=n?null:Bc.instance(s);return[{},o,t+3]}function gf(e,t){const n=e[t]?zm.create(e[t]):null;return[{},n,t+1]}$c(_J,SS),$c(RJ,SS),$c(DJ,SS),$c(Qk),Hc(PJ,Uc,pf,gf),Hc(TJ,Uc,pf,gf),Hc(IJ,Uc,pf,gf),Hc(Uc,pf,gf),Hc(Uc),$c(xJ,FJ),$c(eO),Hc(Uc,pf,gf);function Wc(e){"@babel/helpers - typeof";return Wc=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},Wc(e)}var bs;(function(e){e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}"})(bs||(bs={})),bs.review,bs.review_take,bs.review_scene,bs.review_rendition,bs.review_frame,bs.review_rendition_comment,bs.review_comment,bs.scene_hub,bs.hub_rendition,bs.hub_comment,bs.people_insight,bs.people_detail,bs.project,bs.woohoo,bs.update,bs.core,bs.project_focusMode;var ES=null;function AJ(e){ES=e}function Ym(){if(!ES)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return ES}function tO(){try{var e=Ym();return e.t("errorMessages.fallback.unknownError")}catch{return"An error occurred. Please try again or contact support."}}function kJ(e,t,n,s){var o=e.replace(/{field}/g,t);if(s&&Wc(s)==="object")Object.keys(s).forEach(function(r){var a="{".concat(r,"}"),l=s[r];Array.isArray(l)?l=l.join(", "):r==="value"&&(s.min||s.max)&&(l="".concat(s.min||s.value," and ").concat(s.max||s.value)),o=o.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var i=n[0]||"";n.length>1?i="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(i=n[0].join(", ")),o=o.replace(/{value}/g,i)}return o}function OJ(e,t){for(var n=Object.keys(t),s=0,o=n;s<o.length;s++){var i=o[s],r=Array.isArray(t[i])?t[i].join(", "):String(t[i]);e=e.replace(new RegExp("\\{".concat(i,"\\}"),"g"),r)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function nO(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function sO(e,t){if(!e||Wc(e)!=="object")return null;try{var n=Ym();if(e.validation&&e.validation.fields)for(var s=e.validation.fields,o=Object.keys(s),i=0,r=o;i<r.length;i++){var a=r[i],l=s[a];if(l&&l.rule){var u=l.rule,c=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var C,S=t.toUpperCase();v=(C=p[g])===null||C===void 0||(C=C.errorMessages)===null||C===void 0||(C=C[S])===null||C===void 0||(C=C.validation_rules)===null||C===void 0?void 0:C[u]}if(!v){var b;v=(b=p[g])===null||b===void 0||(b=b.errorMessages)===null||b===void 0||(b=b.GEN)===null||b===void 0||(b=b.validation_rules)===null||b===void 0?void 0:b[u]}if(v&&typeof v=="string")return kJ(v,a,c,d)}catch(w){console.error("Error in validation rules",w)}}}}catch(w){return console.error("Error in getValidationErrorMessage:",w),null}return null}function MJ(e){if(!e)return tO();var t=e.code,n=e.error,s=e.details,o=e.message;if(nO(s)&&s){var i=sO(s,n==null?void 0:n.type);if(console.log("[Error Utils Debug]",i),i)return t!==""?"[".concat(t,"] ").concat(i):i;try{var r=Ym();return r.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(n&&Wc(n)==="object"&&n.type&&n.key){var a=n.type.toUpperCase();try{var l,u,c,d="errorMessages.".concat(a,".").concat(n.key),h=Ym(),f=((l=h.messages)===null||l===void 0?void 0:l.value)||h.messages,p=((u=h.locale)===null||u===void 0?void 0:u.value)||h.locale,g=(c=f[p])===null||c===void 0||(c=c.errorMessages)===null||c===void 0||(c=c[a])===null||c===void 0?void 0:c[n.key];if(g&&typeof g=="string"){var v=g;return s!=null&&s.context&&(v=OJ(v,s.context),console.log("[Error Utils Debug]",v)),t!==""?"[".concat(t,"] ").concat(v):v}}catch(S){console.error("[Error Utils Debug]",S)}}if(n&&Wc(n)!=="object"&&nO(s)){var C=sO(s);if(C)return t!==""?"[".concat(t,"] ").concat(C):C}return o||tO()}var NJ={GEN:{general_error:"General Error",validation_error:"Validation error occurred.",data_locked:"Update failed. Record(s) are locked or currently being updated. You may try again later.",unauthenticated:"Authentication required. Please log in to continue.",unauthorized:"Access denied. You don’t have permission to view this.",not_found:"Resource not found. Check link or try again.",server_error:"Something went wrong on our end. Please try again later.",validation_rules:{required:"The {field} field is required",unique:"The {field} field must be unique",email:"{field} must be a valid email address",emails:"Invalid email(s) pattern",email_exists:"{field} already exists in workspace {value}",regex:"The {field} format is invalid",min:"{field} must be at least {value} characters",max:"{field} cannot exceed {value} characters",between:"{field} must be between {value} characters",numeric:"The {field} must be a number",integer:"The {field} must be an integer",date:"The {field} must be a valid date",after:"The {field} must be after {value}",before:"The {field} must be before {value}",image:"The {field} must be an image",mimes:"The {field} must be a file of type: {value}",max_file_size:"The {field} size cannot exceed {value}MB",confirmed:"The {field} confirmation does not match",same:"The {field} must match {value}",exists:"The Selected {field} is invalid",password_requirements:"The {field} does not meet security requirements",decimal:"Update failed. Maximum allowed decimal places is {value}.",before_or_equal:"{field} must be a date before or equal {value}.",after_or_equal:"{field} must be a date after or equal {value}."}},MRC:{validation_rules:{not_in:"Update failed. These values are not allowed: {value}.",in:"Update failed. Only these values are allowed: {value}.",between:"Update failed. Enter a value between {value}."},excess_decimal_places:"Update failed. Maximum allowed decimal places is {value}."},PPL:{invite_deleted_user:"Invitation failed. Users deleted from the workspace can't be re-invited. Please contact support.",insufficient_seats:"Invitation failed. No seats remaining. Purchase seat(s) to continue."},TM:{NO_ENTITY_TO_UNDEPLOY:"Undeploy failed. No entity specified.",NO_TEAM_EDITOR_ROLE:"No team editor role."},DIR:{has_project_admin_access:"Update failed. User has project access by default.",NO_EDIT_ENTITY_TEAM_ACCESS:"No permission to edit entity team."},AS:{"invalid_field (TBD)":"Something went wrong with account creation. Please contact support."},custom_default_msg:{general:{invalid_data:"Invalid data provided",retry:"Try again later."},network:{offline:"You are currently offline. Please check your network connection.",request_timeout:"Your request has timed out. Please ensure your internet connection is stable.",network_problem:"Network problem. Request timed out. Please try again later.",network_connection_lost:"Network connection lost",gateway_timeout:"Gateway Timeout"},auth:{token_expired:"Token refresh failed"},storage:{storage_limit:"Storage limit exceeded.",thumbnail_size_limit:"Thumbnail picture size can not exceed 2MB!",thumbnail_picture_format:"Thumbnail picture must be image format!",upload_limit:"Your upload exceeds the maximum allowed size"}},fallback:{unknownError:"An error occurred. Please try again or contact support."}};const mf=Ql("toast",()=>{const e=l=>{var u;if((l==null?void 0:l.apiCode)==="offline")o({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const c=MJ((u=l==null?void 0:l.res)==null?void 0:u.data);o({id:l==null?void 0:l.apiCode,type:"error",message:c})}},t=V([]),n=(l,u)=>{const c=pJ[l];if(c){const d=c[u];if(d){o({id:l,type:u,message:d});return}}else o({id:l,type:u,message:l})},s=new Map,o=(l,u=5e3)=>{const c={...l,id:l.id??Date.now()+Math.random()};if(t.value.push(c),u>0){const d=Date.now(),h=setTimeout(()=>{i(c.id),s.delete(c.id)},u);s.set(c.id,{timeoutId:h,remainingTime:u,startTime:d})}};function i(l){t.value=t.value.filter(c=>c.id!==l);const u=s.get(l);u&&(clearTimeout(u.timeoutId),s.delete(l))}function r(l){const u=s.get(l);if(u){clearTimeout(u.timeoutId);const c=Date.now()-u.startTime;u.remainingTime=Math.max(0,u.remainingTime-c)}}function a(l){const u=s.get(l);if(u&&u.remainingTime>0){const c=setTimeout(()=>{i(l),s.delete(l)},u.remainingTime);u.timeoutId=c,u.startTime=Date.now()}}return{notifications:t,addNotification:o,removeNotification:i,showMessage:n,showErrorNetMessage:e,pauseAutoDismiss:r,resumeAutoDismiss:a}}),LJ=["onMouseenter","onMouseleave"],VJ=["innerHTML"],BJ=["innerHTML"],$J=["data-tooltip"],HJ={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},GJ=_t(rt({__name:"Snackbar",setup(e){const t=Jt,n=EU,s=mf(),{removeNotification:o}=s,{notifications:i}=Qs(s),r=f=>f.trim().startsWith("<svg"),a=V("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},u=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},c=V(new Set),d=f=>{var p;c.value.add(f),(p=s.pauseAutoDismiss)==null||p.call(s,f)},h=f=>{var p;c.value.delete(f),(p=s.resumeAutoDismiss)==null||p.call(s,f)};return(f,p)=>(j(),qe(rU,{name:"list",tag:"div",class:Q(["notification-center",f.$style["notification-wrapper"]])},{default:ge(()=>[(j(!0),ue(xt,null,xn(U(i),g=>{var v;return Ke((j(),ue("div",{key:g.id,class:Q([f.$style["notification-item"],f.$style[`notification--${g.type||"info"}`],!(g!=null&&g.actions)||((v=g==null?void 0:g.actions)==null?void 0:v.length)==0?f.$style["snackbar-type"]:""]),onMouseenter:C=>d(g.id),onMouseleave:C=>h(g.id)},[Re("p",{class:Q(f.$style.snackbar__message)},[Re("span",{class:Q(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(j(),qe(lt,{key:0,src:"CircleCheck",source:"remote"})):Je("",!0),!g.icon&&g.type=="interactive"?(j(),qe(lt,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(j(),qe(lt,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&r(g.icon)?(j(),ue("i",{key:3,class:Q(f.$style["icon-draw"]),innerHTML:g.icon},null,10,VJ)):g.icon&&!r(g.icon)?(j(),qe(lt,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Je("",!0)],2),Re("span",{class:Q(f.$style["error-message"])},[Re("span",{class:Q(f.$style.message),innerHTML:g.message},null,10,BJ)],2)],2),g.actions?(j(),ue("div",{key:0,class:Q(f.$style["actions-notification"]),"data-notification":"true"},[(j(!0),ue(xt,null,xn(g.actions,C=>(j(),qe(vt,Xt({key:C.label},{ref_for:!0},C,{onClick:Pt(C.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:ge(()=>[C.btnIcon?(j(),qe(lt,{key:0,src:C.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Je("",!0)]),_:2},1040,["onClick"]))),128))],2)):Je("",!0),g.type!=="interactive"?Ke((j(),ue("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[fe(vt,{variant:"secondary",onClick:C=>u(g.message),class:Q(f.$style["copy-btn"])},{prefix:ge(()=>[fe(lt,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,$J)),[[U(t),a.value]]):Je("",!0),g.type=="interactive"?Ke((j(),ue("div",HJ,[fe(vt,{variant:"tertiary",onClick:C=>U(o)(g.id),class:Q(f.$style["close-btn"]),size:18},{default:ge(()=>[fe(lt,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[U(t),"Close"]]):Je("",!0)],42,LJ)),[[U(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_egqq4_1","notification-item":"_notification-item_egqq4_15","notification--success":"_notification--success_egqq4_30","notification--error":"_notification--error_egqq4_36","close-btn":"_close-btn_egqq4_42","notification--info":"_notification--info_egqq4_45","notification--warning":"_notification--warning_egqq4_52","notification--interactive":"_notification--interactive_egqq4_59","snackbar-type":"_snackbar-type_egqq4_67",snackbar__message:"_snackbar__message_egqq4_76",message:"_message_egqq4_89","error-message":"_error-message_egqq4_97",snackbar__icon:"_snackbar__icon_egqq4_103","actions-notification":"_actions-notification_egqq4_112","icon-draw":"_icon-draw_egqq4_120","copy-btn":"_copy-btn_egqq4_128"}}]]);/*!
|
|
147
147
|
* vue-draggable-next v2.3.0
|
|
148
148
|
* (c) 2025 Anish George
|
|
149
149
|
* @license MIT
|
|
@@ -250,4 +250,4 @@ See ${KN(e,t)}`;return Array.isArray(s)?s.concat(i):[s,i]}var nge={1:"Charting A
|
|
|
250
250
|
If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),jf(c)}if(a.length>0&&o){const l=this.beans.frameworkOverrides.getDocLink(o);jf(`to see all the valid ${s} properties please check: ${l}`)}}};function Ege(e,t,n){const s={},o=e.filter(i=>!t.some(r=>r===i));if(o.length>0)for(const i of o)s[i]=s0({inputValue:i,allSuggestions:n}).values;return s}var _ge=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),Rge={moduleName:"Validation",version:ut,beans:[Sge]};function j2(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var Dge=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(i=>{const r=i.childrenAfterFilter&&i.childrenAfterFilter.length>0,a=i.data&&this.filterManager.doesRowPassFilter({rowNode:i});return r||a}):s.childrenAfterFilter=s.childrenAfterGroup,j2(s)};if(this.doingTreeDataFiltering()){const s=(i,r)=>{if(i.childrenAfterGroup)for(let a=0;a<i.childrenAfterGroup.length;a++){const l=i.childrenAfterGroup[a],u=r||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?s(i.childrenAfterGroup[a],u):n(l,u)}n(i,r)},o=i=>s(i,!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")}},Tge=class extends k0{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,n,s,o){this.comp=e;const i=Qf(this,this.beans.context,o);this.eButtonShowMainFilter=n,this.eFloatingFilterBody=s,this.setGui(t,i),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(i),this.setupLeft(i),this.setupHover(i),this.setupFocus(i),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(i),this.setupUi(),i.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(i);const r=()=>this.onColDefChanged(i);i.addManagedListeners(this.column,{colDefChanged:r}),i.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&r()}}),i.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 Ft(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=di("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new Cd(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();id(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){var r;const{beans:t}=this;if(Un(t)===this.eGui)return;const o=Su(t,this.eGui,null,e.shiftKey);if(o){(r=t.headerNavigation)==null||r.scrollToColumn(this.column),e.preventDefault(),o.focus();return}const i=this.findNextColumnWithFloatingFilter(e.shiftKey);i&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:i},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;Ru(e);case Oe.ENTER:t&&bu(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&&pu(e.relatedTarget,"ag-floating-filter");if(n&&s&&e.target===this.eGui){const o=this.lastFocusEvent,i=!!(o&&o.key===Oe.TAB);if(o&&i){const r=o.shiftKey;bu(this.eGui,r)}}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 A0(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=i=>{if((i==null?void 0:i.source)==="filterDestroyed"&&(!this.isAlive()||!(t!=null&&t.isAlive())))return;const r=this.comp.getFloatingFilterComp();r&&r.then(a=>{if(a){if(s.get("enableFilterHandlers")){const c=i;let d="filter";c!=null&&c.afterFloatingFilter?d="ui":c!=null&&c.afterDataChange?d="dataChanged":(i==null?void 0:i.source)==="api"&&(d="api"),this.updateFloatingFilterParams(this.userCompDetails,d);return}const l=t==null?void 0:t.getCurrentFloatingFilterParentModel(n),u=i?{...i,columns:i.columns??[],source:i.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,u)}})};[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,i=this.comp.getFloatingFilterComp();!i||!o?this.updateCompDetails(e,o,n):i.then(r=>{!r||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 i;typeof(o==null?void 0:o.refresh)=="function"&&(this.gos.get("enableFilterHandlers")&&(n={...n,model:Ts(((i=this.beans.colFilter)==null?void 0:i.model)??{},this.column.getColId()),source:t}),o.refresh(n))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function Ige(e,t){var s;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}(s=e.menuSvc)==null||s.showColumnMenu({column:n,positionBy:"auto"})}function xge(e){var t;(t=e.menuSvc)==null||t.hidePopupMenu()}var Fge={moduleName:"SharedMenu",version:ut,beans:[Hle],apiFunctions:{showColumnMenu:Ige,hidePopupMenu:xge}},Pge=class extends lae{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(),i=this.getParentRect();this.setAlignedTo(t,n);let r=!1;const a=()=>{const l=this.keepXYWithinBounds(n,o.top-i.top,0),u=n.clientWidth>0?n.clientWidth:200;r||(n.style.minWidth=`${u}px`,r=!0);const d=i.right-i.left-u;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-i.left-2}function p(){return o.left-i.left-u}};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 i=this.gos.getCallback("postProcessPopup");if(i){const{column:r,rowNode:a}=e;i({column:r,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 pa(e)}},Ey={moduleName:"Popup",version:ut,beans:[Pge]},Age=".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 kge(e){const t=e.filterManager;return!!(t!=null&&t.isColumnFilterPresent())||!!(t!=null&&t.isAggregateFilterPresent())}function Oge(e,t){var n;return((n=e.filterManager)==null?void 0:n.getColumnFilterInstance(t))??Promise.resolve(void 0)}function Mge(e,t){var s;const n=e.colModel.getColDefCol(t);if(n)return(s=e.colFilter)==null?void 0:s.destroyFilter(n,"api")}function Nge(e,t){e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=e.filterManager)==null?void 0:n.setFilterModel(t)})}function Lge(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function Vge(e,t,n){const{gos:s,colModel:o,colFilter:i}=e;n&&!s.get("enableFilterHandlers")&&(Xe(288),n=!1);const r=o.getColDefCol(t);return r?(i==null?void 0:i.getModelForColumn(r,n))??null:null}function Bge(e,t,n){var s;return((s=e.filterManager)==null?void 0:s.setColumnFilterModel(t,n))??Promise.resolve()}function $ge(e,t){var s;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}(s=e.menuSvc)==null||s.showFilterMenu({column:n,containerType:"columnFilter",positionBy:"auto"})}function Hge(e){var t;(t=e.menuSvc)==null||t.hideFilterMenu()}function Gge(e,t){var s;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}return(s=e.colFilter)==null?void 0:s.getHandler(n,!0)}function Uge(e,t){const{colModel:n,colFilter:s,gos:o}=e;if(!o.get("enableFilterHandlers")){Xe(287);return}const{colId:i,action:r}=t;if(i){const a=n.getColById(i);a&&(s==null||s.updateModel(a,r))}else s==null||s.updateAllModels(r)}var Wge={filterHandler:()=>({doesFilterPass:()=>!0})},zge=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={...sV},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:i}=this.beans;if(o!=null&&o.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const r=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((u,c)=>{const d=e[c];r.push(this.setModelOnFilterWrapper(u,d)),l.delete(c)}),l.forEach(u=>{const c=s.getColDefCol(u)||s.getCol(u);if(!c){Xe(62,{colId:u});return}if(!c.isFilterAllowed()){Xe(63,{colId:u});return}const d=this.getOrCreateFilterWrapper(c,!0);if(!d){Xe(64,{colId:u});return}r.push(this.setModelOnFilterWrapper(d,e[u],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{r.push(this.setModelOnFilterWrapper(l,null))});jn.all(r).then(()=>{const l=this.getModel(!0),u=[];this.allColumnFilters.forEach((c,d)=>{const h=a?a[d]:null,f=l?l[d]:null;Mf(h,f)||u.push(c.column)}),u.length>0?i==null||i.onFilterChanged({columns:u,source:t}):n&&this.updateActive("filterChanged")})}getModel(e){var i;const t={},{allColumnFilters:n,initialModel:s,beans:{colModel:o}}=this;if(n.forEach((r,a)=>{const l=this.getModelFromFilterWrapper(r);dt(l)&&(t[a]=l)}),!e)for(const r of Object.keys(s)){const a=s[r];dt(a)&&!n.has(r)&&((i=o.getCol(r))!=null&&i.isFilterAllowed())&&(t[r]=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 i=s.state;i!=null&&(n=!0,t[o]=i)}),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"?(Xe(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=u=>u?u.isFilterActive?u.isFilterActive():(Xe(67),!1):!1,{colModel:t,gos:n}=this.beans,s=!!LE(n),o=u=>{if(!u.isPrimary())return!0;const d=!t.isPivotActive();return!u.isValueActive()||!d?!1:t.isPivotMode()?!0:s},i=[],r=[],a=(u,c,d)=>{c&&(o(u)?i.push(d):r.push(d))},l=[];return this.allColumnFilters.forEach(u=>{const c=u.column,d=c.getColId();if(u.isHandler)l.push(jn.resolve().then(()=>{a(c,this.isHandlerActive(c),{colId:d,isHandler:!0,handler:u.handler,handlerParams:u.handlerParams})}));else{const h=ll(u);h&&l.push(h.then(f=>{a(c,e(f),{colId:d,isHandler:!1,comp:f})}))}}),jn.all(l).then(()=>{this.activeAggregateFilters=i,this.activeColumnFilters=r})}updateFilterFlagInColumns(e,t){var s;const n=[];return this.allColumnFilters.forEach(o=>{const i=o.column;if(o.isHandler)n.push(jn.resolve().then(()=>{this.setColFilterActive(i,this.isHandlerActive(i),e,t)}));else{const r=ll(o);r&&n.push(r.then(a=>{this.setColFilterActive(i,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,i=n?this.activeAggregateFilters:this.activeColumnFilters,r=n?o:s,a=this.model;for(let l=0;l<i.length;l++){const u=i[l],{colId:c,isHandler:d}=u;if(c!==t)if(d){const{handler:h,handlerParams:f}=u;if(!h.doesFilterPass({node:e,data:r,model:Ts(a,c),handlerParams:f}))return!1}else{const h=u.comp;if(typeof h.doesFilterPass!="function"){Sn(91);continue}if(!h.doesFilterPass({node:e,data:r}))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,u;const{column:i,isHandler:r}=o;s!==i.getColId()&&(r&&((l=(a=o.handler).onAnyFilterChanged)==null||l.call(a)),(u=ll(o,r))==null||u.then(c=>{typeof(c==null?void 0:c.onAnyFilterChanged)=="function"&&c.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 i,r;const s=n.isHandler;s&&((r=(i=n.handler).onNewRowsLoaded)==null||r.call(i));const o=ll(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,i)=>{const r=i?s.getCol(i):e;return r?n.getValue(r,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=dt(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?ll(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const n=ll(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 Woe(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":Aae(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,n,s,o,i){const r=()=>{const u=this.createFilterCompParams(e,o,i),c=s(u,o);return Kie(this.beans.userCompFactory,t,c,n)},a=r();return a?{compDetails:a,createFilterUi:u=>(u?r():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:i,handlerParams:r,handlerGenerator:a}=this.createHandler(e,t,n)??{},l=this.createFilterComp(e,t,n,s,!!i,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:i,handlerGenerator:a,handlerParams:r};const{compDetails:u,createFilterUi:c}=l;return this.isGlobalButtons&&((h=(d=u.params)==null?void 0:d.buttons)!=null&&h.length||Xe(281,{colId:e.getColId()})),{compDetails:u,handler:i,handlerGenerator:a,handlerParams:r,createFilterUi:c}}createBaseFilterParams(e,t){const{filterManager:n,rowModel:s}=this.beans;return Ft(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),i=this.createBaseFilterParams(e,s);if(i.filterChangedCallback=o,i.filterModifiedCallback=s?()=>{}:r=>this.filterModified(e,r),t){const r=i,a=e.getColId(),l=Ts(this.model,a);r.model=l,r.state=this.state.get(a)??{model:l},r.onModelChange=(u,c)=>{this.updateStoredModel(a,u),this.refreshHandlerAndUi(e,u,"ui",!1,c).then(()=>{o({...c,source:"columnFilter"})})},r.onStateChange=u=>{this.updateState(e,u),this.updateOrRefreshFilterUi(e)},r.onAction=(u,c,d)=>{this.updateModel(e,u,c),this.dispatchLocalEvent({type:"filterAction",column:e,action:u,event:d})},r.getHandler=()=>this.getHandler(e,!0),r.onUiChange=u=>this.filterUiChanged(e,u),r.source=n}return i}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:i}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),l=>l),r=e.getColId();if(n)return delete this.initialModel[r],(a=n.init)==null||a.call(n,{...o,source:"init",model:Ts(this.model,r)}),{column:e,isHandler:!0,handler:n,handlerGenerator:s,handlerParams:o,filterUi:this.createFilterUiForHandler(t,i)};if(i){const l={column:e,filterUi:null,isHandler:!1};return l.filterUi=this.createFilterUiLegacy(t,i,u=>{l.filter=u??void 0}),l}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,n){var f;const{gos:s,frameworkOverrides:o,registry:i}=this.beans;let r;const a=p=>{const g=p.filter;if(EL(g)){const v=g.handler;return v||(r=g.doesFilterPass,r?()=>({doesFilterPass:r}):void 0)}return typeof g=="string"?g:void 0},l=s.get("enableFilterHandlers"),u=l?a(t):void 0,c=p=>()=>this.createBean(i.createDynamicBean(p,!0));let d,h;if(typeof u=="string"){const p=(f=s.get("filterHandlers"))==null?void 0:f[u];p!=null?d=p:Cae.has(u)&&(d=c(u),h=u)}else d=u;if(!d){let p;const{compName:g,jsComp:v,fwComp:C}=IL(o,t);g?p=g:v==null&&C==null&&t.filter===!0&&(p=n),h=this.handlerMap[p],h&&(d=c(h))}return d?{filterHandler:d,handlerNameOrCallback:r??h}:l?(os(s)&&Xe(277,{colId:e.getColId()}),Wge):void 0}createHandler(e,t,n){const s=this.createHandlerFunc(e,t,n);if(!s)return;const o=UE(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:i,filterHandler:r}=s,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,r,o);return{handler:a,handlerParams:l,handlerGenerator:i??r}}createHandlerFromFunc(e,t,n){const s=e.getColDef(),o=t(Ft(this.gos,{column:e,colDef:s})),i=this.createHandlerParams(e,n);return{handler:o,handlerParams:i}}createHandlerParams(e,t){const n=e.getColDef(),s=e.getColId(),o=this.filterChangedCallbackFactory(e);return Ft(this.gos,{colDef:n,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:i=>{var r;return((r=this.beans.filterManager)==null?void 0:r.doesRowPassOtherFilters(s,i))??!0},onModelChange:(i,r)=>{this.updateStoredModel(s,i),this.refreshHandlerAndUi(e,i,"handler",!1,r).then(()=>{o({...r,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:n,groupFilter:s}=this.beans;this.allColumnFilters.forEach((i,r)=>{let a;i.column.isPrimary()?a=t.getColDefCol(r):a=t.getCol(r),!(a&&a===i.column)&&(e.push(i.column),this.disposeFilterWrapper(i,"columnChanged"),this.disposeColumnListener(r))});const o=s&&e.every(i=>s.isGroupFilter(i));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,i=h=>{const f=this.getOrCreateFilterUi(e);f!=null&&f.then(p=>{h(tp(p))})},r=e.getColDef(),a=o!=null&&o.isSelectable(r)?o.getFilterDef(e,r):r,l=Lae(s,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",u=this.gos.get("enableFilterHandlers"),c=UE(n,a,this.createFilterCompParams(e,u,"init",!0)),d=Ft(this.gos,{column:e,filterParams:c,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t});if(u){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 Jie(n,r,d,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,n,s){const o="paramsUpdated";if(e.isHandler){const i=t.getColId();delete this.initialModel[i],this.state.delete(i);const r=e.filterUi,a=this.createFilterUiForHandler(n,s);e.filterUi=a;const l=this.eventSvc;r!=null&&r.created?r.promise.then(u=>{this.destroyBean(u),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 i;o&&this.isAlive()&&((i=this.beans.filterManager)==null||i.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:i}=e,r=s.getColId();o&&(n=this.isHandlerActive(s),this.destroyBean(e.handler),delete this.model[r],this.state.delete(r));const a=()=>{this.setColFilterActive(s,!1,"filterDestroyed"),this.allColumnFilters.delete(r),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:s})};if(i){if(i.created)return i.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,_;const n=this.allColumnFilters.get(e);if(!n)return;const s=this.beans,o=n.column,i=o.getColDef(),r=o.isFilterAllowed(),a=this.getDefaultFilter(o),l=s.selectableFilter,u=l!=null&&l.isSelectable(i)?l.getFilterDef(o,i):i,c=r?this.createHandlerFunc(o,u,this.getDefaultFilter(o)):void 0,d=!!c,h=n.isHandler;if(h!=d){this.destroyFilter(o,"paramsUpdated");return}const{compDetails:f,createFilterUi:p}=(r?this.createFilterComp(o,u,a,R=>R,d,"colDef"):null)??{compDetails:null,createFilterUi:null},g=(f==null?void 0:f.params)??UE(s.userCompFactory,u,this.createFilterCompParams(o,d,"colDef"));if(h){const R=(c==null?void 0:c.handlerNameOrCallback)??(c==null?void 0:c.filterHandler),T=Ts(this.model,e);if(n.handlerGenerator!=R){const I=n.handler,{handler:x,handlerParams:P}=this.createHandlerFromFunc(o,c.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(I),T!=null&&((C=this.beans.filterManager)==null||C.onFilterChanged({columns:[o],source:t}))}else{const I=this.createHandlerParams(o,f==null?void 0:f.params);n.handlerParams=I,(b=(S=n.handler).refresh)==null||b.call(S,{...I,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,(_=ll(n,h))==null||_.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 i=this.cachedFilter(e);if(!i)return s&&this.getOrCreateFilterWrapper(e,!0),jn.resolve();if(!i.isHandler)return jn.resolve();const{filterUi:r,handler:a,handlerParams:l}=i;return bae(()=>{if(r){const{created:u,filterParams:c}=r;if(u)return r.promise.then(d=>d?{filter:d,filterParams:c}:void 0);r.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,i=e.getColId(),r=s.get(i);return r?r.model??null:Ts(o,i)}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(i=>{s=i});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 c;const s=e.filter,o=s===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):s;if(typeof o!="string")return;let i,r;const a=this.beans,{filterParams:l,filterValueGetter:u}=e;o==="agMultiColumnFilter"?{filterParams:i,filterValueGetter:r}=((c=a.multiFilter)==null?void 0:c.getParamsForDataType(l,u,t,n))??{}:{filterParams:i,filterValueGetter:r}=xae(o,l,u,t,n,a,this.getLocaleTextFunc()),e.filterParams=i,r&&(e.filterValueGetter=r)}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 i=e.column,r=i.getColId(),a=this.model[r];if(this.updateStoredModel(r,t),n&&t===a){s();return}this.refreshHandlerAndUi(i,t,"api").then(()=>s());return}const o=ll(e);if(o){o.then(i=>{if(typeof(i==null?void 0:i.setModel)!="function"){Xe(65),s();return}(i.setModel(t)||jn.resolve()).then(()=>s())});return}s()})}updateStoredModel(e,t){dt(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 r;const s=e.getColId(),o=this.cachedFilter(e),i=()=>o==null?void 0:o.filterUi;rV(t,i,()=>Ts(this.model,s),()=>this.state.get(s),a=>this.updateState(e,a),a=>{var l,u;return(u=(l=i())==null?void 0:l.filterParams)==null?void 0:u.onModelChange(a,n)},o!=null&&o.isHandler?(r=o.handler.processModelToApply)==null?void 0:r.bind(o.handler):void 0)}updateAllModels(e,t){const n=[];this.allColumnFilters.forEach((s,o)=>{var r;const i=this.beans.colModel.getColDefCol(o);i&&rV(e,()=>s.filterUi,()=>Ts(this.model,o),()=>this.state.get(o),a=>this.updateState(i,a),a=>{this.updateStoredModel(o,a),this.dispatchLocalEvent({type:"filterAction",column:i,action:e}),n.push(this.refreshHandlerAndUi(i,a,"ui"))},s!=null&&s.isHandler?(r=s.handler.processModelToApply)==null?void 0:r.bind(s.handler):void 0)}),n.length&&jn.all(n).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();iV(()=>{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 i=e.get(o);if(i.valid===!1)return!1;(i.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 jge(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function Kge(e,t="api"){var n;(n=e.filterManager)==null||n.onFilterChanged({source:t})}var qge=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(){LE(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 i;const o={source:t,type:"filterChanged",columns:s};n&&so(o,n),this.eventSvc.dispatchEvent(o),(i=this.colFilter)==null||i.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.colFilter)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilter)!=null&&e.isFilterPresent())}updateAggFiltering(){this.aggFiltering=!!LE(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(){Xe(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()}},Yge=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 i;(i=this.popupSvc)==null||i.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,i="left";const r=$o(this.gos);!r&&this.gos.get("enableRtl")&&(o=1,i="right");const a=r?void 0:4*o,l=r?void 0:4;this.showPopup(e,u=>{var c;(c=this.popupSvc)==null||c.positionPopupByComponent({type:n,eventSource:t,ePopup:u,nudgeX:a,nudgeY:l,alignSide:i,keepWithinBounds:!0,position:"under",column:e})},n,t,r,s)}showPopup(e,t,n,s,o,i){var g;const r=e?this.createBean(new Tae(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!(r!=null&&r.hasFilter())||!e){Sn(57);return}const a=rs({tag:"div",cls:`ag-menu${o?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:v=>this.trapFocusWithin(v,a)}),a.appendChild(r==null?void 0:r.getGui());let l;const u=()=>r==null?void 0:r.afterGuiDetached(),c=zoe(this.gos)?s??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,d=v=>{FV(e,!1,"contextMenu");const C=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),C&&s&&mr(s)){const S=ML(s);S==null||S.focus({preventScroll:!0})}u(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,n,e),i==null||i()},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:c,ariaLabel:f});p&&(this.hidePopup=l=p.hideFunc),r.afterInit().then(()=>{t(a),r.afterGuiAttached({container:n,hidePopup:l})}),FV(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,n,e)}trapFocusWithin(e,t){e.key!==Oe.TAB||e.defaultPrevented||Su(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),bu(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()}},Zge=class extends We{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,n){if(!t)return;const s=e.getColDef(),{selectableFilter:o,valueSvc:i}=this.beans,r=n??(o==null?void 0:o.getFilterValueGetter(e.getColId()))??s.filterValueGetter;return r?this.executeFilterValueGetter(r,t.data,e,t,s):i.getValue(e,t)}executeFilterValueGetter(e,t,n,s,o){const{expressionSvc:i,valueSvc:r}=this.beans,a=Ft(this.gos,{data:t,node:s,column:n,colDef:o,getValue:r.getValueCallback.bind(r,s)});return typeof e=="function"?e(a):i==null?void 0:i.evaluate(e,a)}},Xge={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},Jge=class extends wn{constructor(){super(Xge,[Zv]),this.eFloatingFilterText=ct}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(i=>t[i]!=null)?!0:(Xe(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;Xe(73)}else Xe(74)}getCustomOption(e){return this.customFilterOptions[e]}};function pp(e,t,n){return n==null?e.splice(t):e.splice(t,n)}function _y(e){return e==null||typeof e=="string"&&e.trim().length===0}function Qge(e){return e==="AND"||e==="OR"?e:"AND"}function eme(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),Xe(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 d_=class extends Nae{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=Qge(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 i;if(n){const r=e,a=t;i=this.areSimpleModelsEqual(r,a)}else{const r=e,a=t;i=r.operator===a.operator&&ol(r.conditions,a.conditions,(l,u)=>this.areSimpleModelsEqual(l,u))}return i}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=[],Xe(77));const i=tme(o,this.maxNumConditions),r=this.getNumConditions();if(i<r)this.removeConditionsAndOperators(i);else if(i>r)for(let l=r;l<i;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,u)=>{this.eTypes[u].setValue(l.type,!0),this.setConditionIntoUi(l,u)})}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&&(Xe(79),t=1),this.maxNumConditions=t;let n=e.numAlwaysVisibleConditions??1;n<1&&(Xe(80),n=1),n>t&&(Xe(81),n=t),this.numAlwaysVisibleConditions=n}createOption(){const e=this.getGui(),t=this.createManagedBean(new l0);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=rs({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 fre);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 i=this.isConditionDisabled(o,e);s.setDisabled(i||this.filterListOptions.length<=1),o===1&&(Bf(this.eJoinPanels[0],i),this.eJoinAnds[0].setDisabled(i),this.eJoinOrs[0].setDisabled(i))}),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,i,r)=>{this.setElementDisplayed(s,o<r),this.setElementDisabled(s,this.isConditionDisabled(i,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:i,eJoinOrs:r}=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(i,a,t),this.removeComponents(r,a,t)}removeElements(e,t,n){const s=pp(e,t,n);for(const o of s)Vi(o)}removeComponents(e,t,n){const s=pp(e,t,n);for(const o of s)Vi(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 Eu&&this.isConditionBodyVisible(0)?n=s.getInputElement():n=(t=this.eTypes[0])==null?void 0:t.getFocusableElement()}(n??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){var r;super.afterGuiDetached();const e=this.params;if((r=this.beans.colFilter)!=null&&r.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),u=a<t;(l||u)&&(this.removeConditionsAndOperators(a,1),s=!0,u&&n--)}let i=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),i=!0),this.shouldAddNewConditionAtEnd(n===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),i=!0),i&&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 Eu))return;const i=n===0&&o>1?"inRangeStart":n===0?"filterOoo":"inRangeEnd",r=n===0&&o>1?e("ariaFilterFromValue","Filter from value"):n===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(i,s)),t.setInputAriaLabel(r)})}setElementValue(e,t,n){e instanceof Eu&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){bL(e)&&Bn(e.getGui(),t)}setElementDisabled(e,t){bL(e)&&Bf(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Eu&&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 i=0;i<o.length;i++){const r=o[i];r!=null&&n(r,i,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,i)=>{i===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}},K2=class{constructor(e,t,n,s,o,i){this.alive=!0,this.context=e,this.eParent=o;const r=qie(t,n,s);r&&r.newAgStackInstance().then(a=>{var c,d;if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;o.appendChild(a.getGui()),(c=a==null?void 0:a.afterGuiAttached)==null||c.call(a);const{tempValue:l,disabled:u}=this;l&&a.setDate(l),u!=null&&((d=a.setDisabled)==null||d.call(a,u)),i==null||i(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)}},h_=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function q2(e,t){const{dateFrom:n,dateTo:s,type:o}=e||{};return[n&&yo(n,void 0,!0)||null,s&&yo(s,void 0,!0)||null].slice(0,gp(o,t))}var Y2=1e3,Z2=1/0,nme=class extends d_{constructor(){super("dateFilter",q2,h_),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=Y2,this.maxValidYear=Z2,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,u)=>{const c=e[l];if(c!=null)if(isNaN(c))Xe(82,{param:l});else return c==null?u:Number(c);return u},n=t("minValidYear",Y2),s=t("maxValidYear",Z2);this.minValidYear=n,this.maxValidYear=s,n>s&&Xe(83);const{minValidDate:o,maxValidDate:i}=e,r=o instanceof Date?o:yo(o);this.minValidDate=r;const a=i instanceof Date?i:yo(i);this.maxValidDate=a,r&&a&&r>a&&Xe(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:n,gos:s},params:o}=this,i=new K2(n,t,o.colDef,Ft(s,{onDateChanged:()=>this.onUiChanged(),filterParams:o,location:"filter"}),e);return this.addDestroyFunc(()=>i.destroy()),i}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=rs({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=rs({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,i)=>{o!==e||!t||s>=i||(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,i)=>{s<i&&t.push(n.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},X2=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 r=t;s.push(...r.conditions??[])}else s.push(t);const o=n&&n==="OR"?"some":"every",i=this.params.getValue(e.node);return s[o](r=>this.individualConditionPasses(e,r,i))}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 i=hV(t)?t.conditions:[t];const r=(n==null?void 0:n.map(c=>typeof c=="string"?c:c.displayKey))??this.defaultOptions;if(!(!i||i.every(c=>r.find(d=>d===c.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const u=this.filterType;if((i&&!i.every(c=>c.filterType===u)||t.filterType!==u)&&(i=i.map(c=>({...c,filterType:u})),l=!0),typeof s=="number"&&i&&i.length>s&&(i=i.slice(0,s),l=!0),l){const c=i.length>1?{...t,filterType:u,conditions:i}:{...i[0],filterType:u};this.params={...e,model:c},e.onModelChange(c)}}individualConditionPasses(e,t,n){const s=this.optionsFactory,o=this.mapValuesFromModel(t,s),i=s.getCustomOption(t.type),r=eme(i,o,n);return r??(n==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(o,n,t,e))}},J2=class extends X2{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:n,includeBlanksInGreaterThan:s,includeBlanksInLessThan:o,includeBlanksInRange:i}=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(i)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(),i=e[0]!=null?o(e[0],t):0;switch(s){case"equals":return i===0;case"notEqual":return i!==0;case"greaterThan":return i>0;case"greaterThanOrEqual":return i>=0;case"lessThan":return i<0;case"lessThanOrEqual":return i<=0;case"inRange":{const r=o(e[1],t);return this.params.filterParams.inRangeInclusive?i>=0&&r<=0:i>0&&r<0}case"blank":return _y(t);case"notBlank":return!_y(t);default:return Xe(76,{filterModelType:s}),!0}}},Q2={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},sme={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},f_=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?ul(this,"filterSummaryInactive"):null;if(e.operator!=null){const i=e,a=(i.conditions??[]).map(u=>this.getModelAsString(u,t)),l=i.operator==="AND"?"andCondition":"orCondition";return a.join(` ${ul(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return s?ul(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):n(e.type,e.type);{const i=e,r=this.optionsFactory.getCustomOption(i.type),{displayKey:a,displayName:l,numberOfInputs:u}=r||{};return a&&l&&u===0?n(a,l):this.conditionToString(i,s,i.type==="inRange"||u===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:n}=e;this.optionsFactory=t,this.filterParams=n}conditionForToolPanel(e,t,n,s,o,i){let r;const a=this.getTypeKey(e);return a&&(r=ul(this,a)),o&&i&&(r=this.getLocaleTextFunc()(o,i)),r!=null?t?`${r} ${ul(this,"filterSummaryInRangeValues",[n(),s()])}`:`${r} ${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)}},eB=class extends f_{constructor(e,t){super(e,t,n=>{const{dataTypeSvc:s,valueSvc:o}=this.beans,i=t.column,r=s==null?void 0:s.getDateFormatterFunction(i),a=r?r(n??void 0):n;return o.formatValue(i,null,a)}),this.filterTypeKeys=Q2}conditionToString(e,t,n,s,o){const{type:i}=e,r=yo(e.dateFrom),a=yo(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,u=t?this.formatValue.bind(this):h=>n0(h,l),c=()=>r!==null?u(r):"null",d=()=>a!==null?u(a):"null";if(t){const h=this.conditionForToolPanel(i,n,c,d,s,o);if(h!=null)return h}return n?`${c()}-${d()}`:r!=null?u(r):`${i}`}};function ome(e,t){const n=t;return n<e?-1:n>e?1:0}var ime=class extends J2{constructor(){super(q2,h_),this.filterType="date",this.FilterModelFormatterClass=eB}comparator(){return this.params.filterParams.comparator??ome}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},tB=class extends wn{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")}`}},rme={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"}]},ame=class extends tB{constructor(){super(rme,[Zv]),this.eReadOnlyText=ct,this.eDateWrapper=ct,this.FilterModelFormatterClass=eB,this.filterType="date",this.defaultOptions=h_}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?yo(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=v0(e,this.defaultDebounceMs);return Ft(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 K2(e,t,s.column.getColDef(),this.getDateComponentParams(),n,o=>{o.setInputAriaLabel(this.getAriaLabel(s))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},lme={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},ume=class extends wn{constructor(){super(lme,[Zv]),this.eDateInput=ct,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&&il();const{minValidYear:s,maxValidYear:o,minValidDate:i,maxValidDate:r,buttons:a,includeTime:l,colDef:u}=e.filterParams||{},c=this.beans.dataTypeSvc,d=l??((h=c==null?void 0:c.getDateIncludesTimeFlag)==null?void 0:h.call(c,u.cellDataType))??!1;if(n?d?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",i&&s&&Xe(85),r&&o&&Xe(86),i&&r){const[f,p]=[i,r].map(g=>g instanceof Date?g:yo(g));f&&p&&f.getTime()>p.getTime()&&Xe(87)}i?i instanceof Date?t.min=n0(i):t.min=i:s&&(t.min=`${s}-01-01`),r?r instanceof Date?t.max=n0(r):t.max=r: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 yo(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}},p_=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function g_(e){const{allowedCharPattern:t}=e??{};return t??null}function m_(e){return e==null||isNaN(e)?null:e}function nB(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[m_(n),m_(s)].slice(0,gp(o,t))}var cme=class extends d_{constructor(){super("numberFilter",nB,p_),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=g_(this.params),t=rs({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 _u({allowedCharPattern:s}):new a0);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,i)=>{s<i&&t.push(m_(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}},sB=class extends f_{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=Q2}conditionToString(e,t,n,s,o){const{filter:i,filterTo:r,type:a}=e,l=this.formatValue.bind(this);if(t){const u=this.conditionForToolPanel(a,n,()=>l(i),()=>l(r),s,o);if(u!=null)return u}return n?`${l(i)}-${l(r)}`:i!=null?l(i):`${a}`}},dme=class extends J2{constructor(){super(nB,p_),this.filterType="number",this.FilterModelFormatterClass=sB}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},oB=class extends We{constructor(e){super(),this.params=e,this.eInput=ct,this.onValueChanged=()=>{}}setupGui(e){var s;this.eInput=this.createManagedBean(new _u((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 v_(e){const t=e==null?void 0:e.trim();return t===""?e:t}function iB(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[n||null,s||null].slice(0,gp(o,t))}var hme={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},rB=class extends tB{constructor(){super(...arguments),this.eFloatingFilterInputContainer=ct,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(hme)}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=ty(e.filterParams),!o){const i=v0(e.filterParams,s),r=Os(this,this.syncUpWithParentFilter.bind(this),i);n.setValueChangedListener(r)}}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:i}=this;let r=s.getValue();if(o.filterParams.trimInput&&(r=v_(r),s.setValue(r,!0)),n){const a=o,l=a.model,u=this.convertValue(r),c=u==null?null:{...l??{filterType:this.filterType,type:i??this.optionsFactory.defaultOption},filter:u};a.onModelChange(c,{afterFloatingFilter:!0})}else o.parentFilterInstance(a=>{a==null||a.onFloatingFilterChanged(i||null,r||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},fme=class extends We{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new a0),this.eTextInput=this.createManagedBean(new _u),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)}},pme=class extends rB{constructor(){super(...arguments),this.FilterModelFormatterClass=sB,this.filterType="number",this.defaultOptions=p_}updateParams(e){g_(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=g_(e.filterParams),this.allowedCharPattern?this.createManagedBean(new oB({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new fme)}convertValue(e){return e?Number(e):null}},y_=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],gme=class extends d_{constructor(){super("textFilter",iB,y_),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,i)=>{s<i&&t.push(ia(n.getValue()))}),t}createEValue(){const e=rs({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 _u);s.addCss(`ag-filter-${n}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeEValues(e,t){const n=i=>this.removeComponents(i,e,t),{eValuesFrom:s,eValuesTo:o}=this;n(s),n(o)}},aB=class extends f_{constructor(){super(...arguments),this.filterTypeKeys=sme}conditionToString(e,t,n,s,o){const{filter:i,filterTo:r,type:a}=e;if(t){const l=c=>()=>ul(this,"filterSummaryTextQuote",[c]),u=this.conditionForToolPanel(a,n,l(i),l(r),s,o);if(u!=null)return u}return n?`${i}-${r}`:i!=null?`${i}`:`${a}`}},mme=({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}},vme=e=>e,yme=e=>e==null?null:e.toString().toLowerCase(),wme=class extends X2{constructor(){super(iB,y_),this.filterType="text",this.FilterModelFormatterClass=aB}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??mme,this.formatter=t.textFormatter??(t.caseSensitive?vme:yme)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,n,s){const o=e.map(h=>this.formatter(h))||[],i=this.formatter(t),{api:r,colDef:a,column:l,context:u,filterParams:{textFormatter:c}}=this.params;if(n.type==="blank")return _y(t);if(n.type==="notBlank")return!_y(t);const d={api:r,colDef:a,column:l,context:u,node:s.node,data:s.data,filterOption:n.type,value:i,textFormatter:c};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:i}=n;return o&&(s.filter=v_(o)??null),i&&(s.filterTo=v_(i)??null),s};return hV(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},Cme=class extends rB{constructor(){super(...arguments),this.FilterModelFormatterClass=aB,this.filterType="text",this.defaultOptions=y_}createFloatingFilterInputService(){return this.createManagedBean(new oB)}};function bme(e){var t;return!!((t=e.quickFilter)!=null&&t.isFilterPresent())}function Sme(e){var t;return(t=e.quickFilter)==null?void 0:t.getText()}function Eme(e){var t;(t=e.quickFilter)==null||t.resetCache()}var _me=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(),i=e==null?void 0:e.getColumns(),r=t.getColDefCols();let a=(o&&!n.get("applyQuickFilterBeforePivotOrAgg")?(l=s==null?void 0:s.getPivotResultCols())==null?void 0:l.list:r)??[];i&&(a=a.concat(i)),this.colsToUse=n.get("includeHiddenColumnsInQuickFilter")?a:a.filter(u=>u.isVisible()||u.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 dt(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){Xe(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 dt(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=Ft(this.gos,{value:n,node:t,data:t.data,column:e,colDef:s});n=s.getQuickFilterText(o)}return dt(n)?n.toString().toUpperCase():null}getAggText(e){const t=[];for(const n of this.colsToUse){const s=this.getTextForColumn(n,e);dt(s)&&t.push(s)}return t.join(`
|
|
251
251
|
`)}},Rme={moduleName:"ClientSideRowModelFilter",version:ut,rowModels:["clientSide"],beans:[Dge]},w_={moduleName:"FilterCore",version:ut,beans:[qge],apiFunctions:{isAnyFilterPresent:jge,onFilterChanged:Kge},css:[Age],dependsOn:[Rme]},lB={moduleName:"FilterValue",version:ut,beans:[Zge]},Ry={moduleName:"ColumnFilter",version:ut,beans:[zge,Yge],dynamicBeans:{headerFilterCellCtrl:Tge},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:kge,getColumnFilterInstance:Oge,destroyFilter:Mge,setFilterModel:Nge,getFilterModel:Lge,getColumnFilterModel:Vge,setColumnFilterModel:Bge,showColumnFilter:$ge,hideColumnFilter:Hge,getColumnFilterHandler:Gge,doFilterAction:Uge},dependsOn:[w_,Ey,lB,Fge]},Dme={moduleName:"CustomFilter",version:ut,userComponents:{agReadOnlyFloatingFilter:Jge},dependsOn:[Ry]},Tme={moduleName:"TextFilter",version:ut,dependsOn:[Ry],userComponents:{agTextColumnFilter:{classImp:gme,params:{useForm:!0}},agTextColumnFloatingFilter:Cme},dynamicBeans:{agTextColumnFilterHandler:wme}},Ime={moduleName:"NumberFilter",version:ut,dependsOn:[Ry],userComponents:{agNumberColumnFilter:{classImp:cme,params:{useForm:!0}},agNumberColumnFloatingFilter:pme},dynamicBeans:{agNumberColumnFilterHandler:dme}},xme={moduleName:"DateFilter",version:ut,dependsOn:[Ry],userComponents:{agDateColumnFilter:{classImp:nme,params:{useForm:!0}},agDateInput:ume,agDateColumnFloatingFilter:ame},dynamicBeans:{agDateColumnFilterHandler:ime}},Fme={moduleName:"QuickFilterCore",version:ut,rowModels:["clientSide"],beans:[_me],dependsOn:[w_,lB]},Pme={moduleName:"QuickFilter",version:ut,apiFunctions:{isQuickFilterPresent:bme,getQuickFilter:Sme,resetQuickFilter:Eme},dependsOn:[Fme]},Ame={moduleName:"ExternalFilter",version:ut,dependsOn:[w_]},kme=".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}}",C_=(e,t,n)=>{var a,l,u;const{editModelSvc:s}=e,o=(l=(a=s==null?void 0:s.getCellValidationModel())==null?void 0:a.getCellValidation(t))==null?void 0:l.errorMessages,i=(u=s==null?void 0:s.getRowValidationModel().getRowValidation(t))==null?void 0:u.errorMessages,r=o||i;return r!=null&&r.length?r.join(n("tooltipValidationErrorSeparator",". ")):void 0},Ome=class extends We{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,i=u_(o),{column:r,eGui:a}=t,l=r.getColDef();!s&&i&&!l.headerComponent&&(s=Fv(()=>a.querySelector(".ag-header-cell-text")));const u="header",d=this.beans.colNames.getDisplayNameForColumn(r,"header",!0),h=n??d,f={getGui:()=>a,getLocation:()=>u,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Ft(o,{location:u,colDef:l,column:r,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>({column:r,colDef:r.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,i=u_(o),{column:r,eGui:a}=t,l=r.getColGroupDef();!s&&i&&!(l!=null&&l.headerGroupComponent)&&(s=Fv(()=>a.querySelector(".ag-header-group-text")));const u="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(r,"header"),h=n??d,f={getGui:()=>a,getLocation:()=>u,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Ft(o,{location:u,colDef:l,column:r,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>{const g={column:r};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:i}=s,{column:r,rowNode:a}=e;let l="cell";const u=()=>{const f=!!!(i!=null&&i.isEditing(e))&&C_(s,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=r.getColDef(),g=a.data;if(p.tooltipField&&dt(g))return cp(g,p.tooltipField,r.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(Ft(o,{location:"cell",colDef:r.getColDef(),column:r,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},c=u_(o);n||(c&&!e.isCellRenderer()?n=()=>{const h=!!(i!=null&&i.isEditing(e));if(!h&&C_(s,e,this.getLocaleTextFunc()))return!0;if(!r.isTooltipEnabled())return!1;const g=Fv(()=>{const v=e.eGui;return v.children.length===0?v:v.querySelector(".ag-cell-value")});return!h&&g()}:n=()=>!(i!=null&&i.isEditing(e)));const d={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:u,shouldDisplayTooltip:n,getAdditionalParams:()=>({column:r,colDef:r.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},i=this.beans,r=i.context;e&&t.destroyBean(e,r);const a=this.createTooltipFeature(o,i);if(a)return t.createBean(a,r)}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 i={getGui:()=>o,getTooltipValue:()=>C_(n,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{var p,g;const{editModelSvc:u}=n,c=(p=u==null?void 0:u.getRowValidationModel())==null?void 0:p.getRowValidationMap(),d=(g=u==null?void 0:u.getCellValidationModel())==null?void 0:g.getCellValidationMap(),h=!!c&&c.size>0,f=!!d&&d.size>0;return h||f}},r=this.createTooltipFeature(i,n);if(r)return e.createBean(r,s)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=dt(t.tooltipField)||dt(t.tooltipValueGetter)||dt(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},Mme=class extends iae{createTooltipComp(e,t){const n=Xie(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}},uB={moduleName:"Tooltip",version:ut,beans:[Ome],dynamicBeans:{tooltipFeature:YL,highlightTooltipFeature:rae,tooltipStateManager:Mme},userComponents:{agTooltipComponent:uae},dependsOn:[Ey],css:[kme]},Id=class{constructor(e){this.cellValueChanges=e}},b_=class extends Id{constructor(e,t,n,s){super(e),this.initialRange=t,this.finalRange=n,this.ranges=s}},Nme=10,cB=class{constructor(e){this.actionStack=[],this.maxStackSize=e||Nme,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}},Lme=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&&jV(this.activeCellEdit,t),s=this.activeRowEdit!==null&&rce(this.activeRowEdit,t);if(!(n||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:i,rowIndex:r,column:a,oldValue:l,value:u}=e,c={rowPinned:i,rowIndex:r,columnId:a.getColId(),newValue:u,oldValue:l};this.cellValueChanges.push(c)},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 cB(n),this.redoStack=new cB(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 i=e.pop();return i!=null&&i.cellValueChanges?(this.processAction(i,r=>r[s],o),i instanceof b_?this.processRange(i.ranges||[i[n]]):this.processCell(i.cellValueChanges),t.push(i),!0):!1}processAction(e,t,n){for(const s of e.cellValueChanges){const{rowIndex:o,rowPinned:i,columnId:r}=s,a={rowIndex:o,rowPinned:i},l=ga(this.beans,a);l.displayed&&l.setDataValue(r,t(s),n)}}processRange(e){let t;const n=this.beans.rangeSvc;n.removeAllCellRanges(!0),e.forEach((s,o)=>{if(!s)return;const i=s.startRow,r=s.endRow;o===e.length-1&&(t={rowPinned:i.rowPinned,rowIndex:i.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.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},i=ga(this.beans,o),r={rowPinned:t.rowPinned,rowIndex:i.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r)}setLastFocusedCell(e){const{rowIndex:t,columnId:n,rowPinned:s}=e,{colModel:o,focusSvc:i,rangeSvc:r}=this.beans,a=o.getCol(n);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const u={rowIndex:t,column:a,rowPinned:s};i.setFocusedCell({...u,forceBrowserFocus:!0}),r==null||r.setRangeToCell(u)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Id(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 Id(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Id(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new b_(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&&aa(n)?e=new b_(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new Id(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 Id(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},Vme=".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}",Bme={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},$me=class extends hy{constructor(){super(Bme,[r0]),this.eEditor=ct}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=Dv(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}},Dy=class extends hy{constructor(e){super(),this.cellEditorInput=e,this.eEditor=ct}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:i}=e;n.getInputElement().setAttribute("title",""),t.init(n,e);let r,a=!0;s?(this.focusAfterAttached=!0,o===Oe.BACKSPACE||o===Oe.DELETE?r="":o&&o.length===1?i?a=!1:r=o:(r=t.getStartValue(),o!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,r=t.getStartValue()),a&&r!=null&&n.setStartValue(r),this.addGuiEventListener("keydown",l=>{const{key:u}=l;(u===Oe.PAGE_UP||u===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;il()||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()}},Hme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},Gme=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Hme}getAgComponents(){return[LL]}init(e,t){var r,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:i}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(r=this.getDataTypeService())==null?void 0:r.getDateIncludesTimeFlag)==null?void 0:a.call(r,i.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:n}=this,{min:s,max:o,getValidationErrors:i}=n;let r=[];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 u=l.toLocaleDateString();r.push(a("minDateValidation",`Date must be after ${u}`,[u]))}}if(o){const l=o instanceof Date?o:new Date(o);if(t>l){const u=l.toLocaleDateString();r.push(a("maxDateValidation",`Date must be before ${u}`,[u]))}}}return r.length||(r=null),i?i({value:t,cellEditorParams:n,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,n=e.getDate();return!dt(n)&&!dt(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Ho(e,this.includeTime??!1)}},Ume=class extends Dy{constructor(){super(new Gme(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Wme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},zme=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Wme}getAgComponents(){return[LL]}init(e,t){var r,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:i}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(r=this.getDataTypeService())==null?void 0:r.getDateIncludesTimeFlag)==null?void 0:a.call(r,i.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:i,getValidationErrors:r}=t;let a=[];if(s){const l=new Date(s),u=this.getLocaleTextFunc();if(o){const c=new Date(o);if(l<c){const d=c.toLocaleDateString();a.push(u("minDateValidation",`Date must be after ${d}`,[d]))}}if(i){const c=new Date(i);if(l>c){const d=c.toLocaleDateString();a.push(u("maxDateValidation",`Date must be before ${d}`,[d]))}}}return a.length||(a=null),r?r({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,n=this.formatDate(t.getDate());return!dt(n)&&!dt(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):yo(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}},jme=class extends Dy{constructor(){super(new zme(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Kme={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},qme=class extends hy{constructor(){super(Kme,[gre]),this.eEditor=ct}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:n,eventKey:s,maxLength:o,cols:i,rows:r}=e;this.focusAfterAttached=n,t.getInputElement().setAttribute("title",""),t.setMaxLength(o||200).setCols(i||60).setRows(r||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!dt(s)&&!dt(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 i=[];return typeof o=="string"&&t!=null&&o.length>t&&i.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),i.length||(i=null),n?n({value:o,internalErrors:i,cellEditorParams:e}):i}},Yme={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},Zme=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Yme}getAgComponents(){return[mre]}init(e,t){this.eEditor=e,this.params=t;const{max:n,min:s,precision:o,step:i}=t;n!=null&&e.setMax(n),s!=null&&e.setMin(s),o!=null&&e.setPrecision(o),i!=null&&e.setStep(i);const r=e.getInputElement();t.preventStepping?e.addManagedElementListeners(r,{keydown:this.preventStepping}):t.showStepperButtons&&r.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:n,getValidationErrors:s}=e,i=this.eEditor.getInputElement().valueAsNumber,r=this.getLocaleTextFunc();let a=[];return typeof i=="number"&&(t!=null&&i<t&&a.push(r("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),n!=null&&i>n&&a.push(r("maxValueValidation",`Must be less than or equal to ${n}.`,[String(n)]))),a.length||(a=null),s?s({value:i,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(!dt(n)&&!dt(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(){il()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},Xme=class extends Dy{constructor(){super(new Zme(()=>this.getLocaleTextFunc()))}},Jme={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},Qme=class extends hy{constructor(){super(Jme,[Tre]),this.eEditor=ct,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:i,eventKey:r}=e;if(Vn(o)){Xe(58);return}this.startedByEnter=r!=null?r===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||i===d}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:u,valueListMaxHeight:c}=e;l!=null&&t.setPickerGap(l),c!=null&&t.setPickerMaxHeight(c),u!=null&&t.setPickerMaxWidth(u),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 i=this.getLocaleTextFunc();o.push(i("invalidSelectionValidation","Invalid selection."))}else o=null;return n?n({value:s,internalErrors:o,cellEditorParams:e}):o}},eve={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},tve=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return eve}getAgComponents(){return[Zv]}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 i=[];return t!=null&&typeof s=="string"&&s.length>t&&i.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),i.length||(i=null),n?n({value:s,cellEditorParams:e,internalErrors:i}):i}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();return!dt(n)&&!dt(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(){il()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),n=dt(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},dB=class extends Dy{constructor(){super(new tve(()=>this.getLocaleTextFunc()))}};function nve(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function sve(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function hB(e,t,n="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,n),"ensureVisible")}function fB(e,t,n){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,n),"ensureVisible")}function ove(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function ive(e){var t;(t=e.undoRedo)==null||t.undo("api")}function rve(e){var t;(t=e.undoRedo)==null||t.redo("api")}function ave(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function lve(e){var s;const t=(s=e.editModelSvc)==null?void 0:s.getEditMap(),n=[];return t==null||t.forEach((o,i)=>{const{rowIndex:r,rowPinned:a}=i;o.forEach((l,u)=>{const{editorValue:c,pendingValue:d,sourceValue:h,state:f}=l,p=ma(l);let g=c??d;g===fi&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:u,colId:u.getColId(),colKey:u.getColId(),rowIndex:r,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function uve(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 xu(e,{persist:!0});Rd(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function cve(e,t){var s;const n=Wn(e,t);return((s=e.editSvc)==null?void 0:s.isEditing(n))??!1}function dve(e,t){const{key:n,colKey:s,rowIndex:o,rowPinned:i}=t,{editSvc:r,colModel:a}=e,l=a.getCol(s);if(!l){Xe(12,{colKey:s});return}const c=ga(e,{rowIndex:o,rowPinned:i||null});if(!c){Xe(290,{rowIndex:o,rowPinned:i});return}if(!l.isCellEditable(c))return;i==null&&fB(e,o),hB(e,s),r==null||r.startEditing({rowNode:c,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function hve(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function fve(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function pve(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var gve={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},mve=class extends WE{constructor(e){super(gve),this.params=e}postConstruct(){yu(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=s=>{R0(this.gos,s,t.node,t.column,!0)||t.onKeyDown(s)};this.addManagedElementListeners(e,{keydown:n})}};function vve(e,{column:t},n,s,o="ui"){var u;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)&&((u=e.rangeSvc)==null?void 0:u.getCellRanges().length)!=0)return!1;const r=t==null?void 0:t.getColDef(),a=yve(e.gos,r),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 yve(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function S_(e,{rowNode:t,column:n},s="ui"){const o=n.getColDef().editable,i=e.editModelSvc;return n.isColumnFunc(t,o)||!!i&&i.hasEdits({rowNode:t,column:n},{withOpenEditor:!0})}function wve(e,t,n="ui"){const s=S_(e,t,n);return s===!0||n==="ui"?s:e.colModel.getCols().some(i=>S_(e,{rowNode:t.rowNode,column:i},n))}var Ty=(e,t=!1)=>{if(e!==void 0)return ma(e)||t&&e.state==="editing"};function pB(e,t,n=!1){var s;return Ty((s=e.editModelSvc)==null?void 0:s.getEdit(t),n)}var gB=(e,t,n)=>{if(e)for(let s=0,o=e.length;s<o;++s){const i=e[s];if(i.data&&(Ty(t==null?void 0:t.getEdit({rowNode:i,column:n}))||Ty(t==null?void 0:t.getEdit({rowNode:i.pinnedSibling,column:n})))||gB(i.childrenAfterGroup,t,n))return!0}};function mB(e,t){const{column:n,rowNode:s}=t;return e.gos.get("groupTotalRow")&&!(s!=null&&s.footer)?!1:gB(s==null?void 0:s.childrenAfterGroup,e.editModelSvc,n)}function vB(e,{rowNode:t,column:n}){var s;if(t=t.pinnedSibling,!!t)return Ty((s=e.editModelSvc)==null?void 0:s.getEdit({rowNode:t,column:n}))}var Cve=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 i=pB(n,e)||mB(n,e)||vB(n,e);this.applyBatchingStyle(i)}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)}},bve=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 r;const{rowCtrl:e,editModelSvc:t,beans:n}=this;let s=e.rowNode,o=t==null?void 0:t.getEditRow(s);const i=(r=this.editModelSvc)==null?void 0:r.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 u={rowNode:s,column:l};return pB(n,u,!0)||mB(n,u)||vB(n,u)});this.applyStyle(i,a);return}this.applyStyle(i)}applyStyle(e=!1,t=!1){var o,i;const n=((o=this.editSvc)==null?void 0:o.isBatchEditing())??!1,s=this.gos.get("editType")==="fullRow";(i=this.rowCtrl)==null||i.forEachGui(void 0,({rowComp:r})=>{r.toggleCss("ag-row-editing",s&&t),r.toggleCss("ag-row-batch-edit",s&&t&&n),r.toggleCss("ag-row-inline-editing",t),r.toggleCss("ag-row-not-inline-editing",!t),r.toggleCss("ag-row-editing-invalid",s&&t&&e)})}},Sve=({rowModel:e,pinnedRowModel:t,editModelSvc:n},s)=>{const o=new Set;e.forEachNode(i=>s.has(i)&&o.add(i)),t==null||t.forEachPinnedRow("top",i=>s.has(i)&&o.add(i)),t==null||t.forEachPinnedRow("bottom",i=>s.has(i)&&o.add(i));for(const i of s)o.has(i)||n.removeEdits({rowNode:i});return o},Eve=({editModelSvc:e},t,n)=>{var s;for(const o of t)(s=e==null?void 0:e.getEditRow(o))==null||s.forEach((i,r)=>!n.has(r)&&e.removeEdits({rowNode:o,column:r}))},_ve=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),s=new Set(n.keys());Eve(e,Sve(e,s),t)},Rve=new Set(["undo","redo","paste","bulk","rangeSvc"]),Dve=new Set(["ui","api"]),yB={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},Tve=new Set(Object.keys(yB)),Ive=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Iy={cancel:!0,source:"api"},xve={cancel:!1,source:"api"},xd={checkSiblings:!0},mp={force:!0,suppressFlash:!0},Fve=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,Iy),this.createStrategy(s)});const t=_ve(e),n=()=>{const s=this.model.getCellValidationModel().getCellValidationMap().size>0,o=this.model.getRowValidationModel().getRowValidationMap().size>0;return s||o?this.stopEditing(void 0,Iy):this.isEditing()&&(this.isBatchEditing()?Rd(e,this.model.getEditPositions()):this.stopEditing(void 0,xve)),!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,Iy)):(this.stopEditing(void 0,Iy),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:s}=this,o=wB(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=vve(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 zfe(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??xd)}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:i=!1,silent:r}=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:i,startedEdit:n,silent:r})}stopEditing(e,t){var v,C,S;const{event:n,cancel:s,source:o="ui",forceCancel:i,forceStop:r}=t||{},{beans:a,model:l}=this;if(Tve.has(o)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const u=this.committing?yB[o]:o;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,xd))||!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,u)||this.committing&&!this.batch)||(r??!1),g=s&&!!this.shouldCancelEditing(e,n,u)||(i??!1);if(p||g){xu(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 _ of w)l.clearEditValue(_);this.bulkRefresh(void 0,h);for(const _ of l.getEditPositions(b)){const R=Wn(a,_),T=ma(_);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,_=b===Oe.ESCAPE,R=b===Oe.TAB;(w||R||_)&&(w||R?xu(a,{persist:!0}):_&&this.revertSingleCellEdit(d),this.isBatchEditing()?(S=this.strategy)==null||S.cleanupEditors():Rd(a,l.getEditPositions(),{event:n,cancel:_}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else xu(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),t_(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 u;if(!e||!t)return;const{event:n,suppressNavigateAfterEdit:s}=e;if(!(n instanceof KeyboardEvent)||s)return;const{key:i,shiftKey:r}=n,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(i!==Oe.ENTER||!a)return;const l=r?Oe.UP:Oe.DOWN;(u=this.beans.navigation)==null||u.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,i=[];for(const r of s){const a=e.get(r);for(const l of a.keys()){const u=a.get(l),c={rowNode:r,column:l},d=ma(u);!t&&d&&!o&&(this.setNodeDataValue(r,l,u.pendingValue,void 0,n)||i.push(c))}}return i}setNodeDataValue(e,t,n,s,o="edit"){const{beans:i}=this,r=Wn(i,{rowNode:e,column:t}),a=Dve.has(o)?"edit":o;r&&(r.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,n,a);return r&&(r.suppressRefreshCell=!1),s&&(r==null||r.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={...Pve(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:i,rowPinned:r,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:i,rowPinned:r,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:i,rowModel:r}=s;os(o)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),n):t&&((a=i==null?void 0:i.getEditMap(!1))==null||a.forEach((l,u)=>{for(const c of l.keys())this.refCell({rowNode:u,column:c},l.get(c),n)})))}refCell({rowNode:e,column:t},n,s={}){var d,h,f;const{beans:o,gos:i}=this,r=new Set([e]),a=new Set,l=e.pinnedSibling;l&&r.add(l);const u=e.sibling;u&&a.add(u);let c=e.parent;for(;c;)(d=c.sibling)!=null&&d.footer&&i.get("groupTotalRow")||!c.parent&&c.sibling&&i.get("grandTotalRow")?a.add(c.sibling):a.add(c),c=c.parent;for(const p of r)this.dispatchEditValuesChanged({rowNode:p,column:t},n);for(const p of r)(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 i=wB(s)==="fullRow"?wve(o,e,t):S_(o,e,t);return i&&(this.strategy??(this.strategy=this.createStrategy())),i}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,n=!0){var s,o,i,r;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()),(r=(i=(o=a==null?void 0:a.comp)==null?void 0:o.getCellEditor())==null?void 0:i.focusIn)==null||r.call(i)),"block-stop"):(a&&this.revertSingleCellEdit(a),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){var s,o,i,r;const n=Wn(this.beans,e);(s=n==null?void 0:n.comp)!=null&&s.getCellEditor()&&(Rd(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),_d(this.beans,e,{silent:!0}),Fu(this.beans),n==null||n.refreshCell(mp),t&&(n==null||n.focusCell(),(r=(i=(o=n==null?void 0:n.comp)==null?void 0:o.getCellEditor())==null?void 0:i.focusIn)==null||r.call(i)))}hasValidationErrors(e){var s;Fu(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 i=this.isEditing(),r=i&&this.checkNavWithValidation(void 0,n)==="block-stop";return e instanceof Dd&&i&&(o=(a=this.strategy)==null?void 0:a.moveToNextEditingCell(e,t,n,s,r)),o===null||(o=o||!!this.beans.focusSvc.focusedHeader,o===!1&&!r&&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 r=this.model.getEdit({rowNode:o,column:t});r&&(s=r)}const i=n?(s==null?void 0:s.editorValue)??(s==null?void 0:s.pendingValue):s==null?void 0:s.pendingValue;return i===fi||!s?(s==null?void 0:s.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):i}addStopEditingWhenGridLosesFocus(e){Bfe(this,this.beans,e)}createPopupEditorWrapper(e){return new mve(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var s;try{if((!this.isEditing()||this.committing)&&!Ive.has(n))return;const{beans:o}=this;this.strategy??(this.strategy=this.createStrategy());const i=this.isBatchEditing()?"ui":this.committing?n??"api":"api";if(!n||Rve.has(n))return wy(o,e,t,n,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,n);const r=this.model.getEdit(e);if(r){if(r.pendingValue===t)return!1;if(r.sourceValue!==t)return wy(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0;if(r.sourceValue===t)return(s=o.editModelSvc)==null||s.removeEdits(e),this.dispatchEditValuesChanged(e,{...r,pendingValue:t}),!0}return wy(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){Gfe(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,xd))return;const{rowNode:s,column:o}=e,{compDetails:i,valueToDisplay:r}=t;if(i){const{params:l}=i;return l.data=this.model.getEditRowDataValue(s,xd),{compDetails:i}}const a=this.model.getEditRow(e.rowNode,xd);if(r!==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 Ft(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 u,c;if(!n||n.length===0)return;const{beans:s,rangeSvc:o,valueSvc:i}=this;xu(s,{persist:!0});const r=this.model.getEditMap(!0),a=(c=(u=r.get(e))==null?void 0:u.get(t))==null?void 0:c.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(o==null||o.forEachRowInRange(d,h=>{const f=ga(s,h);if(f===void 0)return;const p=r.get(f)??new Map;for(const g of d.columns)if(g&&this.isCellEditable({rowNode:f,column:g},"api")){const v=i.getValue(g,f,!0,"api");let C=i.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&&r.set(f,p)}),this.setEditMap(r),this.batch){this.cleanupEditors(),t_(s),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(r)})}),this.bulkRefresh();const l=Wn(s,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new Cve(e,t)}createRowStyleFeature(e,t){return new bve(e,t)}setEditingCells(e,t){const{beans:n}=this,{colModel:s,valueSvc:o}=n,i=new Map;for(let{colId:r,column:a,colKey:l,rowIndex:u,rowPinned:c,newValue:d,state:h}of e){const f=r?s.getCol(r):l?s.getCol(l):a;if(!f)continue;const p=ga(n,{rowIndex:u,rowPinned:c});if(!p)continue;const g=o.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!ma({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=i.get(p);v||(v=new Map,i.set(p,v)),d===void 0&&(d=fi),v.set(f,{editorValue:void 0,pendingValue:d,sourceValue:g,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(i,t)}onCellFocused(e){var i;const t=Wn(this.beans,e);if(!t||!this.isEditing(t,xd))return;const n=this.model.getEdit(t);if(!n||!ma(n))return;const o=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(i=this.beans.ariaAnnounce)==null||i.announceValue(o,"pendingChange")}allowedFocusTargetOnValidation(e){return Wn(this.beans,e)}};function Pve(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 wB(e,t){return t??e.get("editType")??"singleCell"}var CB=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,i=e.type==="cellFocused"?e.sourceEvent:null;n&&(t=Wn(o,n));const{gos:r,editModelSvc:a}=o,l=e.type==="cellFocusCleared";if(s.isEditing(void 0,{withOpenEditor:!0})){const{column:u,rowIndex:c,rowPinned:d}=e,h={column:u,rowNode:ga(o,{rowIndex:c,rowPinned:d})},f=r.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:i}):!0)||(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"}))}t==null||t.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){var o,i;const n=this.model.getEditPositions(),s={all:[],pass:[],fail:[]};for(const r of n){s.all.push(r);const a=this.model.getCellValidationModel().getCellValidation(r);if((((o=a==null?void 0:a.errorMessages)==null?void 0:o.length)??0)>0){s.fail.push(r);continue}s.pass.push(r)}if(e)for(const r of n)Cy(this.beans,r,{cancel:e}),this.model.stop(r);else{const r=this.processValidationResults(s);if(r.destroy.length>0)for(const a of r.destroy)Cy(this.beans,a,{event:t,cancel:e}),this.model.stop(a);if(r.keep.length>0)for(const a of r.keep){const l=Wn(this.beans,a);(i=this.editSvc)!=null&&i.cellEditingInvalidCommitBlocks()||l&&this.editSvc.revertSingleCellEdit(l)}}return!0}cleanupEditors({rowNode:e}={},t){xu(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);Rd(this.beans,s),t_(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,i;return(i=(o=t==null?void 0:t.getCellEditor())==null?void 0:o.focusIn)==null?void 0:i.call(o)})}}setupEditors(e){const{event:t,ignoreEventKey:n=!1,startedEdit:s,position:o,cells:i=this.model.getEditPositions()}=e,r=t instanceof KeyboardEvent&&!n&&t.key||void 0;Hfe(this.beans,i,o,r,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=Q0(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,i)=>{o.forEach((r,a)=>{r.state==="editing"&&n.push({...r,rowNode:i,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),i=o.pendingValue===fi?void 0:o.pendingValue;this.start({position:o,event:new KeyboardEvent("keydown",{key:i}),source:"api"});const r=Wn(this.beans,o);r&&this.setFocusInOnEditor(r)}}destroy(){this.cleanupEditors(),super.destroy()}},Ave=class extends CB{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:s}=e||{};if(!Q0(this.beans,{rowNode:this.rowNode}))return!0;const i=super.shouldStop({rowNode:this.rowNode},t,n);return i!==null?i: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:i}=e,{rowNode:r}=t;this.rowNode!==r&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],u=[];for(const c of a)c.isCellEditable(r)&&u.push(c);if(u.length!=0){this.dispatchRowEvent({rowNode:r},"rowEditingStarted",n),this.startedRows.push(r);for(const c of u){const d={rowNode:r,column:c};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=r,this.setupEditors({cells:l,position:t,startedEdit:s,event:o,ignoreEventKey:i})}}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((i,r)=>{if(!(!i||i.size===0)){for(const a of i.values())if(ma(a)){s.push(r);break}}}),Fu(this.beans),!e&&((o=this.editSvc)==null?void 0:o.checkNavWithValidation({rowNode:n}))==="block-stop")return!1;super.stop(e,t);for(const i of s)this.dispatchRowEvent({rowNode:i},"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 i=e.cellPosition;let r;this.model.suspend(!0);try{r=(h=this.beans.navigation)==null?void 0:h.findNextCellToFocusOn(i,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(r===!1)return null;if(r==null)return!1;const a=r.cellPosition,l=e.isCellEditable(),u=r.isCellEditable(),c=a&&i.rowIndex===a.rowIndex&&i.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return u&&!o?d?r.focusCell(!0,n):((f=r.comp)!=null&&f.getCellEditor()||_d(this.beans,r,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(r),r.focusCell(!1,n)):(u&&o&&this.setFocusInOnEditor(r),r.focusCell(!0,n)),!c&&!o&&((p=this.editSvc)==null||p.stopEditing({rowNode:e.rowNode},{event:n}),this.cleanupEditors(r,!0),d?r.focusCell(!0,n):this.editSvc.startEditing(r,{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 i;if(n!=="editing")return;const o=Wn(this.beans,{rowNode:t,column:s});o&&!((i=o.comp)!=null&&i.getCellEditor())&&_d(this.beans,o,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},kve=class extends CB{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:i}=e||{};return(!this.rowNode||!this.column)&&o&&i?null:this.rowNode!==o||this.column!==i}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:i}=e,r=ga(this.beans,{rowIndex:s,rowPinned:i}),a=e_(o),l=t.getCol(a),u=e.previousParams;if(u){const c=e_(u.column);if((u==null?void 0:u.rowIndex)===s&&c===a&&(u==null?void 0:u.rowPinned)===i)return}n!=null&&n.isEditing({rowNode:r,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 i=this.beans.focusSvc.getFocusedCell();i&&(e=Sd(this.beans,i)??e);const r=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(r,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const u=a.cellPosition,c=e.isCellEditable(),d=a.isCellEditable(),h=u&&r.rowIndex===u.rowIndex&&r.rowPinned===u.rowPinned;c&&!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});_d(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}},fl={moduleName:"EditCore",version:ut,beans:[Vfe,Fve],apiFunctions:{getEditingCells:lve,getEditRowValues:ave,getCellEditorInstances:$fe,startEditingCell:dve,stopEditing:uve,isEditing:cve,validateEdit:hve},dynamicBeans:{singleCell:kve,fullRow:Ave},dependsOn:[Ey,uB],css:[Vme]},Ove={moduleName:"UndoRedoEdit",version:ut,beans:[Lme],apiFunctions:{undoCellEditing:ive,redoCellEditing:rve,getCurrentUndoSize:fve,getCurrentRedoSize:pve},dependsOn:[fl]},Mve={moduleName:"TextEditor",version:ut,userComponents:{agCellEditor:dB,agTextCellEditor:dB},dependsOn:[fl]},Nve={moduleName:"NumberEditor",version:ut,userComponents:{agNumberCellEditor:{classImp:Xme}},dependsOn:[fl]},Lve={moduleName:"DateEditor",version:ut,userComponents:{agDateCellEditor:Ume,agDateStringCellEditor:jme},dependsOn:[fl]},Vve={moduleName:"CheckboxEditor",version:ut,userComponents:{agCheckboxCellEditor:$me},dependsOn:[fl]},Bve={moduleName:"SelectEditor",version:ut,userComponents:{agSelectCellEditor:Qme},dependsOn:[fl]},$ve={moduleName:"LargeTextEditor",version:ut,userComponents:{agLargeTextCellEditor:qme},dependsOn:[fl]},Hve={moduleName:"CustomEditor",version:ut,dependsOn:[fl]},Gve=class extends We{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,fd(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),Qoe(e))}createColumns(e,t){var h,f;const n=()=>{var p;Uv(this.beans,(p=this.columns)==null?void 0:p.tree),this.columns=null},s=e.treeDepth,i=(((h=this.columns)==null?void 0:h.treeDepth)??-1)==s,r=this.generateSelectionCols();if(Joe(r,((f=this.columns)==null?void 0:f.list)??[])&&i)return;n();const{colGroupSvc:l}=this.beans,u=(l==null?void 0:l.findDepth(e.tree))??0,c=(l==null?void 0:l.balanceTreeForAutoCols(r,u))??[];this.columns={list:r,tree:c,treeDepth:u,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!ua(v));return[...r,...g]})}updateColumns(e){var n;const t=fd(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),$i(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 r,a;const{gos:e,beans:t}=this,n=e.get("rowSelection");if(typeof n!="object"||!mu(e))return!1;const s=(((a=(r=t.autoColSvc)==null?void 0:r.getColumns())==null?void 0:a.length)??0)>0;if(n.checkboxLocation==="autoGroupColumn"&&s)return!1;const o=!!hd(n),i=Lv(n);return o||i}createSelectionColDef(e){const{gos:t}=this,n=e??t.get("selectionColumnDef"),s=t.get("enableRtl"),{rowSpan:o,spanRows:i,...r}=n??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:s?"right":"left",comparator(a,l,u,c){const d=u.isSelected(),h=c.isSelected();return d===h?0:d?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...r,colId:lL,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new wu(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const s=t&&typeof t!="string"?hd(t):void 0,o=e&&typeof e!="string"?hd(e):void 0,i=s!==o,r=t&&typeof t!="string"?Lv(t):void 0,a=e&&typeof e!="string"?Lv(e):void 0,l=r!==a,u=Vv(e),c=Vv(t);(i||l||u!==c)&&this.beans.colModel.refreshAll(n)}destroy(){var e;Uv(this.beans,(e=this.columns)==null?void 0:e.tree),super.destroy()}refreshVisibility(e,t,n){var l,u;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 i=()=>{let c;switch(o.pinned){case"left":case!0:c=e;break;case"right":c=n;break;default:c=t}c&&Bi(c,o)};(((u=this.beans.rowNumbersSvc)==null?void 0:u.getColumn(uL))?2:1)===s&&i()}};function Uve(e,t){var r;if(!t.nodes.every(a=>a.rowPinned&&!ap(a)?(Xe(59),!1):a.id===void 0?(Xe(60),!1):!0))return;const{nodes:s,source:o,newValue:i}=t;(r=e.selectionSvc)==null||r.setNodesSelected({nodes:s,source:o??"api",newValue:i})}function Wve(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.selectAllRowNodes({source:n,selectAll:t})}function zve(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.deselectAllRowNodes({source:n,selectAll:t})}function jve(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function Kve(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function qve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function Yve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function Zve(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function Xve(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var Jve=class extends due{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=Bv(e),this.groupSelectsDescendants=Zf(e),this.groupSelectsFiltered=$v(e)==="filteredDescendants",this.masterSelectsDetail=sL(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=Zf(e),n=Bv(e),s=$v(e)==="filteredDescendants";this.masterSelectsDetail=sL(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?SB(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:i,keepDescendants:r=!1}){var u;if(s.length===0)return 0;const{gos:a}=this;if(!mu(a)&&e)return Xe(132),0;if(s.length>1&&!this.isMultiSelect())return Xe(130),0;let l=0;for(let c=0;c<s.length;c++){const d=s[c],h=Fd(d);if(h.rowPinned&&!ap(h)){Xe(59);continue}if(h.id===void 0){Xe(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,o,i)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((u=h.childrenAfterGroup)!=null&&u.length)&&(l+=this.selectChildren(h,e,i))}return n||(s.length===1&&i==="api"&&this.selectionCtx.setRoot(Fd(s[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(Fd(s[0]),r,i)),l>0&&(this.updateGroupsFromChildrenSelections(i),this.dispatchSelectionChanged(i))),l}selectRange(e,t,n){let s=0;return e.forEach(o=>{const i=Fd(o);if(i.group&&this.groupSelectsDescendants)return;this.selectRowNode(i,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(!os(n))return!1;const o=s.rootNode;if(!o)return!1;t||(t=new up(!0,o),t.active=!1);let i=!1;return t.forEachChangedNodeDepthFirst(r=>{if(r!==o){const a=this.calculateSelectedFromChildren(r);i=this.selectRowNode(r,a===null?!1:a,void 0,e)||i}}),i}clearOtherNodes(e,t,n){const s=new Map;let o=0;return this.selectedNodes.forEach(i=>{const r=i.id==e.id;if((t?!eye(e,i):!0)&&!r){const l=this.selectedNodes.get(i.id);o+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:n}),this.groupSelectsDescendants&&i.parent&&s.set(i.parent.id,i.parent)}}),s.forEach(i=>{const r=this.calculateSelectedFromChildren(i);this.selectRowNode(i,r===null?!1:r,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 al(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(!os(e))return;const n=t.getTopLevelNodes();if(n===null)return;const s=[];function o(i){for(let r=0,a=i.length;r<a;r++){const l=i[r];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=os(this.gos);let s=!1;const o=i=>{const r=this.selectRowNode(Fd(i),!1,void 0,e);s||(s=r)};if(t==="currentPage"||t==="filtered"){if(!n){Sn(102);return}this.getNodesToSelect(t).forEach(o)}else this.selectedNodes.forEach(o),this.reset(e);if(this.selectionCtx.selectAll=!1,n&&this.groupSelectsDescendants){const i=this.updateGroupsFromChildrenSelections(e);s||(s=i)}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 bB(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 i=r=>{var a;n(r),(a=r.childrenAfterFilter)==null||a.forEach(i)};i(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 i=s;i<=o;i++){const r=n.getRow(i);r&&e(r)}}selectAllRowNodes(e){const{gos:t,selectionCtx:n}=this;if(!mu(t)){Xe(132);return}if(Boe(t)&&!Yf(t)){Xe(130);return}if(!this.canSelectAll())return;const{source:s,selectAll:o}=e;let i=!1;if(this.getNodesToSelect(o).forEach(r=>{const a=this.selectRowNode(Fd(r),!0,void 0,s);i||(i=a)}),n.selectAll=!0,os(t)&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(s);i||(i=r)}i&&this.dispatchSelectionChanged(s)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,n){if(e||(e=[]),!Array.isArray(e)){Sn(103);return}const s=new Set(e),o=[];this.beans.rowModel.forEachNode(i=>{s.has(i.id)&&o.push(i)}),n&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:o,source:t})}canSelectAll(){return os(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!mu(t))return;const s="selectableChanged",o=e!==void 0,i=os(t)&&this.groupSelectsDescendants,r=[],a=u=>{var d;if(o&&!u.group)return;if(i&&u.group){const h=((d=u.childrenAfterGroup)==null?void 0:d.some(f=>f.selectable))??!1;this.setRowSelectable(u,h,!0);return}!this.updateRowSelectable(u,!0)&&u.isSelected()&&r.push(u)};if(i){if(e===void 0){const u=n.rootNode;e=u?new up(!1,u):void 0}e==null||e.forEachChangedNodeDepthFirst(a,!o,!o)}else n.forEachNode(a);r.length&&this.setNodesSelected({nodes:r,newValue:!1,source:s}),!o&&i&&((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 i,r;if(!this.masterSelectsDetail)return;const n=(r=(i=e.detailNode)==null?void 0:i.detailGridInfo)==null?void 0:r.api;if(!n)return;const s=Qve(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)){Xe(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 i of s){const r=n.getRowNode(i);r&&o.push(r)}n.setNodesSelected({nodes:o,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function Fd(e){return ap(e)?e.pinnedSibling:e.footer?e.sibling:e}function Qve(e){let t=0,n=0;return e.forEachNode(s=>{s.isSelected()?t++:s.selectable&&n++}),bB(t,n)}function bB(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function eye(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function SB(e){var s;const t=e.isSelected()===!1,n=((s=e.childrenAfterFilter)==null?void 0:s.some(SB))??!1;return t||n}var tye={moduleName:"SharedRowSelection",version:ut,beans:[Gve],apiFunctions:{setNodesSelected:Uve,selectAll:Wve,deselectAll:zve,selectAllFiltered:jve,deselectAllFiltered:Kve,selectAllOnCurrentPage:qve,deselectAllOnCurrentPage:Yve,getSelectedNodes:Zve,getSelectedRows:Xve}},nye={moduleName:"RowSelection",version:ut,rowModels:["clientSide","infinite","viewport"],beans:[Jve],dependsOn:[tye]};function sye(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function oye(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function EB(e){var t;(t=e.rowModel)==null||t.onRowHeightChanged()}function _B(e){var t,n;if((t=e.rowAutoHeight)!=null&&t.active){Xe(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function iye(e,t,n){var o,i;const s=rge(e);if(s){if(((o=e.rowGroupColsSvc)==null?void 0:o.columns.length)===0){if(t<0){Sn(238);return}s.setRowCount(t,n);return}Sn(28);return}(i=Sy(e))==null||i.setRowCount(t,n)}function rye(e){var t;return ud(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function aye(e){return e.rowModel.isLastRowIndexKnown()}var lye={moduleName:"CsrmSsrmSharedApi",version:ut,apiFunctions:{expandAll:sye,collapseAll:oye}},uye={moduleName:"RowModelSharedApi",version:ut,apiFunctions:{onRowHeightChanged:EB,resetRowHeights:_B}},cye={moduleName:"SsrmInfiniteSharedApi",version:ut,apiFunctions:{setRowCount:iye,getCacheBlockState:rye,isLastRowIndexKnown:aye}},dye=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 i;if(!s){Sn(18),t||Sn(20);return}if(this.isGridApi(s))return s;const o=s;return"current"in o?(i=o.current)==null?void 0:i.api:(o.api||Sn(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":Xe(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:i,colModel:r}=s;if(t&&(n=r.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}));$i(s,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));$i(s,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));$i(s,{state:d},"alignedGridChanged")}break;case"columnResized":{const c=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of c.flexColumns??[])d[h.getId()]&&delete d[h.getId()];o==null||o.setColumnWidths(Object.values(d),!1,c.finished,"alignedGridChanged");break}}const u=i.getGridBodyCtrl().isVerticalScrollShowing();for(const c of this.getAlignedGridApis())c.setGridOption("alwaysShowVerticalScroll",u)}},hye={moduleName:"AlignedGrids",version:ut,beans:[dye],dependsOn:[l2]},fye=class extends We{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},RB(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=RB(this.rootNode),i=new Array(e.length);o._leafs=i;let r=0;const a=s==null?void 0:s.getNestedDataGetter(),l=a?new Set:null,u=(c,d)=>{const h=c.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=r,i[r++]=v,l&&!l.has(g)){l.add(g),v.treeParent=c;const C=a(g);C&&u(v,C)}}};u(o,e),i.length=r}setImmutableRowData(e,t){var C;const{rootNode:n,gos:s}=this;this.dispatchRowDataUpdateStarted(t);const o=dd(s),i=e.changedRowNodes,{adds:r,updates:a}=i,l=new Set,u=[],c=(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),r.has(S)||a.add(S),!S.selectable&&S.isSelected()&&u.push(S))},g=(S,b,w)=>{for(let _=0,R=b.length;_<R;++_){const T=b[_];if(!T)continue;let I=this.getRowNode(o({data:T,level:w}));if(I?(p(I,T),f||(f=!!c&&I.treeParent!==S)):(I=this.createRowNode(T,w),r.add(I)),!c||l.has(I)){l.add(I);continue}l.add(I),I.treeParent=S;const x=c(T);x&&g(I,x,w+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,i,u)||d||r.size>0;if(v){const S=n._leafs??(n._leafs=[]);d===void 0?yye(S,l,i):vye(S,l)&&(i.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(u))}deleteUnusedNodes(e,{removals:t},n){const s=this.rootNode._leafs;for(let o=0,i=s.length;o<i;o++){const r=s[o];e.has(r)||(t.add(r),r.isSelected()&&n.push(r),this.deleteNode(r))}return t.size>0}updateRowData(e,t){var a;if(this.dispatchRowDataUpdateStarted(e.add),(a=this.beans.groupStage)!=null&&a.getNestedDataGetter())return Xe(268),{remove:[],update:[],add:[]};const n=[],s=dd(this.gos),o=this.executeRemove(s,e,t,n),i=this.executeUpdate(s,e,t,n),r=this.executeAdd(e,t);return this.deselect(n),{remove:o,update:i,add:r}}executeRemove(e,{remove:t},{adds:n,updates:s,removals:o},i){const r=this.rootNode._leafs,a=r==null?void 0:r.length,l=t==null?void 0:t.length;if(!l||!a)return[];let u=0,c=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<c&&(c=v),v>d&&(d=v),g.isSelected()&&i.push(g),this.deleteNode(g),n.delete(g)?(h??(h=new Set),h.add(g)):(s.delete(g),o.add(g)),f[u++]=g}return f.length=u,u&&mye(r,c,d,o,h),f}executeUpdate(e,{update:t},{adds:n,updates:s},o){const i=t==null?void 0:t.length;if(!i)return[];const r=new Array(i);let a=0;for(let l=0;l<i;l++){const u=t[l],c=this.lookupNode(e,u);c&&(c.updateData(u),!c.selectable&&c.isSelected()&&o.push(c),r[a++]=c,n.has(c)||s.add(c))}return r.length=a,r}executeAdd(e,t){var n;const s=(n=this.rootNode)._leafs??(n._leafs=[]),o=s.length,i=e.add,r=i==null?void 0:i.length;if(!r)return[];const a=o+r;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 u=new Array(r),c=t.adds;for(let d=0;d<r;d++){const h=this.createRowNode(i[d],0);c.add(h),h.sourceRowIndex=l,s[l]=h,u[d]=h,l++}return u}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 al(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]&&Xe(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 gye(this.rootNode._leafs,t);const n=e({data:t,level:0}),s=this.allNodesMap[n];return s||(Sn(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=pye(e,t)),t}},pye=(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},RB=e=>{var r;e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",((r=e._leafs)==null?void 0:r.length)!==0&&(e._leafs=[]);const t=[],n=[],s=[],o=[];e.childrenAfterGroup=t,e.childrenAfterSort=n,e.childrenAfterAggFilter=s,e.childrenAfterFilter=o;const i=e.sibling;return i&&(i.childrenAfterGroup=t,i.childrenAfterSort=n,i.childrenAfterAggFilter=s,i.childrenAfterFilter=o,i.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},gye=(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 Sn(5,{data:t}),null},mye=(e,t,n,s,o)=>{t=Math.max(0,t);for(let i=t,r=e.length;i<r;++i){const a=e[i];i<=n&&(s.has(a)||o!=null&&o.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},vye=(e,t)=>{const n=t.size;e.length=n;let s=0,o=!1,i=!1;for(const r of t){const a=r.sourceRowIndex;a===s?i||(i=o):(a>=0?i=!0:o=!0,r.sourceRowIndex=s,e[s]=r),++s}return i},yye=(e,t,{removals:n,adds:s})=>{const o=e.length;e.length=t.size;let i=0;for(let r=0;r<o;++r){const a=e[r];n.has(a)||(i!==r&&(a.sourceRowIndex=i,e[i]=a),++i)}for(const r of s)r.sourceRowIndex<0&&(r.sourceRowIndex=i,e[i++]=r);e.length=i},DB=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 i=t[s],r=s===0,a=s===o;i.firstChild!==r&&(i.firstChild=r,i.dispatchRowEvent("firstChildChanged")),i.lastChild!==a&&(i.lastChild=a,i.dispatchRowEvent("lastChildChanged")),i.childIndex!==s&&(i.childIndex=s,i.dispatchRowEvent("childIndexChanged"))}},wye=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:i,rowGroupColsSvc:r,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:u}=this.beans,c=o.get("groupMaintainOrder"),d=i.getCols().some(S=>S.isRowGroupActive()),h=r==null?void 0:r.columns,f=i.isPivotMode(),p=o.getCallback("postSortRows");let g=!1,v;const C=S=>{var R,T;const b=f&&S.leafGroup;let w=c&&d&&!S.leafGroup;w&&(v??(v=this.shouldSortContainsGroupCols(e)),w&&(w=!v));let _=null;if(w){let I=!1;if(h){const x=S.level+1;x<h.length&&(I=h[x].getSort()===null)}I||(_=Sye(S))}else!e.length||b||(t&&n?_=Cye(a,S,n,s,e):_=a.doFullSort(S.childrenAfterAggFilter,e));if(_||(_=((R=S.childrenAfterAggFilter)==null?void 0:R.slice(0))??[]),g||(g=((T=S.childrenAfterSort)==null?void 0:T[0])!==_[0]),S.childrenAfterSort=_,DB(S),p){const I={nodes:S.childrenAfterSort};p(I)}};if(s==null||s.forEachChangedNodeDepthFirst(C),g&&o.get("groupHideOpenParents")){const S=u==null?void 0:u.getShowRowGroupCols();S!=null&&S.length&&l.refreshCells({columns:S,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(Cr(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}},Cye=(e,t,n,s,o)=>{const i=t.childrenAfterAggFilter,r=t.childrenAfterSort;if(!r)return e.doFullSort(i,o);const a=new Set,l=[],{updates:u,adds:c}=n;for(let h=0,f=i.length;h<f;++h){const p=i[h];u.has(p)||c.has(p)||s&&!s.canSkip(p)?l.push({currentPos:l.length,rowNode:p}):a.add(p)}const d=r.filter(h=>a.has(h)).map((h,f)=>({currentPos:f,rowNode:h}));return l.sort((h,f)=>e.compareRowNodes(o,h,f)),bye(e,o,l,d)},bye=(e,t,n,s)=>{let o=0,i=0;const r=n.length,a=s.length,l=new Array(r+a);let u=0;for(;o<r&&i<a;){const c=n[o],d=s[i];e.compareRowNodes(t,c,d)<0?(l[u++]=c.rowNode,++o):(l[u++]=d.rowNode,++i)}for(;o<r;)l[u++]=n[o++].rowNode;for(;i<a;)l[u++]=s[i++].rowNode;return l},Sye=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 i=new Array(o),r=new Set;for(let l=0;l<o;++l)r.add(n[l]);let a=0;for(let l=0;l<s;++l){const u=t[l];r.delete(u)&&(i[a++]=u)}if(r.size===0&&a===s)return t;for(const l of r)i[a++]=l;return i.length=a,i},Eye=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 al(e);this.rootNode=t,this.nodeManager=this.createBean(new fye(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 i;const o=(i=s.changeSet)==null?void 0:i.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,i=!1;do{o=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(r,n),u=Math.min(a,s);for(let c=l;c<=u;c++){const d=this.getRow(c);if(d.rowHeightEstimated){const h=nl(this.beans,d);d.setRowHeight(h.height),o=!0,i=!0}}o&&this.setRowTopAndRowIndex()}while(o);return i}onPropChange(e){const{nodeManager:t,gos:n,beans:s}=this,o=s.groupStage;if(!t)return;const i=new Set(e),r=o==null?void 0:o.onPropChange(i);let a;i.has("rowData")?a=n.get("rowData"):r&&(a=o==null?void 0:o.extractData()),a&&!Array.isArray(a)&&(a=null,Xe(1));const l={step:"nothing",changedProps:i};a&&(!r&&!this.isEmpty()&&a.length>0&&n.exists("getRowId")&&!n.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!n.get("suppressAnimationFrame"),l.changedRowNodes=new py,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const u=l.rowDataUpdated?"group":this.getRefreshedStage(e);u&&(l.step=u,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:n}=this,s=t.length;let o=s;for(let i=0,r=e.length;i<r&&o;++i)o=Math.min(o,n.get(e[i])??o);return o<s?t[o].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:n}=this,s=t.environment.getDefaultRowHeight();let o=0;const i=Ms(this.gos,"normal");for(let r=0,a=n.length;r<a;++r){const l=n[r],u=l.id;if(u!=null&&(e==null||e.add(u)),l.rowHeight==null){const c=nl(t,l,i,s);l.setRowHeight(c.height,c.estimated)}l.setRowTop(o),l.setRowIndex(r),o+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const n=e.active,s=r=>{(r==null?void 0:r.id)!=null&&!t.has(r.id)&&r.clearRowTopAndRowIndex()},o=r=>{s(r),s(r.detailNode),s(r.sibling);const a=r.childrenAfterGroup;if(!r.hasChildren()||!a)return;const l=r.level==-1;if(!(n&&!l&&!r.expanded))for(let c=0,d=a.length;c<d;++c)o(a[c])},i=this.rootNode;i&&o(i)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){var o,i;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(((i=e.childrenAfterSort)==null?void 0:i.length)??0)+s}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:n,rowsToDisplay:s}=this;if(!n||!s.length||s[0]===n)return e;const i=n.childrenAfterSort,r=l=>{let u=i[l];if(this.gos.get("groupHideOpenParents"))for(;u.expanded&&u.childrenAfterSort&&u.childrenAfterSort.length>0;)u=u.childrenAfterSort[0];return u.rowIndex},a=t.footerSvc;return a?a==null?void 0:a.getTopDisplayIndex(s,e,i,r):r(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 i=o.parent;for(;i&&i!==t;)o=i,i=o.parent;const r=((a=t.childrenAfterSort)==null?void 0:a.indexOf(o))??-1;return r>=0?r: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 up(!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 u,c;const{nodeManager:t,beans:n,eventSvc:s,started:o,refreshingModel:i}=this;if(!t)return;const r=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&r));if(o&&r&&s.dispatchEvent({type:"rowDataUpdated"}),!o||i||n.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=r);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,(u=n.masterDetailSvc)==null||u.refreshModel(e),r&&e.step!=="group"&&((c=n.colFilter)==null||c.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=[],i=Zf(this.gos);return this.forEachNodeAfterFilterAndSort(r=>{if(s)return;if(n&&(r===t||r===e)&&(s=!0,i&&r.group)){TB(o,r);return}if(!n){if(r!==t&&r!==e)return;n=!0,t===e&&(s=!0)}(!r.group||!i)&&o.push(r)}),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 r=-1,a=-1;for(;;){const l=Math.floor((s+o)/2),u=t[l];if(this.isRowInPixel(u,e)||(u.rowTop<e?s=l+1:u.rowTop>e&&(o=l-1),r===s&&a===o))return l;r=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 i=n?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,r=>r.leafGroup?null:r[i])}depthFirstSearchRowNodes(e,t=!1,n=i=>i.childrenAfterGroup,s=this.rootNode,o=0){let i=o;if(!s)return i;const r=s===this.rootNode;if(r||e(s,i++),s.hasChildren()&&!s.footer){const a=n(s);if(a){const l=this.beans.footerSvc;i=(l==null?void 0:l.addTotalRows(i,s,e,t,r,"top"))??i;for(const u of a)i=this.depthFirstSearchRowNodes(e,t,n,u,i);return(l==null?void 0:l.addTotalRows(i,s,e,t,r,"bottom"))??i}}return i}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),DB(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 i=t._leafs;t.childrenAfterGroup=i,t.updateHasChildren();const r=t.sibling;r&&(r.childrenAfterGroup=i)}(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,j2(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(p0)===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=[],i=[],r=new py;for(const{rowDataTransaction:l,callback:u}of s??[]){this.rowNodesCountReady=!0;const c=e.updateRowData(l,r);o.push(c),u&&i.push(u.bind(null,c))}this.commitTransactions(r),i.length>0&&setTimeout(()=>{for(let l=0,u=i.length;l<u;l++)i[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 py,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()}},TB=(e,t)=>{const n=t.childrenAfterGroup;if(n)for(let s=0,o=n.length;s<o;++s){const i=n[s];i.data&&e.push(i),i.group&&TB(e,i)}};function _ye(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function Rye(e,t){const n=hl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function Dye(e){var t;return((t=hl(e))==null?void 0:t.isEmpty())??!0}function Tye(e,t){var n;(n=hl(e))==null||n.forEachLeafNode(t)}function Iye(e,t){var n;(n=hl(e))==null||n.forEachNodeAfterFilter(t)}function xye(e,t){var n;(n=hl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function Fye(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=hl(e))==null?void 0:n.updateRowData(t)})}function Pye(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var s;return(s=hl(e))==null?void 0:s.batchUpdateRowData(t,n)})}function Aye(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=hl(e))==null?void 0:t.flushAsyncTransactions()})}function kye(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var IB={moduleName:"ClientSideRowModel",version:ut,rowModels:["clientSide"],beans:[Eye,wye],dependsOn:[L2]},Oye={moduleName:"ClientSideRowModelApi",version:ut,apiFunctions:{onGroupExpandedOrCollapsed:_ye,refreshClientSideRowModel:Rye,isRowDataEmpty:Dye,forEachLeafNode:Tye,forEachNodeAfterFilter:Iye,forEachNodeAfterFilterAndSort:xye,applyTransaction:Fye,applyTransactionAsync:Pye,flushAsyncTransactions:Aye,getBestCostNodeSelection:kye,resetRowHeights:_B,onRowHeightChanged:EB},dependsOn:[lye,uye]},Mye=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:i}=t,r=this.getColumnsToExport({allColumns:n,skipRowGroups:o,columnKeys:s,exportRowNumbers:i});return[this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,n,s){var p;const o=t.shouldRowBeSkipped||(()=>!1),r=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!r,l=this.colModel.isPivotMode()?s.leafGroup:!s.group,u=!!s.footer,c=s.allChildrenCount===1&&((p=s.childrenAfterGroup)==null?void 0:p.length)===1&&Loe(this.gos,s);if(!l&&!u&&(t.skipRowGroups||c||a)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.stub||s.level===-1&&!l&&!u||o(Ft(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(Ft(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 CL,{colGroupSvc:o}=this.beans,i=o?o.createColumnGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(i,n,e.processGroupHeaderCallback)}return n}}exportHeaders(e,t){return n=>{if(!e.skipColumnHeaders){const s=n.onNewHeaderRow();t.forEach((o,i)=>{s.onColumn(o,i,void 0)})}return n}}processPinnedTopRows(e,t){return n=>{var o,i;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="top").sort((r,a)=>r.rowIndex-a.rowIndex).map(r=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedTopRow(r.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(i=this.pinnedRowModel)==null||i.forEachPinnedRow("top",s),n}}processRows(e,t){return n=>{var u;const s=this.rowModel,o=os(this.gos),i=ud(this.gos),r=!o&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(c=>c.rowPinned==null).sort((c,d)=>c.rowIndex-d.rowIndex).map(c=>s.getRow(c.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())o?s.forEachPivotNode(a,!0,l==="filteredAndSorted"):i?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||r){const c=((u=this.beans.selectionSvc)==null?void 0:u.getSelectedNodes())??[];this.replicateSortedOrder(c),c.forEach(a)}else l==="all"?s.forEachNode(a):o||i?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=(i,r)=>{var a,l;return i.rowIndex!=null&&r.rowIndex!=null?i.rowIndex-r.rowIndex:i.level===r.level?((a=i.parent)==null?void 0:a.id)===((l=r.parent)==null?void 0:l.id)?n.compareRowNodes(s,{rowNode:i,currentPos:i.rowIndex??-1},{rowNode:r,currentPos:r.rowIndex??-1}):o(i.parent,r.parent):i.level>r.level?o(i.parent,r):o(i,r.parent)};e.sort(o)}processPinnedBottomRows(e,t){return n=>{var o,i;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="bottom").sort((r,a)=>r.rowIndex-a.rowIndex).map(r=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedBottomRow(r.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(i=this.pinnedRowModel)==null||i.forEachPinnedRow("bottom",s),n}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:n=!1,exportRowNumbers:s=!1,columnKeys:o}=e,{colModel:i,gos:r,visibleCols:a}=this,l=i.isPivotMode(),u=h=>ua(h)?!1:!ca(h)||s;if(o!=null&&o.length)return i.getColsForKeys(o).filter(u);const c=r.get("treeData");let d=[];return t&&!l?d=i.getCols():d=a.allCols,d=d.filter(h=>u(h)&&(n&&!c?!$E(h):!0)),d}recursivelyAddHeaderGroups(e,t,n){const s=[];for(const o of e){const i=o;if(i.getChildren)for(const r of i.getChildren()??[])s.push(r)}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 i of t){const r=i;let a;n?a=n(Ft(this.gos,{columnGroup:r})):a=this.beans.colNames.getDisplayNameForColumnGroup(r,"header");const u=(r.isExpandable()?r.getLeafColumns():[]).reduce((c,d,h,f)=>{let p=Tn(c);return d.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],c.push(p)):p&&p[1]==null&&(p[1]=h-1),h===f.length-1&&p&&p[1]==null&&(p[1]=h),c},[]);s.onColumn(r,a||"",o++,r.getLeafColumns().length-1,u)}}},Nye={moduleName:"SharedExport",version:ut,beans:[Mye]},xB=`\r
|
|
252
252
|
`,Lye=class extends hge{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,xB),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():(Xe(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=xB),this.isFirstLine=!1}},Vye=class extends dge{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()){Xe(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(Ft(this.gos,{})):t.fileName;fge(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:i}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:u,suppressQuotes:c,columnSeparator:d}=e;return new Lye({colModel:t,colNames:n,valueSvc:o,gos:i,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:u||void 0,suppressQuotes:c||!1,columnSeparator:d||",",rowGroupColsSvc:s})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function Bye(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function $ye(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var Hye={moduleName:"CsvExport",version:ut,beans:[Vye],apiFunctions:{getDataAsCsv:Bye,exportDataAsCsv:$ye},dependsOn:[Nye]},Gye=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 i=0;i<e;i++){const r=n+i,a=new al(s);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),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){dt(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Vn(this.params.datasource.getRows)){Xe(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:s,filterModel:o},gos:i}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:s,filterModel:o,context:Ft(i,{}).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,i)=>{const r=e.rowData?e.rowData[i]:void 0;!o.id&&o.alreadyRendered&&r&&(t[i]=new al(n),t[i].setRowIndex(o.rowIndex),t[i].setRowTop(o.rowTop),t[i].setRowHeight(o.rowHeight),o.clearRowTopAndRowIndex()),this.setDataAndId(t[i],r,this.startRow+i)});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()}},Uye=2,Wye=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 Gye(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()&&(tl(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),n=(r,a)=>a.lastAccessed-r.lastAccessed;t.sort(n);const s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,i=Uye-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=i,u=s?a>=o:!1;if(l||u){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}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,i=(e.id+1)*n+s;this.rowCount<i&&(this.rowCount=i)}}setRowCount(e,t){this.rowCount=e,dt(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 i={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(o&&s+1!==l.id){r=!0;continue}s=l.id,l.forEachNode(u=>{const c=u===e||u===t;(o||c)&&n.push(u),c&&(o=!o)},i,this.rowCount)}return r||o?[]:n}},zye=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 al(e);this.rootNode=t,t.level=-1,this.rowHeight=vu(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=vu(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;dd(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:i}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:s,initialRowCount:i.get("infiniteInitialRowCount"),maxBlocksInCache:i.get("maxBlocksInCache"),rowHeight:vu(e),overflowSize:i.get("cacheOverflowSize"),blockSize:i.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new Wye(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 jye(e){var t;(t=Sy(e))==null||t.refreshCache()}function Kye(e){var t;(t=Sy(e))==null||t.purgeCache()}function qye(e){var t;return(t=Sy(e))==null?void 0:t.getRowCount()}var Yye=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=Voe(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){Bi(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){tl(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(){tl(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},Zye={moduleName:"InfiniteRowModelCore",version:ut,rowModels:["infinite"],beans:[zye,Yye]},Xye={moduleName:"InfiniteRowModel",version:ut,apiFunctions:{refreshInfiniteCache:jye,purgeInfiniteCache:Kye,getInfiniteRowCount:qye},dependsOn:[Zye,cye]},Jye="↑",Qye="↓",ewe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},twe=class extends wn{constructor(){super(ewe),this.eValue=ct,this.eDelta=ct,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),s=e.formatValue(n),o=dt(s)?s:n,i=t>=0,r=this.eDelta;i?r.textContent=Jye+o:r.textContent=Qye+o,r.classList.toggle("ag-value-change-delta-up",i),r.classList.toggle("ag-value-change-delta-down",!i)}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 u;const{value:n,valueFormatted:s}=e,{eValue:o,lastValue:i,beans:r}=this;if(n===i||(dt(s)?o.textContent=s:dt(n)?o.textContent=n:ks(o),(u=r.filterManager)!=null&&u.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=i&&typeof i=="object"&&"toNumber"in i?i.toNumber():i;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const c=a-l;this.showDelta(e,c)}return i&&o.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},nwe=".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}",swe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},owe=class extends wn{constructor(){super(swe),this.eCurrent=ct,this.refreshCount=0,this.registerCSS(nwe)}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=rs({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 i;e===this.refreshCount&&((i=this.ePrevious)==null||i.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 dt(e.valueFormatted)?s.textContent=e.valueFormatted:dt(e.value)?s.textContent=n:ks(s),!0}},iwe=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 i=Date.now(),r=i+n,a=i+n+s,l={phase:"flash",flashEndTime:r,fadeEndTime:a};o.set(e,l);const u=`ag-cell-${t}`,c=`${u}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(u,!0),d.toggleCss(c,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&r+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=r)}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}`,i=`${o}-animation`;for(const[r,a]of s){if(!r.isAlive()||!r.comp){s.delete(r);continue}const{phase:l,flashEndTime:u,fadeEndTime:c}=a,d=l==="flash"?u:c;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=r;switch(l){case"flash":f.toggleCss(o,!1),f.toggleCss(i,!0),p.transition=`background-color ${c-u}ms`,p.transitionDelay=`${u-e}ms`,t=Math.min(c,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(o,!1),f.toggleCss(i,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),s.delete(r);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=oce(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 rwe(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 awe={moduleName:"HighlightChanges",version:ut,beans:[iwe],userComponents:{agAnimateShowChangeCellRenderer:twe,agAnimateSlideCellRenderer:owe},apiFunctions:{flashCells:rwe}};function lwe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function uwe(e,t,n){var s;return(s=e.stateSvc)==null?void 0:s.setState(t,n)}function FB(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=cwe(e)),e.version=ut,e}function cwe(e){return e.cellSelection=dwe(e,"rangeSelection"),e}function dwe(e,t){if(e&&typeof e=="object")return e[t]}var hwe=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=os(e);const s=FB(e.get("initialState")??{}),o=s.partialColumnState;delete s.partialColumnState,this.cachedState=s;const i=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>i(()=>this.setupStateOnGridReady(s))),(s.columnOrder||s.columnVisibility||s.columnSizing||s.columnPinning||s.columnGroup)&&(n==null||n.hideColumns("columnState"));const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:u})=>{u==="gridInitializing"&&(r(),i(()=>{this.setupStateOnColumnsInitialised(s,!!o),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),i(()=>this.setupStateOnRowCountReady(s))},firstDataRendered:()=>{l==null||l(),i(()=>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=FB(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:i,rowSelection:r,pagination:a}=e,l=(c,d)=>!(n!=null&&n.has(c))&&(d||t==="api");l("filter",s)&&this.setFilterState(s),l("rowGroupExpansion",o)&&this.setRowGroupExpansionState(i,o,t),l("rowSelection",r)&&this.setRowSelectionState(r,t),l("pagination",a)&&this.setPaginationState(a,t);const u=this.updateCachedState.bind(this);u("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(u("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),u("rowGroupExpansion",void 0)):(u("rowGroupExpansion",this.getRowGroupExpansionState()),u("ssrmRowGroupExpansion",void 0)),u("rowSelection",this.getRowSelectionState()),u("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:i}=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:r=>{(r.newPage||r.newPageSize)&&t("pagination",this.getPaginationState())}}),i&&this.addManagedListeners(i,{filterStateChanged:s})}setFirstDataRenderedState(e,t,n){const{scroll:s,cellSelection:o,focusedCell:i,columnOrder:r,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",i)&&this.setFocusedCellState(i),l("cellSelection",o)&&this.setCellSelectionState(o),l("scroll",s)&&this.setScrollState(s),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(r!=null&&r.orderedColIds),t);const u=this.updateCachedState.bind(this);u("sideBar",this.getSideBarState()),u("focusedCell",this.getFocusedCellState());const c=this.getRangeSelectionState();u("rangeSelection",c),u("cellSelection",c),u("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 lge(zv(e),e.colModel.isPivotMode())}setColumnState(e,t,n,s){const{sort:o,rowGroup:i,aggregation:r,pivot:a,columnPinning:l,columnVisibility:u,columnSizing:c,columnOrder:d}=e;let h=!1;const f=(D,F)=>{const k=!(s!=null&&s.has(D))&&!!(F||t==="api");return h||(h=k),k},p={},g=D=>{let F=p[D];return F||(F={colId:D},p[D]=F,F)},v={},C=f("sort",o);C&&(o==null||o.sortModel.forEach(({colId:D,sort:F},k)=>{const O=g(D);O.sort=F,O.sortIndex=k})),(C||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",i);S&&(i==null||i.groupColIds.forEach((D,F)=>{const k=g(D);k.rowGroup=!0,k.rowGroupIndex=F})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",r);b&&(r==null||r.aggregationModel.forEach(({colId:D,aggFunc:F})=>{g(D).aggFunc=F})),(b||!n)&&(v.aggFunc=null);const w=f("pivot",a);w&&(a==null||a.pivotColIds.forEach((D,F)=>{const k=g(D);k.pivot=!0,k.pivotIndex=F}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(w||!n)&&(v.pivot=null,v.pivotIndex=null);const _=f("columnPinning",l);if(_){for(const D of(l==null?void 0:l.leftColIds)??[])g(D).pinned="left";for(const D of(l==null?void 0:l.rightColIds)??[])g(D).pinned="right"}(_||!n)&&(v.pinned=null);const R=f("columnVisibility",u);if(R)for(const D of(u==null?void 0:u.hiddenColIds)??[])g(D).hide=!0;(R||!n)&&(v.hide=null);const T=f("columnSizing",c);if(T)for(const{colId:D,flex:F,width:k}of(c==null?void 0:c.columnSizingModel)??[]){const O=g(D);O.flex=F??null,O.width=k}(T||!n)&&(v.flex=null);const I=d==null?void 0:d.orderedColIds,x=!!(I!=null&&I.length)&&!(s!=null&&s.has("columnOrder")),P=x?I.map(D=>g(D)):Object.values(p);(P.length||h)&&(this.columnStates=P,$i(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:i,colGroupSvc:r}=o;if(i!=null&&i.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)i.getPivotResultCol(l.colId)&&a.push(l);$i(o,{state:a,applyOrder:e},t)}s&&(r==null||r.setColumnGroupState(s,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return uge(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),r=s.getColumnGroupState().map(({groupId:l})=>{const u=o.has(l);return u&&o.delete(l),{groupId:l,open:u}});for(const l of o)r.push({groupId:l,open:!0});r.length&&(this.columnGroupStates=r),s.setColumnGroupState(r,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:i,endRow:r,columns:a,startColumn:l}=n;return{id:s,type:o,startRow:i,endRow:r,colIds:a.map(u=>u.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(!aa(t)||!n)return;const i=[];for(const r of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const u of r.colIds){const c=s.getCol(u);c&&a.push(c)}if(!a.length)continue;let l=s.getCol(r.startColId);if(!l){const u=o.allCols,c=new Set(a);l=u.find(d=>c.has(d))}i.push({...r,columns:a,startColumn:l})}n.setCellRanges(i)}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:i,ctrlsSvc:r}=this.beans;s.wrapIncoming(()=>{var a;r.get("center").setCenterViewportScrollLeft(n),(a=r.getScrollFeature())==null||a.setVerticalScrollPosition(t),o.redraw({afterScroll:!0}),i==null||i.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:i}=e;t.setFocusedCell({column:n.getCol(s),rowIndex:o,rowPinned:i,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:i}=e??{page:0,pageSize:s.get("paginationPageSize")},r=t==="gridInitializing";o&&!s.get("paginationAutoPageSize")&&n.setPageSize(o,r?"initialState":"pageSizeSelector"),typeof i=="number"&&(r?n.setPage(i):n.goToPage(i))}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 i=t[o];Mf(i,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")}},fwe={moduleName:"GridState",version:ut,beans:[hwe],apiFunctions:{getState:lwe,setState:uwe}};function pwe(e){return e.rowModel.isLastRowIndexKnown()}function gwe(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function mwe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function vwe(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function ywe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function wwe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function Cwe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function bwe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function Swe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Ewe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var _we=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(vu(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",Rwe={tag:"span",cls:"ag-paging-page-size"},Dwe=class extends wn{constructor(){super(Rwe),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"),i=this.gos.get(vp)!==!0;Xe(94,{pageSizeSet:o,pageSizesSet:i,pageSizeOptions:e,paginationPageSizeOption:t}),i||Xe(95,{paginationPageSizeOption:t,paginationPageSizeSelector:vp}),e.unshift("")}const s=String(n?"":t);this.selectPageSizeComp?(ol(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 l0).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()}},Twe={selector:"AG-PAGE-SIZE-SELECTOR",component:Dwe},Iwe=".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}",xwe=class extends HV{constructor(){super(),this.btFirst=ct,this.btPrevious=ct,this.btNext=ct,this.btLast=ct,this.lbRecordCount=ct,this.lbFirstRowOnPage=ct,this.lbLastRowOnPage=ct,this.lbCurrent=ct,this.lbTotal=ct,this.pageSizeComp=ct,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(Iwe)}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(),[Twe]);const{btFirst:t,btPrevious:n,btNext:s,btLast:o}=this;this.activateTabIndex([t,n,s,o]),t.insertAdjacentElement("afterbegin",di(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",di(e?"next":"previous",this.beans)),s.insertAdjacentElement("afterbegin",di(e?"previous":"next",this.beans)),o.insertAdjacentElement("afterbegin",di(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:i=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(i):_le(this.beans,i),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())}})}Ele(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}):cge(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){Vse(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(),i=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=i*o+1,a=r+i-1,e&&a>s&&(a=s));const l=r+i-1,u=!e&&n<l,c=this.formatNumber(r);this.lbFirstRowOnPage.textContent=c;let d;const h=this.getLocaleTextFunc();u?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(c,d,C,g,v)}announceAriaStatus(e,t,n,s,o){var d,h;const i=this.getLocaleTextFunc(),r=i("page","Page"),a=i("to","to"),l=i("of","of"),u=`${e} ${a} ${t} ${l} ${n}`,c=`${r} ${s} ${l} ${o}`;u!==this.ariaRowStatus&&(this.ariaRowStatus=u,(d=this.ariaAnnounce)==null||d.announceValue(u,"paginationRow")),c!==this.ariaPageStatus&&(this.ariaPageStatus=c,(h=this.ariaAnnounce)==null||h.announceValue(c,"paginationPage"))}},Fwe={selector:"AG-PAGINATION",component:xwe},Pwe=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 Fwe}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 dt(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:dt(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:dt(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:dt(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,i=n*o;let r=n*(o+1)-1;if(r>s&&(r=s),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(i),r===s)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(r+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})}},Awe={moduleName:"Pagination",version:ut,beans:[Pwe,_we],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:pwe,paginationGetPageSize:gwe,paginationGetCurrentPage:mwe,paginationGetTotalPages:vwe,paginationGetRowCount:ywe,paginationGoToNextPage:wwe,paginationGoToPreviousPage:Cwe,paginationGoToFirstPage:bwe,paginationGoToLastPage:Swe,paginationGoToPage:Ewe},dependsOn:[Ey]};function kwe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function PB(e,t,n,s,o){t&&(s&&t.parent&&t.parent.level!==-1&&PB(e,t.parent,n,s,o),t.setExpanded(n,void 0,o))}function Owe(e,t){return e.rowModel.getRowNode(t)}function Mwe(e,t,n,s){e.rowRenderer.addRenderedRowListener(t,n,s)}function Nwe(e){return e.rowRenderer.getRenderedNodes()}function Lwe(e,t,n){e.rowModel.forEachNode(t,n)}function Vwe(e){return e.rowRenderer.firstRenderedRow}function Bwe(e){return e.rowRenderer.lastRenderedRow}function $we(e,t){return e.rowModel.getRow(t)}function Hwe(e){return e.rowModel.getRowCount()}var Gwe={moduleName:"RowApi",version:ut,apiFunctions:{redrawRows:kwe,setRowNodeExpanded:PB,getRowNode:Owe,addRenderedRowListener:Mwe,getRenderedNodes:Nwe,forEachNode:Lwe,getFirstDisplayedRowIndex:Vwe,getLastDisplayedRowIndex:Bwe,getDisplayedRowAtIndex:$we,getDisplayedRowCount:Hwe}},Uwe={moduleName:"ScrollApi",version:ut,apiFunctions:{getVerticalPixelRange:nve,getHorizontalPixelRange:sve,ensureColumnVisible:hB,ensureIndexVisible:fB,ensureNodeVisible:ove}};function Wwe(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 zwe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function jwe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function Kwe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function qwe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function Ywe(e){return{rowHeight:vu(e),headerHeight:op(e)}}function Zwe(e,t={}){var i;const n=[];for(const r of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=r.getCellRenderer();a!=null&&n.push(tp(a))}if((i=t.columns)!=null&&i.length)return n;const s=[],o=i_(t.rowNodes);for(const r of e.rowRenderer.getAllRowCtrls()){if(o&&!r_(r.rowNode,o)||!r.isFullWidth())continue;const a=r.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const u=a[l];u!=null&&s.push(tp(u))}}return[...s,...n]}var Xwe={moduleName:"RenderApi",version:ut,apiFunctions:{setGridAriaProperty:Wwe,refreshCells:zwe,refreshHeader:jwe,isAnimationFrameQueueEmpty:Kwe,flushAllAnimationFrames:qwe,getSizesForCurrentTheme:Ywe,getCellRendererInstances:Zwe}};function Jwe(e,t){var n,s;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(s=e.colAutosize)==null||s.sizeColumnsToFitGridBody(t)}function AB({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 Qwe(e,t){var n;t&&typeof t=="object"?AB(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var eCe=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 i=e.get("rowData");s=i!=null&&i.length>0&&os(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 u;const o=c=>pd(t,Array.from(c),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return o(s);const i=kB(this.beans),r=c=>n.leftCols.some(d=>Jf(d,c)),a=c=>n.rightCols.some(d=>Jf(d,c)),l=e.colKeys.filter(c=>!ua(c)&&!ca(c)&&!r(c)&&!a(c));this.sizeColumnsToFit(i,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(u=e.columnLimits)==null?void 0:u.map(c=>({...c,key:c.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:i,stopAtGroup:r,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:u=[],source:c="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(u.map(({colId:_,...R})=>[_,R])),b=o??this.gos.get("skipHeaderOnAutoSize"),w=i??b;for(;C!==0;){C=0;const _=[];for(const R of s){if(!R||Xoe(R))continue;const T=f.getCol(R);if(!T||v.has(T))continue;const I=p.getPreferredWidthForColumn(T,b);if(I>0){const x=S[T.colId]??{};x.minWidth??(x.minWidth=l),x.maxWidth??(x.maxWidth=a);const P=tCe(T,I,x);T.setActualWidth(P,c),v.add(T),C++}_.push(T)}_.length&&g.refresh(c)}w||this.autoSizeColumnGroupsByColumns(s,c,r),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,i=new Set,r=s.getColsForKeys(e);for(const l of r){let u=l.getParent();for(;u&&u!=n;)u.isPadding()||i.add(u),u=u.getParent()}let a;for(const l of i){for(const u of o.getHeaderRowContainerCtrls())if(a=u.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 Tu(e);return o.addEventListener("doubleTap",s),()=>{e.removeEventListener("dblclick",s),o.destroy()}}addColumnGroupResize(e,t,n){const s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{const i=[],r=t.getDisplayedLeafColumns();for(const a of r)a.getColDef().suppressAutoSize||i.push(a.getColId());i.length>0&&this.autoSizeCols({colKeys:i,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=kB(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):Xe(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 i=this.beans.visibleCols.allCols;if(e<=0||!i.length)return;const r=la(i);if(s!=null&&s.onlyScaleUp&&r>e||e===r&&i.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),_=C.getActualWidth();return(b==null||_>=b)&&(w==null||_<=w)}))return;const l=[],u=[];for(const v of i){const C=((p=s==null?void 0:s.colKeys)==null?void 0:p.some(S=>Jf(v,S)))??!0;v.getColDef().suppressSizeToFit||!C?u.push(v):l.push(v)}const c=l.slice(0);let d=!1;const h=v=>{Bi(l,v),u.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-la(u);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/la(l);let S=v;for(let b=l.length-1;b>=0;b--){const w=l[b],_=o==null?void 0:o[w.getId()],R=(_==null?void 0:_.minWidth)??(s==null?void 0:s.defaultMinWidth),T=(_==null?void 0:_.maxWidth)??(s==null?void 0:s.defaultMaxWidth),I=w.getMinWidth(),x=w.getMaxWidth(),P=typeof R=="number"&&R>I?R:I,D=typeof T=="number"&&T<x?T:x;let F=Math.round(w.getActualWidth()*C);F<P?(F=P,h(w),d=!1):F>D?(F=D,h(w),d=!1):b===0&&(F=S),w.setActualWidth(F,t,!0),S-=F}}}for(const v of c)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&pd(this.eventSvc,c,!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:i,defaultMaxWidth:r}=n,a=o==null?void 0:o.map(({colId:l,minWidth:u,maxWidth:c})=>({key:l,minWidth:u,maxWidth:c}));this.sizeColumnsToFitGridBody({defaultMinWidth:i,defaultMaxWidth:r,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 kB({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),o=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return $f(n.eGridBody)-o}var nCe={moduleName:"ColumnAutoSize",version:ut,beans:[eCe],apiFunctions:{sizeColumnsToFit:Jwe,autoSizeColumns:AB,autoSizeAllColumns:Qwe},dependsOn:[o2]},sCe=".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 oCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function iCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function rCe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function aCe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function lCe(e,t,n){var s;return(s=e.pinnedRowModel)==null?void 0:s.forEachPinnedRow(t,n)}var uCe={moduleName:"PinnedRow",version:ut,beans:[rue],css:[sCe],apiFunctions:{getPinnedTopRowCount:oCe,getPinnedBottomRowCount:iCe,getPinnedTopRow:rCe,getPinnedBottomRow:aCe,forEachPinnedRow:lCe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},cCe=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}},dCe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:s,rowModel:o,valueSvc:i,pagination:r}}=this,{colDef:a}=t,l=this.getNodeMap(e),u=new Map,c=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const C=(w,_)=>{p=w,g=null,v=_},S=w=>{const _=!w.isExpandable()&&!w.group&&!w.detail&&(c?!c({rowNode:w}):!0);if(w.rowIndex==null||!_){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,i.getValue(t,w));return}const R=i.getValue(t,w);if(f){const T=Ft(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 cCe(t,p),u.set(p,g)}g.addSpannedNode(w),u.set(w,g)};switch(e){case"center":(b=o.forEachDisplayedNode)==null||b.call(o,w=>{(!r||r.isRowInPage(w.rowIndex))&&S(w)}),this.centerValueNodeMap=u;break;case"top":s==null||s.forEachPinnedRow("top",S),this.topValueNodeMap=u;break;case"bottom":s==null||s.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=u;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}}},hCe=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 dCe(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,i=this.spanningColumns.get(s);if(!i)return;let r;switch(e.rowPinned){case"top":r=t==null?void 0:t.getPinnedTopRow(o);break;case"bottom":r=t==null?void 0:t.getPinnedBottomRow(o);break;default:r=n.getRow(o)}if(r)return i.getCellSpan(r)}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()}},fCe=class extends Dd{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,i,r){this.eWrapper=n,super.setComp(e,t,n,s,o,i,r),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||Rv(e,t.rowIndex)}setAriaRowSpan(){Use(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(dy(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}},pCe=class extends by{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 fCe(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(){}},gCe=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),i=new Map;let r=!1;for(const l of o)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(u,c)=>{if(i.has(c.firstNode))return;const d=n.get(c.firstNode);if(d){i.set(c.firstNode,d),n.delete(c.firstNode);return}r=!0;const h=new pCe(c.firstNode,this.beans,!1,!1,!1);i.set(c.firstNode,h)}));this.setCtrlsMap(e,i);const a=i.size===s;if(!(!r&&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")}},mCe={moduleName:"CellSpan",version:ut,beans:[hCe,gCe]},vCe=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);s_(this.beans.expressionSvc,s===this.cellClassRules?void 0:this.cellClassRules,s,o,i=>t.toggleCss(i,!0),i=>t.toggleCss(i,!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 i of this.staticClasses)t.toggleCss(i,!1);const o=this.beans.cellStyles.getStaticCellClasses(n,s);this.staticClasses=o;for(const i of o)t.toggleCss(i,!0)}getCellClassParams(e,t){const{value:n,rowNode:s}=this.cellCtrl;return Ft(this.beans.gos,{value:n,data:s.data,node:s,colDef:t,column:e,rowIndex:s.rowIndex})}},yCe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,s){s_(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 vCe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(o=>{n(o)})}},wCe={moduleName:"CellStyle",version:ut,beans:[yCe]},CCe={moduleName:"RowStyle",version:ut,beans:[rpe]};function bCe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var SCe=class extends We{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:s,gos:o,element:i,columns:r}=this,a=s.colHover;if(n??!!o.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(i,{mouseover:a.setMouseOver.bind(a,r),mouseout:a.clearMouseOver.bind(a)});else{for(const u of this.destroyManagedListeners)u();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},ECe="ag-column-hover",_Ce=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(ECe,n)}addHeaderFilterColumnHoverListener(e,t,n,s){this.createHoverFeature(e,[n],s);const o=()=>{const i=this.isHovered(n);t.toggleCss("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:o}),o()}createHoverFeature(e,t,n){e.createManagedBean(new SCe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},RCe={moduleName:"ColumnHover",version:ut,beans:[_Ce],apiFunctions:{isColumnHovered:bCe}},DCe=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 i;const n=((i=this.wrapSvc)==null?void 0:i.wrap(e,t))??t,s=!yy.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 i,r;const n=((i=this.wrapSvc)==null?void 0:i.unwrap(e,t))??t,s=this.asyncListeners.get(e),o=!!(s!=null&&s.delete(n));o||(r=this.syncListeners.get(e))==null||r.delete(n),this.eventSvc.removeListener(e,n,o)}addGlobalListener(e){var i;const t=((i=this.wrapSvc)==null?void 0:i.wrapGlobal(e))??e,n=(r,a)=>{yy.has(r)&&t(r,a)},s=(r,a)=>{yy.has(r)||t(r,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:r,asyncListener:a}=s.get(o);t.removeGlobalListener(r,!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 TCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.addListener(t,n)}function ICe(e,t,n){var s;(s=e.apiEventSvc)==null||s.removeListener(t,n)}function xCe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function FCe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var PCe={moduleName:"EventApi",version:ut,apiFunctions:{addEventListener:TCe,addGlobalListener:xCe,removeEventListener:ICe,removeGlobalListener:FCe},beans:[DCe]},ACe={moduleName:"Locale",version:ut,beans:[age]},kCe=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,u,c;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:s}=this.beans,o=e.autoHeightCols;let i=!1;const r=d=>{var p;const h=d.__autoHeights;let f=nl(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),i=!0)};(a=s==null?void 0:s.forEachPinnedRow)==null||a.call(s,"top",r),(l=s==null?void 0:s.forEachPinnedRow)==null||l.call(s,"bottom",r),(u=t.forEachDisplayedNode)==null||u.call(t,r),i&&((c=t.onRowHeightChanged)==null||c.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 i=[];switch(e.getPinned()){case"left":i=o.getLeftColsForRow(t);break;case"right":i=o.getRightColsForRow(t);break;case null:i=s.getColsWithinViewport(t);break}return!i.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const s=t.parentElement,{rowNode:o,column:i}=e,r=this.beans,a=c=>{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}=gu(s),g=d+h+f+p,C=t.offsetHeight+g;if(c<5){const b=Ds(r),w=!(b!=null&&b.contains(t)),_=C==0;if(w||_){window.setTimeout(()=>a(c+1),0);return}}this.setRowAutoHeight(o,C,i)},l=()=>a(0);l();const u=Qa(r,t,l);return n.addDestroyFunc(()=>{u(),this.setRowAutoHeight(o,void 0,i)}),!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}},OCe={moduleName:"RowAutoHeight",version:ut,beans:[kCe]},MCe={moduleName:"AllCommunity",version:ut,dependsOn:[IB,Hye,Xye,Rge,Mve,Nve,Lve,Vve,Bve,$ve,Hve,Ove,Tme,Ime,xme,Dme,Pme,Ame,fwe,hye,Awe,l2,Gwe,Uwe,Xwe,nCe,Cce,uCe,nye,Gpe,wCe,RCe,CCe,PCe,zpe,awe,uB,ACe,OCe,wce,Oye,mCe]};let OB=!1;OB||(Toe.registerModules([MCe,IB]),OB=!0);class NCe{constructor(t,n){es(this,"gridApi",null);es(this,"container");es(this,"config");es(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,...i}=this.config,r={...i,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=sge(this.container,r),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 LCe=p2.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"),VCe=rt({__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,i=V(null);sS(i,()=>{var v;const g=(v=r.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const r=V(null),a=Y(()=>({width:"100%",height:s.height||"500px"})),l=Y(()=>({...s,theme:LCe}));function u(){if(!i.value){console.warn("Grid container element not found");return}const g={...l.value,height:s.height};r.value=new NCe(i.value,g),r.value.init(),c()}function c(){var v;const g=((v=r.value)==null?void 0:v.getApi())??null;o("onGridReady",g)}function d(g){var C,S;if(!g)return;(C=r.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=r.value)==null||S.setColumnWidth(v)}function h(){var g;(g=r.value)==null||g.destroy(),r.value=null}function f(){var g;return((g=r.value)==null?void 0:g.getApi())||void 0}function p(){return r.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}),vs(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),nn(()=>{u()}),vs(()=>{h()}),(g,v)=>(j(),ue("div",{ref_key:"gridContainerRef",ref:i,style:dn(a.value),class:Q(["ag-theme-quartz",["ag-table-container",s.isSorting?"is-sorting":""]])},null,6))}});function Pd(e){return fN(e)}const BCe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:Pd(au),suppressMovable:!0},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:Pd(au)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:Pd(au)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:Pd(au)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:Pd(au),cellRendererParams:n=>{var s,o,i;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated.value,tooltip:((i=(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated)==null?void 0:i.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:Pd(au),cellRendererParams:n=>{var s,o,i;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.completedOn.value,tooltip:((i=(o=n==null?void 0:n.data)==null?void 0:o.completedOn)==null?void 0:i.tooltip)||void 0,readOnly:!0}}}].map(n=>Of.fromType(n))],xy={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},$Ce={field:"blank",headerName:"",flex:1,editable:!1,sortable:!1,filter:!1,cellClass:"ag-cell-optimized",suppressMovable:!0,suppressNavigable:!0,suppressAutoSize:!1,suppressSizeToFit:!1},HCe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:xy.WIDTH,minWidth:xy.WIDTH,maxWidth:xy.WIDTH,cellClass:"ag-checkbox-cell",headerClass:xy.HEADER_CLASS,headerComponent:_v(dJ),suppressMovable:!0}),GCe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},UCe=(e,t,n)=>{const{getCachedValue:s,setCachedValue:o}=Dh({dbName:"item_table_column_configs",storeName:"column_configs"}),i=async()=>{const c=await s(t);if(c&&typeof c=="string")try{return JSON.parse(c)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},r=V([]),a=HCe(),l=async c=>{const d=await i(),h=new Map;d==null||d.forEach(F=>{F.width&&h.set(F.field,F.width)});const f=BCe(),p=Of.fromType(GCe),v=((c==null?void 0:c.map(F=>{var k;return{headerName:F.name,field:`metric_${F.id}`,editable:((k=F==null?void 0:F.auth_permission)==null?void 0:k.permission)==2,sortable:!0,filter:!1,flex:1,context:{...F},hide:!(F.is_primary||F.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:_v(au),headerComponentParams:O=>({headerType:F.metric_type.code=="number"||F.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${F.id}`)}}))||[]).map(F=>Of.fromType(F)),C=[a,...f,...v,$Ce,p],S=C.filter(F=>F.pinned==="left"),b=C.filter(F=>F.pinned==="right"||F.field==="blank"),w=C.filter(F=>!F.pinned&&F.field!=="blank");if(!d||d.length===0){r.value=C;return}const _=new Map(d.map(F=>[F.field,F])),R=new Map(w.map(F=>[F.field,F])),T=[];for(const F of d)if(F.field&&R.has(F.field)){const k=R.get(F.field);T.push({...k,hide:F.hide,width:F.width}),R.delete(F.field)}const I=Array.from(R.values()),x=[...T,...I],P=S.map(F=>{const k=_.get(F.field);return k!=null&&k.width?{...F,width:k.width}:F}),D=b.map(F=>{const k=_.get(F.field);return k!=null&&k.width?{...F,width:k.width}:F});r.value=[...P,...x,...D]};et(e,c=>l(c),{immediate:!0});const u=Di((c,d)=>{var C,S;if(c.source!==void 0)if(["uiColumnResized","uiColumnMoved","api"].indexOf(c.source)===-1){console.warn("Skipping saveColumnConfig for source:",c.source);return}else console.warn("Executing saveColumnConfig for source:",c.source);else console.warn("Executing saveColumnConfig for source:",c);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)}),r.value=h||r.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))},rr);return{columnDefs:r,checkboxColumn:a,saveColumnConfig:u}},WCe=()=>{const e=En.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},zCe=e=>{var F,k,O;const{showMessage:t,showErrorNetMessage:n}=mf(),s=Yn(),o={domainApi:WCe(),wsCode:En.getInstance().getItem("ws.code"),entityId:e.value.entityId},i=(O=(k=(F=s==null?void 0:s.appContext)==null?void 0:F.config)==null?void 0:k.globalProperties)==null?void 0:O.apiConfig;if(!i||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const r=new Lk(i,o);r.on("call-api",B=>{B.success?t(B.apiCode,"success"):n(B)});const a=ao({}),l=V([]),u=V(!1),c=V(null),d=V(null),h=V(1),f=V(20);let p=Promise.resolve();const{setCachedUsers:g}=L7(),v=B=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:B}),C=50,S=async(B,Z,J)=>{if(!B.length)return[];const ee=Z4(B,Z);return(await Promise.all(ee.map(J))).flat()},b=async B=>{try{return(await r.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:B})).data.map(J=>[J==null?void 0:J.id,J.permission])}catch(Z){return console.error("Failed to fetch item permissions chunk:",Z),[]}},w=async(B,Z)=>{try{const J=await r.getMetricValues({workspaceId:e.value.workspaceId,item_ids:B,per_page:B.length*Z.length,metric_ids:Z}),ee=J.data.map(ve=>{const ne=new Map(ve.item_metrics.map(H=>[H.metric_id,{value:H.value,auth_permission:H==null?void 0:H.auth_permission}])),L=Object.fromEntries(Z.map(H=>[H,ne.get(H)??null]));return[ve==null?void 0:ve.id,L]}),X=new Set(J.data.map(ve=>ve==null?void 0:ve.id));for(const ve of B)if(!X.has(ve)){const ne=Object.fromEntries(Z.map(L=>[L,{value:null,auth_permission:void 0}]));ee.push([ve,ne])}return ee}catch(J){return console.error("Failed to fetch a chunk of metric values:",J),B.map(X=>[X,Object.fromEntries(Z.map(ve=>[ve,void 0]))])}},_=async B=>{try{const Z=await r.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:B,per_page:B.length}),J=Z.data.flatMap(ee=>ee.assignees);return g(J),Z.data.map(ee=>[ee==null?void 0:ee.id,ee==null?void 0:ee.assignees])}catch(Z){return console.error("Failed to fetch a chunk of assigned users:",Z),[]}},R=async B=>{if(!B.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const Z=await S(B,C,b);return Object.fromEntries(Z)}catch(Z){return console.error("Failed to fetch item permissions:",Z),{}}},T=async(B,Z)=>!B.length||!Z.length?{}:(p=p.then(async()=>{try{const X=[];let ve=0;for(let L=0;L<Z.length;L+=5){ve++;const H=Z.slice(L,L+5),te=[];for(let me=0;me<H.length;me++){const re=H[me],oe=await S(B,C,z=>w(z,[re]));te.push(oe),await new Promise(z=>setTimeout(z,500))}X.push(...te);const he=L+5>=Z.length}const ne={};for(const L of X.flat()){const[H,te]=L;ne[H]||(ne[H]={}),Object.assign(ne[H],te)}return ne}catch(J){return console.error("Failed to fetch metric values:",J),{}}}),p),I=async B=>{if(!B.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const Z=await S(B,C,_);return Object.fromEntries(Z)}catch(Z){return console.error("Failed to fetch assigned users:",Z),{}}};return{items:l,loading:u,error:c,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async B=>{const{cursor:Z,offset:J,size:ee,searchQuery:X}=B;let ve=[];u.value=!0,c.value=null;try{const ne=await r.getAllItem_cursor({...B,cursor:Z||void 0,offset:J||void 0,pageSize:ee||f.value,...v(X),sortBy:B.sort_by});return l.value=ne.data,d.value=ne.meta,h.value=ne.meta.current_page||0,ve=ne.data.map(L=>L==null?void 0:L.id),ne}catch(ne){throw c.value=ne,console.error("Failed to fetch items (cursor):",ne),ne}finally{const ne=async()=>{try{const[L,H]=await Promise.all([I(ve),R(ve)]);e.value.updateItemData({assignees:L,permission:H},ve);const te=await T(ve,e.value.metricIds);e.value.setMetricValues(te,new Set(ve),e.value.metricIds)}catch(L){console.error("Post-fetch processing failed:",L)}};u.value=!1,setTimeout(ne)}},getAssignableStatus:async B=>{try{return await r.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:B})}catch(Z){throw console.error("Failed to fetch assignable status:",Z),Z}},getMetricList:async B=>{try{return await r.getMetricList({workspaceId:e.value.workspaceId,entityId:B})}catch(Z){throw console.error("Failed to fetch metric list:",Z),Z}},getMetricValues:T,getAssignedUsers:I}};function jCe(e){return{updateRowData:(s,o)=>{if(!e.value)return;const i=[],r=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(u=>{if(u.field&&u.field.startsWith("metric_")&&(u.hide===!1||u.hide===void 0))return u.field}).filter(Boolean);o.forEach(u=>{var d;const c=(d=e.value)==null?void 0:d.getRowNode(u);if(c){if(i.push(c),s.assignees){const h=E7((s.assignees[u]||[]).map(xF));c.data.assignees=h,r.add("assignees")}s.permission&&(c.data.permissions=s.permission[u]),l.forEach(h=>{c.data[h]=c.data[h]??null})}}),r.add("assignees"),r.add("status"),r.add("dateRange"),r.add("moreActions"),r.add("name"),e.value.refreshCells({rowNodes:i,columns:Array.from(r),force:!0})},setMetricValues:(s,o,i)=>{const r=e.value;if(!r)return;const a=new Map(Array.from(o).map(u=>[u,new Map(i.map(c=>[c,{value:null,auth_permission:void 0}]))]));Object.entries(s).forEach(([u,c])=>{Object.entries(c).forEach(([d,h])=>{var f;(f=a.get(u))==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(([u,c])=>{const d=r.getRowNode(u);return d!=null&&d.data?(c.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&&r.refreshCells({rowNodes:l,columns:Array.from(i).map(u=>`metric_${u}`),force:!0})}}}function KCe(e,t,n,s,o){let i=!0;return{async getRows(r){try{s(!0),i&&(o(!0),i=!1);const a=Math.floor(r.startRow/t)+1,{rows:l,total:u}=await e({page:a,pageSize:t,filterText:n(),sort_by:r.sortModel});let c=-1;Number.isFinite(u)?c=u:l.length<t&&(c=r.startRow+l.length),r.context={pageSize:t,text:n()},r.successCallback(l,c),s(!1),o(!1)}catch(a){console.error("Datasource fetch error:",a),r.failCallback(),s(!1),o(!1)}}}}function qCe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:s,gridApi:o,fetcher:i}=e,r=V(!0),a=V(!0),l=V(!1),u=()=>{n.value=!n.value},c=v=>{if(r.value=!1,o.value=v,!v)return null;const{addEventListener:C,setGridOption:S}=v;if(!i)return console.error("Fetcher function is undefined"),null;const b=KCe(i,e.perPage,()=>s.value,w=>{r.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=[],r.value=!0,!o.value||!i){console.error("Grid API or fetcher is not available"),r.value=!1;return}l.value=!0,a.value=!0,o.value.purgeInfiniteCache(),o.value.ensureIndexVisible(0,"top"),setTimeout(()=>{r.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=o.value)==null||v.deselectAll(),t.value=[]},f=Di(v=>{d(v)},rr),p=()=>{o.value},g=V(!1);return{isLoading:r,toggleSidebar:u,onGridReady:c,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const YCe={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."]}}},ZCe=e=>{var t;return(t=Object.entries(YCe.changelog).find(([n,s])=>n===e))==null?void 0:t[1].changes},XCe={key:1},JCe=_t(rt({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=V(null),o=e,i=()=>{s.value&&s.value.show()},r=V(""),a=V("idle"),l=V({file:null,format:null}),{apiServices:u}=ts(!1,{}),c=V(!1),d=async()=>{c.value=!0;const T=o.workspaceId,I=o.entityId;if(!T||!I||!u.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await u.value.downloadExportedItemsFile(T,I))throw new Error("No response from downloadTemplate API")}catch(x){console.error("Error downloading template:",x)}c.value=!1},h=n,f=()=>{h("import-success"),S()},p=async T=>{var P,D,F;const I=new FormData,x=((P=T.name.split(".").pop())==null?void 0:P.toString())||"";if(I.append("file",T),I.append("format",x),I.append("entity_id",o.entityId||""),!u.value){console.error("API services not available");return}try{await u.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,I),g()}catch(k){throw console.error("Error uploading file:",k),v(((F=(D=k.response)==null?void 0:D.data)==null?void 0:F.message)||"An unknown error occurred during file upload."),k}},g=()=>{a.value="success"},v=T=>{r.value=T,a.value="error"},C=async()=>{!l.value||!l.value.file||await p(l.value.file)},S=()=>{var T;R(),(T=s.value)==null||T.hide()};t({close:S,open:i});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)),_=V(null),R=()=>{var T;(T=_.value)==null||T.clear(),r.value="",l.value={file:null,format:null},a.value="idle"};return(T,I)=>(j(),qe(U(zk),{"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"?(j(),qe(aN,{key:0,state:a.value,"error-message":r.value,overwrite:!0},null,8,["state","error-message"])):(j(),ue("div",XCe,[Re("div",{class:Q(T.$style["step-section"])},[Re("span",{class:Q(T.$style["step-title"])},"Step 1: Download current data",2),Re("span",{class:Q(T.$style["step-description"])},[...I[1]||(I[1]=[nt(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),Re("br",null,null,-1),Re("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),fe(U(vt),{class:Q(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:c.value,onHandleClick:d},{prefix:ge(()=>[fe(U(lt),{src:"Download"})]),default:ge(()=>[I[2]||(I[2]=nt(" Download file ",-1))]),_:1},8,["class","disabled"])],2),Re("div",{class:Q(T.$style["step-section"])},[Re("span",{class:Q(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),fe(U(FO),{modelValue:l.value,"onUpdate:modelValue":I[0]||(I[0]=x=>l.value=x),ref_key:"filUploaderRef",ref:_},null,8,["modelValue"])],2),Re("div",{class:Q(T.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[fe(lN)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:ge(()=>[fe(U(vt),{style:{flex:"1"},variant:"secondary",onClick:S},{default:ge(()=>[...I[3]||(I[3]=[nt(" Cancel ",-1)])]),_:1}),fe(U(vt),{disabled:w.value,style:{flex:"1"},variant:"primary",onClick:C},{default:ge(()=>[...I[4]||(I[4]=[nt(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ge(()=>[fe(U(vt),{style:{flex:"1"},variant:"primary",onClick:f},{default:ge(()=>[...I[5]||(I[5]=[nt(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:ge(()=>[fe(U(vt),{style:{flex:"1"},variant:"primary",onClick:R},{default:ge(()=>[...I[6]||(I[6]=[nt(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_lw86z_1","step-title":"_step-title_lw86z_11","step-title-2":"_step-title-2_lw86z_17","step-description":"_step-description_lw86z_23","date-format-guide":"_date-format-guide_lw86z_28","import-error":"_import-error_lw86z_39","drop-area":"_drop-area_lw86z_49","is-dragging":"_is-dragging_lw86z_49","drop-area-content":"_drop-area-content_lw86z_52",browse:"_browse_lw86z_61","download-sample-btn":"_download-sample-btn_lw86z_65"}}]]),QCe={style:{cursor:"help"}},ebe=_t(rt({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=To,s=Qb(),{setUserPermissions:o,setEntityPermissions:i}=s,{entityPermissions:r}=Qs(s),a=Jt,l=V(null),u={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},c=V(""),d=Y(()=>{var Ye;const Ae=((Ye=r.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:!Ae},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!Ae,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!Ae,id:"overwrite_scenes_option"}]}),h=e;Of.initialize({wrapVueCellRenderer:_v,wrapVueCellEditor:fN});const f=tf(),{switchInstanceFunc:p}=Qs(f);nn(()=>{const Ae=Yn();p.value=Ae==null?void 0:Ae.appContext.config.globalProperties.switchInstance;const Ye=new BroadcastChannel("focusable_channel");mt(()=>{setTimeout(()=>{Ye.postMessage("Focusable elements updated")},7e3)})});const g=V(null),v=V([]),C=Wm(),{rowCount:S}=Qs(C),b=V(!1),w=V(""),_=V(),R=zA(),{metricList:T}=Qs(R),I=V(""),x=V(!1),P=V(new Set),D=V(new Map),{apiServices:F}=ts(!1,h),{columnDefs:k,checkboxColumn:O,saveColumnConfig:B}=UCe(T,h.entityId,g),Z=V();et(()=>k,()=>{var Ae;(Ae=Z.value)==null||Ae.updateColumnDefs(k.value)},{deep:!0});const J=(Ae,Ye)=>{B(Ae,Ye)},{updateRowData:ee,setMetricValues:X}=jCe(g),ve=Y(()=>({isSearching:w.value.length>0,isFiltering:!(Object.keys(ke.value||{}).length==1&&Object.keys(ke.value)[0]=="preflight_status")&&Object.keys(ke.value||{}).length>0})),ne=Y(cm),L=Y(()=>k.value.filter(Ae=>{var Ye;return((Ye=Ae.field)==null?void 0:Ye.startsWith("metric_"))&&!Ae.hide}).map(Ae=>{var Ye;return((Ye=Ae.field)==null?void 0:Ye.replace("metric_",""))||""}));Zi("timezone",ne);const H=Y(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:L.value,updateItemData:ee,setMetricValues:X})),{fetchItems:te,getMetricList:he,cusorMap:me,getMetricValues:re}=zCe(H),oe=Y(()=>{if(!g.value)return!1;const Ae=g.value.getSelectedRows().length;return Ae>0&&Ae>=S.value.total}),z=Y(()=>{var Ae;return((Ae=l.value)==null?void 0:Ae.name)||"Items"}),pe=Ae=>{setTimeout(()=>{mt(()=>{var Ye,jt;g.value&&(Ae?(Ye=g.value)==null||Ye.showNoRowsOverlay():(jt=g.value)==null||jt.hideOverlay())})},500)},ie=(Ae,Ye)=>{var jt;S.value.total=Ae.meta.total??0,(jt=Ae.meta.next)!=null&&jt.cursor&&(me[Ye+1]=Ae.meta.next.cursor),I.value=Ae.meta["X-Tsr-signature"]||"",Ae.meta.total===0?pe(!0):pe(!1)},be=xO(),G=V(null),{sortingAPIConfiguration:q,isSortingRunning:ce}=Qs(be),ke=V({preflight_status:"1"}),Fe=Y(()=>({...ke.value,search:w.value}));Zi("filterParams",Fe);const Le=V([]),ye=async({page:Ae,pageSize:Ye,filterText:jt})=>{var ku;(ku=g.value)==null||ku.hideOverlay();const sn=me[Ae],Ui=!sn&&Ae>1?(Ae-1)*Ye:void 0,js=q.value;js.length>0&&(ce.value=!0);try{const So={cursor:sn,size:Ye,searchQuery:jt,offset:Ui,sort_by:js,...ke.value},Pr=await te(So);if(!Pr)return{rows:[],total:0};const Kn=(ya=>{const gi=ya.data.map(Ou=>PF(Ou,ne.value));return gi.forEach(Ou=>{P.value.add(String(Ou.id)),D.value.set(String(Ou.id),{})}),gi})(Pr);return ie(Pr,Ae),{rows:Kn,total:S.value.total}}catch(So){return console.error("Failed to fetch items:",So),{rows:[],total:0}}finally{ce.value=!1}},{isLoading:M,toggleSidebar:$,onGridReady:ae,handleUnSelect:Ge,handleSelectAll:we,onSearch:ze,firstLoad:Ue}=qCe({selectRowData:V([]),isSidebarOpen:b,quickFilterText:w,gridApi:g,perPage:u.ROWS_PER_PAGE,fetcher:ye}),Ee=V([]),Ve=()=>{var Ae;Ee.value=((Ae=g.value)==null?void 0:Ae.getSelectedRows())||[]},pt=ao({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),At=Y(()=>({blockLoadDebounceMillis:1e3,columnDefs:k.value,rowModelType:"infinite",cacheBlockSize:u.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:u.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:u.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:Ut,noRowsOverlayComponent:_v(XQ),noRowsOverlayComponentParams:()=>ve.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Ae=>Ae.data.id,getRowClass:Ae=>{if(!Ae.data)return["row-empty"];const Ye=["row-highlight"];return Ae.data.id||Ye.push("row-inactive"),Ae.data.isDeleted&&Ye.push("row-deleted"),Ae.data.disabled&&Ye.push("row-deleted"),Ae.data.isArchived&&Ye.push("row-archived"),Ae.data.isLocked&&Ye.push("row-locked"),Ye},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:F.value,sorting:ce.value},onCellKeyDown:Ae=>{var Ye,jt,sn;if(Ae.data.isDeleted)return!1;if(((Ye=Ae==null?void 0:Ae.event)==null?void 0:Ye.key)==="Enter"){const{api:Ui,node:js,column:ku}=Ae,So=Ui.getCellRendererInstances({rowNodes:[js],columns:[ku]});if(So.length>0){const Pr=So[0];Pr&&typeof((jt=Pr.componsenExposed)==null?void 0:jt.focus)=="function"&&((sn=Pr.componsenExposed)==null||sn.focus())}}},isRowSelectable:Ae=>!Ae.group,suppressKeyboardEvent:Ae=>{var sn;if((sn=Ae.data)!=null&&sn.isDeleted)return!0;const Ye=Ae.event.key,jt=Ae.editing;return jt&&Ye==="Tab"?!0:jt&&Ye==="Enter"?!1:Ye==="Enter"?(Ae.event.preventDefault(),Ae.event.stopPropagation(),!0):Ye==="ArrowUp"||Ye==="ArrowDown"||Ye==="ArrowLeft"||Ye==="ArrowRight"||Ye==="Tab"||Ye==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Ae=>{const Ye=Ae.api.getFirstDisplayedRowIndex(),jt=Ae.api.getLastDisplayedRowIndex();pt.rowsDisplay.fromIndex=Ye,pt.rowsDisplay.toIndex=jt,pt.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(sn=>sn.getColId())},onViewportChanged:Ae=>{pt.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(Ye=>Ye.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Ae){if(Ae.data.isDeleted&&Ae.api.stopEditing(),Ae.colDef.field=="options"){const Ye=Ae.api.getCellRendererInstances({rowNodes:[Ae.node],columns:[Ae.column]});Ye.length>0&&Ye[0].focusUi()}},tabToNextCell:Ae=>{let Ye=Ae.nextCellPosition;if(Ye&&Ye.column.getColId()==="ag-Grid-SelectionColumn"){const jt=Ae.api.getAllDisplayedColumns(),sn=jt.indexOf(Ye.column),Ui=Ae.backwards?-1:1,js=jt[sn+Ui];if(js)return{rowIndex:Ye.rowIndex,column:js,rowPinned:Ye.rowPinned}}return Ye}}));function Ut(){if(!g.value)return;let Ae=0;g.value.forEachNode(Ye=>{Ye.data&&Ae++}),S.value.loaded=Math.min(Ae,S.value.total)}et(()=>q,()=>{g.value&&(I.value="",P.value.clear(),g.value.deselectAll(),Object.keys(me).forEach(Ae=>delete me[Number(Ae)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const Qt=V(),zt=V(),Ne=()=>{var Ae;(Ae=zt.value)==null||Ae.open()},je=()=>{var Ae;(Ae=Qt.value)==null||Ae.open()},wt=async()=>{Ue.value=!0,g.value&&(I.value="",P.value.clear(),Object.keys(me).forEach(Ae=>delete me[Number(Ae)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},Ot=Y(()=>En.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Wt=V(),st=Y(()=>{var Ae;return(Ae=ZCe(Ot.value))==null?void 0:Ae.map(Ye=>`<div>• ${Ye}</div>`).join(`
|
|
253
|
-
`)});function ps(Ae){var Ye;Ae==="new_scene"?(Ye=Wt.value)==null||Ye.show():Ae==="import_scenes"?je():Ae==="overwrite_scenes"&&Ne()}const Gi=Ae=>{v.value=Ae.api.getSelectedRows().map(Ye=>Ye.id)},pl=Ae=>{const Ye=ae(Ae);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",sn=>J(sn,!0)),Ye.addEventListener("columnResized",sn=>J(sn,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport")),Ye},bo=()=>{var Ae;c.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};nn(()=>{mt(()=>{bo()}),window.addEventListener("resize",bo);function Ae(){requestAnimationFrame(Ae)}Ae()}),vs(()=>{window.removeEventListener("resize",bo)});const va=async({code:Ae,name:Ye})=>{await ze(Ae),setTimeout(()=>{var jt;(jt=_.value)==null||jt.setValue(Ye)},300)},gl=Ae=>{if(!g.value)return;const Ye=g.value.getRowNode(Ae);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")},Ir=Ae=>Ae.metric_type.code==="number"?"number":"default",xr=async()=>{if(h.entityId)try{const Ae=await he(h.entityId);T.value=Ae.data.map(Ye=>({...Ye,sortType:Ir(Ye)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),T.value=[]}},pi=async()=>{if(F.value)try{const Ae=await F.value.getUserPermission(h.workspaceId);o(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},Fr=async()=>{if(F.value)try{const Ae=await F.value.getEntityDetail(h.workspaceId,h.entityId);i(Ae.permission),l.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},Au=hv(),{setUser:kn}=Au,gs=async()=>{if(F.value)try{const Ae=await F.value.getMe();return kn(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},__=async()=>{var Ae;if(F.value)try{const Ye=await F.value.getWorkspaces(h.workspaceId),jt=(Ae=Ye.data[0])==null?void 0:Ae.ws_user_role_id;return jt&&Au.setUserRoleId(jt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};et(()=>[h.entityId,h.workspaceId],async([Ae,Ye])=>{!Ae||!Ye||(gs(),__(),xr(),pi(),Fr())},{immediate:!0,deep:!0}),et(L,(Ae,Ye)=>{const jt=Ae.filter(sn=>!(Ye!=null&&Ye.includes(sn)));jt.length>0&&re(Array.from(P.value),jt).then(sn=>{X(sn,P.value,jt)})},{immediate:!0,deep:!0}),et(I,(Ae,Ye)=>{x.value=!!(Ye&&Ae&&Ye!==Ae)}),t({refreshTable:wt});const Ad=Ae=>{ke.value=Ae,wt()},kd=Ae=>{Le.value=Ae,wt()},Od=Ae=>{k.value=Ae||[],J({},!0)},R_=Y(()=>{var sn;const Ae=En.getInstance().getItem("ws.terminology"),Ye=Ae?JSON.parse(Ae):null;return`New ${((sn=Ye==null?void 0:Ye.find(Ui=>Ui.code==="scene"))==null?void 0:sn.name)||"Scene"}`});return(Ae,Ye)=>{const jt=_o("focusable");return j(),qe(U(rJ),{"is-sidebar-open":b.value,onCloseSidebar:U($),onSidebarClear:U($),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U($)},{"header-left":ge(()=>{var sn;return[((sn=U(r))==null?void 0:sn.has_create_item_permission)==1?(j(),qe(U(yS),{key:0,variant:["primary"],options:d.value,onSelect:ps,onHandleClick:Ye[1]||(Ye[1]=Ui=>ps("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ge(()=>[Ke(fe(U(vt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Ui=>ps("new_scene")),label:R_.value},null,8,["label"]),[[jt,1]])]),_:1},8,["options"])):Je("",!0),Re("div",{class:Q(Ae.$style["beta-tag"])},"Beta",2),Ke((j(),ue("span",QCe,[nt(Ct(Ot.value),1)])),[[U(a),st.value||""]])]}),"header-actions":ge(()=>[fe(U(Oee),{"onUpdate:assignees":kd,onApplyFilter:Ad,loading:U(Ue),entityId:h.entityId},null,8,["loading","entityId"]),Ke(fe(U(iS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=sn=>w.value=sn),onSearch:U(ze),class:Q(Ae.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=sn=>U(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:_},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke((j(),qe(U($A),{status:U(M)?"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((j(),qe(U(vt),{variant:["secondary","icon"],disabled:U(M),onClick:wt},{default:ge(()=>[fe(U(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[jt,5],[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke(fe(U(kQ),{"model-value":U(k),onChange:Ye[4]||(Ye[4]=sn=>Od(sn)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:Z,"checkbox-column":U(O),tableHeight:c.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]])]),grid:ge(({availableHeight:sn})=>[fe(U(VCe),Xt({id:"item_table_main",ref_key:"agGrid",ref:G},At.value,{height:sn+"px",isSorting:U(ce),onOnGridReady:pl,onSelectionChanged:Gi}),null,16,["height","isSorting"])]),footer:ge(()=>[Re("div",{class:Q(Ae.$style.tableFooter),id:"table_footer"},[Re("span",null,[Ye[5]||(Ye[5]=nt(" Showing ",-1)),Re("b",null,Ct(U(S).loaded)+" of "+Ct(U(S).total),1)])],2)]),"new-row":ge(()=>[fe(U(cee),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:va,onFocusOnId:gl},null,512)]),"bulk-update-actions":ge(()=>[!b.value&&v.value.length>0?Ke((j(),qe(U(JX),{key:0,selectRowData:Ee.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(Ge),onSelectAll:U(we),"take-name":z.value,"selected-all":oe.value,"total-rows":U(S).total,"visible-rows":U(S).loaded,onUpdated:Ve,loading:U(M)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[jo,!b.value&&v.value.length>0]]):Je("",!0)]),snackbar:ge(()=>[fe(U(GJ))]),popup:ge(()=>[fe(vse,{ref_key:"popupCreateSceneRef",ref:Qt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"]),fe(JCe,{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"}}]]),MB="0.1.
|
|
253
|
+
`)});function ps(Ae){var Ye;Ae==="new_scene"?(Ye=Wt.value)==null||Ye.show():Ae==="import_scenes"?je():Ae==="overwrite_scenes"&&Ne()}const Gi=Ae=>{v.value=Ae.api.getSelectedRows().map(Ye=>Ye.id)},pl=Ae=>{const Ye=ae(Ae);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",sn=>J(sn,!0)),Ye.addEventListener("columnResized",sn=>J(sn,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport")),Ye},bo=()=>{var Ae;c.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};nn(()=>{mt(()=>{bo()}),window.addEventListener("resize",bo);function Ae(){requestAnimationFrame(Ae)}Ae()}),vs(()=>{window.removeEventListener("resize",bo)});const va=async({code:Ae,name:Ye})=>{await ze(Ae),setTimeout(()=>{var jt;(jt=_.value)==null||jt.setValue(Ye)},300)},gl=Ae=>{if(!g.value)return;const Ye=g.value.getRowNode(Ae);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")},Ir=Ae=>Ae.metric_type.code==="number"?"number":"default",xr=async()=>{if(h.entityId)try{const Ae=await he(h.entityId);T.value=Ae.data.map(Ye=>({...Ye,sortType:Ir(Ye)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),T.value=[]}},pi=async()=>{if(F.value)try{const Ae=await F.value.getUserPermission(h.workspaceId);o(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},Fr=async()=>{if(F.value)try{const Ae=await F.value.getEntityDetail(h.workspaceId,h.entityId);i(Ae.permission),l.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},Au=hv(),{setUser:kn}=Au,gs=async()=>{if(F.value)try{const Ae=await F.value.getMe();return kn(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},__=async()=>{var Ae;if(F.value)try{const Ye=await F.value.getWorkspaces(h.workspaceId),jt=(Ae=Ye.data[0])==null?void 0:Ae.ws_user_role_id;return jt&&Au.setUserRoleId(jt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};et(()=>[h.entityId,h.workspaceId],async([Ae,Ye])=>{!Ae||!Ye||(gs(),__(),xr(),pi(),Fr())},{immediate:!0,deep:!0}),et(L,(Ae,Ye)=>{const jt=Ae.filter(sn=>!(Ye!=null&&Ye.includes(sn)));jt.length>0&&re(Array.from(P.value),jt).then(sn=>{X(sn,P.value,jt)})},{immediate:!0,deep:!0}),et(I,(Ae,Ye)=>{x.value=!!(Ye&&Ae&&Ye!==Ae)}),t({refreshTable:wt});const Ad=Ae=>{ke.value=Ae,wt()},kd=Ae=>{Le.value=Ae,wt()},Od=Ae=>{k.value=Ae||[],J({},!0)},R_=Y(()=>{var sn;const Ae=En.getInstance().getItem("ws.terminology"),Ye=Ae?JSON.parse(Ae):null;return`New ${((sn=Ye==null?void 0:Ye.find(Ui=>Ui.code==="scene"))==null?void 0:sn.name)||"Scene"}`});return(Ae,Ye)=>{const jt=_o("focusable");return j(),qe(U(rJ),{"is-sidebar-open":b.value,onCloseSidebar:U($),onSidebarClear:U($),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U($)},{"header-left":ge(()=>{var sn;return[((sn=U(r))==null?void 0:sn.has_create_item_permission)==1?(j(),qe(U(yS),{key:0,variant:["primary"],options:d.value,onSelect:ps,onHandleClick:Ye[1]||(Ye[1]=Ui=>ps("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ge(()=>[Ke(fe(U(vt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Ui=>ps("new_scene")),label:R_.value},null,8,["label"]),[[jt,1]])]),_:1},8,["options"])):Je("",!0),Re("div",{class:Q(Ae.$style["beta-tag"])},"Beta",2),Ke((j(),ue("span",QCe,[nt(Ct(Ot.value),1)])),[[U(a),st.value||""]])]}),"header-actions":ge(()=>[fe(U(Oee),{"onUpdate:assignees":kd,onApplyFilter:Ad,loading:U(Ue),entityId:h.entityId},null,8,["loading","entityId"]),Ke(fe(U(iS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=sn=>w.value=sn),onSearch:U(ze),class:Q(Ae.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=sn=>U(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:_},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke((j(),qe(U($A),{status:U(M)?"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((j(),qe(U(vt),{variant:["secondary","icon"],disabled:U(M),onClick:wt},{default:ge(()=>[fe(U(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[jt,5],[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke(fe(U(kQ),{"model-value":U(k),onChange:Ye[4]||(Ye[4]=sn=>Od(sn)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:Z,"checkbox-column":U(O),tableHeight:c.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]])]),grid:ge(({availableHeight:sn})=>[fe(U(VCe),Xt({id:"item_table_main",ref_key:"agGrid",ref:G},At.value,{height:sn+"px",isSorting:U(ce),onOnGridReady:pl,onSelectionChanged:Gi}),null,16,["height","isSorting"])]),footer:ge(()=>[Re("div",{class:Q(Ae.$style.tableFooter),id:"table_footer"},[Re("span",null,[Ye[5]||(Ye[5]=nt(" Showing ",-1)),Re("b",null,Ct(U(S).loaded)+" of "+Ct(U(S).total),1)])],2)]),"new-row":ge(()=>[fe(U(cee),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:va,onFocusOnId:gl},null,512)]),"bulk-update-actions":ge(()=>[!b.value&&v.value.length>0?Ke((j(),qe(U(JX),{key:0,selectRowData:Ee.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(Ge),onSelectAll:U(we),"take-name":z.value,"selected-all":oe.value,"total-rows":U(S).total,"visible-rows":U(S).loaded,onUpdated:Ve,loading:U(M)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[jo,!b.value&&v.value.length>0]]):Je("",!0)]),snackbar:ge(()=>[fe(U(GJ))]),popup:ge(()=>[fe(vse,{ref_key:"popupCreateSceneRef",ref:Qt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"]),fe(JCe,{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"}}]]),MB="0.1.102",tbe={key:0},nbe=_t(rt({__name:"app",setup(e){const t=Y(()=>n.id.length===0||n.workspaceId.length===0),n=ao({id:"",workspaceId:"",apiConfig:{}}),s=mf(),{showMessage:o,showErrorNetMessage:i}=s,r=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):r.includes(h.apiCode)||i(h)},l=V(null),u=()=>{const h=En.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",MB);try{if(l.value=Yn(),!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)||En.getInstance().getItem("ws.code");const g={domainApi:u(),wsCode:En.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 Lk(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),vs(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const c=Y(()=>n.id),d=Y(()=>n.workspaceId);return Zi("workspaceId",d),Zi("entityId",c),(h,f)=>(j(),ue("div",{class:Q(h.$style.dashboardPluginWrapper)},[t.value?(j(),ue("span",tbe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):c.value?(j(),qe(U(ebe),{key:1,entityId:c.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Je("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),E_=async(e={},t={})=>{const n=RT(nbe),s=lY();n.use(s);const o=["apiConfig","workspaceId","id"],i={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,i[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=i,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,u)=>{console.error("[Vue Error]",a),u&&console.error("[Info]",u)},console.log(`%cArbo Dashboard Plugin v${MB}`,"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",Jt),n.directive("focusable",Ur);const r=await pse();return n.use(r),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=E_),On.default=E_,On.initDashboard=E_,Object.defineProperties(On,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|