@arbocollab/arbo-plugin-item-table 0.1.124 → 0.1.126
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 +77 -92
- package/lib/style.css +1 -1
- package/lib/umd/index.umd.js +6 -6
- package/package.json +1 -1
package/lib/umd/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(On,Y){typeof exports=="object"&&typeof module<"u"?Y(exports):typeof define=="function"&&define.amd?define(["exports"],Y):(On=typeof globalThis<"u"?globalThis:On||self,Y(On.arboDashBoard={}))})(this,function(On){"use strict";var
|
|
1
|
+
(function(On,Y){typeof exports=="object"&&typeof module<"u"?Y(exports):typeof define=="function"&&define.amd?define(["exports"],Y):(On=typeof globalThis<"u"?globalThis:On||self,Y(On.arboDashBoard={}))})(this,function(On){"use strict";var Abe=Object.defineProperty;var kbe=(On,Y,io)=>Y in On?Abe(On,Y,{enumerable:!0,configurable:!0,writable:!0,value:io}):On[Y]=io;var Qn=(On,Y,io)=>kbe(On,typeof Y!="symbol"?Y+"":Y,io);var NB,LB;var Y={env:{}};/**
|
|
2
2
|
* @vue/shared v3.5.25
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
@@ -111,7 +111,7 @@ Expected function or array of functions, received type ${typeof e}.`),ps)}functi
|
|
|
111
111
|
* Date: 2023-02-28T14:09:41.732Z
|
|
112
112
|
*/function R1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function xg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R1(Object(n),!0).forEach(function(s){Ez(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R1(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function bz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D1(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,T1(s.key),s)}}function Sz(e,t,n){return t&&D1(e.prototype,t),n&&D1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ez(e,t,n){return t=T1(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fg(){return Fg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Fg.apply(this,arguments)}function _z(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function T1(e){var t=_z(e,"string");return typeof t=="symbol"?t:String(t)}var I1={exports:{}};(function(e){typeof window>"u"||function(t){var n=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,s=t.Blob&&function(){try{return!!new Blob}catch{return!1}}(),o=s&&t.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),r=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,i=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,a=(s||r)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(l){var c,u,d,h,f,p,g,v,C;if(c=l.match(i),!c)throw new Error("invalid data URI");for(u=c[2]?c[1]:"text/plain"+(c[3]||";charset=US-ASCII"),d=!!c[4],h=l.slice(c[0].length),d?f=atob(h):f=decodeURIComponent(h),p=new ArrayBuffer(f.length),g=new Uint8Array(p),v=0;v<f.length;v+=1)g[v]=f.charCodeAt(v);return s?new Blob([o?g:p],{type:u}):(C=new r,C.append(p),C.getBlob(u))};t.HTMLCanvasElement&&!n.toBlob&&(n.mozGetAsFile?n.toBlob=function(l,c,u){var d=this;setTimeout(function(){u&&n.toDataURL&&a?l(a(d.toDataURL(c,u))):l(d.mozGetAsFile("blob",c))})}:n.toDataURL&&a&&(n.msToBlob?n.toBlob=function(l,c,u){var d=this;setTimeout(function(){(c&&c!=="image/png"||u)&&n.toDataURL&&a?l(a(d.toDataURL(c,u))):l(d.msToBlob(c))})}:n.toBlob=function(l,c,u){var d=this;setTimeout(function(){l(a(d.toDataURL(c,u)))})})),e.exports?e.exports=a:t.dataURLtoBlob=a}(window)})(I1);var x1=I1.exports,Rz=function(t){return typeof Blob>"u"?!1:t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"},F1={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},Dz=typeof window<"u"&&typeof window.document<"u",Oa=Dz?window:{},Pg=function(t){return t>0&&t<1/0},Tz=Array.prototype.slice;function pC(e){return Array.from?Array.from(e):Tz.call(e)}var Iz=/^image\/.+$/;function gC(e){return Iz.test(e)}function xz(e){var t=gC(e)?e.substr(6):"";return t==="jpeg"&&(t="jpg"),".".concat(t)}var P1=String.fromCharCode;function Fz(e,t,n){var s="",o;for(n+=t,o=t;o<n;o+=1)s+=P1(e.getUint8(o));return s}var Pz=Oa.btoa;function A1(e,t){for(var n=[],s=8192,o=new Uint8Array(e);o.length>0;)n.push(P1.apply(null,pC(o.subarray(0,s)))),o=o.subarray(s);return"data:".concat(t,";base64,").concat(Pz(n.join("")))}function Az(e){var t=new DataView(e),n;try{var s,o,r;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var i=t.byteLength,a=2;a+1<i;){if(t.getUint8(a)===255&&t.getUint8(a+1)===225){o=a;break}a+=1}if(o){var l=o+4,c=o+10;if(Fz(t,l,4)==="Exif"){var u=t.getUint16(c);if(s=u===18761,(s||u===19789)&&t.getUint16(c+2,s)===42){var d=t.getUint32(c+4,s);d>=8&&(r=c+d)}}}if(r){var h=t.getUint16(r,s),f,p;for(p=0;p<h;p+=1)if(f=r+p*12+2,t.getUint16(f,s)===274){f+=8,n=t.getUint16(f,s),t.setUint16(f,1,s);break}}}catch{n=1}return n}function kz(e){var t=0,n=1,s=1;switch(e){case 2:n=-1;break;case 3:t=-180;break;case 4:s=-1;break;case 5:t=90,s=-1;break;case 6:t=90;break;case 7:t=90,n=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:n,scaleY:s}}var Oz=/\.\d*(?:0|9){12}\d*$/;function k1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Oz.test(e)?Math.round(e*t)/t:e}function Eh(e){var t=e.aspectRatio,n=e.height,s=e.width,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",r=Pg(s),i=Pg(n);if(r&&i){var a=n*t;(o==="contain"||o==="none")&&a>s||o==="cover"&&a<s?n=s/t:s=n*t}else r?n=s/t:i&&(s=n*t);return{width:s,height:n}}function Mz(e){for(var t=pC(new Uint8Array(e)),n=t.length,s=[],o=0;o+3<n;){var r=t[o],i=t[o+1];if(r===255&&i===218)break;if(r===255&&i===216)o+=2;else{var a=t[o+2]*256+t[o+3],l=o+a+2,c=t.slice(o,l);s.push(c),o=l}}return s.reduce(function(u,d){return d[0]===255&&d[1]===225?u.concat(d):u},[])}function Nz(e,t){var n=pC(new Uint8Array(e));if(n[2]!==255||n[3]!==224)return e;var s=n[4]*256+n[5],o=[255,216].concat(t,n.slice(4+s));return new Uint8Array(o)}var Lz=Oa.ArrayBuffer,mC=Oa.FileReader,Vl=Oa.URL||Oa.webkitURL,Vz=/\.\w+$/,Bz=Oa.Compressor,$z=function(){function e(t,n){bz(this,e),this.file=t,this.exif=[],this.image=new Image,this.options=xg(xg({},F1),n),this.aborted=!1,this.result=null,this.init()}return Sz(e,[{key:"init",value:function(){var n=this,s=this.file,o=this.options;if(!Rz(s)){this.fail(new Error("The first argument must be a File or Blob object."));return}var r=s.type;if(!gC(r)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!Vl||!mC){this.fail(new Error("The current browser does not support image compression."));return}Lz||(o.checkOrientation=!1,o.retainExif=!1);var i=r==="image/jpeg",a=i&&o.checkOrientation,l=i&&o.retainExif;if(Vl&&!a&&!l)this.load({url:Vl.createObjectURL(s)});else{var c=new mC;this.reader=c,c.onload=function(u){var d=u.target,h=d.result,f={},p=1;a&&(p=Az(h),p>1&&Fg(f,kz(p))),l&&(n.exif=Mz(h)),a||l?!Vl||p>1?f.url=A1(h,r):f.url=Vl.createObjectURL(s):f.url=h,n.load(f)},c.onabort=function(){n.fail(new Error("Aborted to read the image with FileReader."))},c.onerror=function(){n.fail(new Error("Failed to read the image with FileReader."))},c.onloadend=function(){n.reader=null},a||l?c.readAsArrayBuffer(s):c.readAsDataURL(s)}}},{key:"load",value:function(n){var s=this,o=this.file,r=this.image;r.onload=function(){s.draw(xg(xg({},n),{},{naturalWidth:r.naturalWidth,naturalHeight:r.naturalHeight}))},r.onabort=function(){s.fail(new Error("Aborted to load the image."))},r.onerror=function(){s.fail(new Error("Failed to load the image."))},Oa.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(Oa.navigator.userAgent)&&(r.crossOrigin="anonymous"),r.alt=o.name,r.src=n.url}},{key:"draw",value:function(n){var s=this,o=n.naturalWidth,r=n.naturalHeight,i=n.rotate,a=i===void 0?0:i,l=n.scaleX,c=l===void 0?1:l,u=n.scaleY,d=u===void 0?1:u,h=this.file,f=this.image,p=this.options,g=document.createElement("canvas"),v=g.getContext("2d"),C=Math.abs(a)%180===90,S=(p.resize==="contain"||p.resize==="cover")&&Pg(p.width)&&Pg(p.height),b=Math.max(p.maxWidth,0)||1/0,w=Math.max(p.maxHeight,0)||1/0,D=Math.max(p.minWidth,0)||0,R=Math.max(p.minHeight,0)||0,T=o/r,I=p.width,x=p.height;if(C){var F=[w,b];b=F[0],w=F[1];var E=[R,D];D=E[0],R=E[1];var A=[x,I];I=A[0],x=A[1]}S&&(T=I/x);var k=Eh({aspectRatio:T,width:b,height:w},"contain");b=k.width,w=k.height;var M=Eh({aspectRatio:T,width:D,height:R},"cover");if(D=M.width,R=M.height,S){var O=Eh({aspectRatio:T,width:I,height:x},p.resize);I=O.width,x=O.height}else{var W=Eh({aspectRatio:T,width:I,height:x}),X=W.width;I=X===void 0?o:X;var J=W.height;x=J===void 0?r:J}I=Math.floor(k1(Math.min(Math.max(I,D),b))),x=Math.floor(k1(Math.min(Math.max(x,R),w)));var ie=-I/2,ae=-x/2,ee=I,V=x,G=[];if(S){var te=0,pe=0,ve=o,re=r,oe=Eh({aspectRatio:T,width:o,height:r},{contain:"cover",cover:"contain"}[p.resize]);ve=oe.width,re=oe.height,te=(o-ve)/2,pe=(r-re)/2,G.push(te,pe,ve,re)}if(G.push(ie,ae,ee,V),C){var K=[x,I];I=K[0],x=K[1]}g.width=I,g.height=x,gC(p.mimeType)||(p.mimeType=h.type);var me="transparent";h.size>p.convertSize&&p.convertTypes.indexOf(p.mimeType)>=0&&(p.mimeType="image/jpeg");var se=p.mimeType==="image/jpeg";if(se&&(me="#fff"),v.fillStyle=me,v.fillRect(0,0,I,x),p.beforeDraw&&p.beforeDraw.call(this,v,g),!this.aborted&&(v.save(),v.translate(I/2,x/2),v.rotate(a*Math.PI/180),v.scale(c,d),v.drawImage.apply(v,[f].concat(G)),v.restore(),p.drew&&p.drew.call(this,v,g),!this.aborted)){var Se=function(Z){if(!s.aborted){var de=function(ye){return s.done({naturalWidth:o,naturalHeight:r,result:ye})};if(Z&&se&&p.retainExif&&s.exif&&s.exif.length>0){var Ae=function(ye){return de(x1(A1(Nz(ye,s.exif),p.mimeType)))};if(Z.arrayBuffer)Z.arrayBuffer().then(Ae).catch(function(){s.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var Fe=new mC;s.reader=Fe,Fe.onload=function(Le){var ye=Le.target;Ae(ye.result)},Fe.onabort=function(){s.fail(new Error("Aborted to read the compressed image with FileReader."))},Fe.onerror=function(){s.fail(new Error("Failed to read the compressed image with FileReader."))},Fe.onloadend=function(){s.reader=null},Fe.readAsArrayBuffer(Z)}}else de(Z)}};g.toBlob?g.toBlob(Se,p.mimeType,p.quality):Se(x1(g.toDataURL(p.mimeType,p.quality)))}}},{key:"done",value:function(n){var s=n.naturalWidth,o=n.naturalHeight,r=n.result,i=this.file,a=this.image,l=this.options;if(Vl&&a.src.indexOf("blob:")===0&&Vl.revokeObjectURL(a.src),r)if(l.strict&&!l.retainExif&&r.size>i.size&&l.mimeType===i.type&&!(l.width>s||l.height>o||l.minWidth>s||l.minHeight>o||l.maxWidth<s||l.maxHeight<o))r=i;else{var c=new Date;r.lastModified=c.getTime(),r.lastModifiedDate=c,r.name=i.name,r.name&&r.type!==i.type&&(r.name=r.name.replace(Vz,xz(r.type)))}else r=i;this.result=r,l.success&&l.success.call(this,r)}},{key:"fail",value:function(n){var s=this.options;if(s.error)s.error.call(this,n);else throw n}},{key:"abort",value:function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))}}],[{key:"noConflict",value:function(){return window.Compressor=Bz,e}},{key:"setDefaults",value:function(n){Fg(F1,n)}}]),e}(),O1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hz(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var M1={exports:{}};(function(e,t){(function(n,s){e.exports=s()})(O1,function(){var n=function(m,y){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,P){_.__proto__=P}||function(_,P){for(var L in P)Object.prototype.hasOwnProperty.call(P,L)&&(_[L]=P[L])})(m,y)},s=function(){return(s=Object.assign||function(m){for(var y,_=1,P=arguments.length;_<P;_++)for(var L in y=arguments[_])Object.prototype.hasOwnProperty.call(y,L)&&(m[L]=y[L]);return m}).apply(this,arguments)};function o(m,y,_){for(var P,L=0,j=y.length;L<j;L++)!P&&L in y||((P=P||Array.prototype.slice.call(y,0,L))[L]=y[L]);return m.concat(P||Array.prototype.slice.call(y))}var r=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:O1,i=Object.keys,a=Array.isArray;function l(m,y){return typeof y!="object"||i(y).forEach(function(_){m[_]=y[_]}),m}typeof Promise>"u"||r.Promise||(r.Promise=Promise);var c=Object.getPrototypeOf,u={}.hasOwnProperty;function d(m,y){return u.call(m,y)}function h(m,y){typeof y=="function"&&(y=y(c(m))),(typeof Reflect>"u"?i:Reflect.ownKeys)(y).forEach(function(_){p(m,_,y[_])})}var f=Object.defineProperty;function p(m,y,_,P){f(m,y,l(_&&d(_,"get")&&typeof _.get=="function"?{get:_.get,set:_.set,configurable:!0}:{value:_,configurable:!0,writable:!0},P))}function g(m){return{from:function(y){return m.prototype=Object.create(y.prototype),p(m.prototype,"constructor",m),{extend:h.bind(null,m.prototype)}}}}var v=Object.getOwnPropertyDescriptor,C=[].slice;function S(m,y,_){return C.call(m,y,_)}function b(m,y){return y(m)}function w(m){if(!m)throw new Error("Assertion Failed")}function D(m){r.setImmediate?setImmediate(m):setTimeout(m,0)}function R(m,y){if(typeof y=="string"&&d(m,y))return m[y];if(!y)return m;if(typeof y!="string"){for(var _=[],P=0,L=y.length;P<L;++P){var j=R(m,y[P]);_.push(j)}return _}var ne=y.indexOf(".");if(ne!==-1){var ue=m[y.substr(0,ne)];return ue==null?void 0:R(ue,y.substr(ne+1))}}function T(m,y,_){if(m&&y!==void 0&&!("isFrozen"in Object&&Object.isFrozen(m)))if(typeof y!="string"&&"length"in y){w(typeof _!="string"&&"length"in _);for(var P=0,L=y.length;P<L;++P)T(m,y[P],_[P])}else{var j,ne,ue=y.indexOf(".");ue!==-1?(j=y.substr(0,ue),(ne=y.substr(ue+1))===""?_===void 0?a(m)&&!isNaN(parseInt(j))?m.splice(j,1):delete m[j]:m[j]=_:T(ue=!(ue=m[j])||!d(m,j)?m[j]={}:ue,ne,_)):_===void 0?a(m)&&!isNaN(parseInt(y))?m.splice(y,1):delete m[y]:m[y]=_}}function I(m){var y,_={};for(y in m)d(m,y)&&(_[y]=m[y]);return _}var x=[].concat;function F(m){return x.apply([],m)}var ba="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(F([8,16,32,64].map(function(m){return["Int","Uint","Float"].map(function(y){return y+m+"Array"})}))).filter(function(m){return r[m]}),E=new Set(ba.map(function(m){return r[m]})),A=null;function k(m){return A=new WeakMap,m=function y(_){if(!_||typeof _!="object")return _;var P=A.get(_);if(P)return P;if(a(_)){P=[],A.set(_,P);for(var L=0,j=_.length;L<j;++L)P.push(y(_[L]))}else if(E.has(_.constructor))P=_;else{var ne,ue=c(_);for(ne in P=ue===Object.prototype?{}:Object.create(ue),A.set(_,P),_)d(_,ne)&&(P[ne]=y(_[ne]))}return P}(m),A=null,m}var M={}.toString;function O(m){return M.call(m).slice(8,-1)}var W=typeof Symbol<"u"?Symbol.iterator:"@@iterator",X=typeof W=="symbol"?function(m){var y;return m!=null&&(y=m[W])&&y.apply(m)}:function(){return null};function J(m,y){return y=m.indexOf(y),0<=y&&m.splice(y,1),0<=y}var ie={};function ae(m){var y,_,P,L;if(arguments.length===1){if(a(m))return m.slice();if(this===ie&&typeof m=="string")return[m];if(L=X(m)){for(_=[];!(P=L.next()).done;)_.push(P.value);return _}if(m==null)return[m];if(typeof(y=m.length)!="number")return[m];for(_=new Array(y);y--;)_[y]=m[y];return _}for(y=arguments.length,_=new Array(y);y--;)_[y]=arguments[y];return _}var ee=typeof Symbol<"u"?function(m){return m[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},ze=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],vr=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(ze),V={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function G(m,y){this.name=m,this.message=y}function te(m,y){return m+". Errors: "+Object.keys(y).map(function(_){return y[_].toString()}).filter(function(_,P,L){return L.indexOf(_)===P}).join(`
|
|
113
113
|
`)}function pe(m,y,_,P){this.failures=y,this.failedKeys=P,this.successCount=_,this.message=te(m,y)}function ve(m,y){this.name="BulkError",this.failures=Object.keys(y).map(function(_){return y[_]}),this.failuresByPos=y,this.message=te(m,this.failures)}g(G).from(Error).extend({toString:function(){return this.name+": "+this.message}}),g(pe).from(G),g(ve).from(G);var re=vr.reduce(function(m,y){return m[y]=y+"Error",m},{}),oe=G,K=vr.reduce(function(m,y){var _=y+"Error";function P(L,j){this.name=_,L?typeof L=="string"?(this.message="".concat(L).concat(j?`
|
|
114
|
-
`+j:""),this.inner=j||null):typeof L=="object"&&(this.message="".concat(L.name," ").concat(L.message),this.inner=L):(this.message=V[y]||_,this.inner=null)}return g(P).from(oe),m[y]=P,m},{});K.Syntax=SyntaxError,K.Type=TypeError,K.Range=RangeError;var me=ze.reduce(function(m,y){return m[y+"Error"]=K[y],m},{}),se=vr.reduce(function(m,y){return["Syntax","Type","Range"].indexOf(y)===-1&&(m[y+"Error"]=K[y]),m},{});function Se(){}function U(m){return m}function Z(m,y){return m==null||m===U?y:function(_){return y(m(_))}}function de(m,y){return function(){m.apply(this,arguments),y.apply(this,arguments)}}function Ae(m,y){return m===Se?y:function(){var _=m.apply(this,arguments);_!==void 0&&(arguments[0]=_);var P=this.onsuccess,L=this.onerror;this.onsuccess=null,this.onerror=null;var j=y.apply(this,arguments);return P&&(this.onsuccess=this.onsuccess?de(P,this.onsuccess):P),L&&(this.onerror=this.onerror?de(L,this.onerror):L),j!==void 0?j:_}}function Fe(m,y){return m===Se?y:function(){m.apply(this,arguments);var _=this.onsuccess,P=this.onerror;this.onsuccess=this.onerror=null,y.apply(this,arguments),_&&(this.onsuccess=this.onsuccess?de(_,this.onsuccess):_),P&&(this.onerror=this.onerror?de(P,this.onerror):P)}}function Le(m,y){return m===Se?y:function(_){var P=m.apply(this,arguments);l(_,P);var L=this.onsuccess,j=this.onerror;return this.onsuccess=null,this.onerror=null,_=y.apply(this,arguments),L&&(this.onsuccess=this.onsuccess?de(L,this.onsuccess):L),j&&(this.onerror=this.onerror?de(j,this.onerror):j),P===void 0?_===void 0?void 0:_:l(P,_)}}function ye(m,y){return m===Se?y:function(){return y.apply(this,arguments)!==!1&&m.apply(this,arguments)}}function N(m,y){return m===Se?y:function(){var _=m.apply(this,arguments);if(_&&typeof _.then=="function"){for(var P=this,L=arguments.length,j=new Array(L);L--;)j[L]=arguments[L];return _.then(function(){return y.apply(P,j)})}return y.apply(this,arguments)}}se.ModifyError=pe,se.DexieError=G,se.BulkError=ve;var $=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function le(m){$=m}var Ge={},we=100,ba=typeof Promise>"u"?[]:function(){var m=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[m,c(m),m];var y=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[y,c(y),m]}(),ze=ba[0],vr=ba[1],ba=ba[2],vr=vr&&vr.then,Ue=ze&&ze.constructor,_e=!!ba,Ve=function(m,y){wt.push([m,y]),kt&&(queueMicrotask(Fi),kt=!1)},gt=!0,kt=!0,Ut=[],en=[],zt=U,Ne={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Se,pgp:!1,env:{},finalize:Se},qe=Ne,wt=[],Nt=0,Wt=[];function nt(m){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var y=this._PSD=qe;if(typeof m!="function"){if(m!==Ge)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&xi(this,this._value))}this._state=null,this._value=null,++y.ref,function _(P,L){try{L(function(j){if(P._state===null){if(j===P)throw new TypeError("A promise cannot be resolved with itself.");var ne=P._lib&&Pi();j&&typeof j.then=="function"?_(P,function(ue,Ce){j instanceof nt?j._then(ue,Ce):j.then(ue,Ce)}):(P._state=!0,P._value=j,gr(P)),ne&&mr()}},xi.bind(null,P))}catch(j){xi(P,j)}}(this,m)}var Is={get:function(){var m=qe,y=Od;function _(P,L){var j=this,ne=!m.global&&(m!==qe||y!==Od),ue=ne&&!Xt(),Ce=new nt(function(Re,Ie){ya(j,new Ur(S_(P,m,ne,ue),S_(L,m,ne,ue),Re,Ie,m))});return this._consoleTask&&(Ce._consoleTask=this._consoleTask),Ce}return _.prototype=Ge,_},set:function(m){p(this,"then",m&&m.prototype===Ge?Is:{get:function(){return m},set:Is.set})}};function Ur(m,y,_,P,L){this.onFulfilled=typeof m=="function"?m:null,this.onRejected=typeof y=="function"?y:null,this.resolve=_,this.reject=P,this.psd=L}function xi(m,y){var _,P;en.push(y),m._state===null&&(_=m._lib&&Pi(),y=zt(y),m._state=!1,m._value=y,P=m,Ut.some(function(L){return L._value===P._value})||Ut.push(P),gr(m),_&&mr())}function gr(m){var y=m._listeners;m._listeners=[];for(var _=0,P=y.length;_<P;++_)ya(m,y[_]);var L=m._PSD;--L.ref||L.finalize(),Nt===0&&(++Nt,Ve(function(){--Nt==0&&Wr()},[]))}function ya(m,y){if(m._state!==null){var _=m._state?y.onFulfilled:y.onRejected;if(_===null)return(m._state?y.resolve:y.reject)(m._value);++y.psd.ref,++Nt,Ve(ml,[_,m,y])}else m._listeners.push(y)}function ml(m,y,_){try{var P,L=y._value;!y._state&&en.length&&(en=[]),P=$&&y._consoleTask?y._consoleTask.run(function(){return m(L)}):m(L),y._state||en.indexOf(L)!==-1||function(j){for(var ne=Ut.length;ne;)if(Ut[--ne]._value===j._value)return Ut.splice(ne,1)}(y),_.resolve(P)}catch(j){_.reject(j)}finally{--Nt==0&&Wr(),--_.psd.ref||_.psd.finalize()}}function Fi(){oo(Ne,function(){Pi()&&mr()})}function Pi(){var m=gt;return kt=gt=!1,m}function mr(){var m,y,_;do for(;0<wt.length;)for(m=wt,wt=[],_=m.length,y=0;y<_;++y){var P=m[y];P[0].apply(null,P[1])}while(0<wt.length);kt=gt=!0}function Wr(){var m=Ut;Ut=[],m.forEach(function(P){P._PSD.onunhandled.call(null,P._value,P)});for(var y=Wt.slice(0),_=y.length;_;)y[--_]()}function Pd(m){return new nt(Ge,!1,m)}function kn(m,y){var _=qe;return function(){var P=Pi(),L=qe;try{return Go(_,!0),m.apply(this,arguments)}catch(j){y&&y(j)}finally{Go(L,!1),P&&mr()}}}h(nt.prototype,{then:Is,_then:function(m,y){ya(this,new Ur(null,null,m,y,qe))},catch:function(m){if(arguments.length===1)return this.then(null,m);var y=m,_=arguments[1];return typeof y=="function"?this.then(null,function(P){return(P instanceof y?_:Pd)(P)}):this.then(null,function(P){return(P&&P.name===y?_:Pd)(P)})},finally:function(m){return this.then(function(y){return nt.resolve(m()).then(function(){return y})},function(y){return nt.resolve(m()).then(function(){return Pd(y)})})},timeout:function(m,y){var _=this;return m<1/0?new nt(function(P,L){var j=setTimeout(function(){return L(new K.Timeout(y))},m);_.then(P,L).finally(clearTimeout.bind(null,j))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&p(nt.prototype,Symbol.toStringTag,"Dexie.Promise"),Ne.env=Ca(),h(nt,{all:function(){var m=ae.apply(null,arguments).map(Co);return new nt(function(y,_){m.length===0&&y([]);var P=m.length;m.forEach(function(L,j){return nt.resolve(L).then(function(ne){m[j]=ne,--P||y(m)},_)})})},resolve:function(m){return m instanceof nt?m:m&&typeof m.then=="function"?new nt(function(y,_){m.then(y,_)}):new nt(Ge,!0,m)},reject:Pd,race:function(){var m=ae.apply(null,arguments).map(Co);return new nt(function(y,_){m.map(function(P){return nt.resolve(P).then(y,_)})})},PSD:{get:function(){return qe},set:function(m){return qe=m}},totalEchoes:{get:function(){return Od}},newPSD:Ye,usePSD:oo,scheduler:{get:function(){return Ve},set:function(m){Ve=m}},rejectionMapper:{get:function(){return zt},set:function(m){zt=m}},follow:function(m,y){return new nt(function(_,P){return Ye(function(L,j){var ne=qe;ne.unhandleds=[],ne.onunhandled=j,ne.finalize=de(function(){var ue,Ce=this;ue=function(){Ce.unhandleds.length===0?L():j(Ce.unhandleds[0])},Wt.push(function Re(){ue(),Wt.splice(Wt.indexOf(Re),1)}),++Nt,Ve(function(){--Nt==0&&Wr()},[])},ne.finalize),m()},y,_,P)})}}),Ue&&(Ue.allSettled&&p(nt,"allSettled",function(){var m=ae.apply(null,arguments).map(Co);return new nt(function(y){m.length===0&&y([]);var _=m.length,P=new Array(_);m.forEach(function(L,j){return nt.resolve(L).then(function(ne){return P[j]={status:"fulfilled",value:ne}},function(ne){return P[j]={status:"rejected",reason:ne}}).then(function(){return--_||y(P)})})})}),Ue.any&&typeof AggregateError<"u"&&p(nt,"any",function(){var m=ae.apply(null,arguments).map(Co);return new nt(function(y,_){m.length===0&&_(new AggregateError([]));var P=m.length,L=new Array(P);m.forEach(function(j,ne){return nt.resolve(j).then(function(ue){return y(ue)},function(ue){L[ne]=ue,--P||_(new AggregateError(L))})})})}),Ue.withResolvers&&(nt.withResolvers=Ue.withResolvers));var fs={awaits:0,echoes:0,id:0},b_=0,Ad=[],kd=0,Od=0,ke=0;function Ye(m,y,_,P){var L=qe,j=Object.create(L);return j.parent=L,j.ref=0,j.global=!1,j.id=++ke,Ne.env,j.env=_e?{Promise:nt,PromiseProp:{value:nt,configurable:!0,writable:!0},all:nt.all,race:nt.race,allSettled:nt.allSettled,any:nt.any,resolve:nt.resolve,reject:nt.reject}:{},y&&l(j,y),++L.ref,j.finalize=function(){--this.parent.ref||this.parent.finalize()},P=oo(j,m,_,P),j.ref===0&&j.finalize(),P}function Qt(){return fs.id||(fs.id=++b_),++fs.awaits,fs.echoes+=we,fs.id}function Xt(){return!!fs.awaits&&(--fs.awaits==0&&(fs.id=0),fs.echoes=fs.awaits*we,!0)}function Co(m){return fs.echoes&&m&&m.constructor===Ue?(Qt(),m.then(function(y){return Xt(),y},function(y){return Xt(),Kn(y)})):m}function wa(){var m=Ad[Ad.length-1];Ad.pop(),Go(m,!1)}function Go(m,y){var _,P=qe;(y?!fs.echoes||kd++&&m===qe:!kd||--kd&&m===qe)||queueMicrotask(y?(function(L){++Od,fs.echoes&&--fs.echoes!=0||(fs.echoes=fs.awaits=fs.id=0),Ad.push(qe),Go(L,!0)}).bind(null,m):wa),m!==qe&&(qe=m,P===Ne&&(Ne.env=Ca()),_e&&(_=Ne.env.Promise,y=m.env,(P.global||m.global)&&(Object.defineProperty(r,"Promise",y.PromiseProp),_.all=y.all,_.race=y.race,_.resolve=y.resolve,_.reject=y.reject,y.allSettled&&(_.allSettled=y.allSettled),y.any&&(_.any=y.any))))}function Ca(){var m=r.Promise;return _e?{Promise:m,PromiseProp:Object.getOwnPropertyDescriptor(r,"Promise"),all:m.all,race:m.race,allSettled:m.allSettled,any:m.any,resolve:m.resolve,reject:m.reject}:{}}function oo(m,y,_,P,L){var j=qe;try{return Go(m,!0),y(_,P,L)}finally{Go(j,!1)}}function S_(m,y,_,P){return typeof m!="function"?m:function(){var L=qe;_&&Qt(),Go(y,!0);try{return m.apply(this,arguments)}finally{Go(L,!1),P&&queueMicrotask(Xt)}}}function vp(m){Promise===Ue&&fs.echoes===0?kd===0?m():enqueueNativeMicroTask(m):setTimeout(m,0)}(""+vr).indexOf("[native code]")===-1&&(Qt=Xt=Se);var Kn=nt.reject,Ai="",bo="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",VB="String expected.",Md=[],Fy="__dbnames",E_="readonly",__="readwrite";function Ac(m,y){return m?y?function(){return m.apply(this,arguments)&&y.apply(this,arguments)}:m:y}var BB={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Py(m){return typeof m!="string"||/\./.test(m)?function(y){return y}:function(y){return y[m]===void 0&&m in y&&delete(y=k(y))[m],y}}function $B(){throw K.Type()}function ln(m,y){try{var _=HB(m),P=HB(y);if(_!==P)return _==="Array"?1:P==="Array"?-1:_==="binary"?1:P==="binary"?-1:_==="string"?1:P==="string"?-1:_==="Date"?1:P!=="Date"?NaN:-1;switch(_){case"number":case"Date":case"string":return y<m?1:m<y?-1:0;case"binary":return function(L,j){for(var ne=L.length,ue=j.length,Ce=ne<ue?ne:ue,Re=0;Re<Ce;++Re)if(L[Re]!==j[Re])return L[Re]<j[Re]?-1:1;return ne===ue?0:ne<ue?-1:1}(GB(m),GB(y));case"Array":return function(L,j){for(var ne=L.length,ue=j.length,Ce=ne<ue?ne:ue,Re=0;Re<Ce;++Re){var Ie=ln(L[Re],j[Re]);if(Ie!==0)return Ie}return ne===ue?0:ne<ue?-1:1}(m,y)}}catch{}return NaN}function HB(m){var y=typeof m;return y!="object"?y:ArrayBuffer.isView(m)?"binary":(m=O(m),m==="ArrayBuffer"?"binary":m)}function GB(m){return m instanceof Uint8Array?m:ArrayBuffer.isView(m)?new Uint8Array(m.buffer,m.byteOffset,m.byteLength):new Uint8Array(m)}var UB=($n.prototype._trans=function(m,y,_){var P=this._tx||qe.trans,L=this.name,j=$&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(m==="readonly"?"read":"write"," ").concat(this.name));function ne(Re,Ie,he){if(!he.schema[L])throw new K.NotFound("Table "+L+" not part of transaction");return y(he.idbtrans,he)}var ue=Pi();try{var Ce=P&&P.db._novip===this.db._novip?P===qe.trans?P._promise(m,ne,_):Ye(function(){return P._promise(m,ne,_)},{trans:P,transless:qe.transless||qe}):function Re(Ie,he,Pe,Ee){if(Ie.idbdb&&(Ie._state.openComplete||qe.letThrough||Ie._vip)){var Te=Ie._createTransaction(he,Pe,Ie._dbSchema);try{Te.create(),Ie._state.PR1398_maxLoop=3}catch(xe){return xe.name===re.InvalidState&&Ie.isOpen()&&0<--Ie._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Ie.close({disableAutoOpen:!1}),Ie.open().then(function(){return Re(Ie,he,Pe,Ee)})):Kn(xe)}return Te._promise(he,function(xe,De){return Ye(function(){return qe.trans=Te,Ee(xe,De,Te)})}).then(function(xe){if(he==="readwrite")try{Te.idbtrans.commit()}catch{}return he==="readonly"?xe:Te._completion.then(function(){return xe})})}if(Ie._state.openComplete)return Kn(new K.DatabaseClosed(Ie._state.dbOpenError));if(!Ie._state.isBeingOpened){if(!Ie._state.autoOpen)return Kn(new K.DatabaseClosed);Ie.open().catch(Se)}return Ie._state.dbReadyPromise.then(function(){return Re(Ie,he,Pe,Ee)})}(this.db,m,[this.name],ne);return j&&(Ce._consoleTask=j,Ce=Ce.catch(function(Re){return console.trace(Re),Kn(Re)})),Ce}finally{ue&&mr()}},$n.prototype.get=function(m,y){var _=this;return m&&m.constructor===Object?this.where(m).first(y):m==null?Kn(new K.Type("Invalid argument to Table.get()")):this._trans("readonly",function(P){return _.core.get({trans:P,key:m}).then(function(L){return _.hook.reading.fire(L)})}).then(y)},$n.prototype.where=function(m){if(typeof m=="string")return new this.db.WhereClause(this,m);if(a(m))return new this.db.WhereClause(this,"[".concat(m.join("+"),"]"));var y=i(m);if(y.length===1)return this.where(y[0]).equals(m[y[0]]);var _=this.schema.indexes.concat(this.schema.primKey).filter(function(ue){if(ue.compound&&y.every(function(Re){return 0<=ue.keyPath.indexOf(Re)})){for(var Ce=0;Ce<y.length;++Ce)if(y.indexOf(ue.keyPath[Ce])===-1)return!1;return!0}return!1}).sort(function(ue,Ce){return ue.keyPath.length-Ce.keyPath.length})[0];if(_&&this.db._maxKey!==Ai){var j=_.keyPath.slice(0,y.length);return this.where(j).equals(j.map(function(Ce){return m[Ce]}))}!_&&$&&console.warn("The query ".concat(JSON.stringify(m)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(y.join("+"),"]"));var P=this.schema.idxByName;function L(ue,Ce){return ln(ue,Ce)===0}var ne=y.reduce(function(he,Ce){var Re=he[0],Ie=he[1],he=P[Ce],Pe=m[Ce];return[Re||he,Re||!he?Ac(Ie,he&&he.multi?function(Ee){return Ee=R(Ee,Ce),a(Ee)&&Ee.some(function(Te){return L(Pe,Te)})}:function(Ee){return L(Pe,R(Ee,Ce))}):Ie]},[null,null]),j=ne[0],ne=ne[1];return j?this.where(j.name).equals(m[j.keyPath]).filter(ne):_?this.filter(ne):this.where(y).equals("")},$n.prototype.filter=function(m){return this.toCollection().and(m)},$n.prototype.count=function(m){return this.toCollection().count(m)},$n.prototype.offset=function(m){return this.toCollection().offset(m)},$n.prototype.limit=function(m){return this.toCollection().limit(m)},$n.prototype.each=function(m){return this.toCollection().each(m)},$n.prototype.toArray=function(m){return this.toCollection().toArray(m)},$n.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},$n.prototype.orderBy=function(m){return new this.db.Collection(new this.db.WhereClause(this,a(m)?"[".concat(m.join("+"),"]"):m))},$n.prototype.reverse=function(){return this.toCollection().reverse()},$n.prototype.mapToClass=function(m){var y,_=this.db,P=this.name;function L(){return y!==null&&y.apply(this,arguments)||this}(this.schema.mappedClass=m).prototype instanceof $B&&(function(Ce,Re){if(typeof Re!="function"&&Re!==null)throw new TypeError("Class extends value "+String(Re)+" is not a constructor or null");function Ie(){this.constructor=Ce}n(Ce,Re),Ce.prototype=Re===null?Object.create(Re):(Ie.prototype=Re.prototype,new Ie)}(L,y=m),Object.defineProperty(L.prototype,"db",{get:function(){return _},enumerable:!1,configurable:!0}),L.prototype.table=function(){return P},m=L);for(var j=new Set,ne=m.prototype;ne;ne=c(ne))Object.getOwnPropertyNames(ne).forEach(function(Ce){return j.add(Ce)});function ue(Ce){if(!Ce)return Ce;var Re,Ie=Object.create(m.prototype);for(Re in Ce)if(!j.has(Re))try{Ie[Re]=Ce[Re]}catch{}return Ie}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=ue,this.hook("reading",ue),m},$n.prototype.defineClass=function(){return this.mapToClass(function(m){l(this,m)})},$n.prototype.add=function(m,y){var _=this,P=this.schema.primKey,L=P.auto,j=P.keyPath,ne=m;return j&&L&&(ne=Py(j)(m)),this._trans("readwrite",function(ue){return _.core.mutate({trans:ue,type:"add",keys:y!=null?[y]:null,values:[ne]})}).then(function(ue){return ue.numFailures?nt.reject(ue.failures[0]):ue.lastResult}).then(function(ue){if(j)try{T(m,j,ue)}catch{}return ue})},$n.prototype.update=function(m,y){return typeof m!="object"||a(m)?this.where(":id").equals(m).modify(y):(m=R(m,this.schema.primKey.keyPath),m===void 0?Kn(new K.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(m).modify(y))},$n.prototype.put=function(m,y){var _=this,P=this.schema.primKey,L=P.auto,j=P.keyPath,ne=m;return j&&L&&(ne=Py(j)(m)),this._trans("readwrite",function(ue){return _.core.mutate({trans:ue,type:"put",values:[ne],keys:y!=null?[y]:null})}).then(function(ue){return ue.numFailures?nt.reject(ue.failures[0]):ue.lastResult}).then(function(ue){if(j)try{T(m,j,ue)}catch{}return ue})},$n.prototype.delete=function(m){var y=this;return this._trans("readwrite",function(_){return y.core.mutate({trans:_,type:"delete",keys:[m]})}).then(function(_){return _.numFailures?nt.reject(_.failures[0]):void 0})},$n.prototype.clear=function(){var m=this;return this._trans("readwrite",function(y){return m.core.mutate({trans:y,type:"deleteRange",range:BB})}).then(function(y){return y.numFailures?nt.reject(y.failures[0]):void 0})},$n.prototype.bulkGet=function(m){var y=this;return this._trans("readonly",function(_){return y.core.getMany({keys:m,trans:_}).then(function(P){return P.map(function(L){return y.hook.reading.fire(L)})})})},$n.prototype.bulkAdd=function(m,y,_){var P=this,L=Array.isArray(y)?y:void 0,j=(_=_||(L?void 0:y))?_.allKeys:void 0;return this._trans("readwrite",function(ne){var Re=P.schema.primKey,ue=Re.auto,Re=Re.keyPath;if(Re&&L)throw new K.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(L&&L.length!==m.length)throw new K.InvalidArgument("Arguments objects and keys must have the same length");var Ce=m.length,Re=Re&&ue?m.map(Py(Re)):m;return P.core.mutate({trans:ne,type:"add",keys:L,values:Re,wantResults:j}).then(function(Te){var he=Te.numFailures,Pe=Te.results,Ee=Te.lastResult,Te=Te.failures;if(he===0)return j?Pe:Ee;throw new ve("".concat(P.name,".bulkAdd(): ").concat(he," of ").concat(Ce," operations failed"),Te)})})},$n.prototype.bulkPut=function(m,y,_){var P=this,L=Array.isArray(y)?y:void 0,j=(_=_||(L?void 0:y))?_.allKeys:void 0;return this._trans("readwrite",function(ne){var Re=P.schema.primKey,ue=Re.auto,Re=Re.keyPath;if(Re&&L)throw new K.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(L&&L.length!==m.length)throw new K.InvalidArgument("Arguments objects and keys must have the same length");var Ce=m.length,Re=Re&&ue?m.map(Py(Re)):m;return P.core.mutate({trans:ne,type:"put",keys:L,values:Re,wantResults:j}).then(function(Te){var he=Te.numFailures,Pe=Te.results,Ee=Te.lastResult,Te=Te.failures;if(he===0)return j?Pe:Ee;throw new ve("".concat(P.name,".bulkPut(): ").concat(he," of ").concat(Ce," operations failed"),Te)})})},$n.prototype.bulkUpdate=function(m){var y=this,_=this.core,P=m.map(function(ne){return ne.key}),L=m.map(function(ne){return ne.changes}),j=[];return this._trans("readwrite",function(ne){return _.getMany({trans:ne,keys:P,cache:"clone"}).then(function(ue){var Ce=[],Re=[];m.forEach(function(he,Pe){var Ee=he.key,Te=he.changes,xe=ue[Pe];if(xe){for(var De=0,Me=Object.keys(Te);De<Me.length;De++){var $e=Me[De],He=Te[$e];if($e===y.schema.primKey.keyPath){if(ln(He,Ee)!==0)throw new K.Constraint("Cannot update primary key in bulkUpdate()")}else T(xe,$e,He)}j.push(Pe),Ce.push(Ee),Re.push(xe)}});var Ie=Ce.length;return _.mutate({trans:ne,type:"put",keys:Ce,values:Re,updates:{keys:P,changeSpecs:L}}).then(function(he){var Pe=he.numFailures,Ee=he.failures;if(Pe===0)return Ie;for(var Te=0,xe=Object.keys(Ee);Te<xe.length;Te++){var De,Me=xe[Te],$e=j[Number(Me)];$e!=null&&(De=Ee[Me],delete Ee[Me],Ee[$e]=De)}throw new ve("".concat(y.name,".bulkUpdate(): ").concat(Pe," of ").concat(Ie," operations failed"),Ee)})})})},$n.prototype.bulkDelete=function(m){var y=this,_=m.length;return this._trans("readwrite",function(P){return y.core.mutate({trans:P,type:"delete",keys:m})}).then(function(ne){var L=ne.numFailures,j=ne.lastResult,ne=ne.failures;if(L===0)return j;throw new ve("".concat(y.name,".bulkDelete(): ").concat(L," of ").concat(_," operations failed"),ne)})},$n);function $n(){}function yp(m){function y(ne,ue){if(ue){for(var Ce=arguments.length,Re=new Array(Ce-1);--Ce;)Re[Ce-1]=arguments[Ce];return _[ne].subscribe.apply(null,Re),m}if(typeof ne=="string")return _[ne]}var _={};y.addEventType=j;for(var P=1,L=arguments.length;P<L;++P)j(arguments[P]);return y;function j(ne,ue,Ce){if(typeof ne!="object"){var Re;ue=ue||ye;var Ie={subscribers:[],fire:Ce=Ce||Se,subscribe:function(he){Ie.subscribers.indexOf(he)===-1&&(Ie.subscribers.push(he),Ie.fire=ue(Ie.fire,he))},unsubscribe:function(he){Ie.subscribers=Ie.subscribers.filter(function(Pe){return Pe!==he}),Ie.fire=Ie.subscribers.reduce(ue,Ce)}};return _[ne]=y[ne]=Ie}i(Re=ne).forEach(function(he){var Pe=Re[he];if(a(Pe))j(he,Re[he][0],Re[he][1]);else{if(Pe!=="asap")throw new K.InvalidArgument("Invalid event config");var Ee=j(he,U,function(){for(var Te=arguments.length,xe=new Array(Te);Te--;)xe[Te]=arguments[Te];Ee.subscribers.forEach(function(De){D(function(){De.apply(null,xe)})})})}})}}function wp(m,y){return g(y).from({prototype:m}),y}function Nd(m,y){return!(m.filter||m.algorithm||m.or)&&(y?m.justLimit:!m.replayFilter)}function R_(m,y){m.filter=Ac(m.filter,y)}function D_(m,y,_){var P=m.replayFilter;m.replayFilter=P?function(){return Ac(P(),y())}:y,m.justLimit=_&&!P}function Ay(m,y){if(m.isPrimKey)return y.primaryKey;var _=y.getIndexByKeyPath(m.index);if(!_)throw new K.Schema("KeyPath "+m.index+" on object store "+y.name+" is not indexed");return _}function WB(m,y,_){var P=Ay(m,y.schema);return y.openCursor({trans:_,values:!m.keysOnly,reverse:m.dir==="prev",unique:!!m.unique,query:{index:P,range:m.range}})}function ky(m,y,_,P){var L=m.replayFilter?Ac(m.filter,m.replayFilter()):m.filter;if(m.or){var j={},ne=function(ue,Ce,Re){var Ie,he;L&&!L(Ce,Re,function(Pe){return Ce.stop(Pe)},function(Pe){return Ce.fail(Pe)})||((he=""+(Ie=Ce.primaryKey))=="[object ArrayBuffer]"&&(he=""+new Uint8Array(Ie)),d(j,he)||(j[he]=!0,y(ue,Ce,Re)))};return Promise.all([m.or._iterate(ne,_),zB(WB(m,P,_),m.algorithm,ne,!m.keysOnly&&m.valueMapper)])}return zB(WB(m,P,_),Ac(m.algorithm,L),y,!m.keysOnly&&m.valueMapper)}function zB(m,y,_,P){var L=kn(P?function(j,ne,ue){return _(P(j),ne,ue)}:_);return m.then(function(j){if(j)return j.start(function(){var ne=function(){return j.continue()};y&&!y(j,function(ue){return ne=ue},function(ue){j.stop(ue),ne=Se},function(ue){j.fail(ue),ne=Se})||L(j.value,j,function(ue){return ne=ue}),ne()})})}var ba=Symbol(),Cp=(jB.prototype.execute=function(m){if(this.add!==void 0){var y=this.add;if(a(y))return o(o([],a(m)?m:[],!0),y).sort();if(typeof y=="number")return(Number(m)||0)+y;if(typeof y=="bigint")try{return BigInt(m)+y}catch{return BigInt(0)+y}throw new TypeError("Invalid term ".concat(y))}if(this.remove!==void 0){var _=this.remove;if(a(_))return a(m)?m.filter(function(P){return!_.includes(P)}).sort():[];if(typeof _=="number")return Number(m)-_;if(typeof _=="bigint")try{return BigInt(m)-_}catch{return BigInt(0)-_}throw new TypeError("Invalid subtrahend ".concat(_))}return y=(y=this.replacePrefix)===null||y===void 0?void 0:y[0],y&&typeof m=="string"&&m.startsWith(y)?this.replacePrefix[1]+m.substring(y.length):m},jB);function jB(m){Object.assign(this,m)}var fbe=(vn.prototype._read=function(m,y){var _=this._ctx;return _.error?_.table._trans(null,Kn.bind(null,_.error)):_.table._trans("readonly",m).then(y)},vn.prototype._write=function(m){var y=this._ctx;return y.error?y.table._trans(null,Kn.bind(null,y.error)):y.table._trans("readwrite",m,"locked")},vn.prototype._addAlgorithm=function(m){var y=this._ctx;y.algorithm=Ac(y.algorithm,m)},vn.prototype._iterate=function(m,y){return ky(this._ctx,m,y,this._ctx.table.core)},vn.prototype.clone=function(m){var y=Object.create(this.constructor.prototype),_=Object.create(this._ctx);return m&&l(_,m),y._ctx=_,y},vn.prototype.raw=function(){return this._ctx.valueMapper=null,this},vn.prototype.each=function(m){var y=this._ctx;return this._read(function(_){return ky(y,m,_,y.table.core)})},vn.prototype.count=function(m){var y=this;return this._read(function(_){var P=y._ctx,L=P.table.core;if(Nd(P,!0))return L.count({trans:_,query:{index:Ay(P,L.schema),range:P.range}}).then(function(ne){return Math.min(ne,P.limit)});var j=0;return ky(P,function(){return++j,!1},_,L).then(function(){return j})}).then(m)},vn.prototype.sortBy=function(m,y){var _=m.split(".").reverse(),P=_[0],L=_.length-1;function j(Ce,Re){return Re?j(Ce[_[Re]],Re-1):Ce[P]}var ne=this._ctx.dir==="next"?1:-1;function ue(Ce,Re){return ln(j(Ce,L),j(Re,L))*ne}return this.toArray(function(Ce){return Ce.sort(ue)}).then(y)},vn.prototype.toArray=function(m){var y=this;return this._read(function(_){var P=y._ctx;if(P.dir==="next"&&Nd(P,!0)&&0<P.limit){var L=P.valueMapper,j=Ay(P,P.table.core.schema);return P.table.core.query({trans:_,limit:P.limit,values:!0,query:{index:j,range:P.range}}).then(function(ue){return ue=ue.result,L?ue.map(L):ue})}var ne=[];return ky(P,function(ue){return ne.push(ue)},_,P.table.core).then(function(){return ne})},m)},vn.prototype.offset=function(m){var y=this._ctx;return m<=0||(y.offset+=m,Nd(y)?D_(y,function(){var _=m;return function(P,L){return _===0||(_===1?--_:L(function(){P.advance(_),_=0}),!1)}}):D_(y,function(){var _=m;return function(){return--_<0}})),this},vn.prototype.limit=function(m){return this._ctx.limit=Math.min(this._ctx.limit,m),D_(this._ctx,function(){var y=m;return function(_,P,L){return--y<=0&&P(L),0<=y}},!0),this},vn.prototype.until=function(m,y){return R_(this._ctx,function(_,P,L){return!m(_.value)||(P(L),y)}),this},vn.prototype.first=function(m){return this.limit(1).toArray(function(y){return y[0]}).then(m)},vn.prototype.last=function(m){return this.reverse().first(m)},vn.prototype.filter=function(m){var y;return R_(this._ctx,function(_){return m(_.value)}),(y=this._ctx).isMatch=Ac(y.isMatch,m),this},vn.prototype.and=function(m){return this.filter(m)},vn.prototype.or=function(m){return new this.db.WhereClause(this._ctx.table,m,this)},vn.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},vn.prototype.desc=function(){return this.reverse()},vn.prototype.eachKey=function(m){var y=this._ctx;return y.keysOnly=!y.isMatch,this.each(function(_,P){m(P.key,P)})},vn.prototype.eachUniqueKey=function(m){return this._ctx.unique="unique",this.eachKey(m)},vn.prototype.eachPrimaryKey=function(m){var y=this._ctx;return y.keysOnly=!y.isMatch,this.each(function(_,P){m(P.primaryKey,P)})},vn.prototype.keys=function(m){var y=this._ctx;y.keysOnly=!y.isMatch;var _=[];return this.each(function(P,L){_.push(L.key)}).then(function(){return _}).then(m)},vn.prototype.primaryKeys=function(m){var y=this._ctx;if(y.dir==="next"&&Nd(y,!0)&&0<y.limit)return this._read(function(P){var L=Ay(y,y.table.core.schema);return y.table.core.query({trans:P,values:!1,limit:y.limit,query:{index:L,range:y.range}})}).then(function(P){return P.result}).then(m);y.keysOnly=!y.isMatch;var _=[];return this.each(function(P,L){_.push(L.primaryKey)}).then(function(){return _}).then(m)},vn.prototype.uniqueKeys=function(m){return this._ctx.unique="unique",this.keys(m)},vn.prototype.firstKey=function(m){return this.limit(1).keys(function(y){return y[0]}).then(m)},vn.prototype.lastKey=function(m){return this.reverse().firstKey(m)},vn.prototype.distinct=function(){var m=this._ctx,m=m.index&&m.table.schema.idxByName[m.index];if(!m||!m.multi)return this;var y={};return R_(this._ctx,function(L){var P=L.primaryKey.toString(),L=d(y,P);return y[P]=!0,!L}),this},vn.prototype.modify=function(m){var y=this,_=this._ctx;return this._write(function(P){var L,j,ne;ne=typeof m=="function"?m:(L=i(m),j=L.length,function(De){for(var Me=!1,$e=0;$e<j;++$e){var He=L[$e],Ze=m[He],rt=R(De,He);Ze instanceof Cp?(T(De,He,Ze.execute(rt)),Me=!0):rt!==Ze&&(T(De,He,Ze),Me=!0)}return Me});var ue=_.table.core,he=ue.schema.primaryKey,Ce=he.outbound,Re=he.extractKey,Ie=200,he=y.db._options.modifyChunkSize;he&&(Ie=typeof he=="object"?he[ue.name]||he["*"]||200:he);function Pe(De,He){var $e=He.failures,He=He.numFailures;Te+=De-He;for(var Ze=0,rt=i($e);Ze<rt.length;Ze++){var mt=rt[Ze];Ee.push($e[mt])}}var Ee=[],Te=0,xe=[];return y.clone().primaryKeys().then(function(De){function Me(He){var Ze=Math.min(Ie,De.length-He);return ue.getMany({trans:P,keys:De.slice(He,He+Ze),cache:"immutable"}).then(function(rt){for(var mt=[],it=[],lt=Ce?[]:null,St=[],ft=0;ft<Ze;++ft){var Rt=rt[ft],Jt={value:k(Rt),primKey:De[He+ft]};ne.call(Jt,Jt.value,Jt)!==!1&&(Jt.value==null?St.push(De[He+ft]):Ce||ln(Re(Rt),Re(Jt.value))===0?(it.push(Jt.value),Ce&<.push(De[He+ft])):(St.push(De[He+ft]),mt.push(Jt.value)))}return Promise.resolve(0<mt.length&&ue.mutate({trans:P,type:"add",values:mt}).then(function(sn){for(var on in sn.failures)St.splice(parseInt(on),1);Pe(mt.length,sn)})).then(function(){return(0<it.length||$e&&typeof m=="object")&&ue.mutate({trans:P,type:"put",keys:lt,values:it,criteria:$e,changeSpec:typeof m!="function"&&m,isAdditionalChunk:0<He}).then(function(sn){return Pe(it.length,sn)})}).then(function(){return(0<St.length||$e&&m===T_)&&ue.mutate({trans:P,type:"delete",keys:St,criteria:$e,isAdditionalChunk:0<He}).then(function(sn){return Pe(St.length,sn)})}).then(function(){return De.length>He+Ze&&Me(He+Ie)})})}var $e=Nd(_)&&_.limit===1/0&&(typeof m!="function"||m===T_)&&{index:_.index,range:_.range};return Me(0).then(function(){if(0<Ee.length)throw new pe("Error modifying one or more objects",Ee,Te,xe);return De.length})})})},vn.prototype.delete=function(){var m=this._ctx,y=m.range;return Nd(m)&&(m.isPrimKey||y.type===3)?this._write(function(_){var P=m.table.core.schema.primaryKey,L=y;return m.table.core.count({trans:_,query:{index:P,range:L}}).then(function(j){return m.table.core.mutate({trans:_,type:"deleteRange",range:L}).then(function(ne){var ue=ne.failures;if(ne.lastResult,ne.results,ne=ne.numFailures,ne)throw new pe("Could not delete some values",Object.keys(ue).map(function(Ce){return ue[Ce]}),j-ne);return j-ne})})}):this.modify(T_)},vn);function vn(){}var T_=function(m,y){return y.value=null};function pbe(m,y){return m<y?-1:m===y?0:1}function gbe(m,y){return y<m?-1:m===y?0:1}function Uo(m,y,_){return m=m instanceof qB?new m.Collection(m):m,m._ctx.error=new(_||TypeError)(y),m}function Ld(m){return new m.Collection(m,function(){return KB("")}).limit(0)}function Oy(m,y,_,P){var L,j,ne,ue,Ce,Re,Ie,he=_.length;if(!_.every(function(Te){return typeof Te=="string"}))return Uo(m,VB);function Pe(Te){L=Te==="next"?function(De){return De.toUpperCase()}:function(De){return De.toLowerCase()},j=Te==="next"?function(De){return De.toLowerCase()}:function(De){return De.toUpperCase()},ne=Te==="next"?pbe:gbe;var xe=_.map(function(De){return{lower:j(De),upper:L(De)}}).sort(function(De,Me){return ne(De.lower,Me.lower)});ue=xe.map(function(De){return De.upper}),Ce=xe.map(function(De){return De.lower}),Ie=(Re=Te)==="next"?"":P}Pe("next"),m=new m.Collection(m,function(){return vl(ue[0],Ce[he-1]+P)}),m._ondirectionchange=function(Te){Pe(Te)};var Ee=0;return m._addAlgorithm(function(Te,xe,De){var Me=Te.key;if(typeof Me!="string")return!1;var $e=j(Me);if(y($e,Ce,Ee))return!0;for(var He=null,Ze=Ee;Ze<he;++Ze){var rt=function(mt,it,lt,St,ft,Rt){for(var Jt=Math.min(mt.length,St.length),sn=-1,on=0;on<Jt;++on){var Wo=it[on];if(Wo!==St[on])return ft(mt[on],lt[on])<0?mt.substr(0,on)+lt[on]+lt.substr(on+1):ft(mt[on],St[on])<0?mt.substr(0,on)+St[on]+lt.substr(on+1):0<=sn?mt.substr(0,sn)+it[sn]+lt.substr(sn+1):null;ft(mt[on],Wo)<0&&(sn=on)}return Jt<St.length&&Rt==="next"?mt+lt.substr(mt.length):Jt<mt.length&&Rt==="prev"?mt.substr(0,lt.length):sn<0?null:mt.substr(0,sn)+St[sn]+lt.substr(sn+1)}(Me,$e,ue[Ze],Ce[Ze],ne,Re);rt===null&&He===null?Ee=Ze+1:(He===null||0<ne(He,rt))&&(He=rt)}return xe(He!==null?function(){Te.continue(He+Ie)}:De),!1}),m}function vl(m,y,_,P){return{type:2,lower:m,upper:y,lowerOpen:_,upperOpen:P}}function KB(m){return{type:1,lower:m,upper:m}}var qB=(Object.defineProperty(xs.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),xs.prototype.between=function(m,y,_,P){_=_!==!1,P=P===!0;try{return 0<this._cmp(m,y)||this._cmp(m,y)===0&&(_||P)&&(!_||!P)?Ld(this):new this.Collection(this,function(){return vl(m,y,!_,!P)})}catch{return Uo(this,bo)}},xs.prototype.equals=function(m){return m==null?Uo(this,bo):new this.Collection(this,function(){return KB(m)})},xs.prototype.above=function(m){return m==null?Uo(this,bo):new this.Collection(this,function(){return vl(m,void 0,!0)})},xs.prototype.aboveOrEqual=function(m){return m==null?Uo(this,bo):new this.Collection(this,function(){return vl(m,void 0,!1)})},xs.prototype.below=function(m){return m==null?Uo(this,bo):new this.Collection(this,function(){return vl(void 0,m,!1,!0)})},xs.prototype.belowOrEqual=function(m){return m==null?Uo(this,bo):new this.Collection(this,function(){return vl(void 0,m)})},xs.prototype.startsWith=function(m){return typeof m!="string"?Uo(this,VB):this.between(m,m+Ai,!0,!0)},xs.prototype.startsWithIgnoreCase=function(m){return m===""?this.startsWith(m):Oy(this,function(y,_){return y.indexOf(_[0])===0},[m],Ai)},xs.prototype.equalsIgnoreCase=function(m){return Oy(this,function(y,_){return y===_[0]},[m],"")},xs.prototype.anyOfIgnoreCase=function(){var m=ae.apply(ie,arguments);return m.length===0?Ld(this):Oy(this,function(y,_){return _.indexOf(y)!==-1},m,"")},xs.prototype.startsWithAnyOfIgnoreCase=function(){var m=ae.apply(ie,arguments);return m.length===0?Ld(this):Oy(this,function(y,_){return _.some(function(P){return y.indexOf(P)===0})},m,Ai)},xs.prototype.anyOf=function(){var m=this,y=ae.apply(ie,arguments),_=this._cmp;try{y.sort(_)}catch{return Uo(this,bo)}if(y.length===0)return Ld(this);var P=new this.Collection(this,function(){return vl(y[0],y[y.length-1])});P._ondirectionchange=function(j){_=j==="next"?m._ascending:m._descending,y.sort(_)};var L=0;return P._addAlgorithm(function(j,ne,ue){for(var Ce=j.key;0<_(Ce,y[L]);)if(++L===y.length)return ne(ue),!1;return _(Ce,y[L])===0||(ne(function(){j.continue(y[L])}),!1)}),P},xs.prototype.notEqual=function(m){return this.inAnyRange([[-1/0,m],[m,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},xs.prototype.noneOf=function(){var m=ae.apply(ie,arguments);if(m.length===0)return new this.Collection(this);try{m.sort(this._ascending)}catch{return Uo(this,bo)}var y=m.reduce(function(_,P){return _?_.concat([[_[_.length-1][1],P]]):[[-1/0,P]]},null);return y.push([m[m.length-1],this.db._maxKey]),this.inAnyRange(y,{includeLowers:!1,includeUppers:!1})},xs.prototype.inAnyRange=function(Me,y){var _=this,P=this._cmp,L=this._ascending,j=this._descending,ne=this._min,ue=this._max;if(Me.length===0)return Ld(this);if(!Me.every(function($e){return $e[0]!==void 0&&$e[1]!==void 0&&L($e[0],$e[1])<=0}))return Uo(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",K.InvalidArgument);var Ce=!y||y.includeLowers!==!1,Re=y&&y.includeUppers===!0,Ie,he=L;function Pe($e,He){return he($e[0],He[0])}try{(Ie=Me.reduce(function($e,He){for(var Ze=0,rt=$e.length;Ze<rt;++Ze){var mt=$e[Ze];if(P(He[0],mt[1])<0&&0<P(He[1],mt[0])){mt[0]=ne(mt[0],He[0]),mt[1]=ue(mt[1],He[1]);break}}return Ze===rt&&$e.push(He),$e},[])).sort(Pe)}catch{return Uo(this,bo)}var Ee=0,Te=Re?function($e){return 0<L($e,Ie[Ee][1])}:function($e){return 0<=L($e,Ie[Ee][1])},xe=Ce?function($e){return 0<j($e,Ie[Ee][0])}:function($e){return 0<=j($e,Ie[Ee][0])},De=Te,Me=new this.Collection(this,function(){return vl(Ie[0][0],Ie[Ie.length-1][1],!Ce,!Re)});return Me._ondirectionchange=function($e){he=$e==="next"?(De=Te,L):(De=xe,j),Ie.sort(Pe)},Me._addAlgorithm(function($e,He,Ze){for(var rt,mt=$e.key;De(mt);)if(++Ee===Ie.length)return He(Ze),!1;return!Te(rt=mt)&&!xe(rt)||(_._cmp(mt,Ie[Ee][1])===0||_._cmp(mt,Ie[Ee][0])===0||He(function(){he===L?$e.continue(Ie[Ee][0]):$e.continue(Ie[Ee][1])}),!1)}),Me},xs.prototype.startsWithAnyOf=function(){var m=ae.apply(ie,arguments);return m.every(function(y){return typeof y=="string"})?m.length===0?Ld(this):this.inAnyRange(m.map(function(y){return[y,y+Ai]})):Uo(this,"startsWithAnyOf() only works with strings")},xs);function xs(){}function ki(m){return kn(function(y){return bp(y),m(y.target.error),!1})}function bp(m){m.stopPropagation&&m.stopPropagation(),m.preventDefault&&m.preventDefault()}var Sp="storagemutated",I_="x-storagemutated-1",yl=yp(null,Sp),mbe=(Oi.prototype._lock=function(){return w(!qe.global),++this._reculock,this._reculock!==1||qe.global||(qe.lockOwnerFor=this),this},Oi.prototype._unlock=function(){if(w(!qe.global),--this._reculock==0)for(qe.global||(qe.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var m=this._blockedFuncs.shift();try{oo(m[1],m[0])}catch{}}return this},Oi.prototype._locked=function(){return this._reculock&&qe.lockOwnerFor!==this},Oi.prototype.create=function(m){var y=this;if(!this.mode)return this;var _=this.db.idbdb,P=this.db._state.dbOpenError;if(w(!this.idbtrans),!m&&!_)switch(P&&P.name){case"DatabaseClosedError":throw new K.DatabaseClosed(P);case"MissingAPIError":throw new K.MissingAPI(P.message,P);default:throw new K.OpenFailed(P)}if(!this.active)throw new K.TransactionInactive;return w(this._completion._state===null),(m=this.idbtrans=m||(this.db.core||_).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=kn(function(L){bp(L),y._reject(m.error)}),m.onabort=kn(function(L){bp(L),y.active&&y._reject(new K.Abort(m.error)),y.active=!1,y.on("abort").fire(L)}),m.oncomplete=kn(function(){y.active=!1,y._resolve(),"mutatedParts"in m&&yl.storagemutated.fire(m.mutatedParts)}),this},Oi.prototype._promise=function(m,y,_){var P=this;if(m==="readwrite"&&this.mode!=="readwrite")return Kn(new K.ReadOnly("Transaction is readonly"));if(!this.active)return Kn(new K.TransactionInactive);if(this._locked())return new nt(function(j,ne){P._blockedFuncs.push([function(){P._promise(m,y,_).then(j,ne)},qe])});if(_)return Ye(function(){var j=new nt(function(ne,ue){P._lock();var Ce=y(ne,ue,P);Ce&&Ce.then&&Ce.then(ne,ue)});return j.finally(function(){return P._unlock()}),j._lib=!0,j});var L=new nt(function(j,ne){var ue=y(j,ne,P);ue&&ue.then&&ue.then(j,ne)});return L._lib=!0,L},Oi.prototype._root=function(){return this.parent?this.parent._root():this},Oi.prototype.waitFor=function(m){var y,_=this._root(),P=nt.resolve(m);_._waitingFor?_._waitingFor=_._waitingFor.then(function(){return P}):(_._waitingFor=P,_._waitingQueue=[],y=_.idbtrans.objectStore(_.storeNames[0]),function j(){for(++_._spinCount;_._waitingQueue.length;)_._waitingQueue.shift()();_._waitingFor&&(y.get(-1/0).onsuccess=j)}());var L=_._waitingFor;return new nt(function(j,ne){P.then(function(ue){return _._waitingQueue.push(kn(j.bind(null,ue)))},function(ue){return _._waitingQueue.push(kn(ne.bind(null,ue)))}).finally(function(){_._waitingFor===L&&(_._waitingFor=null)})})},Oi.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new K.Abort))},Oi.prototype.table=function(m){var y=this._memoizedTables||(this._memoizedTables={});if(d(y,m))return y[m];var _=this.schema[m];if(!_)throw new K.NotFound("Table "+m+" not part of transaction");return _=new this.db.Table(m,_,this),_.core=this.db.core.table(m),y[m]=_},Oi);function Oi(){}function x_(m,y,_,P,L,j,ne){return{name:m,keyPath:y,unique:_,multi:P,auto:L,compound:j,src:(_&&!ne?"&":"")+(P?"*":"")+(L?"++":"")+YB(y)}}function YB(m){return typeof m=="string"?m:m?"["+[].join.call(m,"+")+"]":""}function F_(m,y,_){return{name:m,primKey:y,indexes:_,mappedClass:null,idxByName:(P=function(L){return[L.name,L]},_.reduce(function(L,j,ne){return ne=P(j,ne),ne&&(L[ne[0]]=ne[1]),L},{}))};var P}var Ep=function(m){try{return m.only([[]]),Ep=function(){return[[]]},[[]]}catch{return Ep=function(){return Ai},Ai}};function P_(m){return m==null?function(){}:typeof m=="string"?(y=m).split(".").length===1?function(_){return _[y]}:function(_){return R(_,y)}:function(_){return R(_,m)};var y}function ZB(m){return[].slice.call(m)}var vbe=0;function _p(m){return m==null?":id":typeof m=="string"?m:"[".concat(m.join("+"),"]")}function ybe(m,y,Ce){function P(De){if(De.type===3)return null;if(De.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var Ee=De.lower,Te=De.upper,xe=De.lowerOpen,De=De.upperOpen;return Ee===void 0?Te===void 0?null:y.upperBound(Te,!!De):Te===void 0?y.lowerBound(Ee,!!xe):y.bound(Ee,Te,!!xe,!!De)}function L(Pe){var Ee,Te=Pe.name;return{name:Te,schema:Pe,mutate:function(xe){var De=xe.trans,Me=xe.type,$e=xe.keys,He=xe.values,Ze=xe.range;return new Promise(function(rt,mt){rt=kn(rt);var it=De.objectStore(Te),lt=it.keyPath==null,St=Me==="put"||Me==="add";if(!St&&Me!=="delete"&&Me!=="deleteRange")throw new Error("Invalid operation type: "+Me);var ft,Rt=($e||He||{length:1}).length;if($e&&He&&$e.length!==He.length)throw new Error("Given keys array must have same length as given values array.");if(Rt===0)return rt({numFailures:0,failures:{},results:[],lastResult:void 0});function Jt(ro){++Wo,bp(ro)}var sn=[],on=[],Wo=0;if(Me==="deleteRange"){if(Ze.type===4)return rt({numFailures:Wo,failures:on,results:[],lastResult:void 0});Ze.type===3?sn.push(ft=it.clear()):sn.push(ft=it.delete(P(Ze)))}else{var lt=St?lt?[He,$e]:[He,null]:[$e,null],jt=lt[0],Ks=lt[1];if(St)for(var qs=0;qs<Rt;++qs)sn.push(ft=Ks&&Ks[qs]!==void 0?it[Me](jt[qs],Ks[qs]):it[Me](jt[qs])),ft.onerror=Jt;else for(qs=0;qs<Rt;++qs)sn.push(ft=it[Me](jt[qs])),ft.onerror=Jt}function Ky(ro){ro=ro.target.result,sn.forEach(function(Mc,Y_){return Mc.error!=null&&(on[Y_]=Mc.error)}),rt({numFailures:Wo,failures:on,results:Me==="delete"?$e:sn.map(function(Mc){return Mc.result}),lastResult:ro})}ft.onerror=function(ro){Jt(ro),Ky(ro)},ft.onsuccess=Ky})},getMany:function(xe){var De=xe.trans,Me=xe.keys;return new Promise(function($e,He){$e=kn($e);for(var Ze,rt=De.objectStore(Te),mt=Me.length,it=new Array(mt),lt=0,St=0,ft=function(sn){sn=sn.target,it[sn._pos]=sn.result,++St===lt&&$e(it)},Rt=ki(He),Jt=0;Jt<mt;++Jt)Me[Jt]!=null&&((Ze=rt.get(Me[Jt]))._pos=Jt,Ze.onsuccess=ft,Ze.onerror=Rt,++lt);lt===0&&$e(it)})},get:function(xe){var De=xe.trans,Me=xe.key;return new Promise(function($e,He){$e=kn($e);var Ze=De.objectStore(Te).get(Me);Ze.onsuccess=function(rt){return $e(rt.target.result)},Ze.onerror=ki(He)})},query:(Ee=Re,function(xe){return new Promise(function(De,Me){De=kn(De);var $e,He,Ze,lt=xe.trans,rt=xe.values,mt=xe.limit,ft=xe.query,it=mt===1/0?void 0:mt,St=ft.index,ft=ft.range,lt=lt.objectStore(Te),St=St.isPrimaryKey?lt:lt.index(St.name),ft=P(ft);if(mt===0)return De({result:[]});Ee?((it=rt?St.getAll(ft,it):St.getAllKeys(ft,it)).onsuccess=function(Rt){return De({result:Rt.target.result})},it.onerror=ki(Me)):($e=0,He=!rt&&"openKeyCursor"in St?St.openKeyCursor(ft):St.openCursor(ft),Ze=[],He.onsuccess=function(Rt){var Jt=He.result;return Jt?(Ze.push(rt?Jt.value:Jt.primaryKey),++$e===mt?De({result:Ze}):void Jt.continue()):De({result:Ze})},He.onerror=ki(Me))})}),openCursor:function(xe){var De=xe.trans,Me=xe.values,$e=xe.query,He=xe.reverse,Ze=xe.unique;return new Promise(function(rt,mt){rt=kn(rt);var St=$e.index,it=$e.range,lt=De.objectStore(Te),lt=St.isPrimaryKey?lt:lt.index(St.name),St=He?Ze?"prevunique":"prev":Ze?"nextunique":"next",ft=!Me&&"openKeyCursor"in lt?lt.openKeyCursor(P(it),St):lt.openCursor(P(it),St);ft.onerror=ki(mt),ft.onsuccess=kn(function(Rt){var Jt,sn,on,Wo,jt=ft.result;jt?(jt.___id=++vbe,jt.done=!1,Jt=jt.continue.bind(jt),sn=(sn=jt.continuePrimaryKey)&&sn.bind(jt),on=jt.advance.bind(jt),Wo=function(){throw new Error("Cursor not stopped")},jt.trans=De,jt.stop=jt.continue=jt.continuePrimaryKey=jt.advance=function(){throw new Error("Cursor not started")},jt.fail=kn(mt),jt.next=function(){var Ks=this,qs=1;return this.start(function(){return qs--?Ks.continue():Ks.stop()}).then(function(){return Ks})},jt.start=function(Ks){function qs(){if(ft.result)try{Ks()}catch(ro){jt.fail(ro)}else jt.done=!0,jt.start=function(){throw new Error("Cursor behind last entry")},jt.stop()}var Ky=new Promise(function(ro,Mc){ro=kn(ro),ft.onerror=ki(Mc),jt.fail=Mc,jt.stop=function(Y_){jt.stop=jt.continue=jt.continuePrimaryKey=jt.advance=Wo,ro(Y_)}});return ft.onsuccess=kn(function(ro){ft.onsuccess=qs,qs()}),jt.continue=Jt,jt.continuePrimaryKey=sn,jt.advance=on,qs(),Ky},rt(jt)):rt(null)},mt)})},count:function(xe){var De=xe.query,Me=xe.trans,$e=De.index,He=De.range;return new Promise(function(Ze,rt){var mt=Me.objectStore(Te),it=$e.isPrimaryKey?mt:mt.index($e.name),mt=P(He),it=mt?it.count(mt):it.count();it.onsuccess=kn(function(lt){return Ze(lt.target.result)}),it.onerror=ki(rt)})}}}var j,ne,ue,Ie=(ne=Ce,ue=ZB((j=m).objectStoreNames),{schema:{name:j.name,tables:ue.map(function(Pe){return ne.objectStore(Pe)}).map(function(Pe){var Ee=Pe.keyPath,De=Pe.autoIncrement,Te=a(Ee),xe={},De={name:Pe.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:Ee==null,compound:Te,keyPath:Ee,autoIncrement:De,unique:!0,extractKey:P_(Ee)},indexes:ZB(Pe.indexNames).map(function(Me){return Pe.index(Me)}).map(function(Ze){var $e=Ze.name,He=Ze.unique,rt=Ze.multiEntry,Ze=Ze.keyPath,rt={name:$e,compound:a(Ze),keyPath:Ze,unique:He,multiEntry:rt,extractKey:P_(Ze)};return xe[_p(Ze)]=rt}),getIndexByKeyPath:function(Me){return xe[_p(Me)]}};return xe[":id"]=De.primaryKey,Ee!=null&&(xe[_p(Ee)]=De.primaryKey),De})},hasGetAll:0<ue.length&&"getAll"in ne.objectStore(ue[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),Ce=Ie.schema,Re=Ie.hasGetAll,Ie=Ce.tables.map(L),he={};return Ie.forEach(function(Pe){return he[Pe.name]=Pe}),{stack:"dbcore",transaction:m.transaction.bind(m),table:function(Pe){if(!he[Pe])throw new Error("Table '".concat(Pe,"' not found"));return he[Pe]},MIN_KEY:-1/0,MAX_KEY:Ep(y),schema:Ce}}function wbe(m,y,_,P){var L=_.IDBKeyRange;return _.indexedDB,{dbcore:(P=ybe(y,L,P),m.dbcore.reduce(function(j,ne){return ne=ne.create,s(s({},j),ne(j))},P))}}function My(m,P){var _=P.db,P=wbe(m._middlewares,_,m._deps,P);m.core=P.dbcore,m.tables.forEach(function(L){var j=L.name;m.core.schema.tables.some(function(ne){return ne.name===j})&&(L.core=m.core.table(j),m[j]instanceof m.Table&&(m[j].core=L.core))})}function Ny(m,y,_,P){_.forEach(function(L){var j=P[L];y.forEach(function(ne){var ue=function Ce(Re,Ie){return v(Re,Ie)||(Re=c(Re))&&Ce(Re,Ie)}(ne,L);(!ue||"value"in ue&&ue.value===void 0)&&(ne===m.Transaction.prototype||ne instanceof m.Transaction?p(ne,L,{get:function(){return this.table(L)},set:function(Ce){f(this,L,{value:Ce,writable:!0,configurable:!0,enumerable:!0})}}):ne[L]=new m.Table(L,j))})})}function A_(m,y){y.forEach(function(_){for(var P in _)_[P]instanceof m.Table&&delete _[P]})}function Cbe(m,y){return m._cfg.version-y._cfg.version}function bbe(m,y,_,P){var L=m._dbSchema;_.objectStoreNames.contains("$meta")&&!L.$meta&&(L.$meta=F_("$meta",JB("")[0],[]),m._storeNames.push("$meta"));var j=m._createTransaction("readwrite",m._storeNames,L);j.create(_),j._completion.catch(P);var ne=j._reject.bind(j),ue=qe.transless||qe;Ye(function(){return qe.trans=j,qe.transless=ue,y!==0?(My(m,_),Re=y,((Ce=j).storeNames.includes("$meta")?Ce.table("$meta").get("version").then(function(Ie){return Ie??Re}):nt.resolve(Re)).then(function(Ie){return Pe=Ie,Ee=j,Te=_,xe=[],Ie=(he=m)._versions,De=he._dbSchema=Vy(0,he.idbdb,Te),(Ie=Ie.filter(function(Me){return Me._cfg.version>=Pe})).length!==0?(Ie.forEach(function(Me){xe.push(function(){var $e=De,He=Me._cfg.dbschema;By(he,$e,Te),By(he,He,Te),De=he._dbSchema=He;var Ze=k_($e,He);Ze.add.forEach(function(St){O_(Te,St[0],St[1].primKey,St[1].indexes)}),Ze.change.forEach(function(St){if(St.recreate)throw new K.Upgrade("Not yet support for changing primary key");var ft=Te.objectStore(St.name);St.add.forEach(function(Rt){return Ly(ft,Rt)}),St.change.forEach(function(Rt){ft.deleteIndex(Rt.name),Ly(ft,Rt)}),St.del.forEach(function(Rt){return ft.deleteIndex(Rt)})});var rt=Me._cfg.contentUpgrade;if(rt&&Me._cfg.version>Pe){My(he,Te),Ee._memoizedTables={};var mt=I(He);Ze.del.forEach(function(St){mt[St]=$e[St]}),A_(he,[he.Transaction.prototype]),Ny(he,[he.Transaction.prototype],i(mt),mt),Ee.schema=mt;var it,lt=ee(rt);return lt&&Qt(),Ze=nt.follow(function(){var St;(it=rt(Ee))&<&&(St=Xt.bind(null,null),it.then(St,St))}),it&&typeof it.then=="function"?nt.resolve(it):Ze.then(function(){return it})}}),xe.push(function($e){var He,Ze,rt=Me._cfg.dbschema;He=rt,Ze=$e,[].slice.call(Ze.db.objectStoreNames).forEach(function(mt){return He[mt]==null&&Ze.db.deleteObjectStore(mt)}),A_(he,[he.Transaction.prototype]),Ny(he,[he.Transaction.prototype],he._storeNames,he._dbSchema),Ee.schema=he._dbSchema}),xe.push(function($e){he.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(he.idbdb.version/10)===Me._cfg.version?(he.idbdb.deleteObjectStore("$meta"),delete he._dbSchema.$meta,he._storeNames=he._storeNames.filter(function(He){return He!=="$meta"})):$e.objectStore("$meta").put(Me._cfg.version,"version"))})}),function Me(){return xe.length?nt.resolve(xe.shift()(Ee.idbtrans)).then(Me):nt.resolve()}().then(function(){XB(De,Te)})):nt.resolve();var he,Pe,Ee,Te,xe,De}).catch(ne)):(i(L).forEach(function(Ie){O_(_,Ie,L[Ie].primKey,L[Ie].indexes)}),My(m,_),void nt.follow(function(){return m.on.populate.fire(j)}).catch(ne));var Ce,Re})}function Sbe(m,y){XB(m._dbSchema,y),y.db.version%10!=0||y.objectStoreNames.contains("$meta")||y.db.createObjectStore("$meta").add(Math.ceil(y.db.version/10-1),"version");var _=Vy(0,m.idbdb,y);By(m,m._dbSchema,y);for(var P=0,L=k_(_,m._dbSchema).change;P<L.length;P++){var j=function(ne){if(ne.change.length||ne.recreate)return console.warn("Unable to patch indexes of table ".concat(ne.name," because it has changes on the type of index or primary key.")),{value:void 0};var ue=y.objectStore(ne.name);ne.add.forEach(function(Ce){$&&console.debug("Dexie upgrade patch: Creating missing index ".concat(ne.name,".").concat(Ce.src)),Ly(ue,Ce)})}(L[P]);if(typeof j=="object")return j.value}}function k_(m,y){var _,P={del:[],add:[],change:[]};for(_ in m)y[_]||P.del.push(_);for(_ in y){var L=m[_],j=y[_];if(L){var ne={name:_,def:j,recreate:!1,del:[],add:[],change:[]};if(""+(L.primKey.keyPath||"")!=""+(j.primKey.keyPath||"")||L.primKey.auto!==j.primKey.auto)ne.recreate=!0,P.change.push(ne);else{var ue=L.idxByName,Ce=j.idxByName,Re=void 0;for(Re in ue)Ce[Re]||ne.del.push(Re);for(Re in Ce){var Ie=ue[Re],he=Ce[Re];Ie?Ie.src!==he.src&&ne.change.push(he):ne.add.push(he)}(0<ne.del.length||0<ne.add.length||0<ne.change.length)&&P.change.push(ne)}}else P.add.push([_,j])}return P}function O_(m,y,_,P){var L=m.db.createObjectStore(y,_.keyPath?{keyPath:_.keyPath,autoIncrement:_.auto}:{autoIncrement:_.auto});return P.forEach(function(j){return Ly(L,j)}),L}function XB(m,y){i(m).forEach(function(_){y.db.objectStoreNames.contains(_)||($&&console.debug("Dexie: Creating missing table",_),O_(y,_,m[_].primKey,m[_].indexes))})}function Ly(m,y){m.createIndex(y.name,y.keyPath,{unique:y.unique,multiEntry:y.multi})}function Vy(m,y,_){var P={};return S(y.objectStoreNames,0).forEach(function(L){for(var j=_.objectStore(L),ne=x_(YB(Re=j.keyPath),Re||"",!0,!1,!!j.autoIncrement,Re&&typeof Re!="string",!0),ue=[],Ce=0;Ce<j.indexNames.length;++Ce){var Ie=j.index(j.indexNames[Ce]),Re=Ie.keyPath,Ie=x_(Ie.name,Re,!!Ie.unique,!!Ie.multiEntry,!1,Re&&typeof Re!="string",!1);ue.push(Ie)}P[L]=F_(L,ne,ue)}),P}function By(m,y,_){for(var P=_.db.objectStoreNames,L=0;L<P.length;++L){var j=P[L],ne=_.objectStore(j);m._hasGetAll="getAll"in ne;for(var ue=0;ue<ne.indexNames.length;++ue){var Ce=ne.indexNames[ue],Re=ne.index(Ce).keyPath,Ie=typeof Re=="string"?Re:"["+S(Re).join("+")+"]";!y[j]||(Re=y[j].idxByName[Ie])&&(Re.name=Ce,delete y[j].idxByName[Ie],y[j].idxByName[Ce]=Re)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&r.WorkerGlobalScope&&r instanceof r.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(m._hasGetAll=!1)}function JB(m){return m.split(",").map(function(y,_){var P=(y=y.trim()).replace(/([&*]|\+\+)/g,""),L=/^\[/.test(P)?P.match(/^\[(.*)\]$/)[1].split("+"):P;return x_(P,L||null,/\&/.test(y),/\*/.test(y),/\+\+/.test(y),a(L),_===0)})}var Ebe=($y.prototype._parseStoresSpec=function(m,y){i(m).forEach(function(_){if(m[_]!==null){var P=JB(m[_]),L=P.shift();if(L.unique=!0,L.multi)throw new K.Schema("Primary key cannot be multi-valued");P.forEach(function(j){if(j.auto)throw new K.Schema("Only primary key can be marked as autoIncrement (++)");if(!j.keyPath)throw new K.Schema("Index must have a name and cannot be an empty string")}),y[_]=F_(_,L,P)}})},$y.prototype.stores=function(_){var y=this.db;this._cfg.storesSource=this._cfg.storesSource?l(this._cfg.storesSource,_):_;var _=y._versions,P={},L={};return _.forEach(function(j){l(P,j._cfg.storesSource),L=j._cfg.dbschema={},j._parseStoresSpec(P,L)}),y._dbSchema=L,A_(y,[y._allTables,y,y.Transaction.prototype]),Ny(y,[y._allTables,y,y.Transaction.prototype,this._cfg.tables],i(L),L),y._storeNames=i(L),this},$y.prototype.upgrade=function(m){return this._cfg.contentUpgrade=N(this._cfg.contentUpgrade||Se,m),this},$y);function $y(){}function M_(m,y){var _=m._dbNamesDB;return _||(_=m._dbNamesDB=new Sa(Fy,{addons:[],indexedDB:m,IDBKeyRange:y})).version(1).stores({dbnames:"name"}),_.table("dbnames")}function N_(m){return m&&typeof m.databases=="function"}function L_(m){return Ye(function(){return qe.letThrough=!0,m()})}function V_(m){return!("from"in m)}var js=function(m,y){if(!this){var _=new js;return m&&"d"in m&&l(_,m),_}l(this,arguments.length?{d:1,from:m,to:1<arguments.length?y:m}:{d:0})};function Rp(m,y,_){var P=ln(y,_);if(!isNaN(P)){if(0<P)throw RangeError();if(V_(m))return l(m,{from:y,to:_,d:1});var L=m.l,P=m.r;if(ln(_,m.from)<0)return L?Rp(L,y,_):m.l={from:y,to:_,d:1,l:null,r:null},e$(m);if(0<ln(y,m.to))return P?Rp(P,y,_):m.r={from:y,to:_,d:1,l:null,r:null},e$(m);ln(y,m.from)<0&&(m.from=y,m.l=null,m.d=P?P.d+1:1),0<ln(_,m.to)&&(m.to=_,m.r=null,m.d=m.l?m.l.d+1:1),_=!m.r,L&&!m.l&&Dp(m,L),P&&_&&Dp(m,P)}}function Dp(m,y){V_(y)||function _(P,Ce){var j=Ce.from,ne=Ce.to,ue=Ce.l,Ce=Ce.r;Rp(P,j,ne),ue&&_(P,ue),Ce&&_(P,Ce)}(m,y)}function QB(m,y){var _=Hy(y),P=_.next();if(P.done)return!1;for(var L=P.value,j=Hy(m),ne=j.next(L.from),ue=ne.value;!P.done&&!ne.done;){if(ln(ue.from,L.to)<=0&&0<=ln(ue.to,L.from))return!0;ln(L.from,ue.from)<0?L=(P=_.next(ue.from)).value:ue=(ne=j.next(L.from)).value}return!1}function Hy(m){var y=V_(m)?null:{s:0,n:m};return{next:function(_){for(var P=0<arguments.length;y;)switch(y.s){case 0:if(y.s=1,P)for(;y.n.l&&ln(_,y.n.from)<0;)y={up:y,n:y.n.l,s:1};else for(;y.n.l;)y={up:y,n:y.n.l,s:1};case 1:if(y.s=2,!P||ln(_,y.n.to)<=0)return{value:y.n,done:!1};case 2:if(y.n.r){y.s=3,y={up:y,n:y.n.r,s:0};continue}case 3:y=y.up}return{done:!0}}}}function e$(m){var y,_,P=(((y=m.r)===null||y===void 0?void 0:y.d)||0)-(((_=m.l)===null||_===void 0?void 0:_.d)||0),L=1<P?"r":P<-1?"l":"";L&&(y=L=="r"?"l":"r",_=s({},m),P=m[L],m.from=P.from,m.to=P.to,m[L]=P[L],_[L]=P[y],(m[y]=_).d=t$(_)),m.d=t$(m)}function t$(_){var y=_.r,_=_.l;return(y?_?Math.max(y.d,_.d):y.d:_?_.d:0)+1}function Gy(m,y){return i(y).forEach(function(_){m[_]?Dp(m[_],y[_]):m[_]=function P(L){var j,ne,ue={};for(j in L)d(L,j)&&(ne=L[j],ue[j]=!ne||typeof ne!="object"||E.has(ne.constructor)?ne:P(ne));return ue}(y[_])}),m}function B_(m,y){return m.all||y.all||Object.keys(m).some(function(_){return y[_]&&QB(y[_],m[_])})}h(js.prototype,((vr={add:function(m){return Dp(this,m),this},addKey:function(m){return Rp(this,m,m),this},addKeys:function(m){var y=this;return m.forEach(function(_){return Rp(y,_,_)}),this},hasKey:function(m){var y=Hy(this).next(m).value;return y&&ln(y.from,m)<=0&&0<=ln(y.to,m)}})[W]=function(){return Hy(this)},vr));var kc={},$_={},H_=!1;function Uy(m){Gy($_,m),H_||(H_=!0,setTimeout(function(){H_=!1,G_($_,!($_={}))},0))}function G_(m,y){y===void 0&&(y=!1);var _=new Set;if(m.all)for(var P=0,L=Object.values(kc);P<L.length;P++)n$(ne=L[P],m,_,y);else for(var j in m){var ne,ue=/^idb\:\/\/(.*)\/(.*)\//.exec(j);ue&&(j=ue[1],ue=ue[2],(ne=kc["idb://".concat(j,"/").concat(ue)])&&n$(ne,m,_,y))}_.forEach(function(Ce){return Ce()})}function n$(m,y,_,P){for(var L=[],j=0,ne=Object.entries(m.queries.query);j<ne.length;j++){for(var ue=ne[j],Ce=ue[0],Re=[],Ie=0,he=ue[1];Ie<he.length;Ie++){var Pe=he[Ie];B_(y,Pe.obsSet)?Pe.subscribers.forEach(function(De){return _.add(De)}):P&&Re.push(Pe)}P&&L.push([Ce,Re])}if(P)for(var Ee=0,Te=L;Ee<Te.length;Ee++){var xe=Te[Ee],Ce=xe[0],Re=xe[1];m.queries.query[Ce]=Re}}function _be(m){var y=m._state,_=m._deps.indexedDB;if(y.isBeingOpened||m.idbdb)return y.dbReadyPromise.then(function(){return y.dbOpenError?Kn(y.dbOpenError):m});y.isBeingOpened=!0,y.dbOpenError=null,y.openComplete=!1;var P=y.openCanceller,L=Math.round(10*m.verno),j=!1;function ne(){if(y.openCanceller!==P)throw new K.DatabaseClosed("db.open() was cancelled")}function ue(){return new nt(function(Pe,Ee){if(ne(),!_)throw new K.MissingAPI;var Te=m.name,xe=y.autoSchema||!L?_.open(Te):_.open(Te,L);if(!xe)throw new K.MissingAPI;xe.onerror=ki(Ee),xe.onblocked=kn(m._fireOnBlocked),xe.onupgradeneeded=kn(function(De){var Me;Ie=xe.transaction,y.autoSchema&&!m._options.allowEmptyDB?(xe.onerror=bp,Ie.abort(),xe.result.close(),(Me=_.deleteDatabase(Te)).onsuccess=Me.onerror=kn(function(){Ee(new K.NoSuchDatabase("Database ".concat(Te," doesnt exist")))})):(Ie.onerror=ki(Ee),De=De.oldVersion>Math.pow(2,62)?0:De.oldVersion,he=De<1,m.idbdb=xe.result,j&&Sbe(m,Ie),bbe(m,De/10,Ie,Ee))},Ee),xe.onsuccess=kn(function(){Ie=null;var De,Me,$e,He,Ze,rt=m.idbdb=xe.result,mt=S(rt.objectStoreNames);if(0<mt.length)try{var it=rt.transaction((He=mt).length===1?He[0]:He,"readonly");if(y.autoSchema)Me=rt,$e=it,(De=m).verno=Me.version/10,$e=De._dbSchema=Vy(0,Me,$e),De._storeNames=S(Me.objectStoreNames,0),Ny(De,[De._allTables],i($e),$e);else if(By(m,m._dbSchema,it),((Ze=k_(Vy(0,(Ze=m).idbdb,it),Ze._dbSchema)).add.length||Ze.change.some(function(lt){return lt.add.length||lt.change.length}))&&!j)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),rt.close(),L=rt.version+1,j=!0,Pe(ue());My(m,it)}catch{}Md.push(m),rt.onversionchange=kn(function(lt){y.vcFired=!0,m.on("versionchange").fire(lt)}),rt.onclose=kn(function(lt){m.on("close").fire(lt)}),he&&(Ze=m._deps,it=Te,rt=Ze.indexedDB,Ze=Ze.IDBKeyRange,N_(rt)||it===Fy||M_(rt,Ze).put({name:it}).catch(Se)),Pe()},Ee)}).catch(function(Pe){switch(Pe==null?void 0:Pe.name){case"UnknownError":if(0<y.PR1398_maxLoop)return y.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),ue();break;case"VersionError":if(0<L)return L=0,ue()}return nt.reject(Pe)})}var Ce,Re=y.dbReadyResolve,Ie=null,he=!1;return nt.race([P,(typeof navigator>"u"?nt.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Pe){function Ee(){return indexedDB.databases().finally(Pe)}Ce=setInterval(Ee,100),Ee()}).finally(function(){return clearInterval(Ce)}):Promise.resolve()).then(ue)]).then(function(){return ne(),y.onReadyBeingFired=[],nt.resolve(L_(function(){return m.on.ready.fire(m.vip)})).then(function Pe(){if(0<y.onReadyBeingFired.length){var Ee=y.onReadyBeingFired.reduce(N,Se);return y.onReadyBeingFired=[],nt.resolve(L_(function(){return Ee(m.vip)})).then(Pe)}})}).finally(function(){y.openCanceller===P&&(y.onReadyBeingFired=null,y.isBeingOpened=!1)}).catch(function(Pe){y.dbOpenError=Pe;try{Ie&&Ie.abort()}catch{}return P===y.openCanceller&&m._close(),Kn(Pe)}).finally(function(){y.openComplete=!0,Re()}).then(function(){var Pe;return he&&(Pe={},m.tables.forEach(function(Ee){Ee.schema.indexes.forEach(function(Te){Te.name&&(Pe["idb://".concat(m.name,"/").concat(Ee.name,"/").concat(Te.name)]=new js(-1/0,[[[]]]))}),Pe["idb://".concat(m.name,"/").concat(Ee.name,"/")]=Pe["idb://".concat(m.name,"/").concat(Ee.name,"/:dels")]=new js(-1/0,[[[]]])}),yl(Sp).fire(Pe),G_(Pe,!0)),m})}function U_(m){function y(j){return m.next(j)}var _=L(y),P=L(function(j){return m.throw(j)});function L(j){return function(Ce){var ue=j(Ce),Ce=ue.value;return ue.done?Ce:Ce&&typeof Ce.then=="function"?Ce.then(_,P):a(Ce)?Promise.all(Ce).then(_,P):_(Ce)}}return L(y)()}function Wy(m,y,_){for(var P=a(m)?m.slice():[m],L=0;L<_;++L)P.push(y);return P}var Rbe={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(m){return s(s({},m),{table:function(y){var _=m.table(y),P=_.schema,L={},j=[];function ne(he,Pe,Ee){var Te=_p(he),xe=L[Te]=L[Te]||[],De=he==null?0:typeof he=="string"?1:he.length,Me=0<Pe,Me=s(s({},Ee),{name:Me?"".concat(Te,"(virtual-from:").concat(Ee.name,")"):Ee.name,lowLevelIndex:Ee,isVirtual:Me,keyTail:Pe,keyLength:De,extractKey:P_(he),unique:!Me&&Ee.unique});return xe.push(Me),Me.isPrimaryKey||j.push(Me),1<De&&ne(De===2?he[0]:he.slice(0,De-1),Pe+1,Ee),xe.sort(function($e,He){return $e.keyTail-He.keyTail}),Me}y=ne(P.primaryKey.keyPath,0,P.primaryKey),L[":id"]=[y];for(var ue=0,Ce=P.indexes;ue<Ce.length;ue++){var Re=Ce[ue];ne(Re.keyPath,0,Re)}function Ie(he){var Pe,Ee=he.query.index;return Ee.isVirtual?s(s({},he),{query:{index:Ee.lowLevelIndex,range:(Pe=he.query.range,Ee=Ee.keyTail,{type:Pe.type===1?2:Pe.type,lower:Wy(Pe.lower,Pe.lowerOpen?m.MAX_KEY:m.MIN_KEY,Ee),lowerOpen:!0,upper:Wy(Pe.upper,Pe.upperOpen?m.MIN_KEY:m.MAX_KEY,Ee),upperOpen:!0})}}):he}return s(s({},_),{schema:s(s({},P),{primaryKey:y,indexes:j,getIndexByKeyPath:function(he){return(he=L[_p(he)])&&he[0]}}),count:function(he){return _.count(Ie(he))},query:function(he){return _.query(Ie(he))},openCursor:function(he){var Pe=he.query.index,Ee=Pe.keyTail,Te=Pe.isVirtual,xe=Pe.keyLength;return Te?_.openCursor(Ie(he)).then(function(Me){return Me&&De(Me)}):_.openCursor(he);function De(Me){return Object.create(Me,{continue:{value:function($e){$e!=null?Me.continue(Wy($e,he.reverse?m.MAX_KEY:m.MIN_KEY,Ee)):he.unique?Me.continue(Me.key.slice(0,xe).concat(he.reverse?m.MIN_KEY:m.MAX_KEY,Ee)):Me.continue()}},continuePrimaryKey:{value:function($e,He){Me.continuePrimaryKey(Wy($e,m.MAX_KEY,Ee),He)}},primaryKey:{get:function(){return Me.primaryKey}},key:{get:function(){var $e=Me.key;return xe===1?$e[0]:$e.slice(0,xe)}},value:{get:function(){return Me.value}}})}}})}})}};function W_(m,y,_,P){return _=_||{},P=P||"",i(m).forEach(function(L){var j,ne,ue;d(y,L)?(j=m[L],ne=y[L],typeof j=="object"&&typeof ne=="object"&&j&&ne?(ue=O(j))!==O(ne)?_[P+L]=y[L]:ue==="Object"?W_(j,ne,_,P+L+"."):j!==ne&&(_[P+L]=y[L]):j!==ne&&(_[P+L]=y[L])):_[P+L]=void 0}),i(y).forEach(function(L){d(m,L)||(_[P+L]=y[L])}),_}function z_(m,y){return y.type==="delete"?y.keys:y.keys||y.values.map(m.extractKey)}var Dbe={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(m){return s(s({},m),{table:function(y){var _=m.table(y),P=_.schema.primaryKey;return s(s({},_),{mutate:function(L){var j=qe.trans,ne=j.table(y).hook,ue=ne.deleting,Ce=ne.creating,Re=ne.updating;switch(L.type){case"add":if(Ce.fire===Se)break;return j._promise("readwrite",function(){return Ie(L)},!0);case"put":if(Ce.fire===Se&&Re.fire===Se)break;return j._promise("readwrite",function(){return Ie(L)},!0);case"delete":if(ue.fire===Se)break;return j._promise("readwrite",function(){return Ie(L)},!0);case"deleteRange":if(ue.fire===Se)break;return j._promise("readwrite",function(){return function he(Pe,Ee,Te){return _.query({trans:Pe,values:!1,query:{index:P,range:Ee},limit:Te}).then(function(xe){var De=xe.result;return Ie({type:"delete",keys:De,trans:Pe}).then(function(Me){return 0<Me.numFailures?Promise.reject(Me.failures[0]):De.length<Te?{failures:[],numFailures:0,lastResult:void 0}:he(Pe,s(s({},Ee),{lower:De[De.length-1],lowerOpen:!0}),Te)})})}(L.trans,L.range,1e4)},!0)}return _.mutate(L);function Ie(he){var Pe,Ee,Te,xe=qe.trans,De=he.keys||z_(P,he);if(!De)throw new Error("Keys missing");return(he=he.type==="add"||he.type==="put"?s(s({},he),{keys:De}):s({},he)).type!=="delete"&&(he.values=o([],he.values)),he.keys&&(he.keys=o([],he.keys)),Pe=_,Te=De,((Ee=he).type==="add"?Promise.resolve([]):Pe.getMany({trans:Ee.trans,keys:Te,cache:"immutable"})).then(function(Me){var $e=De.map(function(He,Ze){var rt,mt,it,lt=Me[Ze],St={onerror:null,onsuccess:null};return he.type==="delete"?ue.fire.call(St,He,lt,xe):he.type==="add"||lt===void 0?(rt=Ce.fire.call(St,He,he.values[Ze],xe),He==null&&rt!=null&&(he.keys[Ze]=He=rt,P.outbound||T(he.values[Ze],P.keyPath,He))):(rt=W_(lt,he.values[Ze]),(mt=Re.fire.call(St,rt,He,lt,xe))&&(it=he.values[Ze],Object.keys(mt).forEach(function(ft){d(it,ft)?it[ft]=mt[ft]:T(it,ft,mt[ft])}))),St});return _.mutate(he).then(function(He){for(var Ze=He.failures,rt=He.results,mt=He.numFailures,He=He.lastResult,it=0;it<De.length;++it){var lt=(rt||De)[it],St=$e[it];lt==null?St.onerror&&St.onerror(Ze[it]):St.onsuccess&&St.onsuccess(he.type==="put"&&Me[it]?he.values[it]:lt)}return{failures:Ze,results:rt,numFailures:mt,lastResult:He}}).catch(function(He){return $e.forEach(function(Ze){return Ze.onerror&&Ze.onerror(He)}),Promise.reject(He)})})}}})}})}};function s$(m,y,_){try{if(!y||y.keys.length<m.length)return null;for(var P=[],L=0,j=0;L<y.keys.length&&j<m.length;++L)ln(y.keys[L],m[j])===0&&(P.push(_?k(y.values[L]):y.values[L]),++j);return P.length===m.length?P:null}catch{return null}}var Tbe={stack:"dbcore",level:-1,create:function(m){return{table:function(y){var _=m.table(y);return s(s({},_),{getMany:function(P){if(!P.cache)return _.getMany(P);var L=s$(P.keys,P.trans._cache,P.cache==="clone");return L?nt.resolve(L):_.getMany(P).then(function(j){return P.trans._cache={keys:P.keys,values:P.cache==="clone"?k(j):j},j})},mutate:function(P){return P.type!=="add"&&(P.trans._cache=null),_.mutate(P)}})}}}};function o$(m,y){return m.trans.mode==="readonly"&&!!m.subscr&&!m.trans.explicit&&m.trans.db._options.cache!=="disabled"&&!y.schema.primaryKey.outbound}function r$(m,y){switch(m){case"query":return y.values&&!y.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Ibe={stack:"dbcore",level:0,name:"Observability",create:function(m){var y=m.schema.name,_=new js(m.MIN_KEY,m.MAX_KEY);return s(s({},m),{transaction:function(P,L,j){if(qe.subscr&&L!=="readonly")throw new K.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(qe.querier));return m.transaction(P,L,j)},table:function(P){var L=m.table(P),j=L.schema,ne=j.primaryKey,he=j.indexes,ue=ne.extractKey,Ce=ne.outbound,Re=ne.autoIncrement&&he.filter(function(Ee){return Ee.compound&&Ee.keyPath.includes(ne.keyPath)}),Ie=s(s({},L),{mutate:function(Ee){function Te(ft){return ft="idb://".concat(y,"/").concat(P,"/").concat(ft),He[ft]||(He[ft]=new js)}var xe,De,Me,$e=Ee.trans,He=Ee.mutatedParts||(Ee.mutatedParts={}),Ze=Te(""),rt=Te(":dels"),mt=Ee.type,St=Ee.type==="deleteRange"?[Ee.range]:Ee.type==="delete"?[Ee.keys]:Ee.values.length<50?[z_(ne,Ee).filter(function(ft){return ft}),Ee.values]:[],it=St[0],lt=St[1],St=Ee.trans._cache;return a(it)?(Ze.addKeys(it),(St=mt==="delete"||it.length===lt.length?s$(it,St):null)||rt.addKeys(it),(St||lt)&&(xe=Te,De=St,Me=lt,j.indexes.forEach(function(ft){var Rt=xe(ft.name||"");function Jt(on){return on!=null?ft.extractKey(on):null}function sn(on){return ft.multiEntry&&a(on)?on.forEach(function(Wo){return Rt.addKey(Wo)}):Rt.addKey(on)}(De||Me).forEach(function(on,Ks){var jt=De&&Jt(De[Ks]),Ks=Me&&Jt(Me[Ks]);ln(jt,Ks)!==0&&(jt!=null&&sn(jt),Ks!=null&&sn(Ks))})}))):it?(lt={from:(lt=it.lower)!==null&<!==void 0?lt:m.MIN_KEY,to:(lt=it.upper)!==null&<!==void 0?lt:m.MAX_KEY},rt.add(lt),Ze.add(lt)):(Ze.add(_),rt.add(_),j.indexes.forEach(function(ft){return Te(ft.name).add(_)})),L.mutate(Ee).then(function(ft){return!it||Ee.type!=="add"&&Ee.type!=="put"||(Ze.addKeys(ft.results),Re&&Re.forEach(function(Rt){for(var Jt=Ee.values.map(function(jt){return Rt.extractKey(jt)}),sn=Rt.keyPath.findIndex(function(jt){return jt===ne.keyPath}),on=0,Wo=ft.results.length;on<Wo;++on)Jt[on][sn]=ft.results[on];Te(Rt.name).addKeys(Jt)})),$e.mutatedParts=Gy($e.mutatedParts||{},He),ft})}}),he=function(Te){var xe=Te.query,Te=xe.index,xe=xe.range;return[Te,new js((Te=xe.lower)!==null&&Te!==void 0?Te:m.MIN_KEY,(xe=xe.upper)!==null&&xe!==void 0?xe:m.MAX_KEY)]},Pe={get:function(Ee){return[ne,new js(Ee.key)]},getMany:function(Ee){return[ne,new js().addKeys(Ee.keys)]},count:he,query:he,openCursor:he};return i(Pe).forEach(function(Ee){Ie[Ee]=function(Te){var xe=qe.subscr,De=!!xe,Me=o$(qe,L)&&r$(Ee,Te)?Te.obsSet={}:xe;if(De){var $e=function(lt){return lt="idb://".concat(y,"/").concat(P,"/").concat(lt),Me[lt]||(Me[lt]=new js)},He=$e(""),Ze=$e(":dels"),xe=Pe[Ee](Te),De=xe[0],xe=xe[1];if((Ee==="query"&&De.isPrimaryKey&&!Te.values?Ze:$e(De.name||"")).add(xe),!De.isPrimaryKey){if(Ee!=="count"){var rt=Ee==="query"&&Ce&&Te.values&&L.query(s(s({},Te),{values:!1}));return L[Ee].apply(this,arguments).then(function(lt){if(Ee==="query"){if(Ce&&Te.values)return rt.then(function(Jt){return Jt=Jt.result,He.addKeys(Jt),lt});var St=Te.values?lt.result.map(ue):lt.result;(Te.values?He:Ze).addKeys(St)}else if(Ee==="openCursor"){var ft=lt,Rt=Te.values;return ft&&Object.create(ft,{key:{get:function(){return Ze.addKey(ft.primaryKey),ft.key}},primaryKey:{get:function(){var Jt=ft.primaryKey;return Ze.addKey(Jt),Jt}},value:{get:function(){return Rt&&He.addKey(ft.primaryKey),ft.value}}})}return lt})}Ze.add(_)}}return L[Ee].apply(this,arguments)}}),Ie}})}};function i$(m,y,_){if(_.numFailures===0)return y;if(y.type==="deleteRange")return null;var P=y.keys?y.keys.length:"values"in y&&y.values?y.values.length:1;return _.numFailures===P?null:(y=s({},y),a(y.keys)&&(y.keys=y.keys.filter(function(L,j){return!(j in _.failures)})),"values"in y&&a(y.values)&&(y.values=y.values.filter(function(L,j){return!(j in _.failures)})),y)}function j_(m,y){return _=m,((P=y).lower===void 0||(P.lowerOpen?0<ln(_,P.lower):0<=ln(_,P.lower)))&&(m=m,(y=y).upper===void 0||(y.upperOpen?ln(m,y.upper)<0:ln(m,y.upper)<=0));var _,P}function a$(m,y,Pe,P,L,j){if(!Pe||Pe.length===0)return m;var ne=y.query.index,ue=ne.multiEntry,Ce=y.query.range,Re=P.schema.primaryKey.extractKey,Ie=ne.extractKey,he=(ne.lowLevelIndex||ne).extractKey,Pe=Pe.reduce(function(Ee,Te){var xe=Ee,De=[];if(Te.type==="add"||Te.type==="put")for(var Me=new js,$e=Te.values.length-1;0<=$e;--$e){var He,Ze=Te.values[$e],rt=Re(Ze);Me.hasKey(rt)||(He=Ie(Ze),(ue&&a(He)?He.some(function(ft){return j_(ft,Ce)}):j_(He,Ce))&&(Me.addKey(rt),De.push(Ze)))}switch(Te.type){case"add":var mt=new js().addKeys(y.values?Ee.map(function(Rt){return Re(Rt)}):Ee),xe=Ee.concat(y.values?De.filter(function(Rt){return Rt=Re(Rt),!mt.hasKey(Rt)&&(mt.addKey(Rt),!0)}):De.map(function(Rt){return Re(Rt)}).filter(function(Rt){return!mt.hasKey(Rt)&&(mt.addKey(Rt),!0)}));break;case"put":var it=new js().addKeys(Te.values.map(function(Rt){return Re(Rt)}));xe=Ee.filter(function(Rt){return!it.hasKey(y.values?Re(Rt):Rt)}).concat(y.values?De:De.map(function(Rt){return Re(Rt)}));break;case"delete":var lt=new js().addKeys(Te.keys);xe=Ee.filter(function(Rt){return!lt.hasKey(y.values?Re(Rt):Rt)});break;case"deleteRange":var St=Te.range;xe=Ee.filter(function(Rt){return!j_(Re(Rt),St)})}return xe},m);return Pe===m?m:(Pe.sort(function(Ee,Te){return ln(he(Ee),he(Te))||ln(Re(Ee),Re(Te))}),y.limit&&y.limit<1/0&&(Pe.length>y.limit?Pe.length=y.limit:m.length===y.limit&&Pe.length<y.limit&&(L.dirty=!0)),j?Object.freeze(Pe):Pe)}function l$(m,y){return ln(m.lower,y.lower)===0&&ln(m.upper,y.upper)===0&&!!m.lowerOpen==!!y.lowerOpen&&!!m.upperOpen==!!y.upperOpen}function xbe(m,y){return function(_,P,L,j){if(_===void 0)return P!==void 0?-1:0;if(P===void 0)return 1;if((P=ln(_,P))===0){if(L&&j)return 0;if(L)return 1;if(j)return-1}return P}(m.lower,y.lower,m.lowerOpen,y.lowerOpen)<=0&&0<=function(_,P,L,j){if(_===void 0)return P!==void 0?1:0;if(P===void 0)return-1;if((P=ln(_,P))===0){if(L&&j)return 0;if(L)return-1;if(j)return 1}return P}(m.upper,y.upper,m.upperOpen,y.upperOpen)}function Fbe(m,y,_,P){m.subscribers.add(_),P.addEventListener("abort",function(){var L,j;m.subscribers.delete(_),m.subscribers.size===0&&(L=m,j=y,setTimeout(function(){L.subscribers.size===0&&J(j,L)},3e3))})}var Pbe={stack:"dbcore",level:0,name:"Cache",create:function(m){var y=m.schema.name;return s(s({},m),{transaction:function(_,P,L){var j,ne,ue=m.transaction(_,P,L);return P==="readwrite"&&(ne=(j=new AbortController).signal,L=function(Ce){return function(){if(j.abort(),P==="readwrite"){for(var Re=new Set,Ie=0,he=_;Ie<he.length;Ie++){var Pe=he[Ie],Ee=kc["idb://".concat(y,"/").concat(Pe)];if(Ee){var Te=m.table(Pe),xe=Ee.optimisticOps.filter(function(Rt){return Rt.trans===ue});if(ue._explicit&&Ce&&ue.mutatedParts)for(var De=0,Me=Object.values(Ee.queries.query);De<Me.length;De++)for(var $e=0,He=(mt=Me[De]).slice();$e<He.length;$e++)B_((it=He[$e]).obsSet,ue.mutatedParts)&&(J(mt,it),it.subscribers.forEach(function(Rt){return Re.add(Rt)}));else if(0<xe.length){Ee.optimisticOps=Ee.optimisticOps.filter(function(Rt){return Rt.trans!==ue});for(var Ze=0,rt=Object.values(Ee.queries.query);Ze<rt.length;Ze++)for(var mt,it,lt,St=0,ft=(mt=rt[Ze]).slice();St<ft.length;St++)(it=ft[St]).res!=null&&ue.mutatedParts&&(Ce&&!it.dirty?(lt=Object.isFrozen(it.res),lt=a$(it.res,it.req,xe,Te,it,lt),it.dirty?(J(mt,it),it.subscribers.forEach(function(Rt){return Re.add(Rt)})):lt!==it.res&&(it.res=lt,it.promise=nt.resolve({result:lt}))):(it.dirty&&J(mt,it),it.subscribers.forEach(function(Rt){return Re.add(Rt)})))}}}Re.forEach(function(Rt){return Rt()})}}},ue.addEventListener("abort",L(!1),{signal:ne}),ue.addEventListener("error",L(!1),{signal:ne}),ue.addEventListener("complete",L(!0),{signal:ne})),ue},table:function(_){var P=m.table(_),L=P.schema.primaryKey;return s(s({},P),{mutate:function(j){var ne=qe.trans;if(L.outbound||ne.db._options.cache==="disabled"||ne.explicit||ne.idbtrans.mode!=="readwrite")return P.mutate(j);var ue=kc["idb://".concat(y,"/").concat(_)];return ue?(ne=P.mutate(j),j.type!=="add"&&j.type!=="put"||!(50<=j.values.length||z_(L,j).some(function(Ce){return Ce==null}))?(ue.optimisticOps.push(j),j.mutatedParts&&Uy(j.mutatedParts),ne.then(function(Ce){0<Ce.numFailures&&(J(ue.optimisticOps,j),(Ce=i$(0,j,Ce))&&ue.optimisticOps.push(Ce),j.mutatedParts&&Uy(j.mutatedParts))}),ne.catch(function(){J(ue.optimisticOps,j),j.mutatedParts&&Uy(j.mutatedParts)})):ne.then(function(Ce){var Re=i$(0,s(s({},j),{values:j.values.map(function(Ie,he){var Pe;return Ce.failures[he]?Ie:(Ie=(Pe=L.keyPath)!==null&&Pe!==void 0&&Pe.includes(".")?k(Ie):s({},Ie),T(Ie,L.keyPath,Ce.results[he]),Ie)})}),Ce);ue.optimisticOps.push(Re),queueMicrotask(function(){return j.mutatedParts&&Uy(j.mutatedParts)})}),ne):P.mutate(j)},query:function(j){if(!o$(qe,P)||!r$("query",j))return P.query(j);var ne=((Re=qe.trans)===null||Re===void 0?void 0:Re.db._options.cache)==="immutable",he=qe,ue=he.requery,Ce=he.signal,Re=function(Te,xe,De,Me){var $e=kc["idb://".concat(Te,"/").concat(xe)];if(!$e)return[];if(!(xe=$e.queries[De]))return[null,!1,$e,null];var He=xe[(Me.query?Me.query.index.name:null)||""];if(!He)return[null,!1,$e,null];switch(De){case"query":var Ze=He.find(function(rt){return rt.req.limit===Me.limit&&rt.req.values===Me.values&&l$(rt.req.query.range,Me.query.range)});return Ze?[Ze,!0,$e,He]:[He.find(function(rt){return("limit"in rt.req?rt.req.limit:1/0)>=Me.limit&&(!Me.values||rt.req.values)&&xbe(rt.req.query.range,Me.query.range)}),!1,$e,He];case"count":return Ze=He.find(function(rt){return l$(rt.req.query.range,Me.query.range)}),[Ze,!!Ze,$e,He]}}(y,_,"query",j),Ie=Re[0],he=Re[1],Pe=Re[2],Ee=Re[3];return Ie&&he?Ie.obsSet=j.obsSet:(he=P.query(j).then(function(Te){var xe=Te.result;if(Ie&&(Ie.res=xe),ne){for(var De=0,Me=xe.length;De<Me;++De)Object.freeze(xe[De]);Object.freeze(xe)}else Te.result=k(xe);return Te}).catch(function(Te){return Ee&&Ie&&J(Ee,Ie),Promise.reject(Te)}),Ie={obsSet:j.obsSet,promise:he,subscribers:new Set,type:"query",req:j,dirty:!1},Ee?Ee.push(Ie):(Ee=[Ie],(Pe=Pe||(kc["idb://".concat(y,"/").concat(_)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[j.query.index.name||""]=Ee)),Fbe(Ie,Ee,ue,Ce),Ie.promise.then(function(Te){return{result:a$(Te.result,j,Pe==null?void 0:Pe.optimisticOps,P,Ie,ne)}})}})}})}};function zy(m,y){return new Proxy(m,{get:function(_,P,L){return P==="db"?y:Reflect.get(_,P,L)}})}var Sa=(as.prototype.version=function(m){if(isNaN(m)||m<.1)throw new K.Type("Given version is not a positive number");if(m=Math.round(10*m)/10,this.idbdb||this._state.isBeingOpened)throw new K.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,m);var y=this._versions,_=y.filter(function(P){return P._cfg.version===m})[0];return _||(_=new this.Version(m),y.push(_),y.sort(Cbe),_.stores({}),this._state.autoSchema=!1,_)},as.prototype._whenReady=function(m){var y=this;return this.idbdb&&(this._state.openComplete||qe.letThrough||this._vip)?m():new nt(function(_,P){if(y._state.openComplete)return P(new K.DatabaseClosed(y._state.dbOpenError));if(!y._state.isBeingOpened){if(!y._state.autoOpen)return void P(new K.DatabaseClosed);y.open().catch(Se)}y._state.dbReadyPromise.then(_,P)}).then(m)},as.prototype.use=function(m){var y=m.stack,_=m.create,P=m.level,L=m.name;return L&&this.unuse({stack:y,name:L}),m=this._middlewares[y]||(this._middlewares[y]=[]),m.push({stack:y,create:_,level:P??10,name:L}),m.sort(function(j,ne){return j.level-ne.level}),this},as.prototype.unuse=function(m){var y=m.stack,_=m.name,P=m.create;return y&&this._middlewares[y]&&(this._middlewares[y]=this._middlewares[y].filter(function(L){return P?L.create!==P:!!_&&L.name!==_})),this},as.prototype.open=function(){var m=this;return oo(Ne,function(){return _be(m)})},as.prototype._close=function(){var m=this._state,y=Md.indexOf(this);if(0<=y&&Md.splice(y,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}m.isBeingOpened||(m.dbReadyPromise=new nt(function(_){m.dbReadyResolve=_}),m.openCanceller=new nt(function(_,P){m.cancelOpen=P}))},as.prototype.close=function(_){var y=(_===void 0?{disableAutoOpen:!0}:_).disableAutoOpen,_=this._state;y?(_.isBeingOpened&&_.cancelOpen(new K.DatabaseClosed),this._close(),_.autoOpen=!1,_.dbOpenError=new K.DatabaseClosed):(this._close(),_.autoOpen=this._options.autoOpen||_.isBeingOpened,_.openComplete=!1,_.dbOpenError=null)},as.prototype.delete=function(m){var y=this;m===void 0&&(m={disableAutoOpen:!0});var _=0<arguments.length&&typeof arguments[0]!="object",P=this._state;return new nt(function(L,j){function ne(){y.close(m);var ue=y._deps.indexedDB.deleteDatabase(y.name);ue.onsuccess=kn(function(){var Ce,Re,Ie;Ce=y._deps,Re=y.name,Ie=Ce.indexedDB,Ce=Ce.IDBKeyRange,N_(Ie)||Re===Fy||M_(Ie,Ce).delete(Re).catch(Se),L()}),ue.onerror=ki(j),ue.onblocked=y._fireOnBlocked}if(_)throw new K.InvalidArgument("Invalid closeOptions argument to db.delete()");P.isBeingOpened?P.dbReadyPromise.then(ne):ne()})},as.prototype.backendDB=function(){return this.idbdb},as.prototype.isOpen=function(){return this.idbdb!==null},as.prototype.hasBeenClosed=function(){var m=this._state.dbOpenError;return m&&m.name==="DatabaseClosed"},as.prototype.hasFailed=function(){return this._state.dbOpenError!==null},as.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(as.prototype,"tables",{get:function(){var m=this;return i(this._allTables).map(function(y){return m._allTables[y]})},enumerable:!1,configurable:!0}),as.prototype.transaction=function(){var m=(function(y,_,P){var L=arguments.length;if(L<2)throw new K.InvalidArgument("Too few arguments");for(var j=new Array(L-1);--L;)j[L-1]=arguments[L];return P=j.pop(),[y,F(j),P]}).apply(this,arguments);return this._transaction.apply(this,m)},as.prototype._transaction=function(m,y,_){var P=this,L=qe.trans;L&&L.db===this&&m.indexOf("!")===-1||(L=null);var j,ne,ue=m.indexOf("?")!==-1;m=m.replace("!","").replace("?","");try{if(ne=y.map(function(Re){if(Re=Re instanceof P.Table?Re.name:Re,typeof Re!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return Re}),m=="r"||m===E_)j=E_;else{if(m!="rw"&&m!=__)throw new K.InvalidArgument("Invalid transaction mode: "+m);j=__}if(L){if(L.mode===E_&&j===__){if(!ue)throw new K.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");L=null}L&&ne.forEach(function(Re){if(L&&L.storeNames.indexOf(Re)===-1){if(!ue)throw new K.SubTransaction("Table "+Re+" not included in parent transaction.");L=null}}),ue&&L&&!L.active&&(L=null)}}catch(Re){return L?L._promise(null,function(Ie,he){he(Re)}):Kn(Re)}var Ce=(function Re(Ie,he,Pe,Ee,Te){return nt.resolve().then(function(){var xe=qe.transless||qe,De=Ie._createTransaction(he,Pe,Ie._dbSchema,Ee);if(De.explicit=!0,xe={trans:De,transless:xe},Ee)De.idbtrans=Ee.idbtrans;else try{De.create(),De.idbtrans._explicit=!0,Ie._state.PR1398_maxLoop=3}catch(He){return He.name===re.InvalidState&&Ie.isOpen()&&0<--Ie._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Ie.close({disableAutoOpen:!1}),Ie.open().then(function(){return Re(Ie,he,Pe,null,Te)})):Kn(He)}var Me,$e=ee(Te);return $e&&Qt(),xe=nt.follow(function(){var He;(Me=Te.call(De,De))&&($e?(He=Xt.bind(null,null),Me.then(He,He)):typeof Me.next=="function"&&typeof Me.throw=="function"&&(Me=U_(Me)))},xe),(Me&&typeof Me.then=="function"?nt.resolve(Me).then(function(He){return De.active?He:Kn(new K.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):xe.then(function(){return Me})).then(function(He){return Ee&&De._resolve(),De._completion.then(function(){return He})}).catch(function(He){return De._reject(He),Kn(He)})})}).bind(null,this,j,ne,L,_);return L?L._promise(j,Ce,"lock"):qe.trans?oo(qe.transless,function(){return P._whenReady(Ce)}):this._whenReady(Ce)},as.prototype.table=function(m){if(!d(this._allTables,m))throw new K.InvalidTable("Table ".concat(m," does not exist"));return this._allTables[m]},as);function as(m,y){var _=this;this._middlewares={},this.verno=0;var P=as.dependencies;this._options=y=s({addons:as.addons,autoOpen:!0,indexedDB:P.indexedDB,IDBKeyRange:P.IDBKeyRange,cache:"cloned"},y),this._deps={indexedDB:y.indexedDB,IDBKeyRange:y.IDBKeyRange},P=y.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var L,j,ne,ue,Ce,Re={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Se,dbReadyPromise:null,cancelOpen:Se,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:y.autoOpen};Re.dbReadyPromise=new nt(function(he){Re.dbReadyResolve=he}),Re.openCanceller=new nt(function(he,Pe){Re.cancelOpen=Pe}),this._state=Re,this.name=m,this.on=yp(this,"populate","blocked","versionchange","close",{ready:[N,Se]}),this.on.ready.subscribe=b(this.on.ready.subscribe,function(he){return function(Pe,Ee){as.vip(function(){var Te,xe=_._state;xe.openComplete?(xe.dbOpenError||nt.resolve().then(Pe),Ee&&he(Pe)):xe.onReadyBeingFired?(xe.onReadyBeingFired.push(Pe),Ee&&he(Pe)):(he(Pe),Te=_,Ee||he(function De(){Te.on.ready.unsubscribe(Pe),Te.on.ready.unsubscribe(De)}))})}}),this.Collection=(L=this,wp(fbe.prototype,function(Me,De){this.db=L;var Ee=BB,Te=null;if(De)try{Ee=De()}catch($e){Te=$e}var xe=Me._ctx,De=xe.table,Me=De.hook.reading.fire;this._ctx={table:De,index:xe.index,isPrimKey:!xe.index||De.schema.primKey.keyPath&&xe.index===De.schema.primKey.name,range:Ee,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:Te,or:xe.or,valueMapper:Me!==U?Me:null}})),this.Table=(j=this,wp(UB.prototype,function(he,Pe,Ee){this.db=j,this._tx=Ee,this.name=he,this.schema=Pe,this.hook=j._allTables[he]?j._allTables[he].hook:yp(null,{creating:[Ae,Se],reading:[Z,U],updating:[Le,Se],deleting:[Fe,Se]})})),this.Transaction=(ne=this,wp(mbe.prototype,function(he,Pe,Ee,Te,xe){var De=this;this.db=ne,this.mode=he,this.storeNames=Pe,this.schema=Ee,this.chromeTransactionDurability=Te,this.idbtrans=null,this.on=yp(this,"complete","error","abort"),this.parent=xe||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new nt(function(Me,$e){De._resolve=Me,De._reject=$e}),this._completion.then(function(){De.active=!1,De.on.complete.fire()},function(Me){var $e=De.active;return De.active=!1,De.on.error.fire(Me),De.parent?De.parent._reject(Me):$e&&De.idbtrans&&De.idbtrans.abort(),Kn(Me)})})),this.Version=(ue=this,wp(Ebe.prototype,function(he){this.db=ue,this._cfg={version:he,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(Ce=this,wp(qB.prototype,function(he,Pe,Ee){if(this.db=Ce,this._ctx={table:he,index:Pe===":id"?null:Pe,or:Ee},this._cmp=this._ascending=ln,this._descending=function(Te,xe){return ln(xe,Te)},this._max=function(Te,xe){return 0<ln(Te,xe)?Te:xe},this._min=function(Te,xe){return ln(Te,xe)<0?Te:xe},this._IDBKeyRange=Ce._deps.IDBKeyRange,!this._IDBKeyRange)throw new K.MissingAPI})),this.on("versionchange",function(he){0<he.newVersion?console.warn("Another connection wants to upgrade database '".concat(_.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(_.name,"'. Closing db now to resume the delete request.")),_.close({disableAutoOpen:!1})}),this.on("blocked",function(he){!he.newVersion||he.newVersion<he.oldVersion?console.warn("Dexie.delete('".concat(_.name,"') was blocked")):console.warn("Upgrade '".concat(_.name,"' blocked by other connection holding version ").concat(he.oldVersion/10))}),this._maxKey=Ep(y.IDBKeyRange),this._createTransaction=function(he,Pe,Ee,Te){return new _.Transaction(he,Pe,Ee,_._options.chromeTransactionDurability,Te)},this._fireOnBlocked=function(he){_.on("blocked").fire(he),Md.filter(function(Pe){return Pe.name===_.name&&Pe!==_&&!Pe._state.vcFired}).map(function(Pe){return Pe.on("versionchange").fire(he)})},this.use(Tbe),this.use(Pbe),this.use(Ibe),this.use(Rbe),this.use(Dbe);var Ie=new Proxy(this,{get:function(he,Pe,Ee){if(Pe==="_vip")return!0;if(Pe==="table")return function(xe){return zy(_.table(xe),Ie)};var Te=Reflect.get(he,Pe,Ee);return Te instanceof UB?zy(Te,Ie):Pe==="tables"?Te.map(function(xe){return zy(xe,Ie)}):Pe==="_createTransaction"?function(){return zy(Te.apply(this,arguments),Ie)}:Te}});this.vip=Ie,P.forEach(function(he){return he(_)})}var jy,vr=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Abe=(K_.prototype.subscribe=function(m,y,_){return this._subscribe(m&&typeof m!="function"?m:{next:m,error:y,complete:_})},K_.prototype[vr]=function(){return this},K_);function K_(m){this._subscribe=m}try{jy={indexedDB:r.indexedDB||r.mozIndexedDB||r.webkitIndexedDB||r.msIndexedDB,IDBKeyRange:r.IDBKeyRange||r.webkitIDBKeyRange}}catch{jy={indexedDB:null,IDBKeyRange:null}}function c$(m){var y,_=!1,P=new Abe(function(L){var j=ee(m),ne,ue=!1,Ce={},Re={},Ie={get closed(){return ue},unsubscribe:function(){ue||(ue=!0,ne&&ne.abort(),he&&yl.storagemutated.unsubscribe(Ee))}};L.start&&L.start(Ie);var he=!1,Pe=function(){return vp(Te)},Ee=function(xe){Gy(Ce,xe),B_(Re,Ce)&&Pe()},Te=function(){var xe,De,Me;!ue&&jy.indexedDB&&(Ce={},xe={},ne&&ne.abort(),ne=new AbortController,Me=function($e){var He=Pi();try{j&&Qt();var Ze=Ye(m,$e);return Ze=j?Ze.finally(Xt):Ze}finally{He&&mr()}}(De={subscr:xe,signal:ne.signal,requery:Pe,querier:m,trans:null}),Promise.resolve(Me).then(function($e){_=!0,y=$e,ue||De.signal.aborted||(Ce={},function(He){for(var Ze in He)if(d(He,Ze))return;return 1}(Re=xe)||he||(yl(Sp,Ee),he=!0),vp(function(){return!ue&&L.next&&L.next($e)}))},function($e){_=!1,["DatabaseClosedError","AbortError"].includes($e==null?void 0:$e.name)||ue||vp(function(){ue||L.error&&L.error($e)})}))};return setTimeout(Pe,0),Ie});return P.hasValue=function(){return _},P.getValue=function(){return y},P}var Oc=Sa;function q_(m){var y=wl;try{wl=!0,yl.storagemutated.fire(m),G_(m,!0)}finally{wl=y}}h(Oc,s(s({},se),{delete:function(m){return new Oc(m,{addons:[]}).delete()},exists:function(m){return new Oc(m,{addons:[]}).open().then(function(y){return y.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(m){try{return y=Oc.dependencies,_=y.indexedDB,y=y.IDBKeyRange,(N_(_)?Promise.resolve(_.databases()).then(function(P){return P.map(function(L){return L.name}).filter(function(L){return L!==Fy})}):M_(_,y).toCollection().primaryKeys()).then(m)}catch{return Kn(new K.MissingAPI)}var y,_},defineClass:function(){return function(m){l(this,m)}},ignoreTransaction:function(m){return qe.trans?oo(qe.transless,m):m()},vip:L_,async:function(m){return function(){try{var y=U_(m.apply(this,arguments));return y&&typeof y.then=="function"?y:nt.resolve(y)}catch(_){return Kn(_)}}},spawn:function(m,y,_){try{var P=U_(m.apply(_,y||[]));return P&&typeof P.then=="function"?P:nt.resolve(P)}catch(L){return Kn(L)}},currentTransaction:{get:function(){return qe.trans||null}},waitFor:function(m,y){return y=nt.resolve(typeof m=="function"?Oc.ignoreTransaction(m):m).timeout(y||6e4),qe.trans?qe.trans.waitFor(y):y},Promise:nt,debug:{get:function(){return $},set:function(m){le(m)}},derive:g,extend:l,props:h,override:b,Events:yp,on:yl,liveQuery:c$,extendObservabilitySet:Gy,getByKeyPath:R,setByKeyPath:T,delByKeyPath:function(m,y){typeof y=="string"?T(m,y,void 0):"length"in y&&[].map.call(y,function(_){T(m,_,void 0)})},shallowClone:I,deepClone:k,getObjectDiff:W_,cmp:ln,asap:D,minKey:-1/0,addons:[],connections:Md,errnames:re,dependencies:jy,cache:kc,semVer:"4.0.10",version:"4.0.10".split(".").map(function(m){return parseInt(m)}).reduce(function(m,y,_){return m+y/Math.pow(10,2*_)})})),Oc.maxKey=Ep(Oc.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(yl(Sp,function(m){wl||(m=new CustomEvent(I_,{detail:m}),wl=!0,dispatchEvent(m),wl=!1)}),addEventListener(I_,function(m){m=m.detail,wl||q_(m)}));var Vd,wl=!1,u$=function(){};return typeof BroadcastChannel<"u"&&((u$=function(){(Vd=new BroadcastChannel(I_)).onmessage=function(m){return m.data&&q_(m.data)}})(),typeof Vd.unref=="function"&&Vd.unref(),yl(Sp,function(m){wl||Vd.postMessage(m)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(m){if(!Sa.disableBfCache&&m.persisted){$&&console.debug("Dexie: handling persisted pagehide"),Vd!=null&&Vd.close();for(var y=0,_=Md;y<_.length;y++)_[y].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(m){!Sa.disableBfCache&&m.persisted&&($&&console.debug("Dexie: handling persisted pageshow"),u$(),q_({all:new js(-1/0,[[]])}))})),nt.rejectionMapper=function(m,y){return!m||m instanceof G||m instanceof TypeError||m instanceof SyntaxError||!m.name||!me[m.name]?m:(y=new me[m.name](y||m.message,m),"stack"in m&&p(y,"stack",{get:function(){return this.inner.stack}}),y)},le($),s(Sa,Object.freeze({__proto__:null,Dexie:Sa,liveQuery:c$,Entity:$B,cmp:ln,PropModSymbol:ba,PropModification:Cp,replacePrefix:function(m,y){return new Cp({replacePrefix:[m,y]})},add:function(m){return new Cp({add:m})},remove:function(m){return new Cp({remove:m})},default:Sa,RangeSet:js,mergeRanges:Dp,rangesOverlap:QB}),{default:Sa}),Sa})})(M1);var Gz=M1.exports;const vC=Hz(Gz),N1=Symbol.for("Dexie"),_h=globalThis[N1]||(globalThis[N1]=vC);if(vC.semVer!==_h.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${vC.semVer} and ${_h.semVer}`);const{liveQuery:Kbe,mergeRanges:qbe,rangesOverlap:Ybe,RangeSet:Zbe,cmp:Xbe,Entity:Jbe,PropModSymbol:Qbe,PropModification:eSe,replacePrefix:tSe,add:nSe,remove:sSe}=_h;class L1 extends _h{constructor(n){super(n);Qn(this,"icons");Qn(this,"visuals");Qn(this,"users");Qn(this,"columns");Qn(this,"general");this.version(1).stores({icons:"key",visuals:"key",users:"key",columns:"key",general:"key"})}getTable(n){return this[n]?this[n]:this.general}}const Ag=new Map,Uz=async e=>{if(!Ag.has(e)){const t=new L1(e);try{await t.open(),Ag.set(e,t)}catch(n){console.error("Failed to open database, attempting to delete and recreate:",n);try{await _h.delete(e);const s=new L1(e);await s.open(),Ag.set(e,s)}catch(s){throw console.error("Failed to delete and recreate database:",s),s}}}return Ag.get(e)},Rh=({dbName:e,storeName:t})=>{const n=async()=>(await Uz(e)).getTable(t);return{getCachedValue:async c=>{try{const u=await n();if(!u){console.error(`Store is undefined for key: ${c}`);return}const d=await u.get(c);return d==null?void 0:d.value}catch(u){console.error("Failed to get cached value:",u);return}},setCachedValue:async(c,u)=>{try{const d=await n();if(!d){console.error(`Store is undefined, cannot cache key: ${c}`);return}await d.put({key:c,value:u,timestamp:Date.now()})}catch(d){console.error("Failed to cache value:",d)}},deleteCachedValue:async c=>{try{const u=await n();if(!u){console.error(`Store is undefined, cannot delete key: ${c}`);return}await u.delete(c)}catch(u){console.error("Failed to delete cached value:",u)}},clearCache:async()=>{try{const c=await n();if(!c){console.error("Store is undefined, cannot clear cache");return}await c.clear()}catch(c){console.error("Failed to clear cache:",c)}},getAllKeys:async()=>{try{const c=await n();return c?(await c.toArray()).map(d=>d.key):(console.error("Store is undefined, cannot get all keys"),[])}catch(c){return console.error("Failed to get all keys:",c),[]}},getCachedValueWithTimestamp:async c=>{try{const u=await n();if(!u){console.error(`Store is undefined for key: ${c}`);return}return await u.get(c)}catch(u){console.error("Failed to get cached value with timestamp:",u);return}}}},Wz="AvatarCache",zz="images",Bl={},kg={},jz=()=>{const{getCachedValue:e,setCachedValue:t}=Rh({dbName:Wz,storeName:zz}),n=a=>new Promise((l,c)=>{const u=new FileReader;u.onloadend=()=>l(u.result),u.onerror=c,u.readAsDataURL(a)}),s=async a=>{try{if(Bl[a])return Bl[a];if(kg[a])return await kg[a];const l=(async()=>{try{const c=await e(a);if(!c||!(c instanceof Blob))return null;const u=await n(c);return Bl[a]=u,u}catch(c){return console.warn(`Failed to get cached image for key: ${a}`,c),null}})();return kg[a]=l,l.finally(()=>{delete kg[a]}),await l}catch(l){return console.error(`Error in getCachedImage for key: ${a}`,l),null}},o=a=>new Promise((l,c)=>{new $z(a,{width:96,height:96,quality:1,success(u){l(u)},error(u){console.error("Image compression failed:",u.message),c(u)}})});return{getCachedImage:s,setCachedImage:async(a,l)=>{try{const c=await o(l);await t(a,c);const u=await n(c);Bl[a]=u}catch(c){throw console.error(`Failed to cache image for key: ${a}`,c),c}},clearMemoryCache:a=>{try{a?delete Bl[a]:Object.keys(Bl).forEach(l=>delete Bl[l])}catch(l){console.error("Error clearing memory cache:",l)}}}},Dh=new Map,oi=new Map,su=new Map,Kz=5*60*1e3,V1=100;function qz(){const e=Date.now(),t=[];su.forEach((n,s)=>{e-n>Kz&&t.push(s)}),t.forEach(n=>{Dh.delete(n),su.delete(n),oi.delete(n)})}function Yz(){if(su.size<=V1)return;const e=Array.from(su.entries()).sort((n,s)=>n[1]-s[1]);e.slice(0,e.length-V1).forEach(([n])=>{Dh.delete(n),su.delete(n),oi.delete(n)})}const Zz=(e,t)=>{const n=oi.get(e);return n==null||n.forEach(s=>s(t)),oi.delete(e),t};async function Xz({userId:e,avatarUrl:t,cacheInterface:n,onLoadingChange:s}){let o=e;if(t)try{const d=new URL(t,"http://localhost").pathname.split("/").pop();d?o=`${e}_${d}`:o=t}catch{o=t||e}const r=await n.getCachedImage(o),i=Dh.has(o),a=oi.has(o);if(r)return Zz(o,r);if(qz(),i)return new Promise(u=>{a||oi.set(o,[]),oi.get(o).push(u)});const l=(async()=>{let u=null,d=null;try{const h=Math.random()*300;await new Promise(p=>setTimeout(p,h)),s==null||s(!0);const f=await fetch(t,{cache:"no-cache"});if(!f.ok)throw new Error("Failed to fetch image");return u=await f.blob(),await n.setCachedImage(o,u),d=URL.createObjectURL(u),d}catch(h){throw console.error("Error loading avatar image:",h),h}finally{u=null,s==null||s(!1),su.set(o,Date.now()),setTimeout(()=>{Dh.delete(o),Yz()},100)}})();Dh.set(o,l);const c=await l;return oi.has(o)&&(oi.get(o).forEach(d=>d(c)),oi.delete(o)),c}const Jz=(e,t=3,n=1e3)=>{const s=B(0),o=B(!1),r=B(!1),i=async()=>{try{await e()}catch(a){if(s.value<t)return s.value++,r.value=!0,await new Promise(l=>setTimeout(l,n)),i();throw o.value=!0,a}};return{retry:i,currentAttempt:s,errorRetry:o,isRetrying:r}};function Fs(e,t){Qz(e)&&(e="100%");const n=e3(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Og(e){return Math.min(1,Math.max(0,e))}function Qz(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function e3(e){return typeof e=="string"&&e.indexOf("%")!==-1}function B1(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Mg(e){return Number(e)<=1?`${Number(e)*100}%`:e}function $l(e){return e.length===1?"0"+e:String(e)}function t3(e,t,n){return{r:Fs(e,255)*255,g:Fs(t,255)*255,b:Fs(n,255)*255}}function $1(e,t,n){e=Fs(e,255),t=Fs(t,255),n=Fs(n,255);const s=Math.max(e,t,n),o=Math.min(e,t,n);let r=0,i=0;const a=(s+o)/2;if(s===o)i=0,r=0;else{const l=s-o;switch(i=a>.5?l/(2-s-o):l/(s+o),s){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4;break}r/=6}return{h:r,s:i,l:a}}function yC(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function n3(e,t,n){let s,o,r;if(e=Fs(e,360),t=Fs(t,100),n=Fs(n,100),t===0)o=n,r=n,s=n;else{const i=n<.5?n*(1+t):n+t-n*t,a=2*n-i;s=yC(a,i,e+1/3),o=yC(a,i,e),r=yC(a,i,e-1/3)}return{r:s*255,g:o*255,b:r*255}}function H1(e,t,n){e=Fs(e,255),t=Fs(t,255),n=Fs(n,255);const s=Math.max(e,t,n),o=Math.min(e,t,n);let r=0;const i=s,a=s-o,l=s===0?0:a/s;if(s===o)r=0;else{switch(s){case e:r=(t-n)/a+(t<n?6:0);break;case t:r=(n-e)/a+2;break;case n:r=(e-t)/a+4;break}r/=6}return{h:r,s:l,v:i}}function s3(e,t,n){e=Fs(e,360)*6,t=Fs(t,100),n=Fs(n,100);const s=Math.floor(e),o=e-s,r=n*(1-t),i=n*(1-o*t),a=n*(1-(1-o)*t),l=s%6,c=[n,i,r,r,a,n][l],u=[a,n,n,i,r,r][l],d=[r,r,a,n,n,i][l];return{r:c*255,g:u*255,b:d*255}}function G1(e,t,n,s){const o=[$l(Math.round(e).toString(16)),$l(Math.round(t).toString(16)),$l(Math.round(n).toString(16))];return s&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function o3(e,t,n,s,o){const r=[$l(Math.round(e).toString(16)),$l(Math.round(t).toString(16)),$l(Math.round(n).toString(16)),$l(i3(s))];return o&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))&&r[3].startsWith(r[3].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0)+r[3].charAt(0):r.join("")}function r3(e,t,n,s){const o=e/100,r=t/100,i=n/100,a=s/100,l=255*(1-o)*(1-a),c=255*(1-r)*(1-a),u=255*(1-i)*(1-a);return{r:l,g:c,b:u}}function U1(e,t,n){let s=1-e/255,o=1-t/255,r=1-n/255,i=Math.min(s,o,r);return i===1?(s=0,o=0,r=0):(s=(s-i)/(1-i)*100,o=(o-i)/(1-i)*100,r=(r-i)/(1-i)*100),i*=100,{c:Math.round(s),m:Math.round(o),y:Math.round(r),k:Math.round(i)}}function i3(e){return Math.round(parseFloat(e)*255).toString(16)}function W1(e){return Fo(e)/255}function Fo(e){return parseInt(e,16)}function a3(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}const wC={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function l3(e){let t={r:0,g:0,b:0},n=1,s=null,o=null,r=null,i=!1,a=!1;return typeof e=="string"&&(e=c3(e)),typeof e=="object"&&(Po(e.r)&&Po(e.g)&&Po(e.b)?(t=t3(e.r,e.g,e.b),i=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Po(e.h)&&Po(e.s)&&Po(e.v)?(s=Mg(e.s),o=Mg(e.v),t=s3(e.h,s,o),i=!0,a="hsv"):Po(e.h)&&Po(e.s)&&Po(e.l)?(s=Mg(e.s),r=Mg(e.l),t=n3(e.h,s,r),i=!0,a="hsl"):Po(e.c)&&Po(e.m)&&Po(e.y)&&Po(e.k)&&(t=r3(e.c,e.m,e.y,e.k),i=!0,a="cmyk"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=B1(n),{ok:i,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}const Ma="(?:"+"[-\\+]?\\d*\\.\\d+%?"+")|(?:"+"[-\\+]?\\d+%?"+")",CC="[\\s|\\(]+("+Ma+")[,|\\s]+("+Ma+")[,|\\s]+("+Ma+")\\s*\\)?",Ng="[\\s|\\(]+("+Ma+")[,|\\s]+("+Ma+")[,|\\s]+("+Ma+")[,|\\s]+("+Ma+")\\s*\\)?",Xo={CSS_UNIT:new RegExp(Ma),rgb:new RegExp("rgb"+CC),rgba:new RegExp("rgba"+Ng),hsl:new RegExp("hsl"+CC),hsla:new RegExp("hsla"+Ng),hsv:new RegExp("hsv"+CC),hsva:new RegExp("hsva"+Ng),cmyk:new RegExp("cmyk"+Ng),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function c3(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(wC[e])e=wC[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let n=Xo.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Xo.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Xo.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Xo.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Xo.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Xo.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Xo.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:(n=Xo.hex8.exec(e),n?{r:Fo(n[1]),g:Fo(n[2]),b:Fo(n[3]),a:W1(n[4]),format:t?"name":"hex8"}:(n=Xo.hex6.exec(e),n?{r:Fo(n[1]),g:Fo(n[2]),b:Fo(n[3]),format:t?"name":"hex"}:(n=Xo.hex4.exec(e),n?{r:Fo(n[1]+n[1]),g:Fo(n[2]+n[2]),b:Fo(n[3]+n[3]),a:W1(n[4]+n[4]),format:t?"name":"hex8"}:(n=Xo.hex3.exec(e),n?{r:Fo(n[1]+n[1]),g:Fo(n[2]+n[2]),b:Fo(n[3]+n[3]),format:t?"name":"hex"}:!1))))))))))}function Po(e){return typeof e=="number"?!Number.isNaN(e):Xo.CSS_UNIT.test(e)}class Nn{constructor(t="",n={}){if(t instanceof Nn)return t;typeof t=="number"&&(t=a3(t)),this.originalInput=t;const s=l3(t);this.originalInput=t,this.r=s.r,this.g=s.g,this.b=s.b,this.a=s.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??s.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=s.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3}getLuminance(){const t=this.toRgb();let n,s,o;const r=t.r/255,i=t.g/255,a=t.b/255;return r<=.03928?n=r/12.92:n=Math.pow((r+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),.2126*n+.7152*s+.0722*o}getAlpha(){return this.a}setAlpha(t){return this.a=B1(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return t===0}toHsv(){const t=H1(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=H1(this.r,this.g,this.b),n=Math.round(t.h*360),s=Math.round(t.s*100),o=Math.round(t.v*100);return this.a===1?`hsv(${n}, ${s}%, ${o}%)`:`hsva(${n}, ${s}%, ${o}%, ${this.roundA})`}toHsl(){const t=$1(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}}toHslString(){const t=$1(this.r,this.g,this.b),n=Math.round(t.h*360),s=Math.round(t.s*100),o=Math.round(t.l*100);return this.a===1?`hsl(${n}, ${s}%, ${o}%)`:`hsla(${n}, ${s}%, ${o}%, ${this.roundA})`}toHex(t=!1){return G1(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return o3(this.r,this.g,this.b,this.a,t)}toHex8String(t=!1){return"#"+this.toHex8(t)}toHexShortString(t=!1){return this.a===1?this.toHexString(t):this.toHex8String(t)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const t=Math.round(this.r),n=Math.round(this.g),s=Math.round(this.b);return this.a===1?`rgb(${t}, ${n}, ${s})`:`rgba(${t}, ${n}, ${s}, ${this.roundA})`}toPercentageRgb(){const t=n=>`${Math.round(Fs(n,255)*100)}%`;return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}toPercentageRgbString(){const t=n=>Math.round(Fs(n,255)*100);return this.a===1?`rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)`:`rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`}toCmyk(){return{...U1(this.r,this.g,this.b)}}toCmykString(){const{c:t,m:n,y:s,k:o}=U1(this.r,this.g,this.b);return`cmyk(${t}, ${n}, ${s}, ${o})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const t="#"+G1(this.r,this.g,this.b,!1);for(const[n,s]of Object.entries(wC))if(t===s)return n;return!1}toString(t){const n=!!t;t=t??this.format;let s=!1;const o=this.a<1&&this.a>=0;return!n&&o&&(t.startsWith("hex")||t==="name")?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(s=this.toRgbString()),t==="prgb"&&(s=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(s=this.toHexString()),t==="hex3"&&(s=this.toHexString(!0)),t==="hex4"&&(s=this.toHex8String(!0)),t==="hex8"&&(s=this.toHex8String()),t==="name"&&(s=this.toName()),t==="hsl"&&(s=this.toHslString()),t==="hsv"&&(s=this.toHsvString()),t==="cmyk"&&(s=this.toCmykString()),s||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new Nn(this.toString())}lighten(t=10){const n=this.toHsl();return n.l+=t/100,n.l=Og(n.l),new Nn(n)}brighten(t=10){const n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new Nn(n)}darken(t=10){const n=this.toHsl();return n.l-=t/100,n.l=Og(n.l),new Nn(n)}tint(t=10){return this.mix("white",t)}shade(t=10){return this.mix("black",t)}desaturate(t=10){const n=this.toHsl();return n.s-=t/100,n.s=Og(n.s),new Nn(n)}saturate(t=10){const n=this.toHsl();return n.s+=t/100,n.s=Og(n.s),new Nn(n)}greyscale(){return this.desaturate(100)}spin(t){const n=this.toHsl(),s=(n.h+t)%360;return n.h=s<0?360+s:s,new Nn(n)}mix(t,n=50){const s=this.toRgb(),o=new Nn(t).toRgb(),r=n/100,i={r:(o.r-s.r)*r+s.r,g:(o.g-s.g)*r+s.g,b:(o.b-s.b)*r+s.b,a:(o.a-s.a)*r+s.a};return new Nn(i)}analogous(t=6,n=30){const s=this.toHsl(),o=360/n,r=[this];for(s.h=(s.h-(o*t>>1)+720)%360;--t;)s.h=(s.h+o)%360,r.push(new Nn(s));return r}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new Nn(t)}monochromatic(t=6){const n=this.toHsv(),{h:s}=n,{s:o}=n;let{v:r}=n;const i=[],a=1/t;for(;t--;)i.push(new Nn({h:s,s:o,v:r})),r=(r+a)%1;return i}splitcomplement(){const t=this.toHsl(),{h:n}=t;return[this,new Nn({h:(n+72)%360,s:t.s,l:t.l}),new Nn({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){const n=this.toRgb(),s=new Nn(t).toRgb(),o=n.a+s.a*(1-n.a);return new Nn({r:(n.r*n.a+s.r*s.a*(1-n.a))/o,g:(n.g*n.a+s.g*s.a*(1-n.a))/o,b:(n.b*n.a+s.b*s.a*(1-n.a))/o,a:o})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const n=this.toHsl(),{h:s}=n,o=[this],r=360/t;for(let i=1;i<t;i++)o.push(new Nn({h:(s+i*r)%360,s:n.s,l:n.l}));return o}equals(t){const n=new Nn(t);return this.format==="cmyk"||n.format==="cmyk"?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}}function z1(e){return new Nn(e||"").isValid}function Lg(e,t){const{c1:n,c2:s}={c1:new Nn(e),c2:new Nn(t)};return n.equals(s)}const Pc=class Pc{constructor(){Qn(this,"KEY_PAIR",{workspaceCode:"ws.code",apiBaseUrl:"API_BASE_URL",assetUrl:"ASSET_URL",baseUrl:"BASE_URL",baseReviewUrl:"BASE_REVIEW_URL"});Object.values(this.KEY_PAIR).every(n=>{const s=sessionStorage.getItem(n);return(s==null||s==="")&&console.error(`[SessionStorageHelper] Key "${n}" is not set in sessionStorage.`),!0})||console.error("[SessionStorageHelper] Some expected keys are missing in sessionStorage. Please ensure all required keys are set.")}static getInstance(){return Pc.instance||(Pc.instance=new Pc),Pc.instance}setItem(t,n){try{sessionStorage.setItem(t,n)}catch(s){console.error("Error setting sessionStorage item:",s)}}getItem(t){try{const n=sessionStorage.getItem(t);return n===null?"":n}catch(n){throw console.error("Error getting sessionStorage item:",n),n}}};Qn(Pc,"instance");let un=Pc;const u3=["src","alt"],Th=Et(ot({__name:"Avatar",props:{name:{},id:{},profile_image:{},color:{},initial:{},isMe:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{default:24},isUseShortLabel:{type:Boolean,default:!0},borderRadius:{default:void 0}},setup(e){const t=e,n=q(()=>t.isMe||t.id===h.value),s=B(""),o=B(!1),r=B(null),i=B(!1),a=q(()=>({name:t.name||"",id:t.id||"",profile_image:t.profile_image||null,color:t.color||{bgColor:"#CCCCCC",textColor:"var(--background-color)"},initial:t.initial})),l=q(()=>{var T;const R=((T=a.value.color)==null?void 0:T.bgColor)||"#CCCCCC";return z1(R)?R:"#CCCCCC"}),c=q(()=>{var T;const R=((T=a.value.color)==null?void 0:T.textColor)||"var(--background-color)";return z1(R)?R:"var(--background-color)"}),u=q(()=>{if(!t.isUseShortLabel)return"";const{initial:R,name:T}=a.value;if(typeof R=="string"&&R.trim())return R.trim();if(!(T!=null&&T.trim()))return"";const I=T.trim().split(/\s+/).filter(Boolean);return I.length===1?I[0].slice(0,2).toUpperCase():(I[0][0]+I[1][0]).toUpperCase()}),d=q(()=>a.value.profile_image?"image":"text"),h=q(()=>un.getInstance().getItem("user.ws_user_role_id")),f=q(()=>({"--avatar-size":`${t.size}px`,"--avatar-bg":l.value,"--avatar-border":t.isMe?"var(--primary-color)":"#f3f5f8","--text-color":c.value,"--font-size":`${Math.floor(t.size/2)}px`,"--border-radius":t.borderRadius?typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius:"4px"})),p=()=>{s.value="",i.value=!0},{getCachedImage:g,setCachedImage:v}=jz(),C=async()=>{if(r.value&&r.value.abort(),s.value.startsWith("blob:")&&URL.revokeObjectURL(s.value),!a.value.id||!a.value.profile_image){s.value="";return}r.value=new AbortController;const R=r.value;try{const T=await Xz({userId:a.value.id,avatarUrl:a.value.profile_image,cacheInterface:{getCachedImage:g,setCachedImage:v},onLoadingChange:I=>{R.signal.aborted||(o.value=I)}});if(!R.signal.aborted&&(s.value=T,T.length===0))throw console.warn("Loaded avatar image is empty, displaying initials instead."),p(),new Error("Empty image source")}catch(T){R.signal.aborted||(console.error("Failed to load avatar:",T),s.value="")}},{retry:S,errorRetry:b,isRetrying:w}=Jz(C,3,2e3),D=et(()=>[a.value.id,a.value.profile_image],S,{immediate:!0});return ms(()=>{D(),r.value&&(r.value.abort(),r.value=null),s.value.startsWith("blob:")&&URL.revokeObjectURL(s.value),s.value="",o.value=!1}),(R,T)=>(z(),ce("div",{class:Q([R.$style["avatar-wrapper"],{[R.$style.me]:n.value,[R.$style.loading]:o.value,[R.$style.disabled]:e.disabled,[R.$style.readOnly]:t.readOnly}]),style:hn(f.value)},[o.value||H(w)?(z(),ce("div",{key:0,class:Q(R.$style["skeleton-loader"])},null,2)):(z(),ce(xt,{key:1},[d.value==="text"||H(b)||i.value?(z(),ce("div",{key:0,class:Q(R.$style["short-label"])},Ct(u.value),3)):s.value.length>0||a.value.profile_image?(z(),ce("img",{key:1,src:s.value||a.value.profile_image||"",alt:a.value.name||"Avatar",loading:"lazy"},null,8,u3)):Xe("",!0)],64))],6))}}),[["__cssModules",{$style:{"avatar-wrapper":"_avatar-wrapper_1dygt_1",me:"_me_1dygt_18","short-label":"_short-label_1dygt_22",action:"_action_1dygt_40",loading:"_loading_1dygt_58",disabled:"_disabled_1dygt_61",readOnly:"_readOnly_1dygt_64"}}]]),d3=["404","ClickChart","ClickToCreate","NoAccess1","NoActivity","NoAssignedComment","NoAssignedScene","NoComment","NoData","NoData2","NoRendition1","NoRendition2","PrivateComment","PrivateScene","ReportAchievement","ReportCompletedScenes","ReportInvolvement","ReportMetric","ReportOverdueScenes","ReportProfessionalName","ReportSceneAssignment","ReportSceneStatus","ReportSceneStatusType","Successful1","Unsuccessful1","ConfirmDeletion","Waiting1","DefaultThumbnail","UploadReviewFile","ClickToSearch","NoDataSearchFilter"],h3=["UploadInProgress"],Vg={},Na={},j1=(e,t,n,s,o="base64")=>{const r=B(""),i=B(""),a=B(!0),l=q(()=>`${t}:${e.value.name}`),c=g=>new Promise((v,C)=>{const S=new FileReader;S.onload=()=>v(S.result),S.onerror=C,S.readAsDataURL(g)}),u=g=>`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g)}`,d=async(g,v)=>{if(Na[v])return Na[v];if(v in Vg){const b=await Vg[v];return b&&(Na[v]=b),b}const C=await s(l.value);if(C&&typeof C=="string")return Na[v]=C,C;const S=(async()=>{try{const b=await fetch(g,{cache:"no-cache"});if(!b.ok)throw new Error("Failed to fetch visual");const w=b.headers.get("Content-Type")||"";let D;if(w.includes("svg")||w.includes("xml")){const R=await b.text();if(!R.trim())throw new Error("Empty SVG content");D=o==="svg"?R:u(R),Na[v]=D}else if(w.match(/image\/(jpeg|jpg|png|gif|webp)/)){const R=await b.blob();if(!R.size)throw new Error("Empty image blob");D=await c(R),Na[v]=D}else throw new Error(`Unsupported content type: ${w}`);return await n(l.value,D),D}catch(b){return console.error("Error fetching visual:",b),""}})();return Vg[v]=S,S.finally(()=>{delete Vg[v]}),await S},h=async g=>{a.value=!0;try{if(Na[l.value]){const D=Na[l.value];r.value=D,D.startsWith("data:image/svg+xml")?i.value=decodeURIComponent(D.split(",")[1]):(D.startsWith("<svg")||D.includes("<svg"))&&(i.value=D),a.value=!1;return}const v=un.getInstance().getItem("ASSET_URL")||"",C={icon:`${v}/icon/tess/TESSRAPP_Icon_${g}`,visual:`${v}/icon/visual/TESSRAPP_Visual_${g}`,ratting:`${v}/icon/tess/rating/TESSRAPP_Icon_${g}_Outline`,flag:`${v}/icon/flags/4x3/${g}`},S=d3.includes(g)?"png":h3.includes(g)?"gif":"svg",b=`${C[t]}.${S}`,w=await d(b,l.value);w&&(r.value=w,w.startsWith("data:image/svg+xml")?i.value=decodeURIComponent(w.split(",")[1]):(w.startsWith("<svg")||w.includes("<svg"))&&(i.value=w))}catch(v){console.error("Error fetching remote visual:",v)}finally{a.value=!1}},f=async()=>{r.value="",i.value="",e.value.name&&(a.value=!0,await h(e.value.name),a.value=!1)},p=q(()=>i.value?i.value:"");return et(()=>e,()=>{f()},{deep:!0,immediate:!0}),{svgContent:p,url:r,loading:a}},f3=["innerHTML","about"],p3="IconCache",g3="icons",at=Et(ot({__name:"Icon",props:{src:{},source:{default:"remote"},size:{default:14},color:{default:"currentColor"}},setup(e){const t=e,n=d=>{if(typeof d=="number")return d;switch(d){case"small":return 14;case"medium":return 14;case"large":return 20;default:return typeof d=="string"?Number.parseInt(d,10):14}},s=q(()=>n(t.size));q(()=>({width:s.value+"px",height:s.value+"px",color:t.color}));const{getCachedValue:o,setCachedValue:r}=Rh({dbName:p3,storeName:g3}),i=async d=>{const h=await o(d);if(typeof h=="string")return h},a=async(d,h)=>{await r(d,h)},l=q(()=>t.source==="rating"?"ratting":"icon"),c=q(()=>({name:t.src,size:s.value,color:t.color||"currentColor"})),{svgContent:u}=j1(c,l.value,a,i,"svg");return(d,h)=>(z(),ce("div",{class:"icon-wrapper",style:hn({"--icon-size":s.value+"px",color:t.color}),innerHTML:H(u),about:t.src,"data-icon":"true"},null,12,f3))}}),[["__scopeId","data-v-54eccaa1"]]),m3={review:"{reviewDomain}/{ws_code}",review_take:"{reviewDomain}/{ws_code}?id={take_id}",review_scene:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",review_rendition:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",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}",review_rendition_comment:"{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}",review_comment:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",review_multiple_scenes:"{reviewDomain}/{ws_code}?scene_ids={scene_ids}",scene_hub:"{baseDomain}/{ws_code}/{scene_id}?o=st",hub_rendition:"{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",hub_comment:"{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",people_insight:"{baseDomain}/{ws_code}/{user_id}?o=pt",people_detail:"{baseDomain}/{ws_code}/ws/ppl/{display_name}-${user_id}",project:"{baseDomain}/{ws_code}/pl/dir/{entity_id}",woohoo:"{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",update:"{baseDomain}/{ws_code}/pl/au?id={entity_id}",core:"{baseDomain}/{ws_code}",project_focusMode:"{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",access_setting:"{baseDomain}/{ws_code}/pl/dir?f={entity_id}&o=as"},Xs=({type:e,config:t})=>{const n=[];try{const s=m3[e];if(!s)throw new Error(`Link template for link type "${e}" not found`);const o=s.replace(/{(.*?)}/g,(r,i)=>{const a=t[String(i)];if(a!==void 0)return a;n.push(i)});return n.length>0?{url:o,hasError:!0,error:`Missing required keys: ${n.join(", ")}`,missingKeys:n}:{url:o,hasError:!1,error:void 0}}catch(s){return console.error("Link Creator ERROR at:",s),{url:"",hasError:!0,error:s instanceof Error?s.message:`Missing required keys: ${n.join(", ")}`}}};var K1=typeof global=="object"&&global&&global.Object===Object&&global,v3=typeof self=="object"&&self&&self.Object===Object&&self,Dr=K1||v3||Function("return this")(),Jo=Dr.Symbol,q1=Object.prototype,y3=q1.hasOwnProperty,w3=q1.toString,Ih=Jo?Jo.toStringTag:void 0;function C3(e){var t=y3.call(e,Ih),n=e[Ih];try{e[Ih]=void 0;var s=!0}catch{}var o=w3.call(e);return s&&(t?e[Ih]=n:delete e[Ih]),o}var b3=Object.prototype,S3=b3.toString;function E3(e){return S3.call(e)}var _3="[object Null]",R3="[object Undefined]",Y1=Jo?Jo.toStringTag:void 0;function ou(e){return e==null?e===void 0?R3:_3:Y1&&Y1 in Object(e)?C3(e):E3(e)}function Ki(e){return e!=null&&typeof e=="object"}var D3="[object Symbol]";function Bg(e){return typeof e=="symbol"||Ki(e)&&ou(e)==D3}function T3(e,t){for(var n=-1,s=e==null?0:e.length,o=Array(s);++n<s;)o[n]=t(e[n],n,e);return o}var Qo=Array.isArray,Z1=Jo?Jo.prototype:void 0,X1=Z1?Z1.toString:void 0;function J1(e){if(typeof e=="string")return e;if(Qo(e))return T3(e,J1)+"";if(Bg(e))return X1?X1.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var I3=/\s/;function x3(e){for(var t=e.length;t--&&I3.test(e.charAt(t)););return t}var F3=/^\s+/;function P3(e){return e&&e.slice(0,x3(e)+1).replace(F3,"")}function La(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Q1=NaN,A3=/^[-+]0x[0-9a-f]+$/i,k3=/^0b[01]+$/i,O3=/^0o[0-7]+$/i,M3=parseInt;function bC(e){if(typeof e=="number")return e;if(Bg(e))return Q1;if(La(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=La(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=P3(e);var n=k3.test(e);return n||O3.test(e)?M3(e.slice(2),n?2:8):A3.test(e)?Q1:+e}var eI=1/0,N3=17976931348623157e292;function L3(e){if(!e)return e===0?e:0;if(e=bC(e),e===eI||e===-eI){var t=e<0?-1:1;return t*N3}return e===e?e:0}function V3(e){var t=L3(e),n=t%1;return t===t?n?t-n:t:0}function SC(e){return e}var B3="[object AsyncFunction]",$3="[object Function]",H3="[object GeneratorFunction]",G3="[object Proxy]";function tI(e){if(!La(e))return!1;var t=ou(e);return t==$3||t==H3||t==B3||t==G3}var EC=Dr["__core-js_shared__"],nI=function(){var e=/[^.]+$/.exec(EC&&EC.keys&&EC.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function U3(e){return!!nI&&nI in e}var W3=Function.prototype,z3=W3.toString;function Hl(e){if(e!=null){try{return z3.call(e)}catch{}try{return e+""}catch{}}return""}var j3=/[\\^$.*+?()[\]{}|]/g,K3=/^\[object .+?Constructor\]$/,q3=Function.prototype,Y3=Object.prototype,Z3=q3.toString,X3=Y3.hasOwnProperty,J3=RegExp("^"+Z3.call(X3).replace(j3,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Q3(e){if(!La(e)||U3(e))return!1;var t=tI(e)?J3:K3;return t.test(Hl(e))}function e6(e,t){return e==null?void 0:e[t]}function Gl(e,t){var n=e6(e,t);return Q3(n)?n:void 0}var _C=Gl(Dr,"WeakMap"),sI=Object.create,t6=function(){function e(){}return function(t){if(!La(t))return{};if(sI)return sI(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function n6(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function s6(){}var o6=800,r6=16,i6=Date.now;function a6(e){var t=0,n=0;return function(){var s=i6(),o=r6-(s-n);if(n=s,o>0){if(++t>=o6)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function l6(e){return function(){return e}}var $g=function(){try{var e=Gl(Object,"defineProperty");return e({},"",{}),e}catch{}}(),c6=$g?function(e,t){return $g(e,"toString",{configurable:!0,enumerable:!1,value:l6(t),writable:!0})}:SC,u6=a6(c6);function d6(e,t){for(var n=-1,s=e==null?0:e.length;++n<s&&t(e[n],n,e)!==!1;);return e}function h6(e,t,n,s){for(var o=e.length,r=n+-1;++r<o;)if(t(e[r],r,e))return r;return-1}function f6(e){return e!==e}function p6(e,t,n){for(var s=n-1,o=e.length;++s<o;)if(e[s]===t)return s;return-1}function g6(e,t,n){return t===t?p6(e,t,n):h6(e,f6,n)}function m6(e,t){var n=e==null?0:e.length;return!!n&&g6(e,t,0)>-1}var v6=9007199254740991,y6=/^(?:0|[1-9]\d*)$/;function oI(e,t){var n=typeof e;return t=t??v6,!!t&&(n=="number"||n!="symbol"&&y6.test(e))&&e>-1&&e%1==0&&e<t}function w6(e,t,n){t=="__proto__"&&$g?$g(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function RC(e,t){return e===t||e!==e&&t!==t}var C6=Object.prototype,b6=C6.hasOwnProperty;function S6(e,t,n){var s=e[t];(!(b6.call(e,t)&&RC(s,n))||n===void 0&&!(t in e))&&w6(e,t,n)}var rI=Math.max;function E6(e,t,n){return t=rI(t===void 0?e.length-1:t,0),function(){for(var s=arguments,o=-1,r=rI(s.length-t,0),i=Array(r);++o<r;)i[o]=s[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=s[o];return a[t]=n(i),n6(e,this,a)}}function _6(e,t){return u6(E6(e,t,SC),e+"")}var R6=9007199254740991;function DC(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=R6}function TC(e){return e!=null&&DC(e.length)&&!tI(e)}var D6=Object.prototype;function IC(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||D6;return e===n}function T6(e,t){for(var n=-1,s=Array(e);++n<e;)s[n]=t(n);return s}var I6="[object Arguments]";function iI(e){return Ki(e)&&ou(e)==I6}var aI=Object.prototype,x6=aI.hasOwnProperty,F6=aI.propertyIsEnumerable,Hg=iI(function(){return arguments}())?iI:function(e){return Ki(e)&&x6.call(e,"callee")&&!F6.call(e,"callee")};function P6(){return!1}var lI=typeof On=="object"&&On&&!On.nodeType&&On,cI=lI&&typeof module=="object"&&module&&!module.nodeType&&module,A6=cI&&cI.exports===lI,uI=A6?Dr.Buffer:void 0,k6=uI?uI.isBuffer:void 0,xh=k6||P6,O6="[object Arguments]",M6="[object Array]",N6="[object Boolean]",L6="[object Date]",V6="[object Error]",B6="[object Function]",$6="[object Map]",H6="[object Number]",G6="[object Object]",U6="[object RegExp]",W6="[object Set]",z6="[object String]",j6="[object WeakMap]",K6="[object ArrayBuffer]",q6="[object DataView]",Y6="[object Float32Array]",Z6="[object Float64Array]",X6="[object Int8Array]",J6="[object Int16Array]",Q6="[object Int32Array]",e4="[object Uint8Array]",t4="[object Uint8ClampedArray]",n4="[object Uint16Array]",s4="[object Uint32Array]",Ln={};Ln[Y6]=Ln[Z6]=Ln[X6]=Ln[J6]=Ln[Q6]=Ln[e4]=Ln[t4]=Ln[n4]=Ln[s4]=!0,Ln[O6]=Ln[M6]=Ln[K6]=Ln[N6]=Ln[q6]=Ln[L6]=Ln[V6]=Ln[B6]=Ln[$6]=Ln[H6]=Ln[G6]=Ln[U6]=Ln[W6]=Ln[z6]=Ln[j6]=!1;function o4(e){return Ki(e)&&DC(e.length)&&!!Ln[ou(e)]}function xC(e){return function(t){return e(t)}}var dI=typeof On=="object"&&On&&!On.nodeType&&On,Fh=dI&&typeof module=="object"&&module&&!module.nodeType&&module,r4=Fh&&Fh.exports===dI,FC=r4&&K1.process,ru=function(){try{var e=Fh&&Fh.require&&Fh.require("util").types;return e||FC&&FC.binding&&FC.binding("util")}catch{}}(),hI=ru&&ru.isTypedArray,PC=hI?xC(hI):o4,i4=Object.prototype,a4=i4.hasOwnProperty;function l4(e,t){var n=Qo(e),s=!n&&Hg(e),o=!n&&!s&&xh(e),r=!n&&!s&&!o&&PC(e),i=n||s||o||r,a=i?T6(e.length,String):[],l=a.length;for(var c in e)a4.call(e,c)&&!(i&&(c=="length"||o&&(c=="offset"||c=="parent")||r&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||oI(c,l)))&&a.push(c);return a}function fI(e,t){return function(n){return e(t(n))}}var c4=fI(Object.keys,Object),u4=Object.prototype,d4=u4.hasOwnProperty;function pI(e){if(!IC(e))return c4(e);var t=[];for(var n in Object(e))d4.call(e,n)&&n!="constructor"&&t.push(n);return t}function gI(e){return TC(e)?l4(e):pI(e)}var h4=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,f4=/^\w*$/;function AC(e,t){if(Qo(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Bg(e)?!0:f4.test(e)||!h4.test(e)||t!=null&&e in Object(t)}var Ph=Gl(Object,"create");function p4(){this.__data__=Ph?Ph(null):{},this.size=0}function g4(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var m4="__lodash_hash_undefined__",v4=Object.prototype,y4=v4.hasOwnProperty;function w4(e){var t=this.__data__;if(Ph){var n=t[e];return n===m4?void 0:n}return y4.call(t,e)?t[e]:void 0}var C4=Object.prototype,b4=C4.hasOwnProperty;function S4(e){var t=this.__data__;return Ph?t[e]!==void 0:b4.call(t,e)}var E4="__lodash_hash_undefined__";function _4(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ph&&t===void 0?E4:t,this}function Ul(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Ul.prototype.clear=p4,Ul.prototype.delete=g4,Ul.prototype.get=w4,Ul.prototype.has=S4,Ul.prototype.set=_4;function R4(){this.__data__=[],this.size=0}function Gg(e,t){for(var n=e.length;n--;)if(RC(e[n][0],t))return n;return-1}var D4=Array.prototype,T4=D4.splice;function I4(e){var t=this.__data__,n=Gg(t,e);if(n<0)return!1;var s=t.length-1;return n==s?t.pop():T4.call(t,n,1),--this.size,!0}function x4(e){var t=this.__data__,n=Gg(t,e);return n<0?void 0:t[n][1]}function F4(e){return Gg(this.__data__,e)>-1}function P4(e,t){var n=this.__data__,s=Gg(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this}function qi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}qi.prototype.clear=R4,qi.prototype.delete=I4,qi.prototype.get=x4,qi.prototype.has=F4,qi.prototype.set=P4;var Ah=Gl(Dr,"Map");function A4(){this.size=0,this.__data__={hash:new Ul,map:new(Ah||qi),string:new Ul}}function k4(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ug(e,t){var n=e.__data__;return k4(t)?n[typeof t=="string"?"string":"hash"]:n.map}function O4(e){var t=Ug(this,e).delete(e);return this.size-=t?1:0,t}function M4(e){return Ug(this,e).get(e)}function N4(e){return Ug(this,e).has(e)}function L4(e,t){var n=Ug(this,e),s=n.size;return n.set(e,t),this.size+=n.size==s?0:1,this}function Yi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Yi.prototype.clear=A4,Yi.prototype.delete=O4,Yi.prototype.get=M4,Yi.prototype.has=N4,Yi.prototype.set=L4;var V4="Expected a function";function kC(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(V4);var n=function(){var s=arguments,o=t?t.apply(this,s):s[0],r=n.cache;if(r.has(o))return r.get(o);var i=e.apply(this,s);return n.cache=r.set(o,i)||r,i};return n.cache=new(kC.Cache||Yi),n}kC.Cache=Yi;var B4=500;function $4(e){var t=kC(e,function(s){return n.size===B4&&n.clear(),s}),n=t.cache;return t}var H4=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,G4=/\\(\\)?/g,U4=$4(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(H4,function(n,s,o,r){t.push(o?r.replace(G4,"$1"):s||n)}),t});function W4(e){return e==null?"":J1(e)}function mI(e,t){return Qo(e)?e:AC(e,t)?[e]:U4(W4(e))}function Wg(e){if(typeof e=="string"||Bg(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function vI(e,t){t=mI(t,e);for(var n=0,s=t.length;e!=null&&n<s;)e=e[Wg(t[n++])];return n&&n==s?e:void 0}function z4(e,t,n){var s=e==null?void 0:vI(e,t);return s===void 0?n:s}function yI(e,t){for(var n=-1,s=t.length,o=e.length;++n<s;)e[o+n]=t[n];return e}var wI=Jo?Jo.isConcatSpreadable:void 0;function j4(e){return Qo(e)||Hg(e)||!!(wI&&e&&e[wI])}function K4(e,t,n,s,o){var r=-1,i=e.length;for(n||(n=j4),o||(o=[]);++r<i;){var a=e[r];n(a)&&yI(o,a)}return o}var q4=fI(Object.getPrototypeOf,Object);function Y4(e,t,n){var s=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(o);++s<o;)r[s]=e[s+t];return r}var Z4=Math.ceil,X4=Math.max;function J4(e,t,n){t===void 0?t=1:t=X4(V3(t),0);var s=e==null?0:e.length;if(!s||t<1)return[];for(var o=0,r=0,i=Array(Z4(s/t));o<s;)i[r++]=Y4(e,o,o+=t);return i}function Q4(){this.__data__=new qi,this.size=0}function e5(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function t5(e){return this.__data__.get(e)}function n5(e){return this.__data__.has(e)}var s5=200;function o5(e,t){var n=this.__data__;if(n instanceof qi){var s=n.__data__;if(!Ah||s.length<s5-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new Yi(s)}return n.set(e,t),this.size=n.size,this}function ri(e){var t=this.__data__=new qi(e);this.size=t.size}ri.prototype.clear=Q4,ri.prototype.delete=e5,ri.prototype.get=t5,ri.prototype.has=n5,ri.prototype.set=o5;var CI=typeof On=="object"&&On&&!On.nodeType&&On,bI=CI&&typeof module=="object"&&module&&!module.nodeType&&module,r5=bI&&bI.exports===CI,SI=r5?Dr.Buffer:void 0;SI&&SI.allocUnsafe;function i5(e,t){return e.slice()}function a5(e,t){for(var n=-1,s=e==null?0:e.length,o=0,r=[];++n<s;){var i=e[n];t(i,n,e)&&(r[o++]=i)}return r}function l5(){return[]}var c5=Object.prototype,u5=c5.propertyIsEnumerable,EI=Object.getOwnPropertySymbols,d5=EI?function(e){return e==null?[]:(e=Object(e),a5(EI(e),function(t){return u5.call(e,t)}))}:l5;function h5(e,t,n){var s=t(e);return Qo(e)?s:yI(s,n(e))}function OC(e){return h5(e,gI,d5)}var MC=Gl(Dr,"DataView"),NC=Gl(Dr,"Promise"),iu=Gl(Dr,"Set"),_I="[object Map]",f5="[object Object]",RI="[object Promise]",DI="[object Set]",TI="[object WeakMap]",II="[object DataView]",p5=Hl(MC),g5=Hl(Ah),m5=Hl(NC),v5=Hl(iu),y5=Hl(_C),er=ou;(MC&&er(new MC(new ArrayBuffer(1)))!=II||Ah&&er(new Ah)!=_I||NC&&er(NC.resolve())!=RI||iu&&er(new iu)!=DI||_C&&er(new _C)!=TI)&&(er=function(e){var t=ou(e),n=t==f5?e.constructor:void 0,s=n?Hl(n):"";if(s)switch(s){case p5:return II;case g5:return _I;case m5:return RI;case v5:return DI;case y5:return TI}return t});var w5=Object.prototype,C5=w5.hasOwnProperty;function b5(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&C5.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var zg=Dr.Uint8Array;function LC(e){var t=new e.constructor(e.byteLength);return new zg(t).set(new zg(e)),t}function S5(e,t){var n=LC(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var E5=/\w*$/;function _5(e){var t=new e.constructor(e.source,E5.exec(e));return t.lastIndex=e.lastIndex,t}var xI=Jo?Jo.prototype:void 0,FI=xI?xI.valueOf:void 0;function R5(e){return FI?Object(FI.call(e)):{}}function D5(e,t){var n=LC(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}var T5="[object Boolean]",I5="[object Date]",x5="[object Map]",F5="[object Number]",P5="[object RegExp]",A5="[object Set]",k5="[object String]",O5="[object Symbol]",M5="[object ArrayBuffer]",N5="[object DataView]",L5="[object Float32Array]",V5="[object Float64Array]",B5="[object Int8Array]",$5="[object Int16Array]",H5="[object Int32Array]",G5="[object Uint8Array]",U5="[object Uint8ClampedArray]",W5="[object Uint16Array]",z5="[object Uint32Array]";function j5(e,t,n){var s=e.constructor;switch(t){case M5:return LC(e);case T5:case I5:return new s(+e);case N5:return S5(e);case L5:case V5:case B5:case $5:case H5:case G5:case U5:case W5:case z5:return D5(e);case x5:return new s;case F5:case k5:return new s(e);case P5:return _5(e);case A5:return new s;case O5:return R5(e)}}function K5(e){return typeof e.constructor=="function"&&!IC(e)?t6(q4(e)):{}}var q5="[object Map]";function Y5(e){return Ki(e)&&er(e)==q5}var PI=ru&&ru.isMap,Z5=PI?xC(PI):Y5,X5="[object Set]";function J5(e){return Ki(e)&&er(e)==X5}var AI=ru&&ru.isSet,Q5=AI?xC(AI):J5,kI="[object Arguments]",e8="[object Array]",t8="[object Boolean]",n8="[object Date]",s8="[object Error]",OI="[object Function]",o8="[object GeneratorFunction]",r8="[object Map]",i8="[object Number]",MI="[object Object]",a8="[object RegExp]",l8="[object Set]",c8="[object String]",u8="[object Symbol]",d8="[object WeakMap]",h8="[object ArrayBuffer]",f8="[object DataView]",p8="[object Float32Array]",g8="[object Float64Array]",m8="[object Int8Array]",v8="[object Int16Array]",y8="[object Int32Array]",w8="[object Uint8Array]",C8="[object Uint8ClampedArray]",b8="[object Uint16Array]",S8="[object Uint32Array]",Fn={};Fn[kI]=Fn[e8]=Fn[h8]=Fn[f8]=Fn[t8]=Fn[n8]=Fn[p8]=Fn[g8]=Fn[m8]=Fn[v8]=Fn[y8]=Fn[r8]=Fn[i8]=Fn[MI]=Fn[a8]=Fn[l8]=Fn[c8]=Fn[u8]=Fn[w8]=Fn[C8]=Fn[b8]=Fn[S8]=!0,Fn[s8]=Fn[OI]=Fn[d8]=!1;function jg(e,t,n,s,o,r){var i;if(i!==void 0)return i;if(!La(e))return e;var a=Qo(e);if(a)i=b5(e);else{var l=er(e),c=l==OI||l==o8;if(xh(e))return i5(e);if(l==MI||l==kI||c&&!o)i=c?{}:K5(e);else{if(!Fn[l])return o?e:{};i=j5(e,l)}}r||(r=new ri);var u=r.get(e);if(u)return u;r.set(e,i),Q5(e)?e.forEach(function(f){i.add(jg(f,t,n,f,e,r))}):Z5(e)&&e.forEach(function(f,p){i.set(p,jg(f,t,n,p,e,r))});var d=OC,h=a?void 0:d(e);return d6(h||e,function(f,p){h&&(p=f,f=e[p]),S6(i,p,jg(f,t,n,p,e,r))}),i}var E8=1,_8=4;function NI(e){return jg(e,E8|_8)}var R8="__lodash_hash_undefined__";function D8(e){return this.__data__.set(e,R8),this}function T8(e){return this.__data__.has(e)}function kh(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Yi;++t<n;)this.add(e[t])}kh.prototype.add=kh.prototype.push=D8,kh.prototype.has=T8;function I8(e,t){for(var n=-1,s=e==null?0:e.length;++n<s;)if(t(e[n],n,e))return!0;return!1}function LI(e,t){return e.has(t)}var x8=1,F8=2;function VI(e,t,n,s,o,r){var i=n&x8,a=e.length,l=t.length;if(a!=l&&!(i&&l>a))return!1;var c=r.get(e),u=r.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,f=n&F8?new kh:void 0;for(r.set(e,t),r.set(t,e);++d<a;){var p=e[d],g=t[d];if(s)var v=i?s(g,p,d,t,e,r):s(p,g,d,e,t,r);if(v!==void 0){if(v)continue;h=!1;break}if(f){if(!I8(t,function(C,S){if(!LI(f,S)&&(p===C||o(p,C,n,s,r)))return f.push(S)})){h=!1;break}}else if(!(p===g||o(p,g,n,s,r))){h=!1;break}}return r.delete(e),r.delete(t),h}function P8(e){var t=-1,n=Array(e.size);return e.forEach(function(s,o){n[++t]=[o,s]}),n}function VC(e){var t=-1,n=Array(e.size);return e.forEach(function(s){n[++t]=s}),n}var A8=1,k8=2,O8="[object Boolean]",M8="[object Date]",N8="[object Error]",L8="[object Map]",V8="[object Number]",B8="[object RegExp]",$8="[object Set]",H8="[object String]",G8="[object Symbol]",U8="[object ArrayBuffer]",W8="[object DataView]",BI=Jo?Jo.prototype:void 0,BC=BI?BI.valueOf:void 0;function z8(e,t,n,s,o,r,i){switch(n){case W8:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case U8:return!(e.byteLength!=t.byteLength||!r(new zg(e),new zg(t)));case O8:case M8:case V8:return RC(+e,+t);case N8:return e.name==t.name&&e.message==t.message;case B8:case H8:return e==t+"";case L8:var a=P8;case $8:var l=s&A8;if(a||(a=VC),e.size!=t.size&&!l)return!1;var c=i.get(e);if(c)return c==t;s|=k8,i.set(e,t);var u=VI(a(e),a(t),s,o,r,i);return i.delete(e),u;case G8:if(BC)return BC.call(e)==BC.call(t)}return!1}var j8=1,K8=Object.prototype,q8=K8.hasOwnProperty;function Y8(e,t,n,s,o,r){var i=n&j8,a=OC(e),l=a.length,c=OC(t),u=c.length;if(l!=u&&!i)return!1;for(var d=l;d--;){var h=a[d];if(!(i?h in t:q8.call(t,h)))return!1}var f=r.get(e),p=r.get(t);if(f&&p)return f==t&&p==e;var g=!0;r.set(e,t),r.set(t,e);for(var v=i;++d<l;){h=a[d];var C=e[h],S=t[h];if(s)var b=i?s(S,C,h,t,e,r):s(C,S,h,e,t,r);if(!(b===void 0?C===S||o(C,S,n,s,r):b)){g=!1;break}v||(v=h=="constructor")}if(g&&!v){var w=e.constructor,D=t.constructor;w!=D&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof D=="function"&&D instanceof D)&&(g=!1)}return r.delete(e),r.delete(t),g}var Z8=1,$I="[object Arguments]",HI="[object Array]",Kg="[object Object]",X8=Object.prototype,GI=X8.hasOwnProperty;function J8(e,t,n,s,o,r){var i=Qo(e),a=Qo(t),l=i?HI:er(e),c=a?HI:er(t);l=l==$I?Kg:l,c=c==$I?Kg:c;var u=l==Kg,d=c==Kg,h=l==c;if(h&&xh(e)){if(!xh(t))return!1;i=!0,u=!1}if(h&&!u)return r||(r=new ri),i||PC(e)?VI(e,t,n,s,o,r):z8(e,t,l,n,s,o,r);if(!(n&Z8)){var f=u&&GI.call(e,"__wrapped__"),p=d&&GI.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,v=p?t.value():t;return r||(r=new ri),o(g,v,n,s,r)}}return h?(r||(r=new ri),Y8(e,t,n,s,o,r)):!1}function $C(e,t,n,s,o){return e===t?!0:e==null||t==null||!Ki(e)&&!Ki(t)?e!==e&&t!==t:J8(e,t,n,s,$C,o)}var Q8=1,ej=2;function tj(e,t,n,s){var o=n.length,r=o;if(e==null)return!r;for(e=Object(e);o--;){var i=n[o];if(i[2]?i[1]!==e[i[0]]:!(i[0]in e))return!1}for(;++o<r;){i=n[o];var a=i[0],l=e[a],c=i[1];if(i[2]){if(l===void 0&&!(a in e))return!1}else{var u=new ri,d;if(!(d===void 0?$C(c,l,Q8|ej,s,u):d))return!1}}return!0}function UI(e){return e===e&&!La(e)}function nj(e){for(var t=gI(e),n=t.length;n--;){var s=t[n],o=e[s];t[n]=[s,o,UI(o)]}return t}function WI(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function sj(e){var t=nj(e);return t.length==1&&t[0][2]?WI(t[0][0],t[0][1]):function(n){return n===e||tj(n,e,t)}}function oj(e,t){return e!=null&&t in Object(e)}function rj(e,t,n){t=mI(t,e);for(var s=-1,o=t.length,r=!1;++s<o;){var i=Wg(t[s]);if(!(r=e!=null&&n(e,i)))break;e=e[i]}return r||++s!=o?r:(o=e==null?0:e.length,!!o&&DC(o)&&oI(i,o)&&(Qo(e)||Hg(e)))}function ij(e,t){return e!=null&&rj(e,t,oj)}var aj=1,lj=2;function cj(e,t){return AC(e)&&UI(t)?WI(Wg(e),t):function(n){var s=z4(n,e);return s===void 0&&s===t?ij(n,e):$C(t,s,aj|lj)}}function uj(e){return function(t){return t==null?void 0:t[e]}}function dj(e){return function(t){return vI(t,e)}}function hj(e){return AC(e)?uj(Wg(e)):dj(e)}function fj(e){return typeof e=="function"?e:e==null?SC:typeof e=="object"?Qo(e)?cj(e[0],e[1]):sj(e):hj(e)}var HC=function(){return Dr.Date.now()},pj="Expected a function",gj=Math.max,mj=Math.min;function Tr(e,t,n){var s,o,r,i,a,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(pj);t=bC(t)||0,La(n)&&(u=!!n.leading,d="maxWait"in n,r=d?gj(bC(n.maxWait)||0,t):r,h="trailing"in n?!!n.trailing:h);function f(R){var T=s,I=o;return s=o=void 0,c=R,i=e.apply(I,T),i}function p(R){return c=R,a=setTimeout(C,t),u?f(R):i}function g(R){var T=R-l,I=R-c,x=t-T;return d?mj(x,r-I):x}function v(R){var T=R-l,I=R-c;return l===void 0||T>=t||T<0||d&&I>=r}function C(){var R=HC();if(v(R))return S(R);a=setTimeout(C,g(R))}function S(R){return a=void 0,h&&s?f(R):(s=o=void 0,i)}function b(){a!==void 0&&clearTimeout(a),c=0,s=l=o=a=void 0}function w(){return a===void 0?i:S(HC())}function D(){var R=HC(),T=v(R);if(s=arguments,o=this,l=R,T){if(a===void 0)return p(l);if(d)return clearTimeout(a),a=setTimeout(C,t),f(l)}return a===void 0&&(a=setTimeout(C,t)),i}return D.cancel=b,D.flush=w,D}function zI(e){return Ki(e)&&TC(e)}function vj(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var yj="[object Map]",wj="[object Set]",Cj=Object.prototype,bj=Cj.hasOwnProperty;function Sj(e){if(e==null)return!0;if(TC(e)&&(Qo(e)||typeof e=="string"||typeof e.splice=="function"||xh(e)||PC(e)||Hg(e)))return!e.length;var t=er(e);if(t==yj||t==wj)return!e.size;if(IC(e))return!pI(e).length;for(var n in e)if(bj.call(e,n))return!1;return!0}var Ej=1/0,_j=iu&&1/VC(new iu([,-0]))[1]==Ej?function(e){return new iu(e)}:s6,Rj=200;function Dj(e,t,n){var s=-1,o=m6,r=e.length,i=!0,a=[],l=a;if(r>=Rj){var c=t?null:_j(e);if(c)return VC(c);i=!1,o=LI,l=new kh}else l=t?[]:a;e:for(;++s<r;){var u=e[s],d=t?t(u):u;if(u=u!==0?u:0,i&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),a.push(u)}else o(l,d,n)||(l!==a&&l.push(d),a.push(u))}return a}var au=_6(function(e){var t=vj(e);return zI(t)&&(t=void 0),Dj(K4(e,1,zI),fj(t))});const ts=(e,t)=>{const n=es();return{apiServices:q(()=>{var i;const o=n==null?void 0:n.appContext.config.globalProperties,r=(i=t.params)==null?void 0:i.context;if(o!=null&&o.apiServices)return o.apiServices;if(e&&(r!=null&&r.apiServices))return r.apiServices})}},Tj=e=>{const t=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return t?decodeURIComponent(t[2]):null};let Wl=class extends Error{};class Ij extends Wl{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class xj extends Wl{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Fj extends Wl{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class lu extends Wl{}class jI extends Wl{constructor(t){super(`Invalid unit ${t}`)}}class Bs extends Wl{}let Va=class extends Wl{constructor(){super("Zone is an abstract class")}};const _t="numeric",Ir="short",Ao="long",qg={year:_t,month:_t,day:_t},KI={year:_t,month:Ir,day:_t},Pj={year:_t,month:Ir,day:_t,weekday:Ir},qI={year:_t,month:Ao,day:_t},YI={year:_t,month:Ao,day:_t,weekday:Ao},ZI={hour:_t,minute:_t},XI={hour:_t,minute:_t,second:_t},JI={hour:_t,minute:_t,second:_t,timeZoneName:Ir},QI={hour:_t,minute:_t,second:_t,timeZoneName:Ao},ex={hour:_t,minute:_t,hourCycle:"h23"},tx={hour:_t,minute:_t,second:_t,hourCycle:"h23"},nx={hour:_t,minute:_t,second:_t,hourCycle:"h23",timeZoneName:Ir},sx={hour:_t,minute:_t,second:_t,hourCycle:"h23",timeZoneName:Ao},ox={year:_t,month:_t,day:_t,hour:_t,minute:_t},rx={year:_t,month:_t,day:_t,hour:_t,minute:_t,second:_t},ix={year:_t,month:Ir,day:_t,hour:_t,minute:_t},ax={year:_t,month:Ir,day:_t,hour:_t,minute:_t,second:_t},Aj={year:_t,month:Ir,day:_t,weekday:Ir,hour:_t,minute:_t},lx={year:_t,month:Ao,day:_t,hour:_t,minute:_t,timeZoneName:Ir},cx={year:_t,month:Ao,day:_t,hour:_t,minute:_t,second:_t,timeZoneName:Ir},ux={year:_t,month:Ao,day:_t,weekday:Ao,hour:_t,minute:_t,timeZoneName:Ao},dx={year:_t,month:Ao,day:_t,weekday:Ao,hour:_t,minute:_t,second:_t,timeZoneName:Ao};let Oh=class{get type(){throw new Va}get name(){throw new Va}get ianaName(){return this.name}get isUniversal(){throw new Va}offsetName(t,n){throw new Va}formatOffset(t,n){throw new Va}offset(t){throw new Va}equals(t){throw new Va}get isValid(){throw new Va}},GC=null;class Yg extends Oh{static get instance(){return GC===null&&(GC=new Yg),GC}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return Lx(t,n,s)}formatOffset(t,n){return Vh(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const UC=new Map;function kj(e){let t=UC.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"}),UC.set(e,t)),t}const Oj={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Mj(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,r,i,a,l,c,u]=s;return[i,o,r,a,l,c,u]}function Nj(e,t){const n=e.formatToParts(t),s=[];for(let o=0;o<n.length;o++){const{type:r,value:i}=n[o],a=Oj[r];r==="era"?s[a]=i:Ht(a)||(s[a]=parseInt(i,10))}return s}const WC=new Map;let cu=class Z_ extends Oh{static create(t){let n=WC.get(t);return n===void 0&&WC.set(t,n=new Z_(t)),n}static resetCache(){WC.clear(),UC.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=Z_.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return Lx(t,n,s,this.name)}formatOffset(t,n){return Vh(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const s=kj(this.name);let[o,r,i,a,l,c,u]=s.formatToParts?Nj(s,n):Mj(s,n);a==="BC"&&(o=-Math.abs(o)+1);const h=em({year:o,month:r,day:i,hour:l===24?0:l,minute:c,second:u,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}},hx={};function Lj(e,t={}){const n=JSON.stringify([e,t]);let s=hx[n];return s||(s=new Intl.ListFormat(e,t),hx[n]=s),s}const zC=new Map;function jC(e,t={}){const n=JSON.stringify([e,t]);let s=zC.get(n);return s===void 0&&(s=new Intl.DateTimeFormat(e,t),zC.set(n,s)),s}const KC=new Map;function Vj(e,t={}){const n=JSON.stringify([e,t]);let s=KC.get(n);return s===void 0&&(s=new Intl.NumberFormat(e,t),KC.set(n,s)),s}const qC=new Map;function Bj(e,t={}){const{base:n,...s}=t,o=JSON.stringify([e,s]);let r=qC.get(o);return r===void 0&&(r=new Intl.RelativeTimeFormat(e,t),qC.set(o,r)),r}let Mh=null;function $j(){return Mh||(Mh=new Intl.DateTimeFormat().resolvedOptions().locale,Mh)}const YC=new Map;function fx(e){let t=YC.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),YC.set(e,t)),t}const ZC=new Map;function Hj(e){let t=ZC.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...px,...t}),ZC.set(e,t)}return t}function Gj(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let s,o;try{s=jC(e).resolvedOptions(),o=e}catch{const l=e.substring(0,n);s=jC(l).resolvedOptions(),o=l}const{numberingSystem:r,calendar:i}=s;return[o,r,i]}}function Uj(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Wj(e){const t=[];for(let n=1;n<=12;n++){const s=bt.utc(2009,n,1);t.push(e(s))}return t}function zj(e){const t=[];for(let n=1;n<=7;n++){const s=bt.utc(2016,11,13+n);t.push(e(s))}return t}function Zg(e,t,n,s){const o=e.listingMode();return o==="error"?null:o==="en"?n(t):s(t)}function jj(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||fx(e.locale).numberingSystem==="latn"}class Kj{constructor(t,n,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:o,floor:r,...i}=s;if(!n||Object.keys(i).length>0){const a={useGrouping:!1,...s};s.padTo>0&&(a.minimumIntegerDigits=s.padTo),this.inf=Vj(t,a)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):rb(t,3);return us(n,this.padTo)}}}class qj{constructor(t,n,s){this.opts=s,this.originalZone=void 0;let o;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const i=-1*(t.offset/60),a=i>=0?`Etc/GMT+${i}`:`Etc/GMT${i}`;t.offset!==0&&cu.create(a).valid?(o=a,this.dt=t):(o="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,o=t.zone.name):(o="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const r={...this.opts};r.timeZone=r.timeZone||o,this.dtf=jC(n,r)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const s=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:s}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class Yj{constructor(t,n,s){this.opts={style:"long",...s},!n&&kx()&&(this.rtf=Bj(t,s))}format(t,n){return this.rtf?this.rtf.format(t,n):vK(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const px={firstDay:1,minimalDays:4,weekend:[6,7]};class Sn{static fromOpts(t){return Sn.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,s,o,r=!1){const i=t||Yn.defaultLocale,a=i||(r?"en-US":$j()),l=n||Yn.defaultNumberingSystem,c=s||Yn.defaultOutputCalendar,u=sb(o)||Yn.defaultWeekSettings;return new Sn(a,l,c,u,i)}static resetCache(){Mh=null,zC.clear(),KC.clear(),qC.clear(),YC.clear(),ZC.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:s,weekSettings:o}={}){return Sn.create(t,n,s,o)}constructor(t,n,s,o,r){const[i,a,l]=Gj(t);this.locale=i,this.numberingSystem=n||a||null,this.outputCalendar=s||l||null,this.weekSettings=o,this.intl=Uj(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=jj(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Sn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,sb(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return Zg(this,t,$x,()=>{const s=this.intl==="ja"||this.intl.startsWith("ja-");n&=!s;const o=n?{month:t,day:"numeric"}:{month:t},r=n?"format":"standalone";if(!this.monthsCache[r][t]){const i=s?a=>this.dtFormatter(a,o).format():a=>this.extract(a,o,"month");this.monthsCache[r][t]=Wj(i)}return this.monthsCache[r][t]})}weekdays(t,n=!1){return Zg(this,t,Ux,()=>{const s=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=zj(r=>this.extract(r,s,"weekday"))),this.weekdaysCache[o][t]})}meridiems(){return Zg(this,void 0,()=>Wx,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[bt.utc(2016,11,13,9),bt.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Zg(this,t,zx,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[bt.utc(-40,1,1),bt.utc(2017,1,1)].map(s=>this.extract(s,n,"era"))),this.eraCache[t]})}extract(t,n,s){const o=this.dtFormatter(t,n),r=o.formatToParts(),i=r.find(a=>a.type.toLowerCase()===s);return i?i.value:null}numberFormatter(t={}){return new Kj(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new qj(t,this.intl,n)}relFormatter(t={}){return new Yj(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Lj(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||fx(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Ox()?Hj(this.locale):px}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let XC=null,ii=class Tp extends Oh{static get utcInstance(){return XC===null&&(XC=new Tp(0)),XC}static instance(t){return t===0?Tp.utcInstance:new Tp(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Tp(tm(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Vh(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Vh(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Vh(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}};class Zj extends Oh{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Ba(e,t){if(Ht(e)||e===null)return t;if(e instanceof Oh)return e;if(nK(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Yg.instance:n==="utc"||n==="gmt"?ii.utcInstance:ii.parseSpecifier(n)||cu.create(e)}else return $a(e)?ii.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Zj(e)}const JC={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},gx={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Xj=JC.hanidec.replace(/[\[|\]]/g,"").split("");function Jj(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);if(e[n].search(JC.hanidec)!==-1)t+=Xj.indexOf(e[n]);else for(const o in gx){const[r,i]=gx[o];s>=r&&s<=i&&(t+=s-r)}}return parseInt(t,10)}else return t}const QC=new Map;function Qj(){QC.clear()}function xr({numberingSystem:e},t=""){const n=e||"latn";let s=QC.get(n);s===void 0&&(s=new Map,QC.set(n,s));let o=s.get(t);return o===void 0&&(o=new RegExp(`${JC[n]}${t}`),s.set(t,o)),o}let mx=()=>Date.now(),vx="system",yx=null,wx=null,Cx=null,bx=60,Sx,Ex=null;class Yn{static get now(){return mx}static set now(t){mx=t}static set defaultZone(t){vx=t}static get defaultZone(){return Ba(vx,Yg.instance)}static get defaultLocale(){return yx}static set defaultLocale(t){yx=t}static get defaultNumberingSystem(){return wx}static set defaultNumberingSystem(t){wx=t}static get defaultOutputCalendar(){return Cx}static set defaultOutputCalendar(t){Cx=t}static get defaultWeekSettings(){return Ex}static set defaultWeekSettings(t){Ex=sb(t)}static get twoDigitCutoffYear(){return bx}static set twoDigitCutoffYear(t){bx=t%100}static get throwOnInvalid(){return Sx}static set throwOnInvalid(t){Sx=t}static resetCaches(){Sn.resetCache(),cu.resetCache(),bt.resetCache(),Qj()}}class Fr{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const _x=[0,31,59,90,120,151,181,212,243,273,304,334],Rx=[0,31,60,91,121,152,182,213,244,274,305,335];function tr(e,t){return new Fr("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function eb(e,t,n){const s=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const o=s.getUTCDay();return o===0?7:o}function Dx(e,t,n){return n+(Nh(e)?Rx:_x)[t-1]}function Tx(e,t){const n=Nh(e)?Rx:_x,s=n.findIndex(r=>r<t),o=t-n[s];return{month:s+1,day:o}}function tb(e,t){return(e-t+7)%7+1}function Xg(e,t=4,n=1){const{year:s,month:o,day:r}=e,i=Dx(s,o,r),a=tb(eb(s,o,r),n);let l=Math.floor((i-a+14-t)/7),c;return l<1?(c=s-1,l=Lh(c,t,n)):l>Lh(s,t,n)?(c=s+1,l=1):c=s,{weekYear:c,weekNumber:l,weekday:a,...sm(e)}}function Ix(e,t=4,n=1){const{weekYear:s,weekNumber:o,weekday:r}=e,i=tb(eb(s,1,t),n),a=du(s);let l=o*7+r-i-7+t,c;l<1?(c=s-1,l+=du(c)):l>a?(c=s+1,l-=du(s)):c=s;const{month:u,day:d}=Tx(c,l);return{year:c,month:u,day:d,...sm(e)}}function nb(e){const{year:t,month:n,day:s}=e,o=Dx(t,n,s);return{year:t,ordinal:o,...sm(e)}}function xx(e){const{year:t,ordinal:n}=e,{month:s,day:o}=Tx(t,n);return{year:t,month:s,day:o,...sm(e)}}function Fx(e,t){if(!Ht(e.localWeekday)||!Ht(e.localWeekNumber)||!Ht(e.localWeekYear)){if(!Ht(e.weekday)||!Ht(e.weekNumber)||!Ht(e.weekYear))throw new lu("Cannot mix locale-based week fields with ISO-based week fields");return Ht(e.localWeekday)||(e.weekday=e.localWeekday),Ht(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Ht(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function eK(e,t=4,n=1){const s=Jg(e.weekYear),o=nr(e.weekNumber,1,Lh(e.weekYear,t,n)),r=nr(e.weekday,1,7);return s?o?r?!1:tr("weekday",e.weekday):tr("week",e.weekNumber):tr("weekYear",e.weekYear)}function tK(e){const t=Jg(e.year),n=nr(e.ordinal,1,du(e.year));return t?n?!1:tr("ordinal",e.ordinal):tr("year",e.year)}function Px(e){const t=Jg(e.year),n=nr(e.month,1,12),s=nr(e.day,1,Qg(e.year,e.month));return t?n?s?!1:tr("day",e.day):tr("month",e.month):tr("year",e.year)}function Ax(e){const{hour:t,minute:n,second:s,millisecond:o}=e,r=nr(t,0,23)||t===24&&n===0&&s===0&&o===0,i=nr(n,0,59),a=nr(s,0,59),l=nr(o,0,999);return r?i?a?l?!1:tr("millisecond",o):tr("second",s):tr("minute",n):tr("hour",t)}function Ht(e){return typeof e>"u"}function $a(e){return typeof e=="number"}function Jg(e){return typeof e=="number"&&e%1===0}function nK(e){return typeof e=="string"}function sK(e){return Object.prototype.toString.call(e)==="[object Date]"}function kx(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Ox(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function oK(e){return Array.isArray(e)?e:[e]}function Mx(e,t,n){if(e.length!==0)return e.reduce((s,o)=>{const r=[t(o),o];return s&&n(s[0],r[0])===s[0]?s:r},null)[1]}function rK(e,t){return t.reduce((n,s)=>(n[s]=e[s],n),{})}function uu(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function sb(e){if(e==null)return null;if(typeof e!="object")throw new Bs("Week settings must be an object");if(!nr(e.firstDay,1,7)||!nr(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!nr(t,1,7)))throw new Bs("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function nr(e,t,n){return Jg(e)&&e>=t&&e<=n}function iK(e,t){return e-t*Math.floor(e/t)}function us(e,t=2){const n=e<0;let s;return n?s="-"+(""+-e).padStart(t,"0"):s=(""+e).padStart(t,"0"),s}function Ha(e){if(!(Ht(e)||e===null||e===""))return parseInt(e,10)}function zl(e){if(!(Ht(e)||e===null||e===""))return parseFloat(e)}function ob(e){if(!(Ht(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function rb(e,t,n="round"){const s=10**t;switch(n){case"expand":return e>0?Math.ceil(e*s)/s:Math.floor(e*s)/s;case"trunc":return Math.trunc(e*s)/s;case"round":return Math.round(e*s)/s;case"floor":return Math.floor(e*s)/s;case"ceil":return Math.ceil(e*s)/s;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function Nh(e){return e%4===0&&(e%100!==0||e%400===0)}function du(e){return Nh(e)?366:365}function Qg(e,t){const n=iK(t-1,12)+1,s=e+(t-n)/12;return n===2?Nh(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function em(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 Nx(e,t,n){return-tb(eb(e,1,t),n)+t-1}function Lh(e,t=4,n=1){const s=Nx(e,t,n),o=Nx(e+1,t,n);return(du(e)-s+o)/7}function ib(e){return e>99?e:e>Yn.twoDigitCutoffYear?1900+e:2e3+e}function Lx(e,t,n,s=null){const o=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(r.timeZone=s);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function tm(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 Vx(e){const t=Number(e);if(typeof e=="boolean"||e===""||!Number.isFinite(t))throw new Bs(`Invalid unit value ${e}`);return t}function nm(e,t){const n={};for(const s in e)if(uu(e,s)){const o=e[s];if(o==null)continue;n[t(s)]=Vx(o)}return n}function Vh(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}${us(n,2)}:${us(s,2)}`;case"narrow":return`${o}${n}${s>0?`:${s}`:""}`;case"techie":return`${o}${us(n,2)}${us(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function sm(e){return rK(e,["hour","minute","second","millisecond"])}const aK=["January","February","March","April","May","June","July","August","September","October","November","December"],Bx=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],lK=["J","F","M","A","M","J","J","A","S","O","N","D"];function $x(e){switch(e){case"narrow":return[...lK];case"short":return[...Bx];case"long":return[...aK];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Hx=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Gx=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],cK=["M","T","W","T","F","S","S"];function Ux(e){switch(e){case"narrow":return[...cK];case"short":return[...Gx];case"long":return[...Hx];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Wx=["AM","PM"],uK=["Before Christ","Anno Domini"],dK=["BC","AD"],hK=["B","A"];function zx(e){switch(e){case"narrow":return[...hK];case"short":return[...dK];case"long":return[...uK];default:return null}}function fK(e){return Wx[e.hour<12?0:1]}function pK(e,t){return Ux(t)[e.weekday-1]}function gK(e,t){return $x(t)[e.month-1]}function mK(e,t){return zx(t)[e.year<0?0:1]}function vK(e,t,n="always",s=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},r=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&r){const d=e==="days";switch(t){case 1:return d?"tomorrow":`next ${o[e][0]}`;case-1:return d?"yesterday":`last ${o[e][0]}`;case 0:return d?"today":`this ${o[e][0]}`}}const i=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,c=o[e],u=s?l?c[1]:c[2]||c[1]:l?o[e][0]:e;return i?`${a} ${u} ago`:`in ${a} ${u}`}function jx(e,t){let n="";for(const s of e)s.literal?n+=s.val:n+=t(s.val);return n}const yK={D:qg,DD:KI,DDD:qI,DDDD:YI,t:ZI,tt:XI,ttt:JI,tttt:QI,T:ex,TT:tx,TTT:nx,TTTT:sx,f:ox,ff:ix,fff:lx,ffff:ux,F:rx,FF:ax,FFF:cx,FFFF:dx};class $s{static create(t,n={}){return new $s(t,n)}static parseFormat(t){let n=null,s="",o=!1;const r=[];for(let i=0;i<t.length;i++){const a=t.charAt(i);a==="'"?((s.length>0||o)&&r.push({literal:o||/^\s+$/.test(s),val:s===""?"'":s}),n=null,s="",o=!o):o||a===n?s+=a:(s.length>0&&r.push({literal:/^\s+$/.test(s),val:s}),s=a,n=a)}return s.length>0&&r.push({literal:o||/^\s+$/.test(s),val:s}),r}static macroTokenToFormatOpts(t){return yK[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0,s=void 0){if(this.opts.forceSimple)return us(t,n);const o={...this.opts};return n>0&&(o.padTo=n),s&&(o.signDisplay=s),this.loc.numberFormatter(o).format(t)}formatDateTimeFromString(t,n){const s=this.loc.listingMode()==="en",o=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",r=(f,p)=>this.loc.extract(t,f,p),i=f=>t.isOffsetFixed&&t.offset===0&&f.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,f.format):"",a=()=>s?fK(t):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,p)=>s?gK(t,f):r(p?{month:f}:{month:f,day:"numeric"},"month"),c=(f,p)=>s?pK(t,f):r(p?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),u=f=>{const p=$s.macroTokenToFormatOpts(f);return p?this.formatWithSystemDefault(t,p):f},d=f=>s?mK(t,f):r({era:f},"era"),h=f=>{switch(f){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return o?r({day:"numeric"},"day"):this.num(t.day);case"dd":return o?r({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return o?r({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return o?r({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return o?r({month:"numeric"},"month"):this.num(t.month);case"MM":return o?r({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return o?r({year:"numeric"},"year"):this.num(t.year);case"yy":return o?r({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return o?r({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return o?r({year:"numeric"},"year"):this.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return u(f)}};return jx($s.parseFormat(n),h)}formatDurationFromString(t,n){const s=this.opts.signMode==="negativeLargestOnly"?-1:1,o=u=>{switch(u[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},r=(u,d)=>h=>{const f=o(h);if(f){const p=d.isNegativeDuration&&f!==d.largestUnit?s:1;let g;return this.opts.signMode==="negativeLargestOnly"&&f!==d.largestUnit?g="never":this.opts.signMode==="all"?g="always":g="auto",this.num(u.get(f)*p,h.length,g)}else return h},i=$s.parseFormat(n),a=i.reduce((u,{literal:d,val:h})=>d?u:u.concat(h),[]),l=t.shiftTo(...a.map(o).filter(u=>u)),c={isNegativeDuration:l<0,largestUnit:Object.keys(l.values)[0]};return jx(i,r(l,c))}}const Kx=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function hu(...e){const t=e.reduce((n,s)=>n+s.source,"");return RegExp(`^${t}$`)}function fu(...e){return t=>e.reduce(([n,s,o],r)=>{const[i,a,l]=r(t,o);return[{...n,...i},a||s,l]},[{},null,1]).slice(0,2)}function pu(e,...t){if(e==null)return[null,null];for(const[n,s]of t){const o=n.exec(e);if(o)return s(o)}return[null,null]}function qx(...e){return(t,n)=>{const s={};let o;for(o=0;o<e.length;o++)s[e[o]]=Ha(t[n+o]);return[s,null,n+o]}}const Yx=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,wK=`(?:${Yx.source}?(?:\\[(${Kx.source})\\])?)?`,ab=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Zx=RegExp(`${ab.source}${wK}`),lb=RegExp(`(?:[Tt]${Zx.source})?`),CK=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,bK=/(\d{4})-?W(\d\d)(?:-?(\d))?/,SK=/(\d{4})-?(\d{3})/,EK=qx("weekYear","weekNumber","weekDay"),_K=qx("year","ordinal"),RK=/(\d{4})-(\d\d)-(\d\d)/,Xx=RegExp(`${ab.source} ?(?:${Yx.source}|(${Kx.source}))?`),DK=RegExp(`(?: ${Xx.source})?`);function gu(e,t,n){const s=e[t];return Ht(s)?n:Ha(s)}function TK(e,t){return[{year:gu(e,t),month:gu(e,t+1,1),day:gu(e,t+2,1)},null,t+3]}function mu(e,t){return[{hours:gu(e,t,0),minutes:gu(e,t+1,0),seconds:gu(e,t+2,0),milliseconds:ob(e[t+3])},null,t+4]}function Bh(e,t){const n=!e[t]&&!e[t+1],s=tm(e[t+1],e[t+2]),o=n?null:ii.instance(s);return[{},o,t+3]}function $h(e,t){const n=e[t]?cu.create(e[t]):null;return[{},n,t+1]}const IK=RegExp(`^T?${ab.source}$`),xK=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function FK(e){const[t,n,s,o,r,i,a,l,c]=e,u=t[0]==="-",d=l&&l[0]==="-",h=(f,p=!1)=>f!==void 0&&(p||f&&u)?-f:f;return[{years:h(zl(n)),months:h(zl(s)),weeks:h(zl(o)),days:h(zl(r)),hours:h(zl(i)),minutes:h(zl(a)),seconds:h(zl(l),l==="-0"),milliseconds:h(ob(c),d)}]}const PK={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function cb(e,t,n,s,o,r,i){const a={year:t.length===2?ib(Ha(t)):Ha(t),month:Bx.indexOf(n)+1,day:Ha(s),hour:Ha(o),minute:Ha(r)};return i&&(a.second=Ha(i)),e&&(a.weekday=e.length>3?Hx.indexOf(e)+1:Gx.indexOf(e)+1),a}const AK=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function kK(e){const[,t,n,s,o,r,i,a,l,c,u,d]=e,h=cb(t,o,s,n,r,i,a);let f;return l?f=PK[l]:c?f=0:f=tm(u,d),[h,new ii(f)]}function OK(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const MK=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,NK=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,LK=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Jx(e){const[,t,n,s,o,r,i,a]=e;return[cb(t,o,s,n,r,i,a),ii.utcInstance]}function VK(e){const[,t,n,s,o,r,i,a]=e;return[cb(t,a,n,s,o,r,i),ii.utcInstance]}const BK=hu(CK,lb),$K=hu(bK,lb),HK=hu(SK,lb),GK=hu(Zx),Qx=fu(TK,mu,Bh,$h),UK=fu(EK,mu,Bh,$h),WK=fu(_K,mu,Bh,$h),zK=fu(mu,Bh,$h);function jK(e){return pu(e,[BK,Qx],[$K,UK],[HK,WK],[GK,zK])}function KK(e){return pu(OK(e),[AK,kK])}function qK(e){return pu(e,[MK,Jx],[NK,Jx],[LK,VK])}function YK(e){return pu(e,[xK,FK])}const ZK=fu(mu);function XK(e){return pu(e,[IK,ZK])}const JK=hu(RK,DK),QK=hu(Xx),e9=fu(mu,Bh,$h);function t9(e){return pu(e,[JK,Qx],[QK,e9])}const eF="Invalid Duration",tF={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},n9={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...tF},sr=146097/400,vu=146097/4800,s9={years:{quarters:4,months:12,weeks:sr/7,days:sr,hours:sr*24,minutes:sr*24*60,seconds:sr*24*60*60,milliseconds:sr*24*60*60*1e3},quarters:{months:3,weeks:sr/28,days:sr/4,hours:sr*24/4,minutes:sr*24*60/4,seconds:sr*24*60*60/4,milliseconds:sr*24*60*60*1e3/4},months:{weeks:vu/7,days:vu,hours:vu*24,minutes:vu*24*60,seconds:vu*24*60*60,milliseconds:vu*24*60*60*1e3},...tF},jl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],o9=jl.slice(0).reverse();function Zi(e,t,n=!1){const s={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new fn(s)}function nF(e,t){let n=t.milliseconds??0;for(const s of o9.slice(1))t[s]&&(n+=t[s]*e[s].milliseconds);return n}function sF(e,t){const n=nF(e,t)<0?-1:1;jl.reduceRight((s,o)=>{if(Ht(t[o]))return s;if(s){const r=t[s]*n,i=e[o][s],a=Math.floor(r/i);t[o]+=a*n,t[s]-=a*i*n}return o},null),jl.reduce((s,o)=>{if(Ht(t[o]))return s;if(s){const r=t[s]%1;t[s]-=r,t[o]+=r*e[s][o]}return o},null)}function oF(e){const t={};for(const[n,s]of Object.entries(e))s!==0&&(t[n]=s);return t}class fn{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let s=n?s9:n9;t.matrix&&(s=t.matrix),this.values=t.values,this.loc=t.loc||Sn.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(t,n){return fn.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new Bs(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new fn({values:nm(t,fn.normalizeUnit),loc:Sn.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if($a(t))return fn.fromMillis(t);if(fn.isDuration(t))return t;if(typeof t=="object")return fn.fromObject(t);throw new Bs(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[s]=YK(t);return s?fn.fromObject(s,n):fn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[s]=XK(t);return s?fn.fromObject(s,n):fn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the Duration is invalid");const s=t instanceof Fr?t:new Fr(t,n);if(Yn.throwOnInvalid)throw new Fj(s);return new fn({invalid:s})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new jI(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const s={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?$s.create(this.loc,s).formatDurationFromString(this,t):eF}toHuman(t={}){if(!this.isValid)return eF;const n=t.showZeros!==!1,s=jl.map(o=>{const r=this.values[o];return Ht(r)||r===0&&!n?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:o.slice(0,-1)}).format(r)}).filter(o=>o);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(s)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=rb(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},bt.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?nF(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=fn.fromDurationLike(t),s={};for(const o of jl)(uu(n.values,o)||uu(this.values,o))&&(s[o]=n.get(o)+this.get(o));return Zi(this,{values:s},!0)}minus(t){if(!this.isValid)return this;const n=fn.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const s of Object.keys(this.values))n[s]=Vx(t(this.values[s],s));return Zi(this,{values:n},!0)}get(t){return this[fn.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...nm(t,fn.normalizeUnit)};return Zi(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:s,matrix:o}={}){const i={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:o,conversionAccuracy:s};return Zi(this,i)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return sF(this.matrix,t),Zi(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=oF(this.normalize().shiftToAll().toObject());return Zi(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(i=>fn.normalizeUnit(i));const n={},s={},o=this.toObject();let r;for(const i of jl)if(t.indexOf(i)>=0){r=i;let a=0;for(const c in s)a+=this.matrix[c][i]*s[c],s[c]=0;$a(o[i])&&(a+=o[i]);const l=Math.trunc(a);n[i]=l,s[i]=(a*1e3-l*1e3)/1e3}else $a(o[i])&&(s[i]=o[i]);for(const i in s)s[i]!==0&&(n[r]+=i===r?s[i]:s[i]/this.matrix[r][i]);return sF(this.matrix,n),Zi(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Zi(this,{values:t},!0)}removeZeros(){if(!this.isValid)return this;const t=oF(this.values);return Zi(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(s,o){return s===void 0||s===0?o===void 0||o===0:s===o}for(const s of jl)if(!n(this.values[s],t.values[s]))return!1;return!0}}const yu="Invalid Interval";function r9(e,t){return!e||!e.isValid?Zn.invalid("missing or invalid start"):!t||!t.isValid?Zn.invalid("missing or invalid end"):t<e?Zn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Zn{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the Interval is invalid");const s=t instanceof Fr?t:new Fr(t,n);if(Yn.throwOnInvalid)throw new xj(s);return new Zn({invalid:s})}static fromDateTimes(t,n){const s=Uh(t),o=Uh(n),r=r9(s,o);return r??new Zn({start:s,end:o})}static after(t,n){const s=fn.fromDurationLike(n),o=Uh(t);return Zn.fromDateTimes(o,o.plus(s))}static before(t,n){const s=fn.fromDurationLike(n),o=Uh(t);return Zn.fromDateTimes(o.minus(s),o)}static fromISO(t,n){const[s,o]=(t||"").split("/",2);if(s&&o){let r,i;try{r=bt.fromISO(s,n),i=r.isValid}catch{i=!1}let a,l;try{a=bt.fromISO(o,n),l=a.isValid}catch{l=!1}if(i&&l)return Zn.fromDateTimes(r,a);if(i){const c=fn.fromISO(o,n);if(c.isValid)return Zn.after(r,c)}else if(l){const c=fn.fromISO(s,n);if(c.isValid)return Zn.before(a,c)}}return Zn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const s=this.start.startOf(t,n);let o;return n!=null&&n.useLocaleWeeks?o=this.end.reconfigure({locale:s.locale}):o=this.end,o=o.startOf(t,n),Math.floor(o.diff(s,t).get(t))+(o.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Zn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Uh).filter(i=>this.contains(i)).sort((i,a)=>i.toMillis()-a.toMillis()),s=[];let{s:o}=this,r=0;for(;o<this.e;){const i=n[r]||this.e,a=+i>+this.e?this.e:i;s.push(Zn.fromDateTimes(o,a)),o=a,r+=1}return s}splitBy(t){const n=fn.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s}=this,o=1,r;const i=[];for(;s<this.e;){const a=this.start.plus(n.mapUnits(l=>l*o));r=+a>+this.e?this.e:a,i.push(Zn.fromDateTimes(s,r)),s=r,o+=1}return i}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,s=this.e<t.e?this.e:t.e;return n>=s?null:Zn.fromDateTimes(n,s)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,s=this.e>t.e?this.e:t.e;return Zn.fromDateTimes(n,s)}static merge(t){const[n,s]=t.sort((o,r)=>o.s-r.s).reduce(([o,r],i)=>r?r.overlaps(i)||r.abutsStart(i)?[o,r.union(i)]:[o.concat([r]),i]:[o,i],[[],null]);return s&&n.push(s),n}static xor(t){let n=null,s=0;const o=[],r=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),i=Array.prototype.concat(...r),a=i.sort((l,c)=>l.time-c.time);for(const l of a)s+=l.type==="s"?1:-1,s===1?n=l.time:(n&&+n!=+l.time&&o.push(Zn.fromDateTimes(n,l.time)),n=null);return Zn.merge(o)}difference(...t){return Zn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:yu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=qg,n={}){return this.isValid?$s.create(this.s.loc.clone(n),t).formatInterval(this):yu}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:yu}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:yu}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:yu}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:yu}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):fn.invalid(this.invalidReason)}mapEndpoints(t){return Zn.fromDateTimes(t(this.s),t(this.e))}}class wu{static hasDST(t=Yn.defaultZone){const n=bt.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return cu.isValidZone(t)}static normalizeZone(t){return Ba(t,Yn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||Sn.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||Sn.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||Sn.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null,outputCalendar:r="gregory"}={}){return(o||Sn.create(n,s,r)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null,outputCalendar:r="gregory"}={}){return(o||Sn.create(n,s,r)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null}={}){return(o||Sn.create(n,s,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null}={}){return(o||Sn.create(n,s,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Sn.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return Sn.create(n,null,"gregory").eras(t)}static features(){return{relative:kx(),localeWeek:Ox()}}}function rF(e,t){const n=o=>o.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=n(t)-n(e);return Math.floor(fn.fromMillis(s).as("days"))}function i9(e,t,n){const s=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{const u=rF(l,c);return(u-u%7)/7}],["days",rF]],o={},r=e;let i,a;for(const[l,c]of s)n.indexOf(l)>=0&&(i=l,o[l]=c(e,t),a=r.plus(o),a>t?(o[l]--,e=r.plus(o),e>t&&(a=e,o[l]--,e=r.plus(o))):e=a);return[e,o,a,i]}function a9(e,t,n,s){let[o,r,i,a]=i9(e,t,n);const l=t-o,c=n.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);c.length===0&&(i<t&&(i=o.plus({[a]:1})),i!==o&&(r[a]=(r[a]||0)+l/(i-o)));const u=fn.fromObject(r,s);return c.length>0?fn.fromMillis(l,s).shiftTo(...c).plus(u):u}const l9="missing Intl.DateTimeFormat.formatToParts support";function yn(e,t=n=>n){return{regex:e,deser:([n])=>t(Jj(n))}}const iF="[ ]",aF=new RegExp(iF,"g");function c9(e){return e.replace(/\./g,"\\.?").replace(aF,iF)}function lF(e){return e.replace(/\./g,"").replace(aF," ").toLowerCase()}function Pr(e,t){return e===null?null:{regex:RegExp(e.map(c9).join("|")),deser:([n])=>e.findIndex(s=>lF(n)===lF(s))+t}}function cF(e,t){return{regex:e,deser:([,n,s])=>tm(n,s),groups:t}}function om(e){return{regex:e,deser:([t])=>t}}function u9(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function d9(e,t){const n=xr(t),s=xr(t,"{2}"),o=xr(t,"{3}"),r=xr(t,"{4}"),i=xr(t,"{6}"),a=xr(t,"{1,2}"),l=xr(t,"{1,3}"),c=xr(t,"{1,6}"),u=xr(t,"{1,9}"),d=xr(t,"{2,4}"),h=xr(t,"{4,6}"),f=v=>({regex:RegExp(u9(v.val)),deser:([C])=>C,literal:!0}),g=(v=>{if(e.literal)return f(v);switch(v.val){case"G":return Pr(t.eras("short"),0);case"GG":return Pr(t.eras("long"),0);case"y":return yn(c);case"yy":return yn(d,ib);case"yyyy":return yn(r);case"yyyyy":return yn(h);case"yyyyyy":return yn(i);case"M":return yn(a);case"MM":return yn(s);case"MMM":return Pr(t.months("short",!0),1);case"MMMM":return Pr(t.months("long",!0),1);case"L":return yn(a);case"LL":return yn(s);case"LLL":return Pr(t.months("short",!1),1);case"LLLL":return Pr(t.months("long",!1),1);case"d":return yn(a);case"dd":return yn(s);case"o":return yn(l);case"ooo":return yn(o);case"HH":return yn(s);case"H":return yn(a);case"hh":return yn(s);case"h":return yn(a);case"mm":return yn(s);case"m":return yn(a);case"q":return yn(a);case"qq":return yn(s);case"s":return yn(a);case"ss":return yn(s);case"S":return yn(l);case"SSS":return yn(o);case"u":return om(u);case"uu":return om(a);case"uuu":return yn(n);case"a":return Pr(t.meridiems(),0);case"kkkk":return yn(r);case"kk":return yn(d,ib);case"W":return yn(a);case"WW":return yn(s);case"E":case"c":return yn(n);case"EEE":return Pr(t.weekdays("short",!1),1);case"EEEE":return Pr(t.weekdays("long",!1),1);case"ccc":return Pr(t.weekdays("short",!0),1);case"cccc":return Pr(t.weekdays("long",!0),1);case"Z":case"ZZ":return cF(new RegExp(`([+-]${a.source})(?::(${s.source}))?`),2);case"ZZZ":return cF(new RegExp(`([+-]${a.source})(${s.source})?`),2);case"z":return om(/[a-z_+-/]{1,256}?/i);case" ":return om(/[^\S\n\r]/);default:return f(v)}})(e)||{invalidReason:l9};return g.token=e,g}const h9={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function f9(e,t,n){const{type:s,value:o}=e;if(s==="literal"){const l=/^\s+$/.test(o);return{literal:!l,val:l?" ":o}}const r=t[s];let i=s;s==="hour"&&(t.hour12!=null?i=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?i="hour12":i="hour24":i=n.hour12?"hour12":"hour24");let a=h9[i];if(typeof a=="object"&&(a=a[r]),a)return{literal:!1,val:a}}function p9(e){return[`^${e.map(n=>n.regex).reduce((n,s)=>`${n}(${s.source})`,"")}$`,e]}function g9(e,t,n){const s=e.match(t);if(s){const o={};let r=1;for(const i in n)if(uu(n,i)){const a=n[i],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(o[a.token.val[0]]=a.deser(s.slice(r,r+l))),r+=l}return[s,o]}else return[s,{}]}function m9(e){const t=r=>{switch(r){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,s;return Ht(e.z)||(n=cu.create(e.z)),Ht(e.Z)||(n||(n=new ii(e.Z)),s=e.Z),Ht(e.q)||(e.M=(e.q-1)*3+1),Ht(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),Ht(e.u)||(e.S=ob(e.u)),[Object.keys(e).reduce((r,i)=>{const a=t(i);return a&&(r[a]=e[i]),r},{}),n,s]}let ub=null;function v9(){return ub||(ub=bt.fromMillis(1555555555555)),ub}function y9(e,t){if(e.literal)return e;const n=$s.macroTokenToFormatOpts(e.val),s=fF(n,t);return s==null||s.includes(void 0)?e:s}function uF(e,t){return Array.prototype.concat(...e.map(n=>y9(n,t)))}class dF{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=uF($s.parseFormat(n),t),this.units=this.tokens.map(s=>d9(s,t)),this.disqualifyingUnit=this.units.find(s=>s.invalidReason),!this.disqualifyingUnit){const[s,o]=p9(this.units);this.regex=RegExp(s,"i"),this.handlers=o}}explainFromTokens(t){if(this.isValid){const[n,s]=g9(t,this.regex,this.handlers),[o,r,i]=s?m9(s):[null,null,void 0];if(uu(s,"a")&&uu(s,"H"))throw new lu("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:s,result:o,zone:r,specificOffset:i}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function hF(e,t,n){return new dF(e,n).explainFromTokens(t)}function w9(e,t,n){const{result:s,zone:o,specificOffset:r,invalidReason:i}=hF(e,t,n);return[s,o,r,i]}function fF(e,t){if(!e)return null;const s=$s.create(t,e).dtFormatter(v9()),o=s.formatToParts(),r=s.resolvedOptions();return o.map(i=>f9(i,e,r))}const db="Invalid DateTime",pF=864e13;function Hh(e){return new Fr("unsupported zone",`the zone "${e.name}" is not supported`)}function hb(e){return e.weekData===null&&(e.weekData=Xg(e.c)),e.weekData}function fb(e){return e.localWeekData===null&&(e.localWeekData=Xg(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Kl(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new bt({...n,...t,old:n})}function gF(e,t,n){let s=e-t*60*1e3;const o=n.offset(s);if(t===o)return[s,t];s-=(o-t)*60*1e3;const r=n.offset(s);return o===r?[s,o]:[e-Math.min(o,r)*60*1e3,Math.max(o,r)]}function rm(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function im(e,t,n){return gF(em(e),t,n)}function mF(e,t){const n=e.o,s=e.c.year+Math.trunc(t.years),o=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,r={...e.c,year:s,month:o,day:Math.min(e.c.day,Qg(s,o))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},i=fn.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=em(r);let[l,c]=gF(a,n,e.zone);return i!==0&&(l+=i,c=e.zone.offset(l)),{ts:l,o:c}}function Cu(e,t,n,s,o,r){const{setZone:i,zone:a}=n;if(e&&Object.keys(e).length!==0||t){const l=t||a,c=bt.fromObject(e,{...n,zone:l,specificOffset:r});return i?c:c.setZone(a)}else return bt.invalid(new Fr("unparsable",`the input "${o}" can't be parsed as ${s}`))}function am(e,t,n=!0){return e.isValid?$s.create(Sn.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function pb(e,t,n){const s=e.c.year>9999||e.c.year<0;let o="";if(s&&e.c.year>=0&&(o+="+"),o+=us(e.c.year,s?6:4),n==="year")return o;if(t){if(o+="-",o+=us(e.c.month),n==="month")return o;o+="-"}else if(o+=us(e.c.month),n==="month")return o;return o+=us(e.c.day),o}function vF(e,t,n,s,o,r,i){let a=!n||e.c.millisecond!==0||e.c.second!==0,l="";switch(i){case"day":case"month":case"year":break;default:if(l+=us(e.c.hour),i==="hour")break;if(t){if(l+=":",l+=us(e.c.minute),i==="minute")break;a&&(l+=":",l+=us(e.c.second))}else{if(l+=us(e.c.minute),i==="minute")break;a&&(l+=us(e.c.second))}if(i==="second")break;a&&(!s||e.c.millisecond!==0)&&(l+=".",l+=us(e.c.millisecond,3))}return o&&(e.isOffsetFixed&&e.offset===0&&!r?l+="Z":e.o<0?(l+="-",l+=us(Math.trunc(-e.o/60)),l+=":",l+=us(Math.trunc(-e.o%60))):(l+="+",l+=us(Math.trunc(e.o/60)),l+=":",l+=us(Math.trunc(e.o%60)))),r&&(l+="["+e.zone.ianaName+"]"),l}const yF={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},C9={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},b9={ordinal:1,hour:0,minute:0,second:0,millisecond:0},lm=["year","month","day","hour","minute","second","millisecond"],S9=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],E9=["year","ordinal","hour","minute","second","millisecond"];function cm(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new jI(e);return t}function wF(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return cm(e)}}function _9(e){if(Gh===void 0&&(Gh=Yn.now()),e.type!=="iana")return e.offset(Gh);const t=e.name;let n=gb.get(t);return n===void 0&&(n=e.offset(Gh),gb.set(t,n)),n}function CF(e,t){const n=Ba(t.zone,Yn.defaultZone);if(!n.isValid)return bt.invalid(Hh(n));const s=Sn.fromObject(t);let o,r;if(Ht(e.year))o=Yn.now();else{for(const l of lm)Ht(e[l])&&(e[l]=yF[l]);const i=Px(e)||Ax(e);if(i)return bt.invalid(i);const a=_9(n);[o,r]=im(e,a,n)}return new bt({ts:o,zone:n,loc:s,o:r})}function bF(e,t,n){const s=Ht(n.round)?!0:n.round,o=Ht(n.rounding)?"trunc":n.rounding,r=(a,l)=>(a=rb(a,s||n.calendary?0:2,n.calendary?"round":o),t.loc.clone(n).relFormatter(n).format(a,l)),i=a=>n.calendary?t.hasSame(e,a)?0:t.startOf(a).diff(e.startOf(a),a).get(a):t.diff(e,a).get(a);if(n.unit)return r(i(n.unit),n.unit);for(const a of n.units){const l=i(a);if(Math.abs(l)>=1)return r(l,a)}return r(e>t?-0:0,n.units[n.units.length-1])}function SF(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let Gh;const gb=new Map;class bt{constructor(t){const n=t.zone||Yn.defaultZone;let s=t.invalid||(Number.isNaN(t.ts)?new Fr("invalid input"):null)||(n.isValid?null:Hh(n));this.ts=Ht(t.ts)?Yn.now():t.ts;let o=null,r=null;if(!s)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[o,r]=[t.old.c,t.old.o];else{const a=$a(t.o)&&!t.old?t.o:n.offset(this.ts);o=rm(this.ts,a),s=Number.isNaN(o.year)?new Fr("invalid input"):null,o=s?null:o,r=s?null:a}this._zone=n,this.loc=t.loc||Sn.create(),this.invalid=s,this.weekData=null,this.localWeekData=null,this.c=o,this.o=r,this.isLuxonDateTime=!0}static now(){return new bt({})}static local(){const[t,n]=SF(arguments),[s,o,r,i,a,l,c]=n;return CF({year:s,month:o,day:r,hour:i,minute:a,second:l,millisecond:c},t)}static utc(){const[t,n]=SF(arguments),[s,o,r,i,a,l,c]=n;return t.zone=ii.utcInstance,CF({year:s,month:o,day:r,hour:i,minute:a,second:l,millisecond:c},t)}static fromJSDate(t,n={}){const s=sK(t)?t.valueOf():NaN;if(Number.isNaN(s))return bt.invalid("invalid input");const o=Ba(n.zone,Yn.defaultZone);return o.isValid?new bt({ts:s,zone:o,loc:Sn.fromObject(n)}):bt.invalid(Hh(o))}static fromMillis(t,n={}){if($a(t))return t<-pF||t>pF?bt.invalid("Timestamp out of range"):new bt({ts:t,zone:Ba(n.zone,Yn.defaultZone),loc:Sn.fromObject(n)});throw new Bs(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if($a(t))return new bt({ts:t*1e3,zone:Ba(n.zone,Yn.defaultZone),loc:Sn.fromObject(n)});throw new Bs("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const s=Ba(n.zone,Yn.defaultZone);if(!s.isValid)return bt.invalid(Hh(s));const o=Sn.fromObject(n),r=nm(t,wF),{minDaysInFirstWeek:i,startOfWeek:a}=Fx(r,o),l=Yn.now(),c=Ht(n.specificOffset)?s.offset(l):n.specificOffset,u=!Ht(r.ordinal),d=!Ht(r.year),h=!Ht(r.month)||!Ht(r.day),f=d||h,p=r.weekYear||r.weekNumber;if((f||u)&&p)throw new lu("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&u)throw new lu("Can't mix ordinal dates with month/day");const g=p||r.weekday&&!f;let v,C,S=rm(l,c);g?(v=S9,C=C9,S=Xg(S,i,a)):u?(v=E9,C=b9,S=nb(S)):(v=lm,C=yF);let b=!1;for(const F of v){const E=r[F];Ht(E)?b?r[F]=C[F]:r[F]=S[F]:b=!0}const w=g?eK(r,i,a):u?tK(r):Px(r),D=w||Ax(r);if(D)return bt.invalid(D);const R=g?Ix(r,i,a):u?xx(r):r,[T,I]=im(R,c,s),x=new bt({ts:T,zone:s,o:I,loc:o});return r.weekday&&f&&t.weekday!==x.weekday?bt.invalid("mismatched weekday",`you can't specify both a weekday of ${r.weekday} and a date of ${x.toISO()}`):x.isValid?x:bt.invalid(x.invalid)}static fromISO(t,n={}){const[s,o]=jK(t);return Cu(s,o,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[s,o]=KK(t);return Cu(s,o,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[s,o]=qK(t);return Cu(s,o,n,"HTTP",n)}static fromFormat(t,n,s={}){if(Ht(t)||Ht(n))throw new Bs("fromFormat requires an input string and a format");const{locale:o=null,numberingSystem:r=null}=s,i=Sn.fromOpts({locale:o,numberingSystem:r,defaultToEN:!0}),[a,l,c,u]=w9(i,t,n);return u?bt.invalid(u):Cu(a,l,s,`format ${n}`,t,c)}static fromString(t,n,s={}){return bt.fromFormat(t,n,s)}static fromSQL(t,n={}){const[s,o]=t9(t);return Cu(s,o,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the DateTime is invalid");const s=t instanceof Fr?t:new Fr(t,n);if(Yn.throwOnInvalid)throw new Ij(s);return new bt({invalid:s})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const s=fF(t,Sn.fromObject(n));return s?s.map(o=>o?o.val:null).join(""):null}static expandFormat(t,n={}){return uF($s.parseFormat(t),Sn.fromObject(n)).map(o=>o.val).join("")}static resetCache(){Gh=void 0,gb.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?hb(this).weekYear:NaN}get weekNumber(){return this.isValid?hb(this).weekNumber:NaN}get weekday(){return this.isValid?hb(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?fb(this).weekday:NaN}get localWeekNumber(){return this.isValid?fb(this).weekNumber:NaN}get localWeekYear(){return this.isValid?fb(this).weekYear:NaN}get ordinal(){return this.isValid?nb(this.c).ordinal:NaN}get monthShort(){return this.isValid?wu.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?wu.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?wu.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?wu.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,s=em(this.c),o=this.zone.offset(s-t),r=this.zone.offset(s+t),i=this.zone.offset(s-o*n),a=this.zone.offset(s-r*n);if(i===a)return[this];const l=s-i*n,c=s-a*n,u=rm(l,i),d=rm(c,a);return u.hour===d.hour&&u.minute===d.minute&&u.second===d.second&&u.millisecond===d.millisecond?[Kl(this,{ts:l}),Kl(this,{ts:c})]:[this]}get isInLeapYear(){return Nh(this.year)}get daysInMonth(){return Qg(this.year,this.month)}get daysInYear(){return this.isValid?du(this.year):NaN}get weeksInWeekYear(){return this.isValid?Lh(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Lh(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:s,calendar:o}=$s.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:s,outputCalendar:o}}toUTC(t=0,n={}){return this.setZone(ii.instance(t),n)}toLocal(){return this.setZone(Yn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:s=!1}={}){if(t=Ba(t,Yn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let o=this.ts;if(n||s){const r=t.offset(this.ts),i=this.toObject();[o]=im(i,r,t)}return Kl(this,{ts:o,zone:t})}else return bt.invalid(Hh(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:s}={}){const o=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:s});return Kl(this,{loc:o})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=nm(t,wF),{minDaysInFirstWeek:s,startOfWeek:o}=Fx(n,this.loc),r=!Ht(n.weekYear)||!Ht(n.weekNumber)||!Ht(n.weekday),i=!Ht(n.ordinal),a=!Ht(n.year),l=!Ht(n.month)||!Ht(n.day),c=a||l,u=n.weekYear||n.weekNumber;if((c||i)&&u)throw new lu("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&i)throw new lu("Can't mix ordinal dates with month/day");let d;r?d=Ix({...Xg(this.c,s,o),...n},s,o):Ht(n.ordinal)?(d={...this.toObject(),...n},Ht(n.day)&&(d.day=Math.min(Qg(d.year,d.month),d.day))):d=xx({...nb(this.c),...n});const[h,f]=im(d,this.o,this.zone);return Kl(this,{ts:h,o:f})}plus(t){if(!this.isValid)return this;const n=fn.fromDurationLike(t);return Kl(this,mF(this,n))}minus(t){if(!this.isValid)return this;const n=fn.fromDurationLike(t).negate();return Kl(this,mF(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const s={},o=fn.normalizeUnit(t);switch(o){case"years":s.month=1;case"quarters":case"months":s.day=1;case"weeks":case"days":s.hour=0;case"hours":s.minute=0;case"minutes":s.second=0;case"seconds":s.millisecond=0;break}if(o==="weeks")if(n){const r=this.loc.getStartOfWeek(),{weekday:i}=this;i<r&&(s.weekNumber=this.weekNumber-1),s.weekday=r}else s.weekday=1;if(o==="quarters"){const r=Math.ceil(this.month/3);s.month=(r-1)*3+1}return this.set(s)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?$s.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):db}toLocaleString(t=qg,n={}){return this.isValid?$s.create(this.loc.clone(n),t).formatDateTime(this):db}toLocaleParts(t={}){return this.isValid?$s.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:s=!1,includeOffset:o=!0,extendedZone:r=!1,precision:i="milliseconds"}={}){if(!this.isValid)return null;i=cm(i);const a=t==="extended";let l=pb(this,a,i);return lm.indexOf(i)>=3&&(l+="T"),l+=vF(this,a,n,s,o,r,i),l}toISODate({format:t="extended",precision:n="day"}={}){return this.isValid?pb(this,t==="extended",cm(n)):null}toISOWeekDate(){return am(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:s=!0,includePrefix:o=!1,extendedZone:r=!1,format:i="extended",precision:a="milliseconds"}={}){return this.isValid?(a=cm(a),(o&&lm.indexOf(a)>=3?"T":"")+vF(this,i==="extended",n,t,s,r,a)):null}toRFC2822(){return am(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return am(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?pb(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:s=!0}={}){let o="HH:mm:ss.SSS";return(n||t)&&(s&&(o+=" "),n?o+="z":t&&(o+="ZZ")),am(this,o,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():db}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",s={}){if(!this.isValid||!t.isValid)return fn.invalid("created by diffing an invalid DateTime");const o={locale:this.locale,numberingSystem:this.numberingSystem,...s},r=oK(n).map(fn.normalizeUnit),i=t.valueOf()>this.valueOf(),a=i?this:t,l=i?t:this,c=a9(a,l,r,o);return i?c.negate():c}diffNow(t="milliseconds",n={}){return this.diff(bt.now(),t,n)}until(t){return this.isValid?Zn.fromDateTimes(this,t):this}hasSame(t,n,s){if(!this.isValid)return!1;const o=t.valueOf(),r=this.setZone(t.zone,{keepLocalTime:!0});return r.startOf(n,s)<=o&&o<=r.endOf(n,s)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||bt.fromObject({},{zone:this.zone}),s=t.padding?this<n?-t.padding:t.padding:0;let o=["years","months","days","hours","minutes","seconds"],r=t.unit;return Array.isArray(t.unit)&&(o=t.unit,r=void 0),bF(n,this.plus(s),{...t,numeric:"always",units:o,unit:r})}toRelativeCalendar(t={}){return this.isValid?bF(t.base||bt.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(bt.isDateTime))throw new Bs("min requires all arguments be DateTimes");return Mx(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(bt.isDateTime))throw new Bs("max requires all arguments be DateTimes");return Mx(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,s={}){const{locale:o=null,numberingSystem:r=null}=s,i=Sn.fromOpts({locale:o,numberingSystem:r,defaultToEN:!0});return hF(i,t,n)}static fromStringExplain(t,n,s={}){return bt.fromFormatExplain(t,n,s)}static buildFormatParser(t,n={}){const{locale:s=null,numberingSystem:o=null}=n,r=Sn.fromOpts({locale:s,numberingSystem:o,defaultToEN:!0});return new dF(r,t)}static fromFormatParser(t,n,s={}){if(Ht(t)||Ht(n))throw new Bs("fromFormatParser requires an input string and a format parser");const{locale:o=null,numberingSystem:r=null}=s,i=Sn.fromOpts({locale:o,numberingSystem:r,defaultToEN:!0});if(!i.equals(n.locale))throw new Bs(`fromFormatParser called with a locale of ${i}, but the format parser was created for ${n.locale}`);const{result:a,zone:l,specificOffset:c,invalidReason:u}=n.explainFromTokens(t);return u?bt.invalid(u):Cu(a,l,s,`format ${n.format}`,t,c)}static get DATE_SHORT(){return qg}static get DATE_MED(){return KI}static get DATE_MED_WITH_WEEKDAY(){return Pj}static get DATE_FULL(){return qI}static get DATE_HUGE(){return YI}static get TIME_SIMPLE(){return ZI}static get TIME_WITH_SECONDS(){return XI}static get TIME_WITH_SHORT_OFFSET(){return JI}static get TIME_WITH_LONG_OFFSET(){return QI}static get TIME_24_SIMPLE(){return ex}static get TIME_24_WITH_SECONDS(){return tx}static get TIME_24_WITH_SHORT_OFFSET(){return nx}static get TIME_24_WITH_LONG_OFFSET(){return sx}static get DATETIME_SHORT(){return ox}static get DATETIME_SHORT_WITH_SECONDS(){return rx}static get DATETIME_MED(){return ix}static get DATETIME_MED_WITH_SECONDS(){return ax}static get DATETIME_MED_WITH_WEEKDAY(){return Aj}static get DATETIME_FULL(){return lx}static get DATETIME_FULL_WITH_SECONDS(){return cx}static get DATETIME_HUGE(){return ux}static get DATETIME_HUGE_WITH_SECONDS(){return dx}}function Uh(e){if(bt.isDateTime(e))return e;if(e&&e.valueOf&&$a(e.valueOf()))return bt.fromJSDate(e);if(e&&typeof e=="object")return bt.fromObject(e);throw new Bs(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const EF="account.last_prefered_timezone",ai=500;var At=(e=>(e[e.UNCHECK=0]="UNCHECK",e[e.INDETERMINATE=1]="INDETERMINATE",e[e.CHECKED=2]="CHECKED",e))(At||{});function Wh(e){if(!e)return null;if(bt.isDateTime(e))return e;if(e instanceof Date){const t=bt.fromJSDate(e);return t.isValid?t:null}if(typeof e=="number"){const t=bt.fromMillis(e);return t.isValid?t:null}if(typeof e=="string"){let t=bt.fromISO(e);return t.isValid||(t=bt.fromRFC2822(e)),t.isValid?t:null}return null}function _F(e,t,n){const s=Wh(e);if(!s)return"";const o=n?s.setZone(n):s;return o.isValid?o.toFormat(t):""}const um=()=>Tj(EF)||"UTC",RF=e=>({id:e.id,name:(e==null?void 0:e.name)??e.display_name,initial:e.initial,profile_image:e.profile_image,color:{bgColor:e.color.bgColor,textColor:e.color.textColor}}),bu=e=>e!=null&&e.length?e.map(RF):[],R9=e=>{if(!(e!=null&&e.length))return[];const t=new Set;return e.filter(n=>t.has(n.id)?!1:(t.add(n.id),!0))},DF=e=>{if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t},D9=e=>Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==void 0)),TF=(e,t)=>{var s,o,r;const n={id:e.id,name:e.name,assignees:void 0,status:e.template_flow_status,dateRange:[DF(e.start_date),DF(e.due_date)],isStarted:!!Number(e.is_started),isCompleted:!!Number(e.is_completed),lastUpdated:{tooltip:e!=null&&e.last_updated_by?e.last_updated_by:"",value:_F(e.updated_at,"MMM dd, yyyy | HH:mm",t)||""},completedOn:{tooltip:e.actual_due_date==null?"Pending":e.last_completed_by?e.last_completed_by:"",value:_F(e.actual_due_date,"MMM dd, yyyy | HH:mm",t)},isDeleted:!1,isProcessing:e!=null&&e.bulk_process?{state:e==null?void 0:e.bulk_process.state,message:(e==null?void 0:e.bulk_process.message)||""}:void 0,disabled:((s=e==null?void 0:e.bulk_process)==null?void 0:s.state)==0,isArchived:((o=e.property)==null?void 0:o.is_archived)===1||e.status==0,isLocked:((r=e.template_flow_status)==null?void 0:r.is_lock_item)===1,description:e.description||null};return D9(n)},IF={headphone:["headphones","headset"],sofa:["couch"],couch:["sofa"],run:["running","runner"]},mb=e=>e.toLowerCase().trim(),T9=e=>mb(e).split(/\s+/).filter(Boolean),xF=e=>e.replace(/(ing|ed|s)$/i,"");function I9(e){const t=new Set;for(const n of e){const s=xF(n);if(t.add(s),t.add(n),IF[s])for(const o of IF[s])t.add(xF(o))}return Array.from(t)}function x9(e,t){const n=mb(e),s=I9(T9(t));let o=0;for(const r of s)r&&(n.includes(r)&&(o+=r.length*2),n.startsWith(r)&&(o+=3));return o}function F9(e,t){const n=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=t.split(/\s+/).filter(Boolean).map(n);if(!s.length)return e;const o=new RegExp(`(${s.join("|")})`,"ig");return e.replace(o,"<mark>$1</mark>")}const FF=e=>{if(e!==null){if(Number(e.metric_type.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number(e.metric_type.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number(e.metric_type.id)==3)return"formula"}},vb=e=>!isNaN(e)&&isFinite(e),dm=(e,t)=>{var r;const{restricted_type:n}=e,s=Math.floor(Number(t)),o=((r=e.restricted_value)==null?void 0:r.split(",").map(Number))||[];if(n=="none")return!0;if(e.restricted_type=="not")return vb(s)&&!o.includes(s);if(e.restricted_type=="range"){const[i,a]=o;return vb(Number(t))&&Number(t)>=Number(i)&&Number(t)<=Number(a)}else if(n=="exact")return vb(s)&&o.includes(s);return!1},P9=(e,t)=>{var r;const n=un.getInstance().getItem("ws.terminology"),s=n?JSON.parse(n):null;return` ${((r=s==null?void 0:s.find(i=>i.code==="scene"))==null?void 0:r.name)||"Scene"} ${t}`.trim()};/*! js-cookie v3.0.5 | MIT */function hm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)e[s]=n[s]}return e}var A9={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function yb(e,t){function n(o,r,i){if(!(typeof document>"u")){i=hm({},t,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in i)i[l]&&(a+="; "+l,i[l]!==!0&&(a+="="+i[l].split(";")[0]));return document.cookie=o+"="+e.write(r,o)+a}}function s(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var r=document.cookie?document.cookie.split("; "):[],i={},a=0;a<r.length;a++){var l=r[a].split("="),c=l.slice(1).join("=");try{var u=decodeURIComponent(l[0]);if(i[u]=e.read(c,u),o===u)break}catch{}}return o?i[o]:i}}return Object.create({set:n,get:s,remove:function(o,r){n(o,"",hm({},r,{expires:-1}))},withAttributes:function(o){return yb(this.converter,hm({},this.attributes,o))},withConverter:function(o){return yb(hm({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var PF=yb(A9,{path:"/"});const fm=({date:e,timezone:t,format:n})=>{if(!e)return"";const s=typeof e=="string"?bt.fromISO(e,{zone:t}):e,o=bt.now().setZone(t||"local"),r=s.setZone(t||"local"),i=o.startOf("day"),l=r.startOf("day").diff(i,"days").days;let c="";if(l===0?c="Today":l===-1?c="Yesterday":l===1&&(c="Tomorrow"),c&&(n!=null&&n.includes("HH:mm"))){const u=r.toFormat("HH:mm");return`${c} at ${u}`}else if(c)return c;return r.toFormat(n)},wb=()=>PF.get("account.last_prefered_timezone")||"UTC",pm=e=>`${bt.fromJSDate(e,{zone:"UTC"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`;function AF(e){if(!e)return"";const t=e.replace(/<br\s*\/?>/gi,`
|
|
114
|
+
`+j:""),this.inner=j||null):typeof L=="object"&&(this.message="".concat(L.name," ").concat(L.message),this.inner=L):(this.message=V[y]||_,this.inner=null)}return g(P).from(oe),m[y]=P,m},{});K.Syntax=SyntaxError,K.Type=TypeError,K.Range=RangeError;var me=ze.reduce(function(m,y){return m[y+"Error"]=K[y],m},{}),se=vr.reduce(function(m,y){return["Syntax","Type","Range"].indexOf(y)===-1&&(m[y+"Error"]=K[y]),m},{});function Se(){}function U(m){return m}function Z(m,y){return m==null||m===U?y:function(_){return y(m(_))}}function de(m,y){return function(){m.apply(this,arguments),y.apply(this,arguments)}}function Ae(m,y){return m===Se?y:function(){var _=m.apply(this,arguments);_!==void 0&&(arguments[0]=_);var P=this.onsuccess,L=this.onerror;this.onsuccess=null,this.onerror=null;var j=y.apply(this,arguments);return P&&(this.onsuccess=this.onsuccess?de(P,this.onsuccess):P),L&&(this.onerror=this.onerror?de(L,this.onerror):L),j!==void 0?j:_}}function Fe(m,y){return m===Se?y:function(){m.apply(this,arguments);var _=this.onsuccess,P=this.onerror;this.onsuccess=this.onerror=null,y.apply(this,arguments),_&&(this.onsuccess=this.onsuccess?de(_,this.onsuccess):_),P&&(this.onerror=this.onerror?de(P,this.onerror):P)}}function Le(m,y){return m===Se?y:function(_){var P=m.apply(this,arguments);l(_,P);var L=this.onsuccess,j=this.onerror;return this.onsuccess=null,this.onerror=null,_=y.apply(this,arguments),L&&(this.onsuccess=this.onsuccess?de(L,this.onsuccess):L),j&&(this.onerror=this.onerror?de(j,this.onerror):j),P===void 0?_===void 0?void 0:_:l(P,_)}}function ye(m,y){return m===Se?y:function(){return y.apply(this,arguments)!==!1&&m.apply(this,arguments)}}function N(m,y){return m===Se?y:function(){var _=m.apply(this,arguments);if(_&&typeof _.then=="function"){for(var P=this,L=arguments.length,j=new Array(L);L--;)j[L]=arguments[L];return _.then(function(){return y.apply(P,j)})}return y.apply(this,arguments)}}se.ModifyError=pe,se.DexieError=G,se.BulkError=ve;var $=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function le(m){$=m}var Ge={},we=100,ba=typeof Promise>"u"?[]:function(){var m=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[m,c(m),m];var y=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[y,c(y),m]}(),ze=ba[0],vr=ba[1],ba=ba[2],vr=vr&&vr.then,Ue=ze&&ze.constructor,_e=!!ba,Ve=function(m,y){wt.push([m,y]),kt&&(queueMicrotask(Fi),kt=!1)},gt=!0,kt=!0,Ut=[],en=[],zt=U,Ne={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Se,pgp:!1,env:{},finalize:Se},qe=Ne,wt=[],Nt=0,Wt=[];function nt(m){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var y=this._PSD=qe;if(typeof m!="function"){if(m!==Ge)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&xi(this,this._value))}this._state=null,this._value=null,++y.ref,function _(P,L){try{L(function(j){if(P._state===null){if(j===P)throw new TypeError("A promise cannot be resolved with itself.");var ne=P._lib&&Pi();j&&typeof j.then=="function"?_(P,function(ue,Ce){j instanceof nt?j._then(ue,Ce):j.then(ue,Ce)}):(P._state=!0,P._value=j,gr(P)),ne&&mr()}},xi.bind(null,P))}catch(j){xi(P,j)}}(this,m)}var Is={get:function(){var m=qe,y=Od;function _(P,L){var j=this,ne=!m.global&&(m!==qe||y!==Od),ue=ne&&!Xt(),Ce=new nt(function(Re,Ie){ya(j,new Ur(S_(P,m,ne,ue),S_(L,m,ne,ue),Re,Ie,m))});return this._consoleTask&&(Ce._consoleTask=this._consoleTask),Ce}return _.prototype=Ge,_},set:function(m){p(this,"then",m&&m.prototype===Ge?Is:{get:function(){return m},set:Is.set})}};function Ur(m,y,_,P,L){this.onFulfilled=typeof m=="function"?m:null,this.onRejected=typeof y=="function"?y:null,this.resolve=_,this.reject=P,this.psd=L}function xi(m,y){var _,P;en.push(y),m._state===null&&(_=m._lib&&Pi(),y=zt(y),m._state=!1,m._value=y,P=m,Ut.some(function(L){return L._value===P._value})||Ut.push(P),gr(m),_&&mr())}function gr(m){var y=m._listeners;m._listeners=[];for(var _=0,P=y.length;_<P;++_)ya(m,y[_]);var L=m._PSD;--L.ref||L.finalize(),Nt===0&&(++Nt,Ve(function(){--Nt==0&&Wr()},[]))}function ya(m,y){if(m._state!==null){var _=m._state?y.onFulfilled:y.onRejected;if(_===null)return(m._state?y.resolve:y.reject)(m._value);++y.psd.ref,++Nt,Ve(ml,[_,m,y])}else m._listeners.push(y)}function ml(m,y,_){try{var P,L=y._value;!y._state&&en.length&&(en=[]),P=$&&y._consoleTask?y._consoleTask.run(function(){return m(L)}):m(L),y._state||en.indexOf(L)!==-1||function(j){for(var ne=Ut.length;ne;)if(Ut[--ne]._value===j._value)return Ut.splice(ne,1)}(y),_.resolve(P)}catch(j){_.reject(j)}finally{--Nt==0&&Wr(),--_.psd.ref||_.psd.finalize()}}function Fi(){oo(Ne,function(){Pi()&&mr()})}function Pi(){var m=gt;return kt=gt=!1,m}function mr(){var m,y,_;do for(;0<wt.length;)for(m=wt,wt=[],_=m.length,y=0;y<_;++y){var P=m[y];P[0].apply(null,P[1])}while(0<wt.length);kt=gt=!0}function Wr(){var m=Ut;Ut=[],m.forEach(function(P){P._PSD.onunhandled.call(null,P._value,P)});for(var y=Wt.slice(0),_=y.length;_;)y[--_]()}function Pd(m){return new nt(Ge,!1,m)}function kn(m,y){var _=qe;return function(){var P=Pi(),L=qe;try{return Go(_,!0),m.apply(this,arguments)}catch(j){y&&y(j)}finally{Go(L,!1),P&&mr()}}}h(nt.prototype,{then:Is,_then:function(m,y){ya(this,new Ur(null,null,m,y,qe))},catch:function(m){if(arguments.length===1)return this.then(null,m);var y=m,_=arguments[1];return typeof y=="function"?this.then(null,function(P){return(P instanceof y?_:Pd)(P)}):this.then(null,function(P){return(P&&P.name===y?_:Pd)(P)})},finally:function(m){return this.then(function(y){return nt.resolve(m()).then(function(){return y})},function(y){return nt.resolve(m()).then(function(){return Pd(y)})})},timeout:function(m,y){var _=this;return m<1/0?new nt(function(P,L){var j=setTimeout(function(){return L(new K.Timeout(y))},m);_.then(P,L).finally(clearTimeout.bind(null,j))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&p(nt.prototype,Symbol.toStringTag,"Dexie.Promise"),Ne.env=Ca(),h(nt,{all:function(){var m=ae.apply(null,arguments).map(Co);return new nt(function(y,_){m.length===0&&y([]);var P=m.length;m.forEach(function(L,j){return nt.resolve(L).then(function(ne){m[j]=ne,--P||y(m)},_)})})},resolve:function(m){return m instanceof nt?m:m&&typeof m.then=="function"?new nt(function(y,_){m.then(y,_)}):new nt(Ge,!0,m)},reject:Pd,race:function(){var m=ae.apply(null,arguments).map(Co);return new nt(function(y,_){m.map(function(P){return nt.resolve(P).then(y,_)})})},PSD:{get:function(){return qe},set:function(m){return qe=m}},totalEchoes:{get:function(){return Od}},newPSD:Ye,usePSD:oo,scheduler:{get:function(){return Ve},set:function(m){Ve=m}},rejectionMapper:{get:function(){return zt},set:function(m){zt=m}},follow:function(m,y){return new nt(function(_,P){return Ye(function(L,j){var ne=qe;ne.unhandleds=[],ne.onunhandled=j,ne.finalize=de(function(){var ue,Ce=this;ue=function(){Ce.unhandleds.length===0?L():j(Ce.unhandleds[0])},Wt.push(function Re(){ue(),Wt.splice(Wt.indexOf(Re),1)}),++Nt,Ve(function(){--Nt==0&&Wr()},[])},ne.finalize),m()},y,_,P)})}}),Ue&&(Ue.allSettled&&p(nt,"allSettled",function(){var m=ae.apply(null,arguments).map(Co);return new nt(function(y){m.length===0&&y([]);var _=m.length,P=new Array(_);m.forEach(function(L,j){return nt.resolve(L).then(function(ne){return P[j]={status:"fulfilled",value:ne}},function(ne){return P[j]={status:"rejected",reason:ne}}).then(function(){return--_||y(P)})})})}),Ue.any&&typeof AggregateError<"u"&&p(nt,"any",function(){var m=ae.apply(null,arguments).map(Co);return new nt(function(y,_){m.length===0&&_(new AggregateError([]));var P=m.length,L=new Array(P);m.forEach(function(j,ne){return nt.resolve(j).then(function(ue){return y(ue)},function(ue){L[ne]=ue,--P||_(new AggregateError(L))})})})}),Ue.withResolvers&&(nt.withResolvers=Ue.withResolvers));var fs={awaits:0,echoes:0,id:0},b_=0,Ad=[],kd=0,Od=0,ke=0;function Ye(m,y,_,P){var L=qe,j=Object.create(L);return j.parent=L,j.ref=0,j.global=!1,j.id=++ke,Ne.env,j.env=_e?{Promise:nt,PromiseProp:{value:nt,configurable:!0,writable:!0},all:nt.all,race:nt.race,allSettled:nt.allSettled,any:nt.any,resolve:nt.resolve,reject:nt.reject}:{},y&&l(j,y),++L.ref,j.finalize=function(){--this.parent.ref||this.parent.finalize()},P=oo(j,m,_,P),j.ref===0&&j.finalize(),P}function Qt(){return fs.id||(fs.id=++b_),++fs.awaits,fs.echoes+=we,fs.id}function Xt(){return!!fs.awaits&&(--fs.awaits==0&&(fs.id=0),fs.echoes=fs.awaits*we,!0)}function Co(m){return fs.echoes&&m&&m.constructor===Ue?(Qt(),m.then(function(y){return Xt(),y},function(y){return Xt(),Kn(y)})):m}function wa(){var m=Ad[Ad.length-1];Ad.pop(),Go(m,!1)}function Go(m,y){var _,P=qe;(y?!fs.echoes||kd++&&m===qe:!kd||--kd&&m===qe)||queueMicrotask(y?(function(L){++Od,fs.echoes&&--fs.echoes!=0||(fs.echoes=fs.awaits=fs.id=0),Ad.push(qe),Go(L,!0)}).bind(null,m):wa),m!==qe&&(qe=m,P===Ne&&(Ne.env=Ca()),_e&&(_=Ne.env.Promise,y=m.env,(P.global||m.global)&&(Object.defineProperty(r,"Promise",y.PromiseProp),_.all=y.all,_.race=y.race,_.resolve=y.resolve,_.reject=y.reject,y.allSettled&&(_.allSettled=y.allSettled),y.any&&(_.any=y.any))))}function Ca(){var m=r.Promise;return _e?{Promise:m,PromiseProp:Object.getOwnPropertyDescriptor(r,"Promise"),all:m.all,race:m.race,allSettled:m.allSettled,any:m.any,resolve:m.resolve,reject:m.reject}:{}}function oo(m,y,_,P,L){var j=qe;try{return Go(m,!0),y(_,P,L)}finally{Go(j,!1)}}function S_(m,y,_,P){return typeof m!="function"?m:function(){var L=qe;_&&Qt(),Go(y,!0);try{return m.apply(this,arguments)}finally{Go(L,!1),P&&queueMicrotask(Xt)}}}function vp(m){Promise===Ue&&fs.echoes===0?kd===0?m():enqueueNativeMicroTask(m):setTimeout(m,0)}(""+vr).indexOf("[native code]")===-1&&(Qt=Xt=Se);var Kn=nt.reject,Ai="",bo="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",VB="String expected.",Md=[],Fy="__dbnames",E_="readonly",__="readwrite";function Ac(m,y){return m?y?function(){return m.apply(this,arguments)&&y.apply(this,arguments)}:m:y}var BB={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Py(m){return typeof m!="string"||/\./.test(m)?function(y){return y}:function(y){return y[m]===void 0&&m in y&&delete(y=k(y))[m],y}}function $B(){throw K.Type()}function ln(m,y){try{var _=HB(m),P=HB(y);if(_!==P)return _==="Array"?1:P==="Array"?-1:_==="binary"?1:P==="binary"?-1:_==="string"?1:P==="string"?-1:_==="Date"?1:P!=="Date"?NaN:-1;switch(_){case"number":case"Date":case"string":return y<m?1:m<y?-1:0;case"binary":return function(L,j){for(var ne=L.length,ue=j.length,Ce=ne<ue?ne:ue,Re=0;Re<Ce;++Re)if(L[Re]!==j[Re])return L[Re]<j[Re]?-1:1;return ne===ue?0:ne<ue?-1:1}(GB(m),GB(y));case"Array":return function(L,j){for(var ne=L.length,ue=j.length,Ce=ne<ue?ne:ue,Re=0;Re<Ce;++Re){var Ie=ln(L[Re],j[Re]);if(Ie!==0)return Ie}return ne===ue?0:ne<ue?-1:1}(m,y)}}catch{}return NaN}function HB(m){var y=typeof m;return y!="object"?y:ArrayBuffer.isView(m)?"binary":(m=O(m),m==="ArrayBuffer"?"binary":m)}function GB(m){return m instanceof Uint8Array?m:ArrayBuffer.isView(m)?new Uint8Array(m.buffer,m.byteOffset,m.byteLength):new Uint8Array(m)}var UB=($n.prototype._trans=function(m,y,_){var P=this._tx||qe.trans,L=this.name,j=$&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(m==="readonly"?"read":"write"," ").concat(this.name));function ne(Re,Ie,he){if(!he.schema[L])throw new K.NotFound("Table "+L+" not part of transaction");return y(he.idbtrans,he)}var ue=Pi();try{var Ce=P&&P.db._novip===this.db._novip?P===qe.trans?P._promise(m,ne,_):Ye(function(){return P._promise(m,ne,_)},{trans:P,transless:qe.transless||qe}):function Re(Ie,he,Pe,Ee){if(Ie.idbdb&&(Ie._state.openComplete||qe.letThrough||Ie._vip)){var Te=Ie._createTransaction(he,Pe,Ie._dbSchema);try{Te.create(),Ie._state.PR1398_maxLoop=3}catch(xe){return xe.name===re.InvalidState&&Ie.isOpen()&&0<--Ie._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Ie.close({disableAutoOpen:!1}),Ie.open().then(function(){return Re(Ie,he,Pe,Ee)})):Kn(xe)}return Te._promise(he,function(xe,De){return Ye(function(){return qe.trans=Te,Ee(xe,De,Te)})}).then(function(xe){if(he==="readwrite")try{Te.idbtrans.commit()}catch{}return he==="readonly"?xe:Te._completion.then(function(){return xe})})}if(Ie._state.openComplete)return Kn(new K.DatabaseClosed(Ie._state.dbOpenError));if(!Ie._state.isBeingOpened){if(!Ie._state.autoOpen)return Kn(new K.DatabaseClosed);Ie.open().catch(Se)}return Ie._state.dbReadyPromise.then(function(){return Re(Ie,he,Pe,Ee)})}(this.db,m,[this.name],ne);return j&&(Ce._consoleTask=j,Ce=Ce.catch(function(Re){return console.trace(Re),Kn(Re)})),Ce}finally{ue&&mr()}},$n.prototype.get=function(m,y){var _=this;return m&&m.constructor===Object?this.where(m).first(y):m==null?Kn(new K.Type("Invalid argument to Table.get()")):this._trans("readonly",function(P){return _.core.get({trans:P,key:m}).then(function(L){return _.hook.reading.fire(L)})}).then(y)},$n.prototype.where=function(m){if(typeof m=="string")return new this.db.WhereClause(this,m);if(a(m))return new this.db.WhereClause(this,"[".concat(m.join("+"),"]"));var y=i(m);if(y.length===1)return this.where(y[0]).equals(m[y[0]]);var _=this.schema.indexes.concat(this.schema.primKey).filter(function(ue){if(ue.compound&&y.every(function(Re){return 0<=ue.keyPath.indexOf(Re)})){for(var Ce=0;Ce<y.length;++Ce)if(y.indexOf(ue.keyPath[Ce])===-1)return!1;return!0}return!1}).sort(function(ue,Ce){return ue.keyPath.length-Ce.keyPath.length})[0];if(_&&this.db._maxKey!==Ai){var j=_.keyPath.slice(0,y.length);return this.where(j).equals(j.map(function(Ce){return m[Ce]}))}!_&&$&&console.warn("The query ".concat(JSON.stringify(m)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(y.join("+"),"]"));var P=this.schema.idxByName;function L(ue,Ce){return ln(ue,Ce)===0}var ne=y.reduce(function(he,Ce){var Re=he[0],Ie=he[1],he=P[Ce],Pe=m[Ce];return[Re||he,Re||!he?Ac(Ie,he&&he.multi?function(Ee){return Ee=R(Ee,Ce),a(Ee)&&Ee.some(function(Te){return L(Pe,Te)})}:function(Ee){return L(Pe,R(Ee,Ce))}):Ie]},[null,null]),j=ne[0],ne=ne[1];return j?this.where(j.name).equals(m[j.keyPath]).filter(ne):_?this.filter(ne):this.where(y).equals("")},$n.prototype.filter=function(m){return this.toCollection().and(m)},$n.prototype.count=function(m){return this.toCollection().count(m)},$n.prototype.offset=function(m){return this.toCollection().offset(m)},$n.prototype.limit=function(m){return this.toCollection().limit(m)},$n.prototype.each=function(m){return this.toCollection().each(m)},$n.prototype.toArray=function(m){return this.toCollection().toArray(m)},$n.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},$n.prototype.orderBy=function(m){return new this.db.Collection(new this.db.WhereClause(this,a(m)?"[".concat(m.join("+"),"]"):m))},$n.prototype.reverse=function(){return this.toCollection().reverse()},$n.prototype.mapToClass=function(m){var y,_=this.db,P=this.name;function L(){return y!==null&&y.apply(this,arguments)||this}(this.schema.mappedClass=m).prototype instanceof $B&&(function(Ce,Re){if(typeof Re!="function"&&Re!==null)throw new TypeError("Class extends value "+String(Re)+" is not a constructor or null");function Ie(){this.constructor=Ce}n(Ce,Re),Ce.prototype=Re===null?Object.create(Re):(Ie.prototype=Re.prototype,new Ie)}(L,y=m),Object.defineProperty(L.prototype,"db",{get:function(){return _},enumerable:!1,configurable:!0}),L.prototype.table=function(){return P},m=L);for(var j=new Set,ne=m.prototype;ne;ne=c(ne))Object.getOwnPropertyNames(ne).forEach(function(Ce){return j.add(Ce)});function ue(Ce){if(!Ce)return Ce;var Re,Ie=Object.create(m.prototype);for(Re in Ce)if(!j.has(Re))try{Ie[Re]=Ce[Re]}catch{}return Ie}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=ue,this.hook("reading",ue),m},$n.prototype.defineClass=function(){return this.mapToClass(function(m){l(this,m)})},$n.prototype.add=function(m,y){var _=this,P=this.schema.primKey,L=P.auto,j=P.keyPath,ne=m;return j&&L&&(ne=Py(j)(m)),this._trans("readwrite",function(ue){return _.core.mutate({trans:ue,type:"add",keys:y!=null?[y]:null,values:[ne]})}).then(function(ue){return ue.numFailures?nt.reject(ue.failures[0]):ue.lastResult}).then(function(ue){if(j)try{T(m,j,ue)}catch{}return ue})},$n.prototype.update=function(m,y){return typeof m!="object"||a(m)?this.where(":id").equals(m).modify(y):(m=R(m,this.schema.primKey.keyPath),m===void 0?Kn(new K.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(m).modify(y))},$n.prototype.put=function(m,y){var _=this,P=this.schema.primKey,L=P.auto,j=P.keyPath,ne=m;return j&&L&&(ne=Py(j)(m)),this._trans("readwrite",function(ue){return _.core.mutate({trans:ue,type:"put",values:[ne],keys:y!=null?[y]:null})}).then(function(ue){return ue.numFailures?nt.reject(ue.failures[0]):ue.lastResult}).then(function(ue){if(j)try{T(m,j,ue)}catch{}return ue})},$n.prototype.delete=function(m){var y=this;return this._trans("readwrite",function(_){return y.core.mutate({trans:_,type:"delete",keys:[m]})}).then(function(_){return _.numFailures?nt.reject(_.failures[0]):void 0})},$n.prototype.clear=function(){var m=this;return this._trans("readwrite",function(y){return m.core.mutate({trans:y,type:"deleteRange",range:BB})}).then(function(y){return y.numFailures?nt.reject(y.failures[0]):void 0})},$n.prototype.bulkGet=function(m){var y=this;return this._trans("readonly",function(_){return y.core.getMany({keys:m,trans:_}).then(function(P){return P.map(function(L){return y.hook.reading.fire(L)})})})},$n.prototype.bulkAdd=function(m,y,_){var P=this,L=Array.isArray(y)?y:void 0,j=(_=_||(L?void 0:y))?_.allKeys:void 0;return this._trans("readwrite",function(ne){var Re=P.schema.primKey,ue=Re.auto,Re=Re.keyPath;if(Re&&L)throw new K.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(L&&L.length!==m.length)throw new K.InvalidArgument("Arguments objects and keys must have the same length");var Ce=m.length,Re=Re&&ue?m.map(Py(Re)):m;return P.core.mutate({trans:ne,type:"add",keys:L,values:Re,wantResults:j}).then(function(Te){var he=Te.numFailures,Pe=Te.results,Ee=Te.lastResult,Te=Te.failures;if(he===0)return j?Pe:Ee;throw new ve("".concat(P.name,".bulkAdd(): ").concat(he," of ").concat(Ce," operations failed"),Te)})})},$n.prototype.bulkPut=function(m,y,_){var P=this,L=Array.isArray(y)?y:void 0,j=(_=_||(L?void 0:y))?_.allKeys:void 0;return this._trans("readwrite",function(ne){var Re=P.schema.primKey,ue=Re.auto,Re=Re.keyPath;if(Re&&L)throw new K.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(L&&L.length!==m.length)throw new K.InvalidArgument("Arguments objects and keys must have the same length");var Ce=m.length,Re=Re&&ue?m.map(Py(Re)):m;return P.core.mutate({trans:ne,type:"put",keys:L,values:Re,wantResults:j}).then(function(Te){var he=Te.numFailures,Pe=Te.results,Ee=Te.lastResult,Te=Te.failures;if(he===0)return j?Pe:Ee;throw new ve("".concat(P.name,".bulkPut(): ").concat(he," of ").concat(Ce," operations failed"),Te)})})},$n.prototype.bulkUpdate=function(m){var y=this,_=this.core,P=m.map(function(ne){return ne.key}),L=m.map(function(ne){return ne.changes}),j=[];return this._trans("readwrite",function(ne){return _.getMany({trans:ne,keys:P,cache:"clone"}).then(function(ue){var Ce=[],Re=[];m.forEach(function(he,Pe){var Ee=he.key,Te=he.changes,xe=ue[Pe];if(xe){for(var De=0,Me=Object.keys(Te);De<Me.length;De++){var $e=Me[De],He=Te[$e];if($e===y.schema.primKey.keyPath){if(ln(He,Ee)!==0)throw new K.Constraint("Cannot update primary key in bulkUpdate()")}else T(xe,$e,He)}j.push(Pe),Ce.push(Ee),Re.push(xe)}});var Ie=Ce.length;return _.mutate({trans:ne,type:"put",keys:Ce,values:Re,updates:{keys:P,changeSpecs:L}}).then(function(he){var Pe=he.numFailures,Ee=he.failures;if(Pe===0)return Ie;for(var Te=0,xe=Object.keys(Ee);Te<xe.length;Te++){var De,Me=xe[Te],$e=j[Number(Me)];$e!=null&&(De=Ee[Me],delete Ee[Me],Ee[$e]=De)}throw new ve("".concat(y.name,".bulkUpdate(): ").concat(Pe," of ").concat(Ie," operations failed"),Ee)})})})},$n.prototype.bulkDelete=function(m){var y=this,_=m.length;return this._trans("readwrite",function(P){return y.core.mutate({trans:P,type:"delete",keys:m})}).then(function(ne){var L=ne.numFailures,j=ne.lastResult,ne=ne.failures;if(L===0)return j;throw new ve("".concat(y.name,".bulkDelete(): ").concat(L," of ").concat(_," operations failed"),ne)})},$n);function $n(){}function yp(m){function y(ne,ue){if(ue){for(var Ce=arguments.length,Re=new Array(Ce-1);--Ce;)Re[Ce-1]=arguments[Ce];return _[ne].subscribe.apply(null,Re),m}if(typeof ne=="string")return _[ne]}var _={};y.addEventType=j;for(var P=1,L=arguments.length;P<L;++P)j(arguments[P]);return y;function j(ne,ue,Ce){if(typeof ne!="object"){var Re;ue=ue||ye;var Ie={subscribers:[],fire:Ce=Ce||Se,subscribe:function(he){Ie.subscribers.indexOf(he)===-1&&(Ie.subscribers.push(he),Ie.fire=ue(Ie.fire,he))},unsubscribe:function(he){Ie.subscribers=Ie.subscribers.filter(function(Pe){return Pe!==he}),Ie.fire=Ie.subscribers.reduce(ue,Ce)}};return _[ne]=y[ne]=Ie}i(Re=ne).forEach(function(he){var Pe=Re[he];if(a(Pe))j(he,Re[he][0],Re[he][1]);else{if(Pe!=="asap")throw new K.InvalidArgument("Invalid event config");var Ee=j(he,U,function(){for(var Te=arguments.length,xe=new Array(Te);Te--;)xe[Te]=arguments[Te];Ee.subscribers.forEach(function(De){D(function(){De.apply(null,xe)})})})}})}}function wp(m,y){return g(y).from({prototype:m}),y}function Nd(m,y){return!(m.filter||m.algorithm||m.or)&&(y?m.justLimit:!m.replayFilter)}function R_(m,y){m.filter=Ac(m.filter,y)}function D_(m,y,_){var P=m.replayFilter;m.replayFilter=P?function(){return Ac(P(),y())}:y,m.justLimit=_&&!P}function Ay(m,y){if(m.isPrimKey)return y.primaryKey;var _=y.getIndexByKeyPath(m.index);if(!_)throw new K.Schema("KeyPath "+m.index+" on object store "+y.name+" is not indexed");return _}function WB(m,y,_){var P=Ay(m,y.schema);return y.openCursor({trans:_,values:!m.keysOnly,reverse:m.dir==="prev",unique:!!m.unique,query:{index:P,range:m.range}})}function ky(m,y,_,P){var L=m.replayFilter?Ac(m.filter,m.replayFilter()):m.filter;if(m.or){var j={},ne=function(ue,Ce,Re){var Ie,he;L&&!L(Ce,Re,function(Pe){return Ce.stop(Pe)},function(Pe){return Ce.fail(Pe)})||((he=""+(Ie=Ce.primaryKey))=="[object ArrayBuffer]"&&(he=""+new Uint8Array(Ie)),d(j,he)||(j[he]=!0,y(ue,Ce,Re)))};return Promise.all([m.or._iterate(ne,_),zB(WB(m,P,_),m.algorithm,ne,!m.keysOnly&&m.valueMapper)])}return zB(WB(m,P,_),Ac(m.algorithm,L),y,!m.keysOnly&&m.valueMapper)}function zB(m,y,_,P){var L=kn(P?function(j,ne,ue){return _(P(j),ne,ue)}:_);return m.then(function(j){if(j)return j.start(function(){var ne=function(){return j.continue()};y&&!y(j,function(ue){return ne=ue},function(ue){j.stop(ue),ne=Se},function(ue){j.fail(ue),ne=Se})||L(j.value,j,function(ue){return ne=ue}),ne()})})}var ba=Symbol(),Cp=(jB.prototype.execute=function(m){if(this.add!==void 0){var y=this.add;if(a(y))return o(o([],a(m)?m:[],!0),y).sort();if(typeof y=="number")return(Number(m)||0)+y;if(typeof y=="bigint")try{return BigInt(m)+y}catch{return BigInt(0)+y}throw new TypeError("Invalid term ".concat(y))}if(this.remove!==void 0){var _=this.remove;if(a(_))return a(m)?m.filter(function(P){return!_.includes(P)}).sort():[];if(typeof _=="number")return Number(m)-_;if(typeof _=="bigint")try{return BigInt(m)-_}catch{return BigInt(0)-_}throw new TypeError("Invalid subtrahend ".concat(_))}return y=(y=this.replacePrefix)===null||y===void 0?void 0:y[0],y&&typeof m=="string"&&m.startsWith(y)?this.replacePrefix[1]+m.substring(y.length):m},jB);function jB(m){Object.assign(this,m)}var hbe=(vn.prototype._read=function(m,y){var _=this._ctx;return _.error?_.table._trans(null,Kn.bind(null,_.error)):_.table._trans("readonly",m).then(y)},vn.prototype._write=function(m){var y=this._ctx;return y.error?y.table._trans(null,Kn.bind(null,y.error)):y.table._trans("readwrite",m,"locked")},vn.prototype._addAlgorithm=function(m){var y=this._ctx;y.algorithm=Ac(y.algorithm,m)},vn.prototype._iterate=function(m,y){return ky(this._ctx,m,y,this._ctx.table.core)},vn.prototype.clone=function(m){var y=Object.create(this.constructor.prototype),_=Object.create(this._ctx);return m&&l(_,m),y._ctx=_,y},vn.prototype.raw=function(){return this._ctx.valueMapper=null,this},vn.prototype.each=function(m){var y=this._ctx;return this._read(function(_){return ky(y,m,_,y.table.core)})},vn.prototype.count=function(m){var y=this;return this._read(function(_){var P=y._ctx,L=P.table.core;if(Nd(P,!0))return L.count({trans:_,query:{index:Ay(P,L.schema),range:P.range}}).then(function(ne){return Math.min(ne,P.limit)});var j=0;return ky(P,function(){return++j,!1},_,L).then(function(){return j})}).then(m)},vn.prototype.sortBy=function(m,y){var _=m.split(".").reverse(),P=_[0],L=_.length-1;function j(Ce,Re){return Re?j(Ce[_[Re]],Re-1):Ce[P]}var ne=this._ctx.dir==="next"?1:-1;function ue(Ce,Re){return ln(j(Ce,L),j(Re,L))*ne}return this.toArray(function(Ce){return Ce.sort(ue)}).then(y)},vn.prototype.toArray=function(m){var y=this;return this._read(function(_){var P=y._ctx;if(P.dir==="next"&&Nd(P,!0)&&0<P.limit){var L=P.valueMapper,j=Ay(P,P.table.core.schema);return P.table.core.query({trans:_,limit:P.limit,values:!0,query:{index:j,range:P.range}}).then(function(ue){return ue=ue.result,L?ue.map(L):ue})}var ne=[];return ky(P,function(ue){return ne.push(ue)},_,P.table.core).then(function(){return ne})},m)},vn.prototype.offset=function(m){var y=this._ctx;return m<=0||(y.offset+=m,Nd(y)?D_(y,function(){var _=m;return function(P,L){return _===0||(_===1?--_:L(function(){P.advance(_),_=0}),!1)}}):D_(y,function(){var _=m;return function(){return--_<0}})),this},vn.prototype.limit=function(m){return this._ctx.limit=Math.min(this._ctx.limit,m),D_(this._ctx,function(){var y=m;return function(_,P,L){return--y<=0&&P(L),0<=y}},!0),this},vn.prototype.until=function(m,y){return R_(this._ctx,function(_,P,L){return!m(_.value)||(P(L),y)}),this},vn.prototype.first=function(m){return this.limit(1).toArray(function(y){return y[0]}).then(m)},vn.prototype.last=function(m){return this.reverse().first(m)},vn.prototype.filter=function(m){var y;return R_(this._ctx,function(_){return m(_.value)}),(y=this._ctx).isMatch=Ac(y.isMatch,m),this},vn.prototype.and=function(m){return this.filter(m)},vn.prototype.or=function(m){return new this.db.WhereClause(this._ctx.table,m,this)},vn.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},vn.prototype.desc=function(){return this.reverse()},vn.prototype.eachKey=function(m){var y=this._ctx;return y.keysOnly=!y.isMatch,this.each(function(_,P){m(P.key,P)})},vn.prototype.eachUniqueKey=function(m){return this._ctx.unique="unique",this.eachKey(m)},vn.prototype.eachPrimaryKey=function(m){var y=this._ctx;return y.keysOnly=!y.isMatch,this.each(function(_,P){m(P.primaryKey,P)})},vn.prototype.keys=function(m){var y=this._ctx;y.keysOnly=!y.isMatch;var _=[];return this.each(function(P,L){_.push(L.key)}).then(function(){return _}).then(m)},vn.prototype.primaryKeys=function(m){var y=this._ctx;if(y.dir==="next"&&Nd(y,!0)&&0<y.limit)return this._read(function(P){var L=Ay(y,y.table.core.schema);return y.table.core.query({trans:P,values:!1,limit:y.limit,query:{index:L,range:y.range}})}).then(function(P){return P.result}).then(m);y.keysOnly=!y.isMatch;var _=[];return this.each(function(P,L){_.push(L.primaryKey)}).then(function(){return _}).then(m)},vn.prototype.uniqueKeys=function(m){return this._ctx.unique="unique",this.keys(m)},vn.prototype.firstKey=function(m){return this.limit(1).keys(function(y){return y[0]}).then(m)},vn.prototype.lastKey=function(m){return this.reverse().firstKey(m)},vn.prototype.distinct=function(){var m=this._ctx,m=m.index&&m.table.schema.idxByName[m.index];if(!m||!m.multi)return this;var y={};return R_(this._ctx,function(L){var P=L.primaryKey.toString(),L=d(y,P);return y[P]=!0,!L}),this},vn.prototype.modify=function(m){var y=this,_=this._ctx;return this._write(function(P){var L,j,ne;ne=typeof m=="function"?m:(L=i(m),j=L.length,function(De){for(var Me=!1,$e=0;$e<j;++$e){var He=L[$e],Ze=m[He],rt=R(De,He);Ze instanceof Cp?(T(De,He,Ze.execute(rt)),Me=!0):rt!==Ze&&(T(De,He,Ze),Me=!0)}return Me});var ue=_.table.core,he=ue.schema.primaryKey,Ce=he.outbound,Re=he.extractKey,Ie=200,he=y.db._options.modifyChunkSize;he&&(Ie=typeof he=="object"?he[ue.name]||he["*"]||200:he);function Pe(De,He){var $e=He.failures,He=He.numFailures;Te+=De-He;for(var Ze=0,rt=i($e);Ze<rt.length;Ze++){var mt=rt[Ze];Ee.push($e[mt])}}var Ee=[],Te=0,xe=[];return y.clone().primaryKeys().then(function(De){function Me(He){var Ze=Math.min(Ie,De.length-He);return ue.getMany({trans:P,keys:De.slice(He,He+Ze),cache:"immutable"}).then(function(rt){for(var mt=[],it=[],lt=Ce?[]:null,St=[],ft=0;ft<Ze;++ft){var Rt=rt[ft],Jt={value:k(Rt),primKey:De[He+ft]};ne.call(Jt,Jt.value,Jt)!==!1&&(Jt.value==null?St.push(De[He+ft]):Ce||ln(Re(Rt),Re(Jt.value))===0?(it.push(Jt.value),Ce&<.push(De[He+ft])):(St.push(De[He+ft]),mt.push(Jt.value)))}return Promise.resolve(0<mt.length&&ue.mutate({trans:P,type:"add",values:mt}).then(function(sn){for(var on in sn.failures)St.splice(parseInt(on),1);Pe(mt.length,sn)})).then(function(){return(0<it.length||$e&&typeof m=="object")&&ue.mutate({trans:P,type:"put",keys:lt,values:it,criteria:$e,changeSpec:typeof m!="function"&&m,isAdditionalChunk:0<He}).then(function(sn){return Pe(it.length,sn)})}).then(function(){return(0<St.length||$e&&m===T_)&&ue.mutate({trans:P,type:"delete",keys:St,criteria:$e,isAdditionalChunk:0<He}).then(function(sn){return Pe(St.length,sn)})}).then(function(){return De.length>He+Ze&&Me(He+Ie)})})}var $e=Nd(_)&&_.limit===1/0&&(typeof m!="function"||m===T_)&&{index:_.index,range:_.range};return Me(0).then(function(){if(0<Ee.length)throw new pe("Error modifying one or more objects",Ee,Te,xe);return De.length})})})},vn.prototype.delete=function(){var m=this._ctx,y=m.range;return Nd(m)&&(m.isPrimKey||y.type===3)?this._write(function(_){var P=m.table.core.schema.primaryKey,L=y;return m.table.core.count({trans:_,query:{index:P,range:L}}).then(function(j){return m.table.core.mutate({trans:_,type:"deleteRange",range:L}).then(function(ne){var ue=ne.failures;if(ne.lastResult,ne.results,ne=ne.numFailures,ne)throw new pe("Could not delete some values",Object.keys(ue).map(function(Ce){return ue[Ce]}),j-ne);return j-ne})})}):this.modify(T_)},vn);function vn(){}var T_=function(m,y){return y.value=null};function fbe(m,y){return m<y?-1:m===y?0:1}function pbe(m,y){return y<m?-1:m===y?0:1}function Uo(m,y,_){return m=m instanceof qB?new m.Collection(m):m,m._ctx.error=new(_||TypeError)(y),m}function Ld(m){return new m.Collection(m,function(){return KB("")}).limit(0)}function Oy(m,y,_,P){var L,j,ne,ue,Ce,Re,Ie,he=_.length;if(!_.every(function(Te){return typeof Te=="string"}))return Uo(m,VB);function Pe(Te){L=Te==="next"?function(De){return De.toUpperCase()}:function(De){return De.toLowerCase()},j=Te==="next"?function(De){return De.toLowerCase()}:function(De){return De.toUpperCase()},ne=Te==="next"?fbe:pbe;var xe=_.map(function(De){return{lower:j(De),upper:L(De)}}).sort(function(De,Me){return ne(De.lower,Me.lower)});ue=xe.map(function(De){return De.upper}),Ce=xe.map(function(De){return De.lower}),Ie=(Re=Te)==="next"?"":P}Pe("next"),m=new m.Collection(m,function(){return vl(ue[0],Ce[he-1]+P)}),m._ondirectionchange=function(Te){Pe(Te)};var Ee=0;return m._addAlgorithm(function(Te,xe,De){var Me=Te.key;if(typeof Me!="string")return!1;var $e=j(Me);if(y($e,Ce,Ee))return!0;for(var He=null,Ze=Ee;Ze<he;++Ze){var rt=function(mt,it,lt,St,ft,Rt){for(var Jt=Math.min(mt.length,St.length),sn=-1,on=0;on<Jt;++on){var Wo=it[on];if(Wo!==St[on])return ft(mt[on],lt[on])<0?mt.substr(0,on)+lt[on]+lt.substr(on+1):ft(mt[on],St[on])<0?mt.substr(0,on)+St[on]+lt.substr(on+1):0<=sn?mt.substr(0,sn)+it[sn]+lt.substr(sn+1):null;ft(mt[on],Wo)<0&&(sn=on)}return Jt<St.length&&Rt==="next"?mt+lt.substr(mt.length):Jt<mt.length&&Rt==="prev"?mt.substr(0,lt.length):sn<0?null:mt.substr(0,sn)+St[sn]+lt.substr(sn+1)}(Me,$e,ue[Ze],Ce[Ze],ne,Re);rt===null&&He===null?Ee=Ze+1:(He===null||0<ne(He,rt))&&(He=rt)}return xe(He!==null?function(){Te.continue(He+Ie)}:De),!1}),m}function vl(m,y,_,P){return{type:2,lower:m,upper:y,lowerOpen:_,upperOpen:P}}function KB(m){return{type:1,lower:m,upper:m}}var qB=(Object.defineProperty(xs.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),xs.prototype.between=function(m,y,_,P){_=_!==!1,P=P===!0;try{return 0<this._cmp(m,y)||this._cmp(m,y)===0&&(_||P)&&(!_||!P)?Ld(this):new this.Collection(this,function(){return vl(m,y,!_,!P)})}catch{return Uo(this,bo)}},xs.prototype.equals=function(m){return m==null?Uo(this,bo):new this.Collection(this,function(){return KB(m)})},xs.prototype.above=function(m){return m==null?Uo(this,bo):new this.Collection(this,function(){return vl(m,void 0,!0)})},xs.prototype.aboveOrEqual=function(m){return m==null?Uo(this,bo):new this.Collection(this,function(){return vl(m,void 0,!1)})},xs.prototype.below=function(m){return m==null?Uo(this,bo):new this.Collection(this,function(){return vl(void 0,m,!1,!0)})},xs.prototype.belowOrEqual=function(m){return m==null?Uo(this,bo):new this.Collection(this,function(){return vl(void 0,m)})},xs.prototype.startsWith=function(m){return typeof m!="string"?Uo(this,VB):this.between(m,m+Ai,!0,!0)},xs.prototype.startsWithIgnoreCase=function(m){return m===""?this.startsWith(m):Oy(this,function(y,_){return y.indexOf(_[0])===0},[m],Ai)},xs.prototype.equalsIgnoreCase=function(m){return Oy(this,function(y,_){return y===_[0]},[m],"")},xs.prototype.anyOfIgnoreCase=function(){var m=ae.apply(ie,arguments);return m.length===0?Ld(this):Oy(this,function(y,_){return _.indexOf(y)!==-1},m,"")},xs.prototype.startsWithAnyOfIgnoreCase=function(){var m=ae.apply(ie,arguments);return m.length===0?Ld(this):Oy(this,function(y,_){return _.some(function(P){return y.indexOf(P)===0})},m,Ai)},xs.prototype.anyOf=function(){var m=this,y=ae.apply(ie,arguments),_=this._cmp;try{y.sort(_)}catch{return Uo(this,bo)}if(y.length===0)return Ld(this);var P=new this.Collection(this,function(){return vl(y[0],y[y.length-1])});P._ondirectionchange=function(j){_=j==="next"?m._ascending:m._descending,y.sort(_)};var L=0;return P._addAlgorithm(function(j,ne,ue){for(var Ce=j.key;0<_(Ce,y[L]);)if(++L===y.length)return ne(ue),!1;return _(Ce,y[L])===0||(ne(function(){j.continue(y[L])}),!1)}),P},xs.prototype.notEqual=function(m){return this.inAnyRange([[-1/0,m],[m,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},xs.prototype.noneOf=function(){var m=ae.apply(ie,arguments);if(m.length===0)return new this.Collection(this);try{m.sort(this._ascending)}catch{return Uo(this,bo)}var y=m.reduce(function(_,P){return _?_.concat([[_[_.length-1][1],P]]):[[-1/0,P]]},null);return y.push([m[m.length-1],this.db._maxKey]),this.inAnyRange(y,{includeLowers:!1,includeUppers:!1})},xs.prototype.inAnyRange=function(Me,y){var _=this,P=this._cmp,L=this._ascending,j=this._descending,ne=this._min,ue=this._max;if(Me.length===0)return Ld(this);if(!Me.every(function($e){return $e[0]!==void 0&&$e[1]!==void 0&&L($e[0],$e[1])<=0}))return Uo(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",K.InvalidArgument);var Ce=!y||y.includeLowers!==!1,Re=y&&y.includeUppers===!0,Ie,he=L;function Pe($e,He){return he($e[0],He[0])}try{(Ie=Me.reduce(function($e,He){for(var Ze=0,rt=$e.length;Ze<rt;++Ze){var mt=$e[Ze];if(P(He[0],mt[1])<0&&0<P(He[1],mt[0])){mt[0]=ne(mt[0],He[0]),mt[1]=ue(mt[1],He[1]);break}}return Ze===rt&&$e.push(He),$e},[])).sort(Pe)}catch{return Uo(this,bo)}var Ee=0,Te=Re?function($e){return 0<L($e,Ie[Ee][1])}:function($e){return 0<=L($e,Ie[Ee][1])},xe=Ce?function($e){return 0<j($e,Ie[Ee][0])}:function($e){return 0<=j($e,Ie[Ee][0])},De=Te,Me=new this.Collection(this,function(){return vl(Ie[0][0],Ie[Ie.length-1][1],!Ce,!Re)});return Me._ondirectionchange=function($e){he=$e==="next"?(De=Te,L):(De=xe,j),Ie.sort(Pe)},Me._addAlgorithm(function($e,He,Ze){for(var rt,mt=$e.key;De(mt);)if(++Ee===Ie.length)return He(Ze),!1;return!Te(rt=mt)&&!xe(rt)||(_._cmp(mt,Ie[Ee][1])===0||_._cmp(mt,Ie[Ee][0])===0||He(function(){he===L?$e.continue(Ie[Ee][0]):$e.continue(Ie[Ee][1])}),!1)}),Me},xs.prototype.startsWithAnyOf=function(){var m=ae.apply(ie,arguments);return m.every(function(y){return typeof y=="string"})?m.length===0?Ld(this):this.inAnyRange(m.map(function(y){return[y,y+Ai]})):Uo(this,"startsWithAnyOf() only works with strings")},xs);function xs(){}function ki(m){return kn(function(y){return bp(y),m(y.target.error),!1})}function bp(m){m.stopPropagation&&m.stopPropagation(),m.preventDefault&&m.preventDefault()}var Sp="storagemutated",I_="x-storagemutated-1",yl=yp(null,Sp),gbe=(Oi.prototype._lock=function(){return w(!qe.global),++this._reculock,this._reculock!==1||qe.global||(qe.lockOwnerFor=this),this},Oi.prototype._unlock=function(){if(w(!qe.global),--this._reculock==0)for(qe.global||(qe.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var m=this._blockedFuncs.shift();try{oo(m[1],m[0])}catch{}}return this},Oi.prototype._locked=function(){return this._reculock&&qe.lockOwnerFor!==this},Oi.prototype.create=function(m){var y=this;if(!this.mode)return this;var _=this.db.idbdb,P=this.db._state.dbOpenError;if(w(!this.idbtrans),!m&&!_)switch(P&&P.name){case"DatabaseClosedError":throw new K.DatabaseClosed(P);case"MissingAPIError":throw new K.MissingAPI(P.message,P);default:throw new K.OpenFailed(P)}if(!this.active)throw new K.TransactionInactive;return w(this._completion._state===null),(m=this.idbtrans=m||(this.db.core||_).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=kn(function(L){bp(L),y._reject(m.error)}),m.onabort=kn(function(L){bp(L),y.active&&y._reject(new K.Abort(m.error)),y.active=!1,y.on("abort").fire(L)}),m.oncomplete=kn(function(){y.active=!1,y._resolve(),"mutatedParts"in m&&yl.storagemutated.fire(m.mutatedParts)}),this},Oi.prototype._promise=function(m,y,_){var P=this;if(m==="readwrite"&&this.mode!=="readwrite")return Kn(new K.ReadOnly("Transaction is readonly"));if(!this.active)return Kn(new K.TransactionInactive);if(this._locked())return new nt(function(j,ne){P._blockedFuncs.push([function(){P._promise(m,y,_).then(j,ne)},qe])});if(_)return Ye(function(){var j=new nt(function(ne,ue){P._lock();var Ce=y(ne,ue,P);Ce&&Ce.then&&Ce.then(ne,ue)});return j.finally(function(){return P._unlock()}),j._lib=!0,j});var L=new nt(function(j,ne){var ue=y(j,ne,P);ue&&ue.then&&ue.then(j,ne)});return L._lib=!0,L},Oi.prototype._root=function(){return this.parent?this.parent._root():this},Oi.prototype.waitFor=function(m){var y,_=this._root(),P=nt.resolve(m);_._waitingFor?_._waitingFor=_._waitingFor.then(function(){return P}):(_._waitingFor=P,_._waitingQueue=[],y=_.idbtrans.objectStore(_.storeNames[0]),function j(){for(++_._spinCount;_._waitingQueue.length;)_._waitingQueue.shift()();_._waitingFor&&(y.get(-1/0).onsuccess=j)}());var L=_._waitingFor;return new nt(function(j,ne){P.then(function(ue){return _._waitingQueue.push(kn(j.bind(null,ue)))},function(ue){return _._waitingQueue.push(kn(ne.bind(null,ue)))}).finally(function(){_._waitingFor===L&&(_._waitingFor=null)})})},Oi.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new K.Abort))},Oi.prototype.table=function(m){var y=this._memoizedTables||(this._memoizedTables={});if(d(y,m))return y[m];var _=this.schema[m];if(!_)throw new K.NotFound("Table "+m+" not part of transaction");return _=new this.db.Table(m,_,this),_.core=this.db.core.table(m),y[m]=_},Oi);function Oi(){}function x_(m,y,_,P,L,j,ne){return{name:m,keyPath:y,unique:_,multi:P,auto:L,compound:j,src:(_&&!ne?"&":"")+(P?"*":"")+(L?"++":"")+YB(y)}}function YB(m){return typeof m=="string"?m:m?"["+[].join.call(m,"+")+"]":""}function F_(m,y,_){return{name:m,primKey:y,indexes:_,mappedClass:null,idxByName:(P=function(L){return[L.name,L]},_.reduce(function(L,j,ne){return ne=P(j,ne),ne&&(L[ne[0]]=ne[1]),L},{}))};var P}var Ep=function(m){try{return m.only([[]]),Ep=function(){return[[]]},[[]]}catch{return Ep=function(){return Ai},Ai}};function P_(m){return m==null?function(){}:typeof m=="string"?(y=m).split(".").length===1?function(_){return _[y]}:function(_){return R(_,y)}:function(_){return R(_,m)};var y}function ZB(m){return[].slice.call(m)}var mbe=0;function _p(m){return m==null?":id":typeof m=="string"?m:"[".concat(m.join("+"),"]")}function vbe(m,y,Ce){function P(De){if(De.type===3)return null;if(De.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var Ee=De.lower,Te=De.upper,xe=De.lowerOpen,De=De.upperOpen;return Ee===void 0?Te===void 0?null:y.upperBound(Te,!!De):Te===void 0?y.lowerBound(Ee,!!xe):y.bound(Ee,Te,!!xe,!!De)}function L(Pe){var Ee,Te=Pe.name;return{name:Te,schema:Pe,mutate:function(xe){var De=xe.trans,Me=xe.type,$e=xe.keys,He=xe.values,Ze=xe.range;return new Promise(function(rt,mt){rt=kn(rt);var it=De.objectStore(Te),lt=it.keyPath==null,St=Me==="put"||Me==="add";if(!St&&Me!=="delete"&&Me!=="deleteRange")throw new Error("Invalid operation type: "+Me);var ft,Rt=($e||He||{length:1}).length;if($e&&He&&$e.length!==He.length)throw new Error("Given keys array must have same length as given values array.");if(Rt===0)return rt({numFailures:0,failures:{},results:[],lastResult:void 0});function Jt(ro){++Wo,bp(ro)}var sn=[],on=[],Wo=0;if(Me==="deleteRange"){if(Ze.type===4)return rt({numFailures:Wo,failures:on,results:[],lastResult:void 0});Ze.type===3?sn.push(ft=it.clear()):sn.push(ft=it.delete(P(Ze)))}else{var lt=St?lt?[He,$e]:[He,null]:[$e,null],jt=lt[0],Ks=lt[1];if(St)for(var qs=0;qs<Rt;++qs)sn.push(ft=Ks&&Ks[qs]!==void 0?it[Me](jt[qs],Ks[qs]):it[Me](jt[qs])),ft.onerror=Jt;else for(qs=0;qs<Rt;++qs)sn.push(ft=it[Me](jt[qs])),ft.onerror=Jt}function Ky(ro){ro=ro.target.result,sn.forEach(function(Mc,Y_){return Mc.error!=null&&(on[Y_]=Mc.error)}),rt({numFailures:Wo,failures:on,results:Me==="delete"?$e:sn.map(function(Mc){return Mc.result}),lastResult:ro})}ft.onerror=function(ro){Jt(ro),Ky(ro)},ft.onsuccess=Ky})},getMany:function(xe){var De=xe.trans,Me=xe.keys;return new Promise(function($e,He){$e=kn($e);for(var Ze,rt=De.objectStore(Te),mt=Me.length,it=new Array(mt),lt=0,St=0,ft=function(sn){sn=sn.target,it[sn._pos]=sn.result,++St===lt&&$e(it)},Rt=ki(He),Jt=0;Jt<mt;++Jt)Me[Jt]!=null&&((Ze=rt.get(Me[Jt]))._pos=Jt,Ze.onsuccess=ft,Ze.onerror=Rt,++lt);lt===0&&$e(it)})},get:function(xe){var De=xe.trans,Me=xe.key;return new Promise(function($e,He){$e=kn($e);var Ze=De.objectStore(Te).get(Me);Ze.onsuccess=function(rt){return $e(rt.target.result)},Ze.onerror=ki(He)})},query:(Ee=Re,function(xe){return new Promise(function(De,Me){De=kn(De);var $e,He,Ze,lt=xe.trans,rt=xe.values,mt=xe.limit,ft=xe.query,it=mt===1/0?void 0:mt,St=ft.index,ft=ft.range,lt=lt.objectStore(Te),St=St.isPrimaryKey?lt:lt.index(St.name),ft=P(ft);if(mt===0)return De({result:[]});Ee?((it=rt?St.getAll(ft,it):St.getAllKeys(ft,it)).onsuccess=function(Rt){return De({result:Rt.target.result})},it.onerror=ki(Me)):($e=0,He=!rt&&"openKeyCursor"in St?St.openKeyCursor(ft):St.openCursor(ft),Ze=[],He.onsuccess=function(Rt){var Jt=He.result;return Jt?(Ze.push(rt?Jt.value:Jt.primaryKey),++$e===mt?De({result:Ze}):void Jt.continue()):De({result:Ze})},He.onerror=ki(Me))})}),openCursor:function(xe){var De=xe.trans,Me=xe.values,$e=xe.query,He=xe.reverse,Ze=xe.unique;return new Promise(function(rt,mt){rt=kn(rt);var St=$e.index,it=$e.range,lt=De.objectStore(Te),lt=St.isPrimaryKey?lt:lt.index(St.name),St=He?Ze?"prevunique":"prev":Ze?"nextunique":"next",ft=!Me&&"openKeyCursor"in lt?lt.openKeyCursor(P(it),St):lt.openCursor(P(it),St);ft.onerror=ki(mt),ft.onsuccess=kn(function(Rt){var Jt,sn,on,Wo,jt=ft.result;jt?(jt.___id=++mbe,jt.done=!1,Jt=jt.continue.bind(jt),sn=(sn=jt.continuePrimaryKey)&&sn.bind(jt),on=jt.advance.bind(jt),Wo=function(){throw new Error("Cursor not stopped")},jt.trans=De,jt.stop=jt.continue=jt.continuePrimaryKey=jt.advance=function(){throw new Error("Cursor not started")},jt.fail=kn(mt),jt.next=function(){var Ks=this,qs=1;return this.start(function(){return qs--?Ks.continue():Ks.stop()}).then(function(){return Ks})},jt.start=function(Ks){function qs(){if(ft.result)try{Ks()}catch(ro){jt.fail(ro)}else jt.done=!0,jt.start=function(){throw new Error("Cursor behind last entry")},jt.stop()}var Ky=new Promise(function(ro,Mc){ro=kn(ro),ft.onerror=ki(Mc),jt.fail=Mc,jt.stop=function(Y_){jt.stop=jt.continue=jt.continuePrimaryKey=jt.advance=Wo,ro(Y_)}});return ft.onsuccess=kn(function(ro){ft.onsuccess=qs,qs()}),jt.continue=Jt,jt.continuePrimaryKey=sn,jt.advance=on,qs(),Ky},rt(jt)):rt(null)},mt)})},count:function(xe){var De=xe.query,Me=xe.trans,$e=De.index,He=De.range;return new Promise(function(Ze,rt){var mt=Me.objectStore(Te),it=$e.isPrimaryKey?mt:mt.index($e.name),mt=P(He),it=mt?it.count(mt):it.count();it.onsuccess=kn(function(lt){return Ze(lt.target.result)}),it.onerror=ki(rt)})}}}var j,ne,ue,Ie=(ne=Ce,ue=ZB((j=m).objectStoreNames),{schema:{name:j.name,tables:ue.map(function(Pe){return ne.objectStore(Pe)}).map(function(Pe){var Ee=Pe.keyPath,De=Pe.autoIncrement,Te=a(Ee),xe={},De={name:Pe.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:Ee==null,compound:Te,keyPath:Ee,autoIncrement:De,unique:!0,extractKey:P_(Ee)},indexes:ZB(Pe.indexNames).map(function(Me){return Pe.index(Me)}).map(function(Ze){var $e=Ze.name,He=Ze.unique,rt=Ze.multiEntry,Ze=Ze.keyPath,rt={name:$e,compound:a(Ze),keyPath:Ze,unique:He,multiEntry:rt,extractKey:P_(Ze)};return xe[_p(Ze)]=rt}),getIndexByKeyPath:function(Me){return xe[_p(Me)]}};return xe[":id"]=De.primaryKey,Ee!=null&&(xe[_p(Ee)]=De.primaryKey),De})},hasGetAll:0<ue.length&&"getAll"in ne.objectStore(ue[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),Ce=Ie.schema,Re=Ie.hasGetAll,Ie=Ce.tables.map(L),he={};return Ie.forEach(function(Pe){return he[Pe.name]=Pe}),{stack:"dbcore",transaction:m.transaction.bind(m),table:function(Pe){if(!he[Pe])throw new Error("Table '".concat(Pe,"' not found"));return he[Pe]},MIN_KEY:-1/0,MAX_KEY:Ep(y),schema:Ce}}function ybe(m,y,_,P){var L=_.IDBKeyRange;return _.indexedDB,{dbcore:(P=vbe(y,L,P),m.dbcore.reduce(function(j,ne){return ne=ne.create,s(s({},j),ne(j))},P))}}function My(m,P){var _=P.db,P=ybe(m._middlewares,_,m._deps,P);m.core=P.dbcore,m.tables.forEach(function(L){var j=L.name;m.core.schema.tables.some(function(ne){return ne.name===j})&&(L.core=m.core.table(j),m[j]instanceof m.Table&&(m[j].core=L.core))})}function Ny(m,y,_,P){_.forEach(function(L){var j=P[L];y.forEach(function(ne){var ue=function Ce(Re,Ie){return v(Re,Ie)||(Re=c(Re))&&Ce(Re,Ie)}(ne,L);(!ue||"value"in ue&&ue.value===void 0)&&(ne===m.Transaction.prototype||ne instanceof m.Transaction?p(ne,L,{get:function(){return this.table(L)},set:function(Ce){f(this,L,{value:Ce,writable:!0,configurable:!0,enumerable:!0})}}):ne[L]=new m.Table(L,j))})})}function A_(m,y){y.forEach(function(_){for(var P in _)_[P]instanceof m.Table&&delete _[P]})}function wbe(m,y){return m._cfg.version-y._cfg.version}function Cbe(m,y,_,P){var L=m._dbSchema;_.objectStoreNames.contains("$meta")&&!L.$meta&&(L.$meta=F_("$meta",JB("")[0],[]),m._storeNames.push("$meta"));var j=m._createTransaction("readwrite",m._storeNames,L);j.create(_),j._completion.catch(P);var ne=j._reject.bind(j),ue=qe.transless||qe;Ye(function(){return qe.trans=j,qe.transless=ue,y!==0?(My(m,_),Re=y,((Ce=j).storeNames.includes("$meta")?Ce.table("$meta").get("version").then(function(Ie){return Ie??Re}):nt.resolve(Re)).then(function(Ie){return Pe=Ie,Ee=j,Te=_,xe=[],Ie=(he=m)._versions,De=he._dbSchema=Vy(0,he.idbdb,Te),(Ie=Ie.filter(function(Me){return Me._cfg.version>=Pe})).length!==0?(Ie.forEach(function(Me){xe.push(function(){var $e=De,He=Me._cfg.dbschema;By(he,$e,Te),By(he,He,Te),De=he._dbSchema=He;var Ze=k_($e,He);Ze.add.forEach(function(St){O_(Te,St[0],St[1].primKey,St[1].indexes)}),Ze.change.forEach(function(St){if(St.recreate)throw new K.Upgrade("Not yet support for changing primary key");var ft=Te.objectStore(St.name);St.add.forEach(function(Rt){return Ly(ft,Rt)}),St.change.forEach(function(Rt){ft.deleteIndex(Rt.name),Ly(ft,Rt)}),St.del.forEach(function(Rt){return ft.deleteIndex(Rt)})});var rt=Me._cfg.contentUpgrade;if(rt&&Me._cfg.version>Pe){My(he,Te),Ee._memoizedTables={};var mt=I(He);Ze.del.forEach(function(St){mt[St]=$e[St]}),A_(he,[he.Transaction.prototype]),Ny(he,[he.Transaction.prototype],i(mt),mt),Ee.schema=mt;var it,lt=ee(rt);return lt&&Qt(),Ze=nt.follow(function(){var St;(it=rt(Ee))&<&&(St=Xt.bind(null,null),it.then(St,St))}),it&&typeof it.then=="function"?nt.resolve(it):Ze.then(function(){return it})}}),xe.push(function($e){var He,Ze,rt=Me._cfg.dbschema;He=rt,Ze=$e,[].slice.call(Ze.db.objectStoreNames).forEach(function(mt){return He[mt]==null&&Ze.db.deleteObjectStore(mt)}),A_(he,[he.Transaction.prototype]),Ny(he,[he.Transaction.prototype],he._storeNames,he._dbSchema),Ee.schema=he._dbSchema}),xe.push(function($e){he.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(he.idbdb.version/10)===Me._cfg.version?(he.idbdb.deleteObjectStore("$meta"),delete he._dbSchema.$meta,he._storeNames=he._storeNames.filter(function(He){return He!=="$meta"})):$e.objectStore("$meta").put(Me._cfg.version,"version"))})}),function Me(){return xe.length?nt.resolve(xe.shift()(Ee.idbtrans)).then(Me):nt.resolve()}().then(function(){XB(De,Te)})):nt.resolve();var he,Pe,Ee,Te,xe,De}).catch(ne)):(i(L).forEach(function(Ie){O_(_,Ie,L[Ie].primKey,L[Ie].indexes)}),My(m,_),void nt.follow(function(){return m.on.populate.fire(j)}).catch(ne));var Ce,Re})}function bbe(m,y){XB(m._dbSchema,y),y.db.version%10!=0||y.objectStoreNames.contains("$meta")||y.db.createObjectStore("$meta").add(Math.ceil(y.db.version/10-1),"version");var _=Vy(0,m.idbdb,y);By(m,m._dbSchema,y);for(var P=0,L=k_(_,m._dbSchema).change;P<L.length;P++){var j=function(ne){if(ne.change.length||ne.recreate)return console.warn("Unable to patch indexes of table ".concat(ne.name," because it has changes on the type of index or primary key.")),{value:void 0};var ue=y.objectStore(ne.name);ne.add.forEach(function(Ce){$&&console.debug("Dexie upgrade patch: Creating missing index ".concat(ne.name,".").concat(Ce.src)),Ly(ue,Ce)})}(L[P]);if(typeof j=="object")return j.value}}function k_(m,y){var _,P={del:[],add:[],change:[]};for(_ in m)y[_]||P.del.push(_);for(_ in y){var L=m[_],j=y[_];if(L){var ne={name:_,def:j,recreate:!1,del:[],add:[],change:[]};if(""+(L.primKey.keyPath||"")!=""+(j.primKey.keyPath||"")||L.primKey.auto!==j.primKey.auto)ne.recreate=!0,P.change.push(ne);else{var ue=L.idxByName,Ce=j.idxByName,Re=void 0;for(Re in ue)Ce[Re]||ne.del.push(Re);for(Re in Ce){var Ie=ue[Re],he=Ce[Re];Ie?Ie.src!==he.src&&ne.change.push(he):ne.add.push(he)}(0<ne.del.length||0<ne.add.length||0<ne.change.length)&&P.change.push(ne)}}else P.add.push([_,j])}return P}function O_(m,y,_,P){var L=m.db.createObjectStore(y,_.keyPath?{keyPath:_.keyPath,autoIncrement:_.auto}:{autoIncrement:_.auto});return P.forEach(function(j){return Ly(L,j)}),L}function XB(m,y){i(m).forEach(function(_){y.db.objectStoreNames.contains(_)||($&&console.debug("Dexie: Creating missing table",_),O_(y,_,m[_].primKey,m[_].indexes))})}function Ly(m,y){m.createIndex(y.name,y.keyPath,{unique:y.unique,multiEntry:y.multi})}function Vy(m,y,_){var P={};return S(y.objectStoreNames,0).forEach(function(L){for(var j=_.objectStore(L),ne=x_(YB(Re=j.keyPath),Re||"",!0,!1,!!j.autoIncrement,Re&&typeof Re!="string",!0),ue=[],Ce=0;Ce<j.indexNames.length;++Ce){var Ie=j.index(j.indexNames[Ce]),Re=Ie.keyPath,Ie=x_(Ie.name,Re,!!Ie.unique,!!Ie.multiEntry,!1,Re&&typeof Re!="string",!1);ue.push(Ie)}P[L]=F_(L,ne,ue)}),P}function By(m,y,_){for(var P=_.db.objectStoreNames,L=0;L<P.length;++L){var j=P[L],ne=_.objectStore(j);m._hasGetAll="getAll"in ne;for(var ue=0;ue<ne.indexNames.length;++ue){var Ce=ne.indexNames[ue],Re=ne.index(Ce).keyPath,Ie=typeof Re=="string"?Re:"["+S(Re).join("+")+"]";!y[j]||(Re=y[j].idxByName[Ie])&&(Re.name=Ce,delete y[j].idxByName[Ie],y[j].idxByName[Ce]=Re)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&r.WorkerGlobalScope&&r instanceof r.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(m._hasGetAll=!1)}function JB(m){return m.split(",").map(function(y,_){var P=(y=y.trim()).replace(/([&*]|\+\+)/g,""),L=/^\[/.test(P)?P.match(/^\[(.*)\]$/)[1].split("+"):P;return x_(P,L||null,/\&/.test(y),/\*/.test(y),/\+\+/.test(y),a(L),_===0)})}var Sbe=($y.prototype._parseStoresSpec=function(m,y){i(m).forEach(function(_){if(m[_]!==null){var P=JB(m[_]),L=P.shift();if(L.unique=!0,L.multi)throw new K.Schema("Primary key cannot be multi-valued");P.forEach(function(j){if(j.auto)throw new K.Schema("Only primary key can be marked as autoIncrement (++)");if(!j.keyPath)throw new K.Schema("Index must have a name and cannot be an empty string")}),y[_]=F_(_,L,P)}})},$y.prototype.stores=function(_){var y=this.db;this._cfg.storesSource=this._cfg.storesSource?l(this._cfg.storesSource,_):_;var _=y._versions,P={},L={};return _.forEach(function(j){l(P,j._cfg.storesSource),L=j._cfg.dbschema={},j._parseStoresSpec(P,L)}),y._dbSchema=L,A_(y,[y._allTables,y,y.Transaction.prototype]),Ny(y,[y._allTables,y,y.Transaction.prototype,this._cfg.tables],i(L),L),y._storeNames=i(L),this},$y.prototype.upgrade=function(m){return this._cfg.contentUpgrade=N(this._cfg.contentUpgrade||Se,m),this},$y);function $y(){}function M_(m,y){var _=m._dbNamesDB;return _||(_=m._dbNamesDB=new Sa(Fy,{addons:[],indexedDB:m,IDBKeyRange:y})).version(1).stores({dbnames:"name"}),_.table("dbnames")}function N_(m){return m&&typeof m.databases=="function"}function L_(m){return Ye(function(){return qe.letThrough=!0,m()})}function V_(m){return!("from"in m)}var js=function(m,y){if(!this){var _=new js;return m&&"d"in m&&l(_,m),_}l(this,arguments.length?{d:1,from:m,to:1<arguments.length?y:m}:{d:0})};function Rp(m,y,_){var P=ln(y,_);if(!isNaN(P)){if(0<P)throw RangeError();if(V_(m))return l(m,{from:y,to:_,d:1});var L=m.l,P=m.r;if(ln(_,m.from)<0)return L?Rp(L,y,_):m.l={from:y,to:_,d:1,l:null,r:null},e$(m);if(0<ln(y,m.to))return P?Rp(P,y,_):m.r={from:y,to:_,d:1,l:null,r:null},e$(m);ln(y,m.from)<0&&(m.from=y,m.l=null,m.d=P?P.d+1:1),0<ln(_,m.to)&&(m.to=_,m.r=null,m.d=m.l?m.l.d+1:1),_=!m.r,L&&!m.l&&Dp(m,L),P&&_&&Dp(m,P)}}function Dp(m,y){V_(y)||function _(P,Ce){var j=Ce.from,ne=Ce.to,ue=Ce.l,Ce=Ce.r;Rp(P,j,ne),ue&&_(P,ue),Ce&&_(P,Ce)}(m,y)}function QB(m,y){var _=Hy(y),P=_.next();if(P.done)return!1;for(var L=P.value,j=Hy(m),ne=j.next(L.from),ue=ne.value;!P.done&&!ne.done;){if(ln(ue.from,L.to)<=0&&0<=ln(ue.to,L.from))return!0;ln(L.from,ue.from)<0?L=(P=_.next(ue.from)).value:ue=(ne=j.next(L.from)).value}return!1}function Hy(m){var y=V_(m)?null:{s:0,n:m};return{next:function(_){for(var P=0<arguments.length;y;)switch(y.s){case 0:if(y.s=1,P)for(;y.n.l&&ln(_,y.n.from)<0;)y={up:y,n:y.n.l,s:1};else for(;y.n.l;)y={up:y,n:y.n.l,s:1};case 1:if(y.s=2,!P||ln(_,y.n.to)<=0)return{value:y.n,done:!1};case 2:if(y.n.r){y.s=3,y={up:y,n:y.n.r,s:0};continue}case 3:y=y.up}return{done:!0}}}}function e$(m){var y,_,P=(((y=m.r)===null||y===void 0?void 0:y.d)||0)-(((_=m.l)===null||_===void 0?void 0:_.d)||0),L=1<P?"r":P<-1?"l":"";L&&(y=L=="r"?"l":"r",_=s({},m),P=m[L],m.from=P.from,m.to=P.to,m[L]=P[L],_[L]=P[y],(m[y]=_).d=t$(_)),m.d=t$(m)}function t$(_){var y=_.r,_=_.l;return(y?_?Math.max(y.d,_.d):y.d:_?_.d:0)+1}function Gy(m,y){return i(y).forEach(function(_){m[_]?Dp(m[_],y[_]):m[_]=function P(L){var j,ne,ue={};for(j in L)d(L,j)&&(ne=L[j],ue[j]=!ne||typeof ne!="object"||E.has(ne.constructor)?ne:P(ne));return ue}(y[_])}),m}function B_(m,y){return m.all||y.all||Object.keys(m).some(function(_){return y[_]&&QB(y[_],m[_])})}h(js.prototype,((vr={add:function(m){return Dp(this,m),this},addKey:function(m){return Rp(this,m,m),this},addKeys:function(m){var y=this;return m.forEach(function(_){return Rp(y,_,_)}),this},hasKey:function(m){var y=Hy(this).next(m).value;return y&&ln(y.from,m)<=0&&0<=ln(y.to,m)}})[W]=function(){return Hy(this)},vr));var kc={},$_={},H_=!1;function Uy(m){Gy($_,m),H_||(H_=!0,setTimeout(function(){H_=!1,G_($_,!($_={}))},0))}function G_(m,y){y===void 0&&(y=!1);var _=new Set;if(m.all)for(var P=0,L=Object.values(kc);P<L.length;P++)n$(ne=L[P],m,_,y);else for(var j in m){var ne,ue=/^idb\:\/\/(.*)\/(.*)\//.exec(j);ue&&(j=ue[1],ue=ue[2],(ne=kc["idb://".concat(j,"/").concat(ue)])&&n$(ne,m,_,y))}_.forEach(function(Ce){return Ce()})}function n$(m,y,_,P){for(var L=[],j=0,ne=Object.entries(m.queries.query);j<ne.length;j++){for(var ue=ne[j],Ce=ue[0],Re=[],Ie=0,he=ue[1];Ie<he.length;Ie++){var Pe=he[Ie];B_(y,Pe.obsSet)?Pe.subscribers.forEach(function(De){return _.add(De)}):P&&Re.push(Pe)}P&&L.push([Ce,Re])}if(P)for(var Ee=0,Te=L;Ee<Te.length;Ee++){var xe=Te[Ee],Ce=xe[0],Re=xe[1];m.queries.query[Ce]=Re}}function Ebe(m){var y=m._state,_=m._deps.indexedDB;if(y.isBeingOpened||m.idbdb)return y.dbReadyPromise.then(function(){return y.dbOpenError?Kn(y.dbOpenError):m});y.isBeingOpened=!0,y.dbOpenError=null,y.openComplete=!1;var P=y.openCanceller,L=Math.round(10*m.verno),j=!1;function ne(){if(y.openCanceller!==P)throw new K.DatabaseClosed("db.open() was cancelled")}function ue(){return new nt(function(Pe,Ee){if(ne(),!_)throw new K.MissingAPI;var Te=m.name,xe=y.autoSchema||!L?_.open(Te):_.open(Te,L);if(!xe)throw new K.MissingAPI;xe.onerror=ki(Ee),xe.onblocked=kn(m._fireOnBlocked),xe.onupgradeneeded=kn(function(De){var Me;Ie=xe.transaction,y.autoSchema&&!m._options.allowEmptyDB?(xe.onerror=bp,Ie.abort(),xe.result.close(),(Me=_.deleteDatabase(Te)).onsuccess=Me.onerror=kn(function(){Ee(new K.NoSuchDatabase("Database ".concat(Te," doesnt exist")))})):(Ie.onerror=ki(Ee),De=De.oldVersion>Math.pow(2,62)?0:De.oldVersion,he=De<1,m.idbdb=xe.result,j&&bbe(m,Ie),Cbe(m,De/10,Ie,Ee))},Ee),xe.onsuccess=kn(function(){Ie=null;var De,Me,$e,He,Ze,rt=m.idbdb=xe.result,mt=S(rt.objectStoreNames);if(0<mt.length)try{var it=rt.transaction((He=mt).length===1?He[0]:He,"readonly");if(y.autoSchema)Me=rt,$e=it,(De=m).verno=Me.version/10,$e=De._dbSchema=Vy(0,Me,$e),De._storeNames=S(Me.objectStoreNames,0),Ny(De,[De._allTables],i($e),$e);else if(By(m,m._dbSchema,it),((Ze=k_(Vy(0,(Ze=m).idbdb,it),Ze._dbSchema)).add.length||Ze.change.some(function(lt){return lt.add.length||lt.change.length}))&&!j)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),rt.close(),L=rt.version+1,j=!0,Pe(ue());My(m,it)}catch{}Md.push(m),rt.onversionchange=kn(function(lt){y.vcFired=!0,m.on("versionchange").fire(lt)}),rt.onclose=kn(function(lt){m.on("close").fire(lt)}),he&&(Ze=m._deps,it=Te,rt=Ze.indexedDB,Ze=Ze.IDBKeyRange,N_(rt)||it===Fy||M_(rt,Ze).put({name:it}).catch(Se)),Pe()},Ee)}).catch(function(Pe){switch(Pe==null?void 0:Pe.name){case"UnknownError":if(0<y.PR1398_maxLoop)return y.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),ue();break;case"VersionError":if(0<L)return L=0,ue()}return nt.reject(Pe)})}var Ce,Re=y.dbReadyResolve,Ie=null,he=!1;return nt.race([P,(typeof navigator>"u"?nt.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Pe){function Ee(){return indexedDB.databases().finally(Pe)}Ce=setInterval(Ee,100),Ee()}).finally(function(){return clearInterval(Ce)}):Promise.resolve()).then(ue)]).then(function(){return ne(),y.onReadyBeingFired=[],nt.resolve(L_(function(){return m.on.ready.fire(m.vip)})).then(function Pe(){if(0<y.onReadyBeingFired.length){var Ee=y.onReadyBeingFired.reduce(N,Se);return y.onReadyBeingFired=[],nt.resolve(L_(function(){return Ee(m.vip)})).then(Pe)}})}).finally(function(){y.openCanceller===P&&(y.onReadyBeingFired=null,y.isBeingOpened=!1)}).catch(function(Pe){y.dbOpenError=Pe;try{Ie&&Ie.abort()}catch{}return P===y.openCanceller&&m._close(),Kn(Pe)}).finally(function(){y.openComplete=!0,Re()}).then(function(){var Pe;return he&&(Pe={},m.tables.forEach(function(Ee){Ee.schema.indexes.forEach(function(Te){Te.name&&(Pe["idb://".concat(m.name,"/").concat(Ee.name,"/").concat(Te.name)]=new js(-1/0,[[[]]]))}),Pe["idb://".concat(m.name,"/").concat(Ee.name,"/")]=Pe["idb://".concat(m.name,"/").concat(Ee.name,"/:dels")]=new js(-1/0,[[[]]])}),yl(Sp).fire(Pe),G_(Pe,!0)),m})}function U_(m){function y(j){return m.next(j)}var _=L(y),P=L(function(j){return m.throw(j)});function L(j){return function(Ce){var ue=j(Ce),Ce=ue.value;return ue.done?Ce:Ce&&typeof Ce.then=="function"?Ce.then(_,P):a(Ce)?Promise.all(Ce).then(_,P):_(Ce)}}return L(y)()}function Wy(m,y,_){for(var P=a(m)?m.slice():[m],L=0;L<_;++L)P.push(y);return P}var _be={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(m){return s(s({},m),{table:function(y){var _=m.table(y),P=_.schema,L={},j=[];function ne(he,Pe,Ee){var Te=_p(he),xe=L[Te]=L[Te]||[],De=he==null?0:typeof he=="string"?1:he.length,Me=0<Pe,Me=s(s({},Ee),{name:Me?"".concat(Te,"(virtual-from:").concat(Ee.name,")"):Ee.name,lowLevelIndex:Ee,isVirtual:Me,keyTail:Pe,keyLength:De,extractKey:P_(he),unique:!Me&&Ee.unique});return xe.push(Me),Me.isPrimaryKey||j.push(Me),1<De&&ne(De===2?he[0]:he.slice(0,De-1),Pe+1,Ee),xe.sort(function($e,He){return $e.keyTail-He.keyTail}),Me}y=ne(P.primaryKey.keyPath,0,P.primaryKey),L[":id"]=[y];for(var ue=0,Ce=P.indexes;ue<Ce.length;ue++){var Re=Ce[ue];ne(Re.keyPath,0,Re)}function Ie(he){var Pe,Ee=he.query.index;return Ee.isVirtual?s(s({},he),{query:{index:Ee.lowLevelIndex,range:(Pe=he.query.range,Ee=Ee.keyTail,{type:Pe.type===1?2:Pe.type,lower:Wy(Pe.lower,Pe.lowerOpen?m.MAX_KEY:m.MIN_KEY,Ee),lowerOpen:!0,upper:Wy(Pe.upper,Pe.upperOpen?m.MIN_KEY:m.MAX_KEY,Ee),upperOpen:!0})}}):he}return s(s({},_),{schema:s(s({},P),{primaryKey:y,indexes:j,getIndexByKeyPath:function(he){return(he=L[_p(he)])&&he[0]}}),count:function(he){return _.count(Ie(he))},query:function(he){return _.query(Ie(he))},openCursor:function(he){var Pe=he.query.index,Ee=Pe.keyTail,Te=Pe.isVirtual,xe=Pe.keyLength;return Te?_.openCursor(Ie(he)).then(function(Me){return Me&&De(Me)}):_.openCursor(he);function De(Me){return Object.create(Me,{continue:{value:function($e){$e!=null?Me.continue(Wy($e,he.reverse?m.MAX_KEY:m.MIN_KEY,Ee)):he.unique?Me.continue(Me.key.slice(0,xe).concat(he.reverse?m.MIN_KEY:m.MAX_KEY,Ee)):Me.continue()}},continuePrimaryKey:{value:function($e,He){Me.continuePrimaryKey(Wy($e,m.MAX_KEY,Ee),He)}},primaryKey:{get:function(){return Me.primaryKey}},key:{get:function(){var $e=Me.key;return xe===1?$e[0]:$e.slice(0,xe)}},value:{get:function(){return Me.value}}})}}})}})}};function W_(m,y,_,P){return _=_||{},P=P||"",i(m).forEach(function(L){var j,ne,ue;d(y,L)?(j=m[L],ne=y[L],typeof j=="object"&&typeof ne=="object"&&j&&ne?(ue=O(j))!==O(ne)?_[P+L]=y[L]:ue==="Object"?W_(j,ne,_,P+L+"."):j!==ne&&(_[P+L]=y[L]):j!==ne&&(_[P+L]=y[L])):_[P+L]=void 0}),i(y).forEach(function(L){d(m,L)||(_[P+L]=y[L])}),_}function z_(m,y){return y.type==="delete"?y.keys:y.keys||y.values.map(m.extractKey)}var Rbe={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(m){return s(s({},m),{table:function(y){var _=m.table(y),P=_.schema.primaryKey;return s(s({},_),{mutate:function(L){var j=qe.trans,ne=j.table(y).hook,ue=ne.deleting,Ce=ne.creating,Re=ne.updating;switch(L.type){case"add":if(Ce.fire===Se)break;return j._promise("readwrite",function(){return Ie(L)},!0);case"put":if(Ce.fire===Se&&Re.fire===Se)break;return j._promise("readwrite",function(){return Ie(L)},!0);case"delete":if(ue.fire===Se)break;return j._promise("readwrite",function(){return Ie(L)},!0);case"deleteRange":if(ue.fire===Se)break;return j._promise("readwrite",function(){return function he(Pe,Ee,Te){return _.query({trans:Pe,values:!1,query:{index:P,range:Ee},limit:Te}).then(function(xe){var De=xe.result;return Ie({type:"delete",keys:De,trans:Pe}).then(function(Me){return 0<Me.numFailures?Promise.reject(Me.failures[0]):De.length<Te?{failures:[],numFailures:0,lastResult:void 0}:he(Pe,s(s({},Ee),{lower:De[De.length-1],lowerOpen:!0}),Te)})})}(L.trans,L.range,1e4)},!0)}return _.mutate(L);function Ie(he){var Pe,Ee,Te,xe=qe.trans,De=he.keys||z_(P,he);if(!De)throw new Error("Keys missing");return(he=he.type==="add"||he.type==="put"?s(s({},he),{keys:De}):s({},he)).type!=="delete"&&(he.values=o([],he.values)),he.keys&&(he.keys=o([],he.keys)),Pe=_,Te=De,((Ee=he).type==="add"?Promise.resolve([]):Pe.getMany({trans:Ee.trans,keys:Te,cache:"immutable"})).then(function(Me){var $e=De.map(function(He,Ze){var rt,mt,it,lt=Me[Ze],St={onerror:null,onsuccess:null};return he.type==="delete"?ue.fire.call(St,He,lt,xe):he.type==="add"||lt===void 0?(rt=Ce.fire.call(St,He,he.values[Ze],xe),He==null&&rt!=null&&(he.keys[Ze]=He=rt,P.outbound||T(he.values[Ze],P.keyPath,He))):(rt=W_(lt,he.values[Ze]),(mt=Re.fire.call(St,rt,He,lt,xe))&&(it=he.values[Ze],Object.keys(mt).forEach(function(ft){d(it,ft)?it[ft]=mt[ft]:T(it,ft,mt[ft])}))),St});return _.mutate(he).then(function(He){for(var Ze=He.failures,rt=He.results,mt=He.numFailures,He=He.lastResult,it=0;it<De.length;++it){var lt=(rt||De)[it],St=$e[it];lt==null?St.onerror&&St.onerror(Ze[it]):St.onsuccess&&St.onsuccess(he.type==="put"&&Me[it]?he.values[it]:lt)}return{failures:Ze,results:rt,numFailures:mt,lastResult:He}}).catch(function(He){return $e.forEach(function(Ze){return Ze.onerror&&Ze.onerror(He)}),Promise.reject(He)})})}}})}})}};function s$(m,y,_){try{if(!y||y.keys.length<m.length)return null;for(var P=[],L=0,j=0;L<y.keys.length&&j<m.length;++L)ln(y.keys[L],m[j])===0&&(P.push(_?k(y.values[L]):y.values[L]),++j);return P.length===m.length?P:null}catch{return null}}var Dbe={stack:"dbcore",level:-1,create:function(m){return{table:function(y){var _=m.table(y);return s(s({},_),{getMany:function(P){if(!P.cache)return _.getMany(P);var L=s$(P.keys,P.trans._cache,P.cache==="clone");return L?nt.resolve(L):_.getMany(P).then(function(j){return P.trans._cache={keys:P.keys,values:P.cache==="clone"?k(j):j},j})},mutate:function(P){return P.type!=="add"&&(P.trans._cache=null),_.mutate(P)}})}}}};function o$(m,y){return m.trans.mode==="readonly"&&!!m.subscr&&!m.trans.explicit&&m.trans.db._options.cache!=="disabled"&&!y.schema.primaryKey.outbound}function r$(m,y){switch(m){case"query":return y.values&&!y.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Tbe={stack:"dbcore",level:0,name:"Observability",create:function(m){var y=m.schema.name,_=new js(m.MIN_KEY,m.MAX_KEY);return s(s({},m),{transaction:function(P,L,j){if(qe.subscr&&L!=="readonly")throw new K.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(qe.querier));return m.transaction(P,L,j)},table:function(P){var L=m.table(P),j=L.schema,ne=j.primaryKey,he=j.indexes,ue=ne.extractKey,Ce=ne.outbound,Re=ne.autoIncrement&&he.filter(function(Ee){return Ee.compound&&Ee.keyPath.includes(ne.keyPath)}),Ie=s(s({},L),{mutate:function(Ee){function Te(ft){return ft="idb://".concat(y,"/").concat(P,"/").concat(ft),He[ft]||(He[ft]=new js)}var xe,De,Me,$e=Ee.trans,He=Ee.mutatedParts||(Ee.mutatedParts={}),Ze=Te(""),rt=Te(":dels"),mt=Ee.type,St=Ee.type==="deleteRange"?[Ee.range]:Ee.type==="delete"?[Ee.keys]:Ee.values.length<50?[z_(ne,Ee).filter(function(ft){return ft}),Ee.values]:[],it=St[0],lt=St[1],St=Ee.trans._cache;return a(it)?(Ze.addKeys(it),(St=mt==="delete"||it.length===lt.length?s$(it,St):null)||rt.addKeys(it),(St||lt)&&(xe=Te,De=St,Me=lt,j.indexes.forEach(function(ft){var Rt=xe(ft.name||"");function Jt(on){return on!=null?ft.extractKey(on):null}function sn(on){return ft.multiEntry&&a(on)?on.forEach(function(Wo){return Rt.addKey(Wo)}):Rt.addKey(on)}(De||Me).forEach(function(on,Ks){var jt=De&&Jt(De[Ks]),Ks=Me&&Jt(Me[Ks]);ln(jt,Ks)!==0&&(jt!=null&&sn(jt),Ks!=null&&sn(Ks))})}))):it?(lt={from:(lt=it.lower)!==null&<!==void 0?lt:m.MIN_KEY,to:(lt=it.upper)!==null&<!==void 0?lt:m.MAX_KEY},rt.add(lt),Ze.add(lt)):(Ze.add(_),rt.add(_),j.indexes.forEach(function(ft){return Te(ft.name).add(_)})),L.mutate(Ee).then(function(ft){return!it||Ee.type!=="add"&&Ee.type!=="put"||(Ze.addKeys(ft.results),Re&&Re.forEach(function(Rt){for(var Jt=Ee.values.map(function(jt){return Rt.extractKey(jt)}),sn=Rt.keyPath.findIndex(function(jt){return jt===ne.keyPath}),on=0,Wo=ft.results.length;on<Wo;++on)Jt[on][sn]=ft.results[on];Te(Rt.name).addKeys(Jt)})),$e.mutatedParts=Gy($e.mutatedParts||{},He),ft})}}),he=function(Te){var xe=Te.query,Te=xe.index,xe=xe.range;return[Te,new js((Te=xe.lower)!==null&&Te!==void 0?Te:m.MIN_KEY,(xe=xe.upper)!==null&&xe!==void 0?xe:m.MAX_KEY)]},Pe={get:function(Ee){return[ne,new js(Ee.key)]},getMany:function(Ee){return[ne,new js().addKeys(Ee.keys)]},count:he,query:he,openCursor:he};return i(Pe).forEach(function(Ee){Ie[Ee]=function(Te){var xe=qe.subscr,De=!!xe,Me=o$(qe,L)&&r$(Ee,Te)?Te.obsSet={}:xe;if(De){var $e=function(lt){return lt="idb://".concat(y,"/").concat(P,"/").concat(lt),Me[lt]||(Me[lt]=new js)},He=$e(""),Ze=$e(":dels"),xe=Pe[Ee](Te),De=xe[0],xe=xe[1];if((Ee==="query"&&De.isPrimaryKey&&!Te.values?Ze:$e(De.name||"")).add(xe),!De.isPrimaryKey){if(Ee!=="count"){var rt=Ee==="query"&&Ce&&Te.values&&L.query(s(s({},Te),{values:!1}));return L[Ee].apply(this,arguments).then(function(lt){if(Ee==="query"){if(Ce&&Te.values)return rt.then(function(Jt){return Jt=Jt.result,He.addKeys(Jt),lt});var St=Te.values?lt.result.map(ue):lt.result;(Te.values?He:Ze).addKeys(St)}else if(Ee==="openCursor"){var ft=lt,Rt=Te.values;return ft&&Object.create(ft,{key:{get:function(){return Ze.addKey(ft.primaryKey),ft.key}},primaryKey:{get:function(){var Jt=ft.primaryKey;return Ze.addKey(Jt),Jt}},value:{get:function(){return Rt&&He.addKey(ft.primaryKey),ft.value}}})}return lt})}Ze.add(_)}}return L[Ee].apply(this,arguments)}}),Ie}})}};function i$(m,y,_){if(_.numFailures===0)return y;if(y.type==="deleteRange")return null;var P=y.keys?y.keys.length:"values"in y&&y.values?y.values.length:1;return _.numFailures===P?null:(y=s({},y),a(y.keys)&&(y.keys=y.keys.filter(function(L,j){return!(j in _.failures)})),"values"in y&&a(y.values)&&(y.values=y.values.filter(function(L,j){return!(j in _.failures)})),y)}function j_(m,y){return _=m,((P=y).lower===void 0||(P.lowerOpen?0<ln(_,P.lower):0<=ln(_,P.lower)))&&(m=m,(y=y).upper===void 0||(y.upperOpen?ln(m,y.upper)<0:ln(m,y.upper)<=0));var _,P}function a$(m,y,Pe,P,L,j){if(!Pe||Pe.length===0)return m;var ne=y.query.index,ue=ne.multiEntry,Ce=y.query.range,Re=P.schema.primaryKey.extractKey,Ie=ne.extractKey,he=(ne.lowLevelIndex||ne).extractKey,Pe=Pe.reduce(function(Ee,Te){var xe=Ee,De=[];if(Te.type==="add"||Te.type==="put")for(var Me=new js,$e=Te.values.length-1;0<=$e;--$e){var He,Ze=Te.values[$e],rt=Re(Ze);Me.hasKey(rt)||(He=Ie(Ze),(ue&&a(He)?He.some(function(ft){return j_(ft,Ce)}):j_(He,Ce))&&(Me.addKey(rt),De.push(Ze)))}switch(Te.type){case"add":var mt=new js().addKeys(y.values?Ee.map(function(Rt){return Re(Rt)}):Ee),xe=Ee.concat(y.values?De.filter(function(Rt){return Rt=Re(Rt),!mt.hasKey(Rt)&&(mt.addKey(Rt),!0)}):De.map(function(Rt){return Re(Rt)}).filter(function(Rt){return!mt.hasKey(Rt)&&(mt.addKey(Rt),!0)}));break;case"put":var it=new js().addKeys(Te.values.map(function(Rt){return Re(Rt)}));xe=Ee.filter(function(Rt){return!it.hasKey(y.values?Re(Rt):Rt)}).concat(y.values?De:De.map(function(Rt){return Re(Rt)}));break;case"delete":var lt=new js().addKeys(Te.keys);xe=Ee.filter(function(Rt){return!lt.hasKey(y.values?Re(Rt):Rt)});break;case"deleteRange":var St=Te.range;xe=Ee.filter(function(Rt){return!j_(Re(Rt),St)})}return xe},m);return Pe===m?m:(Pe.sort(function(Ee,Te){return ln(he(Ee),he(Te))||ln(Re(Ee),Re(Te))}),y.limit&&y.limit<1/0&&(Pe.length>y.limit?Pe.length=y.limit:m.length===y.limit&&Pe.length<y.limit&&(L.dirty=!0)),j?Object.freeze(Pe):Pe)}function l$(m,y){return ln(m.lower,y.lower)===0&&ln(m.upper,y.upper)===0&&!!m.lowerOpen==!!y.lowerOpen&&!!m.upperOpen==!!y.upperOpen}function Ibe(m,y){return function(_,P,L,j){if(_===void 0)return P!==void 0?-1:0;if(P===void 0)return 1;if((P=ln(_,P))===0){if(L&&j)return 0;if(L)return 1;if(j)return-1}return P}(m.lower,y.lower,m.lowerOpen,y.lowerOpen)<=0&&0<=function(_,P,L,j){if(_===void 0)return P!==void 0?1:0;if(P===void 0)return-1;if((P=ln(_,P))===0){if(L&&j)return 0;if(L)return-1;if(j)return 1}return P}(m.upper,y.upper,m.upperOpen,y.upperOpen)}function xbe(m,y,_,P){m.subscribers.add(_),P.addEventListener("abort",function(){var L,j;m.subscribers.delete(_),m.subscribers.size===0&&(L=m,j=y,setTimeout(function(){L.subscribers.size===0&&J(j,L)},3e3))})}var Fbe={stack:"dbcore",level:0,name:"Cache",create:function(m){var y=m.schema.name;return s(s({},m),{transaction:function(_,P,L){var j,ne,ue=m.transaction(_,P,L);return P==="readwrite"&&(ne=(j=new AbortController).signal,L=function(Ce){return function(){if(j.abort(),P==="readwrite"){for(var Re=new Set,Ie=0,he=_;Ie<he.length;Ie++){var Pe=he[Ie],Ee=kc["idb://".concat(y,"/").concat(Pe)];if(Ee){var Te=m.table(Pe),xe=Ee.optimisticOps.filter(function(Rt){return Rt.trans===ue});if(ue._explicit&&Ce&&ue.mutatedParts)for(var De=0,Me=Object.values(Ee.queries.query);De<Me.length;De++)for(var $e=0,He=(mt=Me[De]).slice();$e<He.length;$e++)B_((it=He[$e]).obsSet,ue.mutatedParts)&&(J(mt,it),it.subscribers.forEach(function(Rt){return Re.add(Rt)}));else if(0<xe.length){Ee.optimisticOps=Ee.optimisticOps.filter(function(Rt){return Rt.trans!==ue});for(var Ze=0,rt=Object.values(Ee.queries.query);Ze<rt.length;Ze++)for(var mt,it,lt,St=0,ft=(mt=rt[Ze]).slice();St<ft.length;St++)(it=ft[St]).res!=null&&ue.mutatedParts&&(Ce&&!it.dirty?(lt=Object.isFrozen(it.res),lt=a$(it.res,it.req,xe,Te,it,lt),it.dirty?(J(mt,it),it.subscribers.forEach(function(Rt){return Re.add(Rt)})):lt!==it.res&&(it.res=lt,it.promise=nt.resolve({result:lt}))):(it.dirty&&J(mt,it),it.subscribers.forEach(function(Rt){return Re.add(Rt)})))}}}Re.forEach(function(Rt){return Rt()})}}},ue.addEventListener("abort",L(!1),{signal:ne}),ue.addEventListener("error",L(!1),{signal:ne}),ue.addEventListener("complete",L(!0),{signal:ne})),ue},table:function(_){var P=m.table(_),L=P.schema.primaryKey;return s(s({},P),{mutate:function(j){var ne=qe.trans;if(L.outbound||ne.db._options.cache==="disabled"||ne.explicit||ne.idbtrans.mode!=="readwrite")return P.mutate(j);var ue=kc["idb://".concat(y,"/").concat(_)];return ue?(ne=P.mutate(j),j.type!=="add"&&j.type!=="put"||!(50<=j.values.length||z_(L,j).some(function(Ce){return Ce==null}))?(ue.optimisticOps.push(j),j.mutatedParts&&Uy(j.mutatedParts),ne.then(function(Ce){0<Ce.numFailures&&(J(ue.optimisticOps,j),(Ce=i$(0,j,Ce))&&ue.optimisticOps.push(Ce),j.mutatedParts&&Uy(j.mutatedParts))}),ne.catch(function(){J(ue.optimisticOps,j),j.mutatedParts&&Uy(j.mutatedParts)})):ne.then(function(Ce){var Re=i$(0,s(s({},j),{values:j.values.map(function(Ie,he){var Pe;return Ce.failures[he]?Ie:(Ie=(Pe=L.keyPath)!==null&&Pe!==void 0&&Pe.includes(".")?k(Ie):s({},Ie),T(Ie,L.keyPath,Ce.results[he]),Ie)})}),Ce);ue.optimisticOps.push(Re),queueMicrotask(function(){return j.mutatedParts&&Uy(j.mutatedParts)})}),ne):P.mutate(j)},query:function(j){if(!o$(qe,P)||!r$("query",j))return P.query(j);var ne=((Re=qe.trans)===null||Re===void 0?void 0:Re.db._options.cache)==="immutable",he=qe,ue=he.requery,Ce=he.signal,Re=function(Te,xe,De,Me){var $e=kc["idb://".concat(Te,"/").concat(xe)];if(!$e)return[];if(!(xe=$e.queries[De]))return[null,!1,$e,null];var He=xe[(Me.query?Me.query.index.name:null)||""];if(!He)return[null,!1,$e,null];switch(De){case"query":var Ze=He.find(function(rt){return rt.req.limit===Me.limit&&rt.req.values===Me.values&&l$(rt.req.query.range,Me.query.range)});return Ze?[Ze,!0,$e,He]:[He.find(function(rt){return("limit"in rt.req?rt.req.limit:1/0)>=Me.limit&&(!Me.values||rt.req.values)&&Ibe(rt.req.query.range,Me.query.range)}),!1,$e,He];case"count":return Ze=He.find(function(rt){return l$(rt.req.query.range,Me.query.range)}),[Ze,!!Ze,$e,He]}}(y,_,"query",j),Ie=Re[0],he=Re[1],Pe=Re[2],Ee=Re[3];return Ie&&he?Ie.obsSet=j.obsSet:(he=P.query(j).then(function(Te){var xe=Te.result;if(Ie&&(Ie.res=xe),ne){for(var De=0,Me=xe.length;De<Me;++De)Object.freeze(xe[De]);Object.freeze(xe)}else Te.result=k(xe);return Te}).catch(function(Te){return Ee&&Ie&&J(Ee,Ie),Promise.reject(Te)}),Ie={obsSet:j.obsSet,promise:he,subscribers:new Set,type:"query",req:j,dirty:!1},Ee?Ee.push(Ie):(Ee=[Ie],(Pe=Pe||(kc["idb://".concat(y,"/").concat(_)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[j.query.index.name||""]=Ee)),xbe(Ie,Ee,ue,Ce),Ie.promise.then(function(Te){return{result:a$(Te.result,j,Pe==null?void 0:Pe.optimisticOps,P,Ie,ne)}})}})}})}};function zy(m,y){return new Proxy(m,{get:function(_,P,L){return P==="db"?y:Reflect.get(_,P,L)}})}var Sa=(as.prototype.version=function(m){if(isNaN(m)||m<.1)throw new K.Type("Given version is not a positive number");if(m=Math.round(10*m)/10,this.idbdb||this._state.isBeingOpened)throw new K.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,m);var y=this._versions,_=y.filter(function(P){return P._cfg.version===m})[0];return _||(_=new this.Version(m),y.push(_),y.sort(wbe),_.stores({}),this._state.autoSchema=!1,_)},as.prototype._whenReady=function(m){var y=this;return this.idbdb&&(this._state.openComplete||qe.letThrough||this._vip)?m():new nt(function(_,P){if(y._state.openComplete)return P(new K.DatabaseClosed(y._state.dbOpenError));if(!y._state.isBeingOpened){if(!y._state.autoOpen)return void P(new K.DatabaseClosed);y.open().catch(Se)}y._state.dbReadyPromise.then(_,P)}).then(m)},as.prototype.use=function(m){var y=m.stack,_=m.create,P=m.level,L=m.name;return L&&this.unuse({stack:y,name:L}),m=this._middlewares[y]||(this._middlewares[y]=[]),m.push({stack:y,create:_,level:P??10,name:L}),m.sort(function(j,ne){return j.level-ne.level}),this},as.prototype.unuse=function(m){var y=m.stack,_=m.name,P=m.create;return y&&this._middlewares[y]&&(this._middlewares[y]=this._middlewares[y].filter(function(L){return P?L.create!==P:!!_&&L.name!==_})),this},as.prototype.open=function(){var m=this;return oo(Ne,function(){return Ebe(m)})},as.prototype._close=function(){var m=this._state,y=Md.indexOf(this);if(0<=y&&Md.splice(y,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}m.isBeingOpened||(m.dbReadyPromise=new nt(function(_){m.dbReadyResolve=_}),m.openCanceller=new nt(function(_,P){m.cancelOpen=P}))},as.prototype.close=function(_){var y=(_===void 0?{disableAutoOpen:!0}:_).disableAutoOpen,_=this._state;y?(_.isBeingOpened&&_.cancelOpen(new K.DatabaseClosed),this._close(),_.autoOpen=!1,_.dbOpenError=new K.DatabaseClosed):(this._close(),_.autoOpen=this._options.autoOpen||_.isBeingOpened,_.openComplete=!1,_.dbOpenError=null)},as.prototype.delete=function(m){var y=this;m===void 0&&(m={disableAutoOpen:!0});var _=0<arguments.length&&typeof arguments[0]!="object",P=this._state;return new nt(function(L,j){function ne(){y.close(m);var ue=y._deps.indexedDB.deleteDatabase(y.name);ue.onsuccess=kn(function(){var Ce,Re,Ie;Ce=y._deps,Re=y.name,Ie=Ce.indexedDB,Ce=Ce.IDBKeyRange,N_(Ie)||Re===Fy||M_(Ie,Ce).delete(Re).catch(Se),L()}),ue.onerror=ki(j),ue.onblocked=y._fireOnBlocked}if(_)throw new K.InvalidArgument("Invalid closeOptions argument to db.delete()");P.isBeingOpened?P.dbReadyPromise.then(ne):ne()})},as.prototype.backendDB=function(){return this.idbdb},as.prototype.isOpen=function(){return this.idbdb!==null},as.prototype.hasBeenClosed=function(){var m=this._state.dbOpenError;return m&&m.name==="DatabaseClosed"},as.prototype.hasFailed=function(){return this._state.dbOpenError!==null},as.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(as.prototype,"tables",{get:function(){var m=this;return i(this._allTables).map(function(y){return m._allTables[y]})},enumerable:!1,configurable:!0}),as.prototype.transaction=function(){var m=(function(y,_,P){var L=arguments.length;if(L<2)throw new K.InvalidArgument("Too few arguments");for(var j=new Array(L-1);--L;)j[L-1]=arguments[L];return P=j.pop(),[y,F(j),P]}).apply(this,arguments);return this._transaction.apply(this,m)},as.prototype._transaction=function(m,y,_){var P=this,L=qe.trans;L&&L.db===this&&m.indexOf("!")===-1||(L=null);var j,ne,ue=m.indexOf("?")!==-1;m=m.replace("!","").replace("?","");try{if(ne=y.map(function(Re){if(Re=Re instanceof P.Table?Re.name:Re,typeof Re!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return Re}),m=="r"||m===E_)j=E_;else{if(m!="rw"&&m!=__)throw new K.InvalidArgument("Invalid transaction mode: "+m);j=__}if(L){if(L.mode===E_&&j===__){if(!ue)throw new K.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");L=null}L&&ne.forEach(function(Re){if(L&&L.storeNames.indexOf(Re)===-1){if(!ue)throw new K.SubTransaction("Table "+Re+" not included in parent transaction.");L=null}}),ue&&L&&!L.active&&(L=null)}}catch(Re){return L?L._promise(null,function(Ie,he){he(Re)}):Kn(Re)}var Ce=(function Re(Ie,he,Pe,Ee,Te){return nt.resolve().then(function(){var xe=qe.transless||qe,De=Ie._createTransaction(he,Pe,Ie._dbSchema,Ee);if(De.explicit=!0,xe={trans:De,transless:xe},Ee)De.idbtrans=Ee.idbtrans;else try{De.create(),De.idbtrans._explicit=!0,Ie._state.PR1398_maxLoop=3}catch(He){return He.name===re.InvalidState&&Ie.isOpen()&&0<--Ie._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Ie.close({disableAutoOpen:!1}),Ie.open().then(function(){return Re(Ie,he,Pe,null,Te)})):Kn(He)}var Me,$e=ee(Te);return $e&&Qt(),xe=nt.follow(function(){var He;(Me=Te.call(De,De))&&($e?(He=Xt.bind(null,null),Me.then(He,He)):typeof Me.next=="function"&&typeof Me.throw=="function"&&(Me=U_(Me)))},xe),(Me&&typeof Me.then=="function"?nt.resolve(Me).then(function(He){return De.active?He:Kn(new K.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):xe.then(function(){return Me})).then(function(He){return Ee&&De._resolve(),De._completion.then(function(){return He})}).catch(function(He){return De._reject(He),Kn(He)})})}).bind(null,this,j,ne,L,_);return L?L._promise(j,Ce,"lock"):qe.trans?oo(qe.transless,function(){return P._whenReady(Ce)}):this._whenReady(Ce)},as.prototype.table=function(m){if(!d(this._allTables,m))throw new K.InvalidTable("Table ".concat(m," does not exist"));return this._allTables[m]},as);function as(m,y){var _=this;this._middlewares={},this.verno=0;var P=as.dependencies;this._options=y=s({addons:as.addons,autoOpen:!0,indexedDB:P.indexedDB,IDBKeyRange:P.IDBKeyRange,cache:"cloned"},y),this._deps={indexedDB:y.indexedDB,IDBKeyRange:y.IDBKeyRange},P=y.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var L,j,ne,ue,Ce,Re={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Se,dbReadyPromise:null,cancelOpen:Se,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:y.autoOpen};Re.dbReadyPromise=new nt(function(he){Re.dbReadyResolve=he}),Re.openCanceller=new nt(function(he,Pe){Re.cancelOpen=Pe}),this._state=Re,this.name=m,this.on=yp(this,"populate","blocked","versionchange","close",{ready:[N,Se]}),this.on.ready.subscribe=b(this.on.ready.subscribe,function(he){return function(Pe,Ee){as.vip(function(){var Te,xe=_._state;xe.openComplete?(xe.dbOpenError||nt.resolve().then(Pe),Ee&&he(Pe)):xe.onReadyBeingFired?(xe.onReadyBeingFired.push(Pe),Ee&&he(Pe)):(he(Pe),Te=_,Ee||he(function De(){Te.on.ready.unsubscribe(Pe),Te.on.ready.unsubscribe(De)}))})}}),this.Collection=(L=this,wp(hbe.prototype,function(Me,De){this.db=L;var Ee=BB,Te=null;if(De)try{Ee=De()}catch($e){Te=$e}var xe=Me._ctx,De=xe.table,Me=De.hook.reading.fire;this._ctx={table:De,index:xe.index,isPrimKey:!xe.index||De.schema.primKey.keyPath&&xe.index===De.schema.primKey.name,range:Ee,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:Te,or:xe.or,valueMapper:Me!==U?Me:null}})),this.Table=(j=this,wp(UB.prototype,function(he,Pe,Ee){this.db=j,this._tx=Ee,this.name=he,this.schema=Pe,this.hook=j._allTables[he]?j._allTables[he].hook:yp(null,{creating:[Ae,Se],reading:[Z,U],updating:[Le,Se],deleting:[Fe,Se]})})),this.Transaction=(ne=this,wp(gbe.prototype,function(he,Pe,Ee,Te,xe){var De=this;this.db=ne,this.mode=he,this.storeNames=Pe,this.schema=Ee,this.chromeTransactionDurability=Te,this.idbtrans=null,this.on=yp(this,"complete","error","abort"),this.parent=xe||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new nt(function(Me,$e){De._resolve=Me,De._reject=$e}),this._completion.then(function(){De.active=!1,De.on.complete.fire()},function(Me){var $e=De.active;return De.active=!1,De.on.error.fire(Me),De.parent?De.parent._reject(Me):$e&&De.idbtrans&&De.idbtrans.abort(),Kn(Me)})})),this.Version=(ue=this,wp(Sbe.prototype,function(he){this.db=ue,this._cfg={version:he,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(Ce=this,wp(qB.prototype,function(he,Pe,Ee){if(this.db=Ce,this._ctx={table:he,index:Pe===":id"?null:Pe,or:Ee},this._cmp=this._ascending=ln,this._descending=function(Te,xe){return ln(xe,Te)},this._max=function(Te,xe){return 0<ln(Te,xe)?Te:xe},this._min=function(Te,xe){return ln(Te,xe)<0?Te:xe},this._IDBKeyRange=Ce._deps.IDBKeyRange,!this._IDBKeyRange)throw new K.MissingAPI})),this.on("versionchange",function(he){0<he.newVersion?console.warn("Another connection wants to upgrade database '".concat(_.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(_.name,"'. Closing db now to resume the delete request.")),_.close({disableAutoOpen:!1})}),this.on("blocked",function(he){!he.newVersion||he.newVersion<he.oldVersion?console.warn("Dexie.delete('".concat(_.name,"') was blocked")):console.warn("Upgrade '".concat(_.name,"' blocked by other connection holding version ").concat(he.oldVersion/10))}),this._maxKey=Ep(y.IDBKeyRange),this._createTransaction=function(he,Pe,Ee,Te){return new _.Transaction(he,Pe,Ee,_._options.chromeTransactionDurability,Te)},this._fireOnBlocked=function(he){_.on("blocked").fire(he),Md.filter(function(Pe){return Pe.name===_.name&&Pe!==_&&!Pe._state.vcFired}).map(function(Pe){return Pe.on("versionchange").fire(he)})},this.use(Dbe),this.use(Fbe),this.use(Tbe),this.use(_be),this.use(Rbe);var Ie=new Proxy(this,{get:function(he,Pe,Ee){if(Pe==="_vip")return!0;if(Pe==="table")return function(xe){return zy(_.table(xe),Ie)};var Te=Reflect.get(he,Pe,Ee);return Te instanceof UB?zy(Te,Ie):Pe==="tables"?Te.map(function(xe){return zy(xe,Ie)}):Pe==="_createTransaction"?function(){return zy(Te.apply(this,arguments),Ie)}:Te}});this.vip=Ie,P.forEach(function(he){return he(_)})}var jy,vr=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Pbe=(K_.prototype.subscribe=function(m,y,_){return this._subscribe(m&&typeof m!="function"?m:{next:m,error:y,complete:_})},K_.prototype[vr]=function(){return this},K_);function K_(m){this._subscribe=m}try{jy={indexedDB:r.indexedDB||r.mozIndexedDB||r.webkitIndexedDB||r.msIndexedDB,IDBKeyRange:r.IDBKeyRange||r.webkitIDBKeyRange}}catch{jy={indexedDB:null,IDBKeyRange:null}}function c$(m){var y,_=!1,P=new Pbe(function(L){var j=ee(m),ne,ue=!1,Ce={},Re={},Ie={get closed(){return ue},unsubscribe:function(){ue||(ue=!0,ne&&ne.abort(),he&&yl.storagemutated.unsubscribe(Ee))}};L.start&&L.start(Ie);var he=!1,Pe=function(){return vp(Te)},Ee=function(xe){Gy(Ce,xe),B_(Re,Ce)&&Pe()},Te=function(){var xe,De,Me;!ue&&jy.indexedDB&&(Ce={},xe={},ne&&ne.abort(),ne=new AbortController,Me=function($e){var He=Pi();try{j&&Qt();var Ze=Ye(m,$e);return Ze=j?Ze.finally(Xt):Ze}finally{He&&mr()}}(De={subscr:xe,signal:ne.signal,requery:Pe,querier:m,trans:null}),Promise.resolve(Me).then(function($e){_=!0,y=$e,ue||De.signal.aborted||(Ce={},function(He){for(var Ze in He)if(d(He,Ze))return;return 1}(Re=xe)||he||(yl(Sp,Ee),he=!0),vp(function(){return!ue&&L.next&&L.next($e)}))},function($e){_=!1,["DatabaseClosedError","AbortError"].includes($e==null?void 0:$e.name)||ue||vp(function(){ue||L.error&&L.error($e)})}))};return setTimeout(Pe,0),Ie});return P.hasValue=function(){return _},P.getValue=function(){return y},P}var Oc=Sa;function q_(m){var y=wl;try{wl=!0,yl.storagemutated.fire(m),G_(m,!0)}finally{wl=y}}h(Oc,s(s({},se),{delete:function(m){return new Oc(m,{addons:[]}).delete()},exists:function(m){return new Oc(m,{addons:[]}).open().then(function(y){return y.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(m){try{return y=Oc.dependencies,_=y.indexedDB,y=y.IDBKeyRange,(N_(_)?Promise.resolve(_.databases()).then(function(P){return P.map(function(L){return L.name}).filter(function(L){return L!==Fy})}):M_(_,y).toCollection().primaryKeys()).then(m)}catch{return Kn(new K.MissingAPI)}var y,_},defineClass:function(){return function(m){l(this,m)}},ignoreTransaction:function(m){return qe.trans?oo(qe.transless,m):m()},vip:L_,async:function(m){return function(){try{var y=U_(m.apply(this,arguments));return y&&typeof y.then=="function"?y:nt.resolve(y)}catch(_){return Kn(_)}}},spawn:function(m,y,_){try{var P=U_(m.apply(_,y||[]));return P&&typeof P.then=="function"?P:nt.resolve(P)}catch(L){return Kn(L)}},currentTransaction:{get:function(){return qe.trans||null}},waitFor:function(m,y){return y=nt.resolve(typeof m=="function"?Oc.ignoreTransaction(m):m).timeout(y||6e4),qe.trans?qe.trans.waitFor(y):y},Promise:nt,debug:{get:function(){return $},set:function(m){le(m)}},derive:g,extend:l,props:h,override:b,Events:yp,on:yl,liveQuery:c$,extendObservabilitySet:Gy,getByKeyPath:R,setByKeyPath:T,delByKeyPath:function(m,y){typeof y=="string"?T(m,y,void 0):"length"in y&&[].map.call(y,function(_){T(m,_,void 0)})},shallowClone:I,deepClone:k,getObjectDiff:W_,cmp:ln,asap:D,minKey:-1/0,addons:[],connections:Md,errnames:re,dependencies:jy,cache:kc,semVer:"4.0.10",version:"4.0.10".split(".").map(function(m){return parseInt(m)}).reduce(function(m,y,_){return m+y/Math.pow(10,2*_)})})),Oc.maxKey=Ep(Oc.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(yl(Sp,function(m){wl||(m=new CustomEvent(I_,{detail:m}),wl=!0,dispatchEvent(m),wl=!1)}),addEventListener(I_,function(m){m=m.detail,wl||q_(m)}));var Vd,wl=!1,u$=function(){};return typeof BroadcastChannel<"u"&&((u$=function(){(Vd=new BroadcastChannel(I_)).onmessage=function(m){return m.data&&q_(m.data)}})(),typeof Vd.unref=="function"&&Vd.unref(),yl(Sp,function(m){wl||Vd.postMessage(m)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(m){if(!Sa.disableBfCache&&m.persisted){$&&console.debug("Dexie: handling persisted pagehide"),Vd!=null&&Vd.close();for(var y=0,_=Md;y<_.length;y++)_[y].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(m){!Sa.disableBfCache&&m.persisted&&($&&console.debug("Dexie: handling persisted pageshow"),u$(),q_({all:new js(-1/0,[[]])}))})),nt.rejectionMapper=function(m,y){return!m||m instanceof G||m instanceof TypeError||m instanceof SyntaxError||!m.name||!me[m.name]?m:(y=new me[m.name](y||m.message,m),"stack"in m&&p(y,"stack",{get:function(){return this.inner.stack}}),y)},le($),s(Sa,Object.freeze({__proto__:null,Dexie:Sa,liveQuery:c$,Entity:$B,cmp:ln,PropModSymbol:ba,PropModification:Cp,replacePrefix:function(m,y){return new Cp({replacePrefix:[m,y]})},add:function(m){return new Cp({add:m})},remove:function(m){return new Cp({remove:m})},default:Sa,RangeSet:js,mergeRanges:Dp,rangesOverlap:QB}),{default:Sa}),Sa})})(M1);var Gz=M1.exports;const vC=Hz(Gz),N1=Symbol.for("Dexie"),_h=globalThis[N1]||(globalThis[N1]=vC);if(vC.semVer!==_h.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${vC.semVer} and ${_h.semVer}`);const{liveQuery:jbe,mergeRanges:Kbe,rangesOverlap:qbe,RangeSet:Ybe,cmp:Zbe,Entity:Xbe,PropModSymbol:Jbe,PropModification:Qbe,replacePrefix:eSe,add:tSe,remove:nSe}=_h;class L1 extends _h{constructor(n){super(n);Qn(this,"icons");Qn(this,"visuals");Qn(this,"users");Qn(this,"columns");Qn(this,"general");this.version(1).stores({icons:"key",visuals:"key",users:"key",columns:"key",general:"key"})}getTable(n){return this[n]?this[n]:this.general}}const Ag=new Map,Uz=async e=>{if(!Ag.has(e)){const t=new L1(e);try{await t.open(),Ag.set(e,t)}catch(n){console.error("Failed to open database, attempting to delete and recreate:",n);try{await _h.delete(e);const s=new L1(e);await s.open(),Ag.set(e,s)}catch(s){throw console.error("Failed to delete and recreate database:",s),s}}}return Ag.get(e)},Rh=({dbName:e,storeName:t})=>{const n=async()=>(await Uz(e)).getTable(t);return{getCachedValue:async c=>{try{const u=await n();if(!u){console.error(`Store is undefined for key: ${c}`);return}const d=await u.get(c);return d==null?void 0:d.value}catch(u){console.error("Failed to get cached value:",u);return}},setCachedValue:async(c,u)=>{try{const d=await n();if(!d){console.error(`Store is undefined, cannot cache key: ${c}`);return}await d.put({key:c,value:u,timestamp:Date.now()})}catch(d){console.error("Failed to cache value:",d)}},deleteCachedValue:async c=>{try{const u=await n();if(!u){console.error(`Store is undefined, cannot delete key: ${c}`);return}await u.delete(c)}catch(u){console.error("Failed to delete cached value:",u)}},clearCache:async()=>{try{const c=await n();if(!c){console.error("Store is undefined, cannot clear cache");return}await c.clear()}catch(c){console.error("Failed to clear cache:",c)}},getAllKeys:async()=>{try{const c=await n();return c?(await c.toArray()).map(d=>d.key):(console.error("Store is undefined, cannot get all keys"),[])}catch(c){return console.error("Failed to get all keys:",c),[]}},getCachedValueWithTimestamp:async c=>{try{const u=await n();if(!u){console.error(`Store is undefined for key: ${c}`);return}return await u.get(c)}catch(u){console.error("Failed to get cached value with timestamp:",u);return}}}},Wz="AvatarCache",zz="images",Bl={},kg={},jz=()=>{const{getCachedValue:e,setCachedValue:t}=Rh({dbName:Wz,storeName:zz}),n=a=>new Promise((l,c)=>{const u=new FileReader;u.onloadend=()=>l(u.result),u.onerror=c,u.readAsDataURL(a)}),s=async a=>{try{if(Bl[a])return Bl[a];if(kg[a])return await kg[a];const l=(async()=>{try{const c=await e(a);if(!c||!(c instanceof Blob))return null;const u=await n(c);return Bl[a]=u,u}catch(c){return console.warn(`Failed to get cached image for key: ${a}`,c),null}})();return kg[a]=l,l.finally(()=>{delete kg[a]}),await l}catch(l){return console.error(`Error in getCachedImage for key: ${a}`,l),null}},o=a=>new Promise((l,c)=>{new $z(a,{width:96,height:96,quality:1,success(u){l(u)},error(u){console.error("Image compression failed:",u.message),c(u)}})});return{getCachedImage:s,setCachedImage:async(a,l)=>{try{const c=await o(l);await t(a,c);const u=await n(c);Bl[a]=u}catch(c){throw console.error(`Failed to cache image for key: ${a}`,c),c}},clearMemoryCache:a=>{try{a?delete Bl[a]:Object.keys(Bl).forEach(l=>delete Bl[l])}catch(l){console.error("Error clearing memory cache:",l)}}}},Dh=new Map,oi=new Map,su=new Map,Kz=5*60*1e3,V1=100;function qz(){const e=Date.now(),t=[];su.forEach((n,s)=>{e-n>Kz&&t.push(s)}),t.forEach(n=>{Dh.delete(n),su.delete(n),oi.delete(n)})}function Yz(){if(su.size<=V1)return;const e=Array.from(su.entries()).sort((n,s)=>n[1]-s[1]);e.slice(0,e.length-V1).forEach(([n])=>{Dh.delete(n),su.delete(n),oi.delete(n)})}const Zz=(e,t)=>{const n=oi.get(e);return n==null||n.forEach(s=>s(t)),oi.delete(e),t};async function Xz({userId:e,avatarUrl:t,cacheInterface:n,onLoadingChange:s}){let o=e;if(t)try{const d=new URL(t,"http://localhost").pathname.split("/").pop();d?o=`${e}_${d}`:o=t}catch{o=t||e}const r=await n.getCachedImage(o),i=Dh.has(o),a=oi.has(o);if(r)return Zz(o,r);if(qz(),i)return new Promise(u=>{a||oi.set(o,[]),oi.get(o).push(u)});const l=(async()=>{let u=null,d=null;try{const h=Math.random()*300;await new Promise(p=>setTimeout(p,h)),s==null||s(!0);const f=await fetch(t,{cache:"no-cache"});if(!f.ok)throw new Error("Failed to fetch image");return u=await f.blob(),await n.setCachedImage(o,u),d=URL.createObjectURL(u),d}catch(h){throw console.error("Error loading avatar image:",h),h}finally{u=null,s==null||s(!1),su.set(o,Date.now()),setTimeout(()=>{Dh.delete(o),Yz()},100)}})();Dh.set(o,l);const c=await l;return oi.has(o)&&(oi.get(o).forEach(d=>d(c)),oi.delete(o)),c}const Jz=(e,t=3,n=1e3)=>{const s=B(0),o=B(!1),r=B(!1),i=async()=>{try{await e()}catch(a){if(s.value<t)return s.value++,r.value=!0,await new Promise(l=>setTimeout(l,n)),i();throw o.value=!0,a}};return{retry:i,currentAttempt:s,errorRetry:o,isRetrying:r}};function Fs(e,t){Qz(e)&&(e="100%");const n=e3(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Og(e){return Math.min(1,Math.max(0,e))}function Qz(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function e3(e){return typeof e=="string"&&e.indexOf("%")!==-1}function B1(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Mg(e){return Number(e)<=1?`${Number(e)*100}%`:e}function $l(e){return e.length===1?"0"+e:String(e)}function t3(e,t,n){return{r:Fs(e,255)*255,g:Fs(t,255)*255,b:Fs(n,255)*255}}function $1(e,t,n){e=Fs(e,255),t=Fs(t,255),n=Fs(n,255);const s=Math.max(e,t,n),o=Math.min(e,t,n);let r=0,i=0;const a=(s+o)/2;if(s===o)i=0,r=0;else{const l=s-o;switch(i=a>.5?l/(2-s-o):l/(s+o),s){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4;break}r/=6}return{h:r,s:i,l:a}}function yC(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function n3(e,t,n){let s,o,r;if(e=Fs(e,360),t=Fs(t,100),n=Fs(n,100),t===0)o=n,r=n,s=n;else{const i=n<.5?n*(1+t):n+t-n*t,a=2*n-i;s=yC(a,i,e+1/3),o=yC(a,i,e),r=yC(a,i,e-1/3)}return{r:s*255,g:o*255,b:r*255}}function H1(e,t,n){e=Fs(e,255),t=Fs(t,255),n=Fs(n,255);const s=Math.max(e,t,n),o=Math.min(e,t,n);let r=0;const i=s,a=s-o,l=s===0?0:a/s;if(s===o)r=0;else{switch(s){case e:r=(t-n)/a+(t<n?6:0);break;case t:r=(n-e)/a+2;break;case n:r=(e-t)/a+4;break}r/=6}return{h:r,s:l,v:i}}function s3(e,t,n){e=Fs(e,360)*6,t=Fs(t,100),n=Fs(n,100);const s=Math.floor(e),o=e-s,r=n*(1-t),i=n*(1-o*t),a=n*(1-(1-o)*t),l=s%6,c=[n,i,r,r,a,n][l],u=[a,n,n,i,r,r][l],d=[r,r,a,n,n,i][l];return{r:c*255,g:u*255,b:d*255}}function G1(e,t,n,s){const o=[$l(Math.round(e).toString(16)),$l(Math.round(t).toString(16)),$l(Math.round(n).toString(16))];return s&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function o3(e,t,n,s,o){const r=[$l(Math.round(e).toString(16)),$l(Math.round(t).toString(16)),$l(Math.round(n).toString(16)),$l(i3(s))];return o&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))&&r[3].startsWith(r[3].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0)+r[3].charAt(0):r.join("")}function r3(e,t,n,s){const o=e/100,r=t/100,i=n/100,a=s/100,l=255*(1-o)*(1-a),c=255*(1-r)*(1-a),u=255*(1-i)*(1-a);return{r:l,g:c,b:u}}function U1(e,t,n){let s=1-e/255,o=1-t/255,r=1-n/255,i=Math.min(s,o,r);return i===1?(s=0,o=0,r=0):(s=(s-i)/(1-i)*100,o=(o-i)/(1-i)*100,r=(r-i)/(1-i)*100),i*=100,{c:Math.round(s),m:Math.round(o),y:Math.round(r),k:Math.round(i)}}function i3(e){return Math.round(parseFloat(e)*255).toString(16)}function W1(e){return Fo(e)/255}function Fo(e){return parseInt(e,16)}function a3(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}const wC={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function l3(e){let t={r:0,g:0,b:0},n=1,s=null,o=null,r=null,i=!1,a=!1;return typeof e=="string"&&(e=c3(e)),typeof e=="object"&&(Po(e.r)&&Po(e.g)&&Po(e.b)?(t=t3(e.r,e.g,e.b),i=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Po(e.h)&&Po(e.s)&&Po(e.v)?(s=Mg(e.s),o=Mg(e.v),t=s3(e.h,s,o),i=!0,a="hsv"):Po(e.h)&&Po(e.s)&&Po(e.l)?(s=Mg(e.s),r=Mg(e.l),t=n3(e.h,s,r),i=!0,a="hsl"):Po(e.c)&&Po(e.m)&&Po(e.y)&&Po(e.k)&&(t=r3(e.c,e.m,e.y,e.k),i=!0,a="cmyk"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=B1(n),{ok:i,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}const Ma="(?:"+"[-\\+]?\\d*\\.\\d+%?"+")|(?:"+"[-\\+]?\\d+%?"+")",CC="[\\s|\\(]+("+Ma+")[,|\\s]+("+Ma+")[,|\\s]+("+Ma+")\\s*\\)?",Ng="[\\s|\\(]+("+Ma+")[,|\\s]+("+Ma+")[,|\\s]+("+Ma+")[,|\\s]+("+Ma+")\\s*\\)?",Xo={CSS_UNIT:new RegExp(Ma),rgb:new RegExp("rgb"+CC),rgba:new RegExp("rgba"+Ng),hsl:new RegExp("hsl"+CC),hsla:new RegExp("hsla"+Ng),hsv:new RegExp("hsv"+CC),hsva:new RegExp("hsva"+Ng),cmyk:new RegExp("cmyk"+Ng),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function c3(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(wC[e])e=wC[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let n=Xo.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Xo.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Xo.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Xo.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Xo.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Xo.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Xo.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:(n=Xo.hex8.exec(e),n?{r:Fo(n[1]),g:Fo(n[2]),b:Fo(n[3]),a:W1(n[4]),format:t?"name":"hex8"}:(n=Xo.hex6.exec(e),n?{r:Fo(n[1]),g:Fo(n[2]),b:Fo(n[3]),format:t?"name":"hex"}:(n=Xo.hex4.exec(e),n?{r:Fo(n[1]+n[1]),g:Fo(n[2]+n[2]),b:Fo(n[3]+n[3]),a:W1(n[4]+n[4]),format:t?"name":"hex8"}:(n=Xo.hex3.exec(e),n?{r:Fo(n[1]+n[1]),g:Fo(n[2]+n[2]),b:Fo(n[3]+n[3]),format:t?"name":"hex"}:!1))))))))))}function Po(e){return typeof e=="number"?!Number.isNaN(e):Xo.CSS_UNIT.test(e)}class Nn{constructor(t="",n={}){if(t instanceof Nn)return t;typeof t=="number"&&(t=a3(t)),this.originalInput=t;const s=l3(t);this.originalInput=t,this.r=s.r,this.g=s.g,this.b=s.b,this.a=s.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??s.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=s.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3}getLuminance(){const t=this.toRgb();let n,s,o;const r=t.r/255,i=t.g/255,a=t.b/255;return r<=.03928?n=r/12.92:n=Math.pow((r+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),.2126*n+.7152*s+.0722*o}getAlpha(){return this.a}setAlpha(t){return this.a=B1(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return t===0}toHsv(){const t=H1(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=H1(this.r,this.g,this.b),n=Math.round(t.h*360),s=Math.round(t.s*100),o=Math.round(t.v*100);return this.a===1?`hsv(${n}, ${s}%, ${o}%)`:`hsva(${n}, ${s}%, ${o}%, ${this.roundA})`}toHsl(){const t=$1(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}}toHslString(){const t=$1(this.r,this.g,this.b),n=Math.round(t.h*360),s=Math.round(t.s*100),o=Math.round(t.l*100);return this.a===1?`hsl(${n}, ${s}%, ${o}%)`:`hsla(${n}, ${s}%, ${o}%, ${this.roundA})`}toHex(t=!1){return G1(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return o3(this.r,this.g,this.b,this.a,t)}toHex8String(t=!1){return"#"+this.toHex8(t)}toHexShortString(t=!1){return this.a===1?this.toHexString(t):this.toHex8String(t)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const t=Math.round(this.r),n=Math.round(this.g),s=Math.round(this.b);return this.a===1?`rgb(${t}, ${n}, ${s})`:`rgba(${t}, ${n}, ${s}, ${this.roundA})`}toPercentageRgb(){const t=n=>`${Math.round(Fs(n,255)*100)}%`;return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}toPercentageRgbString(){const t=n=>Math.round(Fs(n,255)*100);return this.a===1?`rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)`:`rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`}toCmyk(){return{...U1(this.r,this.g,this.b)}}toCmykString(){const{c:t,m:n,y:s,k:o}=U1(this.r,this.g,this.b);return`cmyk(${t}, ${n}, ${s}, ${o})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const t="#"+G1(this.r,this.g,this.b,!1);for(const[n,s]of Object.entries(wC))if(t===s)return n;return!1}toString(t){const n=!!t;t=t??this.format;let s=!1;const o=this.a<1&&this.a>=0;return!n&&o&&(t.startsWith("hex")||t==="name")?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(s=this.toRgbString()),t==="prgb"&&(s=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(s=this.toHexString()),t==="hex3"&&(s=this.toHexString(!0)),t==="hex4"&&(s=this.toHex8String(!0)),t==="hex8"&&(s=this.toHex8String()),t==="name"&&(s=this.toName()),t==="hsl"&&(s=this.toHslString()),t==="hsv"&&(s=this.toHsvString()),t==="cmyk"&&(s=this.toCmykString()),s||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new Nn(this.toString())}lighten(t=10){const n=this.toHsl();return n.l+=t/100,n.l=Og(n.l),new Nn(n)}brighten(t=10){const n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new Nn(n)}darken(t=10){const n=this.toHsl();return n.l-=t/100,n.l=Og(n.l),new Nn(n)}tint(t=10){return this.mix("white",t)}shade(t=10){return this.mix("black",t)}desaturate(t=10){const n=this.toHsl();return n.s-=t/100,n.s=Og(n.s),new Nn(n)}saturate(t=10){const n=this.toHsl();return n.s+=t/100,n.s=Og(n.s),new Nn(n)}greyscale(){return this.desaturate(100)}spin(t){const n=this.toHsl(),s=(n.h+t)%360;return n.h=s<0?360+s:s,new Nn(n)}mix(t,n=50){const s=this.toRgb(),o=new Nn(t).toRgb(),r=n/100,i={r:(o.r-s.r)*r+s.r,g:(o.g-s.g)*r+s.g,b:(o.b-s.b)*r+s.b,a:(o.a-s.a)*r+s.a};return new Nn(i)}analogous(t=6,n=30){const s=this.toHsl(),o=360/n,r=[this];for(s.h=(s.h-(o*t>>1)+720)%360;--t;)s.h=(s.h+o)%360,r.push(new Nn(s));return r}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new Nn(t)}monochromatic(t=6){const n=this.toHsv(),{h:s}=n,{s:o}=n;let{v:r}=n;const i=[],a=1/t;for(;t--;)i.push(new Nn({h:s,s:o,v:r})),r=(r+a)%1;return i}splitcomplement(){const t=this.toHsl(),{h:n}=t;return[this,new Nn({h:(n+72)%360,s:t.s,l:t.l}),new Nn({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){const n=this.toRgb(),s=new Nn(t).toRgb(),o=n.a+s.a*(1-n.a);return new Nn({r:(n.r*n.a+s.r*s.a*(1-n.a))/o,g:(n.g*n.a+s.g*s.a*(1-n.a))/o,b:(n.b*n.a+s.b*s.a*(1-n.a))/o,a:o})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const n=this.toHsl(),{h:s}=n,o=[this],r=360/t;for(let i=1;i<t;i++)o.push(new Nn({h:(s+i*r)%360,s:n.s,l:n.l}));return o}equals(t){const n=new Nn(t);return this.format==="cmyk"||n.format==="cmyk"?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}}function z1(e){return new Nn(e||"").isValid}function Lg(e,t){const{c1:n,c2:s}={c1:new Nn(e),c2:new Nn(t)};return n.equals(s)}const Pc=class Pc{constructor(){Qn(this,"KEY_PAIR",{workspaceCode:"ws.code",apiBaseUrl:"API_BASE_URL",assetUrl:"ASSET_URL",baseUrl:"BASE_URL",baseReviewUrl:"BASE_REVIEW_URL"});Object.values(this.KEY_PAIR).every(n=>{const s=sessionStorage.getItem(n);return(s==null||s==="")&&console.error(`[SessionStorageHelper] Key "${n}" is not set in sessionStorage.`),!0})||console.error("[SessionStorageHelper] Some expected keys are missing in sessionStorage. Please ensure all required keys are set.")}static getInstance(){return Pc.instance||(Pc.instance=new Pc),Pc.instance}setItem(t,n){try{sessionStorage.setItem(t,n)}catch(s){console.error("Error setting sessionStorage item:",s)}}getItem(t){try{const n=sessionStorage.getItem(t);return n===null?"":n}catch(n){throw console.error("Error getting sessionStorage item:",n),n}}};Qn(Pc,"instance");let un=Pc;const u3=["src","alt"],Th=Et(ot({__name:"Avatar",props:{name:{},id:{},profile_image:{},color:{},initial:{},isMe:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{default:24},isUseShortLabel:{type:Boolean,default:!0},borderRadius:{default:void 0}},setup(e){const t=e,n=q(()=>t.isMe||t.id===h.value),s=B(""),o=B(!1),r=B(null),i=B(!1),a=q(()=>({name:t.name||"",id:t.id||"",profile_image:t.profile_image||null,color:t.color||{bgColor:"#CCCCCC",textColor:"var(--background-color)"},initial:t.initial})),l=q(()=>{var T;const R=((T=a.value.color)==null?void 0:T.bgColor)||"#CCCCCC";return z1(R)?R:"#CCCCCC"}),c=q(()=>{var T;const R=((T=a.value.color)==null?void 0:T.textColor)||"var(--background-color)";return z1(R)?R:"var(--background-color)"}),u=q(()=>{if(!t.isUseShortLabel)return"";const{initial:R,name:T}=a.value;if(typeof R=="string"&&R.trim())return R.trim();if(!(T!=null&&T.trim()))return"";const I=T.trim().split(/\s+/).filter(Boolean);return I.length===1?I[0].slice(0,2).toUpperCase():(I[0][0]+I[1][0]).toUpperCase()}),d=q(()=>a.value.profile_image?"image":"text"),h=q(()=>un.getInstance().getItem("user.ws_user_role_id")),f=q(()=>({"--avatar-size":`${t.size}px`,"--avatar-bg":l.value,"--avatar-border":t.isMe?"var(--primary-color)":"#f3f5f8","--text-color":c.value,"--font-size":`${Math.floor(t.size/2)}px`,"--border-radius":t.borderRadius?typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius:"4px"})),p=()=>{s.value="",i.value=!0},{getCachedImage:g,setCachedImage:v}=jz(),C=async()=>{if(r.value&&r.value.abort(),s.value.startsWith("blob:")&&URL.revokeObjectURL(s.value),!a.value.id||!a.value.profile_image){s.value="";return}r.value=new AbortController;const R=r.value;try{const T=await Xz({userId:a.value.id,avatarUrl:a.value.profile_image,cacheInterface:{getCachedImage:g,setCachedImage:v},onLoadingChange:I=>{R.signal.aborted||(o.value=I)}});if(!R.signal.aborted&&(s.value=T,T.length===0))throw console.warn("Loaded avatar image is empty, displaying initials instead."),p(),new Error("Empty image source")}catch(T){R.signal.aborted||(console.error("Failed to load avatar:",T),s.value="")}},{retry:S,errorRetry:b,isRetrying:w}=Jz(C,3,2e3),D=et(()=>[a.value.id,a.value.profile_image],S,{immediate:!0});return ms(()=>{D(),r.value&&(r.value.abort(),r.value=null),s.value.startsWith("blob:")&&URL.revokeObjectURL(s.value),s.value="",o.value=!1}),(R,T)=>(z(),ce("div",{class:Q([R.$style["avatar-wrapper"],{[R.$style.me]:n.value,[R.$style.loading]:o.value,[R.$style.disabled]:e.disabled,[R.$style.readOnly]:t.readOnly}]),style:hn(f.value)},[o.value||H(w)?(z(),ce("div",{key:0,class:Q(R.$style["skeleton-loader"])},null,2)):(z(),ce(xt,{key:1},[d.value==="text"||H(b)||i.value?(z(),ce("div",{key:0,class:Q(R.$style["short-label"])},Ct(u.value),3)):s.value.length>0||a.value.profile_image?(z(),ce("img",{key:1,src:s.value||a.value.profile_image||"",alt:a.value.name||"Avatar",loading:"lazy"},null,8,u3)):Xe("",!0)],64))],6))}}),[["__cssModules",{$style:{"avatar-wrapper":"_avatar-wrapper_1dygt_1",me:"_me_1dygt_18","short-label":"_short-label_1dygt_22",action:"_action_1dygt_40",loading:"_loading_1dygt_58",disabled:"_disabled_1dygt_61",readOnly:"_readOnly_1dygt_64"}}]]),d3=["404","ClickChart","ClickToCreate","NoAccess1","NoActivity","NoAssignedComment","NoAssignedScene","NoComment","NoData","NoData2","NoRendition1","NoRendition2","PrivateComment","PrivateScene","ReportAchievement","ReportCompletedScenes","ReportInvolvement","ReportMetric","ReportOverdueScenes","ReportProfessionalName","ReportSceneAssignment","ReportSceneStatus","ReportSceneStatusType","Successful1","Unsuccessful1","ConfirmDeletion","Waiting1","DefaultThumbnail","UploadReviewFile","ClickToSearch","NoDataSearchFilter"],h3=["UploadInProgress"],Vg={},Na={},j1=(e,t,n,s,o="base64")=>{const r=B(""),i=B(""),a=B(!0),l=q(()=>`${t}:${e.value.name}`),c=g=>new Promise((v,C)=>{const S=new FileReader;S.onload=()=>v(S.result),S.onerror=C,S.readAsDataURL(g)}),u=g=>`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g)}`,d=async(g,v)=>{if(Na[v])return Na[v];if(v in Vg){const b=await Vg[v];return b&&(Na[v]=b),b}const C=await s(l.value);if(C&&typeof C=="string")return Na[v]=C,C;const S=(async()=>{try{const b=await fetch(g,{cache:"no-cache"});if(!b.ok)throw new Error("Failed to fetch visual");const w=b.headers.get("Content-Type")||"";let D;if(w.includes("svg")||w.includes("xml")){const R=await b.text();if(!R.trim())throw new Error("Empty SVG content");D=o==="svg"?R:u(R),Na[v]=D}else if(w.match(/image\/(jpeg|jpg|png|gif|webp)/)){const R=await b.blob();if(!R.size)throw new Error("Empty image blob");D=await c(R),Na[v]=D}else throw new Error(`Unsupported content type: ${w}`);return await n(l.value,D),D}catch(b){return console.error("Error fetching visual:",b),""}})();return Vg[v]=S,S.finally(()=>{delete Vg[v]}),await S},h=async g=>{a.value=!0;try{if(Na[l.value]){const D=Na[l.value];r.value=D,D.startsWith("data:image/svg+xml")?i.value=decodeURIComponent(D.split(",")[1]):(D.startsWith("<svg")||D.includes("<svg"))&&(i.value=D),a.value=!1;return}const v=un.getInstance().getItem("ASSET_URL")||"",C={icon:`${v}/icon/tess/TESSRAPP_Icon_${g}`,visual:`${v}/icon/visual/TESSRAPP_Visual_${g}`,ratting:`${v}/icon/tess/rating/TESSRAPP_Icon_${g}_Outline`,flag:`${v}/icon/flags/4x3/${g}`},S=d3.includes(g)?"png":h3.includes(g)?"gif":"svg",b=`${C[t]}.${S}`,w=await d(b,l.value);w&&(r.value=w,w.startsWith("data:image/svg+xml")?i.value=decodeURIComponent(w.split(",")[1]):(w.startsWith("<svg")||w.includes("<svg"))&&(i.value=w))}catch(v){console.error("Error fetching remote visual:",v)}finally{a.value=!1}},f=async()=>{r.value="",i.value="",e.value.name&&(a.value=!0,await h(e.value.name),a.value=!1)},p=q(()=>i.value?i.value:"");return et(()=>e,()=>{f()},{deep:!0,immediate:!0}),{svgContent:p,url:r,loading:a}},f3=["innerHTML","about"],p3="IconCache",g3="icons",at=Et(ot({__name:"Icon",props:{src:{},source:{default:"remote"},size:{default:14},color:{default:"currentColor"}},setup(e){const t=e,n=d=>{if(typeof d=="number")return d;switch(d){case"small":return 14;case"medium":return 14;case"large":return 20;default:return typeof d=="string"?Number.parseInt(d,10):14}},s=q(()=>n(t.size));q(()=>({width:s.value+"px",height:s.value+"px",color:t.color}));const{getCachedValue:o,setCachedValue:r}=Rh({dbName:p3,storeName:g3}),i=async d=>{const h=await o(d);if(typeof h=="string")return h},a=async(d,h)=>{await r(d,h)},l=q(()=>t.source==="rating"?"ratting":"icon"),c=q(()=>({name:t.src,size:s.value,color:t.color||"currentColor"})),{svgContent:u}=j1(c,l.value,a,i,"svg");return(d,h)=>(z(),ce("div",{class:"icon-wrapper",style:hn({"--icon-size":s.value+"px",color:t.color}),innerHTML:H(u),about:t.src,"data-icon":"true"},null,12,f3))}}),[["__scopeId","data-v-54eccaa1"]]),m3={review:"{reviewDomain}/{ws_code}",review_take:"{reviewDomain}/{ws_code}?id={take_id}",review_scene:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",review_rendition:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",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}",review_rendition_comment:"{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}",review_comment:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",review_multiple_scenes:"{reviewDomain}/{ws_code}?scene_ids={scene_ids}",scene_hub:"{baseDomain}/{ws_code}/{scene_id}?o=st",hub_rendition:"{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",hub_comment:"{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",people_insight:"{baseDomain}/{ws_code}/{user_id}?o=pt",people_detail:"{baseDomain}/{ws_code}/ws/ppl/{display_name}-${user_id}",project:"{baseDomain}/{ws_code}/pl/dir/{entity_id}",woohoo:"{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",update:"{baseDomain}/{ws_code}/pl/au?id={entity_id}",core:"{baseDomain}/{ws_code}",project_focusMode:"{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",access_setting:"{baseDomain}/{ws_code}/pl/dir?f={entity_id}&o=as"},Xs=({type:e,config:t})=>{const n=[];try{const s=m3[e];if(!s)throw new Error(`Link template for link type "${e}" not found`);const o=s.replace(/{(.*?)}/g,(r,i)=>{const a=t[String(i)];if(a!==void 0)return a;n.push(i)});return n.length>0?{url:o,hasError:!0,error:`Missing required keys: ${n.join(", ")}`,missingKeys:n}:{url:o,hasError:!1,error:void 0}}catch(s){return console.error("Link Creator ERROR at:",s),{url:"",hasError:!0,error:s instanceof Error?s.message:`Missing required keys: ${n.join(", ")}`}}};var K1=typeof global=="object"&&global&&global.Object===Object&&global,v3=typeof self=="object"&&self&&self.Object===Object&&self,Dr=K1||v3||Function("return this")(),Jo=Dr.Symbol,q1=Object.prototype,y3=q1.hasOwnProperty,w3=q1.toString,Ih=Jo?Jo.toStringTag:void 0;function C3(e){var t=y3.call(e,Ih),n=e[Ih];try{e[Ih]=void 0;var s=!0}catch{}var o=w3.call(e);return s&&(t?e[Ih]=n:delete e[Ih]),o}var b3=Object.prototype,S3=b3.toString;function E3(e){return S3.call(e)}var _3="[object Null]",R3="[object Undefined]",Y1=Jo?Jo.toStringTag:void 0;function ou(e){return e==null?e===void 0?R3:_3:Y1&&Y1 in Object(e)?C3(e):E3(e)}function Ki(e){return e!=null&&typeof e=="object"}var D3="[object Symbol]";function Bg(e){return typeof e=="symbol"||Ki(e)&&ou(e)==D3}function T3(e,t){for(var n=-1,s=e==null?0:e.length,o=Array(s);++n<s;)o[n]=t(e[n],n,e);return o}var Qo=Array.isArray,Z1=Jo?Jo.prototype:void 0,X1=Z1?Z1.toString:void 0;function J1(e){if(typeof e=="string")return e;if(Qo(e))return T3(e,J1)+"";if(Bg(e))return X1?X1.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var I3=/\s/;function x3(e){for(var t=e.length;t--&&I3.test(e.charAt(t)););return t}var F3=/^\s+/;function P3(e){return e&&e.slice(0,x3(e)+1).replace(F3,"")}function La(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Q1=NaN,A3=/^[-+]0x[0-9a-f]+$/i,k3=/^0b[01]+$/i,O3=/^0o[0-7]+$/i,M3=parseInt;function bC(e){if(typeof e=="number")return e;if(Bg(e))return Q1;if(La(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=La(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=P3(e);var n=k3.test(e);return n||O3.test(e)?M3(e.slice(2),n?2:8):A3.test(e)?Q1:+e}var eI=1/0,N3=17976931348623157e292;function L3(e){if(!e)return e===0?e:0;if(e=bC(e),e===eI||e===-eI){var t=e<0?-1:1;return t*N3}return e===e?e:0}function V3(e){var t=L3(e),n=t%1;return t===t?n?t-n:t:0}function SC(e){return e}var B3="[object AsyncFunction]",$3="[object Function]",H3="[object GeneratorFunction]",G3="[object Proxy]";function tI(e){if(!La(e))return!1;var t=ou(e);return t==$3||t==H3||t==B3||t==G3}var EC=Dr["__core-js_shared__"],nI=function(){var e=/[^.]+$/.exec(EC&&EC.keys&&EC.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function U3(e){return!!nI&&nI in e}var W3=Function.prototype,z3=W3.toString;function Hl(e){if(e!=null){try{return z3.call(e)}catch{}try{return e+""}catch{}}return""}var j3=/[\\^$.*+?()[\]{}|]/g,K3=/^\[object .+?Constructor\]$/,q3=Function.prototype,Y3=Object.prototype,Z3=q3.toString,X3=Y3.hasOwnProperty,J3=RegExp("^"+Z3.call(X3).replace(j3,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Q3(e){if(!La(e)||U3(e))return!1;var t=tI(e)?J3:K3;return t.test(Hl(e))}function e6(e,t){return e==null?void 0:e[t]}function Gl(e,t){var n=e6(e,t);return Q3(n)?n:void 0}var _C=Gl(Dr,"WeakMap"),sI=Object.create,t6=function(){function e(){}return function(t){if(!La(t))return{};if(sI)return sI(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function n6(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function s6(){}var o6=800,r6=16,i6=Date.now;function a6(e){var t=0,n=0;return function(){var s=i6(),o=r6-(s-n);if(n=s,o>0){if(++t>=o6)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function l6(e){return function(){return e}}var $g=function(){try{var e=Gl(Object,"defineProperty");return e({},"",{}),e}catch{}}(),c6=$g?function(e,t){return $g(e,"toString",{configurable:!0,enumerable:!1,value:l6(t),writable:!0})}:SC,u6=a6(c6);function d6(e,t){for(var n=-1,s=e==null?0:e.length;++n<s&&t(e[n],n,e)!==!1;);return e}function h6(e,t,n,s){for(var o=e.length,r=n+-1;++r<o;)if(t(e[r],r,e))return r;return-1}function f6(e){return e!==e}function p6(e,t,n){for(var s=n-1,o=e.length;++s<o;)if(e[s]===t)return s;return-1}function g6(e,t,n){return t===t?p6(e,t,n):h6(e,f6,n)}function m6(e,t){var n=e==null?0:e.length;return!!n&&g6(e,t,0)>-1}var v6=9007199254740991,y6=/^(?:0|[1-9]\d*)$/;function oI(e,t){var n=typeof e;return t=t??v6,!!t&&(n=="number"||n!="symbol"&&y6.test(e))&&e>-1&&e%1==0&&e<t}function w6(e,t,n){t=="__proto__"&&$g?$g(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function RC(e,t){return e===t||e!==e&&t!==t}var C6=Object.prototype,b6=C6.hasOwnProperty;function S6(e,t,n){var s=e[t];(!(b6.call(e,t)&&RC(s,n))||n===void 0&&!(t in e))&&w6(e,t,n)}var rI=Math.max;function E6(e,t,n){return t=rI(t===void 0?e.length-1:t,0),function(){for(var s=arguments,o=-1,r=rI(s.length-t,0),i=Array(r);++o<r;)i[o]=s[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=s[o];return a[t]=n(i),n6(e,this,a)}}function _6(e,t){return u6(E6(e,t,SC),e+"")}var R6=9007199254740991;function DC(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=R6}function TC(e){return e!=null&&DC(e.length)&&!tI(e)}var D6=Object.prototype;function IC(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||D6;return e===n}function T6(e,t){for(var n=-1,s=Array(e);++n<e;)s[n]=t(n);return s}var I6="[object Arguments]";function iI(e){return Ki(e)&&ou(e)==I6}var aI=Object.prototype,x6=aI.hasOwnProperty,F6=aI.propertyIsEnumerable,Hg=iI(function(){return arguments}())?iI:function(e){return Ki(e)&&x6.call(e,"callee")&&!F6.call(e,"callee")};function P6(){return!1}var lI=typeof On=="object"&&On&&!On.nodeType&&On,cI=lI&&typeof module=="object"&&module&&!module.nodeType&&module,A6=cI&&cI.exports===lI,uI=A6?Dr.Buffer:void 0,k6=uI?uI.isBuffer:void 0,xh=k6||P6,O6="[object Arguments]",M6="[object Array]",N6="[object Boolean]",L6="[object Date]",V6="[object Error]",B6="[object Function]",$6="[object Map]",H6="[object Number]",G6="[object Object]",U6="[object RegExp]",W6="[object Set]",z6="[object String]",j6="[object WeakMap]",K6="[object ArrayBuffer]",q6="[object DataView]",Y6="[object Float32Array]",Z6="[object Float64Array]",X6="[object Int8Array]",J6="[object Int16Array]",Q6="[object Int32Array]",e4="[object Uint8Array]",t4="[object Uint8ClampedArray]",n4="[object Uint16Array]",s4="[object Uint32Array]",Ln={};Ln[Y6]=Ln[Z6]=Ln[X6]=Ln[J6]=Ln[Q6]=Ln[e4]=Ln[t4]=Ln[n4]=Ln[s4]=!0,Ln[O6]=Ln[M6]=Ln[K6]=Ln[N6]=Ln[q6]=Ln[L6]=Ln[V6]=Ln[B6]=Ln[$6]=Ln[H6]=Ln[G6]=Ln[U6]=Ln[W6]=Ln[z6]=Ln[j6]=!1;function o4(e){return Ki(e)&&DC(e.length)&&!!Ln[ou(e)]}function xC(e){return function(t){return e(t)}}var dI=typeof On=="object"&&On&&!On.nodeType&&On,Fh=dI&&typeof module=="object"&&module&&!module.nodeType&&module,r4=Fh&&Fh.exports===dI,FC=r4&&K1.process,ru=function(){try{var e=Fh&&Fh.require&&Fh.require("util").types;return e||FC&&FC.binding&&FC.binding("util")}catch{}}(),hI=ru&&ru.isTypedArray,PC=hI?xC(hI):o4,i4=Object.prototype,a4=i4.hasOwnProperty;function l4(e,t){var n=Qo(e),s=!n&&Hg(e),o=!n&&!s&&xh(e),r=!n&&!s&&!o&&PC(e),i=n||s||o||r,a=i?T6(e.length,String):[],l=a.length;for(var c in e)a4.call(e,c)&&!(i&&(c=="length"||o&&(c=="offset"||c=="parent")||r&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||oI(c,l)))&&a.push(c);return a}function fI(e,t){return function(n){return e(t(n))}}var c4=fI(Object.keys,Object),u4=Object.prototype,d4=u4.hasOwnProperty;function pI(e){if(!IC(e))return c4(e);var t=[];for(var n in Object(e))d4.call(e,n)&&n!="constructor"&&t.push(n);return t}function gI(e){return TC(e)?l4(e):pI(e)}var h4=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,f4=/^\w*$/;function AC(e,t){if(Qo(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Bg(e)?!0:f4.test(e)||!h4.test(e)||t!=null&&e in Object(t)}var Ph=Gl(Object,"create");function p4(){this.__data__=Ph?Ph(null):{},this.size=0}function g4(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var m4="__lodash_hash_undefined__",v4=Object.prototype,y4=v4.hasOwnProperty;function w4(e){var t=this.__data__;if(Ph){var n=t[e];return n===m4?void 0:n}return y4.call(t,e)?t[e]:void 0}var C4=Object.prototype,b4=C4.hasOwnProperty;function S4(e){var t=this.__data__;return Ph?t[e]!==void 0:b4.call(t,e)}var E4="__lodash_hash_undefined__";function _4(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ph&&t===void 0?E4:t,this}function Ul(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Ul.prototype.clear=p4,Ul.prototype.delete=g4,Ul.prototype.get=w4,Ul.prototype.has=S4,Ul.prototype.set=_4;function R4(){this.__data__=[],this.size=0}function Gg(e,t){for(var n=e.length;n--;)if(RC(e[n][0],t))return n;return-1}var D4=Array.prototype,T4=D4.splice;function I4(e){var t=this.__data__,n=Gg(t,e);if(n<0)return!1;var s=t.length-1;return n==s?t.pop():T4.call(t,n,1),--this.size,!0}function x4(e){var t=this.__data__,n=Gg(t,e);return n<0?void 0:t[n][1]}function F4(e){return Gg(this.__data__,e)>-1}function P4(e,t){var n=this.__data__,s=Gg(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this}function qi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}qi.prototype.clear=R4,qi.prototype.delete=I4,qi.prototype.get=x4,qi.prototype.has=F4,qi.prototype.set=P4;var Ah=Gl(Dr,"Map");function A4(){this.size=0,this.__data__={hash:new Ul,map:new(Ah||qi),string:new Ul}}function k4(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ug(e,t){var n=e.__data__;return k4(t)?n[typeof t=="string"?"string":"hash"]:n.map}function O4(e){var t=Ug(this,e).delete(e);return this.size-=t?1:0,t}function M4(e){return Ug(this,e).get(e)}function N4(e){return Ug(this,e).has(e)}function L4(e,t){var n=Ug(this,e),s=n.size;return n.set(e,t),this.size+=n.size==s?0:1,this}function Yi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Yi.prototype.clear=A4,Yi.prototype.delete=O4,Yi.prototype.get=M4,Yi.prototype.has=N4,Yi.prototype.set=L4;var V4="Expected a function";function kC(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(V4);var n=function(){var s=arguments,o=t?t.apply(this,s):s[0],r=n.cache;if(r.has(o))return r.get(o);var i=e.apply(this,s);return n.cache=r.set(o,i)||r,i};return n.cache=new(kC.Cache||Yi),n}kC.Cache=Yi;var B4=500;function $4(e){var t=kC(e,function(s){return n.size===B4&&n.clear(),s}),n=t.cache;return t}var H4=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,G4=/\\(\\)?/g,U4=$4(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(H4,function(n,s,o,r){t.push(o?r.replace(G4,"$1"):s||n)}),t});function W4(e){return e==null?"":J1(e)}function mI(e,t){return Qo(e)?e:AC(e,t)?[e]:U4(W4(e))}function Wg(e){if(typeof e=="string"||Bg(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function vI(e,t){t=mI(t,e);for(var n=0,s=t.length;e!=null&&n<s;)e=e[Wg(t[n++])];return n&&n==s?e:void 0}function z4(e,t,n){var s=e==null?void 0:vI(e,t);return s===void 0?n:s}function yI(e,t){for(var n=-1,s=t.length,o=e.length;++n<s;)e[o+n]=t[n];return e}var wI=Jo?Jo.isConcatSpreadable:void 0;function j4(e){return Qo(e)||Hg(e)||!!(wI&&e&&e[wI])}function K4(e,t,n,s,o){var r=-1,i=e.length;for(n||(n=j4),o||(o=[]);++r<i;){var a=e[r];n(a)&&yI(o,a)}return o}var q4=fI(Object.getPrototypeOf,Object);function Y4(e,t,n){var s=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(o);++s<o;)r[s]=e[s+t];return r}var Z4=Math.ceil,X4=Math.max;function J4(e,t,n){t===void 0?t=1:t=X4(V3(t),0);var s=e==null?0:e.length;if(!s||t<1)return[];for(var o=0,r=0,i=Array(Z4(s/t));o<s;)i[r++]=Y4(e,o,o+=t);return i}function Q4(){this.__data__=new qi,this.size=0}function e5(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function t5(e){return this.__data__.get(e)}function n5(e){return this.__data__.has(e)}var s5=200;function o5(e,t){var n=this.__data__;if(n instanceof qi){var s=n.__data__;if(!Ah||s.length<s5-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new Yi(s)}return n.set(e,t),this.size=n.size,this}function ri(e){var t=this.__data__=new qi(e);this.size=t.size}ri.prototype.clear=Q4,ri.prototype.delete=e5,ri.prototype.get=t5,ri.prototype.has=n5,ri.prototype.set=o5;var CI=typeof On=="object"&&On&&!On.nodeType&&On,bI=CI&&typeof module=="object"&&module&&!module.nodeType&&module,r5=bI&&bI.exports===CI,SI=r5?Dr.Buffer:void 0;SI&&SI.allocUnsafe;function i5(e,t){return e.slice()}function a5(e,t){for(var n=-1,s=e==null?0:e.length,o=0,r=[];++n<s;){var i=e[n];t(i,n,e)&&(r[o++]=i)}return r}function l5(){return[]}var c5=Object.prototype,u5=c5.propertyIsEnumerable,EI=Object.getOwnPropertySymbols,d5=EI?function(e){return e==null?[]:(e=Object(e),a5(EI(e),function(t){return u5.call(e,t)}))}:l5;function h5(e,t,n){var s=t(e);return Qo(e)?s:yI(s,n(e))}function OC(e){return h5(e,gI,d5)}var MC=Gl(Dr,"DataView"),NC=Gl(Dr,"Promise"),iu=Gl(Dr,"Set"),_I="[object Map]",f5="[object Object]",RI="[object Promise]",DI="[object Set]",TI="[object WeakMap]",II="[object DataView]",p5=Hl(MC),g5=Hl(Ah),m5=Hl(NC),v5=Hl(iu),y5=Hl(_C),er=ou;(MC&&er(new MC(new ArrayBuffer(1)))!=II||Ah&&er(new Ah)!=_I||NC&&er(NC.resolve())!=RI||iu&&er(new iu)!=DI||_C&&er(new _C)!=TI)&&(er=function(e){var t=ou(e),n=t==f5?e.constructor:void 0,s=n?Hl(n):"";if(s)switch(s){case p5:return II;case g5:return _I;case m5:return RI;case v5:return DI;case y5:return TI}return t});var w5=Object.prototype,C5=w5.hasOwnProperty;function b5(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&C5.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var zg=Dr.Uint8Array;function LC(e){var t=new e.constructor(e.byteLength);return new zg(t).set(new zg(e)),t}function S5(e,t){var n=LC(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var E5=/\w*$/;function _5(e){var t=new e.constructor(e.source,E5.exec(e));return t.lastIndex=e.lastIndex,t}var xI=Jo?Jo.prototype:void 0,FI=xI?xI.valueOf:void 0;function R5(e){return FI?Object(FI.call(e)):{}}function D5(e,t){var n=LC(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}var T5="[object Boolean]",I5="[object Date]",x5="[object Map]",F5="[object Number]",P5="[object RegExp]",A5="[object Set]",k5="[object String]",O5="[object Symbol]",M5="[object ArrayBuffer]",N5="[object DataView]",L5="[object Float32Array]",V5="[object Float64Array]",B5="[object Int8Array]",$5="[object Int16Array]",H5="[object Int32Array]",G5="[object Uint8Array]",U5="[object Uint8ClampedArray]",W5="[object Uint16Array]",z5="[object Uint32Array]";function j5(e,t,n){var s=e.constructor;switch(t){case M5:return LC(e);case T5:case I5:return new s(+e);case N5:return S5(e);case L5:case V5:case B5:case $5:case H5:case G5:case U5:case W5:case z5:return D5(e);case x5:return new s;case F5:case k5:return new s(e);case P5:return _5(e);case A5:return new s;case O5:return R5(e)}}function K5(e){return typeof e.constructor=="function"&&!IC(e)?t6(q4(e)):{}}var q5="[object Map]";function Y5(e){return Ki(e)&&er(e)==q5}var PI=ru&&ru.isMap,Z5=PI?xC(PI):Y5,X5="[object Set]";function J5(e){return Ki(e)&&er(e)==X5}var AI=ru&&ru.isSet,Q5=AI?xC(AI):J5,kI="[object Arguments]",e8="[object Array]",t8="[object Boolean]",n8="[object Date]",s8="[object Error]",OI="[object Function]",o8="[object GeneratorFunction]",r8="[object Map]",i8="[object Number]",MI="[object Object]",a8="[object RegExp]",l8="[object Set]",c8="[object String]",u8="[object Symbol]",d8="[object WeakMap]",h8="[object ArrayBuffer]",f8="[object DataView]",p8="[object Float32Array]",g8="[object Float64Array]",m8="[object Int8Array]",v8="[object Int16Array]",y8="[object Int32Array]",w8="[object Uint8Array]",C8="[object Uint8ClampedArray]",b8="[object Uint16Array]",S8="[object Uint32Array]",Fn={};Fn[kI]=Fn[e8]=Fn[h8]=Fn[f8]=Fn[t8]=Fn[n8]=Fn[p8]=Fn[g8]=Fn[m8]=Fn[v8]=Fn[y8]=Fn[r8]=Fn[i8]=Fn[MI]=Fn[a8]=Fn[l8]=Fn[c8]=Fn[u8]=Fn[w8]=Fn[C8]=Fn[b8]=Fn[S8]=!0,Fn[s8]=Fn[OI]=Fn[d8]=!1;function jg(e,t,n,s,o,r){var i;if(i!==void 0)return i;if(!La(e))return e;var a=Qo(e);if(a)i=b5(e);else{var l=er(e),c=l==OI||l==o8;if(xh(e))return i5(e);if(l==MI||l==kI||c&&!o)i=c?{}:K5(e);else{if(!Fn[l])return o?e:{};i=j5(e,l)}}r||(r=new ri);var u=r.get(e);if(u)return u;r.set(e,i),Q5(e)?e.forEach(function(f){i.add(jg(f,t,n,f,e,r))}):Z5(e)&&e.forEach(function(f,p){i.set(p,jg(f,t,n,p,e,r))});var d=OC,h=a?void 0:d(e);return d6(h||e,function(f,p){h&&(p=f,f=e[p]),S6(i,p,jg(f,t,n,p,e,r))}),i}var E8=1,_8=4;function NI(e){return jg(e,E8|_8)}var R8="__lodash_hash_undefined__";function D8(e){return this.__data__.set(e,R8),this}function T8(e){return this.__data__.has(e)}function kh(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Yi;++t<n;)this.add(e[t])}kh.prototype.add=kh.prototype.push=D8,kh.prototype.has=T8;function I8(e,t){for(var n=-1,s=e==null?0:e.length;++n<s;)if(t(e[n],n,e))return!0;return!1}function LI(e,t){return e.has(t)}var x8=1,F8=2;function VI(e,t,n,s,o,r){var i=n&x8,a=e.length,l=t.length;if(a!=l&&!(i&&l>a))return!1;var c=r.get(e),u=r.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,f=n&F8?new kh:void 0;for(r.set(e,t),r.set(t,e);++d<a;){var p=e[d],g=t[d];if(s)var v=i?s(g,p,d,t,e,r):s(p,g,d,e,t,r);if(v!==void 0){if(v)continue;h=!1;break}if(f){if(!I8(t,function(C,S){if(!LI(f,S)&&(p===C||o(p,C,n,s,r)))return f.push(S)})){h=!1;break}}else if(!(p===g||o(p,g,n,s,r))){h=!1;break}}return r.delete(e),r.delete(t),h}function P8(e){var t=-1,n=Array(e.size);return e.forEach(function(s,o){n[++t]=[o,s]}),n}function VC(e){var t=-1,n=Array(e.size);return e.forEach(function(s){n[++t]=s}),n}var A8=1,k8=2,O8="[object Boolean]",M8="[object Date]",N8="[object Error]",L8="[object Map]",V8="[object Number]",B8="[object RegExp]",$8="[object Set]",H8="[object String]",G8="[object Symbol]",U8="[object ArrayBuffer]",W8="[object DataView]",BI=Jo?Jo.prototype:void 0,BC=BI?BI.valueOf:void 0;function z8(e,t,n,s,o,r,i){switch(n){case W8:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case U8:return!(e.byteLength!=t.byteLength||!r(new zg(e),new zg(t)));case O8:case M8:case V8:return RC(+e,+t);case N8:return e.name==t.name&&e.message==t.message;case B8:case H8:return e==t+"";case L8:var a=P8;case $8:var l=s&A8;if(a||(a=VC),e.size!=t.size&&!l)return!1;var c=i.get(e);if(c)return c==t;s|=k8,i.set(e,t);var u=VI(a(e),a(t),s,o,r,i);return i.delete(e),u;case G8:if(BC)return BC.call(e)==BC.call(t)}return!1}var j8=1,K8=Object.prototype,q8=K8.hasOwnProperty;function Y8(e,t,n,s,o,r){var i=n&j8,a=OC(e),l=a.length,c=OC(t),u=c.length;if(l!=u&&!i)return!1;for(var d=l;d--;){var h=a[d];if(!(i?h in t:q8.call(t,h)))return!1}var f=r.get(e),p=r.get(t);if(f&&p)return f==t&&p==e;var g=!0;r.set(e,t),r.set(t,e);for(var v=i;++d<l;){h=a[d];var C=e[h],S=t[h];if(s)var b=i?s(S,C,h,t,e,r):s(C,S,h,e,t,r);if(!(b===void 0?C===S||o(C,S,n,s,r):b)){g=!1;break}v||(v=h=="constructor")}if(g&&!v){var w=e.constructor,D=t.constructor;w!=D&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof D=="function"&&D instanceof D)&&(g=!1)}return r.delete(e),r.delete(t),g}var Z8=1,$I="[object Arguments]",HI="[object Array]",Kg="[object Object]",X8=Object.prototype,GI=X8.hasOwnProperty;function J8(e,t,n,s,o,r){var i=Qo(e),a=Qo(t),l=i?HI:er(e),c=a?HI:er(t);l=l==$I?Kg:l,c=c==$I?Kg:c;var u=l==Kg,d=c==Kg,h=l==c;if(h&&xh(e)){if(!xh(t))return!1;i=!0,u=!1}if(h&&!u)return r||(r=new ri),i||PC(e)?VI(e,t,n,s,o,r):z8(e,t,l,n,s,o,r);if(!(n&Z8)){var f=u&&GI.call(e,"__wrapped__"),p=d&&GI.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,v=p?t.value():t;return r||(r=new ri),o(g,v,n,s,r)}}return h?(r||(r=new ri),Y8(e,t,n,s,o,r)):!1}function $C(e,t,n,s,o){return e===t?!0:e==null||t==null||!Ki(e)&&!Ki(t)?e!==e&&t!==t:J8(e,t,n,s,$C,o)}var Q8=1,ej=2;function tj(e,t,n,s){var o=n.length,r=o;if(e==null)return!r;for(e=Object(e);o--;){var i=n[o];if(i[2]?i[1]!==e[i[0]]:!(i[0]in e))return!1}for(;++o<r;){i=n[o];var a=i[0],l=e[a],c=i[1];if(i[2]){if(l===void 0&&!(a in e))return!1}else{var u=new ri,d;if(!(d===void 0?$C(c,l,Q8|ej,s,u):d))return!1}}return!0}function UI(e){return e===e&&!La(e)}function nj(e){for(var t=gI(e),n=t.length;n--;){var s=t[n],o=e[s];t[n]=[s,o,UI(o)]}return t}function WI(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function sj(e){var t=nj(e);return t.length==1&&t[0][2]?WI(t[0][0],t[0][1]):function(n){return n===e||tj(n,e,t)}}function oj(e,t){return e!=null&&t in Object(e)}function rj(e,t,n){t=mI(t,e);for(var s=-1,o=t.length,r=!1;++s<o;){var i=Wg(t[s]);if(!(r=e!=null&&n(e,i)))break;e=e[i]}return r||++s!=o?r:(o=e==null?0:e.length,!!o&&DC(o)&&oI(i,o)&&(Qo(e)||Hg(e)))}function ij(e,t){return e!=null&&rj(e,t,oj)}var aj=1,lj=2;function cj(e,t){return AC(e)&&UI(t)?WI(Wg(e),t):function(n){var s=z4(n,e);return s===void 0&&s===t?ij(n,e):$C(t,s,aj|lj)}}function uj(e){return function(t){return t==null?void 0:t[e]}}function dj(e){return function(t){return vI(t,e)}}function hj(e){return AC(e)?uj(Wg(e)):dj(e)}function fj(e){return typeof e=="function"?e:e==null?SC:typeof e=="object"?Qo(e)?cj(e[0],e[1]):sj(e):hj(e)}var HC=function(){return Dr.Date.now()},pj="Expected a function",gj=Math.max,mj=Math.min;function Tr(e,t,n){var s,o,r,i,a,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(pj);t=bC(t)||0,La(n)&&(u=!!n.leading,d="maxWait"in n,r=d?gj(bC(n.maxWait)||0,t):r,h="trailing"in n?!!n.trailing:h);function f(R){var T=s,I=o;return s=o=void 0,c=R,i=e.apply(I,T),i}function p(R){return c=R,a=setTimeout(C,t),u?f(R):i}function g(R){var T=R-l,I=R-c,x=t-T;return d?mj(x,r-I):x}function v(R){var T=R-l,I=R-c;return l===void 0||T>=t||T<0||d&&I>=r}function C(){var R=HC();if(v(R))return S(R);a=setTimeout(C,g(R))}function S(R){return a=void 0,h&&s?f(R):(s=o=void 0,i)}function b(){a!==void 0&&clearTimeout(a),c=0,s=l=o=a=void 0}function w(){return a===void 0?i:S(HC())}function D(){var R=HC(),T=v(R);if(s=arguments,o=this,l=R,T){if(a===void 0)return p(l);if(d)return clearTimeout(a),a=setTimeout(C,t),f(l)}return a===void 0&&(a=setTimeout(C,t)),i}return D.cancel=b,D.flush=w,D}function zI(e){return Ki(e)&&TC(e)}function vj(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var yj="[object Map]",wj="[object Set]",Cj=Object.prototype,bj=Cj.hasOwnProperty;function Sj(e){if(e==null)return!0;if(TC(e)&&(Qo(e)||typeof e=="string"||typeof e.splice=="function"||xh(e)||PC(e)||Hg(e)))return!e.length;var t=er(e);if(t==yj||t==wj)return!e.size;if(IC(e))return!pI(e).length;for(var n in e)if(bj.call(e,n))return!1;return!0}var Ej=1/0,_j=iu&&1/VC(new iu([,-0]))[1]==Ej?function(e){return new iu(e)}:s6,Rj=200;function Dj(e,t,n){var s=-1,o=m6,r=e.length,i=!0,a=[],l=a;if(r>=Rj){var c=t?null:_j(e);if(c)return VC(c);i=!1,o=LI,l=new kh}else l=t?[]:a;e:for(;++s<r;){var u=e[s],d=t?t(u):u;if(u=u!==0?u:0,i&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),a.push(u)}else o(l,d,n)||(l!==a&&l.push(d),a.push(u))}return a}var au=_6(function(e){var t=vj(e);return zI(t)&&(t=void 0),Dj(K4(e,1,zI),fj(t))});const ts=(e,t)=>{const n=es();return{apiServices:q(()=>{var i;const o=n==null?void 0:n.appContext.config.globalProperties,r=(i=t.params)==null?void 0:i.context;if(o!=null&&o.apiServices)return o.apiServices;if(e&&(r!=null&&r.apiServices))return r.apiServices})}},Tj=e=>{const t=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return t?decodeURIComponent(t[2]):null};let Wl=class extends Error{};class Ij extends Wl{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class xj extends Wl{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Fj extends Wl{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class lu extends Wl{}class jI extends Wl{constructor(t){super(`Invalid unit ${t}`)}}class Bs extends Wl{}let Va=class extends Wl{constructor(){super("Zone is an abstract class")}};const _t="numeric",Ir="short",Ao="long",qg={year:_t,month:_t,day:_t},KI={year:_t,month:Ir,day:_t},Pj={year:_t,month:Ir,day:_t,weekday:Ir},qI={year:_t,month:Ao,day:_t},YI={year:_t,month:Ao,day:_t,weekday:Ao},ZI={hour:_t,minute:_t},XI={hour:_t,minute:_t,second:_t},JI={hour:_t,minute:_t,second:_t,timeZoneName:Ir},QI={hour:_t,minute:_t,second:_t,timeZoneName:Ao},ex={hour:_t,minute:_t,hourCycle:"h23"},tx={hour:_t,minute:_t,second:_t,hourCycle:"h23"},nx={hour:_t,minute:_t,second:_t,hourCycle:"h23",timeZoneName:Ir},sx={hour:_t,minute:_t,second:_t,hourCycle:"h23",timeZoneName:Ao},ox={year:_t,month:_t,day:_t,hour:_t,minute:_t},rx={year:_t,month:_t,day:_t,hour:_t,minute:_t,second:_t},ix={year:_t,month:Ir,day:_t,hour:_t,minute:_t},ax={year:_t,month:Ir,day:_t,hour:_t,minute:_t,second:_t},Aj={year:_t,month:Ir,day:_t,weekday:Ir,hour:_t,minute:_t},lx={year:_t,month:Ao,day:_t,hour:_t,minute:_t,timeZoneName:Ir},cx={year:_t,month:Ao,day:_t,hour:_t,minute:_t,second:_t,timeZoneName:Ir},ux={year:_t,month:Ao,day:_t,weekday:Ao,hour:_t,minute:_t,timeZoneName:Ao},dx={year:_t,month:Ao,day:_t,weekday:Ao,hour:_t,minute:_t,second:_t,timeZoneName:Ao};let Oh=class{get type(){throw new Va}get name(){throw new Va}get ianaName(){return this.name}get isUniversal(){throw new Va}offsetName(t,n){throw new Va}formatOffset(t,n){throw new Va}offset(t){throw new Va}equals(t){throw new Va}get isValid(){throw new Va}},GC=null;class Yg extends Oh{static get instance(){return GC===null&&(GC=new Yg),GC}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return Lx(t,n,s)}formatOffset(t,n){return Vh(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const UC=new Map;function kj(e){let t=UC.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"}),UC.set(e,t)),t}const Oj={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Mj(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,r,i,a,l,c,u]=s;return[i,o,r,a,l,c,u]}function Nj(e,t){const n=e.formatToParts(t),s=[];for(let o=0;o<n.length;o++){const{type:r,value:i}=n[o],a=Oj[r];r==="era"?s[a]=i:Ht(a)||(s[a]=parseInt(i,10))}return s}const WC=new Map;let cu=class Z_ extends Oh{static create(t){let n=WC.get(t);return n===void 0&&WC.set(t,n=new Z_(t)),n}static resetCache(){WC.clear(),UC.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=Z_.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return Lx(t,n,s,this.name)}formatOffset(t,n){return Vh(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const s=kj(this.name);let[o,r,i,a,l,c,u]=s.formatToParts?Nj(s,n):Mj(s,n);a==="BC"&&(o=-Math.abs(o)+1);const h=em({year:o,month:r,day:i,hour:l===24?0:l,minute:c,second:u,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}},hx={};function Lj(e,t={}){const n=JSON.stringify([e,t]);let s=hx[n];return s||(s=new Intl.ListFormat(e,t),hx[n]=s),s}const zC=new Map;function jC(e,t={}){const n=JSON.stringify([e,t]);let s=zC.get(n);return s===void 0&&(s=new Intl.DateTimeFormat(e,t),zC.set(n,s)),s}const KC=new Map;function Vj(e,t={}){const n=JSON.stringify([e,t]);let s=KC.get(n);return s===void 0&&(s=new Intl.NumberFormat(e,t),KC.set(n,s)),s}const qC=new Map;function Bj(e,t={}){const{base:n,...s}=t,o=JSON.stringify([e,s]);let r=qC.get(o);return r===void 0&&(r=new Intl.RelativeTimeFormat(e,t),qC.set(o,r)),r}let Mh=null;function $j(){return Mh||(Mh=new Intl.DateTimeFormat().resolvedOptions().locale,Mh)}const YC=new Map;function fx(e){let t=YC.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),YC.set(e,t)),t}const ZC=new Map;function Hj(e){let t=ZC.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...px,...t}),ZC.set(e,t)}return t}function Gj(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let s,o;try{s=jC(e).resolvedOptions(),o=e}catch{const l=e.substring(0,n);s=jC(l).resolvedOptions(),o=l}const{numberingSystem:r,calendar:i}=s;return[o,r,i]}}function Uj(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Wj(e){const t=[];for(let n=1;n<=12;n++){const s=bt.utc(2009,n,1);t.push(e(s))}return t}function zj(e){const t=[];for(let n=1;n<=7;n++){const s=bt.utc(2016,11,13+n);t.push(e(s))}return t}function Zg(e,t,n,s){const o=e.listingMode();return o==="error"?null:o==="en"?n(t):s(t)}function jj(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||fx(e.locale).numberingSystem==="latn"}class Kj{constructor(t,n,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:o,floor:r,...i}=s;if(!n||Object.keys(i).length>0){const a={useGrouping:!1,...s};s.padTo>0&&(a.minimumIntegerDigits=s.padTo),this.inf=Vj(t,a)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):rb(t,3);return us(n,this.padTo)}}}class qj{constructor(t,n,s){this.opts=s,this.originalZone=void 0;let o;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const i=-1*(t.offset/60),a=i>=0?`Etc/GMT+${i}`:`Etc/GMT${i}`;t.offset!==0&&cu.create(a).valid?(o=a,this.dt=t):(o="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,o=t.zone.name):(o="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const r={...this.opts};r.timeZone=r.timeZone||o,this.dtf=jC(n,r)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const s=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:s}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class Yj{constructor(t,n,s){this.opts={style:"long",...s},!n&&kx()&&(this.rtf=Bj(t,s))}format(t,n){return this.rtf?this.rtf.format(t,n):vK(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const px={firstDay:1,minimalDays:4,weekend:[6,7]};class Sn{static fromOpts(t){return Sn.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,s,o,r=!1){const i=t||Yn.defaultLocale,a=i||(r?"en-US":$j()),l=n||Yn.defaultNumberingSystem,c=s||Yn.defaultOutputCalendar,u=sb(o)||Yn.defaultWeekSettings;return new Sn(a,l,c,u,i)}static resetCache(){Mh=null,zC.clear(),KC.clear(),qC.clear(),YC.clear(),ZC.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:s,weekSettings:o}={}){return Sn.create(t,n,s,o)}constructor(t,n,s,o,r){const[i,a,l]=Gj(t);this.locale=i,this.numberingSystem=n||a||null,this.outputCalendar=s||l||null,this.weekSettings=o,this.intl=Uj(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=jj(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Sn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,sb(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return Zg(this,t,$x,()=>{const s=this.intl==="ja"||this.intl.startsWith("ja-");n&=!s;const o=n?{month:t,day:"numeric"}:{month:t},r=n?"format":"standalone";if(!this.monthsCache[r][t]){const i=s?a=>this.dtFormatter(a,o).format():a=>this.extract(a,o,"month");this.monthsCache[r][t]=Wj(i)}return this.monthsCache[r][t]})}weekdays(t,n=!1){return Zg(this,t,Ux,()=>{const s=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=zj(r=>this.extract(r,s,"weekday"))),this.weekdaysCache[o][t]})}meridiems(){return Zg(this,void 0,()=>Wx,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[bt.utc(2016,11,13,9),bt.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Zg(this,t,zx,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[bt.utc(-40,1,1),bt.utc(2017,1,1)].map(s=>this.extract(s,n,"era"))),this.eraCache[t]})}extract(t,n,s){const o=this.dtFormatter(t,n),r=o.formatToParts(),i=r.find(a=>a.type.toLowerCase()===s);return i?i.value:null}numberFormatter(t={}){return new Kj(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new qj(t,this.intl,n)}relFormatter(t={}){return new Yj(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Lj(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||fx(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Ox()?Hj(this.locale):px}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let XC=null,ii=class Tp extends Oh{static get utcInstance(){return XC===null&&(XC=new Tp(0)),XC}static instance(t){return t===0?Tp.utcInstance:new Tp(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Tp(tm(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Vh(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Vh(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Vh(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}};class Zj extends Oh{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Ba(e,t){if(Ht(e)||e===null)return t;if(e instanceof Oh)return e;if(nK(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Yg.instance:n==="utc"||n==="gmt"?ii.utcInstance:ii.parseSpecifier(n)||cu.create(e)}else return $a(e)?ii.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Zj(e)}const JC={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},gx={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Xj=JC.hanidec.replace(/[\[|\]]/g,"").split("");function Jj(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);if(e[n].search(JC.hanidec)!==-1)t+=Xj.indexOf(e[n]);else for(const o in gx){const[r,i]=gx[o];s>=r&&s<=i&&(t+=s-r)}}return parseInt(t,10)}else return t}const QC=new Map;function Qj(){QC.clear()}function xr({numberingSystem:e},t=""){const n=e||"latn";let s=QC.get(n);s===void 0&&(s=new Map,QC.set(n,s));let o=s.get(t);return o===void 0&&(o=new RegExp(`${JC[n]}${t}`),s.set(t,o)),o}let mx=()=>Date.now(),vx="system",yx=null,wx=null,Cx=null,bx=60,Sx,Ex=null;class Yn{static get now(){return mx}static set now(t){mx=t}static set defaultZone(t){vx=t}static get defaultZone(){return Ba(vx,Yg.instance)}static get defaultLocale(){return yx}static set defaultLocale(t){yx=t}static get defaultNumberingSystem(){return wx}static set defaultNumberingSystem(t){wx=t}static get defaultOutputCalendar(){return Cx}static set defaultOutputCalendar(t){Cx=t}static get defaultWeekSettings(){return Ex}static set defaultWeekSettings(t){Ex=sb(t)}static get twoDigitCutoffYear(){return bx}static set twoDigitCutoffYear(t){bx=t%100}static get throwOnInvalid(){return Sx}static set throwOnInvalid(t){Sx=t}static resetCaches(){Sn.resetCache(),cu.resetCache(),bt.resetCache(),Qj()}}class Fr{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const _x=[0,31,59,90,120,151,181,212,243,273,304,334],Rx=[0,31,60,91,121,152,182,213,244,274,305,335];function tr(e,t){return new Fr("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function eb(e,t,n){const s=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const o=s.getUTCDay();return o===0?7:o}function Dx(e,t,n){return n+(Nh(e)?Rx:_x)[t-1]}function Tx(e,t){const n=Nh(e)?Rx:_x,s=n.findIndex(r=>r<t),o=t-n[s];return{month:s+1,day:o}}function tb(e,t){return(e-t+7)%7+1}function Xg(e,t=4,n=1){const{year:s,month:o,day:r}=e,i=Dx(s,o,r),a=tb(eb(s,o,r),n);let l=Math.floor((i-a+14-t)/7),c;return l<1?(c=s-1,l=Lh(c,t,n)):l>Lh(s,t,n)?(c=s+1,l=1):c=s,{weekYear:c,weekNumber:l,weekday:a,...sm(e)}}function Ix(e,t=4,n=1){const{weekYear:s,weekNumber:o,weekday:r}=e,i=tb(eb(s,1,t),n),a=du(s);let l=o*7+r-i-7+t,c;l<1?(c=s-1,l+=du(c)):l>a?(c=s+1,l-=du(s)):c=s;const{month:u,day:d}=Tx(c,l);return{year:c,month:u,day:d,...sm(e)}}function nb(e){const{year:t,month:n,day:s}=e,o=Dx(t,n,s);return{year:t,ordinal:o,...sm(e)}}function xx(e){const{year:t,ordinal:n}=e,{month:s,day:o}=Tx(t,n);return{year:t,month:s,day:o,...sm(e)}}function Fx(e,t){if(!Ht(e.localWeekday)||!Ht(e.localWeekNumber)||!Ht(e.localWeekYear)){if(!Ht(e.weekday)||!Ht(e.weekNumber)||!Ht(e.weekYear))throw new lu("Cannot mix locale-based week fields with ISO-based week fields");return Ht(e.localWeekday)||(e.weekday=e.localWeekday),Ht(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Ht(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function eK(e,t=4,n=1){const s=Jg(e.weekYear),o=nr(e.weekNumber,1,Lh(e.weekYear,t,n)),r=nr(e.weekday,1,7);return s?o?r?!1:tr("weekday",e.weekday):tr("week",e.weekNumber):tr("weekYear",e.weekYear)}function tK(e){const t=Jg(e.year),n=nr(e.ordinal,1,du(e.year));return t?n?!1:tr("ordinal",e.ordinal):tr("year",e.year)}function Px(e){const t=Jg(e.year),n=nr(e.month,1,12),s=nr(e.day,1,Qg(e.year,e.month));return t?n?s?!1:tr("day",e.day):tr("month",e.month):tr("year",e.year)}function Ax(e){const{hour:t,minute:n,second:s,millisecond:o}=e,r=nr(t,0,23)||t===24&&n===0&&s===0&&o===0,i=nr(n,0,59),a=nr(s,0,59),l=nr(o,0,999);return r?i?a?l?!1:tr("millisecond",o):tr("second",s):tr("minute",n):tr("hour",t)}function Ht(e){return typeof e>"u"}function $a(e){return typeof e=="number"}function Jg(e){return typeof e=="number"&&e%1===0}function nK(e){return typeof e=="string"}function sK(e){return Object.prototype.toString.call(e)==="[object Date]"}function kx(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Ox(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function oK(e){return Array.isArray(e)?e:[e]}function Mx(e,t,n){if(e.length!==0)return e.reduce((s,o)=>{const r=[t(o),o];return s&&n(s[0],r[0])===s[0]?s:r},null)[1]}function rK(e,t){return t.reduce((n,s)=>(n[s]=e[s],n),{})}function uu(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function sb(e){if(e==null)return null;if(typeof e!="object")throw new Bs("Week settings must be an object");if(!nr(e.firstDay,1,7)||!nr(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!nr(t,1,7)))throw new Bs("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function nr(e,t,n){return Jg(e)&&e>=t&&e<=n}function iK(e,t){return e-t*Math.floor(e/t)}function us(e,t=2){const n=e<0;let s;return n?s="-"+(""+-e).padStart(t,"0"):s=(""+e).padStart(t,"0"),s}function Ha(e){if(!(Ht(e)||e===null||e===""))return parseInt(e,10)}function zl(e){if(!(Ht(e)||e===null||e===""))return parseFloat(e)}function ob(e){if(!(Ht(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function rb(e,t,n="round"){const s=10**t;switch(n){case"expand":return e>0?Math.ceil(e*s)/s:Math.floor(e*s)/s;case"trunc":return Math.trunc(e*s)/s;case"round":return Math.round(e*s)/s;case"floor":return Math.floor(e*s)/s;case"ceil":return Math.ceil(e*s)/s;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function Nh(e){return e%4===0&&(e%100!==0||e%400===0)}function du(e){return Nh(e)?366:365}function Qg(e,t){const n=iK(t-1,12)+1,s=e+(t-n)/12;return n===2?Nh(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function em(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 Nx(e,t,n){return-tb(eb(e,1,t),n)+t-1}function Lh(e,t=4,n=1){const s=Nx(e,t,n),o=Nx(e+1,t,n);return(du(e)-s+o)/7}function ib(e){return e>99?e:e>Yn.twoDigitCutoffYear?1900+e:2e3+e}function Lx(e,t,n,s=null){const o=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(r.timeZone=s);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function tm(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 Vx(e){const t=Number(e);if(typeof e=="boolean"||e===""||!Number.isFinite(t))throw new Bs(`Invalid unit value ${e}`);return t}function nm(e,t){const n={};for(const s in e)if(uu(e,s)){const o=e[s];if(o==null)continue;n[t(s)]=Vx(o)}return n}function Vh(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}${us(n,2)}:${us(s,2)}`;case"narrow":return`${o}${n}${s>0?`:${s}`:""}`;case"techie":return`${o}${us(n,2)}${us(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function sm(e){return rK(e,["hour","minute","second","millisecond"])}const aK=["January","February","March","April","May","June","July","August","September","October","November","December"],Bx=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],lK=["J","F","M","A","M","J","J","A","S","O","N","D"];function $x(e){switch(e){case"narrow":return[...lK];case"short":return[...Bx];case"long":return[...aK];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Hx=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Gx=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],cK=["M","T","W","T","F","S","S"];function Ux(e){switch(e){case"narrow":return[...cK];case"short":return[...Gx];case"long":return[...Hx];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Wx=["AM","PM"],uK=["Before Christ","Anno Domini"],dK=["BC","AD"],hK=["B","A"];function zx(e){switch(e){case"narrow":return[...hK];case"short":return[...dK];case"long":return[...uK];default:return null}}function fK(e){return Wx[e.hour<12?0:1]}function pK(e,t){return Ux(t)[e.weekday-1]}function gK(e,t){return $x(t)[e.month-1]}function mK(e,t){return zx(t)[e.year<0?0:1]}function vK(e,t,n="always",s=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},r=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&r){const d=e==="days";switch(t){case 1:return d?"tomorrow":`next ${o[e][0]}`;case-1:return d?"yesterday":`last ${o[e][0]}`;case 0:return d?"today":`this ${o[e][0]}`}}const i=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,c=o[e],u=s?l?c[1]:c[2]||c[1]:l?o[e][0]:e;return i?`${a} ${u} ago`:`in ${a} ${u}`}function jx(e,t){let n="";for(const s of e)s.literal?n+=s.val:n+=t(s.val);return n}const yK={D:qg,DD:KI,DDD:qI,DDDD:YI,t:ZI,tt:XI,ttt:JI,tttt:QI,T:ex,TT:tx,TTT:nx,TTTT:sx,f:ox,ff:ix,fff:lx,ffff:ux,F:rx,FF:ax,FFF:cx,FFFF:dx};class $s{static create(t,n={}){return new $s(t,n)}static parseFormat(t){let n=null,s="",o=!1;const r=[];for(let i=0;i<t.length;i++){const a=t.charAt(i);a==="'"?((s.length>0||o)&&r.push({literal:o||/^\s+$/.test(s),val:s===""?"'":s}),n=null,s="",o=!o):o||a===n?s+=a:(s.length>0&&r.push({literal:/^\s+$/.test(s),val:s}),s=a,n=a)}return s.length>0&&r.push({literal:o||/^\s+$/.test(s),val:s}),r}static macroTokenToFormatOpts(t){return yK[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0,s=void 0){if(this.opts.forceSimple)return us(t,n);const o={...this.opts};return n>0&&(o.padTo=n),s&&(o.signDisplay=s),this.loc.numberFormatter(o).format(t)}formatDateTimeFromString(t,n){const s=this.loc.listingMode()==="en",o=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",r=(f,p)=>this.loc.extract(t,f,p),i=f=>t.isOffsetFixed&&t.offset===0&&f.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,f.format):"",a=()=>s?fK(t):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,p)=>s?gK(t,f):r(p?{month:f}:{month:f,day:"numeric"},"month"),c=(f,p)=>s?pK(t,f):r(p?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),u=f=>{const p=$s.macroTokenToFormatOpts(f);return p?this.formatWithSystemDefault(t,p):f},d=f=>s?mK(t,f):r({era:f},"era"),h=f=>{switch(f){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return o?r({day:"numeric"},"day"):this.num(t.day);case"dd":return o?r({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return o?r({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return o?r({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return o?r({month:"numeric"},"month"):this.num(t.month);case"MM":return o?r({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return o?r({year:"numeric"},"year"):this.num(t.year);case"yy":return o?r({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return o?r({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return o?r({year:"numeric"},"year"):this.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return u(f)}};return jx($s.parseFormat(n),h)}formatDurationFromString(t,n){const s=this.opts.signMode==="negativeLargestOnly"?-1:1,o=u=>{switch(u[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},r=(u,d)=>h=>{const f=o(h);if(f){const p=d.isNegativeDuration&&f!==d.largestUnit?s:1;let g;return this.opts.signMode==="negativeLargestOnly"&&f!==d.largestUnit?g="never":this.opts.signMode==="all"?g="always":g="auto",this.num(u.get(f)*p,h.length,g)}else return h},i=$s.parseFormat(n),a=i.reduce((u,{literal:d,val:h})=>d?u:u.concat(h),[]),l=t.shiftTo(...a.map(o).filter(u=>u)),c={isNegativeDuration:l<0,largestUnit:Object.keys(l.values)[0]};return jx(i,r(l,c))}}const Kx=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function hu(...e){const t=e.reduce((n,s)=>n+s.source,"");return RegExp(`^${t}$`)}function fu(...e){return t=>e.reduce(([n,s,o],r)=>{const[i,a,l]=r(t,o);return[{...n,...i},a||s,l]},[{},null,1]).slice(0,2)}function pu(e,...t){if(e==null)return[null,null];for(const[n,s]of t){const o=n.exec(e);if(o)return s(o)}return[null,null]}function qx(...e){return(t,n)=>{const s={};let o;for(o=0;o<e.length;o++)s[e[o]]=Ha(t[n+o]);return[s,null,n+o]}}const Yx=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,wK=`(?:${Yx.source}?(?:\\[(${Kx.source})\\])?)?`,ab=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Zx=RegExp(`${ab.source}${wK}`),lb=RegExp(`(?:[Tt]${Zx.source})?`),CK=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,bK=/(\d{4})-?W(\d\d)(?:-?(\d))?/,SK=/(\d{4})-?(\d{3})/,EK=qx("weekYear","weekNumber","weekDay"),_K=qx("year","ordinal"),RK=/(\d{4})-(\d\d)-(\d\d)/,Xx=RegExp(`${ab.source} ?(?:${Yx.source}|(${Kx.source}))?`),DK=RegExp(`(?: ${Xx.source})?`);function gu(e,t,n){const s=e[t];return Ht(s)?n:Ha(s)}function TK(e,t){return[{year:gu(e,t),month:gu(e,t+1,1),day:gu(e,t+2,1)},null,t+3]}function mu(e,t){return[{hours:gu(e,t,0),minutes:gu(e,t+1,0),seconds:gu(e,t+2,0),milliseconds:ob(e[t+3])},null,t+4]}function Bh(e,t){const n=!e[t]&&!e[t+1],s=tm(e[t+1],e[t+2]),o=n?null:ii.instance(s);return[{},o,t+3]}function $h(e,t){const n=e[t]?cu.create(e[t]):null;return[{},n,t+1]}const IK=RegExp(`^T?${ab.source}$`),xK=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function FK(e){const[t,n,s,o,r,i,a,l,c]=e,u=t[0]==="-",d=l&&l[0]==="-",h=(f,p=!1)=>f!==void 0&&(p||f&&u)?-f:f;return[{years:h(zl(n)),months:h(zl(s)),weeks:h(zl(o)),days:h(zl(r)),hours:h(zl(i)),minutes:h(zl(a)),seconds:h(zl(l),l==="-0"),milliseconds:h(ob(c),d)}]}const PK={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function cb(e,t,n,s,o,r,i){const a={year:t.length===2?ib(Ha(t)):Ha(t),month:Bx.indexOf(n)+1,day:Ha(s),hour:Ha(o),minute:Ha(r)};return i&&(a.second=Ha(i)),e&&(a.weekday=e.length>3?Hx.indexOf(e)+1:Gx.indexOf(e)+1),a}const AK=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function kK(e){const[,t,n,s,o,r,i,a,l,c,u,d]=e,h=cb(t,o,s,n,r,i,a);let f;return l?f=PK[l]:c?f=0:f=tm(u,d),[h,new ii(f)]}function OK(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const MK=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,NK=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,LK=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Jx(e){const[,t,n,s,o,r,i,a]=e;return[cb(t,o,s,n,r,i,a),ii.utcInstance]}function VK(e){const[,t,n,s,o,r,i,a]=e;return[cb(t,a,n,s,o,r,i),ii.utcInstance]}const BK=hu(CK,lb),$K=hu(bK,lb),HK=hu(SK,lb),GK=hu(Zx),Qx=fu(TK,mu,Bh,$h),UK=fu(EK,mu,Bh,$h),WK=fu(_K,mu,Bh,$h),zK=fu(mu,Bh,$h);function jK(e){return pu(e,[BK,Qx],[$K,UK],[HK,WK],[GK,zK])}function KK(e){return pu(OK(e),[AK,kK])}function qK(e){return pu(e,[MK,Jx],[NK,Jx],[LK,VK])}function YK(e){return pu(e,[xK,FK])}const ZK=fu(mu);function XK(e){return pu(e,[IK,ZK])}const JK=hu(RK,DK),QK=hu(Xx),e9=fu(mu,Bh,$h);function t9(e){return pu(e,[JK,Qx],[QK,e9])}const eF="Invalid Duration",tF={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},n9={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...tF},sr=146097/400,vu=146097/4800,s9={years:{quarters:4,months:12,weeks:sr/7,days:sr,hours:sr*24,minutes:sr*24*60,seconds:sr*24*60*60,milliseconds:sr*24*60*60*1e3},quarters:{months:3,weeks:sr/28,days:sr/4,hours:sr*24/4,minutes:sr*24*60/4,seconds:sr*24*60*60/4,milliseconds:sr*24*60*60*1e3/4},months:{weeks:vu/7,days:vu,hours:vu*24,minutes:vu*24*60,seconds:vu*24*60*60,milliseconds:vu*24*60*60*1e3},...tF},jl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],o9=jl.slice(0).reverse();function Zi(e,t,n=!1){const s={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new fn(s)}function nF(e,t){let n=t.milliseconds??0;for(const s of o9.slice(1))t[s]&&(n+=t[s]*e[s].milliseconds);return n}function sF(e,t){const n=nF(e,t)<0?-1:1;jl.reduceRight((s,o)=>{if(Ht(t[o]))return s;if(s){const r=t[s]*n,i=e[o][s],a=Math.floor(r/i);t[o]+=a*n,t[s]-=a*i*n}return o},null),jl.reduce((s,o)=>{if(Ht(t[o]))return s;if(s){const r=t[s]%1;t[s]-=r,t[o]+=r*e[s][o]}return o},null)}function oF(e){const t={};for(const[n,s]of Object.entries(e))s!==0&&(t[n]=s);return t}class fn{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let s=n?s9:n9;t.matrix&&(s=t.matrix),this.values=t.values,this.loc=t.loc||Sn.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(t,n){return fn.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new Bs(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new fn({values:nm(t,fn.normalizeUnit),loc:Sn.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if($a(t))return fn.fromMillis(t);if(fn.isDuration(t))return t;if(typeof t=="object")return fn.fromObject(t);throw new Bs(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[s]=YK(t);return s?fn.fromObject(s,n):fn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[s]=XK(t);return s?fn.fromObject(s,n):fn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the Duration is invalid");const s=t instanceof Fr?t:new Fr(t,n);if(Yn.throwOnInvalid)throw new Fj(s);return new fn({invalid:s})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new jI(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const s={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?$s.create(this.loc,s).formatDurationFromString(this,t):eF}toHuman(t={}){if(!this.isValid)return eF;const n=t.showZeros!==!1,s=jl.map(o=>{const r=this.values[o];return Ht(r)||r===0&&!n?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:o.slice(0,-1)}).format(r)}).filter(o=>o);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(s)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=rb(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},bt.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?nF(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=fn.fromDurationLike(t),s={};for(const o of jl)(uu(n.values,o)||uu(this.values,o))&&(s[o]=n.get(o)+this.get(o));return Zi(this,{values:s},!0)}minus(t){if(!this.isValid)return this;const n=fn.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const s of Object.keys(this.values))n[s]=Vx(t(this.values[s],s));return Zi(this,{values:n},!0)}get(t){return this[fn.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...nm(t,fn.normalizeUnit)};return Zi(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:s,matrix:o}={}){const i={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:o,conversionAccuracy:s};return Zi(this,i)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return sF(this.matrix,t),Zi(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=oF(this.normalize().shiftToAll().toObject());return Zi(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(i=>fn.normalizeUnit(i));const n={},s={},o=this.toObject();let r;for(const i of jl)if(t.indexOf(i)>=0){r=i;let a=0;for(const c in s)a+=this.matrix[c][i]*s[c],s[c]=0;$a(o[i])&&(a+=o[i]);const l=Math.trunc(a);n[i]=l,s[i]=(a*1e3-l*1e3)/1e3}else $a(o[i])&&(s[i]=o[i]);for(const i in s)s[i]!==0&&(n[r]+=i===r?s[i]:s[i]/this.matrix[r][i]);return sF(this.matrix,n),Zi(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Zi(this,{values:t},!0)}removeZeros(){if(!this.isValid)return this;const t=oF(this.values);return Zi(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(s,o){return s===void 0||s===0?o===void 0||o===0:s===o}for(const s of jl)if(!n(this.values[s],t.values[s]))return!1;return!0}}const yu="Invalid Interval";function r9(e,t){return!e||!e.isValid?Zn.invalid("missing or invalid start"):!t||!t.isValid?Zn.invalid("missing or invalid end"):t<e?Zn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Zn{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the Interval is invalid");const s=t instanceof Fr?t:new Fr(t,n);if(Yn.throwOnInvalid)throw new xj(s);return new Zn({invalid:s})}static fromDateTimes(t,n){const s=Uh(t),o=Uh(n),r=r9(s,o);return r??new Zn({start:s,end:o})}static after(t,n){const s=fn.fromDurationLike(n),o=Uh(t);return Zn.fromDateTimes(o,o.plus(s))}static before(t,n){const s=fn.fromDurationLike(n),o=Uh(t);return Zn.fromDateTimes(o.minus(s),o)}static fromISO(t,n){const[s,o]=(t||"").split("/",2);if(s&&o){let r,i;try{r=bt.fromISO(s,n),i=r.isValid}catch{i=!1}let a,l;try{a=bt.fromISO(o,n),l=a.isValid}catch{l=!1}if(i&&l)return Zn.fromDateTimes(r,a);if(i){const c=fn.fromISO(o,n);if(c.isValid)return Zn.after(r,c)}else if(l){const c=fn.fromISO(s,n);if(c.isValid)return Zn.before(a,c)}}return Zn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const s=this.start.startOf(t,n);let o;return n!=null&&n.useLocaleWeeks?o=this.end.reconfigure({locale:s.locale}):o=this.end,o=o.startOf(t,n),Math.floor(o.diff(s,t).get(t))+(o.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Zn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Uh).filter(i=>this.contains(i)).sort((i,a)=>i.toMillis()-a.toMillis()),s=[];let{s:o}=this,r=0;for(;o<this.e;){const i=n[r]||this.e,a=+i>+this.e?this.e:i;s.push(Zn.fromDateTimes(o,a)),o=a,r+=1}return s}splitBy(t){const n=fn.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s}=this,o=1,r;const i=[];for(;s<this.e;){const a=this.start.plus(n.mapUnits(l=>l*o));r=+a>+this.e?this.e:a,i.push(Zn.fromDateTimes(s,r)),s=r,o+=1}return i}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,s=this.e<t.e?this.e:t.e;return n>=s?null:Zn.fromDateTimes(n,s)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,s=this.e>t.e?this.e:t.e;return Zn.fromDateTimes(n,s)}static merge(t){const[n,s]=t.sort((o,r)=>o.s-r.s).reduce(([o,r],i)=>r?r.overlaps(i)||r.abutsStart(i)?[o,r.union(i)]:[o.concat([r]),i]:[o,i],[[],null]);return s&&n.push(s),n}static xor(t){let n=null,s=0;const o=[],r=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),i=Array.prototype.concat(...r),a=i.sort((l,c)=>l.time-c.time);for(const l of a)s+=l.type==="s"?1:-1,s===1?n=l.time:(n&&+n!=+l.time&&o.push(Zn.fromDateTimes(n,l.time)),n=null);return Zn.merge(o)}difference(...t){return Zn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:yu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=qg,n={}){return this.isValid?$s.create(this.s.loc.clone(n),t).formatInterval(this):yu}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:yu}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:yu}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:yu}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:yu}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):fn.invalid(this.invalidReason)}mapEndpoints(t){return Zn.fromDateTimes(t(this.s),t(this.e))}}class wu{static hasDST(t=Yn.defaultZone){const n=bt.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return cu.isValidZone(t)}static normalizeZone(t){return Ba(t,Yn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||Sn.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||Sn.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||Sn.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null,outputCalendar:r="gregory"}={}){return(o||Sn.create(n,s,r)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null,outputCalendar:r="gregory"}={}){return(o||Sn.create(n,s,r)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null}={}){return(o||Sn.create(n,s,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null}={}){return(o||Sn.create(n,s,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Sn.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return Sn.create(n,null,"gregory").eras(t)}static features(){return{relative:kx(),localeWeek:Ox()}}}function rF(e,t){const n=o=>o.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=n(t)-n(e);return Math.floor(fn.fromMillis(s).as("days"))}function i9(e,t,n){const s=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{const u=rF(l,c);return(u-u%7)/7}],["days",rF]],o={},r=e;let i,a;for(const[l,c]of s)n.indexOf(l)>=0&&(i=l,o[l]=c(e,t),a=r.plus(o),a>t?(o[l]--,e=r.plus(o),e>t&&(a=e,o[l]--,e=r.plus(o))):e=a);return[e,o,a,i]}function a9(e,t,n,s){let[o,r,i,a]=i9(e,t,n);const l=t-o,c=n.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);c.length===0&&(i<t&&(i=o.plus({[a]:1})),i!==o&&(r[a]=(r[a]||0)+l/(i-o)));const u=fn.fromObject(r,s);return c.length>0?fn.fromMillis(l,s).shiftTo(...c).plus(u):u}const l9="missing Intl.DateTimeFormat.formatToParts support";function yn(e,t=n=>n){return{regex:e,deser:([n])=>t(Jj(n))}}const iF="[ ]",aF=new RegExp(iF,"g");function c9(e){return e.replace(/\./g,"\\.?").replace(aF,iF)}function lF(e){return e.replace(/\./g,"").replace(aF," ").toLowerCase()}function Pr(e,t){return e===null?null:{regex:RegExp(e.map(c9).join("|")),deser:([n])=>e.findIndex(s=>lF(n)===lF(s))+t}}function cF(e,t){return{regex:e,deser:([,n,s])=>tm(n,s),groups:t}}function om(e){return{regex:e,deser:([t])=>t}}function u9(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function d9(e,t){const n=xr(t),s=xr(t,"{2}"),o=xr(t,"{3}"),r=xr(t,"{4}"),i=xr(t,"{6}"),a=xr(t,"{1,2}"),l=xr(t,"{1,3}"),c=xr(t,"{1,6}"),u=xr(t,"{1,9}"),d=xr(t,"{2,4}"),h=xr(t,"{4,6}"),f=v=>({regex:RegExp(u9(v.val)),deser:([C])=>C,literal:!0}),g=(v=>{if(e.literal)return f(v);switch(v.val){case"G":return Pr(t.eras("short"),0);case"GG":return Pr(t.eras("long"),0);case"y":return yn(c);case"yy":return yn(d,ib);case"yyyy":return yn(r);case"yyyyy":return yn(h);case"yyyyyy":return yn(i);case"M":return yn(a);case"MM":return yn(s);case"MMM":return Pr(t.months("short",!0),1);case"MMMM":return Pr(t.months("long",!0),1);case"L":return yn(a);case"LL":return yn(s);case"LLL":return Pr(t.months("short",!1),1);case"LLLL":return Pr(t.months("long",!1),1);case"d":return yn(a);case"dd":return yn(s);case"o":return yn(l);case"ooo":return yn(o);case"HH":return yn(s);case"H":return yn(a);case"hh":return yn(s);case"h":return yn(a);case"mm":return yn(s);case"m":return yn(a);case"q":return yn(a);case"qq":return yn(s);case"s":return yn(a);case"ss":return yn(s);case"S":return yn(l);case"SSS":return yn(o);case"u":return om(u);case"uu":return om(a);case"uuu":return yn(n);case"a":return Pr(t.meridiems(),0);case"kkkk":return yn(r);case"kk":return yn(d,ib);case"W":return yn(a);case"WW":return yn(s);case"E":case"c":return yn(n);case"EEE":return Pr(t.weekdays("short",!1),1);case"EEEE":return Pr(t.weekdays("long",!1),1);case"ccc":return Pr(t.weekdays("short",!0),1);case"cccc":return Pr(t.weekdays("long",!0),1);case"Z":case"ZZ":return cF(new RegExp(`([+-]${a.source})(?::(${s.source}))?`),2);case"ZZZ":return cF(new RegExp(`([+-]${a.source})(${s.source})?`),2);case"z":return om(/[a-z_+-/]{1,256}?/i);case" ":return om(/[^\S\n\r]/);default:return f(v)}})(e)||{invalidReason:l9};return g.token=e,g}const h9={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function f9(e,t,n){const{type:s,value:o}=e;if(s==="literal"){const l=/^\s+$/.test(o);return{literal:!l,val:l?" ":o}}const r=t[s];let i=s;s==="hour"&&(t.hour12!=null?i=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?i="hour12":i="hour24":i=n.hour12?"hour12":"hour24");let a=h9[i];if(typeof a=="object"&&(a=a[r]),a)return{literal:!1,val:a}}function p9(e){return[`^${e.map(n=>n.regex).reduce((n,s)=>`${n}(${s.source})`,"")}$`,e]}function g9(e,t,n){const s=e.match(t);if(s){const o={};let r=1;for(const i in n)if(uu(n,i)){const a=n[i],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(o[a.token.val[0]]=a.deser(s.slice(r,r+l))),r+=l}return[s,o]}else return[s,{}]}function m9(e){const t=r=>{switch(r){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,s;return Ht(e.z)||(n=cu.create(e.z)),Ht(e.Z)||(n||(n=new ii(e.Z)),s=e.Z),Ht(e.q)||(e.M=(e.q-1)*3+1),Ht(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),Ht(e.u)||(e.S=ob(e.u)),[Object.keys(e).reduce((r,i)=>{const a=t(i);return a&&(r[a]=e[i]),r},{}),n,s]}let ub=null;function v9(){return ub||(ub=bt.fromMillis(1555555555555)),ub}function y9(e,t){if(e.literal)return e;const n=$s.macroTokenToFormatOpts(e.val),s=fF(n,t);return s==null||s.includes(void 0)?e:s}function uF(e,t){return Array.prototype.concat(...e.map(n=>y9(n,t)))}class dF{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=uF($s.parseFormat(n),t),this.units=this.tokens.map(s=>d9(s,t)),this.disqualifyingUnit=this.units.find(s=>s.invalidReason),!this.disqualifyingUnit){const[s,o]=p9(this.units);this.regex=RegExp(s,"i"),this.handlers=o}}explainFromTokens(t){if(this.isValid){const[n,s]=g9(t,this.regex,this.handlers),[o,r,i]=s?m9(s):[null,null,void 0];if(uu(s,"a")&&uu(s,"H"))throw new lu("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:s,result:o,zone:r,specificOffset:i}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function hF(e,t,n){return new dF(e,n).explainFromTokens(t)}function w9(e,t,n){const{result:s,zone:o,specificOffset:r,invalidReason:i}=hF(e,t,n);return[s,o,r,i]}function fF(e,t){if(!e)return null;const s=$s.create(t,e).dtFormatter(v9()),o=s.formatToParts(),r=s.resolvedOptions();return o.map(i=>f9(i,e,r))}const db="Invalid DateTime",pF=864e13;function Hh(e){return new Fr("unsupported zone",`the zone "${e.name}" is not supported`)}function hb(e){return e.weekData===null&&(e.weekData=Xg(e.c)),e.weekData}function fb(e){return e.localWeekData===null&&(e.localWeekData=Xg(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Kl(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new bt({...n,...t,old:n})}function gF(e,t,n){let s=e-t*60*1e3;const o=n.offset(s);if(t===o)return[s,t];s-=(o-t)*60*1e3;const r=n.offset(s);return o===r?[s,o]:[e-Math.min(o,r)*60*1e3,Math.max(o,r)]}function rm(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function im(e,t,n){return gF(em(e),t,n)}function mF(e,t){const n=e.o,s=e.c.year+Math.trunc(t.years),o=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,r={...e.c,year:s,month:o,day:Math.min(e.c.day,Qg(s,o))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},i=fn.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=em(r);let[l,c]=gF(a,n,e.zone);return i!==0&&(l+=i,c=e.zone.offset(l)),{ts:l,o:c}}function Cu(e,t,n,s,o,r){const{setZone:i,zone:a}=n;if(e&&Object.keys(e).length!==0||t){const l=t||a,c=bt.fromObject(e,{...n,zone:l,specificOffset:r});return i?c:c.setZone(a)}else return bt.invalid(new Fr("unparsable",`the input "${o}" can't be parsed as ${s}`))}function am(e,t,n=!0){return e.isValid?$s.create(Sn.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function pb(e,t,n){const s=e.c.year>9999||e.c.year<0;let o="";if(s&&e.c.year>=0&&(o+="+"),o+=us(e.c.year,s?6:4),n==="year")return o;if(t){if(o+="-",o+=us(e.c.month),n==="month")return o;o+="-"}else if(o+=us(e.c.month),n==="month")return o;return o+=us(e.c.day),o}function vF(e,t,n,s,o,r,i){let a=!n||e.c.millisecond!==0||e.c.second!==0,l="";switch(i){case"day":case"month":case"year":break;default:if(l+=us(e.c.hour),i==="hour")break;if(t){if(l+=":",l+=us(e.c.minute),i==="minute")break;a&&(l+=":",l+=us(e.c.second))}else{if(l+=us(e.c.minute),i==="minute")break;a&&(l+=us(e.c.second))}if(i==="second")break;a&&(!s||e.c.millisecond!==0)&&(l+=".",l+=us(e.c.millisecond,3))}return o&&(e.isOffsetFixed&&e.offset===0&&!r?l+="Z":e.o<0?(l+="-",l+=us(Math.trunc(-e.o/60)),l+=":",l+=us(Math.trunc(-e.o%60))):(l+="+",l+=us(Math.trunc(e.o/60)),l+=":",l+=us(Math.trunc(e.o%60)))),r&&(l+="["+e.zone.ianaName+"]"),l}const yF={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},C9={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},b9={ordinal:1,hour:0,minute:0,second:0,millisecond:0},lm=["year","month","day","hour","minute","second","millisecond"],S9=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],E9=["year","ordinal","hour","minute","second","millisecond"];function cm(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new jI(e);return t}function wF(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return cm(e)}}function _9(e){if(Gh===void 0&&(Gh=Yn.now()),e.type!=="iana")return e.offset(Gh);const t=e.name;let n=gb.get(t);return n===void 0&&(n=e.offset(Gh),gb.set(t,n)),n}function CF(e,t){const n=Ba(t.zone,Yn.defaultZone);if(!n.isValid)return bt.invalid(Hh(n));const s=Sn.fromObject(t);let o,r;if(Ht(e.year))o=Yn.now();else{for(const l of lm)Ht(e[l])&&(e[l]=yF[l]);const i=Px(e)||Ax(e);if(i)return bt.invalid(i);const a=_9(n);[o,r]=im(e,a,n)}return new bt({ts:o,zone:n,loc:s,o:r})}function bF(e,t,n){const s=Ht(n.round)?!0:n.round,o=Ht(n.rounding)?"trunc":n.rounding,r=(a,l)=>(a=rb(a,s||n.calendary?0:2,n.calendary?"round":o),t.loc.clone(n).relFormatter(n).format(a,l)),i=a=>n.calendary?t.hasSame(e,a)?0:t.startOf(a).diff(e.startOf(a),a).get(a):t.diff(e,a).get(a);if(n.unit)return r(i(n.unit),n.unit);for(const a of n.units){const l=i(a);if(Math.abs(l)>=1)return r(l,a)}return r(e>t?-0:0,n.units[n.units.length-1])}function SF(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let Gh;const gb=new Map;class bt{constructor(t){const n=t.zone||Yn.defaultZone;let s=t.invalid||(Number.isNaN(t.ts)?new Fr("invalid input"):null)||(n.isValid?null:Hh(n));this.ts=Ht(t.ts)?Yn.now():t.ts;let o=null,r=null;if(!s)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[o,r]=[t.old.c,t.old.o];else{const a=$a(t.o)&&!t.old?t.o:n.offset(this.ts);o=rm(this.ts,a),s=Number.isNaN(o.year)?new Fr("invalid input"):null,o=s?null:o,r=s?null:a}this._zone=n,this.loc=t.loc||Sn.create(),this.invalid=s,this.weekData=null,this.localWeekData=null,this.c=o,this.o=r,this.isLuxonDateTime=!0}static now(){return new bt({})}static local(){const[t,n]=SF(arguments),[s,o,r,i,a,l,c]=n;return CF({year:s,month:o,day:r,hour:i,minute:a,second:l,millisecond:c},t)}static utc(){const[t,n]=SF(arguments),[s,o,r,i,a,l,c]=n;return t.zone=ii.utcInstance,CF({year:s,month:o,day:r,hour:i,minute:a,second:l,millisecond:c},t)}static fromJSDate(t,n={}){const s=sK(t)?t.valueOf():NaN;if(Number.isNaN(s))return bt.invalid("invalid input");const o=Ba(n.zone,Yn.defaultZone);return o.isValid?new bt({ts:s,zone:o,loc:Sn.fromObject(n)}):bt.invalid(Hh(o))}static fromMillis(t,n={}){if($a(t))return t<-pF||t>pF?bt.invalid("Timestamp out of range"):new bt({ts:t,zone:Ba(n.zone,Yn.defaultZone),loc:Sn.fromObject(n)});throw new Bs(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if($a(t))return new bt({ts:t*1e3,zone:Ba(n.zone,Yn.defaultZone),loc:Sn.fromObject(n)});throw new Bs("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const s=Ba(n.zone,Yn.defaultZone);if(!s.isValid)return bt.invalid(Hh(s));const o=Sn.fromObject(n),r=nm(t,wF),{minDaysInFirstWeek:i,startOfWeek:a}=Fx(r,o),l=Yn.now(),c=Ht(n.specificOffset)?s.offset(l):n.specificOffset,u=!Ht(r.ordinal),d=!Ht(r.year),h=!Ht(r.month)||!Ht(r.day),f=d||h,p=r.weekYear||r.weekNumber;if((f||u)&&p)throw new lu("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&u)throw new lu("Can't mix ordinal dates with month/day");const g=p||r.weekday&&!f;let v,C,S=rm(l,c);g?(v=S9,C=C9,S=Xg(S,i,a)):u?(v=E9,C=b9,S=nb(S)):(v=lm,C=yF);let b=!1;for(const F of v){const E=r[F];Ht(E)?b?r[F]=C[F]:r[F]=S[F]:b=!0}const w=g?eK(r,i,a):u?tK(r):Px(r),D=w||Ax(r);if(D)return bt.invalid(D);const R=g?Ix(r,i,a):u?xx(r):r,[T,I]=im(R,c,s),x=new bt({ts:T,zone:s,o:I,loc:o});return r.weekday&&f&&t.weekday!==x.weekday?bt.invalid("mismatched weekday",`you can't specify both a weekday of ${r.weekday} and a date of ${x.toISO()}`):x.isValid?x:bt.invalid(x.invalid)}static fromISO(t,n={}){const[s,o]=jK(t);return Cu(s,o,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[s,o]=KK(t);return Cu(s,o,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[s,o]=qK(t);return Cu(s,o,n,"HTTP",n)}static fromFormat(t,n,s={}){if(Ht(t)||Ht(n))throw new Bs("fromFormat requires an input string and a format");const{locale:o=null,numberingSystem:r=null}=s,i=Sn.fromOpts({locale:o,numberingSystem:r,defaultToEN:!0}),[a,l,c,u]=w9(i,t,n);return u?bt.invalid(u):Cu(a,l,s,`format ${n}`,t,c)}static fromString(t,n,s={}){return bt.fromFormat(t,n,s)}static fromSQL(t,n={}){const[s,o]=t9(t);return Cu(s,o,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the DateTime is invalid");const s=t instanceof Fr?t:new Fr(t,n);if(Yn.throwOnInvalid)throw new Ij(s);return new bt({invalid:s})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const s=fF(t,Sn.fromObject(n));return s?s.map(o=>o?o.val:null).join(""):null}static expandFormat(t,n={}){return uF($s.parseFormat(t),Sn.fromObject(n)).map(o=>o.val).join("")}static resetCache(){Gh=void 0,gb.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?hb(this).weekYear:NaN}get weekNumber(){return this.isValid?hb(this).weekNumber:NaN}get weekday(){return this.isValid?hb(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?fb(this).weekday:NaN}get localWeekNumber(){return this.isValid?fb(this).weekNumber:NaN}get localWeekYear(){return this.isValid?fb(this).weekYear:NaN}get ordinal(){return this.isValid?nb(this.c).ordinal:NaN}get monthShort(){return this.isValid?wu.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?wu.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?wu.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?wu.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,s=em(this.c),o=this.zone.offset(s-t),r=this.zone.offset(s+t),i=this.zone.offset(s-o*n),a=this.zone.offset(s-r*n);if(i===a)return[this];const l=s-i*n,c=s-a*n,u=rm(l,i),d=rm(c,a);return u.hour===d.hour&&u.minute===d.minute&&u.second===d.second&&u.millisecond===d.millisecond?[Kl(this,{ts:l}),Kl(this,{ts:c})]:[this]}get isInLeapYear(){return Nh(this.year)}get daysInMonth(){return Qg(this.year,this.month)}get daysInYear(){return this.isValid?du(this.year):NaN}get weeksInWeekYear(){return this.isValid?Lh(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Lh(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:s,calendar:o}=$s.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:s,outputCalendar:o}}toUTC(t=0,n={}){return this.setZone(ii.instance(t),n)}toLocal(){return this.setZone(Yn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:s=!1}={}){if(t=Ba(t,Yn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let o=this.ts;if(n||s){const r=t.offset(this.ts),i=this.toObject();[o]=im(i,r,t)}return Kl(this,{ts:o,zone:t})}else return bt.invalid(Hh(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:s}={}){const o=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:s});return Kl(this,{loc:o})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=nm(t,wF),{minDaysInFirstWeek:s,startOfWeek:o}=Fx(n,this.loc),r=!Ht(n.weekYear)||!Ht(n.weekNumber)||!Ht(n.weekday),i=!Ht(n.ordinal),a=!Ht(n.year),l=!Ht(n.month)||!Ht(n.day),c=a||l,u=n.weekYear||n.weekNumber;if((c||i)&&u)throw new lu("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&i)throw new lu("Can't mix ordinal dates with month/day");let d;r?d=Ix({...Xg(this.c,s,o),...n},s,o):Ht(n.ordinal)?(d={...this.toObject(),...n},Ht(n.day)&&(d.day=Math.min(Qg(d.year,d.month),d.day))):d=xx({...nb(this.c),...n});const[h,f]=im(d,this.o,this.zone);return Kl(this,{ts:h,o:f})}plus(t){if(!this.isValid)return this;const n=fn.fromDurationLike(t);return Kl(this,mF(this,n))}minus(t){if(!this.isValid)return this;const n=fn.fromDurationLike(t).negate();return Kl(this,mF(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const s={},o=fn.normalizeUnit(t);switch(o){case"years":s.month=1;case"quarters":case"months":s.day=1;case"weeks":case"days":s.hour=0;case"hours":s.minute=0;case"minutes":s.second=0;case"seconds":s.millisecond=0;break}if(o==="weeks")if(n){const r=this.loc.getStartOfWeek(),{weekday:i}=this;i<r&&(s.weekNumber=this.weekNumber-1),s.weekday=r}else s.weekday=1;if(o==="quarters"){const r=Math.ceil(this.month/3);s.month=(r-1)*3+1}return this.set(s)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?$s.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):db}toLocaleString(t=qg,n={}){return this.isValid?$s.create(this.loc.clone(n),t).formatDateTime(this):db}toLocaleParts(t={}){return this.isValid?$s.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:s=!1,includeOffset:o=!0,extendedZone:r=!1,precision:i="milliseconds"}={}){if(!this.isValid)return null;i=cm(i);const a=t==="extended";let l=pb(this,a,i);return lm.indexOf(i)>=3&&(l+="T"),l+=vF(this,a,n,s,o,r,i),l}toISODate({format:t="extended",precision:n="day"}={}){return this.isValid?pb(this,t==="extended",cm(n)):null}toISOWeekDate(){return am(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:s=!0,includePrefix:o=!1,extendedZone:r=!1,format:i="extended",precision:a="milliseconds"}={}){return this.isValid?(a=cm(a),(o&&lm.indexOf(a)>=3?"T":"")+vF(this,i==="extended",n,t,s,r,a)):null}toRFC2822(){return am(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return am(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?pb(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:s=!0}={}){let o="HH:mm:ss.SSS";return(n||t)&&(s&&(o+=" "),n?o+="z":t&&(o+="ZZ")),am(this,o,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():db}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",s={}){if(!this.isValid||!t.isValid)return fn.invalid("created by diffing an invalid DateTime");const o={locale:this.locale,numberingSystem:this.numberingSystem,...s},r=oK(n).map(fn.normalizeUnit),i=t.valueOf()>this.valueOf(),a=i?this:t,l=i?t:this,c=a9(a,l,r,o);return i?c.negate():c}diffNow(t="milliseconds",n={}){return this.diff(bt.now(),t,n)}until(t){return this.isValid?Zn.fromDateTimes(this,t):this}hasSame(t,n,s){if(!this.isValid)return!1;const o=t.valueOf(),r=this.setZone(t.zone,{keepLocalTime:!0});return r.startOf(n,s)<=o&&o<=r.endOf(n,s)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||bt.fromObject({},{zone:this.zone}),s=t.padding?this<n?-t.padding:t.padding:0;let o=["years","months","days","hours","minutes","seconds"],r=t.unit;return Array.isArray(t.unit)&&(o=t.unit,r=void 0),bF(n,this.plus(s),{...t,numeric:"always",units:o,unit:r})}toRelativeCalendar(t={}){return this.isValid?bF(t.base||bt.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(bt.isDateTime))throw new Bs("min requires all arguments be DateTimes");return Mx(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(bt.isDateTime))throw new Bs("max requires all arguments be DateTimes");return Mx(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,s={}){const{locale:o=null,numberingSystem:r=null}=s,i=Sn.fromOpts({locale:o,numberingSystem:r,defaultToEN:!0});return hF(i,t,n)}static fromStringExplain(t,n,s={}){return bt.fromFormatExplain(t,n,s)}static buildFormatParser(t,n={}){const{locale:s=null,numberingSystem:o=null}=n,r=Sn.fromOpts({locale:s,numberingSystem:o,defaultToEN:!0});return new dF(r,t)}static fromFormatParser(t,n,s={}){if(Ht(t)||Ht(n))throw new Bs("fromFormatParser requires an input string and a format parser");const{locale:o=null,numberingSystem:r=null}=s,i=Sn.fromOpts({locale:o,numberingSystem:r,defaultToEN:!0});if(!i.equals(n.locale))throw new Bs(`fromFormatParser called with a locale of ${i}, but the format parser was created for ${n.locale}`);const{result:a,zone:l,specificOffset:c,invalidReason:u}=n.explainFromTokens(t);return u?bt.invalid(u):Cu(a,l,s,`format ${n.format}`,t,c)}static get DATE_SHORT(){return qg}static get DATE_MED(){return KI}static get DATE_MED_WITH_WEEKDAY(){return Pj}static get DATE_FULL(){return qI}static get DATE_HUGE(){return YI}static get TIME_SIMPLE(){return ZI}static get TIME_WITH_SECONDS(){return XI}static get TIME_WITH_SHORT_OFFSET(){return JI}static get TIME_WITH_LONG_OFFSET(){return QI}static get TIME_24_SIMPLE(){return ex}static get TIME_24_WITH_SECONDS(){return tx}static get TIME_24_WITH_SHORT_OFFSET(){return nx}static get TIME_24_WITH_LONG_OFFSET(){return sx}static get DATETIME_SHORT(){return ox}static get DATETIME_SHORT_WITH_SECONDS(){return rx}static get DATETIME_MED(){return ix}static get DATETIME_MED_WITH_SECONDS(){return ax}static get DATETIME_MED_WITH_WEEKDAY(){return Aj}static get DATETIME_FULL(){return lx}static get DATETIME_FULL_WITH_SECONDS(){return cx}static get DATETIME_HUGE(){return ux}static get DATETIME_HUGE_WITH_SECONDS(){return dx}}function Uh(e){if(bt.isDateTime(e))return e;if(e&&e.valueOf&&$a(e.valueOf()))return bt.fromJSDate(e);if(e&&typeof e=="object")return bt.fromObject(e);throw new Bs(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const EF="account.last_prefered_timezone",ai=500;var At=(e=>(e[e.UNCHECK=0]="UNCHECK",e[e.INDETERMINATE=1]="INDETERMINATE",e[e.CHECKED=2]="CHECKED",e))(At||{});function Wh(e){if(!e)return null;if(bt.isDateTime(e))return e;if(e instanceof Date){const t=bt.fromJSDate(e);return t.isValid?t:null}if(typeof e=="number"){const t=bt.fromMillis(e);return t.isValid?t:null}if(typeof e=="string"){let t=bt.fromISO(e);return t.isValid||(t=bt.fromRFC2822(e)),t.isValid?t:null}return null}function _F(e,t,n){const s=Wh(e);if(!s)return"";const o=n?s.setZone(n):s;return o.isValid?o.toFormat(t):""}const um=()=>Tj(EF)||"UTC",RF=e=>({id:e.id,name:(e==null?void 0:e.name)??e.display_name,initial:e.initial,profile_image:e.profile_image,color:{bgColor:e.color.bgColor,textColor:e.color.textColor}}),bu=e=>e!=null&&e.length?e.map(RF):[],R9=e=>{if(!(e!=null&&e.length))return[];const t=new Set;return e.filter(n=>t.has(n.id)?!1:(t.add(n.id),!0))},DF=e=>{if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t},D9=e=>Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==void 0)),TF=(e,t)=>{var s,o,r;const n={id:e.id,name:e.name,assignees:void 0,status:e.template_flow_status,dateRange:[DF(e.start_date),DF(e.due_date)],isStarted:!!Number(e.is_started),isCompleted:!!Number(e.is_completed),lastUpdated:{tooltip:e!=null&&e.last_updated_by?e.last_updated_by:"",value:_F(e.updated_at,"MMM dd, yyyy | HH:mm",t)||""},completedOn:{tooltip:e.actual_due_date==null?"Pending":e.last_completed_by?e.last_completed_by:"",value:_F(e.actual_due_date,"MMM dd, yyyy | HH:mm",t)},isDeleted:!1,isProcessing:e!=null&&e.bulk_process?{state:e==null?void 0:e.bulk_process.state,message:(e==null?void 0:e.bulk_process.message)||""}:void 0,disabled:((s=e==null?void 0:e.bulk_process)==null?void 0:s.state)==0,isArchived:((o=e.property)==null?void 0:o.is_archived)===1||e.status==0,isLocked:((r=e.template_flow_status)==null?void 0:r.is_lock_item)===1,description:e.description||null};return D9(n)},IF={headphone:["headphones","headset"],sofa:["couch"],couch:["sofa"],run:["running","runner"]},mb=e=>e.toLowerCase().trim(),T9=e=>mb(e).split(/\s+/).filter(Boolean),xF=e=>e.replace(/(ing|ed|s)$/i,"");function I9(e){const t=new Set;for(const n of e){const s=xF(n);if(t.add(s),t.add(n),IF[s])for(const o of IF[s])t.add(xF(o))}return Array.from(t)}function x9(e,t){const n=mb(e),s=I9(T9(t));let o=0;for(const r of s)r&&(n.includes(r)&&(o+=r.length*2),n.startsWith(r)&&(o+=3));return o}function F9(e,t){const n=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=t.split(/\s+/).filter(Boolean).map(n);if(!s.length)return e;const o=new RegExp(`(${s.join("|")})`,"ig");return e.replace(o,"<mark>$1</mark>")}const FF=e=>{if(e!==null){if(Number(e.metric_type.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number(e.metric_type.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number(e.metric_type.id)==3)return"formula"}},vb=e=>!isNaN(e)&&isFinite(e),dm=(e,t)=>{var r;const{restricted_type:n}=e,s=Math.floor(Number(t)),o=((r=e.restricted_value)==null?void 0:r.split(",").map(Number))||[];if(n=="none")return!0;if(e.restricted_type=="not")return vb(s)&&!o.includes(s);if(e.restricted_type=="range"){const[i,a]=o;return vb(Number(t))&&Number(t)>=Number(i)&&Number(t)<=Number(a)}else if(n=="exact")return vb(s)&&o.includes(s);return!1},P9=(e,t)=>{var r;const n=un.getInstance().getItem("ws.terminology"),s=n?JSON.parse(n):null;return` ${((r=s==null?void 0:s.find(i=>i.code==="scene"))==null?void 0:r.name)||"Scene"} ${t}`.trim()};/*! js-cookie v3.0.5 | MIT */function hm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)e[s]=n[s]}return e}var A9={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function yb(e,t){function n(o,r,i){if(!(typeof document>"u")){i=hm({},t,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in i)i[l]&&(a+="; "+l,i[l]!==!0&&(a+="="+i[l].split(";")[0]));return document.cookie=o+"="+e.write(r,o)+a}}function s(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var r=document.cookie?document.cookie.split("; "):[],i={},a=0;a<r.length;a++){var l=r[a].split("="),c=l.slice(1).join("=");try{var u=decodeURIComponent(l[0]);if(i[u]=e.read(c,u),o===u)break}catch{}}return o?i[o]:i}}return Object.create({set:n,get:s,remove:function(o,r){n(o,"",hm({},r,{expires:-1}))},withAttributes:function(o){return yb(this.converter,hm({},this.attributes,o))},withConverter:function(o){return yb(hm({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var PF=yb(A9,{path:"/"});const fm=({date:e,timezone:t,format:n})=>{if(!e)return"";const s=typeof e=="string"?bt.fromISO(e,{zone:t}):e,o=bt.now().setZone(t||"local"),r=s.setZone(t||"local"),i=o.startOf("day"),l=r.startOf("day").diff(i,"days").days;let c="";if(l===0?c="Today":l===-1?c="Yesterday":l===1&&(c="Tomorrow"),c&&(n!=null&&n.includes("HH:mm"))){const u=r.toFormat("HH:mm");return`${c} at ${u}`}else if(c)return c;return r.toFormat(n)},wb=()=>PF.get("account.last_prefered_timezone")||"UTC",pm=e=>`${bt.fromJSDate(e,{zone:"UTC"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`;function AF(e){if(!e)return"";const t=e.replace(/<br\s*\/?>/gi,`
|
|
115
115
|
`).replace(/<\/(p|div|li|h[1-6])>/gi,`
|
|
116
116
|
`);return(new DOMParser().parseFromString(t,"text/html").body.textContent??"").replace(/\n{3,}/g,`
|
|
117
117
|
|
|
@@ -148,7 +148,7 @@ This will fail in production.`);i=Zl,i._s.has(e)||(o?qb(e,t,s,i):MA(e,s,i),Y.env
|
|
|
148
148
|
`)}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[dk]=this[dk]={accessors:{}}).accessors,o=this.prototype;function r(i){const a=cf(i);s[a]||(gX(o,i),s[a]=!0)}return Be.isArray(t)?t.forEach(r):r(t),this}};fo.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Be.reduceDescriptors(fo.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}}),Be.freezeMethods(fo);function uS(e,t){const n=this||lf,s=t||n,o=fo.from(s.headers);let r=s.data;return Be.forEach(e,function(a){r=a.call(n,r,o.normalize(),t?t.status:void 0)}),o.normalize(),r}function hk(e){return!!(e&&e.__CANCEL__)}function Nu(e,t,n){Yt.call(this,e??"canceled",Yt.ERR_CANCELED,t,n),this.name="CanceledError"}Be.inherits(Nu,Yt,{__CANCEL__:!0});function fk(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new Yt("Request failed with status code "+n.status,[Yt.ERR_BAD_REQUEST,Yt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function mX(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function vX(e,t){e=e||10;const n=new Array(e),s=new Array(e);let o=0,r=0,i;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=s[r];i||(i=c),n[o]=l,s[o]=c;let d=r,h=0;for(;d!==o;)h+=n[d++],d=d%e;if(o=(o+1)%e,o===r&&(r=(r+1)%e),c-i<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function yX(e,t){let n=0,s=1e3/t,o,r;const i=(c,u=Date.now())=>{n=u,o=null,r&&(clearTimeout(r),r=null),e(...c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=s?i(c,u):(o=c,r||(r=setTimeout(()=>{r=null,i(o)},s-d)))},()=>o&&i(o)]}const Bm=(e,t,n=3)=>{let s=0;const o=vX(50,250);return yX(r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,l=i-s,c=o(l),u=i<=a;s=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-i)/c:void 0,event:r,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},pk=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},gk=e=>(...t)=>Be.asap(()=>e(...t)),wX=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,CX=Gs.hasStandardBrowserEnv?{write(e,t,n,s,o,r,i){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}`),r===!0&&a.push("secure"),Be.isString(i)&&a.push(`SameSite=${i}`),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 bX(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function SX(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function mk(e,t,n){let s=!bX(t);return e&&(s||n==!1)?SX(e,t):t}const vk=e=>e instanceof fo?{...e}:e;function nc(e,t){t=t||{};const n={};function s(c,u,d,h){return Be.isPlainObject(c)&&Be.isPlainObject(u)?Be.merge.call({caseless:h},c,u):Be.isPlainObject(u)?Be.merge({},u):Be.isArray(u)?u.slice():u}function o(c,u,d,h){if(Be.isUndefined(u)){if(!Be.isUndefined(c))return s(void 0,c,d,h)}else return s(c,u,d,h)}function r(c,u){if(!Be.isUndefined(u))return s(void 0,u)}function i(c,u){if(Be.isUndefined(u)){if(!Be.isUndefined(c))return s(void 0,c)}else return s(void 0,u)}function a(c,u,d){if(d in t)return s(c,u);if(d in e)return s(void 0,c)}const l={url:r,method:r,data:r,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(c,u,d)=>o(vk(c),vk(u),d,!0)};return Be.forEach(Object.keys({...e,...t}),function(u){const d=l[u]||o,h=d(e[u],t[u],u);Be.isUndefined(h)&&d!==a||(n[u]=h)}),n}const yk=e=>{const t=nc({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:o,xsrfCookieName:r,headers:i,auth:a}=t;if(t.headers=i=fo.from(i),t.url=ak(mk(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Be.isFormData(n)){if(Gs.hasStandardBrowserEnv||Gs.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(Be.isFunction(n.getHeaders)){const l=n.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([u,d])=>{c.includes(u.toLowerCase())&&i.set(u,d)})}}if(Gs.hasStandardBrowserEnv&&(s&&Be.isFunction(s)&&(s=s(t)),s||s!==!1&&wX(t.url))){const l=o&&r&&CX.read(r);l&&i.set(o,l)}return t},EX=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,s){const o=yk(e);let r=o.data;const i=fo.from(o.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=o,u,d,h,f,p;function g(){f&&f(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(o.method.toUpperCase(),o.url,!0),v.timeout=o.timeout;function C(){if(!v)return;const b=fo.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),D={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:b,config:e,request:v};fk(function(T){n(T),g()},function(T){s(T),g()},D),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 Yt("Request aborted",Yt.ECONNABORTED,e,v)),v=null)},v.onerror=function(w){const D=w&&w.message?w.message:"Network Error",R=new Yt(D,Yt.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 D=o.transitional||ck;o.timeoutErrorMessage&&(w=o.timeoutErrorMessage),s(new Yt(w,D.clarifyTimeoutError?Yt.ETIMEDOUT:Yt.ECONNABORTED,e,v)),v=null},r===void 0&&i.setContentType(null),"setRequestHeader"in v&&Be.forEach(i.toJSON(),function(w,D){v.setRequestHeader(D,w)}),Be.isUndefined(o.withCredentials)||(v.withCredentials=!!o.withCredentials),a&&a!=="json"&&(v.responseType=o.responseType),c&&([h,p]=Bm(c,!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)&&(u=b=>{v&&(s(!b||b.type?new Nu(null,e,v):b),v.abort(),v=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const S=mX(o.url);if(S&&Gs.protocols.indexOf(S)===-1){s(new Yt("Unsupported protocol "+S+":",Yt.ERR_BAD_REQUEST,e));return}v.send(r||null)})},_X=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,o;const r=function(c){if(!o){o=!0,a();const u=c instanceof Error?c:this.reason;s.abort(u instanceof Yt?u:new Nu(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,r(new Yt(`timeout ${t} of ms exceeded`,Yt.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),e=null)};e.forEach(c=>c.addEventListener("abort",r));const{signal:l}=s;return l.unsubscribe=()=>Be.asap(a),l}},RX=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},DX=async function*(e,t){for await(const n of TX(e))yield*RX(n,t)},TX=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()}},wk=(e,t,n,s)=>{const o=DX(e,t);let r=0,i,a=l=>{i||(i=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await o.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let h=r+=d;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),o.return()}},{highWaterMark:2})},Ck=64*1024,{isFunction:$m}=Be,IX=(({Request:e,Response:t})=>({Request:e,Response:t}))(Be.global),{ReadableStream:bk,TextEncoder:Sk}=Be.global,Ek=(e,...t)=>{try{return!!e(...t)}catch{return!1}},xX=e=>{e=Be.merge.call({skipUndefined:!0},IX,e);const{fetch:t,Request:n,Response:s}=e,o=t?$m(t):typeof fetch=="function",r=$m(n),i=$m(s);if(!o)return!1;const a=o&&$m(bk),l=o&&(typeof Sk=="function"?(p=>g=>p.encode(g))(new Sk):async p=>new Uint8Array(await new n(p).arrayBuffer())),c=r&&a&&Ek(()=>{let p=!1;const g=new n(Gs.origin,{body:new bk,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),u=i&&a&&Ek(()=>Be.isReadableStream(new s("").body)),d={stream:u&&(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 Yt(`Response type '${p}' is not supported`,Yt.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:D,onUploadProgress:R,responseType:T,headers:I,withCredentials:x="same-origin",fetchOptions:F}=yk(p),E=t||fetch;T=T?(T+"").toLowerCase():"text";let A=_X([S,b&&b.toAbortSignal()],w),k=null;const M=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let O;try{if(R&&c&&v!=="get"&&v!=="head"&&(O=await f(I,C))!==0){let ee=new n(g,{method:"POST",body:C,duplex:"half"}),V;if(Be.isFormData(C)&&(V=ee.headers.get("content-type"))&&I.setContentType(V),ee.body){const[G,te]=pk(O,Bm(gk(R)));C=wk(ee.body,Ck,G,te)}}Be.isString(x)||(x=x?"include":"omit");const W=r&&"credentials"in n.prototype,X={...F,signal:A,method:v.toUpperCase(),headers:I.normalize().toJSON(),body:C,duplex:"half",credentials:W?x:void 0};k=r&&new n(g,X);let J=await(r?E(k,F):E(g,X));const ie=u&&(T==="stream"||T==="response");if(u&&(D||ie&&M)){const ee={};["status","statusText","headers"].forEach(pe=>{ee[pe]=J[pe]});const V=Be.toFiniteNumber(J.headers.get("content-length")),[G,te]=D&&pk(V,Bm(gk(D),!0))||[];J=new s(wk(J.body,Ck,G,()=>{te&&te(),M&&M()}),ee)}T=T||"text";let ae=await d[Be.findKey(d,T)||"text"](J,p);return!ie&&M&&M(),await new Promise((ee,V)=>{fk(ee,V,{data:ae,headers:fo.from(J.headers),status:J.status,statusText:J.statusText,config:p,request:k})})}catch(W){throw M&&M(),W&&W.name==="TypeError"&&/Load failed|fetch/i.test(W.message)?Object.assign(new Yt("Network Error",Yt.ERR_NETWORK,p,k),{cause:W.cause||W}):Yt.from(W,W&&W.code,p,k)}}},FX=new Map,_k=e=>{let t=e&&e.env||{};const{fetch:n,Request:s,Response:o}=t,r=[s,o,n];let i=r.length,a=i,l,c,u=FX;for(;a--;)l=r[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:xX(t)),u=c;return c};_k();const dS={http:JZ,xhr:EX,fetch:{get:_k}};Be.forEach(dS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Rk=e=>`- ${e}`,PX=e=>Be.isFunction(e)||e===null||e===!1;function AX(e,t){e=Be.isArray(e)?e:[e];const{length:n}=e;let s,o;const r={};for(let i=0;i<n;i++){s=e[i];let a;if(o=s,!PX(s)&&(o=dS[(a=String(s)).toLowerCase()],o===void 0))throw new Yt(`Unknown adapter '${a}'`);if(o&&(Be.isFunction(o)||(o=o.get(t))))break;r[a||"#"+i]=o}if(!o){const i=Object.entries(r).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=n?i.length>1?`since :
|
|
149
149
|
`+i.map(Rk).join(`
|
|
150
150
|
`):" "+Rk(i[0]):"as no adapter specified";throw new Yt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const Dk={getAdapter:AX,adapters:dS};function hS(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Nu(null,e)}function Tk(e){return hS(e),e.headers=fo.from(e.headers),e.data=uS.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Dk.getAdapter(e.adapter||lf.adapter,e)(e).then(function(s){return hS(e),s.data=uS.call(e,e.transformResponse,s),s.headers=fo.from(s.headers),s},function(s){return hk(s)||(hS(e),s&&s.response&&(s.response.data=uS.call(e,e.transformResponse,s.response),s.response.headers=fo.from(s.response.headers))),Promise.reject(s)})}const Ik="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 xk={};Hm.transitional=function(t,n,s){function o(r,i){return"[Axios v"+Ik+"] Transitional option '"+r+"'"+i+(s?". "+s:"")}return(r,i,a)=>{if(t===!1)throw new Yt(o(i," has been removed"+(n?" in "+n:"")),Yt.ERR_DEPRECATED);return n&&!xk[i]&&(xk[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(r,i,a):!0}},Hm.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function kX(e,t,n){if(typeof e!="object")throw new Yt("options must be an object",Yt.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let o=s.length;for(;o-- >0;){const r=s[o],i=t[r];if(i){const a=e[r],l=a===void 0||i(a,r,e);if(l!==!0)throw new Yt("option "+r+" must be "+l,Yt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Yt("Unknown option "+r,Yt.ERR_BAD_OPTION)}}const Gm={assertOptions:kX,validators:Hm},ui=Gm.validators;let sc=class{constructor(t){this.defaults=t||{},this.interceptors={request:new lk,response:new lk}}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 r=o.stack?o.stack.replace(/^.+\n/,""):"";try{s.stack?r&&!String(s.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
151
|
-
`+r):s.stack=r}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=nc(this.defaults,n);const{transitional:s,paramsSerializer:o,headers:r}=n;s!==void 0&&Gm.assertOptions(s,{silentJSONParsing:ui.transitional(ui.boolean),forcedJSONParsing:ui.transitional(ui.boolean),clarifyTimeoutError:ui.transitional(ui.boolean)},!1),o!=null&&(Be.isFunction(o)?n.paramsSerializer={serialize:o}:Gm.assertOptions(o,{encode:ui.function,serialize:ui.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Gm.assertOptions(n,{baseUrl:ui.spelling("baseURL"),withXsrfToken:ui.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=r&&Be.merge(r.common,r[n.method]);r&&Be.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),n.headers=fo.concat(i,r);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 c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,d=0,h;if(!l){const p=[Tk.bind(this),void 0];for(p.unshift(...a),p.push(...c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}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{u=Tk.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=nc(this.defaults,t);const n=mk(t.baseURL,t.url,t.allowAbsoluteUrls);return ak(n,t.params,t.paramsSerializer)}};Be.forEach(["delete","get","head","options"],function(t){sc.prototype[t]=function(n,s){return this.request(nc(s||{},{method:t,url:n,data:(s||{}).data}))}}),Be.forEach(["post","put","patch"],function(t){function n(s){return function(r,i,a){return this.request(nc(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}sc.prototype[t]=n(),sc.prototype[t+"Form"]=n(!0)});let OX=class d${constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(r){n=r});const s=this;this.promise.then(o=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](o);s._listeners=null}),this.promise.then=o=>{let r;const i=new Promise(a=>{s.subscribe(a),r=a}).then(o);return i.cancel=function(){s.unsubscribe(r)},i},t(function(r,i,a){s.reason||(s.reason=new Nu(r,i,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 d$(function(o){t=o}),cancel:t}}};function MX(e){return function(n){return e.apply(null,n)}}function NX(e){return Be.isObject(e)&&e.isAxiosError===!0}const fS={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(fS).forEach(([e,t])=>{fS[t]=e});function Fk(e){const t=new sc(e),n=jA(sc.prototype.request,t);return Be.extend(n,sc.prototype,t,{allOwnKeys:!0}),Be.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Fk(nc(e,o))},n}const ns=Fk(lf);ns.Axios=sc,ns.CanceledError=Nu,ns.CancelToken=OX,ns.isCancel=hk,ns.VERSION=Ik,ns.toFormData=Lm,ns.AxiosError=Yt,ns.Cancel=ns.CanceledError,ns.all=function(t){return Promise.all(t)},ns.spread=MX,ns.isAxiosError=NX,ns.mergeConfig=nc,ns.AxiosHeaders=fo,ns.formToJSON=e=>uk(Be.isHTMLForm(e)?new FormData(e):e),ns.getAdapter=Dk.getAdapter,ns.HttpStatusCode=fS,ns.default=ns;const{Axios:n0e,AxiosError:s0e,CanceledError:o0e,isCancel:r0e,CancelToken:i0e,VERSION:a0e,all:l0e,Cancel:c0e,isAxiosError:LX,spread:u0e,toFormData:d0e,AxiosHeaders:h0e,HttpStatusCode:f0e,formToJSON:p0e,getAdapter:g0e,mergeConfig:m0e}=ns,VX=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},BX=6e4,Pk=e=>({[`/api/v1/workspace/${e}/item/2`]:1,[`/api/v1/workspace/${e}/item/2/metrics`]:5,default:5}),Um=new Map,Ak=e=>{const t=e.match(/\/api\/v1\/workspace\/([^/]+)/);return t?t[1]:null},$X=e=>{const t=Ak(e),n=Pk(t||"none"),o=new URL(e,"https://dummy.com").pathname,r=Object.keys(n).find(a=>a!=="default"&&o===a)||"default";Um.has(r)||Um.set(r,{ongoing:0,queue:[]});const i=Um.get(r);return new Promise(a=>{i?i.ongoing<n[r]?(i.ongoing++,a()):i.queue.push(()=>{i.ongoing++,a()}):a()})},kk=e=>{const t=Ak(e),n=Pk(t||"none"),o=new URL(e,"https://dummy.com").pathname,r=Object.keys(n).find(a=>a!=="default"&&o===a)||"default",i=Um.get(r);if(i&&(i.ongoing--,i.queue.length>0)){const a=i.queue.shift();setTimeout(()=>{a==null||a()},1e3)}},HX=(()=>{const e=ns.create({timeout:BX,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(async t=>{const n=t.url||"";await $X(n);const s=VX("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=>(kk(t.config.url||""),t),async t=>{var s,o,r;if(((s=t.response)==null?void 0:s.status)===401){const i=sessionStorage.getItem("BASE_URL")||"";(()=>{const l=`${i}/start`;window.postMessage({type:"TOKEN_EXPIRED",message:"Authentication token has expired"},"*"),window.location.replace(l)})()}if(t.config&&kk(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 i=t.response.headers["retry-after"],a=i?parseInt(i)*1e3:Math.pow(2,n._retryCount)*1e3;return await new Promise(l=>setTimeout(l,a)),e(n)}return((r=t.response)==null?void 0:r.status)===401&&!n._retry&&(n._retry=!0),Promise.reject(t)}),e})();class uf extends Error{constructor(t,n,s,o,r){super(t),this.name="ApiError",this.statusCode=n,this.code=s,this.details=o,this.type=r,Object.setPrototypeOf(this,uf.prototype)}}const df=e=>{var t,n;if(LX(e)){const s=(t=e.response)==null?void 0:t.status,o=(n=e.response)==null?void 0:n.data,r=(o==null?void 0:o.message)||e.message||"An unexpected error occurred",i=(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===ku.UNAUTHORIZED||s===ku.FORBIDDEN?l="AUTH":s===ku.UNPROCESSABLE_ENTITY||s===ku.BAD_REQUEST?l="VALIDATION":s>=ku.BAD_REQUEST&&(l="CLIENT"),new uf(r,s,i,a,l)}return e instanceof Error?new uf(e.message,void 0,void 0,void 0,"UNKNOWN"):new uf("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class GX{constructor(){this.axios=HX}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,r])=>{r!=null&&r!==""&&(Array.isArray(r)?r.forEach(i=>n.append(o,String(i))):typeof r=="object"?n.append(o,JSON.stringify(r)):n.append(o,String(r)))});const s=n.toString();return s?`?${s}`:""}async get(t="",n,s){try{const o=this.buildUrl(t),r=n?this.buildQueryParams(n):"";return(await this.axios.get(`${o}${r}`,s)).data}catch(o){throw df(o)}}async post(t="",n,s,o){try{const r=this.buildUrl(t),i=n?this.buildQueryParams(n):"";return(await this.axios.post(`${r}${i}`,s,o)).data}catch(r){throw df(r)}}async put(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.put(o,n,s)).data}catch(o){throw df(o)}}async patch(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.patch(o,n,s)).data}catch(o){throw df(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 df(o)}}}const UX=({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}/v1/workspace/${t}/entity/2/metrics`,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"}}),WX=(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 Ok extends GX{constructor(t,n){const s=n==null?void 0:n.domainApi,o=n==null?void 0:n.wsCode,r=(n==null?void 0:n.entityId)||"";super(),this.events=Object.create(null);const i=UX({domainApi:s,wsCode:o,entityId:r}),a={};Object.entries(i).forEach(([l,c])=>{const u=l;t[u]?a[u]=t[u]:(console.warn(`API config for ${u} is missing, using base config.`),a[u]=c)}),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(r){console.error(`Error in event listener for ${t}:`,r)}})}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:r,responseType:i}){var c,u;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:i}),(((c=l.headers)==null?void 0:c["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const h=((u=l.headers)==null?void 0:u["content-disposition"])||"",f=h.includes("filename=")?h.split("filename=")[1]:"exported_items.xlsx";WX(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:r,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:r,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let s=t;return Object.entries(n).forEach(([o,r])=>{s=s.replace(`{${o}}`,String(r))}),s}async request(t,n,s={}){const{url:o,code:r,method:i}=this.apiConfig[t],a=this.generateUrl(o,n);return this._requestHandler({method:i,path:a,params:s.params,payload:s.payload,code:r,responseType:s.responseType})}async getAllItem_cursor(t){var r;const n=t.workspaceId,s={entity_ids:((r=t.entityIds)==null?void 0:r.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:r}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:r||100,page:s||1,name_like:o||void 0,permission:"1,2"}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:s,metric_ids:o}){const r={item_ids:n,metric_ids:o};return this.request("metricValues",{workspaceId:t},{params:{per_page:s,include_permission:1},payload:r})}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 r={item_id:s,entity_id:n,name:o,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:s},{payload:r})}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 r={item_ids:n,delete_all:s?1:void 0,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:r})}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:r,filterParams:i}){const a={item_ids:n,start_date:s,due_date:o,entity_id:r};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:i})}async updateAssignee(t){const{workspaceId:n,itemIds:s,userIds:o,entityId:r}=t,i={item_ids:s,ws_user_role_ids:o,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:i,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:s,entityId:o}=t,r={item_ids:n,ws_user_role_ids:s,entity_id:o};return!n||n.length===0?(r.item_ids=void 0,r.entity_id=o):(r.item_ids=n,r.entity_id=void 0),r}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:r}=t,i={item_ids:s,ws_user_role_ids:o,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:i})}async addAssignee({workspaceId:t,itemIds:n,userIds:s,entityId:o,filterParams:r}){const i={item_ids:n,ws_user_role_ids:s,entity_id:o};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:i,params:r})}async unAssignAll(t){const{workspaceId:n,entityId:s,itemIds:o,filterParams:r}=t,i={item_ids:o,entity_id:s,ws_user_role_ids:[]};return!o||o.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(s)},{payload:i,params:r})}async updateItemStatus(t){const{workspaceId:n,itemIds:s=[],statusId:o,entityId:r}=t,i={item_ids:s,template_flow_status_id:o};return s.length||(i.item_ids=void 0,i.entity_id=r),this.request("bulkStatusUpdate",{workspaceId:n},{payload:i,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:r,clear:i}=t,a={item_ids:s,metric_id:o,metric_value:r,clear:i??(r==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:r,entity_ids:i}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:s,per_page:o,display_name_like:r,entity_ids:i}})}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 this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return this.request("getAssignableAssignees",{workspaceId:t},{params:n})}}const zX=(e,t,n,s,o,r,i)=>{const{apiServices:a}=ts(n,s),l=B(!1),c=()=>{l.value=!0},u=()=>{vt(()=>{setTimeout(()=>{l.value=!1},500)})},d=q(()=>!!(o!=null&&o.value&&(r!=null&&r.value))),h=_n("filterParams",null);return{isUpdating:l,handleUpdate:async p=>{var v;const g=p.value;c();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)}u()}}},jX=Et(ot({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=GA(),s=B([]),o=e,r=t,i=B([]),a=B(null),l=X=>{var ae,ee,V;const J=s.value.findIndex(G=>G.id===X.id);a.value=J;const ie=(ae=i.value[J])==null?void 0:ae.$el;(ee=D.value)==null||ee.scrollTo(J*30),ie&&ie.scrollIntoView({behavior:"smooth",block:"center"}),c(J),(V=i.value[J])==null||V.show()},c=X=>{a.value=X,i.value.forEach((J,ie)=>{ie!==X&&J&&J.hide()})},u=B(""),d=()=>{u.value="",i.value.forEach(X=>{X==null||X.hide()}),a.value=null},h=q(()=>o.selectedIds||[]),f=q(()=>({itemIds:h.value,workspaceId:String(o.workspaceId)})),p=_n("isSelectAll",B(!1)),g=_n("bulkUpdate",B(!1)),v=B(null),{handleUpdate:C,isUpdating:S}=zX(f,X=>{var J;r("update",X),d(),(J=v.value)==null||J.hide()},!1,o,g,p),b=async X=>{var J;r("update-start");try{await C(X),r("update-completed")}catch{r("update-failed"),(J=v.value)==null||J.open()}},w=X=>{d(),vt(()=>{var J;(J=D.value)==null||J.focus()})},D=B(null),R=(X,J)=>{var ie;X?(ie=D.value)==null||ie.focus():d(),X&&J!==X&&W("")},T=B(!0),I=B(!0),{apiServices:x}=ts(!1,o),F=async(X,J,ie)=>{var ae;try{return ie?I.value=!0:T.value=!0,await((ae=x.value)==null?void 0:ae.getMetricList({workspaceId:o.workspaceId||"",entityId:o.entityId||"",page:X,query:J,per_page:10}))}catch(ee){throw console.error("Failed to fetch metric list:",ee),ee}finally{T.value=!1,I.value=!1}},E=B(0),A=B(!0),k=X=>({id:String(X.id),label:String(X.name),value:String(X.id),description:X.morpheme_value?`${String(X.morpheme_value)}`:"",type:n.checkEditType(X),metricConfig:X}),M=X=>X.filter(J=>!J.formula).filter(J=>{var ie;return((ie=J==null?void 0:J.auth_permission)==null?void 0:ie.permission)==2}).map(k),O=async()=>{E.value+=1;const X=await F(E.value,u.value,!0);if(X&&X.data){const J=M(X.data);s.value=[...s.value,...J],A.value=X.meta.last_page!=X.meta.current_page}else A.value=!1},W=async X=>{u.value=X,E.value=1;try{const J=await F(E.value,u.value);J&&J.data?(s.value=M(J.data),A.value=J.meta.last_page!=J.meta.current_page):s.value=[]}catch{s.value=[]}};return(X,J)=>(z(),je(nf,{ref_key:"wrapperRef",ref:v,isUpdating:H(S),disabled:o.disabled||H(S),onOnVisibleChange:R},{trigger:ge(({hide:ie,disabled:ae})=>[fe(ht,{variant:o.variant,loading:H(S),disabled:ae,onEscape:ie},{default:ge(()=>[fe(at,{src:"SquareRootVariable",class:"icon"}),J[1]||(J[1]=st(" Metric ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ge(({isVisible:ie,popupRef:ae,hide:ee})=>[Ke(fe(Qi,{ref_key:"searchListRef",ref:D,style:{width:"320px"},options:s.value,loading:T.value,"loading-more":I.value,"selected-id":void 0,"has-more":A.value,onSearch:W,onSelect:l,onLoadMore:J[0]||(J[0]=()=>O()),onCancel:ee},{item:ge(({item:V,index:G,selectedIndex:te})=>[fe(fZ,{ref:pe=>i.value[G]=pe,label:V.label,type:V.type,morpheme:V.description||"",onFocusOnSearch:w,onOpen:pe=>c(G),attachTo:ae,config:V.metricConfig,onHandleUpdate:b,class:Q(["metric-update-item",{selected:a.value===G||te===G}])},null,8,["label","type","morpheme","onOpen","attachTo","config","class"])]),"extra-item":ge(()=>[...J[2]||(J[2]=[be("div",{style:{width:"250px"}},null,-1)])]),"empty-list":ge(()=>[...J[3]||(J[3]=[st("No options available.",-1)])]),_:2},1032,["options","loading","loading-more","has-more","onCancel"]),[[Ko,ie]])]),default:ge(()=>[J[4]||(J[4]=st(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),[["__scopeId","data-v-bf83ec06"]]),Wm=Ql("bulkUpdate",()=>{const e=B(At.UNCHECK),t=lo({loaded:0,total:0}),n=u=>{t.total=u},s=u=>{t.loaded=u},o=lo({isBulkUpdating:!1});function r(u){o.isBulkUpdating=u}const i=B({}),a=u=>{i.value=u},l=(u,d)=>{i.value[u]=d},c=u=>{e.value=u};return{bulkUpdateState:o,setIsBulkUpdating:r,selectionIds:i,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:c,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:s,handelSelectAll:()=>{c(At.CHECKED)}}}),KX={class:"status-label"},Mk=Et(ot({__name:"StatusItem",props:{status:{},selected:{type:Boolean},focused:{type:Boolean},hovered:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=qt,s=e,o=t,r=a=>{o("select",a)},i=a=>new Nn(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(z(),ce("div",{class:Q(["status-option",{selected:s.selected,focused:s.focused,hovered:s.hovered}]),onClick:l[0]||(l[0]=c=>r(e.status.id))},[be("div",{class:"status-color",style:hn({backgroundColor:e.status.color,borderColor:i(e.status.color)})},null,4),Ke((z(),ce("div",KX,[Tt(a.$slots,"label",{},()=>[st(Ct(e.status.name),1)],!0)])),[[H(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-aeaa75a4"]]),qX=["innerHTML"],Nk=Et(ot({__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,r=n,i=B([]),a=B(!1),l=B(!1),c=B(null),u=B(s.INITIAL_PAGE),d=B(!0),h=B(0),f=B(""),p=q(()=>{var M;return(M=o.value)==null?void 0:M.id}),g=q(()=>!!(o.id||o.ids&&o.ids.length>0)),v=M=>({label:M.name,value:M.id,selected:p.value===M.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:M,id:M.id,color:M.color}),C=q(()=>{const M=new Set;return o.id&&M.add(String(o.id)),o.ids&&o.ids.forEach(O=>{O&&M.add(String(O))}),Array.from(M)}),S=_n("bulkUpdate",!1),{apiServices:b}=ts(!S,o),w=Wm(),{selectionStatus:D}=Qs(w),R=_n("filterParams",null),T=async(M=s.INITIAL_PAGE,O="",W=!1)=>{var X,J,ie,ae;if(!g.value){console.error("Missing required props",o);return}W?l.value=!0:a.value=!0,c.value=null;try{const ee={workspaceId:String(o.workspaceId),itemIds:C.value,page:M,perPage:s.PER_PAGE,name_like:O.trim(),...R||{}};if(((X=b.value)==null?void 0:X.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const V=await((J=b.value)==null?void 0:J.getAssignableStatus(ee));if(!(V!=null&&V.data)){W||(i.value=[]),d.value=!1;return}const G=V.data.map(v);i.value=W?[...i.value,...G]:G,h.value=((ie=V.meta)==null?void 0:ie.total)??V.data.length,d.value=!((ae=V.meta)!=null&&ae.on_last_page),u.value=M}catch(ee){console.error("Error fetching statuses:",ee),c.value="Failed to load statuses",W||(i.value=[]),d.value=!1,r("error",c.value)}finally{a.value=!1,l.value=!1}},I=Tr(async M=>{f.value=M,u.value=s.INITIAL_PAGE,await T(s.INITIAL_PAGE,M,!1)},ai),x=async()=>{!d.value||l.value||await T(u.value+1,f.value,!0)},F=()=>{var M;r("cancel"),(M=o.params)==null||M.api.stopEditing()},E=async M=>{var O,W,X;if(!g.value){console.error("Missing required props for updating status",o);return}try{const J={workspaceId:String(o.workspaceId),itemIds:C.value,statusId:String(M.value),entityId:String(o.entityId),filterParams:R!=null&&R.value?R==null?void 0:R.value:void 0};if(D.value==At.CHECKED&&S&&(J.itemIds=void 0,J.entityId=String(o.entityId)),r("start-update"),!await b.value.updateItemStatus(J))throw new Error("Status update failed: empty response");const ae={workspaceId:String(o.workspaceId),itemIds:C.value,data:{id:M.id,name:M.label,color:M.color}};r("updated",ae),o.params&&((W=o.params)==null||W.node.setData({...(O=o.params)==null?void 0:O.node.data,status:{id:M.id,name:M.label,color:M.color}}),(X=o.params)==null||X.api.stopEditing()),r("finish-update")}catch(J){console.error("Error updating status:",J),c.value="Failed to update status",r("error",c.value)}},A=q(()=>i.value.map(M=>({...M})));et([()=>o.id,()=>o.workspaceId,()=>o.ids],()=>{T()},{deep:!0,immediate:!0});const k=B(null);return rn(()=>{vt(()=>{var M;(M=k.value)==null||M.focus()})}),t({refresh:()=>T(s.INITIAL_PAGE,f.value,!1),loadMore:x,focus:()=>{var M;return(M=k.value)==null?void 0:M.focus()}}),(M,O)=>{var W;return z(),je(Qi,Kt({ref_key:"popupRef",ref:k},o,{"selected-id":(W=o.value)==null?void 0:W.id,options:A.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:c.value,onSearch:H(I),onSelect:E,onLoadMore:x,onCancel:F,onClose:F}),{item:ge(({item:X,selectedIndex:J,isSelected:ie,handleItemHover:ae,getHighlightedLabel:ee,query:V,idx:G})=>[(z(),je(Mk,{key:X.value,status:X.data,selected:ie(X),onMouseover:te=>ae(G),onSelect:te=>E(X),hovered:G===J},{label:ge(()=>[V?(z(),ce("span",{key:0,class:Q([M.$style["item-label"],M.$style.match]),style:{flex:"1"},innerHTML:ee(X.label)},null,10,qX)):(z(),ce("span",{key:1,class:Q(M.$style["item-label"]),style:{flex:"1"}},Ct(X.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"}}]]),YX=ot({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e,s=q(()=>{const f=es();return f==null?void 0:f.appContext.config.globalProperties.apiServices}),o=t,r=B(!1),i=B(null),a=f=>{r.value=!1,o("updated",f)},l=q(()=>({apiServices:s.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId}));Xr("bulkUpdate",!0);const c=f=>{var p,g;r.value=!1,f?(o("update-completed"),(p=i.value)==null||p.destroy()):(o("update-failed"),(g=i.value)==null||g.open())},u=B(null),d=(f,p)=>{var g;f&&((g=u.value)==null||g.focus())},h=()=>{var f;(f=i.value)==null||f.hide(),r.value=!0,o("update-start")};return et(()=>n.ids,()=>{var f;(f=i.value)==null||f.destroy()}),(f,p)=>(z(),je(nf,{ref_key:"wrapperRef",ref:i,isUpdating:r.value,disabled:n.disabled||r.value,onOnVisibleChange:d},{trigger:ge(({hide:g,disabled:v})=>[fe(ht,{variant:n.variant,loading:r.value,disabled:v,onEscape:g},{default:ge(()=>[fe(at,{src:"Square",class:"icon"}),p[2]||(p[2]=st(" Status ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ge(({hide:g})=>[fe(Nk,Kt({disabled:r.value,ref_key:"statusRef",ref:u},l.value,{onUpdated:a,onCancel:g,onStartUpdate:h,onFinishUpdate:p[0]||(p[0]=v=>c(!0)),onError:p[1]||(p[1]=v=>c(!1)),callback:()=>{}}),null,16,["disabled","onCancel"])]),default:ge(()=>[p[3]||(p[3]=st(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),Lk=Et(ot({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=Wi,o=e,r=q(()=>(o==null?void 0:o.workspaceId)||""),i=q(()=>(o==null?void 0:o.entityId)||""),a=()=>{var M,O,W;return(W=(M=o.params)==null?void 0:M.api)==null?void 0:W.getCellRendererInstances({columns:["options"],rowNodes:(O=o.params)!=null&&O.node?[o.params.node]:[]})[0]},l=()=>{var O,W,X,J;const M=a();(W=(O=M==null?void 0:M.componsenExposed)==null?void 0:O.blur)==null||W.call(O),(J=(X=M==null?void 0:M.container)==null?void 0:X.parentElement)==null||J.classList.remove("ag-cell-focus")},c=()=>{var W,X,J;(X=(W=o.params)==null?void 0:W.api)==null||X.stopEditing(),l();const M=`scene-name-${o.id}`,O=document.getElementById(M);(J=O==null?void 0:O.__sceneNameEditor)==null||J.startEdit()},{apiServices:u}=ts(!0,o),d=q(()=>{var M;return{ws_code:r.value,entity_id:i.value,scene_id:o.id,axiosService:u,optionBlock:o.optionBlock,permissions:(M=o.data)==null?void 0:M.permissions}}),h=M=>{var W,X,J,ie,ae,ee;let O=(X=(W=o.params)==null?void 0:W.api)==null?void 0:X.getRowNode(String(o.id));if(O){const V={...O.data,isDeleted:M==="deleted",isArchived:M==="archived"?!0:O.data.isArchived,isLocked:M==="locked"?!0:O.data.isLocked,disabled:!1};M=="deleted"&&(V.isLocked=!1,V.disabled=!0),M=="unarchived"&&(V.isArchived=!1),(ie=(J=o.params)==null?void 0:J.api)==null||ie.redrawRows({rowNodes:[O]}),O.setData(V),(ee=(ae=o.params)==null?void 0:ae.api)==null||ee.redrawRows({rowNodes:[O]})}},f=ef(),{openSceneHub:p}=f,g=()=>{vt(()=>{var W,X,J,ie,ae,ee;const M=((X=(W=o.params)==null?void 0:W.node)==null?void 0:X.rowIndex)||0,O=((ie=(J=o.params)==null?void 0:J.column)==null?void 0:ie.getColId())||"";(ee=(ae=o.params)==null?void 0:ae.api)==null||ee.setFocusedCell(M,O)})};q(()=>{var O,W;const M=(W=(O=o.params)==null?void 0:O.api)==null?void 0:W.getRowNode(String(o.id));return M==null?void 0:M.data});const{options:v}=mY(d,h,c,p,g),C=n,S=()=>{var M,O,W,X,J,ie;console.trace("Focusing current cell for row:",o.id),(ie=(M=o.params)==null?void 0:M.api)==null||ie.setFocusedCell(((W=(O=o.params)==null?void 0:O.node)==null?void 0:W.rowIndex)||0,((J=(X=o.params)==null?void 0:X.column)==null?void 0:J.getColId())||"")},b=q(()=>{var M;return(M=o.params)==null?void 0:M.api}),w=(M,O)=>{var W,X,J,ie,ae,ee,V,G;if(C("actionExecuted",M),M.id=="copy-link"){(ae=b.value)==null||ae.startEditingCell({rowIndex:(X=(W=o.params)==null?void 0:W.node)==null?void 0:X.rowIndex,colKey:(ie=(J=o.params)==null?void 0:J.column)==null?void 0:ie.getColId()});return}else{if(M.id!=="copy-link"&&((ee=b.value)==null||ee.stopEditing()),M.id==="rename")(V=b.value)==null||V.stopEditing(),(G=b.value)==null||G.clearFocusedCell(),l();else if(M.id==="copy-link"){const te=document.getElementById(O);setTimeout(()=>{var pe,ve,re;(re=(ve=(pe=te==null?void 0:te.__vueParentComponent)==null?void 0:pe.exposed)==null?void 0:ve.focus)==null||re.call(ve)},300)}else if(["delete-rendition","delete-thumbnail"].includes(M.id)){setTimeout(()=>{S()},300);return}setTimeout(()=>{var te,pe;(pe=(te=o.params)==null?void 0:te.api)==null||pe.clearFocusedCell()},300)}},D=()=>{var M,O;(O=(M=o.params)==null?void 0:M.api)==null||O.stopEditing()},R=M=>{var O,W,X,J;return M==="archive"?!((W=(O=o.params)==null?void 0:O.data)!=null&&W.isArchived):M==="unarchive"?(J=(X=o.params)==null?void 0:X.data)==null?void 0:J.isArchived:!0},T=q(()=>v.value.map(M=>({...M,options:M.options.filter(O=>!O.hide&&R(O.id))})).filter(M=>M.options.length>0)),I=B({}),x=B(null),F=q(()=>{var O,W;if(o.focusableIndex)return o.focusableIndex;const M=(W=(O=o.params)==null?void 0:O.api)==null?void 0:W.getRowNode(String(o.id));return`${((M==null?void 0:M.rowIndex)??0)+10}`}),E=(M,O)=>`${F.value}.${M*10+O}`,A=(M,O)=>{if(O&&"focus"in O){I.value[M]=O;return}delete I.value[M]},k=M=>{M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation()};return rn(()=>{var M;(M=x.value)==null||M.focus()}),t({focus(){var W;const M=`${F.value}.0`,O=I.value[M];O&&O.focus?O.focus():(W=x.value)==null||W.focus()}}),(M,O)=>Ke((z(),ce("div",{onKeydown:k,class:Q([M.$style["more-option-section"],{[M.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:x,tabindex:"0",role:"menu"},[(z(!0),ce(xt,null,xn(T.value,(W,X)=>(z(),ce("div",{key:W.id,style:hn({"--g-number":Math.min(W.options.length,4),"--g-size":W.type==="column"?"36px":"auto"}),class:Q([M.$style["option-block"],M.$style[W.type]])},[(z(!0),ce(xt,null,xn(W.options,(J,ie)=>(z(),ce("div",{key:J.id,class:Q(M.$style["option-item"])},[fe(XX,{layer:o.layer,"scene-id":String(o.id),option:J,type:W.type,onActionExecuted:ae=>w(ae,`more-action-${ae.id}-${o.id}`),focusableIndex:E(X,ie),ref_for:!0,ref:ae=>A(E(X,ie),ae),onHandleHide:D,id:`more-action-${J.id}-${o.id}`,label:J.label},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id","label"])],2))),128))],6))),128))],34)),[[H(s),F.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"}}]]),ZX={key:0,style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center"}},XX=Et(ot({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const s=Wi,o=qt,r=e,i=B(!1),a=B(!1),l=(I,x)=>{if(!x){p();return}const F=x.target;F.closest(".tippy-content")||F.closest(".tippy-box")||F.closest("[data-tippy-root]")||F.closest(".option-item")||p()},c=B(null),{triggerRef:u,popupRef:d,show:h,isVisible:f,hide:p}=Es({toggleOnClick:!0,interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:l,appendTo:c.value||void 0}),g=n,v=async I=>{var x,F;if(!a.value){a.value=!0;try{await((F=(x=r.option).action)==null?void 0:F.call(x,I)),g("actionExecuted",r.option)}catch(E){console.error("Action execution failed:",E)}finally{a.value=!1,i.value=!1}}},C=async I=>{var x,F;if(I.preventDefault(),I.stopPropagation(),!a.value){if(r.option.isDanger){i.value=!i.value;return}if(r.option.subMenu)h();else{a.value=!0;try{await((F=(x=r.option).action)==null?void 0:F.call(x,I)),g("actionExecuted",r.option)}catch(E){console.error("Action execution failed:",E)}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",D=I=>{const x=r.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...x],column:["menu-item",...x],block:["secondary",...x]}[I]||[]},R=()=>{i.value?i.value=!1:f.value?p():g("handleHide")};t({focus:()=>{vt(()=>{u.value instanceof HTMLElement?u.value.focus():u.value&&"$el"in u.value?u.value.$el.focus():console.warn("Trigger ref is not an HTMLElement:",u.value)})},escape:()=>{p()},select:()=>{C(new MouseEvent("click"))}});const T=I=>{var x;I.stopPropagation(),I.preventDefault(),i.value=!1,(x=u.value)==null||x.focus()};return(I,x)=>{var F;return Ke((z(),ce("div",{ref_key:"wrapperRef",ref:c,class:Q(I.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:Pt(C,["stop","prevent"])},[Ke((z(),je(ht,{ref_key:"triggerRef",ref:u,class:Q(I.$style["option-item"]),disabled:e.option.disabled||a.value,actived:H(f)||i.value,size:w(e.type),variant:D(e.type),onClick:Pt(C,["stop","prevent"]),onKeydown:b,onEscape:R,label:e.option.label},{prefix:ge(()=>[e.option.icon?(z(),ce("div",ZX,[fe(at,{size:"14",src:e.option.icon,color:e.option.isDanger?void 0:"#a6a6a6",source:"remote"},null,8,["src","color"])])):Xe("",!0)]),suffix:ge(()=>[e.option.subMenu?(z(),je(at,{key:0,src:"Play",source:"remote"})):Xe("",!0),e.option.isDanger&&i.value?(z(),ce("div",{key:1,class:Q(I.$style["confirm-action"])},[Ke((z(),je(ht,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:T},{default:ge(()=>[fe(at,{src:"XMarkSolid",source:"remote"})]),_:1})),[[H(s),`${r.focusableIndex}.0`],[H(o),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((z(),je(ht,{variant:["danger","primary","icon"],size:"small",onClick:Pt(v,["stop","prevent"]),onEscape:x[0]||(x[0]=E=>i.value=!1)},{default:ge(()=>[fe(at,{src:"Check",source:"remote"})]),_:1})),[[H(s),`${r.focusableIndex}.1`],[H(o),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Xe("",!0)]),_:1},8,["class","disabled","actived","size","variant","label"])),[[H(s),r.focusableIndex]]),e.option.subMenu?(z(),ce("div",{key:0,ref_key:"popupRef",ref:d,class:Q(I.$style["submenu-container"])},[fe(Lk,{focusableIndex:r.focusableIndex,layer:r.layer+1,ref:"submenuRef","option-block":[((F=e.option)==null?void 0:F.subMenu)||[]],"is-submenu":!1,onActionExecuted:S},null,8,["focusableIndex","layer","option-block"])],2)):Xe("",!0)],2)),[[H(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"}}]]),JX={style:{"max-width":"225px","line-height":"14px"}},QX={style:{"max-width":"100px","line-height":"14px"}},eJ=Et(ot({__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=qt,s=Wi,o=e,r=t,i=Wm(),{handelSelectAll:a}=i,{selectionStatus:l}=Qs(i),c=q(()=>l.value===At.CHECKED),u=q(()=>o.selectRowData.map(ve=>ve.id)),d=q(()=>o.selectRowData.length>0);Xr("bulkUpdate",d),Xr("isSelectAll",c);const h=({itemIds:ve,data:re})=>{const oe=o.gridApi;ve.forEach(K=>{if(!oe){console.error("Grid API is undefined");return}const me=oe.getRowNode(K);if(me){const se={...me.data,status:re};me.setData(se)}})},f=q(()=>o.selectRowData),p=({itemIds:ve,data:re})=>{const oe=o.gridApi;if(!oe){console.error("Grid API is undefined");return}ve.forEach(K=>{const me=oe.getRowNode(K);if(me){const se=me.data.dateRange||[null,null];"startDate"in re&&re.startDate!==void 0&&(se[0]=re.startDate?new Date(re.startDate):null),"dueDate"in re&&re.dueDate!==void 0&&(se[1]=re.dueDate?new Date(re.dueDate):null);const Se={...me.data,dateRange:se};me.setData(Se)}}),r("updated")},g=q(()=>o.selectRowData.map(ve=>ve.id)),v=ve=>{const re=o.gridApi,{id:oe,value:K}=ve;if(!re){console.error("Grid API is undefined");return}g.value.forEach(me=>{const se=re.getRowNode(me);if(se){const Se={...se.data,[`metric_${oe}`]:K};se.setData(Se)}}),r("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=()=>{r("unselect")},w=Yb(),{userPermissions:D}=Qs(w),R=q(()=>D.value.includes(Zb)),T=q(()=>{if(!R.value){console.error("User does not have permission to open review.");return}if(l.value==At.CHECKED)return Xs({type:"review_take",config:{reviewDomain:un.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,take_id:o.entityId}}).url;const ve=o.selectRowData.map(oe=>oe.id).join(",");return Xs({type:"review_multiple_scenes",config:{reviewDomain:un.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,scene_ids:ve}}).url}),I=ve=>{const{assignees:re,type:oe}=ve,K=o.gridApi;if(!K){console.error("Grid API is not available for bulk update.");return}o.selectRowData.map(se=>{const Se=K.getRowNode(se.id);if(!Se)return null;const U=Se.data.assignees||[];let Z=[];switch(oe){case"add":{const de=new Set(U.map(Fe=>Fe.id)),Ae=re.filter(Fe=>!de.has(Fe.id));Z=[...U,...Ae];break}case"overwrite":{Z=re;break}case"remove":{const de=new Set(re.map(Ae=>Ae.id));Z=U.filter(Ae=>!de.has(Ae.id));break}case"removeAll":{Z=[];break}}return{...Se.data,assignees:Z}}).filter(se=>se!==null).forEach(se=>{const Se=K.getRowNode(se.id);Se&&Se.setData(se)})},{apiServices:x}=ts(!1,o),F=async()=>{var K;const ve=o.selectRowData.map(me=>me.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk delete.");return}const oe=await((K=x.value)==null?void 0:K.bulkDeleteItems(M.value));(oe==null?void 0:oe.message)=="Done"&&(ve.forEach(me=>{const se=re.getRowNode(me);if(se){const Se={...se.data,isDeleted:!0,disabled:!0};se.setData(Se)}}),re.deselectAll())},E=B(null),A=async()=>{var K,me,se;const ve=o.selectRowData.map(Se=>Se.id);if(!o.gridApi){console.error("Grid API is not available for bulk unarchive.");return}const oe=await((K=x.value)==null?void 0:K.bulkUnarchiveItems(M.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to unarchive items."),(me=E.value)==null||me.open();return}W(ve,"isArchived",!1),(se=E.value)==null||se.hide()},k=_n("filterParams",void 0),M=q(()=>({workspaceId:String(o.workspaceId),itemIds:d.value&&c.value?[]:o.selectRowData.map(ve=>ve.id),entityId:o.entityId,filterParams:k!=null&&k.value?k.value:void 0})),O=async()=>{var K,me,se;const ve=o.selectRowData.map(Se=>Se.id);if(!o.gridApi){console.error("Grid API is not available for bulk archive.");return}const oe=await((K=x.value)==null?void 0:K.bulkArchiveItems(M.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to archive items."),(me=E.value)==null||me.open();return}W(ve,"isArchived",!0),(se=E.value)==null||se.hide()},W=(ve,re,oe)=>{const K=o.gridApi;if(!K){console.error("Grid API is not available for bulk update.");return}const me=ve.map(se=>{const Se=K.getRowNode(se);if(Se){const U={...Se.data,[re]:oe};Se.setData(U)}return Se}).filter(se=>se!=null);K.redrawRows({rowNodes:me})},X=async()=>{var K,me,se;const ve=o.selectRowData.map(Se=>Se.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk thumbnail deletion.");return}const oe=await((K=x.value)==null?void 0:K.deleteThumbnail(M.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to delete thumbnails."),(me=E.value)==null||me.open();return}ve.forEach(Se=>{const U=re.getRowNode(Se);if(U){const Z={...U.data,thumbnail:null};U.setData(Z)}}),(se=E.value)==null||se.hide()},J=async()=>{var K,me,se;const ve=o.selectRowData.map(Se=>Se.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk rendition deletion.");return}const oe=await((K=x.value)==null?void 0:K.deleteRendition(M.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to delete renditions."),(me=E.value)==null||me.open();return}ve.forEach(Se=>{const U=re.getRowNode(Se);if(U){const Z={...U.data,rendition:null};U.setData(Z)}}),(se=E.value)==null||se.hide()},ie=B(!1),ae=B(null),ee=async ve=>{var re,oe;try{switch(G.value=!0,ie.value=!0,ve.id){case"unarchive":await A();break;case"delete":await F();break;case"archive":await O();break;case"delete-thumbnail":await X();break;case"delete-rendition":await J();break;default:console.error("Unknown action:",ve.id),ie.value=!1;break}}catch(K){console.error("Error performing action:",K),(re=E.value)==null||re.open()}finally{(oe=ae.value)==null||oe.focus(),vt(()=>{G.value=!1,ie.value=!1})}},V=(ve,re)=>{var oe;!ve&&re&&((oe=ae.value)==null||oe.focus())},G=B(!0),te=ve=>{vt(()=>{G.value=ve})};et(()=>o.selectRowData,ve=>{G.value=!1},{deep:!0,immediate:!0});const pe=q(()=>({workspaceId:o.workspaceId,entityId:o.entityId,variant:C,disabled:G.value,ids:u.value}));return(ve,re)=>Ke((z(),ce("div",{class:Q(ve.$style["bulk-update-action"])},[be("div",{class:Q(ve.$style["left-actions"])},[be("div",{class:Q(ve.$style["selection-track"])},[fe(ht,{class:Q(ve.$style["btn-close"]),variant:["tertiary","icon"],onClick:b,style:{background:"transparent"}},{prefix:ge(()=>[fe(at,{src:"XMarkSolid",source:"remote"})]),_:1},8,["class"]),H(l)==H(At).INDETERMINATE?(z(),ce("span",{key:0,class:Q(ve.$style["selected-count"])},Ct(e.selectRowData.length)+" selected ",3)):Xe("",!0),H(l)==H(At).CHECKED?(z(),ce("span",{key:1,class:Q(ve.$style["selected-count"]),style:{"line-height":"14px"}},[re[12]||(re[12]=st(' All in " ',-1)),Ke((z(),ce("span",JX,[st(Ct(e.takeName),1)])),[[H(n),{content:e.takeName}]]),re[13]||(re[13]=st(' " ',-1))],2)):Xe("",!0),!e.loading&&H(l)==H(At).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(z(),je(ht,{key:2,variant:"secondary",onHandleClick:H(a)},{default:ge(()=>[be("span",{class:Q(ve.$style["selected-count"]),style:{"line-height":"14px"}},[re[14]||(re[14]=st(' Select all in " ',-1)),Ke((z(),ce("span",QX,[st(Ct(e.takeName),1)])),[[H(n),{content:e.takeName}]]),re[15]||(re[15]=st(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Xe("",!0),be("span",{class:Q(ve.$style.divider)},null,2)],2),fe(YX,Kt(pe.value,{onUpdated:h,onUpdateStart:re[0]||(re[0]=oe=>G.value=!0),onUpdateCompleted:re[1]||(re[1]=oe=>te(!1)),onUpdateFailed:re[2]||(re[2]=oe=>te(!1)),"selected-all":H(l)==H(At).CHECKED}),null,16,["selected-all"]),fe($Y,Kt({onUpdate:I,onUpdateStart:re[3]||(re[3]=oe=>G.value=!0),onUpdateCompleted:re[4]||(re[4]=oe=>te(!1)),onUpdateFailed:re[5]||(re[5]=oe=>te(!1)),"selected-all":H(l)==H(At).CHECKED},pe.value),null,16,["selected-all"]),fe(QY,Kt({"row-selected":f.value,"selected-all":H(l)==H(At).CHECKED},pe.value,{onUpdated:p,onUpdateStart:re[6]||(re[6]=oe=>G.value=!0),onUpdateCompleted:re[7]||(re[7]=oe=>te(!1)),onUpdateFailed:re[8]||(re[8]=oe=>te(!1))}),null,16,["row-selected","selected-all"]),fe(jX,{disabled:G.value,onUpdate:v,onUpdateStart:re[9]||(re[9]=oe=>G.value=!0),onUpdateCompleted:re[10]||(re[10]=oe=>te(!1)),onUpdateFailed:re[11]||(re[11]=oe=>te(!1)),selectedIds:u.value,"workspace-id":e.workspaceId,variant:C,"entity-id":e.entityId,"selected-all":H(l)==H(At).CHECKED},null,8,["disabled","selectedIds","workspace-id","entity-id","selected-all"]),be("span",{class:Q(ve.$style.divider)},null,2),Ke((z(),ce("div",null,[R.value?(z(),je(ht,{key:0,class:Q(ve.$style["action-button"]),variant:[...C,"icon"],href:T.value,disabled:o.selectRowData.length>40&&H(l)!=H(At).CHECKED},{default:ge(()=>[fe(at,{src:"PenRuler",class:Q(ve.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","href","disabled"])):Xe("",!0)])),[[H(n),o.selectRowData.length<=40||H(l)==H(At).CHECKED?"Open in Review":"Select fewer than 40 items to open in Review"]]),be("span",{class:Q(ve.$style.divider)},null,2),fe(nf,{ref_key:"wrapperRef",ref:E,isUpdating:G.value,disabled:G.value,onOnVisibleChange:V},{trigger:ge(({hide:oe,toggle:K,isVisible:me,disabled:se})=>[Ke((z(),je(ht,{onEscape:oe,actived:me,ref_key:"moreActionRef",ref:ae,class:Q(ve.$style["action-button"]),variant:["secondary","icon"],loading:ie.value,disabled:se||G.value,onClick:Pt(K,["stop"])},{default:ge(()=>[fe(at,{src:"EllipsisVertical",class:Q(ve.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","loading","disabled","onClick"])),[[H(s),"99999"],[H(n),{content:"More actions"}]])]),popup:ge(({isVisible:oe,hide:K})=>[(z(),ce(xt,null,xn(S,(me,se)=>fe(ec,Kt({clickable:!0,key:me.id},{ref_for:!0},me,{show:oe,style:{borderLeft:0},"focus-index":"99999."+se,onClick:()=>{ee(me)},onEscape:K}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1},8,["isUpdating","disabled"])],2)],2)),[[Ko,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_1m5lx_1","left-actions":"_left-actions_1m5lx_19","right-actions":"_right-actions_1m5lx_20","selection-track":"_selection-track_1m5lx_25","btn-close":"_btn-close_1m5lx_31","close-icon":"_close-icon_1m5lx_37","selected-count":"_selected-count_1m5lx_41",divider:"_divider_1m5lx_47","more-button":"_more-button_1m5lx_52",dropdown:"_dropdown_1m5lx_56","dropdown-content":"_dropdown-content_1m5lx_59",delete:"_delete_1m5lx_82","icon-btn":"_icon-btn_1m5lx_89","selected-list":"_selected-list_1m5lx_93"}}]]),za=Et(ot({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=qt,s=e,o=q(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:s.value===void 0||s.value===null||s.value==="",clickable:!0})),{argsMain:r}=ys(o),i=q(()=>{var c,u,d;return!!((c=s.params)!=null&&c.api||(u=s.params)!=null&&u.node||(d=s.params)!=null&&d.context)}),a=q(()=>{if(s.tooltip){if(typeof s.tooltip=="string")return{content:s.tooltip};if(typeof s.tooltip=="object"&&"display_name"in s.tooltip){const c=s.tooltip,u=document.createElement("div");u.classList.add("tooltip-user-info"),u.style.display="flex",u.style.alignItems="center",u.style.gap="4px";const d=document.createElement("div"),h=fe(Th,{id:c.id,name:c.display_name,profile_image:c.profile_image,size:20,initial:c.initial,color:c.color});zw(h,d);const f=document.createElement("span");f.innerText=c.display_name,f.classList.add("tooltip-user-name");const p=document.createElement("span");p.style.whiteSpace="nowrap",p.innerText="By",u.appendChild(p),u.appendChild(d),u.appendChild(f);const g=document.getElementById("item-table-layout-id");return{content:u,allowHtml:!0,appendTo:g||document.body,bypassOverflowCheck:!0}}}return{content:void 0}}),l=q(()=>s.value===void 0);return(c,u)=>Ke((z(),je(ws,Kt(H(r),{ref:"displayWrapperRef"}),{default:ge(()=>[be("span",{class:Q(c.$style["item-table-label-renderer"])},Ct(s.value||"-"),3)]),_:1},16)),[[H(t),{isLoading:l.value||!i.value}],[H(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),tJ=["placeholder","maxlength"],nJ={key:0,class:"wrapper-suffix"},sJ=Et(ot({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=qt,r=e,i=n,a=B(r.value),l=B(null),c=B(null),u=B(r.value||""),d=B(!1),h=B(!1),f=q(()=>{var E;return{disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((E=r.value)==null?void 0:E.length)===0,inputRef:l,wrapperRef:c,clickable:!0,focused:d.value||r.keyboardFocusing}}),{argsMain:p,isHover:g}=ys(f),v=()=>u.value!==a.value,C=()=>{h.value=!0,d.value=!1,u.value=a.value,i("update:value",a.value),setTimeout(()=>{h.value=!1},100)},S=()=>{if(!d.value||!l.value)return;const E=l.value.value;if(!v()){d.value=!1;return}a.value=E,i("update:value",E),i("enter",E),d.value=!1},b=()=>{h.value||(r.saveOnBlur?S():C(),i("blur",u.value))},w=E=>{var A;if(E.key==="ArrowLeft"||E.key==="ArrowRight"){E.stopPropagation();return}E.ctrlKey&&(E.key=="a"||E.key=="A")?(E.stopPropagation(),(A=l.value)==null||A.select()):E.key==="Enter"?(E.preventDefault(),E.stopPropagation(),S()):E.key==="Escape"&&(E.preventDefault(),E.stopPropagation(),C())},D=()=>{a.value=r.value,u.value=r.value,d.value=!0,vt(()=>{var E,A;(E=l.value)==null||E.click(),(A=l.value)==null||A.focus()})},R=()=>{var E;d.value?C():(E=l.value)==null||E.blur(),i("blur",u.value)},T={focus:()=>{D()}};rn(()=>{var A;const E=(A=c.value)==null?void 0:A.$el;E&&(E.__sceneNameEditor=T)}),ms(()=>{const E=c.value;E&&delete E.__sceneNameEditor});const I=B(null),x=B(null);t({focus:D,blur:()=>{var E;return(E=l.value)==null?void 0:E.blur()},save:S,cancel:C,focusEditButton:()=>{vt(()=>{var E;(E=I.value)==null||E.focus()})},focusCancelButton:()=>{vt(()=>{var E;(E=x.value)==null||E.focus()})},startEdit:D});const F=q(()=>r.value===void 0);return Qb(c,()=>{d.value&&b()}),(E,A)=>Ke((z(),je(H(ws),Kt(H(p),{ref_key:"wrapperRef",ref:c,bordered:r.bordered,style:{paddingTop:"0px",paddingBottom:"0px"}}),nh({default:ge(()=>[d.value?Xe("",!0):Tt(E.$slots,"default",{key:0,isEditting:d.value,isHover:H(g)},()=>[Ke((z(),ce("span",{class:Q(E.$style["label-renderer"])},[st(Ct(u.value),1)],2)),[[H(o),{content:u.value||void 0}]])]),Ke(be("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":A[0]||(A[0]=k=>u.value=k),class:Q(E.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:w,onBlur:b},null,42,tJ),[[Ko,d.value],[yT,u.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:ge(({hovered:k,focused:M})=>[k?(z(),ce("div",nJ,[k&&!M?Ke((z(),je(ht,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(D,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:I,onKeydown:[zn(Pt(D,["prevent","stop"]),["enter"]),zn(Pt(R,["prevent","stop"]),["escape"])]},{default:ge(()=>[fe(H(at),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[H(o),"Edit"]]):Xe("",!0)])):Xe("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[H(s),{isLoading:F.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),oJ=["tabindex"],Vk=Et(ot({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=qt,o=To,r=e,i=n,a=B(r.value),l=B(r.value),c=B(null),u=B(null),d=_n("bulkUpdate",!1),{apiServices:h}=ts(!d,r),f=q(()=>{var ae;return{componentType:void 0,disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((ae=a==null?void 0:a.value)==null?void 0:ae.length)===0,inputRef:c,wrapperRef:u,clickable:!0}}),{isFocus:p}=ys(f),g=q(()=>{const ae=un.getInstance().getItem("ws.code"),ee=un.getInstance().getItem("BASE_URL"),V=ae||r.workspaceId;return Xs({type:"scene_hub",config:{baseDomain:ee,ws_code:V,scene_id:String(r.id)}}).url}),v=q(()=>{var ae,ee,V;return((ee=(ae=r.data)==null?void 0:ae.isProcessing)==null?void 0:ee.state)==0||((V=r.data)==null?void 0:V.isDeleted)==!0}),C=q(()=>r.readOnly||R.value),S=q(()=>{var ae,ee,V,G,te;return((ae=r.data)==null?void 0:ae.isDeleted)==!0||((V=(ee=r.data)==null?void 0:ee.isProcessing)==null?void 0:V.state)==0||((te=(G=r.data)==null?void 0:G.isProcessing)==null?void 0:te.state)==1}),b=q(()=>{var ae,ee;return(ee=(ae=r.data)==null?void 0:ae.isProcessing)==null?void 0:ee.message}),w=q(()=>{var ae;return((ae=r.data)==null?void 0:ae.isArchived)==1}),D=q(()=>{var ae;return((ae=r.data)==null?void 0:ae.isLocked)==1}),R=q(()=>r.value===void 0),T=q(()=>{var ae,ee;return((ee=(ae=r.data)==null?void 0:ae.permissions)==null?void 0:ee.has_edit_permission)==1}),I=async ae=>{var ee,V,G,te,pe,ve,re,oe,K,me;a.value=ae,p.value=!1;try{const se=await((V=(ee=h.value)==null?void 0:ee.updateSceneName)==null?void 0:V.call(ee,{workspaceId:r.workspaceId,entityId:r.entityId,itemId:r.id,name:a.value})),Se=PF.get(EF)||"UTC";if(se){const U=TF(se,Se),Z={...r.data,...U};(G=r.params)==null||G.api.clearFocusedCell();const de=((pe=(te=r.params)==null?void 0:te.column)==null?void 0:pe.getColId())||"",Ae=((re=(ve=r.params)==null?void 0:ve.node)==null?void 0:re.rowIndex)||0;(oe=r.params)==null||oe.api.setFocusedCell(Ae,de),(me=(K=r.params)==null?void 0:K.node)==null||me.setData(Z),l.value=a.value,i("enter")}else a.value=l.value}catch(se){console.error("Failed to update scene name:",se),a.value=l.value}},x={focus:()=>{p.value=!0,vt(()=>{var ae;return(ae=u.value)==null?void 0:ae.focus()})},startEdit:()=>{var ae;(ae=u.value)==null||ae.startEdit()}},F=()=>u.value?"$el"in u.value?u.value.$el:u.value:null;et(()=>r.value,ae=>{a.value=ae,l.value=ae}),rn(()=>{const ae=F();ae&&(ae.__sceneNameEditor=x)}),ms(()=>{const ae=u.value,ee=ae&&"$el"in ae?ae.$el:ae;ee&&delete ee.__sceneNameEditor});const E=ef(),{openSceneHub:A}=E,k=ae=>{try{if(ae.ctrlKey||ae.metaKey){window.open(g.value,"_blank");return}A(String(r.id))}catch{window.open(g.value,"_blank")}finally{J()}},M=()=>{setTimeout(()=>{ie.value=!0,O.value=0,vt(()=>{var ae;(ae=W.value)==null||ae.focus()})},300)},O=B(-1),W=B(null);t({focus:M,trigerFocus:M,startEdit:()=>{var ae;(ae=u.value)==null||ae.startEdit()}});const X=ae=>{if(ae.key==="Enter"){ae.preventDefault(),k(ae);return}if(ae.key==="Escape"){ae.preventDefault(),J();return}ae.key==="Tab"&&(ae.preventDefault(),ae.stopPropagation(),ae.stopImmediatePropagation(),vt(()=>{var ee;(ee=u.value)==null||ee.focusEditButton()}))},J=()=>{var V,G,te,pe,ve,re;ie.value=!1,O.value=-1,(V=r.params)==null||V.api.clearFocusedCell();const ae=((te=(G=r.params)==null?void 0:G.column)==null?void 0:te.getColId())||"",ee=((ve=(pe=r.params)==null?void 0:pe.node)==null?void 0:ve.rowIndex)||0;(re=r.params)==null||re.api.setFocusedCell(ee,ae)},ie=B(!1);return(ae,ee)=>Ke((z(),je(sJ,{"save-on-blur":!0,ref_key:"wrapperRef",ref:u,disabled:r.disabled,"read-only":C.value,placeholder:r.placeholder,value:a.value,"onUpdate:value":ee[0]||(ee[0]=V=>a.value=V),id:`scene-name-${r.id}`,onEnter:I,"max-length":255,bordered:!0,keyboardFocusing:ie.value,onBlur:J},{default:ge(({isHover:V,isEditting:G})=>[Ke(be("div",{class:Q(ae.$style["scene-name-display"])},[Ke((z(),ce("a",{tabindex:O.value,ref_key:"nameRef",ref:W,onClick:Pt(k,["prevent"]),onKeydown:X,target:"_blank",class:Q(ae.$style["scene-name-text"]),style:{lineHeight:"28px"}},[st(Ct(a.value),1)],42,oJ)),[[H(s),{content:a.value,delay:[1e3,0]}]]),C.value||!V&&!G&&!C.value?(z(),ce(xt,{key:0},[D.value?Ke((z(),ce("div",{key:0,class:Q([ae.$style["icon-processing"],ae.$style.isLocked])},[fe(at,{src:"Lock",color:T.value?"#a6a6a6":"#232323"},null,8,["color"])],2)),[[H(s),{content:T.value?"Locked — You can still edit, or unlock by changing the status from completed":"Locked",delay:[1e3,0]}]]):Xe("",!0),w.value?Ke((z(),ce("div",{key:1,class:Q([ae.$style["icon-processing"],ae.$style.archived])},[fe(at,{src:"BoxArchive"})],2)),[[H(s),{content:"Archived",delay:[1e3,0]}]]):Xe("",!0),S.value?Ke((z(),ce("div",{key:2,class:Q([ae.$style["icon-processing"],ae.$style.processing,v.value&&ae.$style["icon-red"]])},[fe(at,{src:"AnimatedHourglass",color:"inherit"})],2)),[[H(s),b.value]]):Xe("",!0)],64)):Xe("",!0)],2),[[Ko,!H(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[H(o),{isLoading:R.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_nare0_1","scene-name-display":"_scene-name-display_nare0_11","icon-processing":"_icon-processing_nare0_18",archived:"_archived_nare0_28",locked:"_locked_nare0_31",processing:"_processing_nare0_34","icon-red":"_icon-red_nare0_38","scene-name-text":"_scene-name-text_nare0_43"}}]]),pS=Et(ot({__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=Wi,o=B([]),r=e,i=B(null),a=q(()=>typeof r.size=="number"?`${r.size}px`:{small:"24px",medium:"32px",large:"48px"}[r.size]??"32px"),l=q(()=>{let C=[];return typeof r.variant=="string"?C.push(r.variant):Array.isArray(r.variant)&&(C=[...r.variant]),[...C,"icon"]}),c=n,{hide:u,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=Es({toggleOnClick:!0,offset:[0,0]});function v(C){c("select",C),u()}return th(()=>{g.value&&g.value.setProps({placement:r.placement})}),t({show:h,hide:u,hideDropdown:()=>{u()},popupRef:p}),et(d,C=>{var S;C&&((S=p.value)==null||S.focus())}),(C,S)=>(z(),ce("div",{class:Q(C.$style["button-dropdown-wrapper"]),style:hn({"--button-size":a.value})},[be("div",{class:Q(C.$style["button-group"])},[Tt(C.$slots,"prefix"),be("div",{ref_key:"triggerRef",ref:f,class:Q(H(d)?C.$style.open:"")},[Tt(C.$slots,"triggerDropdown",{open:H(d)},()=>[r.readOnly?Xe("",!0):Ke((z(),je(ht,{key:0,onEscape:H(u),ref_key:"mainButton",ref:i,actived:H(d),class:Q(C.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:r.disabled},{default:ge(()=>[Tt(C.$slots,"iconDropdown",{},()=>[fe(at,{class:Q(C.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[H(s),e.tabIndex]])])],2)],2),be("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:Q(C.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(z(!0),ce(xt,null,xn(e.options,(b,w)=>Ke((z(),je(ec,Kt({ref_for:!0,ref:D=>o.value[w]=D,key:b.value},{ref_for:!0},{...b},{"icon-name":b.icon,onClick:Pt(D=>v(b.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:ge(()=>[st(Ct(b.label),1)]),_:2},1040,["icon-name","onClick"])),[[H(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"}}]]),hf=Et(ot({__name:"CloseBadgeWrapper",props:{disableRemove:{type:Boolean,default:!0},tooltip:{default:"Unassign"}},emits:["clear"],setup(e,{emit:t}){const n=qt,s=e,o=t,r=a=>{a.preventDefault(),a.stopImmediatePropagation(),a.stopPropagation(),o("clear")},i=q(()=>({content:s.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(z(),ce("div",{class:Q(a.$style["close-wrapper"])},[e.disableRemove?Xe("",!0):(z(),ce("div",{key:0,class:Q(a.$style["close-button"])},[Ke((z(),je(ht,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:r,size:16,rounded:!0},{default:ge(()=>[fe(at,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[H(n),i.value]])],2)),Tt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_15u1e_1","close-button":"_close-button_15u1e_5"}}]]),rJ=Et(ot({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=qt,n=To,s=e,{isEditing:o}=Fu(s),r=B(s.value),i=B(null),a=B(null),{apiServices:l}=ts(!0,s),c=B(!0),u=()=>{c.value=s.value===void 0};eh(()=>{u()}),rn(()=>{u()}),et(()=>s.value,I=>{u()});const d=q(()=>({disabled:s.disabled,readOnly:s.readOnly,error:s.error,inputRef:i,wrapperRef:a,clickable:!(s.readOnly||c.value),active:o})),{argsMain:h,isHover:f}=ys(d),p=q(()=>{var I;return((I=r.value)==null?void 0:I.slice(0,s.maxVisible))||[]}),g=q(()=>{var I;return Math.max(0,(((I=r.value)==null?void 0:I.length)||0)-s.maxVisible)}),v=q(()=>{var I;return g.value<=0?"":((I=r.value)==null?void 0:I.slice(s.maxVisible).map(x=>x.name).join(", "))||""}),C=q(()=>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=q(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));et(()=>s.value,I=>{r.value=I},{immediate:!0,deep:!0});const b=async I=>{var F,E,A;await T(I)&&(r.value=(F=r.value)==null?void 0:F.filter(k=>k.id!==I),(A=s.params)==null||A.node.setData({...(E=s.params)==null?void 0:E.node.data,assignees:r.value}))},w=I=>{var F;const x=un.getInstance().getItem("ws.code");return((F=l.value)==null?void 0:F.getUserInformation(x,I))||Promise.resolve(null)},{id:D}=Up(s),R=I=>{var F,E;const x=(E=(F=s.params)==null?void 0:F.api)==null?void 0:E.getRowNode(String(D.value));x==null||x.setDataValue("assignees",NI(I.assignees))},{removeAssignee:T}=mm({...s,entityId:s.entityId,updateRowData:R,value:s.value,errorCallback:()=>{}});return(I,x)=>Ke((z(),je(ws,Kt(H(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:ge(()=>{var F;return[be("div",{class:Q(I.$style.assigneeGroupRenderer)},[((F=r.value)==null?void 0:F.length)===0?(z(),je(at,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:hn(S.value)},null,8,["style"])):Xe("",!0),(z(!0),ce(xt,null,xn(C.value,E=>(z(),je(hf,{key:E.id,"disable-remove":s.readOnly||s.disabled,onClear:A=>b(E.id),style:{marginLeft:"0"}},{default:ge(()=>[fe(Au,{user:E.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((z(),ce("div",{key:1,class:Q(I.$style["extra-avatars"])},[st(" +"+Ct(g.value),1)],2)),[[H(t),v.value]]):Xe("",!0)],2)]}),_:1},16)),[[H(n),{isLoading:c.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"}}]]),iJ=Et(ot({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=qt,n=To,s=wb(),o=e,r=B(null),i=B(null),{isEditing:a}=Fu(o),l=I=>{if(I){if(typeof I=="string")return I;if(I instanceof Date)return I.toISOString()}},c=q(()=>o.value===void 0),u=q(()=>{var I;return(I=o.data)==null?void 0:I.isStarted}),d=q(()=>{var I;return(I=o.data)==null?void 0:I.isCompleted}),h=q(()=>!!(o.value&&(o.value[0]||o.value[1]))),f=q(()=>h.value?o.disabled&&!o.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=q(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,inputRef:r,wrapperRef:i,clickable:!0,active:a})),{argsMain:g}=ys(p),{startDate:v,endDate:C,startClasses:S,endClasses:b,fullStartDate:w,fullEndDate:D}=N9({start:l((R=o.value)==null?void 0:R[0]),end:l((T=o.value)==null?void 0:T[1]),isStarted:u.value,isEnded:d.value,timezone:o.timezone||s});return(I,x)=>Ke((z(),je(ws,Kt(H(g),{ref_key:"wrapperRef",ref:i,bordered:!0}),{default:ge(()=>[c.value?Xe("",!0):(z(),ce("div",{key:0,class:Q(I.$style.dateRangeRenderer)},[h.value?Xe("",!0):(z(),je(at,{key:0,src:"Calendar",class:Q(I.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(z(),ce(xt,{key:1},[Ke((z(),ce("span",{class:Q([I.$style.dateLabelDisplay,...H(S).map(F=>I.$style[F])])},[st(Ct(H(v)),1)],2)),[[H(t),H(w)]]),x[0]||(x[0]=be("span",null,"→",-1)),Ke((z(),ce("span",{class:Q([I.$style.dateLabelDisplay,...H(b).map(F=>I.$style[F])])},[st(Ct(H(C)),1)],2)),[[H(t),H(D)]])],64)):Xe("",!0)],2))]),_:1},16)),[[H(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_rsfrm_1",calendarIcon:"_calendarIcon_rsfrm_8",dateSection:"_dateSection_rsfrm_12",dateLabelDisplay:"_dateLabelDisplay_rsfrm_19",empty:"_empty_rsfrm_29","end-today":"_end-today_rsfrm_35",actual:"_actual_rsfrm_38","end-tomorrow":"_end-tomorrow_rsfrm_41","end-yesterday":"_end-yesterday_rsfrm_47","end-past":"_end-past_rsfrm_53","end-future":"_end-future_rsfrm_59","start-today":"_start-today_rsfrm_62","start-tomorrow":"_start-tomorrow_rsfrm_68","start-yesterday":"_start-yesterday_rsfrm_74","start-past":"_start-past_rsfrm_80","start-future":"_start-future_rsfrm_86"}}]]),aJ=ot({__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:wb()}},emits:["closed"],setup(e,{expose:t,emit:n}){const s=B(null);rn(()=>{vt(()=>{s.value&&s.value.focus()})});const o=e,r=n,i=()=>{var C;(C=o.params)==null||C.api.stopEditing(),r("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})},c=async()=>{await v({startDate:null})},u=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,D,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({...(D=o.params)==null?void 0:D.node.data,dateRange:T==null?void 0:T.dateRange}))}catch(T){console.error("Failed to update scene name:",T)}};return t({focus:()=>{vt(()=>{var C;(C=s.value)==null||C.focus()})}}),(C,S)=>(z(),je(Am,Kt(o,{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:u,onClearStart:c,onClosed:i,ref_key:"calendarRef",ref:s}),null,16))}}),lJ=Et(ot({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=B(null),s=B(0);let o=null;rn(()=>{n.value&&(o=new ResizeObserver(i=>{for(const a of i)s.value=a.contentRect.height}),o.observe(n.value))}),zc(()=>{o&&n.value&&o.unobserve(n.value)});const r=q(()=>{const i=s.value;return i>120?i-42-36:0});return(i,a)=>(z(),ce("div",{class:Q(i.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[be("div",{class:Q(i.$style["item-header"])},[be("div",{class:Q(i.$style["item-header__left"])},[Tt(i.$slots,"header-left",{},()=>[be("h1",{class:Q(i.$style["item-header__title"])},[Tt(i.$slots,"title",{},()=>[a[0]||(a[0]=st("Items",-1))])],2)])],2),be("div",{class:Q(i.$style["item-header__spacer"])},null,2),be("div",{class:Q(i.$style["item-header__actions"])},[Tt(i.$slots,"header-actions")],2)],2),Tt(i.$slots,"grid",{availableHeight:r.value}),be("div",{class:Q(i.$style.footer)},[Tt(i.$slots,"footer")],2),Tt(i.$slots,"new-row"),Tt(i.$slots,"bulk-update-actions"),Tt(i.$slots,"snackbar"),Tt(i.$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"}}]]),Bk=(e,t)=>{const n=B(Number(e.value.value)),s=q(()=>e.value.metricConfig),o=q(()=>{var g,v;const l=s.value,c=t.value,u=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"||u&&((g=l==null?void 0:l.metric_type)==null?void 0:g.code)==="formula",isEmpty:u,isError:d,hasPrefix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="prefix",hasSuffix:!u&&!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:c&&!u&&!f}}),r=17,i=q(()=>{var l;return{maxRating:((l=s.value)==null?void 0:l.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:r}});return{componentState:o,metricConfig:s,ICON_SIZE:r,ratingParams:i,standardNameforIcon:()=>{var c;return(((c=s.value)==null?void 0:c.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},cJ=["aria-label"],$k=Et(ot({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=qt,o=e,r=Gp(!1),i=B(null),a=B(null),{isEditing:l}=Fu(o),c=q(()=>{var O,W;return{value:o.value,metricConfig:((W=(O=o.params)==null?void 0:O.colDef)==null?void 0:W.context)||o.config,error:o.error,hovered:r.value,readOnly:o.readOnly,disabled:o.disabled,active:l}}),{componentState:u,metricConfig:d,internalValue:h}=Bk(c,r),f=q(()=>{var W,X;let O=!1;if(["number","formula"].includes(d.value.metric_type.code)){const J=Number(o.value),ie=Number((W=d.value)==null?void 0:W.format_value);Number.isFinite(ie)&&ie>=0&&(O=(((X=J.toString().split(".")[1])==null?void 0:X.length)||0)>ie)}return O}),p=q(()=>{var O;return!!((O=d.value)!=null&&O.morpheme_value)||u.value.isEmpty||f.value}),g=q(()=>{var X,J,ie;if(u.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(u.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(u.value.isEmpty)return;const O=x.value,W=(X=d.value)==null?void 0:X.morpheme_type;return W==="prefix"?`${((J=d.value)==null?void 0:J.morpheme_value)||""} ${O}`.trim():W==="suffix"?`${O} ${((ie=d.value)==null?void 0:ie.morpheme_value)||""}`.trim():O}),v=q(()=>{const{format_type:O,format_value:W}=d.value;if(O==="dropdown"&&typeof W=="string"&&W.startsWith("["))try{return JSON.parse(W)}catch{return[]}return[]}),C=q(()=>({disabled:o.disabled,error:u.value.isError,inputRef:i,wrapperRef:a,clickable:!I.value,readOnly:o.readOnly||I.value,isEmpty:u.value.isEmpty})),{argsMain:S,isHover:b}=ys(C),w=(O,W,X="en-US")=>new Intl.NumberFormat(X,{minimumFractionDigits:W,maximumFractionDigits:W}).format(O),D=q(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const O=o.value,{format_type:W,format_value:X,mapping:J}=d.value;if(J&&typeof J=="object"&&!Array.isArray(J)){const ie=J[`!${O}`];if(ie)return ie}if(W==="dropdown"){const ie=v.value.find(ae=>String(ae.name)===String(O));if(ie)return ie.name}if(typeof O=="string"){const ie=Number(O);return Number.isNaN(ie)?O:O.replace(/[.-]/g,"").length>16?R(O,X):R(ie,X)}return typeof O=="number"?R(O,X):String(O)}),R=(O,W)=>{const X=Number.parseInt(String(W)||"2",10),J=Number.isFinite(X)&&X>=0?X:2;try{if(typeof O=="string"){const ie=O.split("."),ae=ie[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ee=ie[1]?ie[1].substring(0,J).padEnd(J,"0"):"0".repeat(J);return J>0?`${ae}.${ee}`:ae}return w(O,J)}catch(ie){return console.error("Error formatting metric value:",ie,{num:O,decimals:J}),String(O)}},T=(O,W)=>{const X=Number.parseInt(String(W)||"2",10),J=Number.isFinite(X)&&X>=0?X:2;try{if(typeof O=="string"){const ie=O.split("."),ae=ie[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ee=ie[1]?ie[1].length:0,V=Math.max(J,ee),G=ie[1]?ie[1].padEnd(V,"0"):"0".repeat(V);return V>0?`${ae}.${G}`:ae}return new Intl.NumberFormat("en-US",{minimumFractionDigits:J,maximumFractionDigits:20}).format(O)}catch(ie){return console.error("Error formatting exact metric value:",ie,{num:O,decimals:J}),String(O)}},I=q(()=>{var O;return((O=d.value)==null?void 0:O.metric_type.code)==="formula"}),x=q(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const O=o.value,{format_type:W,format_value:X,mapping:J}=d.value;if(J&&typeof J=="object"&&!Array.isArray(J)){const ie=J[`!${O}`];if(ie)return ie}if(W==="dropdown"){const ie=v.value.find(ae=>String(ae.name)===String(O));if(ie)return ie.name}if(typeof O=="string"){const ie=Number(O);return Number.isNaN(ie)?O:O.replace(/[.-]/g,"").length>16?T(O,X):T(ie,X)}return typeof O=="number"?T(O,X):String(O)}),{tooltip:F}=kF(""),E=async O=>{O.stopPropagation(),O.preventDefault(),O.stopImmediatePropagation();try{await navigator.clipboard.writeText(x.value),F.value="Copied",setTimeout(()=>{F.value="Copy"},3e3)}catch(W){console.error("Failed to copy text:",W),F.value="Copy failed",setTimeout(()=>{F.value="Copy"},3e3)}};et(()=>o.value,(O,W)=>{const X=Number(O);Number.isFinite(X)&&X!==h.value?h.value=X:O==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const k=()=>{r.value=!0},M=()=>{r.value=!1};return(O,W)=>Ke((z(),je(ws,Kt(H(S),{onMouseenter:k,style:{"--icon-size":"24px"},onMouseleave:M,ref_key:"wrapperRef",ref:a,actived:H(l),bordered:!0}),{suffix:ge(()=>[o.disabled?Xe("",!0):(z(),ce("div",{key:0,class:Q([O.$style.suffix,"wrapper-suffix"])},[r.value&&!H(u).isEmpty&&!H(u).isError?Ke((z(),je(ht,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(E,["prevent","stop"])},{default:ge(()=>[fe(at,{src:"Copy",source:"remote",size:12})]),_:1})),[[H(s),{content:H(F),hideOnClick:!1,contentClass:"extra-padding"}]]):Xe("",!0)],2))]),default:ge(()=>[be("div",{class:Q(O.$style["metric-wrapper"]),"aria-label":H(d).format_value||void 0},[be("div",{class:Q([O.$style["metric-content"],o.disabled?O.$style.disabled:""])},[!H(u).isError&&H(u).isEmpty?(z(),ce(xt,{key:0},[H(u).pendingCalculation?Ke((z(),ce("span",{key:0,class:Q(O.$style["metric-empty"])},[...W[0]||(W[0]=[st(" - ",-1)])],2)),[[H(s),"Can’t calculate yet. Complete required fields."]]):H(u).isEmpty?(z(),ce("span",{key:1,class:Q(O.$style["metric-empty"])}," - ",2)):Xe("",!0)],64)):Xe("",!0),H(u).isError?Ke((z(),ce("div",{key:1,class:Q(O.$style["metric-error"])},[...W[1]||(W[1]=[st(" Error ",-1)])],2)),[[H(s),"Something went wrong. Review formula, inputs and retry."]]):Xe("",!0),!H(u).isEmpty&&!H(u).isError?Ke((z(),ce("span",{key:2,class:Q([O.$style["metric-value"],H(b)?O.$style.hovered:"",{[O.$style.disabled]:o.disabled}])},[st(Ct(D.value),1)],2)),[[H(s),{content:g.value,bypassOverflowCheck:p.value}]]):Xe("",!0)],2)],10,cJ)]),_:1},16,["actived"])),[[H(n),{isLoading:H(u).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"}}]]),uJ={key:0,style:{color:"#6b6b6b"}},dJ=Et(ot({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue"],setup(e,{emit:t}){const n=qt,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"}},r={asc:{value:"asc",label:"Smallest to largest",id:"asc"},desc:{value:"desc",label:"Largest to smallest",id:"desc"}},i={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"},c=q(()=>{var A,k;if(a.headerType)return a.headerType;if(((k=(A=a.params)==null?void 0:A.column)==null?void 0:k.getColId()).includes("metric"))return"default";const E=a.headerType??a.params.column.getColId();return l[E]||"default"}),u=B(),d=()=>{var E,A,k;const F=(A=(E=a.params)==null?void 0:E.column)==null?void 0:A.getColDef();if((k=F.colId)!=null&&k.includes("metric")){if(F.context.is_primary==1)return"primary";if(F.context.is_point_metric==1)return"secondary"}};th(()=>{u.value=d()}),rn(()=>{u.value=d()});const h=q(()=>{var F,E;return((E=(F=a.params)==null?void 0:F.column.getColDef().context)==null?void 0:E.morpheme_value)||void 0}),f=q(()=>{var F;return(F=a.params)==null?void 0:F.displayName}),p=q(()=>{let F=[];switch(c.value){case"dateRange":F=Object.values(s).map(E=>({...E,selected:v.value===E.value,type:"text",hover:T.value===E.value}));break;case"date":F=Object.values(o).map(E=>({...E,selected:v.value===E.value,type:"text",hover:T.value===E.value}));break;case"number":F=Object.values(r).map(E=>({...E,selected:v.value===E.value,type:"text",hover:T.value===E.value}));break;default:F=Object.values(i).map(E=>({...E,selected:v.value===E.value,type:"text",hover:T.value===E.value}));break}return v.value!=="none"&&F.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:T.value=="none"}),F}),g=q(()=>String(v.value).endsWith("asc")?"SortUp":String(v.value).endsWith("desc")?"SortDown":"Sort"),v=B(a.modelValue??"none"),C=F=>{D("update:modelValue",F),D("sort-changed",F)},S=F=>{v.value=F},b=Tr(()=>{if(c.value==="date"||c.value==="default"||c.value==="number"){let F;v.value==="none"?F="asc":v.value==="asc"?F="desc":F="none",v.value=F}else{const F=[s.START_ASC.value,s.START_DESC.value,s.DUE_ASC.value,s.DUE_DESC.value,"none"],A=(F.indexOf(v.value)+1)%F.length;v.value=F[A]}},ai),w=q(()=>{if(v.value==="none")return"No sorting applied";const F=p.value.find(E=>E.value===v.value);return(F==null?void 0:F.label)||""}),D=t,R=q(()=>{if(a.disabled&&!a.readOnly)return"var(--disabled-color)";if(v.value!=="none")return"var(--primary-color-hover)"});et(()=>a.modelValue,F=>{F!=v.value&&(v.value=F)}),et(v,F=>{F!==a.modelValue&&C(F)});const T=B(v.value);et(()=>v.value,F=>{T.value=F});const I=F=>{var M,O;if(a.readOnly||a.disabled)return;let E=0;F.key==="ArrowDown"?E=1:F.key==="ArrowUp"&&(E=-1);const A=p.value.findIndex(W=>W.value===T.value),k=p.value.length;if(F.key==="Enter"||F.key===" ")F.preventDefault(),v.value=T.value,(M=x.value)==null||M.hide();else if(E!==0){F.preventDefault();let W=(A+E+k)%k;T.value=p.value[W].value}else F.key==="Escape"&&((O=x.value)==null||O.hide())},x=B(null);return rn(()=>{var F,E;(E=(F=x.value)==null?void 0:F.$el)==null||E.addEventListener("keydown",I)}),zc(()=>{var F,E;(E=(F=x.value)==null?void 0:F.$el)==null||E.removeEventListener("keydown",I)}),(F,E)=>(z(),je(pS,{ref_key:"dropdownRef",ref:x,options:p.value,label:f.value,readOnly:a.readOnly,disabled:a.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:H(b),onSelect:E[0]||(E[0]=A=>S(A))},{prefix:ge(()=>[fe(ht,{variant:["text"],onClick:H(b),size:"small"},{default:ge(()=>[Ke((z(),ce("b",null,[st(Ct(f.value),1)])),[[H(n),{content:f.value}]]),h.value?(z(),ce("small",uJ," ("+Ct(h.value)+") ",1)):Xe("",!0),u.value=="primary"?Ke((z(),ce("div",{key:1,class:Q(F.$style["icon-metric"])},[fe(at,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[H(n),"Woohoo metric"]]):Xe("",!0),u.value=="secondary"?Ke((z(),ce("div",{key:2,class:Q(F.$style["icon-metric"])},[fe(at,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[H(n),"Point Metric"]]):Xe("",!0)]),_:1},8,["onClick"])]),iconDropdown:ge(()=>[Ke(fe(at,{src:g.value,source:"remote",color:R.value},null,8,["src","color"]),[[H(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"}}]]),hJ=["disabled","readonly","checked","indeterminate"],Hk=Et(ot({__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=qt,s=Wi,o=e,r=t,i=q(()=>{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=q(()=>o.allowIndeterminate?[At.UNCHECK,At.INDETERMINATE,At.CHECKED]:[At.UNCHECK,At.CHECKED]),l=q(()=>{if(typeof o.tooltipText=="string"||!o.tooltipText)return o.tooltipText||"";switch(u.value){case At.UNCHECK:return o.tooltipText.unchecked;case At.INDETERMINATE:return o.tooltipText.indeterminate;case At.CHECKED:return o.tooltipText.checked;default:return""}}),c=()=>{if(h.value)return;const p=(a.value.indexOf(u.value)+1)%a.value.length;u.value=a.value[p]},u=B(typeof o.modelValue=="boolean"?o.modelValue?At.CHECKED:At.UNCHECK:o.modelValue),d=q(()=>({checked:u.value===At.CHECKED,indeterminate:u.value===At.INDETERMINATE,none:u.value===At.UNCHECK})),h=q(()=>o.disabled||o.readOnly);return et(()=>u.value,f=>{r("update:modelValue",f===At.CHECKED)}),(f,p)=>Ke((z(),ce("input",{disabled:o.disabled,key:u.value,readonly:o.readOnly,type:"checkbox",class:Q([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:c,"aria-label":"Select All Items",style:hn({"--input-size":i.value})},null,46,hJ)),[[H(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[H(s),o.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_1kz1e_84",large:"_large_1kz1e_87",medium:"_medium_1kz1e_90"}}]]),fJ=Et(ot({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=qt,s=Wm(),{setSelectionStatus:o}=s,{rowCount:r,selectionStatus:i}=Qs(s),a=B(new Set);et(i,w=>{o(w)},{immediate:!0});const l=q(()=>i.value!==At.UNCHECK),c=q(()=>({checked:i.value===At.CHECKED,indeterminate:i.value===At.INDETERMINATE,UNCHECK:i.value===At.UNCHECK})),u=q(()=>({[At.UNCHECK]:"Click to select all",[At.INDETERMINATE]:"Click to clear selection",[At.CHECKED]:"Click to clear selection"})[i.value]||"Select items"),d=q(()=>{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:r.value.total,loaded:r.value.loaded}),f=({api:w,state:D})=>{if(w)if(D===At.UNCHECK)w.deselectAll(),a.value.clear(),i.value=D;else if(D===At.CHECKED){const R=new Set;w.forEachNode(T=>{T.isSelected()&&R.add(T.id||"")}),a.value=R,w.forEachNode(T=>T.setSelected(!0)),i.value=D}else w.forEachNode(R=>R.setSelected(!0)),i.value=D},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 D={[At.UNCHECK]:At.INDETERMINATE,[At.INDETERMINATE]:At.UNCHECK,[At.CHECKED]:At.UNCHECK};f({api:w,state:D[i.value]})},g=w=>{var T;const D=(T=t.params)==null?void 0:T.api;if(!D){console.error("no api");return}const R={INDETERMINATE:At.INDETERMINATE,GLOBAL:At.CHECKED,UNCHECK:At.UNCHECK};f({api:D,state:R[w]})},v=Tr(w=>{const{selected:D,total:R}=h(w);if(R==0){i.value=At.UNCHECK;return}D===R?i.value=At.CHECKED:D===0?i.value=At.UNCHECK:i.value=At.INDETERMINATE},300);let C=[];const S=w=>{v(w)};rn(()=>{var I;const w=(I=t.params)==null?void 0:I.api;if(!w)return;const D=x=>v(x.api),R=()=>S(w),T=()=>S(w);w.addEventListener("selectionChanged",D),w.addEventListener("rowDataUpdated",R),w.addEventListener("modelUpdated",R),C=[()=>w.removeEventListener("selectionChanged",D),()=>w.removeEventListener("rowDataUpdated",R),()=>w.removeEventListener("modelUpdated",T)]}),ms(()=>{C.forEach(w=>w())});const b=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(w,D)=>(z(),je(pS,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:ge(()=>[Ke((z(),je(Hk,{"tab-index":"8",id:b,disabled:t.disabled,key:H(i),readonly:t.readOnly,type:"checkbox",checked:c.value.checked,indeterminate:c.value.indeterminate,modelValue:H(i),"onUpdate:modelValue":D[0]||(D[0]=R=>mn(i)?i.value=R:null),onChange:p,"aria-label":H(i)===H(At).CHECKED?"All items selected":"Select visible items",class:Q(w.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[H(n),{content:u.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_4qktt_1","button-group":"_button-group_4qktt_62","button-main":"_button-main_4qktt_62",headerCheckbox:"_headerCheckbox_4qktt_66"}}]]),pJ={key:1},gJ=Et(ot({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=qt,s=e,{isEditing:o}=Fu(s),r=B(null),i=B(null),a=q(()=>s.value),l=q(()=>a.value===void 0),c=q(()=>{var g;return((g=a.value)==null?void 0:g.name)||"No status"}),u=q(()=>{var g;return{disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:Sj((g=a.value)==null?void 0:g.label),inputRef:r,wrapperRef:i,clickable:!s.disabled&&!s.readOnly,active:o}}),{argsMain:d,isHover:h}=ys(u),f=q(()=>{var g;return((g=a.value)==null?void 0:g.color)||"red"}),p=q(()=>new Nn(f.value).isLight()?"#000":"#fff");return(g,v)=>Ke((z(),je(H(ws),Kt(H(d),{ref_key:"wrapperRef",ref:i,bordered:!0,style:{background:`${f.value} !important`,color:p.value,"--border-color":!H(o)&&!H(h)?"#f3f5f8":void 0}}),{default:ge(()=>[l.value?Xe("",!0):(z(),ce("div",{key:0,class:Q(g.$style["status-renderer"])},[a.value?Ke((z(),ce("div",{key:0,class:Q(g.$style["status-renderer__status-name"])},[st(Ct(c.value),1)],2)),[[H(n),{content:c.value,delay:[1e3,0]}]]):l.value?Xe("",!0):(z(),ce("div",pJ,"No status"))],2))]),_:1},16,["style"])),[[H(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"}}]]),Gk=Et(ot({__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:r,hide:i,isVisible:a}=G9({useTrigger:!1,arrow:!1,centered:!0,showOverlay:s.showOverlay,overlayOpacity:s.overlayOpacity,closeOnOverlayClick:s.closeOnOverlayClick,appendTo(u){return document.body}}),l=u=>{s.closeOnEscape&&u.key==="Escape"&&a.value&&i()};rn(()=>{document.addEventListener("keydown",l)}),ms(()=>{document.removeEventListener("keydown",l)}),t({show:r,hide:i,isVisible:a});const c=n;return et(()=>a.value,u=>{c(u?"shown":"hidden")}),(u,d)=>{const h=Eo("tooltip");return z(),ce("div",{ref_key:"popupRef",ref:o,class:Q(u.$style.popupContainer)},[be("div",{class:Q(u.$style.popupWrapper)},[be("div",{class:Q(u.$style.header)},[be("span",{class:Q(u.$style["header-title"])},Ct(e.popupName),3),Ke((z(),je(ht,{style:{position:"absolute",top:"0",right:"0"},variant:"text",onClick:H(i),"aria-label":"Close popup"},{default:ge(()=>[fe(at,{src:"Xmark"})]),_:1},8,["onClick"])),[[h,"Close"]])],2),be("div",{class:Q(u.$style.body)},[Tt(u.$slots,"default")],2),be("div",{class:Q(u.$style.footer)},[Tt(u.$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"}}]]),mJ={...{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 vJ extends Error{}class ja extends vJ{constructor(){super("Zone is an abstract class")}}class Uk{get type(){throw new ja}get name(){throw new ja}get ianaName(){return this.name}get isUniversal(){throw new ja}offsetName(t,n){throw new ja}formatOffset(t,n){throw new ja}offset(t){throw new ja}equals(t){throw new ja}get isValid(){throw new ja}}const gS=new Map;function yJ(e){let t=gS.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"}),gS.set(e,t)),t}const wJ={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function CJ(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,r,i,a,l,c,u]=s;return[i,o,r,a,l,c,u]}function bJ(e,t){const n=e.formatToParts(t),s=[];for(let o=0;o<n.length;o++){const{type:r,value:i}=n[o],a=wJ[r];r==="era"?s[a]=i:jm(a)||(s[a]=parseInt(i,10))}return s}const mS=new Map;class zm extends Uk{static create(t){let n=mS.get(t);return n===void 0&&mS.set(t,n=new zm(t)),n}static resetCache(){mS.clear(),gS.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 _J(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=yJ(this.name);let[o,r,i,a,l,c,u]=s.formatToParts?bJ(s,n):CJ(s,n);a==="BC"&&(o=-Math.abs(o)+1);const h=EJ({year:o,month:r,day:i,hour:l===24?0:l,minute:c,second:u,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 vS=null;class Lu extends Uk{static get utcInstance(){return vS===null&&(vS=new Lu(0)),vS}static instance(t){return t===0?Lu.utcInstance:new Lu(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Lu(zk(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 Wk(e){if(!(jm(e)||e===null||e===""))return parseInt(e,10)}function SJ(e){if(!(jm(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function EJ(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 _J(e,t,n,s=null){const o=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(r.timeZone=s);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function zk(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 jk=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Vu(...e){const t=e.reduce((n,s)=>n+s.source,"");return RegExp(`^${t}$`)}function Bu(...e){return t=>e.reduce(([n,s,o],r)=>{const[i,a,l]=r(t,o);return[{...n,...i},a||s,l]},[{},null,1]).slice(0,2)}function Kk(...e){return(t,n)=>{const s={};let o;for(o=0;o<e.length;o++)s[e[o]]=Wk(t[n+o]);return[s,null,n+o]}}const qk=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,RJ=`(?:${qk.source}?(?:\\[(${jk.source})\\])?)?`,Yk=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Zk=RegExp(`${Yk.source}${RJ}`),yS=RegExp(`(?:[Tt]${Zk.source})?`),DJ=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,TJ=/(\d{4})-?W(\d\d)(?:-?(\d))?/,IJ=/(\d{4})-?(\d{3})/,xJ=Kk("weekYear","weekNumber","weekDay"),FJ=Kk("year","ordinal"),PJ=/(\d{4})-(\d\d)-(\d\d)/,Xk=RegExp(`${Yk.source} ?(?:${qk.source}|(${jk.source}))?`),AJ=RegExp(`(?: ${Xk.source})?`);function $u(e,t,n){const s=e[t];return jm(s)?n:Wk(s)}function kJ(e,t){return[{year:$u(e,t),month:$u(e,t+1,1),day:$u(e,t+2,1)},null,t+3]}function Hu(e,t){return[{hours:$u(e,t,0),minutes:$u(e,t+1,0),seconds:$u(e,t+2,0),milliseconds:SJ(e[t+3])},null,t+4]}function ff(e,t){const n=!e[t]&&!e[t+1],s=zk(e[t+1],e[t+2]),o=n?null:Lu.instance(s);return[{},o,t+3]}function pf(e,t){const n=e[t]?zm.create(e[t]):null;return[{},n,t+1]}Vu(DJ,yS),Vu(TJ,yS),Vu(IJ,yS),Vu(Zk),Bu(kJ,Hu,ff,pf),Bu(xJ,Hu,ff,pf),Bu(FJ,Hu,ff,pf),Bu(Hu,ff,pf),Bu(Hu),Vu(PJ,AJ),Vu(Xk),Bu(Hu,ff,pf);function Gu(e){"@babel/helpers - typeof";return Gu=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},Gu(e)}var Cs;(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}"})(Cs||(Cs={})),Cs.review,Cs.review_take,Cs.review_scene,Cs.review_rendition,Cs.review_frame,Cs.review_rendition_comment,Cs.review_comment,Cs.scene_hub,Cs.hub_rendition,Cs.hub_comment,Cs.people_insight,Cs.people_detail,Cs.project,Cs.woohoo,Cs.update,Cs.core,Cs.project_focusMode;var wS=null;function OJ(e){wS=e}function Ym(){if(!wS)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return wS}function Jk(){try{var e=sessionStorage.getItem("APP_DEBUG")?"✅":"",t=Ym();return"".concat(t.t("errorMessages.fallback.unknownError")," ").concat(e)}catch{return"An error occurred. Please try again or contact support."}}function MJ(e,t,n,s){var o=e.replace(/{field}/g,t);if(s&&Gu(s)==="object")Object.keys(s).forEach(function(i){var a="{".concat(i,"}"),l=s[i];Array.isArray(l)?l=l.join(", "):i==="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 r=n[0]||"";n.length>1?r="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(r=n[0].join(", ")),o=o.replace(/{value}/g,r)}return o}function NJ(e,t){for(var n=Object.keys(t),s=0,o=n;s<o.length;s++){var r=o[s],i=Array.isArray(t[r])?t[r].join(", "):String(t[r]);e=e.replace(new RegExp("\\{".concat(r,"\\}"),"g"),i)}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 Qk(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function eO(e,t){if(!e||Gu(e)!=="object")return null;try{var n=Ym();if(e.validation&&e.validation.fields)for(var s=e.validation.fields,o=Object.keys(s),r=0,i=o;r<i.length;r++){var a=i[r],l=s[a];if(l&&l.rule){var c=l.rule,u=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[c]}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[c]}if(v&&typeof v=="string")return MJ(v,a,u,d)}catch(w){console.error("Error in validation rules",w)}}}}catch(w){return console.error("Error in getValidationErrorMessage:",w),null}return null}function LJ(e){var t=sessionStorage.getItem("APP_DEBUG")?"✅":"";if(!e)return Jk();var n=e.code,s=e.error,o=e.details,r=e.message;if(Qk(o)&&o){var i=eO(o,s==null?void 0:s.type);if(sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",i),i)return n!==""?"[".concat(n,"] ").concat(i," ").concat(t):"".concat(i);try{var a=Ym();return a.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(s&&Gu(s)==="object"&&s.type&&s.key){var l=s.type.toUpperCase();try{var c,u,d,h="errorMessages.".concat(l,".").concat(s.key),f=Ym(),p=((c=f.messages)===null||c===void 0?void 0:c.value)||f.messages,g=((u=f.locale)===null||u===void 0?void 0:u.value)||f.locale,v=(d=p[g])===null||d===void 0||(d=d.errorMessages)===null||d===void 0||(d=d[l])===null||d===void 0?void 0:d[s.key];if(v&&typeof v=="string"){var C=v;return o!=null&&o.context&&(C=NJ(C,o.context),sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",C)),n!==""?"[".concat(n,"] ").concat(C," ").concat(t):"".concat(C," ").concat(t)}}catch(b){console.error("[Error Utils Debug]",b)}}if(s&&Gu(s)!=="object"&&Qk(o)){var S=eO(o);if(S)return n!==""?"[".concat(n,"] ").concat(S," ").concat(t):"".concat(S," ").concat(t)}return r?"".concat(r):Jk()}const gf=Ql("toast",()=>{const e=l=>{var c;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 u=LJ((c=l==null?void 0:l.res)==null?void 0:c.data);o({id:l==null?void 0:l.apiCode,type:"error",message:u})}},t=B([]),n=(l,c)=>{const u=mJ[l];if(u){const d=u[c];if(d){o({id:l,type:c,message:d});return}}else o({id:l,type:c,message:l})},s=new Map,o=(l,c=5e3)=>{const u={...l,id:l.id??Date.now()+Math.random()};if(t.value.push(u),c>0){const d=Date.now(),h=setTimeout(()=>{r(u.id),s.delete(u.id)},c);s.set(u.id,{timeoutId:h,remainingTime:c,startTime:d})}};function r(l){t.value=t.value.filter(u=>u.id!==l);const c=s.get(l);c&&(clearTimeout(c.timeoutId),s.delete(l))}function i(l){const c=s.get(l);if(c){clearTimeout(c.timeoutId);const u=Date.now()-c.startTime;c.remainingTime=Math.max(0,c.remainingTime-u)}}function a(l){const c=s.get(l);if(c&&c.remainingTime>0){const u=setTimeout(()=>{r(l),s.delete(l)},c.remainingTime);c.timeoutId=u,c.startTime=Date.now()}}return{notifications:t,addNotification:o,removeNotification:r,showMessage:n,showErrorNetMessage:e,pauseAutoDismiss:i,resumeAutoDismiss:a}}),VJ=["onMouseenter","onMouseleave"],BJ=["innerHTML"],$J=["innerHTML"],HJ=["data-tooltip"],GJ={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},UJ=Et(ot({__name:"Snackbar",setup(e){const t=qt,n=RU,s=gf(),{removeNotification:o}=s,{notifications:r}=Qs(s),i=f=>f.trim().startsWith("<svg"),a=B("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},c=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},u=B(new Set),d=f=>{var p;u.value.add(f),(p=s.pauseAutoDismiss)==null||p.call(s,f)},h=f=>{var p;u.value.delete(f),(p=s.resumeAutoDismiss)==null||p.call(s,f)};return(f,p)=>(z(),je(lU,{name:"list",tag:"div",class:Q(["notification-center",f.$style["notification-wrapper"]])},{default:ge(()=>[(z(!0),ce(xt,null,xn(H(r),g=>{var v;return Ke((z(),ce("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)},[be("p",{class:Q(f.$style.snackbar__message)},[be("span",{class:Q(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(z(),je(at,{key:0,src:"CircleCheck",source:"remote"})):Xe("",!0),!g.icon&&g.type=="interactive"?(z(),je(at,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(z(),je(at,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&i(g.icon)?(z(),ce("i",{key:3,class:Q(f.$style["icon-draw"]),innerHTML:g.icon},null,10,BJ)):g.icon&&!i(g.icon)?(z(),je(at,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Xe("",!0)],2),be("span",{class:Q(f.$style["error-message"])},[be("span",{class:Q(f.$style.message),innerHTML:g.message},null,10,$J)],2)],2),g.actions?(z(),ce("div",{key:0,class:Q(f.$style["actions-notification"]),"data-notification":"true"},[(z(!0),ce(xt,null,xn(g.actions,C=>(z(),je(ht,Kt({key:C.label},{ref_for:!0},C,{onClick:Pt(C.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:ge(()=>[C.btnIcon?(z(),je(at,{key:0,src:C.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Xe("",!0)]),_:2},1040,["onClick"]))),128))],2)):Xe("",!0),g.type!=="interactive"?Ke((z(),ce("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[fe(ht,{variant:"secondary",onClick:C=>c(g.message),class:Q(f.$style["copy-btn"])},{prefix:ge(()=>[fe(at,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,HJ)),[[H(t),a.value]]):Xe("",!0),g.type=="interactive"?Ke((z(),ce("div",GJ,[fe(ht,{variant:"tertiary",onClick:C=>H(o)(g.id),class:Q(f.$style["close-btn"]),size:18},{default:ge(()=>[fe(at,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[H(t),"Close"]]):Xe("",!0)],42,VJ)),[[H(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_jf7je_1","notification-item":"_notification-item_jf7je_15","notification--success":"_notification--success_jf7je_30","notification--error":"_notification--error_jf7je_36","close-btn":"_close-btn_jf7je_42","notification--info":"_notification--info_jf7je_45","notification--warning":"_notification--warning_jf7je_52","notification--interactive":"_notification--interactive_jf7je_59","snackbar-type":"_snackbar-type_jf7je_67",snackbar__message:"_snackbar__message_jf7je_76",message:"_message_jf7je_89","error-message":"_error-message_jf7je_97",snackbar__icon:"_snackbar__icon_jf7je_103","actions-notification":"_actions-notification_jf7je_112","icon-draw":"_icon-draw_jf7je_120","copy-btn":"_copy-btn_jf7je_128"}}]]);/*!
|
|
151
|
+
`+r):s.stack=r}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=nc(this.defaults,n);const{transitional:s,paramsSerializer:o,headers:r}=n;s!==void 0&&Gm.assertOptions(s,{silentJSONParsing:ui.transitional(ui.boolean),forcedJSONParsing:ui.transitional(ui.boolean),clarifyTimeoutError:ui.transitional(ui.boolean)},!1),o!=null&&(Be.isFunction(o)?n.paramsSerializer={serialize:o}:Gm.assertOptions(o,{encode:ui.function,serialize:ui.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Gm.assertOptions(n,{baseUrl:ui.spelling("baseURL"),withXsrfToken:ui.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=r&&Be.merge(r.common,r[n.method]);r&&Be.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),n.headers=fo.concat(i,r);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 c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,d=0,h;if(!l){const p=[Tk.bind(this),void 0];for(p.unshift(...a),p.push(...c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}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{u=Tk.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=nc(this.defaults,t);const n=mk(t.baseURL,t.url,t.allowAbsoluteUrls);return ak(n,t.params,t.paramsSerializer)}};Be.forEach(["delete","get","head","options"],function(t){sc.prototype[t]=function(n,s){return this.request(nc(s||{},{method:t,url:n,data:(s||{}).data}))}}),Be.forEach(["post","put","patch"],function(t){function n(s){return function(r,i,a){return this.request(nc(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}sc.prototype[t]=n(),sc.prototype[t+"Form"]=n(!0)});let OX=class d${constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(r){n=r});const s=this;this.promise.then(o=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](o);s._listeners=null}),this.promise.then=o=>{let r;const i=new Promise(a=>{s.subscribe(a),r=a}).then(o);return i.cancel=function(){s.unsubscribe(r)},i},t(function(r,i,a){s.reason||(s.reason=new Nu(r,i,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 d$(function(o){t=o}),cancel:t}}};function MX(e){return function(n){return e.apply(null,n)}}function NX(e){return Be.isObject(e)&&e.isAxiosError===!0}const fS={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(fS).forEach(([e,t])=>{fS[t]=e});function Fk(e){const t=new sc(e),n=jA(sc.prototype.request,t);return Be.extend(n,sc.prototype,t,{allOwnKeys:!0}),Be.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Fk(nc(e,o))},n}const ns=Fk(lf);ns.Axios=sc,ns.CanceledError=Nu,ns.CancelToken=OX,ns.isCancel=hk,ns.VERSION=Ik,ns.toFormData=Lm,ns.AxiosError=Yt,ns.Cancel=ns.CanceledError,ns.all=function(t){return Promise.all(t)},ns.spread=MX,ns.isAxiosError=NX,ns.mergeConfig=nc,ns.AxiosHeaders=fo,ns.formToJSON=e=>uk(Be.isHTMLForm(e)?new FormData(e):e),ns.getAdapter=Dk.getAdapter,ns.HttpStatusCode=fS,ns.default=ns;const{Axios:t0e,AxiosError:n0e,CanceledError:s0e,isCancel:o0e,CancelToken:r0e,VERSION:i0e,all:a0e,Cancel:l0e,isAxiosError:LX,spread:c0e,toFormData:u0e,AxiosHeaders:d0e,HttpStatusCode:h0e,formToJSON:f0e,getAdapter:p0e,mergeConfig:g0e}=ns,VX=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},BX=6e4,Pk=e=>({[`/api/v1/workspace/${e}/item/2`]:1,[`/api/v1/workspace/${e}/item/2/metrics`]:5,default:5}),Um=new Map,Ak=e=>{const t=e.match(/\/api\/v1\/workspace\/([^/]+)/);return t?t[1]:null},$X=e=>{const t=Ak(e),n=Pk(t||"none"),o=new URL(e,"https://dummy.com").pathname,r=Object.keys(n).find(a=>a!=="default"&&o===a)||"default";Um.has(r)||Um.set(r,{ongoing:0,queue:[]});const i=Um.get(r);return new Promise(a=>{i?i.ongoing<n[r]?(i.ongoing++,a()):i.queue.push(()=>{i.ongoing++,a()}):a()})},kk=e=>{const t=Ak(e),n=Pk(t||"none"),o=new URL(e,"https://dummy.com").pathname,r=Object.keys(n).find(a=>a!=="default"&&o===a)||"default",i=Um.get(r);if(i&&(i.ongoing--,i.queue.length>0)){const a=i.queue.shift();setTimeout(()=>{a==null||a()},1e3)}},HX=(()=>{const e=ns.create({timeout:BX,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(async t=>{const n=t.url||"";await $X(n);const s=VX("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=>(kk(t.config.url||""),t),async t=>{var s,o,r;if(((s=t.response)==null?void 0:s.status)===401){const i=sessionStorage.getItem("BASE_URL")||"";(()=>{const l=`${i}/start`;window.postMessage({type:"TOKEN_EXPIRED",message:"Authentication token has expired"},"*"),window.location.replace(l)})()}if(t.config&&kk(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 i=t.response.headers["retry-after"],a=i?parseInt(i)*1e3:Math.pow(2,n._retryCount)*1e3;return await new Promise(l=>setTimeout(l,a)),e(n)}return((r=t.response)==null?void 0:r.status)===401&&!n._retry&&(n._retry=!0),Promise.reject(t)}),e})();class uf extends Error{constructor(t,n,s,o,r){super(t),this.name="ApiError",this.statusCode=n,this.code=s,this.details=o,this.type=r,Object.setPrototypeOf(this,uf.prototype)}}const df=e=>{var t,n;if(LX(e)){const s=(t=e.response)==null?void 0:t.status,o=(n=e.response)==null?void 0:n.data,r=(o==null?void 0:o.message)||e.message||"An unexpected error occurred",i=(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===ku.UNAUTHORIZED||s===ku.FORBIDDEN?l="AUTH":s===ku.UNPROCESSABLE_ENTITY||s===ku.BAD_REQUEST?l="VALIDATION":s>=ku.BAD_REQUEST&&(l="CLIENT"),new uf(r,s,i,a,l)}return e instanceof Error?new uf(e.message,void 0,void 0,void 0,"UNKNOWN"):new uf("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class GX{constructor(){this.axios=HX}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,r])=>{r!=null&&r!==""&&(Array.isArray(r)?r.forEach(i=>n.append(o,String(i))):typeof r=="object"?n.append(o,JSON.stringify(r)):n.append(o,String(r)))});const s=n.toString();return s?`?${s}`:""}async get(t="",n,s){try{const o=this.buildUrl(t),r=n?this.buildQueryParams(n):"";return(await this.axios.get(`${o}${r}`,s)).data}catch(o){throw df(o)}}async post(t="",n,s,o){try{const r=this.buildUrl(t),i=n?this.buildQueryParams(n):"";return(await this.axios.post(`${r}${i}`,s,o)).data}catch(r){throw df(r)}}async put(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.put(o,n,s)).data}catch(o){throw df(o)}}async patch(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.patch(o,n,s)).data}catch(o){throw df(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 df(o)}}}const UX=({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}/v1/workspace/${t}/entity/2/metrics`,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"}}),WX=(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 Ok extends GX{constructor(t,n){const s=n==null?void 0:n.domainApi,o=n==null?void 0:n.wsCode,r=(n==null?void 0:n.entityId)||"";super(),this.events=Object.create(null);const i=UX({domainApi:s,wsCode:o,entityId:r}),a={};Object.entries(i).forEach(([l,c])=>{const u=l;t[u]?a[u]=t[u]:(console.warn(`API config for ${u} is missing, using base config.`),a[u]=c)}),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(r){console.error(`Error in event listener for ${t}:`,r)}})}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:r,responseType:i}){var c,u;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:i}),(((c=l.headers)==null?void 0:c["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const h=((u=l.headers)==null?void 0:u["content-disposition"])||"",f=h.includes("filename=")?h.split("filename=")[1]:"exported_items.xlsx";WX(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:r,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:r,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let s=t;return Object.entries(n).forEach(([o,r])=>{s=s.replace(`{${o}}`,String(r))}),s}async request(t,n,s={}){const{url:o,code:r,method:i}=this.apiConfig[t],a=this.generateUrl(o,n);return this._requestHandler({method:i,path:a,params:s.params,payload:s.payload,code:r,responseType:s.responseType})}async getAllItem_cursor(t){var r;const n=t.workspaceId,s={entity_ids:((r=t.entityIds)==null?void 0:r.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:r}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:r||100,page:s||1,name_like:o||void 0,permission:"1,2"}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:s,metric_ids:o}){const r={item_ids:n,metric_ids:o};return this.request("metricValues",{workspaceId:t},{params:{per_page:s,include_permission:1},payload:r})}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 r={item_id:s,entity_id:n,name:o,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:s},{payload:r})}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 r={item_ids:n,delete_all:s?1:void 0,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:r})}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:r,filterParams:i}){const a={item_ids:n,start_date:s,due_date:o,entity_id:r};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:i})}async updateAssignee(t){const{workspaceId:n,itemIds:s,userIds:o,entityId:r}=t,i={item_ids:s,ws_user_role_ids:o,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:i,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:s,entityId:o}=t,r={item_ids:n,ws_user_role_ids:s,entity_id:o};return!n||n.length===0?(r.item_ids=void 0,r.entity_id=o):(r.item_ids=n,r.entity_id=void 0),r}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:r}=t,i={item_ids:s,ws_user_role_ids:o,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:i})}async addAssignee({workspaceId:t,itemIds:n,userIds:s,entityId:o,filterParams:r}){const i={item_ids:n,ws_user_role_ids:s,entity_id:o};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:i,params:r})}async unAssignAll(t){const{workspaceId:n,entityId:s,itemIds:o,filterParams:r}=t,i={item_ids:o,entity_id:s,ws_user_role_ids:[]};return!o||o.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(s)},{payload:i,params:r})}async updateItemStatus(t){const{workspaceId:n,itemIds:s=[],statusId:o,entityId:r}=t,i={item_ids:s,template_flow_status_id:o};return s.length||(i.item_ids=void 0,i.entity_id=r),this.request("bulkStatusUpdate",{workspaceId:n},{payload:i,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:r,clear:i}=t,a={item_ids:s,metric_id:o,metric_value:r,clear:i??(r==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:r,entity_ids:i}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:s,per_page:o,display_name_like:r,entity_ids:i}})}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 this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return this.request("getAssignableAssignees",{workspaceId:t},{params:n})}}const zX=(e,t,n,s,o,r,i)=>{const{apiServices:a}=ts(n,s),l=B(!1),c=()=>{l.value=!0},u=()=>{vt(()=>{setTimeout(()=>{l.value=!1},500)})},d=q(()=>!!(o!=null&&o.value&&(r!=null&&r.value))),h=_n("filterParams",null);return{isUpdating:l,handleUpdate:async p=>{var v;const g=p.value;c();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)}u()}}},jX=Et(ot({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=GA(),s=B([]),o=e,r=t,i=B([]),a=B(null),l=X=>{var ae,ee,V;const J=s.value.findIndex(G=>G.id===X.id);a.value=J;const ie=(ae=i.value[J])==null?void 0:ae.$el;(ee=D.value)==null||ee.scrollTo(J*30),ie&&ie.scrollIntoView({behavior:"smooth",block:"center"}),c(J),(V=i.value[J])==null||V.show()},c=X=>{a.value=X,i.value.forEach((J,ie)=>{ie!==X&&J&&J.hide()})},u=B(""),d=()=>{u.value="",i.value.forEach(X=>{X==null||X.hide()}),a.value=null},h=q(()=>o.selectedIds||[]),f=q(()=>({itemIds:h.value,workspaceId:String(o.workspaceId)})),p=_n("isSelectAll",B(!1)),g=_n("bulkUpdate",B(!1)),v=B(null),{handleUpdate:C,isUpdating:S}=zX(f,X=>{var J;r("update",X),d(),(J=v.value)==null||J.hide()},!1,o,g,p),b=async X=>{var J;r("update-start");try{await C(X),r("update-completed")}catch{r("update-failed"),(J=v.value)==null||J.open()}},w=X=>{d(),vt(()=>{var J;(J=D.value)==null||J.focus()})},D=B(null),R=(X,J)=>{var ie;X?(ie=D.value)==null||ie.focus():d(),X&&J!==X&&W("")},T=B(!0),I=B(!0),{apiServices:x}=ts(!1,o),F=async(X,J,ie)=>{var ae;try{return ie?I.value=!0:T.value=!0,await((ae=x.value)==null?void 0:ae.getMetricList({workspaceId:o.workspaceId||"",entityId:o.entityId||"",page:X,query:J,per_page:10}))}catch(ee){throw console.error("Failed to fetch metric list:",ee),ee}finally{T.value=!1,I.value=!1}},E=B(0),A=B(!0),k=X=>({id:String(X.id),label:String(X.name),value:String(X.id),description:X.morpheme_value?`${String(X.morpheme_value)}`:"",type:n.checkEditType(X),metricConfig:X}),M=X=>X.filter(J=>!J.formula).filter(J=>{var ie;return((ie=J==null?void 0:J.auth_permission)==null?void 0:ie.permission)==2}).map(k),O=async()=>{E.value+=1;const X=await F(E.value,u.value,!0);if(X&&X.data){const J=M(X.data);s.value=[...s.value,...J],A.value=X.meta.last_page!=X.meta.current_page}else A.value=!1},W=async X=>{u.value=X,E.value=1;try{const J=await F(E.value,u.value);J&&J.data?(s.value=M(J.data),A.value=J.meta.last_page!=J.meta.current_page):s.value=[]}catch{s.value=[]}};return(X,J)=>(z(),je(nf,{ref_key:"wrapperRef",ref:v,isUpdating:H(S),disabled:o.disabled||H(S),onOnVisibleChange:R},{trigger:ge(({hide:ie,disabled:ae})=>[fe(ht,{variant:o.variant,loading:H(S),disabled:ae,onEscape:ie},{default:ge(()=>[fe(at,{src:"SquareRootVariable",class:"icon"}),J[1]||(J[1]=st(" Metric ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ge(({isVisible:ie,popupRef:ae,hide:ee})=>[Ke(fe(Qi,{ref_key:"searchListRef",ref:D,style:{width:"320px"},options:s.value,loading:T.value,"loading-more":I.value,"selected-id":void 0,"has-more":A.value,onSearch:W,onSelect:l,onLoadMore:J[0]||(J[0]=()=>O()),onCancel:ee},{item:ge(({item:V,index:G,selectedIndex:te})=>[fe(fZ,{ref:pe=>i.value[G]=pe,label:V.label,type:V.type,morpheme:V.description||"",onFocusOnSearch:w,onOpen:pe=>c(G),attachTo:ae,config:V.metricConfig,onHandleUpdate:b,class:Q(["metric-update-item",{selected:a.value===G||te===G}])},null,8,["label","type","morpheme","onOpen","attachTo","config","class"])]),"extra-item":ge(()=>[...J[2]||(J[2]=[be("div",{style:{width:"250px"}},null,-1)])]),"empty-list":ge(()=>[...J[3]||(J[3]=[st("No options available.",-1)])]),_:2},1032,["options","loading","loading-more","has-more","onCancel"]),[[Ko,ie]])]),default:ge(()=>[J[4]||(J[4]=st(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),[["__scopeId","data-v-bf83ec06"]]),Wm=Ql("bulkUpdate",()=>{const e=B(At.UNCHECK),t=lo({loaded:0,total:0}),n=u=>{t.total=u},s=u=>{t.loaded=u},o=lo({isBulkUpdating:!1});function r(u){o.isBulkUpdating=u}const i=B({}),a=u=>{i.value=u},l=(u,d)=>{i.value[u]=d},c=u=>{e.value=u};return{bulkUpdateState:o,setIsBulkUpdating:r,selectionIds:i,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:c,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:s,handelSelectAll:()=>{c(At.CHECKED)}}}),KX={class:"status-label"},Mk=Et(ot({__name:"StatusItem",props:{status:{},selected:{type:Boolean},focused:{type:Boolean},hovered:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=qt,s=e,o=t,r=a=>{o("select",a)},i=a=>new Nn(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(z(),ce("div",{class:Q(["status-option",{selected:s.selected,focused:s.focused,hovered:s.hovered}]),onClick:l[0]||(l[0]=c=>r(e.status.id))},[be("div",{class:"status-color",style:hn({backgroundColor:e.status.color,borderColor:i(e.status.color)})},null,4),Ke((z(),ce("div",KX,[Tt(a.$slots,"label",{},()=>[st(Ct(e.status.name),1)],!0)])),[[H(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-aeaa75a4"]]),qX=["innerHTML"],Nk=Et(ot({__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,r=n,i=B([]),a=B(!1),l=B(!1),c=B(null),u=B(s.INITIAL_PAGE),d=B(!0),h=B(0),f=B(""),p=q(()=>{var M;return(M=o.value)==null?void 0:M.id}),g=q(()=>!!(o.id||o.ids&&o.ids.length>0)),v=M=>({label:M.name,value:M.id,selected:p.value===M.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:M,id:M.id,color:M.color}),C=q(()=>{const M=new Set;return o.id&&M.add(String(o.id)),o.ids&&o.ids.forEach(O=>{O&&M.add(String(O))}),Array.from(M)}),S=_n("bulkUpdate",!1),{apiServices:b}=ts(!S,o),w=Wm(),{selectionStatus:D}=Qs(w),R=_n("filterParams",null),T=async(M=s.INITIAL_PAGE,O="",W=!1)=>{var X,J,ie,ae;if(!g.value){console.error("Missing required props",o);return}W?l.value=!0:a.value=!0,c.value=null;try{const ee={workspaceId:String(o.workspaceId),itemIds:C.value,page:M,perPage:s.PER_PAGE,name_like:O.trim(),...R||{}};if(((X=b.value)==null?void 0:X.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const V=await((J=b.value)==null?void 0:J.getAssignableStatus(ee));if(!(V!=null&&V.data)){W||(i.value=[]),d.value=!1;return}const G=V.data.map(v);i.value=W?[...i.value,...G]:G,h.value=((ie=V.meta)==null?void 0:ie.total)??V.data.length,d.value=!((ae=V.meta)!=null&&ae.on_last_page),u.value=M}catch(ee){console.error("Error fetching statuses:",ee),c.value="Failed to load statuses",W||(i.value=[]),d.value=!1,r("error",c.value)}finally{a.value=!1,l.value=!1}},I=Tr(async M=>{f.value=M,u.value=s.INITIAL_PAGE,await T(s.INITIAL_PAGE,M,!1)},ai),x=async()=>{!d.value||l.value||await T(u.value+1,f.value,!0)},F=()=>{var M;r("cancel"),(M=o.params)==null||M.api.stopEditing()},E=async M=>{var O,W,X;if(!g.value){console.error("Missing required props for updating status",o);return}try{const J={workspaceId:String(o.workspaceId),itemIds:C.value,statusId:String(M.value),entityId:String(o.entityId),filterParams:R!=null&&R.value?R==null?void 0:R.value:void 0};if(D.value==At.CHECKED&&S&&(J.itemIds=void 0,J.entityId=String(o.entityId)),r("start-update"),!await b.value.updateItemStatus(J))throw new Error("Status update failed: empty response");const ae={workspaceId:String(o.workspaceId),itemIds:C.value,data:{id:M.id,name:M.label,color:M.color}};r("updated",ae),o.params&&((W=o.params)==null||W.node.setData({...(O=o.params)==null?void 0:O.node.data,status:{id:M.id,name:M.label,color:M.color}}),(X=o.params)==null||X.api.stopEditing()),r("finish-update")}catch(J){console.error("Error updating status:",J),c.value="Failed to update status",r("error",c.value)}},A=q(()=>i.value.map(M=>({...M})));et([()=>o.id,()=>o.workspaceId,()=>o.ids],()=>{T()},{deep:!0,immediate:!0});const k=B(null);return rn(()=>{vt(()=>{var M;(M=k.value)==null||M.focus()})}),t({refresh:()=>T(s.INITIAL_PAGE,f.value,!1),loadMore:x,focus:()=>{var M;return(M=k.value)==null?void 0:M.focus()}}),(M,O)=>{var W;return z(),je(Qi,Kt({ref_key:"popupRef",ref:k},o,{"selected-id":(W=o.value)==null?void 0:W.id,options:A.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:c.value,onSearch:H(I),onSelect:E,onLoadMore:x,onCancel:F,onClose:F}),{item:ge(({item:X,selectedIndex:J,isSelected:ie,handleItemHover:ae,getHighlightedLabel:ee,query:V,idx:G})=>[(z(),je(Mk,{key:X.value,status:X.data,selected:ie(X),onMouseover:te=>ae(G),onSelect:te=>E(X),hovered:G===J},{label:ge(()=>[V?(z(),ce("span",{key:0,class:Q([M.$style["item-label"],M.$style.match]),style:{flex:"1"},innerHTML:ee(X.label)},null,10,qX)):(z(),ce("span",{key:1,class:Q(M.$style["item-label"]),style:{flex:"1"}},Ct(X.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"}}]]),YX=ot({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e,s=q(()=>{const f=es();return f==null?void 0:f.appContext.config.globalProperties.apiServices}),o=t,r=B(!1),i=B(null),a=f=>{r.value=!1,o("updated",f)},l=q(()=>({apiServices:s.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId}));Xr("bulkUpdate",!0);const c=f=>{var p,g;r.value=!1,f?(o("update-completed"),(p=i.value)==null||p.destroy()):(o("update-failed"),(g=i.value)==null||g.open())},u=B(null),d=(f,p)=>{var g;f&&((g=u.value)==null||g.focus())},h=()=>{var f;(f=i.value)==null||f.hide(),r.value=!0,o("update-start")};return et(()=>n.ids,()=>{var f;(f=i.value)==null||f.destroy()}),(f,p)=>(z(),je(nf,{ref_key:"wrapperRef",ref:i,isUpdating:r.value,disabled:n.disabled||r.value,onOnVisibleChange:d},{trigger:ge(({hide:g,disabled:v})=>[fe(ht,{variant:n.variant,loading:r.value,disabled:v,onEscape:g},{default:ge(()=>[fe(at,{src:"Square",class:"icon"}),p[2]||(p[2]=st(" Status ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:ge(({hide:g})=>[fe(Nk,Kt({disabled:r.value,ref_key:"statusRef",ref:u},l.value,{onUpdated:a,onCancel:g,onStartUpdate:h,onFinishUpdate:p[0]||(p[0]=v=>c(!0)),onError:p[1]||(p[1]=v=>c(!1)),callback:()=>{}}),null,16,["disabled","onCancel"])]),default:ge(()=>[p[3]||(p[3]=st(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),Lk=Et(ot({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=Wi,o=e,r=q(()=>(o==null?void 0:o.workspaceId)||""),i=q(()=>(o==null?void 0:o.entityId)||""),a=()=>{var M,O,W;return(W=(M=o.params)==null?void 0:M.api)==null?void 0:W.getCellRendererInstances({columns:["options"],rowNodes:(O=o.params)!=null&&O.node?[o.params.node]:[]})[0]},l=()=>{var O,W,X,J;const M=a();(W=(O=M==null?void 0:M.componsenExposed)==null?void 0:O.blur)==null||W.call(O),(J=(X=M==null?void 0:M.container)==null?void 0:X.parentElement)==null||J.classList.remove("ag-cell-focus")},c=()=>{var W,X,J;(X=(W=o.params)==null?void 0:W.api)==null||X.stopEditing(),l();const M=`scene-name-${o.id}`,O=document.getElementById(M);(J=O==null?void 0:O.__sceneNameEditor)==null||J.startEdit()},{apiServices:u}=ts(!0,o),d=q(()=>{var M;return{ws_code:r.value,entity_id:i.value,scene_id:o.id,axiosService:u,optionBlock:o.optionBlock,permissions:(M=o.data)==null?void 0:M.permissions}}),h=M=>{var W,X,J,ie,ae,ee;let O=(X=(W=o.params)==null?void 0:W.api)==null?void 0:X.getRowNode(String(o.id));if(O){const V={...O.data,isDeleted:M==="deleted",isArchived:M==="archived"?!0:O.data.isArchived,isLocked:M==="locked"?!0:O.data.isLocked,disabled:!1};M=="deleted"&&(V.isLocked=!1,V.disabled=!0),M=="unarchived"&&(V.isArchived=!1),(ie=(J=o.params)==null?void 0:J.api)==null||ie.redrawRows({rowNodes:[O]}),O.setData(V),(ee=(ae=o.params)==null?void 0:ae.api)==null||ee.redrawRows({rowNodes:[O]})}},f=ef(),{openSceneHub:p}=f,g=()=>{vt(()=>{var W,X,J,ie,ae,ee;const M=((X=(W=o.params)==null?void 0:W.node)==null?void 0:X.rowIndex)||0,O=((ie=(J=o.params)==null?void 0:J.column)==null?void 0:ie.getColId())||"";(ee=(ae=o.params)==null?void 0:ae.api)==null||ee.setFocusedCell(M,O)})};q(()=>{var O,W;const M=(W=(O=o.params)==null?void 0:O.api)==null?void 0:W.getRowNode(String(o.id));return M==null?void 0:M.data});const{options:v}=mY(d,h,c,p,g),C=n,S=()=>{var M,O,W,X,J,ie;console.trace("Focusing current cell for row:",o.id),(ie=(M=o.params)==null?void 0:M.api)==null||ie.setFocusedCell(((W=(O=o.params)==null?void 0:O.node)==null?void 0:W.rowIndex)||0,((J=(X=o.params)==null?void 0:X.column)==null?void 0:J.getColId())||"")},b=q(()=>{var M;return(M=o.params)==null?void 0:M.api}),w=(M,O)=>{var W,X,J,ie,ae,ee,V,G;if(C("actionExecuted",M),M.id=="copy-link"){(ae=b.value)==null||ae.startEditingCell({rowIndex:(X=(W=o.params)==null?void 0:W.node)==null?void 0:X.rowIndex,colKey:(ie=(J=o.params)==null?void 0:J.column)==null?void 0:ie.getColId()});return}else{if(M.id!=="copy-link"&&((ee=b.value)==null||ee.stopEditing()),M.id==="rename")(V=b.value)==null||V.stopEditing(),(G=b.value)==null||G.clearFocusedCell(),l();else if(M.id==="copy-link"){const te=document.getElementById(O);setTimeout(()=>{var pe,ve,re;(re=(ve=(pe=te==null?void 0:te.__vueParentComponent)==null?void 0:pe.exposed)==null?void 0:ve.focus)==null||re.call(ve)},300)}else if(["delete-rendition","delete-thumbnail"].includes(M.id)){setTimeout(()=>{S()},300);return}setTimeout(()=>{var te,pe;(pe=(te=o.params)==null?void 0:te.api)==null||pe.clearFocusedCell()},300)}},D=()=>{var M,O;(O=(M=o.params)==null?void 0:M.api)==null||O.stopEditing()},R=M=>{var O,W,X,J;return M==="archive"?!((W=(O=o.params)==null?void 0:O.data)!=null&&W.isArchived):M==="unarchive"?(J=(X=o.params)==null?void 0:X.data)==null?void 0:J.isArchived:!0},T=q(()=>v.value.map(M=>({...M,options:M.options.filter(O=>!O.hide&&R(O.id))})).filter(M=>M.options.length>0)),I=B({}),x=B(null),F=q(()=>{var O,W;if(o.focusableIndex)return o.focusableIndex;const M=(W=(O=o.params)==null?void 0:O.api)==null?void 0:W.getRowNode(String(o.id));return`${((M==null?void 0:M.rowIndex)??0)+10}`}),E=(M,O)=>`${F.value}.${M*10+O}`,A=(M,O)=>{if(O&&"focus"in O){I.value[M]=O;return}delete I.value[M]},k=M=>{M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation()};return rn(()=>{var M;(M=x.value)==null||M.focus()}),t({focus(){var W;const M=`${F.value}.0`,O=I.value[M];O&&O.focus?O.focus():(W=x.value)==null||W.focus()}}),(M,O)=>Ke((z(),ce("div",{onKeydown:k,class:Q([M.$style["more-option-section"],{[M.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:x,tabindex:"0",role:"menu"},[(z(!0),ce(xt,null,xn(T.value,(W,X)=>(z(),ce("div",{key:W.id,style:hn({"--g-number":Math.min(W.options.length,4),"--g-size":W.type==="column"?"36px":"auto"}),class:Q([M.$style["option-block"],M.$style[W.type]])},[(z(!0),ce(xt,null,xn(W.options,(J,ie)=>(z(),ce("div",{key:J.id,class:Q(M.$style["option-item"])},[fe(XX,{layer:o.layer,"scene-id":String(o.id),option:J,type:W.type,onActionExecuted:ae=>w(ae,`more-action-${ae.id}-${o.id}`),focusableIndex:E(X,ie),ref_for:!0,ref:ae=>A(E(X,ie),ae),onHandleHide:D,id:`more-action-${J.id}-${o.id}`,label:J.label},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id","label"])],2))),128))],6))),128))],34)),[[H(s),F.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"}}]]),ZX={key:0,style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center"}},XX=Et(ot({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const s=Wi,o=qt,r=e,i=B(!1),a=B(!1),l=(I,x)=>{if(!x){p();return}const F=x.target;F.closest(".tippy-content")||F.closest(".tippy-box")||F.closest("[data-tippy-root]")||F.closest(".option-item")||p()},c=B(null),{triggerRef:u,popupRef:d,show:h,isVisible:f,hide:p}=Es({toggleOnClick:!0,interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:l,appendTo:c.value||void 0}),g=n,v=async I=>{var x,F;if(!a.value){a.value=!0;try{await((F=(x=r.option).action)==null?void 0:F.call(x,I)),g("actionExecuted",r.option)}catch(E){console.error("Action execution failed:",E)}finally{a.value=!1,i.value=!1}}},C=async I=>{var x,F;if(I.preventDefault(),I.stopPropagation(),!a.value){if(r.option.isDanger){i.value=!i.value;return}if(r.option.subMenu)h();else{a.value=!0;try{await((F=(x=r.option).action)==null?void 0:F.call(x,I)),g("actionExecuted",r.option)}catch(E){console.error("Action execution failed:",E)}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",D=I=>{const x=r.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...x],column:["menu-item",...x],block:["secondary",...x]}[I]||[]},R=()=>{i.value?i.value=!1:f.value?p():g("handleHide")};t({focus:()=>{vt(()=>{u.value instanceof HTMLElement?u.value.focus():u.value&&"$el"in u.value?u.value.$el.focus():console.warn("Trigger ref is not an HTMLElement:",u.value)})},escape:()=>{p()},select:()=>{C(new MouseEvent("click"))}});const T=I=>{var x;I.stopPropagation(),I.preventDefault(),i.value=!1,(x=u.value)==null||x.focus()};return(I,x)=>{var F;return Ke((z(),ce("div",{ref_key:"wrapperRef",ref:c,class:Q(I.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:Pt(C,["stop","prevent"])},[Ke((z(),je(ht,{ref_key:"triggerRef",ref:u,class:Q(I.$style["option-item"]),disabled:e.option.disabled||a.value,actived:H(f)||i.value,size:w(e.type),variant:D(e.type),onClick:Pt(C,["stop","prevent"]),onKeydown:b,onEscape:R,label:e.option.label},{prefix:ge(()=>[e.option.icon?(z(),ce("div",ZX,[fe(at,{size:"14",src:e.option.icon,color:e.option.isDanger?void 0:"#a6a6a6",source:"remote"},null,8,["src","color"])])):Xe("",!0)]),suffix:ge(()=>[e.option.subMenu?(z(),je(at,{key:0,src:"Play",source:"remote"})):Xe("",!0),e.option.isDanger&&i.value?(z(),ce("div",{key:1,class:Q(I.$style["confirm-action"])},[Ke((z(),je(ht,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:T},{default:ge(()=>[fe(at,{src:"XMarkSolid",source:"remote"})]),_:1})),[[H(s),`${r.focusableIndex}.0`],[H(o),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((z(),je(ht,{variant:["danger","primary","icon"],size:"small",onClick:Pt(v,["stop","prevent"]),onEscape:x[0]||(x[0]=E=>i.value=!1)},{default:ge(()=>[fe(at,{src:"Check",source:"remote"})]),_:1})),[[H(s),`${r.focusableIndex}.1`],[H(o),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Xe("",!0)]),_:1},8,["class","disabled","actived","size","variant","label"])),[[H(s),r.focusableIndex]]),e.option.subMenu?(z(),ce("div",{key:0,ref_key:"popupRef",ref:d,class:Q(I.$style["submenu-container"])},[fe(Lk,{focusableIndex:r.focusableIndex,layer:r.layer+1,ref:"submenuRef","option-block":[((F=e.option)==null?void 0:F.subMenu)||[]],"is-submenu":!1,onActionExecuted:S},null,8,["focusableIndex","layer","option-block"])],2)):Xe("",!0)],2)),[[H(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"}}]]),JX={style:{"max-width":"225px","line-height":"14px"}},QX={style:{"max-width":"100px","line-height":"14px"}},eJ=Et(ot({__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=qt,s=Wi,o=e,r=t,i=Wm(),{handelSelectAll:a}=i,{selectionStatus:l}=Qs(i),c=q(()=>l.value===At.CHECKED),u=q(()=>o.selectRowData.map(ve=>ve.id)),d=q(()=>o.selectRowData.length>0);Xr("bulkUpdate",d),Xr("isSelectAll",c);const h=({itemIds:ve,data:re})=>{const oe=o.gridApi;ve.forEach(K=>{if(!oe){console.error("Grid API is undefined");return}const me=oe.getRowNode(K);if(me){const se={...me.data,status:re};me.setData(se)}})},f=q(()=>o.selectRowData),p=({itemIds:ve,data:re})=>{const oe=o.gridApi;if(!oe){console.error("Grid API is undefined");return}ve.forEach(K=>{const me=oe.getRowNode(K);if(me){const se=me.data.dateRange||[null,null];"startDate"in re&&re.startDate!==void 0&&(se[0]=re.startDate?new Date(re.startDate):null),"dueDate"in re&&re.dueDate!==void 0&&(se[1]=re.dueDate?new Date(re.dueDate):null);const Se={...me.data,dateRange:se};me.setData(Se)}}),r("updated")},g=q(()=>o.selectRowData.map(ve=>ve.id)),v=ve=>{const re=o.gridApi,{id:oe,value:K}=ve;if(!re){console.error("Grid API is undefined");return}g.value.forEach(me=>{const se=re.getRowNode(me);if(se){const Se={...se.data,[`metric_${oe}`]:K};se.setData(Se)}}),r("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=()=>{r("unselect")},w=Yb(),{userPermissions:D}=Qs(w),R=q(()=>D.value.includes(Zb)),T=q(()=>{if(!R.value){console.error("User does not have permission to open review.");return}if(l.value==At.CHECKED)return Xs({type:"review_take",config:{reviewDomain:un.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,take_id:o.entityId}}).url;const ve=o.selectRowData.map(oe=>oe.id).join(",");return Xs({type:"review_multiple_scenes",config:{reviewDomain:un.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,scene_ids:ve}}).url}),I=ve=>{const{assignees:re,type:oe}=ve,K=o.gridApi;if(!K){console.error("Grid API is not available for bulk update.");return}o.selectRowData.map(se=>{const Se=K.getRowNode(se.id);if(!Se)return null;const U=Se.data.assignees||[];let Z=[];switch(oe){case"add":{const de=new Set(U.map(Fe=>Fe.id)),Ae=re.filter(Fe=>!de.has(Fe.id));Z=[...U,...Ae];break}case"overwrite":{Z=re;break}case"remove":{const de=new Set(re.map(Ae=>Ae.id));Z=U.filter(Ae=>!de.has(Ae.id));break}case"removeAll":{Z=[];break}}return{...Se.data,assignees:Z}}).filter(se=>se!==null).forEach(se=>{const Se=K.getRowNode(se.id);Se&&Se.setData(se)})},{apiServices:x}=ts(!1,o),F=async()=>{var K;const ve=o.selectRowData.map(me=>me.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk delete.");return}const oe=await((K=x.value)==null?void 0:K.bulkDeleteItems(M.value));(oe==null?void 0:oe.message)=="Done"&&(ve.forEach(me=>{const se=re.getRowNode(me);if(se){const Se={...se.data,isDeleted:!0,disabled:!0};se.setData(Se)}}),re.deselectAll())},E=B(null),A=async()=>{var K,me,se;const ve=o.selectRowData.map(Se=>Se.id);if(!o.gridApi){console.error("Grid API is not available for bulk unarchive.");return}const oe=await((K=x.value)==null?void 0:K.bulkUnarchiveItems(M.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to unarchive items."),(me=E.value)==null||me.open();return}W(ve,"isArchived",!1),(se=E.value)==null||se.hide()},k=_n("filterParams",void 0),M=q(()=>({workspaceId:String(o.workspaceId),itemIds:d.value&&c.value?[]:o.selectRowData.map(ve=>ve.id),entityId:o.entityId,filterParams:k!=null&&k.value?k.value:void 0})),O=async()=>{var K,me,se;const ve=o.selectRowData.map(Se=>Se.id);if(!o.gridApi){console.error("Grid API is not available for bulk archive.");return}const oe=await((K=x.value)==null?void 0:K.bulkArchiveItems(M.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to archive items."),(me=E.value)==null||me.open();return}W(ve,"isArchived",!0),(se=E.value)==null||se.hide()},W=(ve,re,oe)=>{const K=o.gridApi;if(!K){console.error("Grid API is not available for bulk update.");return}const me=ve.map(se=>{const Se=K.getRowNode(se);if(Se){const U={...Se.data,[re]:oe};Se.setData(U)}return Se}).filter(se=>se!=null);K.redrawRows({rowNodes:me})},X=async()=>{var K,me,se;const ve=o.selectRowData.map(Se=>Se.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk thumbnail deletion.");return}const oe=await((K=x.value)==null?void 0:K.deleteThumbnail(M.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to delete thumbnails."),(me=E.value)==null||me.open();return}ve.forEach(Se=>{const U=re.getRowNode(Se);if(U){const Z={...U.data,thumbnail:null};U.setData(Z)}}),(se=E.value)==null||se.hide()},J=async()=>{var K,me,se;const ve=o.selectRowData.map(Se=>Se.id),re=o.gridApi;if(!re){console.error("Grid API is not available for bulk rendition deletion.");return}const oe=await((K=x.value)==null?void 0:K.deleteRendition(M.value));if((oe==null?void 0:oe.message)!="Done"){console.error("Failed to delete renditions."),(me=E.value)==null||me.open();return}ve.forEach(Se=>{const U=re.getRowNode(Se);if(U){const Z={...U.data,rendition:null};U.setData(Z)}}),(se=E.value)==null||se.hide()},ie=B(!1),ae=B(null),ee=async ve=>{var re,oe;try{switch(G.value=!0,ie.value=!0,ve.id){case"unarchive":await A();break;case"delete":await F();break;case"archive":await O();break;case"delete-thumbnail":await X();break;case"delete-rendition":await J();break;default:console.error("Unknown action:",ve.id),ie.value=!1;break}}catch(K){console.error("Error performing action:",K),(re=E.value)==null||re.open()}finally{(oe=ae.value)==null||oe.focus(),vt(()=>{G.value=!1,ie.value=!1})}},V=(ve,re)=>{var oe;!ve&&re&&((oe=ae.value)==null||oe.focus())},G=B(!0),te=ve=>{vt(()=>{G.value=ve})};et(()=>o.selectRowData,ve=>{G.value=!1},{deep:!0,immediate:!0});const pe=q(()=>({workspaceId:o.workspaceId,entityId:o.entityId,variant:C,disabled:G.value,ids:u.value}));return(ve,re)=>Ke((z(),ce("div",{class:Q(ve.$style["bulk-update-action"])},[be("div",{class:Q(ve.$style["left-actions"])},[be("div",{class:Q(ve.$style["selection-track"])},[fe(ht,{class:Q(ve.$style["btn-close"]),variant:["tertiary","icon"],onClick:b,style:{background:"transparent"}},{prefix:ge(()=>[fe(at,{src:"XMarkSolid",source:"remote"})]),_:1},8,["class"]),H(l)==H(At).INDETERMINATE?(z(),ce("span",{key:0,class:Q(ve.$style["selected-count"])},Ct(e.selectRowData.length)+" selected ",3)):Xe("",!0),H(l)==H(At).CHECKED?(z(),ce("span",{key:1,class:Q(ve.$style["selected-count"]),style:{"line-height":"14px"}},[re[12]||(re[12]=st(' All in " ',-1)),Ke((z(),ce("span",JX,[st(Ct(e.takeName),1)])),[[H(n),{content:e.takeName}]]),re[13]||(re[13]=st(' " ',-1))],2)):Xe("",!0),!e.loading&&H(l)==H(At).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(z(),je(ht,{key:2,variant:"secondary",onHandleClick:H(a)},{default:ge(()=>[be("span",{class:Q(ve.$style["selected-count"]),style:{"line-height":"14px"}},[re[14]||(re[14]=st(' Select all in " ',-1)),Ke((z(),ce("span",QX,[st(Ct(e.takeName),1)])),[[H(n),{content:e.takeName}]]),re[15]||(re[15]=st(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Xe("",!0),be("span",{class:Q(ve.$style.divider)},null,2)],2),fe(YX,Kt(pe.value,{onUpdated:h,onUpdateStart:re[0]||(re[0]=oe=>G.value=!0),onUpdateCompleted:re[1]||(re[1]=oe=>te(!1)),onUpdateFailed:re[2]||(re[2]=oe=>te(!1)),"selected-all":H(l)==H(At).CHECKED}),null,16,["selected-all"]),fe($Y,Kt({onUpdate:I,onUpdateStart:re[3]||(re[3]=oe=>G.value=!0),onUpdateCompleted:re[4]||(re[4]=oe=>te(!1)),onUpdateFailed:re[5]||(re[5]=oe=>te(!1)),"selected-all":H(l)==H(At).CHECKED},pe.value),null,16,["selected-all"]),fe(QY,Kt({"row-selected":f.value,"selected-all":H(l)==H(At).CHECKED},pe.value,{onUpdated:p,onUpdateStart:re[6]||(re[6]=oe=>G.value=!0),onUpdateCompleted:re[7]||(re[7]=oe=>te(!1)),onUpdateFailed:re[8]||(re[8]=oe=>te(!1))}),null,16,["row-selected","selected-all"]),fe(jX,{disabled:G.value,onUpdate:v,onUpdateStart:re[9]||(re[9]=oe=>G.value=!0),onUpdateCompleted:re[10]||(re[10]=oe=>te(!1)),onUpdateFailed:re[11]||(re[11]=oe=>te(!1)),selectedIds:u.value,"workspace-id":e.workspaceId,variant:C,"entity-id":e.entityId,"selected-all":H(l)==H(At).CHECKED},null,8,["disabled","selectedIds","workspace-id","entity-id","selected-all"]),be("span",{class:Q(ve.$style.divider)},null,2),Ke((z(),ce("div",null,[R.value?(z(),je(ht,{key:0,class:Q(ve.$style["action-button"]),variant:[...C,"icon"],href:T.value,disabled:o.selectRowData.length>40&&H(l)!=H(At).CHECKED},{default:ge(()=>[fe(at,{src:"PenRuler",class:Q(ve.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","href","disabled"])):Xe("",!0)])),[[H(n),o.selectRowData.length<=40||H(l)==H(At).CHECKED?"Open in Review":"Select fewer than 40 items to open in Review"]]),be("span",{class:Q(ve.$style.divider)},null,2),fe(nf,{ref_key:"wrapperRef",ref:E,isUpdating:G.value,disabled:G.value,onOnVisibleChange:V},{trigger:ge(({hide:oe,toggle:K,isVisible:me,disabled:se})=>[Ke((z(),je(ht,{onEscape:oe,actived:me,ref_key:"moreActionRef",ref:ae,class:Q(ve.$style["action-button"]),variant:["secondary","icon"],loading:ie.value,disabled:se||G.value,onClick:Pt(K,["stop"])},{default:ge(()=>[fe(at,{src:"EllipsisVertical",class:Q(ve.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","loading","disabled","onClick"])),[[H(s),"99999"],[H(n),{content:"More actions"}]])]),popup:ge(({isVisible:oe,hide:K})=>[(z(),ce(xt,null,xn(S,(me,se)=>fe(ec,Kt({clickable:!0,key:me.id},{ref_for:!0},me,{show:oe,style:{borderLeft:0},"focus-index":"99999."+se,onClick:()=>{ee(me)},onEscape:K}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1},8,["isUpdating","disabled"])],2)],2)),[[Ko,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_1m5lx_1","left-actions":"_left-actions_1m5lx_19","right-actions":"_right-actions_1m5lx_20","selection-track":"_selection-track_1m5lx_25","btn-close":"_btn-close_1m5lx_31","close-icon":"_close-icon_1m5lx_37","selected-count":"_selected-count_1m5lx_41",divider:"_divider_1m5lx_47","more-button":"_more-button_1m5lx_52",dropdown:"_dropdown_1m5lx_56","dropdown-content":"_dropdown-content_1m5lx_59",delete:"_delete_1m5lx_82","icon-btn":"_icon-btn_1m5lx_89","selected-list":"_selected-list_1m5lx_93"}}]]),za=Et(ot({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=qt,s=e,o=q(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:s.value===void 0||s.value===null||s.value==="",clickable:!0})),{argsMain:r}=ys(o),i=q(()=>{var c,u,d;return!!((c=s.params)!=null&&c.api||(u=s.params)!=null&&u.node||(d=s.params)!=null&&d.context)}),a=q(()=>{if(s.tooltip){if(typeof s.tooltip=="string")return{content:s.tooltip};if(typeof s.tooltip=="object"&&"display_name"in s.tooltip){const c=s.tooltip,u=document.createElement("div");u.classList.add("tooltip-user-info"),u.style.display="flex",u.style.alignItems="center",u.style.gap="4px";const d=document.createElement("div"),h=fe(Th,{id:c.id,name:c.display_name,profile_image:c.profile_image,size:20,initial:c.initial,color:c.color});zw(h,d);const f=document.createElement("span");f.innerText=c.display_name,f.classList.add("tooltip-user-name");const p=document.createElement("span");p.style.whiteSpace="nowrap",p.innerText="By",u.appendChild(p),u.appendChild(d),u.appendChild(f);const g=document.getElementById("item-table-layout-id");return{content:u,allowHtml:!0,appendTo:g||document.body,bypassOverflowCheck:!0}}}return{content:void 0}}),l=q(()=>s.value===void 0);return(c,u)=>Ke((z(),je(ws,Kt(H(r),{ref:"displayWrapperRef"}),{default:ge(()=>[be("span",{class:Q(c.$style["item-table-label-renderer"])},Ct(s.value||"-"),3)]),_:1},16)),[[H(t),{isLoading:l.value||!i.value}],[H(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),tJ=["placeholder","maxlength"],nJ={key:0,class:"wrapper-suffix"},sJ=Et(ot({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=qt,r=e,i=n,a=B(r.value),l=B(null),c=B(null),u=B(r.value||""),d=B(!1),h=B(!1),f=q(()=>{var E;return{disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((E=r.value)==null?void 0:E.length)===0,inputRef:l,wrapperRef:c,clickable:!0,focused:d.value||r.keyboardFocusing}}),{argsMain:p,isHover:g}=ys(f),v=()=>u.value!==a.value,C=()=>{h.value=!0,d.value=!1,u.value=a.value,i("update:value",a.value),setTimeout(()=>{h.value=!1},100)},S=()=>{if(!d.value||!l.value)return;const E=l.value.value;if(!v()){d.value=!1;return}a.value=E,i("update:value",E),i("enter",E),d.value=!1},b=()=>{h.value||(r.saveOnBlur?S():C(),i("blur",u.value))},w=E=>{var A;if(E.key==="ArrowLeft"||E.key==="ArrowRight"){E.stopPropagation();return}E.ctrlKey&&(E.key=="a"||E.key=="A")?(E.stopPropagation(),(A=l.value)==null||A.select()):E.key==="Enter"?(E.preventDefault(),E.stopPropagation(),S()):E.key==="Escape"&&(E.preventDefault(),E.stopPropagation(),C())},D=()=>{a.value=r.value,u.value=r.value,d.value=!0,vt(()=>{var E,A;(E=l.value)==null||E.click(),(A=l.value)==null||A.focus()})},R=()=>{var E;d.value?C():(E=l.value)==null||E.blur(),i("blur",u.value)},T={focus:()=>{D()}};rn(()=>{var A;const E=(A=c.value)==null?void 0:A.$el;E&&(E.__sceneNameEditor=T)}),ms(()=>{const E=c.value;E&&delete E.__sceneNameEditor});const I=B(null),x=B(null);t({focus:D,blur:()=>{var E;return(E=l.value)==null?void 0:E.blur()},save:S,cancel:C,focusEditButton:()=>{vt(()=>{var E;(E=I.value)==null||E.focus()})},focusCancelButton:()=>{vt(()=>{var E;(E=x.value)==null||E.focus()})},startEdit:D});const F=q(()=>r.value===void 0);return Qb(c,()=>{d.value&&b()}),(E,A)=>Ke((z(),je(H(ws),Kt(H(p),{ref_key:"wrapperRef",ref:c,bordered:r.bordered,style:{paddingTop:"0px",paddingBottom:"0px"}}),nh({default:ge(()=>[d.value?Xe("",!0):Tt(E.$slots,"default",{key:0,isEditting:d.value,isHover:H(g)},()=>[Ke((z(),ce("span",{class:Q(E.$style["label-renderer"])},[st(Ct(u.value),1)],2)),[[H(o),{content:u.value||void 0}]])]),Ke(be("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":A[0]||(A[0]=k=>u.value=k),class:Q(E.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:w,onBlur:b},null,42,tJ),[[Ko,d.value],[yT,u.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:ge(({hovered:k,focused:M})=>[k?(z(),ce("div",nJ,[k&&!M?Ke((z(),je(ht,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(D,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:I,onKeydown:[zn(Pt(D,["prevent","stop"]),["enter"]),zn(Pt(R,["prevent","stop"]),["escape"])]},{default:ge(()=>[fe(H(at),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[H(o),"Edit"]]):Xe("",!0)])):Xe("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[H(s),{isLoading:F.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),oJ=["tabindex"],Vk=Et(ot({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=qt,o=To,r=e,i=n,a=B(r.value),l=B(r.value),c=B(null),u=B(null),d=_n("bulkUpdate",!1),{apiServices:h}=ts(!d,r),f=q(()=>{var ae;return{componentType:void 0,disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((ae=a==null?void 0:a.value)==null?void 0:ae.length)===0,inputRef:c,wrapperRef:u,clickable:!0}}),{isFocus:p}=ys(f),g=q(()=>{const ae=un.getInstance().getItem("ws.code"),ee=un.getInstance().getItem("BASE_URL"),V=ae||r.workspaceId;return Xs({type:"scene_hub",config:{baseDomain:ee,ws_code:V,scene_id:String(r.id)}}).url}),v=q(()=>{var ae,ee,V;return((ee=(ae=r.data)==null?void 0:ae.isProcessing)==null?void 0:ee.state)==0||((V=r.data)==null?void 0:V.isDeleted)==!0}),C=q(()=>r.readOnly||R.value),S=q(()=>{var ae,ee,V,G,te;return((ae=r.data)==null?void 0:ae.isDeleted)==!0||((V=(ee=r.data)==null?void 0:ee.isProcessing)==null?void 0:V.state)==0||((te=(G=r.data)==null?void 0:G.isProcessing)==null?void 0:te.state)==1}),b=q(()=>{var ae,ee;return(ee=(ae=r.data)==null?void 0:ae.isProcessing)==null?void 0:ee.message}),w=q(()=>{var ae;return((ae=r.data)==null?void 0:ae.isArchived)==1}),D=q(()=>{var ae;return((ae=r.data)==null?void 0:ae.isLocked)==1}),R=q(()=>r.value===void 0),T=q(()=>{var ae,ee;return((ee=(ae=r.data)==null?void 0:ae.permissions)==null?void 0:ee.has_edit_permission)==1}),I=async ae=>{var ee,V,G,te,pe,ve,re,oe,K,me;a.value=ae,p.value=!1;try{const se=await((V=(ee=h.value)==null?void 0:ee.updateSceneName)==null?void 0:V.call(ee,{workspaceId:r.workspaceId,entityId:r.entityId,itemId:r.id,name:a.value})),Se=PF.get(EF)||"UTC";if(se){const U=TF(se,Se),Z={...r.data,...U};(G=r.params)==null||G.api.clearFocusedCell();const de=((pe=(te=r.params)==null?void 0:te.column)==null?void 0:pe.getColId())||"",Ae=((re=(ve=r.params)==null?void 0:ve.node)==null?void 0:re.rowIndex)||0;(oe=r.params)==null||oe.api.setFocusedCell(Ae,de),(me=(K=r.params)==null?void 0:K.node)==null||me.setData(Z),l.value=a.value,i("enter")}else a.value=l.value}catch(se){console.error("Failed to update scene name:",se),a.value=l.value}},x={focus:()=>{p.value=!0,vt(()=>{var ae;return(ae=u.value)==null?void 0:ae.focus()})},startEdit:()=>{var ae;(ae=u.value)==null||ae.startEdit()}},F=()=>u.value?"$el"in u.value?u.value.$el:u.value:null;et(()=>r.value,ae=>{a.value=ae,l.value=ae}),rn(()=>{const ae=F();ae&&(ae.__sceneNameEditor=x)}),ms(()=>{const ae=u.value,ee=ae&&"$el"in ae?ae.$el:ae;ee&&delete ee.__sceneNameEditor});const E=ef(),{openSceneHub:A}=E,k=ae=>{try{if(ae.ctrlKey||ae.metaKey){window.open(g.value,"_blank");return}A(String(r.id))}catch{window.open(g.value,"_blank")}finally{J()}},M=()=>{setTimeout(()=>{ie.value=!0,O.value=0,vt(()=>{var ae;(ae=W.value)==null||ae.focus()})},300)},O=B(-1),W=B(null);t({focus:M,trigerFocus:M,startEdit:()=>{var ae;(ae=u.value)==null||ae.startEdit()}});const X=ae=>{if(ae.key==="Enter"){ae.preventDefault(),k(ae);return}if(ae.key==="Escape"){ae.preventDefault(),J();return}ae.key==="Tab"&&(ae.preventDefault(),ae.stopPropagation(),ae.stopImmediatePropagation(),vt(()=>{var ee;(ee=u.value)==null||ee.focusEditButton()}))},J=()=>{var V,G,te,pe,ve,re;ie.value=!1,O.value=-1,(V=r.params)==null||V.api.clearFocusedCell();const ae=((te=(G=r.params)==null?void 0:G.column)==null?void 0:te.getColId())||"",ee=((ve=(pe=r.params)==null?void 0:pe.node)==null?void 0:ve.rowIndex)||0;(re=r.params)==null||re.api.setFocusedCell(ee,ae)},ie=B(!1);return(ae,ee)=>Ke((z(),je(sJ,{"save-on-blur":!0,ref_key:"wrapperRef",ref:u,disabled:r.disabled,"read-only":C.value,placeholder:r.placeholder,value:a.value,"onUpdate:value":ee[0]||(ee[0]=V=>a.value=V),id:`scene-name-${r.id}`,onEnter:I,"max-length":255,bordered:!0,keyboardFocusing:ie.value,onBlur:J},{default:ge(({isHover:V,isEditting:G})=>[Ke(be("div",{class:Q(ae.$style["scene-name-display"])},[Ke((z(),ce("a",{tabindex:O.value,ref_key:"nameRef",ref:W,onClick:Pt(k,["prevent"]),onKeydown:X,target:"_blank",class:Q(ae.$style["scene-name-text"]),style:{lineHeight:"28px"}},[st(Ct(a.value),1)],42,oJ)),[[H(s),{content:a.value,delay:[1e3,0]}]]),C.value||!V&&!G&&!C.value?(z(),ce(xt,{key:0},[D.value?Ke((z(),ce("div",{key:0,class:Q([ae.$style["icon-processing"],ae.$style.isLocked])},[fe(at,{src:"Lock",color:T.value?"#a6a6a6":"#232323"},null,8,["color"])],2)),[[H(s),{content:T.value?"Locked — You can still edit, or unlock by changing the status from completed":"Locked",delay:[1e3,0]}]]):Xe("",!0),w.value?Ke((z(),ce("div",{key:1,class:Q([ae.$style["icon-processing"],ae.$style.archived])},[fe(at,{src:"BoxArchive"})],2)),[[H(s),{content:"Archived",delay:[1e3,0]}]]):Xe("",!0),S.value?Ke((z(),ce("div",{key:2,class:Q([ae.$style["icon-processing"],ae.$style.processing,v.value&&ae.$style["icon-red"]])},[fe(at,{src:"AnimatedHourglass",color:"inherit"})],2)),[[H(s),b.value]]):Xe("",!0)],64)):Xe("",!0)],2),[[Ko,!H(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[H(o),{isLoading:R.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_nare0_1","scene-name-display":"_scene-name-display_nare0_11","icon-processing":"_icon-processing_nare0_18",archived:"_archived_nare0_28",locked:"_locked_nare0_31",processing:"_processing_nare0_34","icon-red":"_icon-red_nare0_38","scene-name-text":"_scene-name-text_nare0_43"}}]]),pS=Et(ot({__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=Wi,o=B([]),r=e,i=B(null),a=q(()=>typeof r.size=="number"?`${r.size}px`:{small:"24px",medium:"32px",large:"48px"}[r.size]??"32px"),l=q(()=>{let C=[];return typeof r.variant=="string"?C.push(r.variant):Array.isArray(r.variant)&&(C=[...r.variant]),[...C,"icon"]}),c=n,{hide:u,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=Es({toggleOnClick:!0,offset:[0,0]});function v(C){c("select",C),u()}return th(()=>{g.value&&g.value.setProps({placement:r.placement})}),t({show:h,hide:u,hideDropdown:()=>{u()},popupRef:p}),et(d,C=>{var S;C&&((S=p.value)==null||S.focus())}),(C,S)=>(z(),ce("div",{class:Q(C.$style["button-dropdown-wrapper"]),style:hn({"--button-size":a.value})},[be("div",{class:Q(C.$style["button-group"])},[Tt(C.$slots,"prefix"),be("div",{ref_key:"triggerRef",ref:f,class:Q(H(d)?C.$style.open:"")},[Tt(C.$slots,"triggerDropdown",{open:H(d)},()=>[r.readOnly?Xe("",!0):Ke((z(),je(ht,{key:0,onEscape:H(u),ref_key:"mainButton",ref:i,actived:H(d),class:Q(C.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:r.disabled},{default:ge(()=>[Tt(C.$slots,"iconDropdown",{},()=>[fe(at,{class:Q(C.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[H(s),e.tabIndex]])])],2)],2),be("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:Q(C.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(z(!0),ce(xt,null,xn(e.options,(b,w)=>Ke((z(),je(ec,Kt({ref_for:!0,ref:D=>o.value[w]=D,key:b.value},{ref_for:!0},{...b},{"icon-name":b.icon,onClick:Pt(D=>v(b.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:ge(()=>[st(Ct(b.label),1)]),_:2},1040,["icon-name","onClick"])),[[H(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"}}]]),hf=Et(ot({__name:"CloseBadgeWrapper",props:{disableRemove:{type:Boolean,default:!0},tooltip:{default:"Unassign"}},emits:["clear"],setup(e,{emit:t}){const n=qt,s=e,o=t,r=a=>{a.preventDefault(),a.stopImmediatePropagation(),a.stopPropagation(),o("clear")},i=q(()=>({content:s.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(z(),ce("div",{class:Q(a.$style["close-wrapper"])},[e.disableRemove?Xe("",!0):(z(),ce("div",{key:0,class:Q(a.$style["close-button"])},[Ke((z(),je(ht,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:r,size:16,rounded:!0},{default:ge(()=>[fe(at,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[H(n),i.value]])],2)),Tt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_15u1e_1","close-button":"_close-button_15u1e_5"}}]]),rJ=Et(ot({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=qt,n=To,s=e,{isEditing:o}=Fu(s),r=B(s.value),i=B(null),a=B(null),{apiServices:l}=ts(!0,s),c=B(!0),u=()=>{c.value=s.value===void 0};eh(()=>{u()}),rn(()=>{u()}),et(()=>s.value,I=>{u()});const d=q(()=>({disabled:s.disabled,readOnly:s.readOnly,error:s.error,inputRef:i,wrapperRef:a,clickable:!(s.readOnly||c.value),active:o})),{argsMain:h,isHover:f}=ys(d),p=q(()=>{var I;return((I=r.value)==null?void 0:I.slice(0,s.maxVisible))||[]}),g=q(()=>{var I;return Math.max(0,(((I=r.value)==null?void 0:I.length)||0)-s.maxVisible)}),v=q(()=>{var I;return g.value<=0?"":((I=r.value)==null?void 0:I.slice(s.maxVisible).map(x=>x.name).join(", "))||""}),C=q(()=>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=q(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));et(()=>s.value,I=>{r.value=I},{immediate:!0,deep:!0});const b=async I=>{var F,E,A;await T(I)&&(r.value=(F=r.value)==null?void 0:F.filter(k=>k.id!==I),(A=s.params)==null||A.node.setData({...(E=s.params)==null?void 0:E.node.data,assignees:r.value}))},w=I=>{var F;const x=un.getInstance().getItem("ws.code");return((F=l.value)==null?void 0:F.getUserInformation(x,I))||Promise.resolve(null)},{id:D}=Up(s),R=I=>{var F,E;const x=(E=(F=s.params)==null?void 0:F.api)==null?void 0:E.getRowNode(String(D.value));x==null||x.setDataValue("assignees",NI(I.assignees))},{removeAssignee:T}=mm({...s,entityId:s.entityId,updateRowData:R,value:s.value,errorCallback:()=>{}});return(I,x)=>Ke((z(),je(ws,Kt(H(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:ge(()=>{var F;return[be("div",{class:Q(I.$style.assigneeGroupRenderer)},[((F=r.value)==null?void 0:F.length)===0?(z(),je(at,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:hn(S.value)},null,8,["style"])):Xe("",!0),(z(!0),ce(xt,null,xn(C.value,E=>(z(),je(hf,{key:E.id,"disable-remove":s.readOnly||s.disabled,onClear:A=>b(E.id),style:{marginLeft:"0"}},{default:ge(()=>[fe(Au,{user:E.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((z(),ce("div",{key:1,class:Q(I.$style["extra-avatars"])},[st(" +"+Ct(g.value),1)],2)),[[H(t),v.value]]):Xe("",!0)],2)]}),_:1},16)),[[H(n),{isLoading:c.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"}}]]),iJ=Et(ot({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=qt,n=To,s=wb(),o=e,r=B(null),i=B(null),{isEditing:a}=Fu(o),l=I=>{if(I){if(typeof I=="string")return I;if(I instanceof Date)return I.toISOString()}},c=q(()=>o.value===void 0),u=q(()=>{var I;return(I=o.data)==null?void 0:I.isStarted}),d=q(()=>{var I;return(I=o.data)==null?void 0:I.isCompleted}),h=q(()=>!!(o.value&&(o.value[0]||o.value[1]))),f=q(()=>h.value?o.disabled&&!o.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=q(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,inputRef:r,wrapperRef:i,clickable:!0,active:a})),{argsMain:g}=ys(p),{startDate:v,endDate:C,startClasses:S,endClasses:b,fullStartDate:w,fullEndDate:D}=N9({start:l((R=o.value)==null?void 0:R[0]),end:l((T=o.value)==null?void 0:T[1]),isStarted:u.value,isEnded:d.value,timezone:o.timezone||s});return(I,x)=>Ke((z(),je(ws,Kt(H(g),{ref_key:"wrapperRef",ref:i,bordered:!0}),{default:ge(()=>[c.value?Xe("",!0):(z(),ce("div",{key:0,class:Q(I.$style.dateRangeRenderer)},[h.value?Xe("",!0):(z(),je(at,{key:0,src:"Calendar",class:Q(I.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(z(),ce(xt,{key:1},[Ke((z(),ce("span",{class:Q([I.$style.dateLabelDisplay,...H(S).map(F=>I.$style[F])])},[st(Ct(H(v)),1)],2)),[[H(t),H(w)]]),x[0]||(x[0]=be("span",null,"→",-1)),Ke((z(),ce("span",{class:Q([I.$style.dateLabelDisplay,...H(b).map(F=>I.$style[F])])},[st(Ct(H(C)),1)],2)),[[H(t),H(D)]])],64)):Xe("",!0)],2))]),_:1},16)),[[H(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_rsfrm_1",calendarIcon:"_calendarIcon_rsfrm_8",dateSection:"_dateSection_rsfrm_12",dateLabelDisplay:"_dateLabelDisplay_rsfrm_19",empty:"_empty_rsfrm_29","end-today":"_end-today_rsfrm_35",actual:"_actual_rsfrm_38","end-tomorrow":"_end-tomorrow_rsfrm_41","end-yesterday":"_end-yesterday_rsfrm_47","end-past":"_end-past_rsfrm_53","end-future":"_end-future_rsfrm_59","start-today":"_start-today_rsfrm_62","start-tomorrow":"_start-tomorrow_rsfrm_68","start-yesterday":"_start-yesterday_rsfrm_74","start-past":"_start-past_rsfrm_80","start-future":"_start-future_rsfrm_86"}}]]),aJ=ot({__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:wb()}},emits:["closed"],setup(e,{expose:t,emit:n}){const s=B(null);rn(()=>{vt(()=>{s.value&&s.value.focus()})});const o=e,r=n,i=()=>{var C;(C=o.params)==null||C.api.stopEditing(),r("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})},c=async()=>{await v({startDate:null})},u=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,D,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({...(D=o.params)==null?void 0:D.node.data,dateRange:T==null?void 0:T.dateRange}))}catch(T){console.error("Failed to update scene name:",T)}};return t({focus:()=>{vt(()=>{var C;(C=s.value)==null||C.focus()})}}),(C,S)=>(z(),je(Am,Kt(o,{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:u,onClearStart:c,onClosed:i,ref_key:"calendarRef",ref:s}),null,16))}}),lJ=Et(ot({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=B(null),s=B(0);let o=null;rn(()=>{n.value&&(o=new ResizeObserver(i=>{for(const a of i)s.value=a.contentRect.height}),o.observe(n.value))}),zc(()=>{o&&n.value&&o.unobserve(n.value)});const r=q(()=>{const i=s.value;return i>120?i-42-36:0});return(i,a)=>(z(),ce("div",{class:Q(i.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[be("div",{class:Q(i.$style["item-header"])},[be("div",{class:Q(i.$style["item-header__left"])},[Tt(i.$slots,"header-left",{},()=>[be("h1",{class:Q(i.$style["item-header__title"])},[Tt(i.$slots,"title",{},()=>[a[0]||(a[0]=st("Items",-1))])],2)])],2),be("div",{class:Q(i.$style["item-header__spacer"])},null,2),be("div",{class:Q(i.$style["item-header__actions"])},[Tt(i.$slots,"header-actions")],2)],2),Tt(i.$slots,"grid",{availableHeight:r.value}),be("div",{class:Q(i.$style.footer)},[Tt(i.$slots,"footer")],2),Tt(i.$slots,"new-row"),Tt(i.$slots,"bulk-update-actions"),Tt(i.$slots,"snackbar"),Tt(i.$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"}}]]),Bk=(e,t)=>{const n=B(Number(e.value.value)),s=q(()=>e.value.metricConfig),o=q(()=>{var g,v;const l=s.value,c=t.value,u=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"||u&&((g=l==null?void 0:l.metric_type)==null?void 0:g.code)==="formula",isEmpty:u,isError:d,hasPrefix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="prefix",hasSuffix:!u&&!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:c&&!u&&!f}}),r=17,i=q(()=>{var l;return{maxRating:((l=s.value)==null?void 0:l.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:r}});return{componentState:o,metricConfig:s,ICON_SIZE:r,ratingParams:i,standardNameforIcon:()=>{var c;return(((c=s.value)==null?void 0:c.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},cJ=["aria-label"],$k=Et(ot({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=qt,o=e,r=Gp(!1),i=B(null),a=B(null),{isEditing:l}=Fu(o),c=q(()=>{var O,W;return{value:o.value,metricConfig:((W=(O=o.params)==null?void 0:O.colDef)==null?void 0:W.context)||o.config,error:o.error,hovered:r.value,readOnly:o.readOnly,disabled:o.disabled,active:l}}),{componentState:u,metricConfig:d,internalValue:h}=Bk(c,r),f=q(()=>{var W,X;let O=!1;if(["number","formula"].includes(d.value.metric_type.code)){const J=Number(o.value),ie=Number((W=d.value)==null?void 0:W.format_value);Number.isFinite(ie)&&ie>=0&&(O=(((X=J.toString().split(".")[1])==null?void 0:X.length)||0)>ie)}return O}),p=q(()=>{var O;return!!((O=d.value)!=null&&O.morpheme_value)||u.value.isEmpty||f.value}),g=q(()=>{var X,J,ie;if(u.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(u.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(u.value.isEmpty)return;const O=x.value,W=(X=d.value)==null?void 0:X.morpheme_type;return W==="prefix"?`${((J=d.value)==null?void 0:J.morpheme_value)||""} ${O}`.trim():W==="suffix"?`${O} ${((ie=d.value)==null?void 0:ie.morpheme_value)||""}`.trim():O}),v=q(()=>{const{format_type:O,format_value:W}=d.value;if(O==="dropdown"&&typeof W=="string"&&W.startsWith("["))try{return JSON.parse(W)}catch{return[]}return[]}),C=q(()=>({disabled:o.disabled,error:u.value.isError,inputRef:i,wrapperRef:a,clickable:!I.value,readOnly:o.readOnly||I.value,isEmpty:u.value.isEmpty})),{argsMain:S,isHover:b}=ys(C),w=(O,W,X="en-US")=>new Intl.NumberFormat(X,{minimumFractionDigits:W,maximumFractionDigits:W}).format(O),D=q(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const O=o.value,{format_type:W,format_value:X,mapping:J}=d.value;if(J&&typeof J=="object"&&!Array.isArray(J)){const ie=J[`!${O}`];if(ie)return ie}if(W==="dropdown"){const ie=v.value.find(ae=>String(ae.name)===String(O));if(ie)return ie.name}if(typeof O=="string"){const ie=Number(O);return Number.isNaN(ie)?O:O.replace(/[.-]/g,"").length>16?R(O,X):R(ie,X)}return typeof O=="number"?R(O,X):String(O)}),R=(O,W)=>{const X=Number.parseInt(String(W)||"2",10),J=Number.isFinite(X)&&X>=0?X:2;try{if(typeof O=="string"){const ie=O.split("."),ae=ie[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ee=ie[1]?ie[1].substring(0,J).padEnd(J,"0"):"0".repeat(J);return J>0?`${ae}.${ee}`:ae}return w(O,J)}catch(ie){return console.error("Error formatting metric value:",ie,{num:O,decimals:J}),String(O)}},T=(O,W)=>{const X=Number.parseInt(String(W)||"2",10),J=Number.isFinite(X)&&X>=0?X:2;try{if(typeof O=="string"){const ie=O.split("."),ae=ie[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ee=ie[1]?ie[1].length:0,V=Math.max(J,ee),G=ie[1]?ie[1].padEnd(V,"0"):"0".repeat(V);return V>0?`${ae}.${G}`:ae}return new Intl.NumberFormat("en-US",{minimumFractionDigits:J,maximumFractionDigits:20}).format(O)}catch(ie){return console.error("Error formatting exact metric value:",ie,{num:O,decimals:J}),String(O)}},I=q(()=>{var O;return((O=d.value)==null?void 0:O.metric_type.code)==="formula"}),x=q(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const O=o.value,{format_type:W,format_value:X,mapping:J}=d.value;if(J&&typeof J=="object"&&!Array.isArray(J)){const ie=J[`!${O}`];if(ie)return ie}if(W==="dropdown"){const ie=v.value.find(ae=>String(ae.name)===String(O));if(ie)return ie.name}if(typeof O=="string"){const ie=Number(O);return Number.isNaN(ie)?O:O.replace(/[.-]/g,"").length>16?T(O,X):T(ie,X)}return typeof O=="number"?T(O,X):String(O)}),{tooltip:F}=kF(""),E=async O=>{O.stopPropagation(),O.preventDefault(),O.stopImmediatePropagation();try{await navigator.clipboard.writeText(x.value),F.value="Copied",setTimeout(()=>{F.value="Copy"},3e3)}catch(W){console.error("Failed to copy text:",W),F.value="Copy failed",setTimeout(()=>{F.value="Copy"},3e3)}};et(()=>o.value,(O,W)=>{const X=Number(O);Number.isFinite(X)&&X!==h.value?h.value=X:O==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const k=()=>{r.value=!0},M=()=>{r.value=!1};return(O,W)=>Ke((z(),je(ws,Kt(H(S),{onMouseenter:k,style:{"--icon-size":"24px"},onMouseleave:M,ref_key:"wrapperRef",ref:a,actived:H(l),bordered:!0}),{suffix:ge(()=>[o.disabled?Xe("",!0):(z(),ce("div",{key:0,class:Q([O.$style.suffix,"wrapper-suffix"])},[r.value&&!H(u).isEmpty&&!H(u).isError?Ke((z(),je(ht,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(E,["prevent","stop"])},{default:ge(()=>[fe(at,{src:"Copy",source:"remote",size:12})]),_:1})),[[H(s),{content:H(F),hideOnClick:!1,contentClass:"extra-padding"}]]):Xe("",!0)],2))]),default:ge(()=>[be("div",{class:Q(O.$style["metric-wrapper"]),"aria-label":H(d).format_value||void 0},[be("div",{class:Q([O.$style["metric-content"],o.disabled?O.$style.disabled:""])},[!H(u).isError&&H(u).isEmpty?(z(),ce(xt,{key:0},[H(u).pendingCalculation?Ke((z(),ce("span",{key:0,class:Q(O.$style["metric-empty"])},[...W[0]||(W[0]=[st(" - ",-1)])],2)),[[H(s),"Can’t calculate yet. Complete required fields."]]):H(u).isEmpty?(z(),ce("span",{key:1,class:Q(O.$style["metric-empty"])}," - ",2)):Xe("",!0)],64)):Xe("",!0),H(u).isError?Ke((z(),ce("div",{key:1,class:Q(O.$style["metric-error"])},[...W[1]||(W[1]=[st(" Error ",-1)])],2)),[[H(s),"Something went wrong. Review formula, inputs and retry."]]):Xe("",!0),!H(u).isEmpty&&!H(u).isError?Ke((z(),ce("span",{key:2,class:Q([O.$style["metric-value"],H(b)?O.$style.hovered:"",{[O.$style.disabled]:o.disabled}])},[st(Ct(D.value),1)],2)),[[H(s),{content:g.value,bypassOverflowCheck:p.value}]]):Xe("",!0)],2)],10,cJ)]),_:1},16,["actived"])),[[H(n),{isLoading:H(u).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"}}]]),uJ={key:0,style:{color:"#6b6b6b"}},dJ=Et(ot({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue"],setup(e,{emit:t}){const n=qt,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"}},r={asc:{value:"asc",label:"Smallest to largest",id:"asc"},desc:{value:"desc",label:"Largest to smallest",id:"desc"}},i={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"},c=q(()=>{var A,k;if(a.headerType)return a.headerType;if(((k=(A=a.params)==null?void 0:A.column)==null?void 0:k.getColId()).includes("metric"))return"default";const E=a.headerType??a.params.column.getColId();return l[E]||"default"}),u=B(),d=()=>{var E,A,k;const F=(A=(E=a.params)==null?void 0:E.column)==null?void 0:A.getColDef();if((k=F.colId)!=null&&k.includes("metric")){if(F.context.is_primary==1)return"primary";if(F.context.is_point_metric==1)return"secondary"}};th(()=>{u.value=d()}),rn(()=>{u.value=d()});const h=q(()=>{var F,E;return((E=(F=a.params)==null?void 0:F.column.getColDef().context)==null?void 0:E.morpheme_value)||void 0}),f=q(()=>{var F;return(F=a.params)==null?void 0:F.displayName}),p=q(()=>{let F=[];switch(c.value){case"dateRange":F=Object.values(s).map(E=>({...E,selected:v.value===E.value,type:"text",hover:T.value===E.value}));break;case"date":F=Object.values(o).map(E=>({...E,selected:v.value===E.value,type:"text",hover:T.value===E.value}));break;case"number":F=Object.values(r).map(E=>({...E,selected:v.value===E.value,type:"text",hover:T.value===E.value}));break;default:F=Object.values(i).map(E=>({...E,selected:v.value===E.value,type:"text",hover:T.value===E.value}));break}return v.value!=="none"&&F.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:T.value=="none"}),F}),g=q(()=>String(v.value).endsWith("asc")?"SortUp":String(v.value).endsWith("desc")?"SortDown":"Sort"),v=B(a.modelValue??"none"),C=F=>{D("update:modelValue",F),D("sort-changed",F)},S=F=>{v.value=F},b=Tr(()=>{if(c.value==="date"||c.value==="default"||c.value==="number"){let F;v.value==="none"?F="asc":v.value==="asc"?F="desc":F="none",v.value=F}else{const F=[s.START_ASC.value,s.START_DESC.value,s.DUE_ASC.value,s.DUE_DESC.value,"none"],A=(F.indexOf(v.value)+1)%F.length;v.value=F[A]}},ai),w=q(()=>{if(v.value==="none")return"No sorting applied";const F=p.value.find(E=>E.value===v.value);return(F==null?void 0:F.label)||""}),D=t,R=q(()=>{if(a.disabled&&!a.readOnly)return"var(--disabled-color)";if(v.value!=="none")return"var(--primary-color-hover)"});et(()=>a.modelValue,F=>{F!=v.value&&(v.value=F)}),et(v,F=>{F!==a.modelValue&&C(F)});const T=B(v.value);et(()=>v.value,F=>{T.value=F});const I=F=>{var M,O;if(a.readOnly||a.disabled)return;let E=0;F.key==="ArrowDown"?E=1:F.key==="ArrowUp"&&(E=-1);const A=p.value.findIndex(W=>W.value===T.value),k=p.value.length;if(F.key==="Enter"||F.key===" ")F.preventDefault(),v.value=T.value,(M=x.value)==null||M.hide();else if(E!==0){F.preventDefault();let W=(A+E+k)%k;T.value=p.value[W].value}else F.key==="Escape"&&((O=x.value)==null||O.hide())},x=B(null);return rn(()=>{var F,E;(E=(F=x.value)==null?void 0:F.$el)==null||E.addEventListener("keydown",I)}),zc(()=>{var F,E;(E=(F=x.value)==null?void 0:F.$el)==null||E.removeEventListener("keydown",I)}),(F,E)=>(z(),je(pS,{ref_key:"dropdownRef",ref:x,options:p.value,label:f.value,readOnly:a.readOnly,disabled:a.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:H(b),onSelect:E[0]||(E[0]=A=>S(A))},{prefix:ge(()=>[fe(ht,{variant:["text"],onClick:H(b),size:"small"},{default:ge(()=>[Ke((z(),ce("b",null,[st(Ct(f.value),1)])),[[H(n),{content:f.value}]]),h.value?(z(),ce("small",uJ," ("+Ct(h.value)+") ",1)):Xe("",!0),u.value=="primary"?Ke((z(),ce("div",{key:1,class:Q(F.$style["icon-metric"])},[fe(at,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[H(n),"Woohoo metric"]]):Xe("",!0),u.value=="secondary"?Ke((z(),ce("div",{key:2,class:Q(F.$style["icon-metric"])},[fe(at,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[H(n),"Point Metric"]]):Xe("",!0)]),_:1},8,["onClick"])]),iconDropdown:ge(()=>[Ke(fe(at,{src:g.value,source:"remote",color:R.value},null,8,["src","color"]),[[H(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"}}]]),hJ=["disabled","readonly","checked","indeterminate"],Hk=Et(ot({__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=qt,s=Wi,o=e,r=t,i=q(()=>{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=q(()=>o.allowIndeterminate?[At.UNCHECK,At.INDETERMINATE,At.CHECKED]:[At.UNCHECK,At.CHECKED]),l=q(()=>{if(typeof o.tooltipText=="string"||!o.tooltipText)return o.tooltipText||"";switch(u.value){case At.UNCHECK:return o.tooltipText.unchecked;case At.INDETERMINATE:return o.tooltipText.indeterminate;case At.CHECKED:return o.tooltipText.checked;default:return""}}),c=()=>{if(h.value)return;const p=(a.value.indexOf(u.value)+1)%a.value.length;u.value=a.value[p]},u=B(typeof o.modelValue=="boolean"?o.modelValue?At.CHECKED:At.UNCHECK:o.modelValue),d=q(()=>({checked:u.value===At.CHECKED,indeterminate:u.value===At.INDETERMINATE,none:u.value===At.UNCHECK})),h=q(()=>o.disabled||o.readOnly);return et(()=>u.value,f=>{r("update:modelValue",f===At.CHECKED)}),(f,p)=>Ke((z(),ce("input",{disabled:o.disabled,key:u.value,readonly:o.readOnly,type:"checkbox",class:Q([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:c,"aria-label":"Select All Items",style:hn({"--input-size":i.value})},null,46,hJ)),[[H(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[H(s),o.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_1kz1e_84",large:"_large_1kz1e_87",medium:"_medium_1kz1e_90"}}]]),fJ=Et(ot({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=qt,s=Wm(),{setSelectionStatus:o}=s,{rowCount:r,selectionStatus:i}=Qs(s),a=B(new Set);et(i,w=>{o(w)},{immediate:!0});const l=q(()=>i.value!==At.UNCHECK),c=q(()=>({checked:i.value===At.CHECKED,indeterminate:i.value===At.INDETERMINATE,UNCHECK:i.value===At.UNCHECK})),u=q(()=>({[At.UNCHECK]:"Click to select all",[At.INDETERMINATE]:"Click to clear selection",[At.CHECKED]:"Click to clear selection"})[i.value]||"Select items"),d=q(()=>{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:r.value.total,loaded:r.value.loaded}),f=({api:w,state:D})=>{if(w)if(D===At.UNCHECK)w.deselectAll(),a.value.clear(),i.value=D;else if(D===At.CHECKED){const R=new Set;w.forEachNode(T=>{T.isSelected()&&R.add(T.id||"")}),a.value=R,w.forEachNode(T=>T.setSelected(!0)),i.value=D}else w.forEachNode(R=>R.setSelected(!0)),i.value=D},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 D={[At.UNCHECK]:At.INDETERMINATE,[At.INDETERMINATE]:At.UNCHECK,[At.CHECKED]:At.UNCHECK};f({api:w,state:D[i.value]})},g=w=>{var T;const D=(T=t.params)==null?void 0:T.api;if(!D){console.error("no api");return}const R={INDETERMINATE:At.INDETERMINATE,GLOBAL:At.CHECKED,UNCHECK:At.UNCHECK};f({api:D,state:R[w]})},v=Tr(w=>{const{selected:D,total:R}=h(w);if(R==0){i.value=At.UNCHECK;return}D===R?i.value=At.CHECKED:D===0?i.value=At.UNCHECK:i.value=At.INDETERMINATE},300);let C=[];const S=w=>{v(w)};rn(()=>{var I;const w=(I=t.params)==null?void 0:I.api;if(!w)return;const D=x=>v(x.api),R=()=>S(w),T=()=>S(w);w.addEventListener("selectionChanged",D),w.addEventListener("rowDataUpdated",R),w.addEventListener("modelUpdated",R),C=[()=>w.removeEventListener("selectionChanged",D),()=>w.removeEventListener("rowDataUpdated",R),()=>w.removeEventListener("modelUpdated",T)]}),ms(()=>{C.forEach(w=>w())});const b=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(w,D)=>(z(),je(pS,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:ge(()=>[Ke((z(),je(Hk,{"tab-index":"8",id:b,disabled:t.disabled,key:H(i),readonly:t.readOnly,type:"checkbox",checked:c.value.checked,indeterminate:c.value.indeterminate,modelValue:H(i),"onUpdate:modelValue":D[0]||(D[0]=R=>mn(i)?i.value=R:null),onChange:p,"aria-label":H(i)===H(At).CHECKED?"All items selected":"Select visible items",class:Q(w.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[H(n),{content:u.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_4qktt_1","button-group":"_button-group_4qktt_62","button-main":"_button-main_4qktt_62",headerCheckbox:"_headerCheckbox_4qktt_66"}}]]),pJ={key:1},gJ=Et(ot({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=qt,s=e,{isEditing:o}=Fu(s),r=B(null),i=B(null),a=q(()=>s.value),l=q(()=>a.value===void 0),c=q(()=>{var g;return((g=a.value)==null?void 0:g.name)||"No status"}),u=q(()=>{var g;return{disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:Sj((g=a.value)==null?void 0:g.label),inputRef:r,wrapperRef:i,clickable:!s.disabled&&!s.readOnly,active:o}}),{argsMain:d,isHover:h}=ys(u),f=q(()=>{var g;return((g=a.value)==null?void 0:g.color)||"red"}),p=q(()=>new Nn(f.value).isLight()?"#000":"#fff");return(g,v)=>Ke((z(),je(H(ws),Kt(H(d),{ref_key:"wrapperRef",ref:i,bordered:!0,style:{background:`${f.value} !important`,color:p.value,"--border-color":!H(o)&&!H(h)?"#f3f5f8":void 0}}),{default:ge(()=>[l.value?Xe("",!0):(z(),ce("div",{key:0,class:Q(g.$style["status-renderer"])},[a.value?Ke((z(),ce("div",{key:0,class:Q(g.$style["status-renderer__status-name"])},[st(Ct(c.value),1)],2)),[[H(n),{content:c.value,delay:[1e3,0]}]]):l.value?Xe("",!0):(z(),ce("div",pJ,"No status"))],2))]),_:1},16,["style"])),[[H(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"}}]]),Gk=Et(ot({__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:r,hide:i,isVisible:a}=G9({useTrigger:!1,arrow:!1,centered:!0,showOverlay:s.showOverlay,overlayOpacity:s.overlayOpacity,closeOnOverlayClick:s.closeOnOverlayClick,appendTo(u){return document.body}}),l=u=>{s.closeOnEscape&&u.key==="Escape"&&a.value&&i()};rn(()=>{document.addEventListener("keydown",l)}),ms(()=>{document.removeEventListener("keydown",l)}),t({show:r,hide:i,isVisible:a});const c=n;return et(()=>a.value,u=>{c(u?"shown":"hidden")}),(u,d)=>{const h=Eo("tooltip");return z(),ce("div",{ref_key:"popupRef",ref:o,class:Q(u.$style.popupContainer)},[be("div",{class:Q(u.$style.popupWrapper)},[be("div",{class:Q(u.$style.header)},[be("span",{class:Q(u.$style["header-title"])},Ct(e.popupName),3),Ke((z(),je(ht,{style:{position:"absolute",top:"0",right:"0"},variant:"text",onClick:H(i),"aria-label":"Close popup"},{default:ge(()=>[fe(at,{src:"Xmark"})]),_:1},8,["onClick"])),[[h,"Close"]])],2),be("div",{class:Q(u.$style.body)},[Tt(u.$slots,"default")],2),be("div",{class:Q(u.$style.footer)},[Tt(u.$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"}}]]),mJ={...{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 vJ extends Error{}class ja extends vJ{constructor(){super("Zone is an abstract class")}}class Uk{get type(){throw new ja}get name(){throw new ja}get ianaName(){return this.name}get isUniversal(){throw new ja}offsetName(t,n){throw new ja}formatOffset(t,n){throw new ja}offset(t){throw new ja}equals(t){throw new ja}get isValid(){throw new ja}}const gS=new Map;function yJ(e){let t=gS.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"}),gS.set(e,t)),t}const wJ={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function CJ(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,r,i,a,l,c,u]=s;return[i,o,r,a,l,c,u]}function bJ(e,t){const n=e.formatToParts(t),s=[];for(let o=0;o<n.length;o++){const{type:r,value:i}=n[o],a=wJ[r];r==="era"?s[a]=i:jm(a)||(s[a]=parseInt(i,10))}return s}const mS=new Map;class zm extends Uk{static create(t){let n=mS.get(t);return n===void 0&&mS.set(t,n=new zm(t)),n}static resetCache(){mS.clear(),gS.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 _J(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=yJ(this.name);let[o,r,i,a,l,c,u]=s.formatToParts?bJ(s,n):CJ(s,n);a==="BC"&&(o=-Math.abs(o)+1);const h=EJ({year:o,month:r,day:i,hour:l===24?0:l,minute:c,second:u,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 vS=null;class Lu extends Uk{static get utcInstance(){return vS===null&&(vS=new Lu(0)),vS}static instance(t){return t===0?Lu.utcInstance:new Lu(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Lu(zk(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 Wk(e){if(!(jm(e)||e===null||e===""))return parseInt(e,10)}function SJ(e){if(!(jm(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function EJ(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 _J(e,t,n,s=null){const o=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(r.timeZone=s);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function zk(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 jk=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Vu(...e){const t=e.reduce((n,s)=>n+s.source,"");return RegExp(`^${t}$`)}function Bu(...e){return t=>e.reduce(([n,s,o],r)=>{const[i,a,l]=r(t,o);return[{...n,...i},a||s,l]},[{},null,1]).slice(0,2)}function Kk(...e){return(t,n)=>{const s={};let o;for(o=0;o<e.length;o++)s[e[o]]=Wk(t[n+o]);return[s,null,n+o]}}const qk=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,RJ=`(?:${qk.source}?(?:\\[(${jk.source})\\])?)?`,Yk=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Zk=RegExp(`${Yk.source}${RJ}`),yS=RegExp(`(?:[Tt]${Zk.source})?`),DJ=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,TJ=/(\d{4})-?W(\d\d)(?:-?(\d))?/,IJ=/(\d{4})-?(\d{3})/,xJ=Kk("weekYear","weekNumber","weekDay"),FJ=Kk("year","ordinal"),PJ=/(\d{4})-(\d\d)-(\d\d)/,Xk=RegExp(`${Yk.source} ?(?:${qk.source}|(${jk.source}))?`),AJ=RegExp(`(?: ${Xk.source})?`);function $u(e,t,n){const s=e[t];return jm(s)?n:Wk(s)}function kJ(e,t){return[{year:$u(e,t),month:$u(e,t+1,1),day:$u(e,t+2,1)},null,t+3]}function Hu(e,t){return[{hours:$u(e,t,0),minutes:$u(e,t+1,0),seconds:$u(e,t+2,0),milliseconds:SJ(e[t+3])},null,t+4]}function ff(e,t){const n=!e[t]&&!e[t+1],s=zk(e[t+1],e[t+2]),o=n?null:Lu.instance(s);return[{},o,t+3]}function pf(e,t){const n=e[t]?zm.create(e[t]):null;return[{},n,t+1]}Vu(DJ,yS),Vu(TJ,yS),Vu(IJ,yS),Vu(Zk),Bu(kJ,Hu,ff,pf),Bu(xJ,Hu,ff,pf),Bu(FJ,Hu,ff,pf),Bu(Hu,ff,pf),Bu(Hu),Vu(PJ,AJ),Vu(Xk),Bu(Hu,ff,pf);function Gu(e){"@babel/helpers - typeof";return Gu=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},Gu(e)}var Cs;(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}"})(Cs||(Cs={})),Cs.review,Cs.review_take,Cs.review_scene,Cs.review_rendition,Cs.review_frame,Cs.review_rendition_comment,Cs.review_comment,Cs.scene_hub,Cs.hub_rendition,Cs.hub_comment,Cs.people_insight,Cs.people_detail,Cs.project,Cs.woohoo,Cs.update,Cs.core,Cs.project_focusMode;var wS=null;function OJ(e){wS=e}function Ym(){if(!wS)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return wS}function Jk(){try{var e=sessionStorage.getItem("APP_DEBUG")?"✅":"",t=Ym();return"".concat(t.t("errorMessages.fallback.unknownError")," ").concat(e)}catch{return"An error occurred. Please try again or contact support."}}function MJ(e,t,n,s){var o=e.replace(/{field}/g,t);if(s&&Gu(s)==="object")Object.keys(s).forEach(function(i){var a="{".concat(i,"}"),l=s[i];Array.isArray(l)?l=l.join(", "):i==="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 r=n[0]||"";n.length>1?r="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(r=n[0].join(", ")),o=o.replace(/{value}/g,r)}return o}function NJ(e,t){for(var n=Object.keys(t),s=0,o=n;s<o.length;s++){var r=o[s],i=Array.isArray(t[r])?t[r].join(", "):String(t[r]);e=e.replace(new RegExp("\\{".concat(r,"\\}"),"g"),i)}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 Qk(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function eO(e,t){if(!e||Gu(e)!=="object")return null;try{var n=Ym();if(e.validation&&e.validation.fields)for(var s=e.validation.fields,o=Object.keys(s),r=0,i=o;r<i.length;r++){var a=i[r],l=s[a];if(l&&l.rule){var c=l.rule,u=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[c]}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[c]}if(v&&typeof v=="string")return MJ(v,a,u,d)}catch(w){console.error("Error in validation rules",w)}}}}catch(w){return console.error("Error in getValidationErrorMessage:",w),null}return null}function LJ(e){var t=sessionStorage.getItem("APP_DEBUG")?"✅":"";if(!e)return Jk();var n=e.code,s=e.error,o=e.details,r=e.message;if(Qk(o)&&o){var i=eO(o,s==null?void 0:s.type);if(sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",i),i)return n!==""?"[".concat(n,"] ").concat(i," ").concat(t):"".concat(i);try{var a=Ym();return a.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(s&&Gu(s)==="object"&&s.type&&s.key){var l=s.type.toUpperCase();try{var c,u,d,h="errorMessages.".concat(l,".").concat(s.key),f=Ym(),p=((c=f.messages)===null||c===void 0?void 0:c.value)||f.messages,g=((u=f.locale)===null||u===void 0?void 0:u.value)||f.locale,v=(d=p[g])===null||d===void 0||(d=d.errorMessages)===null||d===void 0||(d=d[l])===null||d===void 0?void 0:d[s.key];if(v&&typeof v=="string"){var C=v;return o!=null&&o.context&&(C=NJ(C,o.context),sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",C)),n!==""?"[".concat(n,"] ").concat(C," ").concat(t):"".concat(C," ").concat(t)}}catch(b){console.error("[Error Utils Debug]",b)}}if(s&&Gu(s)!=="object"&&Qk(o)){var S=eO(o);if(S)return n!==""?"[".concat(n,"] ").concat(S," ").concat(t):"".concat(S," ").concat(t)}return r?"".concat(r):Jk()}const gf=Ql("toast",()=>{const e=l=>{var c;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 u=LJ((c=l==null?void 0:l.res)==null?void 0:c.data);o({id:l==null?void 0:l.apiCode,type:"error",message:u})}},t=B([]),n=(l,c)=>{const u=mJ[l];if(u){const d=u[c];if(d){o({id:l,type:c,message:d});return}}else o({id:l,type:c,message:l})},s=new Map,o=(l,c=5e3)=>{const u={...l,id:l.id??Date.now()+Math.random()};if(t.value.push(u),c>0){const d=Date.now(),h=setTimeout(()=>{r(u.id),s.delete(u.id)},c);s.set(u.id,{timeoutId:h,remainingTime:c,startTime:d})}};function r(l){t.value=t.value.filter(u=>u.id!==l);const c=s.get(l);c&&(clearTimeout(c.timeoutId),s.delete(l))}function i(l){const c=s.get(l);if(c){clearTimeout(c.timeoutId);const u=Date.now()-c.startTime;c.remainingTime=Math.max(0,c.remainingTime-u)}}function a(l){const c=s.get(l);if(c&&c.remainingTime>0){const u=setTimeout(()=>{r(l),s.delete(l)},c.remainingTime);c.timeoutId=u,c.startTime=Date.now()}}return{notifications:t,addNotification:o,removeNotification:r,showMessage:n,showErrorNetMessage:e,pauseAutoDismiss:i,resumeAutoDismiss:a}}),VJ=["onMouseenter","onMouseleave"],BJ=["innerHTML"],$J=["innerHTML"],HJ=["data-tooltip"],GJ={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},UJ=Et(ot({__name:"Snackbar",setup(e){const t=qt,n=RU,s=gf(),{removeNotification:o}=s,{notifications:r}=Qs(s),i=f=>f.trim().startsWith("<svg"),a=B("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},c=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},u=B(new Set),d=f=>{var p;u.value.add(f),(p=s.pauseAutoDismiss)==null||p.call(s,f)},h=f=>{var p;u.value.delete(f),(p=s.resumeAutoDismiss)==null||p.call(s,f)};return(f,p)=>(z(),je(lU,{name:"list",tag:"div",class:Q(["notification-center",f.$style["notification-wrapper"]])},{default:ge(()=>[(z(!0),ce(xt,null,xn(H(r),g=>{var v;return Ke((z(),ce("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)},[be("p",{class:Q(f.$style.snackbar__message)},[be("span",{class:Q(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(z(),je(at,{key:0,src:"CircleCheck",source:"remote"})):Xe("",!0),!g.icon&&g.type=="interactive"?(z(),je(at,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(z(),je(at,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&i(g.icon)?(z(),ce("i",{key:3,class:Q(f.$style["icon-draw"]),innerHTML:g.icon},null,10,BJ)):g.icon&&!i(g.icon)?(z(),je(at,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Xe("",!0)],2),be("span",{class:Q(f.$style["error-message"])},[be("span",{class:Q(f.$style.message),innerHTML:g.message},null,10,$J)],2)],2),g.actions?(z(),ce("div",{key:0,class:Q(f.$style["actions-notification"]),"data-notification":"true"},[(z(!0),ce(xt,null,xn(g.actions,C=>(z(),je(ht,Kt({key:C.label},{ref_for:!0},C,{onClick:Pt(C.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:ge(()=>[C.btnIcon?(z(),je(at,{key:0,src:C.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Xe("",!0)]),_:2},1040,["onClick"]))),128))],2)):Xe("",!0),g.type!=="interactive"?Ke((z(),ce("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[fe(ht,{variant:"secondary",onClick:C=>c(g.message),class:Q(f.$style["copy-btn"])},{prefix:ge(()=>[fe(at,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,HJ)),[[H(t),a.value]]):Xe("",!0),g.type=="interactive"?Ke((z(),ce("div",GJ,[fe(ht,{variant:"tertiary",onClick:C=>H(o)(g.id),class:Q(f.$style["close-btn"]),size:18},{default:ge(()=>[fe(at,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[H(t),"Close"]]):Xe("",!0)],42,VJ)),[[H(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_jf7je_1","notification-item":"_notification-item_jf7je_15","notification--success":"_notification--success_jf7je_30","notification--error":"_notification--error_jf7je_36","close-btn":"_close-btn_jf7je_42","notification--info":"_notification--info_jf7je_45","notification--warning":"_notification--warning_jf7je_52","notification--interactive":"_notification--interactive_jf7je_59","snackbar-type":"_snackbar-type_jf7je_67",snackbar__message:"_snackbar__message_jf7je_76",message:"_message_jf7je_89","error-message":"_error-message_jf7je_97",snackbar__icon:"_snackbar__icon_jf7je_103","actions-notification":"_actions-notification_jf7je_112","icon-draw":"_icon-draw_jf7je_120","copy-btn":"_copy-btn_jf7je_128"}}]]);/*!
|
|
152
152
|
* vue-draggable-next v2.3.0
|
|
153
153
|
* (c) 2025 Anish George
|
|
154
154
|
* @license MIT
|
|
@@ -171,7 +171,7 @@ This will fail in production.`);i=Zl,i._s.has(e)||(o?qb(e,t,s,i):MA(e,s,i),Y.env
|
|
|
171
171
|
</clipPath>
|
|
172
172
|
</defs>
|
|
173
173
|
</svg>`,r=gf(),{showMessage:i,showErrorNetMessage:a}=r,l=B(!1),c=B(!1),u=e,d=B({file:null,format:null,isValid:void 0}),h=q(()=>{var x;return((x=u.acceptTypes)==null?void 0:x.map(F=>`.${F}`).join(","))||".xlsx,.xls,.csv"}),f=q(()=>d.value.format?o(d.value.format):""),p=q(()=>{var x;if(!d.value.isValid)return`Invalid file type. Please upload a ${(x=u.acceptTypes)==null?void 0:x.join(", ")} file.`}),g=q(()=>!!d.value.file),v=()=>{var x;(x=s.value)==null||x.click()},C=q(()=>d.value.file?d.value.file.name:""),S=x=>{var A;const F=u.acceptTypes||["xlsx","xls","csv"],E=(A=x.name.split(".").pop())==null?void 0:A.toLowerCase();return E?F.includes(E):!1},b=x=>{var E,A;const F=S(x);x&&F?(d.value.isValid=F,l.value=!1,d.value.file=x,d.value.format=((E=x.name.split(".").pop())==null?void 0:E.toLowerCase())||null):i(`Invalid file type. Please upload a ${(A=u.acceptTypes)==null?void 0:A.join(", ")} file.`,"error")},w=x=>{const F=x.target;if(F.files&&F.files[0]){const E=F.files[0];b(E)}},D=()=>{c.value=!0},R=()=>{c.value=!1},T=x=>{if(c.value=!1,x.dataTransfer&&x.dataTransfer.files&&x.dataTransfer.files[0]){const F=x.dataTransfer.files[0];b(F)}},I=n;return et(d,x=>{I("update:modelValue",x)},{deep:!0}),t({internalValue:d,clear:()=>{s.value&&(s.value.value=""),d.value={file:null,format:null},l.value=!1}}),(x,F)=>{const E=Eo("tooltip");return z(),ce("div",{class:Q([x.$style["drop-area"],{[x.$style["is-dragging"]]:c.value,[x.$style.error]:l.value}]),onDragenter:Pt(D,["prevent"]),onDragover:Pt(D,["prevent"]),onDragleave:Pt(R,["prevent"]),onDrop:Pt(T,["prevent"]),onClick:v},[g.value?Xe("",!0):(z(),ce("div",{key:0,class:Q(x.$style["drop-area-content"])},[fe(at,{src:"Upload",size:"24",color:"#3C9BFA"}),be("span",null,[fe(ht,{variant:["tertiary","text"],class:Q(x.$style["upload-btn"])},{default:ge(()=>[...F[0]||(F[0]=[st(" Click to upload ",-1)])]),_:1},8,["class"]),F[1]||(F[1]=st(" or drag and drop files here ",-1))])],2)),g.value?Ke((z(),ce("div",{key:1,class:Q(x.$style["drop-area-file"])},[be("div",{innerHTML:f.value},null,8,hee),Ke((z(),ce("span",{class:Q(x.$style["file-name"])},[st(Ct(C.value),1)],2)),[[E,{content:C.value}]])],2)),[[E,p.value]]):Xe("",!0),be("input",{ref_key:"fileInput",ref:s,type:"file",style:{display:"none"},accept:h.value,onChange:w},null,40,fee)],34)}}}),[["__cssModules",{$style:{"upload-btn":"_upload-btn_19ysm_1","drop-area":"_drop-area_19ysm_8","is-dragging":"_is-dragging_19ysm_18",error:"_error_19ysm_22","drop-area-content":"_drop-area-content_19ysm_26","drop-area-file":"_drop-area-file_19ysm_34","file-name":"_file-name_19ysm_42","clear-button":"_clear-button_19ysm_51"}}]]),pee={style:{"text-align":"left",width:"100%"}},gee={style:{display:"flex","align-items":"center",gap:"2px",flex:"1","min-width":"0"}},mee={key:0},vee=["innerHTML"],yee=20,wee=Et(ot({__name:"FilterAssignee",props:{maxVisible:{default:3},entityId:{},actived:{type:Boolean}},emits:["updated","cancel","start-update","escape"],setup(e,{expose:t,emit:n}){const s=Wi,o=e,{triggerRef:r}=Es({appendTo:()=>document.querySelector(".filter-assignee"),toggleOnClick:!0,offset:[0,0]}),{triggerRef:i,popupRef:a,isVisible:l,hide:c}=Es({toggleOnClick:!0,appendTo:()=>document.querySelector("#filter-assignee"),offset:[0,2]}),u=()=>{v()},d=we=>{c()},{triggerRef:h,popupRef:f,isVisible:p,hide:g,show:v}=Es({toggleOnClick:!0,appendTo:()=>document.querySelector("#filter-assignee"),offset:[0,2]}),C=B(null),S=()=>{J.value=[],Fe.value=!1,Ae.value=!1,K.value="any"},b=q(()=>l.value||p.value||o.actived),w=q(()=>{var we;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((we=J.value)==null?void 0:we.length)===0,wrapperRef:r,active:b,bordered:!0}}),{argsMain:D,isFocus:R}=ys(w),T=qt,I=n,x=q(()=>{var we;return Math.max(0,(((we=J.value)==null?void 0:we.length)||0)-o.maxVisible)}),F=q(()=>{var we;return x.value<=0?"":((we=J.value)==null?void 0:we.slice(o.maxVisible).map(ze=>ze.name).join(", "))||""}),E=B(!1),A=B(!1),k=B(null),M=B(1),O=B(!0),W=B(0),X=B(""),J=B([]),ie=q(()=>{var we;return((we=J.value)==null?void 0:we.map(ze=>ze.id))||[]}),{assigneeList:ae,mergedOptions:ee}=mm({...o,value:[]}),{apiServices:V}=ts(!1,o),G=async(we=1,ze="",Ue=!1)=>{var Ve,gt,kt,Ut,en;if(!V.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(Ue?A.value=!0:E.value=!0,k.value=null,!((Ve=V.value)!=null&&Ve.getEntityUserRoles))throw new Error("API service getEntityUserRoles is undefined");const _e=un.getInstance().getItem("ws.code");try{const zt=await((gt=V.value)==null?void 0:gt.getEntityUserRoles({workspaceId:String(_e),page:we,per_page:yee,display_name_like:ze,entity_ids:String(o.entityId)})),Ne=((kt=bu(zt.data))==null?void 0:kt.map(gm))??[];ae.value=Ue?au(ae.value,Ne,"id"):Ne,W.value=zt.meta.total,O.value=(((Ut=zt==null?void 0:zt.meta)==null?void 0:Ut.current_page)||0)<(((en=zt==null?void 0:zt.meta)==null?void 0:en.last_page)||0),M.value=we}catch(zt){console.error("Error fetching assignable users:",zt),k.value="Failed to load assignable users"}finally{E.value=!1,A.value=!1}},te=we=>{var ze,Ue;if((ze=J.value)!=null&&ze.some(_e=>_e.id===we.data.id)){J.value=(Ue=J.value)==null?void 0:Ue.filter(_e=>_e.id!==we.data.id);return}J.value=[...J.value||[],we.data]},pe=()=>{!A.value&&O.value&&G(M.value+1,X.value,!0)},ve=Tr(async we=>{X.value=we,await G(1,we,!1)},ai);et(()=>p.value,we=>{var ze;we&&(G(1,X.value,!1),(ze=C.value)==null||ze.focus())});const re=q(()=>{var we;return((we=J.value)==null?void 0:we.slice(0,3))||[]}),oe=q(()=>re.value.map(we=>({id:we.id,name:we.name,initial:we.initial,avatarId:we.id,profile_image:we.profile_image,color:we.color,size:24,user:we}))),K=B("any"),me=we=>{K.value=we.id},se=q(()=>[{label:"Any",value:"any",id:"any",selected:K.value==="any"},{label:"All",value:"all",id:"all",selected:K.value==="all"}]),Se=q(()=>K.value==="any"?"Any":K.value==="all"?"All":""),U=hv(),{user:Z}=Qs(U),de=q(()=>{if(!Z.value)return{id:"",name:"Unknown",initial:"U",profile_image:null,color:{bgColor:"#CCCCCC",textColor:"var(--background-color)"}};const we=Z.value;return{id:we.id,name:we.first_name,initial:"Me",profile_image:we.avatar,color:{bgColor:"#CCCCCC",textColor:"var(--background-color)"}}}),Ae=B(!1),Fe=B(!1);t({getData:()=>({assignees:J.value,showNoAssignee:Ae.value,showMe:Fe.value,selectedTypeId:K.value}),clear:S,setData:we=>{J.value=we.assignees||[],Ae.value=we.showNoAssignee||!1,Fe.value=we.showMe||!1,K.value=we.selectedTypeId||"any"},focus:()=>{var we;(we=i.value)==null||we.focus()},triggerFocus:()=>{var we;(we=i.value)==null||we.focus()}}),et([J,Ae,Fe,K],()=>{I("updated",{assignees:J.value,showNoAssignee:Ae.value,showMe:Fe.value,selectedTypeId:K.value})},{deep:!0});const Le=()=>{Ae.value=!1},ye=()=>{var we;Fe.value=!1,J.value=(we=J.value)==null?void 0:we.filter(ze=>ze.id!==de.value.id)},N=we=>{var ze;J.value=(ze=J.value)==null?void 0:ze.filter(Ue=>Ue.id!==we)},$=we=>{var Ue;const ze=un.getInstance().getItem("ws.code");return((Ue=V.value)==null?void 0:Ue.getUserInformation(ze,we))||Promise.resolve(null)},le=B(),Ge=()=>{I("escape")};return(we,ze)=>(z(),ce(xt,null,[be("div",{id:"filter-assignee",ref_key:"wrapperRef",ref:le},[fe(ws,Kt(H(D),{ref_key:"triggerRef",ref:r,style:{"--box-padding":"0 0 0 0","--icon-size":"18px","--border-color":H(R)?"var(--primary-color)":null},onEscape:Ge}),{default:ge(({hovered:Ue,focused:_e})=>[be("div",{class:Q([we.$style["assignee-row"],we.$style["assignee-selector"]])},[Ke((z(),ce("div",null,[Ke((z(),je(ht,{variant:"text",ref_key:"triggerRef1",ref:i,size:30,disabled:Ae.value,style:hn({background:Ae.value?"#D7D7D7":"transparent",borderRadius:Ae.value?"4px 0 0 4px":"",border:"none",width:"calc(100% - 2px)",height:"30px"}),onEscape:d},{suffix:ge(()=>[fe(at,{class:Q(["wrapper-suffix2",{"icon-up":H(l)}]),src:"ChevronDown",color:"#A6A6A6",size:"12"},null,8,["class"])]),default:ge(()=>[be("span",pee,Ct(Se.value),1)]),_:1},8,["disabled","style"])),[[H(s),"3.0"]])])),[[H(T),{content:Ae.value?"Only ‘Any’ is allowed with ‘No assignee’":""}]]),be("span",{class:Q([we.$style.seperator])},null,2),Ke((z(),je(ht,{variant:"text",ref_key:"triggerRef2",ref:h,style:{flex:1,padding:0,width:"100%",justifyContent:"space-between",height:"30px",paddingRight:"2px","--button-size":"30px"},onEscape:H(g)},{default:ge(()=>[be("div",gee,[fe(hf,{onClear:Le,"disable-remove":!1},{default:ge(()=>[Ae.value&&K.value=="any"?(z(),ce("div",mee,[be("div",{class:Q(we.$style["unassign-icon"])},[...ze[2]||(ze[2]=[be("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[be("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"white"})],-1)])],2)])):Xe("",!0)]),_:1}),fe(hf,{tooltip:"Remove",onClear:ye,"disable-remove":!1},{default:ge(()=>[Fe.value?(z(),je(Au,{key:0,user:de.value,"show-profile":!1,"append-to":"parent"},null,8,["user"])):Xe("",!0)]),_:1}),(z(!0),ce(xt,null,xn(oe.value,Ve=>(z(),je(hf,{tooltip:"Remove",key:Ve.user.id,onClear:gt=>N(Ve.user.id),"disable-remove":!1},{default:ge(()=>[fe(Au,{user:Ve.user,apiUpdateFunction:$,appendTo:le.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),x.value>0?Ke((z(),ce("div",{key:0,class:Q(we.$style["extra-avatars"])},[st(" +"+Ct(x.value),1)],2)),[[H(T),F.value]]):Xe("",!0)])]),suffix:ge(()=>{var Ve;return[(J.value&&((Ve=J.value)==null?void 0:Ve.length)>0||Ae.value||Fe.value)&&(Ue||_e||H(p))?(z(),ce("div",{key:0,class:"wrapper-suffix",onClick:Pt(S,["stop","prevent"])},[fe(ht,{variant:["icon","primary"],rounded:!0,size:18},{default:ge(()=>[fe(at,{src:"XMarkSolid",size:"8"})]),_:1})])):Xe("",!0),be("div",{class:Q(["wrapper-suffix",{"icon-up":H(p)}]),onClick:u,style:{width:"24px",height:"24px",display:"flex","align-items":"center","justify-content":"center"}},[fe(at,{src:"ChevronDown",color:"#A6A6A6",size:"12"})],2)]}),_:2},1032,["onEscape"])),[[H(s),"3.1"]])],2)]),_:1},16,["style"])],512),be("div",{ref_key:"popupRef1",ref:a,class:Q([we.$style.list])},[(z(!0),ce(xt,null,xn(se.value,(Ue,_e)=>(z(),je(ec,Kt({focusIndex:`3.0.${_e}`,class:we.$style["list-item"],style:{width:"100px",minWidth:"100px"}},{ref_for:!0},Ue,{key:Ue.id,onClick:Ve=>me(Ue),onEscape:H(c)}),null,16,["focusIndex","class","onClick","onEscape"]))),128))],2),be("div",{ref_key:"popupRef2",ref:f},[fe(Qi,Kt({"selected-id":ie.value},{...o},{options:H(ee),loading:E.value,"loading-more":A.value,"has-more":O.value,ref_key:"searchListRef",ref:C,onSelect:ze[1]||(ze[1]=Ue=>{te(Ue),I("start-update")}),onSearch:H(ve),onLoadMore:pe,onCancel:H(g)}),{"extra-item":ge(({query:Ue})=>[K.value=="any"&&Ue.trim()===""?(z(),je(nS,{key:0,onClick:ze[0]||(ze[0]=()=>{Ae.value=!Ae.value}),actived:Ae.value},null,8,["actived"])):Xe("",!0)]),item:ge(({item:Ue,selectedIndex:_e,isSelected:Ve,handleSelect:gt,handleItemHover:kt,getHighlightedLabel:Ut,query:en,idx:zt})=>[fe(BA,{user:Ue.data,"multiple-select":!0,"append-to":le.value,isMe:!1,hover:zt===_e,selected:Ve(Ue),onClick:Pt(Ne=>gt(Ue,Ne),["stop","prevent"]),onMouseover:Ne=>kt(zt),"api-update-function":$},{name:ge(()=>[en?Ke((z(),ce("span",{key:0,class:Q([we.$style["item-label"],we.$style.match]),style:{flex:"1"},innerHTML:Ut(Ue.label)},null,10,vee)),[[H(T),{content:Ue.label}]]):Ke((z(),ce("span",{key:1,class:Q(we.$style["item-label"]),style:{flex:"1"}},[st(Ct(Ue.label),1)],2)),[[H(T),{content:Ue.label}]])]),_:2},1032,["user","append-to","hover","selected","onClick","onMouseover"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch","onCancel"])],512)],64))}}),[["__cssModules",{$style:{action:"_action_1p46f_1","item-assignee":"_item-assignee_1p46f_6","item-action":"_item-action_1p46f_6","item-label":"_item-label_1p46f_16","unassign-icon":"_unassign-icon_1p46f_25","error-message":"_error-message_1p46f_37","empty-state":"_empty-state_1p46f_47","assignee-row":"_assignee-row_1p46f_60","assignee-selector":"_assignee-selector_1p46f_72",seperator:"_seperator_1p46f_78","extra-avatars":"_extra-avatars_1p46f_87",list:"_list_1p46f_99"}}]]),Cee={key:0,class:"wrapper-suffix"},bee=Et(ot({__name:"FilterArchiveStatus",props:{actived:{type:Boolean},focusIndex:{}},emits:["updated"],setup(e,{expose:t,emit:n}){const{triggerRef:s,popupRef:o,isVisible:r,hide:i}=Es({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),a=B([]),l=q(()=>[{label:"Archived",value:"archived",id:"archived",selected:a.value.includes("archived")},{label:"Not archived (Active)",value:"active",id:"active",selected:a.value.includes("active")}]),c=B("");et(a,b=>{b.length===0?c.value="":b.length===2?c.value="All":b.length===1&&(c.value=b[0]==="archived"?"Archived":"Not archived (Active)")},{immediate:!0,deep:!0});const u=b=>{a.value.includes(b.value)?a.value=a.value.filter(w=>w!==b.value):a.value.push(b.value)},d=()=>{a.value=[]},h=e,f=()=>{a.value=[]},p=q(()=>r.value||h.actived),g=q(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:a.value.length===0,wrapperRef:s,active:p,bordered:!0})),{argsMain:v}=ys(g);t({getData:()=>a.value,clear:d,setData:b=>{a.value=b},reset:f,focus:()=>{var b;(b=S.value)==null||b.focus()},triggerFocus:()=>{var b;(b=S.value)==null||b.focus()}});const C=n;et(()=>a.value,b=>{C("updated",b)},{deep:!0});const S=B(null);return(b,w)=>{const D=Eo("focusable");return z(),ce(xt,null,[Ke((z(),je(ws,Kt({ref_key:"triggerRef",ref:s},H(v),{style:{"--icon-size":"18px"},class:"border-f3f5f8",onEscape:H(i)}),{suffix:ge(({hovered:R,focused:T})=>[a.value.length>0&&(R||T||H(r))?(z(),ce("div",Cee,[fe(ht,{onClick:Pt(d,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ge(()=>[fe(at,{src:"XMarkSolid",size:"8"})]),_:1})])):Xe("",!0),be("div",{class:Q(["wrapper-suffix",{"icon-up":H(r)}])},[fe(at,{src:"ChevronDown",size:"12",color:"#A6A6A6"})],2)]),default:ge(()=>[(z(),ce("span",{key:c.value,style:{cursor:"pointer"}},Ct(c.value),1))]),_:1},16,["onEscape"])),[[D,h.focusIndex]]),be("div",{ref_key:"popupRef",ref:o,class:Q(b.$style.list)},[(z(!0),ce(xt,null,xn(l.value,(R,T)=>(z(),je(ec,Kt({class:b.$style["list-item"],focusIndex:`${h.focusIndex}.${T}`},{ref_for:!0},R,{key:R.id,onHandleClick:()=>u(R),onEscape:H(i)}),null,16,["class","focusIndex","onHandleClick","onEscape"]))),128))],2)],64)}}}),[["__cssModules",{$style:{list:"_list_10jzh_2","list-item":"_list-item_10jzh_9"}}]]),See={key:0,class:"wrapper-suffix"},Eee=["innerHTML"],_ee=Et(ot({__name:"FilterStatus",props:{entityId:{},actived:{type:Boolean}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const s=e,o={INITIAL_PAGE:1},{triggerRef:r,popupRef:i,isVisible:a,hide:l}=Es({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),c=B([]),u=B([]),d=B(!1),h=B(!1),f=B(null),p=B(o.INITIAL_PAGE),g=B(!0),v=B(0),C=B(""),S=n,b=q(()=>a.value||s.actived),w=q(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value.length===0,wrapperRef:r,active:b,bordered:!0})),D=B(null),{argsMain:R}=ys(w),T=q(()=>u.value.filter(ie=>c.value.includes(ie.id))),I=q(()=>{const ie=T.value.length;return ie===0?"":ie===1?T.value[0].label:`${ie} statuses `}),x=q(()=>c.value),F=q(()=>{if(c.value.length===0)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const ie=T.value[0],ae=String((ie==null?void 0:ie.color)||"white");return{backgroundColor:ae,border:Lg(ae,"white")?"1px solid #ccc":"1px solid #fff"}}),E=ie=>({label:ie.name,value:ie.id,selected:c.value.includes(ie.id),hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:ie,id:ie.id,color:ie.color}),{apiServices:A}=ts(!1,s),k=async(ie=o.INITIAL_PAGE,ae="",ee=!1)=>{var V,G;ee?h.value=!0:d.value=!0,f.value=null;try{const te=un.getInstance().getItem("ws.code"),pe=await((V=A.value)==null?void 0:V.getFilterStatuses(te,s.entityId||"",{name_like:ae,page:ie,entity_ids:s.entityId}));if(!pe){ee||(u.value=[]),g.value=!1;return}const ve=pe.data.map(E);u.value=ee?[...u.value,...ve]:ve,v.value=((G=pe.meta)==null?void 0:G.total)??pe.data.length,g.value=u.value.length<v.value,p.value=ie}catch(te){console.error("Error fetching statuses:",te),f.value="Failed to load statuses",ee||(u.value=[]),g.value=!1,S("error",f.value)}finally{d.value=!1,h.value=!1}},M=ie=>{const ae=ie.id;c.value.includes(ae)?c.value=c.value.filter(V=>V!==ae):c.value=[...c.value,ae],S("update:modelValue",c.value)},O=async()=>{!g.value||h.value||await k(p.value+1,C.value,!0)},W=async ie=>{C.value=ie,p.value=o.INITIAL_PAGE,await k(o.INITIAL_PAGE,ie,!1)},X=()=>{c.value=[],S("update:modelValue",[])},J=()=>{var ie;(ie=i.value)==null||ie.focus()};return et(()=>a.value,ie=>{var ae;ie&&(k(1,C.value,!1),(ae=D.value)==null||ae.focus())}),et(()=>c.value,ie=>{S("updated",ie)},{deep:!0}),t({focus:J,clear:X,getData:()=>c.value,setData:ie=>{c.value=ie},triggerFocus:()=>{J()}}),(ie,ae)=>{const ee=Eo("tooltip"),V=Eo("focusable");return z(),ce(xt,null,[Ke((z(),je(ws,Kt({ref_key:"triggerRef",ref:r},H(R),{style:{"--icon-size":"18px"},class:"border-f3f5f8",actived:s.actived||H(a)}),{suffix:ge(({hovered:G,focused:te})=>[T.value.length>0&&(G||te||H(a))?(z(),ce("div",See,[fe(ht,{onClick:Pt(X,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ge(()=>[fe(at,{src:"XMarkSolid",size:"8"})]),_:1})])):Xe("",!0),be("div",{class:Q(["wrapper-suffix",{"icon-up":H(a)}])},[fe(at,{src:"ChevronDown",size:"12",color:"#A6A6A6"})],2)]),default:ge(()=>[be("div",{class:Q(ie.$style.status)},[T.value.length==1?(z(),ce("div",{key:0,class:Q(ie.$style["color-indicator"]),style:hn(F.value)},null,6)):Xe("",!0),Ke((z(),ce("span",{class:Q({[ie.$style.empty]:T.value.length===0,[ie.$style["status-text"]]:!0})},[st(Ct(I.value),1)],2)),[[ee,{content:I.value}]])],2)]),_:1},16,["actived"])),[[V,"3.2"]]),be("div",{ref_key:"popupRef",ref:i},[fe(Qi,{style:{width:"250px"},ref_key:"searchListRef",ref:D,"selected-id":x.value,options:u.value,loading:d.value,"loading-more":h.value,"has-more":g.value,error:f.value,onSearch:W,onSelect:M,onLoadMore:O,onCancel:H(l)},{item:ge(({item:G,selectedIndex:te,isSelected:pe,handleItemHover:ve,getHighlightedLabel:re,query:oe,idx:K})=>[(z(),je(Mk,{key:G.value,status:G.data,selected:pe(G),onMouseover:me=>ve(K),onSelect:me=>M(G),hovered:K===te},{label:ge(()=>[oe?Ke((z(),ce("span",{key:0,class:Q([ie.$style["item-label"],ie.$style.match]),style:{flex:"1"},innerHTML:re(G.label)},null,10,Eee)),[[ee,{content:G.label}]]):Ke((z(),ce("span",{key:1,class:Q(ie.$style["item-label"]),style:{flex:"1"}},[st(Ct(G.label),1)],2)),[[ee,{content:G.label}]])]),_:2},1032,["status","selected","onMouseover","onSelect","hovered"]))]),_:1},8,["selected-id","options","loading","loading-more","has-more","error","onCancel"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_pfzkz_2",status:"_status_pfzkz_6","color-indicator":"_color-indicator_pfzkz_12","count-badge":"_count-badge_pfzkz_26","status-text":"_status-text_pfzkz_33",empty:"_empty_pfzkz_42"}}],["__scopeId","data-v-7b7476c5"]]),Ree={key:0},Dee={key:1},Tee={key:0},Iee={key:1},xee={key:0,class:"wrapper-suffix"},Fee={key:1,class:"wrapper-suffix"},IO=Et(ot({__name:"FilterDateRange",props:{actived:{type:Boolean},focusIndex:{}},emits:["updated"],setup(e,{expose:t,emit:n}){const{triggerRef:s,popupRef:o,isVisible:r,hide:i}=Es({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),a=e,l=()=>{c.value=[null,null]},c=B([null,null]),u=S=>{const b=um();return S?bt.fromJSDate(S,{zone:b}).toFormat("dd/MM/yyyy"):""},d=q(()=>r.value||a.actived),h=q(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value[0]===null&&c.value[1]===null,wrapperRef:s,active:d,bordered:!0})),{argsMain:f}=ys(h),p=B(!1),g=S=>{"start"in S&&S.start!==void 0&&(c.value[0]=S.start),"end"in S&&S.end!==void 0&&(c.value[1]=S.end)};t({getData:()=>c.value,clear:l,setData:S=>{c.value=S},focus:()=>{var S;(S=C.value)==null||S.focus()},triggerFocus:()=>{var S;(S=C.value)==null||S.focus()}});const v=n;et(()=>c.value,S=>{v("updated",S)},{deep:!0});const C=B(null);return et(()=>r.value,S=>{S&&setTimeout(()=>{var b;(b=C.value)==null||b.focus()},0)}),(S,b)=>{const w=Eo("focusable");return z(),ce(xt,null,[Ke((z(),je(ws,Kt({ref_key:"triggerRef",ref:s},H(f),{actived:a.actived||H(r),style:{"--icon-size":"18px",cursor:"pointer"}}),{default:ge(({focused:D})=>[be("div",{class:Q(S.$style["date-time"])},[be("div",{class:Q(S.$style.date)},[c.value[0]==null&&(D||H(r))?(z(),ce("span",Ree,"DD/MM/YYYY")):(z(),ce("span",Dee,Ct(u(c.value[0])),1))],2),c.value[0]!==null||c.value[1]!==null||D||H(r)?(z(),ce("div",{key:0,class:Q(S.$style.separator)}," → ",2)):Xe("",!0),be("div",{class:Q(S.$style.date)},[c.value[1]==null&&(D||H(r))?(z(),ce("span",Tee,"DD/MM/YYYY")):(z(),ce("span",Iee,Ct(u(c.value[1])),1))],2)],2)]),suffix:ge(({hovered:D,focused:R})=>[(c.value[0]!==null||c.value[1]!==null)&&(D||R||H(r))?(z(),ce("div",xee,[fe(ht,{onClick:Pt(l,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ge(()=>[fe(at,{src:"XMarkSolid",size:"8"})]),_:1})])):(z(),ce("div",Fee,[fe(at,{src:"Calendar",size:"12",color:"#A6A6A6"})]))]),_:1},16,["actived"])),[[w,a.focusIndex]]),be("div",{ref_key:"popupRef",ref:o},[H(r)?(z(),je(Am,{key:0,immediatelyUpdate:!1,value:c.value,onConfirmed:g,ref_key:"calendarRef",ref:C,onClosed:H(i),onStartUpdate:b[0]||(b[0]=D=>p.value=!0),onFinishUpdate:b[1]||(b[1]=D=>p.value=!1)},null,8,["value","onClosed"])):Xe("",!0)],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_1695v_2","date-time":"_date-time_1695v_5",date:"_date_1695v_5",separator:"_separator_1695v_16"}}]]),Pee=Et(ot({__name:"Switch",props:{modelValue:{type:String,required:!0,validator:e=>["AND","OR"].includes(e)},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,s=t,o=u=>{n.disabled||n.modelValue===u||s("update:modelValue",u)},r=q(()=>n.modelValue==="AND"?"left":"right"),i=q(()=>n.modelValue==="AND"&&l.value?l.value.offsetWidth+"px":n.modelValue==="OR"&&c.value?c.value.offsetWidth+"px":"calc(50% - 2px)"),a=q(()=>n.modelValue==="AND"?"translateX(0)":n.modelValue==="OR"&&l.value?`translateX(${l.value.offsetWidth+2}px)`:"translateX(0)"),l=B(null),c=B(null);return(u,d)=>(z(),ce("div",{class:Q(["switch-container",{disabled:e.disabled}])},[be("div",{class:Q(["slider",r.value]),style:hn({width:i.value,transform:a.value})},null,6),be("div",{class:Q(["option",{active:e.modelValue==="AND"}]),onClick:d[0]||(d[0]=h=>o("AND")),ref_key:"andRef",ref:l}," AND ",2),be("div",{class:Q(["option",{active:e.modelValue==="OR"}]),onClick:d[1]||(d[1]=h=>o("OR")),ref_key:"orRef",ref:c}," OR ",2)],2))}}),[["__scopeId","data-v-964beee9"]]),Df=Et(ot({__name:"FilterRow",props:{logic:{},label:{},dataTabIndex:{},openDropdown:{type:Function}},setup(e,{expose:t}){const n=e;return t({triggerFocus:()=>{var s;(s=n.openDropdown)==null||s.call(n)}}),(s,o)=>(z(),ce("div",{class:Q(s.$style["filter-line"])},[be("div",{class:Q(s.$style["filter-logic"])},[be("span",{class:Q(s.$style["filter-tag"])},[Tt(s.$slots,"logic",{},()=>[st(Ct(e.logic),1)],!0)],2)],2),be("span",null,Ct(e.label),1),be("span",null,[Tt(s.$slots,"is",{},()=>[o[0]||(o[0]=st("is",-1))],!0)]),be("div",{class:Q(s.$style.selector)},[Tt(s.$slots,"default",{},void 0,!0)],2)],2))}}),[["__cssModules",{$style:{"filter-line":"_filter-line_1jv6h_1","filter-tag":"_filter-tag_1jv6h_8",selector:"_selector_1jv6h_27"}}],["__scopeId","data-v-1fe9c01d"]]),Aee={style:{height:"18px","min-width":"18px",width:"18px",display:"flex","align-items":"center","justify-content":"center"}},kee=["fill"],Oee=["fill"],Mee=Et(ot({__name:"FilterBox",props:{loading:{type:Boolean},entityId:{}},emits:["update:assignees","apply-filter"],setup(e,{expose:t,emit:n}){const s=To,o=qt,r=e,i={ACTIVE:"#000",DEFAULT:"#3C9BFA"},{hide:a,isVisible:l,triggerRef:c,popupRef:u}=Es({toggleOnClick:!0,offset:[0,0],maxWidth:650,zIndex:2}),d=hv(),{workspaceUserRoleId:h}=Qs(d),f=n,p=B(null),g=B(null),v=B(null),C=B(null),S=B(null),b=B(null),w=B(null),D=(re,oe)=>{b.value={...b.value,[re]:oe}},R=q(()=>h.value||""),T=B("AND"),I=q(()=>F.value?i.ACTIVE:i.DEFAULT),x=q(()=>({border:F.value?"1px solid var(--primary-color)":"",backgroundColor:F.value?"#F0F7FF":"",padding:F.value?"2px 8px 2px 8px":"2px 8px",gap:"0"})),F=q(()=>M(w.value)>0),E=q(()=>M(b.value)),A=q(()=>E.value===0),k=q(()=>E.value<=1),M=re=>{var me,se,Se;let oe=0;return re&&((((me=re.assignees)==null?void 0:me.assignees)&&re.assignees.assignees.length>0||((se=re.assignees)==null?void 0:se.showMe)||((Se=re.assignees)==null?void 0:Se.showNoAssignee))&&oe++,re.statuses&&re.statuses.length>0&&oe++,re.archiveStatuses&&re.archiveStatuses.length>0&&oe++,re.startDateRange&&(re.startDateRange[0]||re.startDateRange[1])&&oe++,re.dueDateRange&&(re.dueDateRange[0]||re.dueDateRange[1])&&oe++),oe},O=re=>re?re.toISOString():null,W=re=>{var Z;const oe={};if(!re)return oe;const K=((Z=re.assignees)==null?void 0:Z.map(de=>de.id))||[],me=re.showMe,se=re.showNoAssignee,Se=re.selectedTypeId,U=me&&R.value?[...K,R.value]:K;if(U.length>0){const de=U.join(",");Se==="any"?oe.assignee_any_ina=de||"":Se==="all"&&(oe.assignee_all_ina=de)}return se&&Se==="any"&&(oe.with_not_assigned="1"),oe},X=(re,oe)=>{const K={},[me,se]=re;if(me&&se){const Se=O(me),U=O(se);Se&&U&&(K[`${oe}_btw`]=`${Se},${U}`)}else if(me){const Se=O(me);Se&&(K[`${oe}_gte`]=Se)}else if(se){const Se=O(se);Se&&(K[`${oe}_lte`]=Se)}return K},J=re=>{const oe={};Object.assign(oe,W(re.assignees));const{statuses:K,archiveStatuses:me,startDateRange:se,dueDateRange:Se}=re;return K&&K.length>0&&(oe.status_ina=K.join(",")),T.value=="AND"?oe.condition_combine_type="and":oe.condition_combine_type="or",se&&Object.assign(oe,X(se,"start_date")),Se&&Object.assign(oe,X(Se,"due_date")),!me||me.length===0?oe.preflight_status="1":me&&me.length===1?oe.status_eq=me[0]==="archived"?"0":"1":me&&me.length===2?oe.status_eq="0,1":Object.keys(oe).length===0&&(oe.status_eq="1"),oe},ie=re=>{if(re===null||typeof re!="object")return re;if(re instanceof Date)return new Date(re.getTime());if(Array.isArray(re))return re.map(K=>ie(K));const oe={};for(const K in re)Object.prototype.hasOwnProperty.call(re,K)&&(oe[K]=ie(re[K]));return oe},ae=()=>{var re,oe,K,me,se;return{assignees:((re=p.value)==null?void 0:re.getData())||{},statuses:((oe=g.value)==null?void 0:oe.getData())||[],startDateRange:((K=v.value)==null?void 0:K.getData())||[null,null],dueDateRange:((me=C.value)==null?void 0:me.getData())||[null,null],archiveStatuses:((se=S.value)==null?void 0:se.getData())||[]}},ee=re=>{var oe,K,me,se,Se,U,Z,de,Ae,Fe,Le,ye,N,$,le,Ge,we,ze,Ue,_e;if(!re){(K=(oe=p.value)==null?void 0:oe.clear)==null||K.call(oe),(se=(me=g.value)==null?void 0:me.clear)==null||se.call(me),(U=(Se=v.value)==null?void 0:Se.clear)==null||U.call(Se),(de=(Z=C.value)==null?void 0:Z.clear)==null||de.call(Z),(Fe=(Ae=S.value)==null?void 0:Ae.clear)==null||Fe.call(Ae);return}re.assignees&&((ye=(Le=p.value)==null?void 0:Le.setData)==null||ye.call(Le,re.assignees)),re.statuses&&(($=(N=g.value)==null?void 0:N.setData)==null||$.call(N,re.statuses)),re.startDateRange&&((Ge=(le=v.value)==null?void 0:le.setData)==null||Ge.call(le,re.startDateRange)),re.dueDateRange&&((ze=(we=C.value)==null?void 0:we.setData)==null||ze.call(we,re.dueDateRange)),re.archiveStatuses&&((_e=(Ue=S.value)==null?void 0:Ue.setData)==null||_e.call(Ue,re.archiveStatuses))},V=()=>{const re=ae(),oe=J(re);w.value=ie(re),b.value=ie(re),f("apply-filter",oe),a()},G=()=>{var re,oe,K,me,se,Se,U,Z,de,Ae;(oe=(re=p.value)==null?void 0:re.clear)==null||oe.call(re),(me=(K=g.value)==null?void 0:K.clear)==null||me.call(K),(Se=(se=v.value)==null?void 0:se.clear)==null||Se.call(se),(Z=(U=C.value)==null?void 0:U.clear)==null||Z.call(U),(Ae=(de=S.value)==null?void 0:de.clear)==null||Ae.call(de),T.value="AND",b.value=null},te=()=>{G(),w.value=null,b.value=null,f("apply-filter",{preflight_status:"1"})};et(E,re=>{re==0&&(T.value="AND")});const pe=()=>{w.value?(ee(ie(w.value)),b.value=ie(w.value)):(ee(null),b.value=null)};et(l,(re,oe)=>{var K;re&&((K=u.value)==null||K.focus()),re&&!oe?w.value&&(ee(ie(w.value)),b.value=ie(w.value)):!re&&oe&&pe()}),t({getData:ae,getParams:()=>J(ae()),clear:te,revertToCache:pe});const ve=B(null);return et(()=>l.value,(re,oe)=>{re&&!oe&&vt(()=>{setTimeout(()=>{var K;(K=ve.value)==null||K.click()},1e3)})}),(re,oe)=>{var me,se,Se,U,Z,de,Ae;const K=Eo("focusable");return z(),ce(xt,null,[be("div",{ref_key:"triggerRef",ref:c},[Ke((z(),je(ht,{variant:["secondary"],actived:H(l)||F.value,style:hn({...x.value}),onEscape:H(a)},nh({prefix:ge(()=>[Ke((z(),ce("div",Aee,[(z(),ce("svg",{width:"14",height:"12",viewBox:"0 0 14 12",fill:I.value,xmlns:"http://www.w3.org/2000/svg"},[be("path",{d:"M0.0998533 0.587105C0.269063 0.228176 0.627991 0 1.02538 0H12.1009C12.4983 0 12.8572 0.228176 13.0264 0.587105C13.1956 0.946034 13.1443 1.36906 12.8931 1.67671L8.20395 7.40675V10.6653C8.20395 10.9755 8.02961 11.2601 7.75016 11.3986C7.47071 11.537 7.13998 11.5088 6.8913 11.3216L5.25048 10.091C5.04281 9.9372 4.92232 9.69364 4.92232 9.4347V7.40675L0.230606 1.67415C-0.0180804 1.36906 -0.0719197 0.94347 0.0998533 0.587105Z",fill:I.value},null,8,Oee)],8,kee))])),[[H(o),"Filter"]])]),_:2},[F.value?{name:"suffix",fn:ge(()=>[Ke((z(),ce("div",{onClick:Pt(te,["stop","prevent"]),style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center","margin-left":"4px"},class:"rotate-icon"},[fe(at,{src:"XMarkSolid",size:9})])),[[H(o),"Clear filter"]])]),key:"0"}:void 0]),1032,["actived","style","onEscape"])),[[H(s),{isLoading:e.loading,fullwidth:!0}],[K,"3"]])],512),be("div",{ref_key:"popupRef",ref:u,class:Q(re.$style["basic-filter"]),tabindex:"0"},[be("div",{class:Q(re.$style.row)},[be("span",{class:Q(re.$style["filter-header"])},[oe[6]||(oe[6]=st(" Filters ",-1)),Ke(fe(Pee,{modelValue:T.value,"onUpdate:modelValue":oe[0]||(oe[0]=Fe=>T.value=Fe),disabled:k.value},null,8,["modelValue","disabled"]),[[H(o),{content:k.value?"Available only when more than one filter is selected.":"",bypassOverflowCheck:!0}]])],2),E.value>0||((se=(me=b.value)==null?void 0:me.assignees)==null?void 0:se.selectedTypeId)=="all"?(z(),ce("div",{key:0,class:Q(re.$style.row)},[Ke((z(),je(ht,{size:"small",variant:"secondary",onClick:G,onEscape:H(a)},{default:ge(()=>[...oe[7]||(oe[7]=[st(" Clear all ",-1)])]),_:1},8,["onEscape"])),[[K,"3.7"]])],2)):Xe("",!0)],2),fe(Df,{logic:T.value,label:"Assignee",openDropdown:(Se=p.value)==null?void 0:Se.triggerFocus},{logic:ge(()=>[...oe[8]||(oe[8]=[st("Where",-1)])]),default:ge(()=>[fe(wee,{entityId:r.entityId,ref_key:"FilterAssigneeRef",ref:p,onUpdated:oe[1]||(oe[1]=Fe=>D("assignees",Fe)),onEscape:H(a)},null,8,["entityId","onEscape"])]),_:1},8,["logic","openDropdown"]),fe(Df,{logic:T.value,label:"Status",openDropdown:(U=g.value)==null?void 0:U.triggerFocus},{default:ge(()=>[fe(_ee,{ref_key:"FilterStatusRef",ref:g,entityId:r.entityId,onUpdated:oe[2]||(oe[2]=Fe=>D("statuses",Fe))},null,8,["entityId"])]),_:1},8,["logic","openDropdown"]),fe(Df,{logic:T.value,openDropdown:(Z=v.value)==null?void 0:Z.triggerFocus,label:"Start Date"},{default:ge(()=>[fe(IO,{focusIndex:"3.3",ref_key:"FilterStartDateRangeRef",ref:v,onUpdated:oe[3]||(oe[3]=Fe=>D("startDateRange",Fe))},null,512)]),_:1},8,["logic","openDropdown"]),fe(Df,{logic:T.value,label:"Due Date",openDropdown:(de=C.value)==null?void 0:de.triggerFocus},{default:ge(()=>[fe(IO,{focusIndex:"3.4",ref_key:"FilterDueDateRangeRef",ref:C,onUpdated:oe[4]||(oe[4]=Fe=>D("dueDateRange",Fe))},null,512)]),_:1},8,["logic","openDropdown"]),fe(Df,{logic:T.value,label:"Archive Status",openDropdown:(Ae=S.value)==null?void 0:Ae.triggerFocus},{default:ge(()=>[fe(bee,{focusIndex:"3.5",ref_key:"FilterArchiveStatusRef",ref:S,onUpdated:oe[5]||(oe[5]=Fe=>D("archiveStatuses",Fe))},null,512)]),_:1},8,["logic","openDropdown"]),be("div",{class:Q([re.$style.row,re.$style["justify-end"]])},[Ke((z(),je(ht,{size:"small",onClick:V,disabled:A.value,onEscape:H(a)},{default:ge(()=>[...oe[9]||(oe[9]=[st(" Apply filter ",-1)])]),_:1},8,["disabled","onEscape"])),[[K,"3.6"]])],2)],2)],64)}}}),[["__cssModules",{$style:{row:"_row_1mu3v_1","justify-end":"_justify-end_1mu3v_7","basic-filter":"_basic-filter_1mu3v_11","filter-grid":"_filter-grid_1mu3v_29","filter-line":"_filter-line_1mu3v_34","filter-tag":"_filter-tag_1mu3v_41",selector:"_selector_1mu3v_56","filter-header":"_filter-header_1mu3v_66"}}]]),Nee=ot({__name:"RatingRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{},sceneId:{}},setup(e,{expose:t}){var I;const n=To,s=e,{isEditing:o}=Fu(s),{apiServices:r}=ts(!0,s),i=q(()=>{var x,F;return{value:a.value,metricConfig:((F=(x=s.params)==null?void 0:x.colDef)==null?void 0:F.context)||s.config,error:s.error,hovered:!1,readOnly:s.disabled,disabled:s.readOnly,apiServices:r.value}}),a=B(Number(s.value)),l=B(!1),{componentState:c,metricConfig:u,ICON_SIZE:d,ratingParams:h,standardNameforIcon:f}=Bk(i,l),{updateCellData:p}=RO((I=s.params)==null?void 0:I.api),g=x=>{a.value=x,S(x)},v=x=>{var F,E,A;p({rowId:String((E=(F=s.params)==null?void 0:F.data)==null?void 0:E.id),field:`metric_${((A=u.value)==null?void 0:A.id)||""}`,value:x})},C=q(()=>{var x,F;return(s==null?void 0:s.sceneId)||((F=(x=s.params)==null?void 0:x.data)==null?void 0:F.id)}),S=async x=>{var F,E;v(void 0);try{const A=await((E=r.value)==null?void 0:E.bulkUpdateMetric({workspaceId:s.workspaceId||"",itemIds:[C.value||""],value:x==0||x===null?null:x.toString(),metricId:((F=u.value)==null?void 0:F.id)||""}));if((A==null?void 0:A.message)=="Done")v(x),b.value=x;else throw console.error("Rating update: failed, reverting to cached value"),v(b.value),new Error("Update failed")}catch(A){console.error("Rating update: error updating value, reverting to cached value",A),v(b.value)}},b=B(a.value),w=async()=>{vt(()=>{setTimeout(async()=>{await S(a.value)},100)})},D=q(()=>({disabled:s.disabled,error:c.value.isError,clickable:!0,readOnly:s.readOnly,isEmpty:c.value.isEmpty})),{argsMain:R}=ys(D),T=B(null);return t({focus:()=>{var x,F;(F=(x=T.value)==null?void 0:x.focus)==null||F.call(x)}}),(x,F)=>(z(),je(ws,Kt({style:{"--icon-size":"24px","--box-padding":"0 0 0 0"}},H(R),{ref:"wrapperRef",actived:H(o),size:32,tabindex:"0",bordered:!0}),{default:ge(()=>[H(c).isRating&&H(h).maxRating?Ke((z(),je(UA,{key:0,ref_key:"ratingComponentRef",ref:T,modelValue:a.value,"onUpdate:modelValue":F[0]||(F[0]=E=>a.value=E),params:H(h),readOnly:s.readOnly,disabled:s.disabled,onHandleEnter:g},{icon:ge(()=>[fe(at,{onClick:w,source:"rating",src:H(f)()||"Star",size:H(d)},null,8,["src","size"])]),_:1},8,["modelValue","params","readOnly","disabled"])),[[H(n),{isLoading:H(c).isLoading,fullwidth:!0}]]):Xe("",!0)]),_:1},16,["actived"]))}}),Lee=["innerHTML"],$S="Copy",xO="Copied to clipboard",Vee=5e3,Bee=Et(ot({__name:"NotePreviewer",props:{isOpen:{type:Boolean},canEdit:{type:Boolean},sceneId:{},disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},emits:["close","edit"],setup(e,{emit:t}){const n=qt,s=e,o=B(null),r=B($S);let i=null;const a=()=>{i&&(clearTimeout(i),i=null)},l=async()=>{const d=AF(String(s.value??""));try{try{typeof ClipboardItem<"u"?await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([s.value??""],{type:"text/html"}),"text/plain":new Blob([d],{type:"text/plain"})})]):await navigator.clipboard.writeText(d),r.value=xO}catch(h){console.error("[NotePreviewer] Failed to copy note to clipboard:",h);return}r.value=xO}catch(h){console.error("[NotePreviewer] Failed to copy note to clipboard:",h);return}a(),i=setTimeout(()=>{r.value=$S},Vee)};et(()=>s.isOpen,d=>{d||(a(),r.value=$S)});const c=t,u=()=>{c("edit")};return(d,h)=>(z(),ce("div",{class:Q(d.$style["note-previewer"]),ref_key:"popupRef",ref:o},[be("div",{class:Q(d.$style["note-preview-header"])},[be("div",{class:Q(d.$style["note-preview-title"])},"Notes",2),be("div",{class:Q(d.$style["note-preview-actions"])},[Ke((z(),je(H(ht),{variant:["secondary","icon"],size:"small",onClick:l},{default:ge(()=>[fe(at,{src:"Copy"})]),_:1})),[[H(n),{content:r.value}]]),s.canEdit?Ke((z(),je(H(ht),{key:0,variant:["secondary","icon"],size:"small",onClick:u},{default:ge(()=>[fe(at,{src:"Pen"})]),_:1})),[[H(n),"Edit in Full View "]]):Xe("",!0)],2)],2),be("div",{class:Q(d.$style["note-preview-content"])},[be("div",{class:Q(d.$style["note-preview-text"]),innerHTML:s.value},null,10,Lee)],2)],2))}}),[["__cssModules",{$style:{"note-previewer":"_note-previewer_1tqlx_1","note-preview-header":"_note-preview-header_1tqlx_11","note-preview-content":"_note-preview-content_1tqlx_24","note-preview-title":"_note-preview-title_1tqlx_50","note-preview-actions":"_note-preview-actions_1tqlx_71"}}]]),$ee={key:0,class:"note-edit-btn"};let Yu=null;function Hee(e){Yu&&Yu!==e&&Yu(),Yu=e}function FO(e){Yu===e&&(Yu=null)}const Gee=Et(ot({__name:"NoteRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=qt,n=e,s=B(null),o=1e3,r=1e3,i=50,a=q(()=>AF(String(n.value??""))),l=q(()=>a.value.length>0),c=q(()=>{var O,W;return((W=(O=n.data)==null?void 0:O.permissions)==null?void 0:W.has_edit_permission)==1}),u=q(()=>{if(!l.value)return"-";const O=a.value.split(`
|
|
174
|
-
`)[0];return O.length>i?`${O.slice(0,i)}…`:O});let d=null,h=null,f=!1,p=!1,g=!1;const v=()=>{d&&(clearTimeout(d),d=null)},C=()=>{h&&(clearTimeout(h),h=null)},{popupRef:S,triggerRef:b,show:w,hide:D,isVisible:R}=Es({trigger:"manual",appendTo:()=>document.getElementById("item-table-layout-id")||document.body,maxWidth:420,offset:[0,0],zIndex:1e3,onShow:()=>{Hee(D)},onHide:()=>{f=!1,v(),C(),FO(D)}}),T=()=>{f||(C(),h=setTimeout(()=>{!p&&!g&&D()},r))},I=()=>{p=!0,C(),!(!l.value||R.value)&&(v(),d=setTimeout(()=>{f=!1,w()},o))},x=()=>{p=!1,v()},F=()=>{g=!0,C()},E=()=>{g=!1},A=()=>{l.value&&(v(),C(),R.value?D():(f=!0,w()))},k=O=>{var X;if(!R.value)return;const W=O.target;W&&((X=S.value)!=null&&X.contains(W))||D()};et(b,(O,W,X)=>{const J=O;J&&(J.addEventListener("mouseenter",I),J.addEventListener("mouseleave",x),J.addEventListener("click",A),X(()=>{J.removeEventListener("mouseenter",I),J.removeEventListener("mouseleave",x),J.removeEventListener("click",A)}))}),et(S,(O,W,X)=>{O&&(O.addEventListener("mouseenter",F),O.addEventListener("mouseleave",E),X(()=>{O.removeEventListener("mouseenter",F),O.removeEventListener("mouseleave",E)}))}),window.addEventListener("scroll",k,!0),ms(()=>{v(),C(),FO(D),window.removeEventListener("scroll",k,!0)});const M=()=>{if(window.switchApploader)window.switchApploader("scene_hub",{tab:"home",id:n.id||"",editDescription:!0},{showLoading:!1});else{const O=un.getInstance().getItem("ws.code")||"",W=un.getInstance().getItem("BASE_URL"),X=Xs({type:"scene_hub",config:{baseDomain:W,ws_code:O,scene_id:String(n.id)}}).url;window.open(X,"_blank")}D()};return(O,W)=>(z(),ce("div",{class:"note-wrapper",ref_key:"wrapperRef",ref:s},[be("div",{class:Q(["note-renderer",{"note-renderer--empty":!l.value,"note-renderer--can-edit":c.value}]),onMouseleave:T,ref_key:"triggerRef",ref:b},[be("div",{class:Q(["note-content",{"note-content--empty":!l.value}])},Ct(u.value),3),c.value?(z(),ce("div",$ee,[c.value?Ke((z(),je(H(ht),{key:0,variant:["secondary","icon"],onClick:Pt(M,["stop"]),size:"small"},{default:ge(()=>[fe(at,{src:"Pen"})]),_:1})),[[H(t),{content:"Edit in Full View "}]]):Xe("",!0)])):Xe("",!0)],34),l.value?(z(),ce("div",{key:0,ref_key:"popupRef",ref:S,onMouseleave:T},[fe(Bee,{onClose:H(D),value:n.value,"read-only":!1,sceneId:n.id,"is-open":H(R),"can-edit":c.value,onEdit:M},null,8,["onClose","value","sceneId","is-open","can-edit"])],544)):Xe("",!0)],512))}}),[["__scopeId","data-v-
|
|
174
|
+
`)[0];return O.length>i?`${O.slice(0,i)}…`:O});let d=null,h=null,f=!1,p=!1,g=!1;const v=()=>{d&&(clearTimeout(d),d=null)},C=()=>{h&&(clearTimeout(h),h=null)},{popupRef:S,triggerRef:b,show:w,hide:D,isVisible:R}=Es({trigger:"manual",appendTo:()=>document.getElementById("item-table-layout-id")||document.body,maxWidth:420,offset:[0,0],zIndex:1e3,onShow:()=>{Hee(D)},onHide:()=>{f=!1,v(),C(),FO(D)}}),T=()=>{f||(C(),h=setTimeout(()=>{!p&&!g&&D()},r))},I=()=>{p=!0,C(),!(!l.value||R.value)&&(v(),d=setTimeout(()=>{f=!1,w()},o))},x=()=>{p=!1,v()},F=()=>{g=!0,C()},E=()=>{g=!1},A=()=>{l.value&&(v(),C(),R.value?D():(f=!0,w()))},k=O=>{var X;if(!R.value)return;const W=O.target;W&&((X=S.value)!=null&&X.contains(W))||D()};et(b,(O,W,X)=>{const J=O;J&&(J.addEventListener("mouseenter",I),J.addEventListener("mouseleave",x),J.addEventListener("click",A),X(()=>{J.removeEventListener("mouseenter",I),J.removeEventListener("mouseleave",x),J.removeEventListener("click",A)}))}),et(S,(O,W,X)=>{O&&(O.addEventListener("mouseenter",F),O.addEventListener("mouseleave",E),X(()=>{O.removeEventListener("mouseenter",F),O.removeEventListener("mouseleave",E)}))}),window.addEventListener("scroll",k,!0),ms(()=>{v(),C(),FO(D),window.removeEventListener("scroll",k,!0)});const M=()=>{if(window.switchApploader)window.switchApploader("scene_hub",{tab:"home",id:n.id||"",editDescription:!0},{showLoading:!1});else{const O=un.getInstance().getItem("ws.code")||"",W=un.getInstance().getItem("BASE_URL"),X=Xs({type:"scene_hub",config:{baseDomain:W,ws_code:O,scene_id:String(n.id)}}).url;window.open(X,"_blank")}D()};return(O,W)=>(z(),ce("div",{class:"note-wrapper",ref_key:"wrapperRef",ref:s},[be("div",{class:Q(["note-renderer",{"note-renderer--empty":!l.value,"note-renderer--can-edit":c.value}]),onMouseleave:T,ref_key:"triggerRef",ref:b},[be("div",{class:Q(["note-content",{"note-content--empty":!l.value}])},Ct(u.value),3),c.value?(z(),ce("div",$ee,[c.value?Ke((z(),je(H(ht),{key:0,variant:["secondary","icon"],onClick:Pt(M,["stop"]),size:"small"},{default:ge(()=>[fe(at,{src:"Pen"})]),_:1})),[[H(t),{content:"Edit in Full View "}]]):Xe("",!0)])):Xe("",!0)],34),l.value?(z(),ce("div",{key:0,ref_key:"popupRef",ref:S,onMouseleave:T},[fe(Bee,{onClose:H(D),value:n.value,"read-only":!1,sceneId:n.id,"is-open":H(R),"can-edit":c.value,onEdit:M},null,8,["onClose","value","sceneId","is-open","can-edit"])],544)):Xe("",!0)],512))}}),[["__scopeId","data-v-99d4dc65"]]);/*!
|
|
175
175
|
* shared v9.14.5
|
|
176
176
|
* (c) 2025 kazuya kawaguchi
|
|
177
177
|
* Released under the MIT License.
|
|
@@ -255,5 +255,5 @@ See ${KN(e,t)}`;return Array.isArray(s)?s.concat(r):[s,r]}var fge={1:"Charting A
|
|
|
255
255
|
`)}checkProperties(e,t,n,s,o){const r=["__ob__","__v_skip","__metadata__"],i=Oge(Object.getOwnPropertyNames(e),[...r,...t,...n],n),a=Object.keys(i);for(const l of a){const c=i[l];let u=`invalid ${s} property '${l}' did you mean any of these: ${c.slice(0,8).join(", ")}.`;n.includes("context")&&(u+=`
|
|
256
256
|
If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),zf(u)}if(a.length>0&&o){const l=this.beans.frameworkOverrides.getDocLink(o);zf(`to see all the valid ${s} properties please check: ${l}`)}}};function Oge(e,t,n){const s={},o=e.filter(r=>!t.some(i=>i===r));if(o.length>0)for(const r of o)s[r]=e0({inputValue:r,allSuggestions:n}).values;return s}var Mge=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),Nge={moduleName:"Validation",version:ct,beans:[kge]};function j2(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var Lge=class extends We{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){var n;const t=!!((n=this.filterManager)!=null&&n.isChildFilterPresent());this.filterNodes(t,e)}filterNodes(e,t){const n=(s,o)=>{s.hasChildren()&&e&&!o?s.childrenAfterFilter=s.childrenAfterGroup.filter(r=>{const i=r.childrenAfterFilter&&r.childrenAfterFilter.length>0,a=r.data&&this.filterManager.doesRowPassFilter({rowNode:r});return i||a}):s.childrenAfterFilter=s.childrenAfterGroup,j2(s)};if(this.doingTreeDataFiltering()){const s=(r,i)=>{if(r.childrenAfterGroup)for(let a=0;a<r.childrenAfterGroup.length;a++){const l=r.childrenAfterGroup[a],c=i||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?s(r.childrenAfterGroup[a],c):n(l,c)}n(r,i)},o=r=>s(r,!1);t.executeFromRootNode(o)}else{const s=o=>n(o,!1);t.forEachChangedNodeDepthFirst(s,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},Vge=class extends F0{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,n,s,o){this.comp=e;const r=Jf(this,this.beans.context,o);this.eButtonShowMainFilter=n,this.eFloatingFilterBody=s,this.setGui(t,r),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(r),this.setupLeft(r),this.setupHover(r),this.setupFocus(r),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(r),this.setupUi(),r.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(r);const i=()=>this.onColDefChanged(r);r.addManagedListeners(this.column,{colDefChanged:i}),r.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&i()}}),r.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,n=e.colDef;return 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=hr("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new wd(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.getLocaleTextFunc();od(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){var i;const{beans:t}=this;if(Un(t)===this.eGui)return;const o=Sc(t,this.eGui,null,e.shiftKey);if(o){(i=t.headerNavigation)==null||i.scrollToColumn(this.column),e.preventDefault(),o.focus();return}const r=this.findNextColumnWithFloatingFilter(e.shiftKey);r&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:r},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let n=this.column;do if(n=e?t.getColBefore(n):t.getColAfter(n),!n)break;while(!n.getColDef().filter||!n.getColDef().floatingFilter);return n}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case Oe.UP:case Oe.DOWN:case Oe.LEFT:case Oe.RIGHT:if(t)return;Rc(e);case Oe.ENTER:t&&bc(this.eGui)&&e.preventDefault();break;case Oe.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const n=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),s=!!e.relatedTarget&&pc(e.relatedTarget,"ag-floating-filter");if(n&&s&&e.target===this.eGui){const o=this.lastFocusEvent,r=!!(o&&o.key===Oe.TAB);if(o&&r){const i=o.shiftKey;bc(this.eGui,i)}}this.focusThis()}setupHover(e){var t;(t=this.beans.colHover)==null||t.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new x0(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){var e;this.suppressFilterButton=!((e=this.beans.menuSvc)!=null&&e.isFloatingFilterButtonEnabled(this.column)),this.highlightFilterButtonWhenActive=!$o(this.gos)}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.colFilter)==null?void 0:t.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){var t;const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;(t=this.beans.menuSvc)==null||t.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:n,gos:s}=this,o=r=>{if((r==null?void 0:r.source)==="filterDestroyed"&&(!this.isAlive()||!(t!=null&&t.isAlive())))return;const i=this.comp.getFloatingFilterComp();i&&i.then(a=>{if(a){if(s.get("enableFilterHandlers")){const u=r;let d="filter";u!=null&&u.afterFloatingFilter?d="ui":u!=null&&u.afterDataChange?d="dataChanged":(r==null?void 0:r.source)==="api"&&(d="api"),this.updateFloatingFilterParams(this.userCompDetails,d);return}const l=t==null?void 0:t.getCurrentFloatingFilterParentModel(n),c=r?{...r,columns:r.columns??[],source:r.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,c)}})};[this.destroySyncListener]=e.addManagedListeners(n,{filterChanged:o}),t!=null&&t.isFilterActive(n)&&o(null)}setupWidth(e){const t=()=>{const n=`${this.column.getActualWidth()}px`;this.comp.setWidth(n)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){var e;if(!this.suppressFilterButton&&this.comp){const t=!!((e=this.beans.filterManager)!=null&&e.isFilterAllowed(this.column));this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const n=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const s=this.beans.colFilter,o=this.active?s==null?void 0:s.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,r=this.comp.getFloatingFilterComp();!r||!o?this.updateCompDetails(e,o,n):r.then(i=>{!i||s!=null&&s.areFilterCompsDifferent(this.userCompDetails??null,o)?this.updateCompDetails(e,o,n):this.updateFloatingFilterParams(o,"colDef")})}updateCompDetails(e,t,n){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),n&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){var s;if(!e)return;let n=e.params;(s=this.comp.getFloatingFilterComp())==null||s.then(o=>{var r;typeof(o==null?void 0:o.refresh)=="function"&&(this.gos.get("enableFilterHandlers")&&(n={...n,model:Ts(((r=this.beans.colFilter)==null?void 0:r.model)??{},this.column.getColId()),source:t}),o.refresh(n))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function Bge(e,t){var s;const n=e.colModel.getCol(t);if(!n){En(12,{colKey:t});return}(s=e.menuSvc)==null||s.showColumnMenu({column:n,positionBy:"auto"})}function $ge(e){var t;(t=e.menuSvc)==null||t.hidePopupMenu()}var Hge={moduleName:"SharedMenu",version:ct,beans:[Jle],apiFunctions:{showColumnMenu:Bge,hidePopupMenu:$ge}},Gge=class extends wae{postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getDefaultPopupParent(){return this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:n,event:s}=e,o=t.getBoundingClientRect(),r=this.getParentRect();this.setAlignedTo(t,n);let i=!1;const a=()=>{const l=this.keepXYWithinBounds(n,o.top-r.top,0),c=n.clientWidth>0?n.clientWidth:200;i||(n.style.minWidth=`${c}px`,i=!0);const d=r.right-r.left-c;let h;return this.gos.get("enableRtl")?(h=p(),h<0&&(h=f(),this.setAlignedStyles(n,"left")),h>d&&(h=0,this.setAlignedStyles(n,"right"))):(h=f(),h>d&&(h=p(),this.setAlignedStyles(n,"right")),h<0&&(h=0,this.setAlignedStyles(n,"left"))),{x:h,y:l};function f(){return o.right-r.left-2}function p(){return o.left-r.left-c}};this.positionPopup({ePopup:n,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",n,t,s instanceof MouseEvent?s:void 0)})}callPostProcessPopup(e,t,n,s,o){const r=this.gos.getCallback("postProcessPopup");if(r){const{column:i,rowNode:a}=e;r({column:i,rowNode:a,ePopup:n,type:t,eventSource:s,mouseEvent:o})}}getActivePopups(){return this.popupList.map(e=>e.element)}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const n of this.popupList)t.applyThemeClasses(n.wrapper)}}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return ga(e)}},Ey={moduleName:"Popup",version:ct,beans:[Gge]},Uge=".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 Wge(e){const t=e.filterManager;return!!(t!=null&&t.isColumnFilterPresent())||!!(t!=null&&t.isAggregateFilterPresent())}function zge(e,t){var n;return((n=e.filterManager)==null?void 0:n.getColumnFilterInstance(t))??Promise.resolve(void 0)}function jge(e,t){var s;const n=e.colModel.getColDefCol(t);if(n)return(s=e.colFilter)==null?void 0:s.destroyFilter(n,"api")}function Kge(e,t){e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=e.filterManager)==null?void 0:n.setFilterModel(t)})}function qge(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function Yge(e,t,n){const{gos:s,colModel:o,colFilter:r}=e;n&&!s.get("enableFilterHandlers")&&(Je(288),n=!1);const i=o.getColDefCol(t);return i?(r==null?void 0:r.getModelForColumn(i,n))??null:null}function Zge(e,t,n){var s;return((s=e.filterManager)==null?void 0:s.setColumnFilterModel(t,n))??Promise.resolve()}function Xge(e,t){var s;const n=e.colModel.getCol(t);if(!n){En(12,{colKey:t});return}(s=e.menuSvc)==null||s.showFilterMenu({column:n,containerType:"columnFilter",positionBy:"auto"})}function Jge(e){var t;(t=e.menuSvc)==null||t.hideFilterMenu()}function Qge(e,t){var s;const n=e.colModel.getCol(t);if(!n){En(12,{colKey:t});return}return(s=e.colFilter)==null?void 0:s.getHandler(n,!0)}function eme(e,t){const{colModel:n,colFilter:s,gos:o}=e;if(!o.get("enableFilterHandlers")){Je(287);return}const{colId:r,action:i}=t;if(r){const a=n.getColById(r);a&&(s==null||s.updateModel(a,i))}else s==null||s.updateAllModels(i)}var tme={filterHandler:()=>({doesFilterPass:()=>!0})},nme=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:r}=this.beans;if(o!=null&&o.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const i=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,u)=>{const d=e[u];i.push(this.setModelOnFilterWrapper(c,d)),l.delete(u)}),l.forEach(c=>{const u=s.getColDefCol(c)||s.getCol(c);if(!u){Je(62,{colId:c});return}if(!u.isFilterAllowed()){Je(63,{colId:c});return}const d=this.getOrCreateFilterWrapper(u,!0);if(!d){Je(64,{colId:c});return}i.push(this.setModelOnFilterWrapper(d,e[c],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{i.push(this.setModelOnFilterWrapper(l,null))});jn.all(i).then(()=>{const l=this.getModel(!0),c=[];this.allColumnFilters.forEach((u,d)=>{const h=a?a[d]:null,f=l?l[d]:null;Of(h,f)||c.push(u.column)}),c.length>0?r==null||r.onFilterChanged({columns:c,source:t}):n&&this.updateActive("filterChanged")})}getModel(e){var r;const t={},{allColumnFilters:n,initialModel:s,beans:{colModel:o}}=this;if(n.forEach((i,a)=>{const l=this.getModelFromFilterWrapper(i);dt(l)&&(t[a]=l)}),!e)for(const i of Object.keys(s)){const a=s[i];dt(a)&&!n.has(i)&&((r=o.getCol(i))!=null&&r.isFilterAllowed())&&(t[i]=a)}return t}setState(e,t,n="api"){if(this.state.clear(),t)for(const s of Object.keys(t)){const o=t[s];this.state.set(s,{model:Ts(this.model,s),state:o})}this.setModel(e,n,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let n=!1;return e.forEach((s,o)=>{const r=s.state;r!=null&&(n=!0,t[o]=r)}),n?t:void 0}getModelFromFilterWrapper(e){const n=e.column.getColId();if(e.isHandler)return Ts(this.model,n);const s=e.filter;return s?typeof s.getModel!="function"?(Je(66),null):s.getModel():Ts(this.initialModel,n)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return e.size?(e.forEach(t=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),!0):!1}updateActiveFilters(){const e=c=>c?c.isFilterActive?c.isFilterActive():(Je(67),!1):!1,{colModel:t,gos:n}=this.beans,s=!!OE(n),o=c=>{if(!c.isPrimary())return!0;const d=!t.isPivotActive();return!c.isValueActive()||!d?!1:t.isPivotMode()?!0:s},r=[],i=[],a=(c,u,d)=>{u&&(o(c)?r.push(d):i.push(d))},l=[];return this.allColumnFilters.forEach(c=>{const u=c.column,d=u.getColId();if(c.isHandler)l.push(jn.resolve().then(()=>{a(u,this.isHandlerActive(u),{colId:d,isHandler:!0,handler:c.handler,handlerParams:c.handlerParams})}));else{const h=ul(c);h&&l.push(h.then(f=>{a(u,e(f),{colId:d,isHandler:!1,comp:f})}))}}),jn.all(l).then(()=>{this.activeAggregateFilters=r,this.activeColumnFilters=i})}updateFilterFlagInColumns(e,t){var s;const n=[];return this.allColumnFilters.forEach(o=>{const r=o.column;if(o.isHandler)n.push(jn.resolve().then(()=>{this.setColFilterActive(r,this.isHandlerActive(r),e,t)}));else{const i=ul(o);i&&n.push(i.then(a=>{this.setColFilterActive(r,a.isFilterActive(),e,t)}))}}),(s=this.beans.groupFilter)==null||s.updateFilterFlags(e,t),jn.all(n)}doFiltersPass(e,t,n){const{data:s,aggData:o}=e,r=n?this.activeAggregateFilters:this.activeColumnFilters,i=n?o:s,a=this.model;for(let l=0;l<r.length;l++){const c=r[l],{colId:u,isHandler:d}=c;if(u!==t)if(d){const{handler:h,handlerParams:f}=c;if(!h.doesFilterPass({node:e,data:i,model:Ts(a,u),handlerParams:f}))return!1}else{const h=c.comp;if(typeof h.doesFilterPass!="function"){En(91);continue}if(!h.doesFilterPass({node:e,data:i}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t!=null&&t.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:n}=this.beans,s=()=>{this.isAlive()&&(n==null||n.onFilterChanged(e))};t.isRefreshInProgress()?setTimeout(s,0):s()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:n}=e,s=t==null?void 0:t.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",n).then(()=>{this.allColumnFilters.forEach(o=>{var a,l,c;const{column:r,isHandler:i}=o;s!==r.getColId()&&(i&&((l=(a=o.handler).onAnyFilterChanged)==null||l.call(a)),(c=ul(o,i))==null||c.then(u=>{typeof(u==null?void 0:u.onAnyFilterChanged)=="function"&&u.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(n=>{var r,i;const s=n.isHandler;s&&((i=(r=n.handler).onNewRowsLoaded)==null||i.call(r));const o=ul(n,s);o&&t.push(o.then(a=>{var l;(l=a.onNewRowsLoaded)==null||l.call(a)}))}),jn.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:n,colModel:s}=this.beans;return(o,r)=>{const i=r?s.getCol(r):e;return i?n.getValue(i,o,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t!=null&&t.isHandler)return this.isHandlerActive(e);const n=t==null?void 0:t.filter;return n?n.isFilterActive():Ts(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=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?ul(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const n=ul(t);return n?n.then(s=>({comp:s,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const n=this.getOrCreateFilterWrapper(e,t);return n!=null&&n.isHandler?n.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let n=this.cachedFilter(e);return!n&&t&&(n=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,n)),n}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>{var n;return(n=this.beans.dataTypeSvc)==null?void 0:n.getBaseDataType(e)},t)}getDefaultFilterFromDataType(e,t=!1){return tre(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":Uae(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,n,s,o,r){const i=()=>{const c=this.createFilterCompParams(e,o,r),u=s(c,o);return oie(this.beans.userCompFactory,t,u,n)},a=i();return a?{compDetails:a,createFilterUi:c=>(c?i():a).newAgStackInstance()}:null}createFilterInstance(e,t,n,s){var d,h;const o=this.beans.selectableFilter;o!=null&&o.isSelectable(t)&&(t=o.getFilterDef(e,t));const{handler:r,handlerParams:i,handlerGenerator:a}=this.createHandler(e,t,n)??{},l=this.createFilterComp(e,t,n,s,!!r,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:r,handlerGenerator:a,handlerParams:i};const{compDetails:c,createFilterUi:u}=l;return this.isGlobalButtons&&((h=(d=c.params)==null?void 0:d.buttons)!=null&&h.length||Je(281,{colId:e.getColId()})),{compDetails:c,handler:r,handlerGenerator:a,handlerParams:i,createFilterUi:u}}createBaseFilterParams(e,t){const{filterManager:n,rowModel:s}=this.beans;return 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),r=this.createBaseFilterParams(e,s);if(r.filterChangedCallback=o,r.filterModifiedCallback=s?()=>{}:i=>this.filterModified(e,i),t){const i=r,a=e.getColId(),l=Ts(this.model,a);i.model=l,i.state=this.state.get(a)??{model:l},i.onModelChange=(c,u)=>{this.updateStoredModel(a,c),this.refreshHandlerAndUi(e,c,"ui",!1,u).then(()=>{o({...u,source:"columnFilter"})})},i.onStateChange=c=>{this.updateState(e,c),this.updateOrRefreshFilterUi(e)},i.onAction=(c,u,d)=>{this.updateModel(e,c,u),this.dispatchLocalEvent({type:"filterAction",column:e,action:c,event:d})},i.getHandler=()=>this.getHandler(e,!0),i.onUiChange=c=>this.filterUiChanged(e,c),i.source=n}return r}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,n){const s=t(),o={created:!0,create:t,filterParams:e.params,compDetails:e,promise:s};return s.then(n),o}createFilterWrapper(e){var a;const{compDetails:t,handler:n,handlerGenerator:s,handlerParams:o,createFilterUi:r}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),l=>l),i=e.getColId();if(n)return delete this.initialModel[i],(a=n.init)==null||a.call(n,{...o,source:"init",model:Ts(this.model,i)}),{column:e,isHandler:!0,handler:n,handlerGenerator:s,handlerParams:o,filterUi:this.createFilterUiForHandler(t,r)};if(r){const l={column:e,filterUi:null,isHandler:!1};return l.filterUi=this.createFilterUiLegacy(t,r,c=>{l.filter=c??void 0}),l}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,n){var f;const{gos:s,frameworkOverrides:o,registry:r}=this.beans;let i;const a=p=>{const g=p.filter;if(EL(g)){const v=g.handler;return v||(i=g.doesFilterPass,i?()=>({doesFilterPass:i}):void 0)}return typeof g=="string"?g:void 0},l=s.get("enableFilterHandlers"),c=l?a(t):void 0,u=p=>()=>this.createBean(r.createDynamicBean(p,!0));let d,h;if(typeof c=="string"){const p=(f=s.get("filterHandlers"))==null?void 0:f[c];p!=null?d=p:Pae.has(c)&&(d=u(c),h=c)}else d=c;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=u(h))}return d?{filterHandler:d,handlerNameOrCallback:i??h}:l?(os(s)&&Je(277,{colId:e.getColId()}),tme):void 0}createHandler(e,t,n){const s=this.createHandlerFunc(e,t,n);if(!s)return;const o=$E(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:r,filterHandler:i}=s,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,i,o);return{handler:a,handlerParams:l,handlerGenerator:r??i}}createHandlerFromFunc(e,t,n){const s=e.getColDef(),o=t(Ft(this.gos,{column:e,colDef:s})),r=this.createHandlerParams(e,n);return{handler:o,handlerParams:r}}createHandlerParams(e,t){const n=e.getColDef(),s=e.getColId(),o=this.filterChangedCallbackFactory(e);return Ft(this.gos,{colDef:n,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:r=>{var i;return((i=this.beans.filterManager)==null?void 0:i.doesRowPassOtherFilters(s,r))??!0},onModelChange:(r,i)=>{this.updateStoredModel(s,r),this.refreshHandlerAndUi(e,r,"handler",!1,i).then(()=>{o({...i,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:n,groupFilter:s}=this.beans;this.allColumnFilters.forEach((r,i)=>{let a;r.column.isPrimary()?a=t.getColDefCol(i):a=t.getCol(i),!(a&&a===r.column)&&(e.push(r.column),this.disposeFilterWrapper(r,"columnChanged"),this.disposeColumnListener(i))});const o=s&&e.every(r=>s.isGroupFilter(r));e.length>0&&!o&&(n==null||n.onFilterChanged({columns:e,source:"api"}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:n,frameworkOverrides:s,selectableFilter:o}=this.beans,r=h=>{const f=this.getOrCreateFilterUi(e);f!=null&&f.then(p=>{h(ep(p))})},i=e.getColDef(),a=o!=null&&o.isSelectable(i)?o.getFilterDef(e,i):i,l=qae(s,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",c=this.gos.get("enableFilterHandlers"),u=$E(n,a,this.createFilterCompParams(e,c,"init",!0)),d=Ft(this.gos,{column:e,filterParams:u,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:r,showParentFilter:t});if(c){const h=d,f=e.getColId(),p=this.filterChangedCallbackFactory(e);h.onUiChange=g=>this.floatingFilterUiChanged(e,g),h.model=Ts(this.model,f),h.onModelChange=(g,v)=>{this.updateStoredModel(f,g),this.refreshHandlerAndUi(e,g,"floating",!0,v).then(()=>{p({...v,source:"columnFilter"})})},h.getHandler=()=>this.getHandler(e,!0),h.source="init"}return cie(n,i,d,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,n,s){const o="paramsUpdated";if(e.isHandler){const r=t.getColId();delete this.initialModel[r],this.state.delete(r);const i=e.filterUi,a=this.createFilterUiForHandler(n,s);e.filterUi=a;const l=this.eventSvc;i!=null&&i.created?i.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:o,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:o,column:t})}else this.destroyFilter(t,o)}destroyFilter(e,t="api"){const n=e.getColId(),s=this.allColumnFilters.get(n);this.disposeColumnListener(n),delete this.initialModel[n],s&&this.disposeFilterWrapper(s,t).then(o=>{var r;o&&this.isAlive()&&((r=this.beans.filterManager)==null||r.onFilterChanged({columns:[e],source:"api"}))})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let n=!1;const{column:s,isHandler:o,filterUi:r}=e,i=s.getColId();o&&(n=this.isHandlerActive(s),this.destroyBean(e.handler),delete this.model[i],this.state.delete(i));const a=()=>{this.setColFilterActive(s,!1,"filterDestroyed"),this.allColumnFilters.delete(i),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:s})};if(r){if(r.created)return r.promise.then(l=>(n=o?n:!!(l!=null&&l.isFilterActive()),this.destroyBean(l),a(),n));a()}return jn.resolve(n)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:(t==null?void 0:t.source)??"columnFilter"})}}filterParamsChanged(e,t="api"){var v,C,S,b,w,D;const n=this.allColumnFilters.get(e);if(!n)return;const s=this.beans,o=n.column,r=o.getColDef(),i=o.isFilterAllowed(),a=this.getDefaultFilter(o),l=s.selectableFilter,c=l!=null&&l.isSelectable(r)?l.getFilterDef(o,r):r,u=i?this.createHandlerFunc(o,c,this.getDefaultFilter(o)):void 0,d=!!u,h=n.isHandler;if(h!=d){this.destroyFilter(o,"paramsUpdated");return}const{compDetails:f,createFilterUi:p}=(i?this.createFilterComp(o,c,a,R=>R,d,"colDef"):null)??{compDetails:null,createFilterUi:null},g=(f==null?void 0:f.params)??$E(s.userCompFactory,c,this.createFilterCompParams(o,d,"colDef"));if(h){const R=(u==null?void 0:u.handlerNameOrCallback)??(u==null?void 0:u.filterHandler),T=Ts(this.model,e);if(n.handlerGenerator!=R){const I=n.handler,{handler:x,handlerParams:F}=this.createHandlerFromFunc(o,u.filterHandler,g);n.handler=x,n.handlerParams=F,n.handlerGenerator=R,delete this.model[e],(v=x.init)==null||v.call(x,{...F,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,(D=ul(n,h))==null||D.then(R=>{(R!=null&&R.refresh?R.refresh(g):!0)===!1?this.destroyFilterUi(n,o,f,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:o,params:g})})}refreshHandlerAndUi(e,t,n,s,o){const r=this.cachedFilter(e);if(!r)return s&&this.getOrCreateFilterWrapper(e,!0),jn.resolve();if(!r.isHandler)return jn.resolve();const{filterUi:i,handler:a,handlerParams:l}=r;return Aae(()=>{if(i){const{created:c,filterParams:u}=i;if(c)return i.promise.then(d=>d?{filter:d,filterParams:u}:void 0);i.refreshed=!0}return jn.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},n,o)}setColumnFilterWrapper(e,t){const n=e.getColId();this.allColumnFilters.set(n,t),this.allColumnListeners.set(n,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(n)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:n}=e,{componentClass:s}=t;return!(n===s||(n==null?void 0:n.render)&&(s==null?void 0:s.render)&&n.render===s.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const n=this.getOrCreateFilterUi(t);return n?new Promise(s=>{n.then(o=>{s(ep(o))})}):Promise.resolve(null)}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:e,source:t})=>this.setModel(e,t)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:e,model:t,resolve:n})=>{this.setModelForColumn(e,t).then(()=>n())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:s,model:o}=this,r=e.getColId(),i=s.get(r);return i?i.model??null:Ts(o,r)}const n=this.cachedFilter(e);return n?this.getModelFromFilterWrapper(n):null}setModelForColumn(e,t){var n;if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){let s=()=>{};const o=new Promise(r=>{s=r});return this.columnModelUpdates.push({key:e,model:t,resolve:s}),o}return new Promise(s=>{this.setModelForColumnLegacy(e,t).then(o=>s(o))})}getStateForColumn(e){return this.state.get(e)??{model:Ts(this.model,e)}}setModelForColumnLegacy(e,t){const n=this.beans.colModel.getColDefCol(e),s=n?this.getOrCreateFilterWrapper(n,!0):null;return s?this.setModelOnFilterWrapper(s,t):jn.resolve()}setColDefPropsForDataType(e,t,n){var u;const s=e.filter,o=s===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):s;if(typeof o!="string")return;let r,i;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;o==="agMultiColumnFilter"?{filterParams:r,filterValueGetter:i}=((u=a.multiFilter)==null?void 0:u.getParamsForDataType(l,c,t,n))??{}:{filterParams:r,filterValueGetter:i}=$ae(o,l,c,t,n,a,this.getLocaleTextFunc()),e.filterParams=r,i&&(e.filterValueGetter=i)}setColFilterActive(e,t,n,s){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",n)),e.dispatchColEvent("filterChanged",n,s)}setModelOnFilterWrapper(e,t,n){return new jn(s=>{if(e.isHandler){const r=e.column,i=r.getColId(),a=this.model[i];if(this.updateStoredModel(i,t),n&&t===a){s();return}this.refreshHandlerAndUi(r,t,"api").then(()=>s());return}const o=ul(e);if(o){o.then(r=>{if(typeof(r==null?void 0:r.setModel)!="function"){Je(65),s();return}(r.setModel(t)||jn.resolve()).then(()=>s())});return}s()})}updateStoredModel(e,t){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 i;const s=e.getColId(),o=this.cachedFilter(e),r=()=>o==null?void 0:o.filterUi;iV(t,r,()=>Ts(this.model,s),()=>this.state.get(s),a=>this.updateState(e,a),a=>{var l,c;return(c=(l=r())==null?void 0:l.filterParams)==null?void 0:c.onModelChange(a,n)},o!=null&&o.isHandler?(i=o.handler.processModelToApply)==null?void 0:i.bind(o.handler):void 0)}updateAllModels(e,t){const n=[];this.allColumnFilters.forEach((s,o)=>{var i;const r=this.beans.colModel.getColDefCol(o);r&&iV(e,()=>s.filterUi,()=>Ts(this.model,o),()=>this.state.get(o),a=>this.updateState(r,a),a=>{this.updateStoredModel(o,a),this.dispatchLocalEvent({type:"filterAction",column:r,action:e}),n.push(this.refreshHandlerAndUi(r,a,"ui"))},s!=null&&s.isHandler?(i=s.handler.processModelToApply)==null?void 0:i.bind(s.handler):void 0)}),n.length&&jn.all(n).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();rV(()=>{var n;return(n=this.cachedFilter(e))==null?void 0:n.filterUi},()=>Ts(this.model,t),()=>this.state.get(t))}updateState(e,t){this.state.set(e.getColId(),t),this.dispatchLocalEvent({type:"filterStateChanged",column:e,state:t})}canApplyAll(){const{state:e,model:t,activeFilterComps:n}=this;for(const o of n)if(o.source==="COLUMN_MENU")return!1;let s=!1;for(const o of e.keys()){const r=e.get(o);if(r.valid===!1)return!1;(r.model??null)!==Ts(t,o)&&(s=!0)}return s}hasUnappliedModel(e){var s;const{model:t,state:n}=this;return(((s=n.get(e))==null?void 0:s.model)??null)!==Ts(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;const n=this.beans.filterPanelSvc;return n!=null&&n.isActive?!!n.getState(e.getColId()):!1}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function sme(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function ome(e,t="api"){var n;(n=e.filterManager)==null||n.onFilterChanged({source:t})}var rme=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(){OE(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:n,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):jn.resolve()).then(()=>{var r;const o={source:t,type:"filterChanged",columns:s};n&&so(o,n),this.eventSvc.dispatchEvent(o),(r=this.colFilter)==null||r.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.colFilter)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilter)!=null&&e.isFilterPresent())}updateAggFiltering(){this.aggFiltering=!!OE(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,colIdToSkip:e})}doesRowPassAggregateFilters(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.externalFilterPresent&&!this.doesExternalFilterPass(t)||this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip)||this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(t))}isFilterAllowed(e){var t;return this.isAdvFilterEnabled()?!1:!!((t=this.colFilter)!=null&&t.isFilterAllowed(e))}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){var n;if(this.isAdvFilterEnabled()){if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){this.advFilterModelUpdateQueue.push(e);return}this.advancedFilter.setModel(e??null),this.onFilterChanged({source:t})}}toggleAdvFilterBuilder(e,t){this.isAdvFilterEnabled()&&this.advancedFilter.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvFilterColumns(){this.isAdvFilterEnabled()&&this.advancedFilter.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){var e;return this.isAdvFilterEnabled()?!1:!!((e=this.colFilter)!=null&&e.hasFloatingFilters())}getColumnFilterInstance(e){var t;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):((t=this.colFilter)==null?void 0:t.getFilterInstance(e))??Promise.resolve(void 0)}warnAdvFilters(){Je(68)}setupAdvFilterHeaderComp(e){var t;(t=this.advancedFilter)==null||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(const e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){var n;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):((n=this.colFilter)==null?void 0:n.setModelForColumn(e,t))??Promise.resolve()}},ime=class extends We{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){var e;(e=this.hidePopup)==null||e.call(this)}showMenuAfterMouseEvent(e,t,n,s){e&&!e.isColumn||this.showPopup(e,o=>{var r;(r=this.popupSvc)==null||r.positionPopupUnderMouseEvent({column:e,type:n,mouseEvent:t,ePopup:o})},n,t.target,$o(this.gos),s)}showMenuAfterButtonClick(e,t,n,s){if(e&&!e.isColumn)return;let o=-1,r="left";const i=$o(this.gos);!i&&this.gos.get("enableRtl")&&(o=1,r="right");const a=i?void 0:4*o,l=i?void 0:4;this.showPopup(e,c=>{var u;(u=this.popupSvc)==null||u.positionPopupByComponent({type:n,eventSource:t,ePopup:c,nudgeX:a,nudgeY:l,alignSide:r,keepWithinBounds:!0,position:"under",column:e})},n,t,i,s)}showPopup(e,t,n,s,o,r){var g;const i=e?this.createBean(new Vae(e,"COLUMN_MENU")):void 0;if(this.activeMenu=i,!(i!=null&&i.hasFilter())||!e){En(57);return}const a=is({tag:"div",cls:`ag-menu${o?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:v=>this.trapFocusWithin(v,a)}),a.appendChild(i==null?void 0:i.getGui());let l;const c=()=>i==null?void 0:i.afterGuiDetached(),u=nre(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&&vi(s)){const S=ML(s);S==null||S.focus({preventScroll:!0})}c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,n,e),r==null||r()},h=this.getLocaleTextFunc(),f=o&&n!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),p=(g=this.popupSvc)==null?void 0:g.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:d,positionCallback:()=>t(a),anchorToElement:u,ariaLabel:f});p&&(this.hidePopup=l=p.hideFunc),i.afterInit().then(()=>{t(a),i.afterGuiAttached({container:n,hidePopup:l})}),FV(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,n,e)}trapFocusWithin(e,t){e.key!==Oe.TAB||e.defaultPrevented||Sc(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),bc(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,n){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:n??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},ame=class extends We{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,n){if(!t)return;const s=e.getColDef(),{selectableFilter:o,valueSvc:r}=this.beans,i=n??(o==null?void 0:o.getFilterValueGetter(e.getColId()))??s.filterValueGetter;return i?this.executeFilterValueGetter(i,t.data,e,t,s):r.getValue(e,t)}executeFilterValueGetter(e,t,n,s,o){const{expressionSvc:r,valueSvc:i}=this.beans,a=Ft(this.gos,{data:t,node:s,column:n,colDef:o,getValue:i.getValueCallback.bind(i,s)});return typeof e=="function"?e(a):r==null?void 0:r.evaluate(e,a)}},lme={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},cme=class extends Cn{constructor(){super(lme,[Zv]),this.eFloatingFilterText=ut}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)}},a_=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const n=e.filterOptions??t;this.filterOptions!==n&&(this.filterOptions=n,this.customFilterOptions={},this.mapCustomOptions()),this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){const{filterOptions:e}=this;if(e)for(const t of e){if(typeof t=="string")continue;const n=[["displayKey"],["displayName"],["predicate","test"]],s=o=>o.some(r=>t[r]!=null)?!0:(Je(72,{keys:o}),!1);if(!n.every(s)){this.filterOptions=e.filter(o=>o===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const n=t[0];if(typeof n=="string")return n;if(n.displayKey)return n.displayKey;Je(73)}else Je(74)}getCustomOption(e){return this.customFilterOptions[e]}};function fp(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 ume(e){return e==="AND"||e==="OR"?e:"AND"}function dme(e,t,n){if(e==null)return;const{predicate:s}=e;if(s!=null&&!t.some(o=>o==null))return s(t,n)}function hme(e,t){let n=e.length;return n>t&&(e.splice(t),Je(78),n=t),n}function pp(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 l_=class extends Kae{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 a_;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=ume(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions();const t=this.getGui();this.isReadOnly()?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex")}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,n)=>{const s=n===0?e:this.optionsFactory.defaultOption;t.setValue(s,!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){const n=!e.operator,s=!t.operator;if(!n&&s||n&&!s)return!1;let r;if(n){const i=e,a=t;r=this.areSimpleModelsEqual(i,a)}else{const i=e,a=t;r=i.operator===a.operator&&il(i.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return r}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),jn.resolve();if(e.operator){const s=e;let o=s.conditions;o==null&&(o=[],Je(77));const r=hme(o,this.maxNumConditions),i=this.getNumConditions();if(r<i)this.removeConditionsAndOperators(r);else if(r>i)for(let l=i;l<r;l++)this.createJoinOperatorPanel(),this.createOption();const a=s.operator==="OR";this.eJoinAnds.forEach(l=>l.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),o.forEach((l,c)=>{this.eTypes[c].setValue(l.type,!0),this.setConditionIntoUi(l,c)})}else{const s=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(s.type,!0),this.setConditionIntoUi(s,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),jn.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(Je(79),t=1),this.maxNumConditions=t;let n=e.numAlwaysVisibleConditions??1;n<1&&(Je(80),n=1),n>t&&(Je(81),n=t),this.numAlwaysVisibleConditions=n}createOption(){const e=this.getGui(),t=this.createManagedBean(new r0);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=is({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 _ie);e.push(s);const o="ag-filter-condition-operator";return s.addCss(o),s.addCss(`${o}-${n}`),t.appendChild(s.getGui()),s}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map(e=>typeof e=="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const n of t)e.addOption(n);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,n=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:n?this.getLocaleTextFunc()(n.displayKey,n.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let n=0;n<this.getNumConditions();n++)this.isConditionUiComplete(n)?e=n:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const n=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<n){this.removeConditionsAndOperators(n+1);const s=e+1,o=n-s;o>0&&this.removeConditionsAndOperators(s,o),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((s,o)=>{const r=this.isConditionDisabled(o,e);s.setDisabled(r||this.filterListOptions.length<=1),o===1&&(Vf(this.eJoinPanels[0],r),this.eJoinAnds[0].setDisabled(r),this.eJoinOrs[0].setDisabled(r))}),this.eConditionBodies.forEach((s,o)=>{Bn(s,this.isConditionBodyVisible(o))});const n=(t??this.getJoinOperator())==="OR";for(const s of this.eJoinAnds)s.setValue(!n,!0);for(const s of this.eJoinOrs)s.setValue(n,!0);this.forEachInput((s,o,r,i)=>{this.setElementDisplayed(s,o<i),this.setElementDisabled(s,this.isConditionDisabled(r,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:n,eConditionBodies:s,eJoinPanels:o,eJoinAnds:r,eJoinOrs:i}=this;this.removeComponents(n,e,t),this.removeElements(s,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(o,a,t),this.removeComponents(r,a,t),this.removeComponents(i,a,t)}removeElements(e,t,n){const s=fp(e,t,n);for(const o of s)Br(o)}removeComponents(e,t,n){const s=fp(e,t,n);for(const o of s)Br(o.getGui()),this.destroyBean(o)}afterGuiAttached(e){var t;if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus)){let n;if(!this.isReadOnly()){const s=this.getInputs(0)[0];s instanceof Ec&&this.isConditionBodyVisible(0)?n=s.getInputElement():n=(t=this.eTypes[0])==null?void 0:t.getFocusableElement()}(n??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){var i;super.afterGuiDetached();const e=this.params;if((i=this.beans.colFilter)!=null&&i.shouldKeepStateOnDetach(e.column))return;e.onStateChange({model:e.model});let t=-1,n=-1,s=!1;const o=this.getJoinOperator();for(let a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))t===-1&&(t=a,n=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),c=a<t;(l||c)&&(this.removeConditionsAndOperators(a,1),s=!0,c&&n--)}let r=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),r=!0),this.shouldAddNewConditionAtEnd(n===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),r=!0),r&&this.updateConditionStatusesAndValues(n,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=n}getModelAsString(e){var t,n;return((n=(t=this.params.getHandler())==null?void 0:t.getModelAsString)==null?void 0:n.call(t,e))??""}getPlaceholderText(e,t){let n=this.translate(e);if(typeof this.filterPlaceholder=="function"){const s=this.eTypes[t].getValue(),o=this.translate(s);n=this.filterPlaceholder({filterOptionKey:s,filterOption:o,placeholder:n})}else typeof this.filterPlaceholder=="string"&&(n=this.filterPlaceholder);return n}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,n,s,o)=>{if(!(t instanceof Ec))return;const r=n===0&&o>1?"inRangeStart":n===0?"filterOoo":"inRangeEnd",i=n===0&&o>1?e("ariaFilterFromValue","Filter from value"):n===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(r,s)),t.setInputAriaLabel(i)})}setElementValue(e,t,n){e instanceof Ec&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){bL(e)&&Bn(e.getGui(),t)}setElementDisabled(e,t){bL(e)&&Vf(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Ec&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,n)=>{this.forEachPositionTypeInput(n,t,e)})}forEachPositionInput(e,t){const n=this.getConditionType(e);this.forEachPositionTypeInput(e,n,t)}forEachPositionTypeInput(e,t,n){const s=pp(t,this.optionsFactory),o=this.getInputs(e);for(let r=0;r<o.length;r++){const i=o[r];i!=null&&n(i,r,e,s)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return pp(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(n=>n==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinAnds.forEach((t,n)=>this.resetJoinOperatorAnd(t,n,this.joinOperatorId+n)),this.eJoinOrs.forEach((t,n)=>this.resetJoinOperatorOr(t,n,this.joinOperatorId+n)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.updateUiVisibility(),e||this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){const n=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(n).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),n)}resetJoinOperatorOr(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),n)}resetJoinOperator(e,t,n,s,o){this.updateJoinOperatorDisabled(e.setValue(n,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(s),t)}updateJoinOperatorsDisabled(){const e=(t,n)=>this.updateJoinOperatorDisabled(t,n);this.eJoinAnds.forEach(e),this.eJoinOrs.forEach(e)}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const n=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((s,o,r)=>{r===t&&this.setElementValue(s,n[o]!=null?n[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,n,s)=>{this.setElementValue(t,n===0&&s===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,n=>{this.attachElementOnChange(n,this.listener)}))}hasInvalidInputs(){return!1}isReadOnly(){return!!this.params.readOnly}},K2=class{constructor(e,t,n,s,o,r){this.alive=!0,this.context=e,this.eParent=o;const i=rie(t,n,s);i&&i.newAgStackInstance().then(a=>{var u,d;if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;o.appendChild(a.getGui()),(u=a==null?void 0:a.afterGuiAttached)==null||u.call(a);const{tempValue:l,disabled:c}=this;l&&a.setDate(l),c!=null&&((d=a.setDisabled)==null||d.call(a,c)),r==null||r(this)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){const t=this.dateComp;t?t.setDate(e):this.tempValue=e}setDisabled(e){var n;const t=this.dateComp;t?(n=t.setDisabled)==null||n.call(t,e):this.disabled=e}setDisplayed(e){Bn(this.eParent,e)}setInputPlaceholder(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputPlaceholder)==null||n.call(t,e)}setInputAriaLabel(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputAriaLabel)==null||n.call(t,e)}afterGuiAttached(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.afterGuiAttached)==null||n.call(t,e)}updateParams(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.refresh)==null||n.call(t,e)}},c_=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function q2(e,t){const{dateFrom:n,dateTo:s,type:o}=e||{};return[n&&vo(n,void 0,!0)||null,s&&vo(s,void 0,!0)||null].slice(0,pp(o,t))}var Y2=1e3,Z2=1/0,fme=class extends l_{constructor(){super("dateFilter",q2,c_),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,c)=>{const u=e[l];if(u!=null)if(isNaN(u))Je(82,{param:l});else return u==null?c:Number(u);return c},n=t("minValidYear",Y2),s=t("maxValidYear",Z2);this.minValidYear=n,this.maxValidYear=s,n>s&&Je(83);const{minValidDate:o,maxValidDate:r}=e,i=o instanceof Date?o:vo(o);this.minValidDate=i;const a=r instanceof Date?r:vo(r);this.maxValidDate=a,i&&a&&i>a&&Je(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:n,gos:s},params:o}=this,r=new K2(n,t,o.colDef,Ft(s,{onDateChanged:()=>this.onUiChanged(),filterParams:o,location:"filter"}),e);return this.addDestroyFunc(()=>r.destroy()),r}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=is({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=is({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),fp(this.eConditionPanelsFrom,e,t),fp(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,n){const s=fp(e,t,n);for(const o of s)o.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:n,minValidYear:s,maxValidYear:o}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<s)return!1;if(n){if(e>n)return!1}else if(e.getUTCFullYear()>o)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((n,s,o,r)=>{o!==e||!t||s>=r||(t=t&&this.isValidDateValue(n.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),n={},s=this.getValues(e),o=this.params.useIsoSeparator?"T":" ";return s.length>0&&(n.dateFrom=Ho(s[0],!0,o)),s.length>1&&(n.dateTo=Ho(s[1],!0,o)),{dateFrom:null,dateTo:null,filterType:this.filterType,type:t,...n}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),n=e("ariaFilterValue","Filter Value");this.forEachInput(s=>{s.setInputPlaceholder(t),s.setInputAriaLabel(n)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,r)=>{s<r&&t.push(n.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},X2=class extends We{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,n=new a_;this.optionsFactory=n,n.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(n,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,n=this.optionsFactory;n.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:n,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(t==null)return!0;const{operator:n}=t,s=[];if(n){const i=t;s.push(...i.conditions??[])}else s.push(t);const o=n&&n==="OR"?"some":"every",r=this.params.getValue(e.node);return s[o](i=>this.individualConditionPasses(e,i,r))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:n,maxNumConditions:s}}=e;if(t==null)return;let r=hV(t)?t.conditions:[t];const i=(n==null?void 0:n.map(u=>typeof u=="string"?u:u.displayKey))??this.defaultOptions;if(!(!r||r.every(u=>i.find(d=>d===u.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const c=this.filterType;if((r&&!r.every(u=>u.filterType===c)||t.filterType!==c)&&(r=r.map(u=>({...u,filterType:c})),l=!0),typeof s=="number"&&r&&r.length>s&&(r=r.slice(0,s),l=!0),l){const u=r.length>1?{...t,filterType:c,conditions:r}:{...r[0],filterType:c};this.params={...e,model:u},e.onModelChange(u)}}individualConditionPasses(e,t,n){const s=this.optionsFactory,o=this.mapValuesFromModel(t,s),r=s.getCustomOption(t.type),i=dme(r,o,n);return i??(n==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(o,n,t,e))}},J2=class extends X2{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:n,includeBlanksInGreaterThan:s,includeBlanksInLessThan:o,includeBlanksInRange:r}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(n)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(s)return!0;break;case"lessThan":case"lessThanOrEqual":if(o)return!0;break;case"inRange":if(r)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,n){const s=n.type;if(!this.isValid(t))return s==="notEqual"||s==="notBlank";const o=this.comparator(),r=e[0]!=null?o(e[0],t):0;switch(s){case"equals":return r===0;case"notEqual":return r!==0;case"greaterThan":return r>0;case"greaterThanOrEqual":return r>=0;case"lessThan":return r<0;case"lessThanOrEqual":return r<=0;case"inRange":{const i=o(e[1],t);return this.params.filterParams.inRangeInclusive?r>=0&&i<=0:r>0&&i<0}case"blank":return _y(t);case"notBlank":return!_y(t);default:return Je(76,{filterModelType:s}),!0}}},Q2={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},pme={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},u_=class extends We{constructor(e,t,n){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=n}getModelAsString(e,t){const n=this.getLocaleTextFunc(),s=t==="filterToolPanel";if(!e)return s?dl(this,"filterSummaryInactive"):null;if(e.operator!=null){const r=e,a=(r.conditions??[]).map(c=>this.getModelAsString(c,t)),l=r.operator==="AND"?"andCondition":"orCondition";return a.join(` ${dl(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return s?dl(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):n(e.type,e.type);{const r=e,i=this.optionsFactory.getCustomOption(r.type),{displayKey:a,displayName:l,numberOfInputs:c}=i||{};return a&&l&&c===0?n(a,l):this.conditionToString(r,s,r.type==="inRange"||c===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:n}=e;this.optionsFactory=t,this.filterParams=n}conditionForToolPanel(e,t,n,s,o,r){let i;const a=this.getTypeKey(e);return a&&(i=dl(this,a)),o&&r&&(i=this.getLocaleTextFunc()(o,r)),i!=null?t?`${i} ${dl(this,"filterSummaryInRangeValues",[n(),s()])}`:`${i} ${n()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.valueFormatter;return t?t(e??null)??"":String(e)}},eB=class extends u_{constructor(e,t){super(e,t,n=>{const{dataTypeSvc:s,valueSvc:o}=this.beans,r=t.column,i=s==null?void 0:s.getDateFormatterFunction(r),a=i?i(n??void 0):n;return o.formatValue(r,null,a)}),this.filterTypeKeys=Q2}conditionToString(e,t,n,s,o){const{type:r}=e,i=vo(e.dateFrom),a=vo(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>QE(h,l),u=()=>i!==null?c(i):"null",d=()=>a!==null?c(a):"null";if(t){const h=this.conditionForToolPanel(r,n,u,d,s,o);if(h!=null)return h}return n?`${u()}-${d()}`:i!=null?c(i):`${r}`}};function gme(e,t){const n=t;return n<e?-1:n>e?1:0}var mme=class extends J2{constructor(){super(q2,c_),this.filterType="date",this.FilterModelFormatterClass=eB}comparator(){return this.params.filterParams.comparator??gme}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},tB=class extends Cn{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}const t=e.operator;let n;t?n=e.conditions[0]:n=e,this.lastType=n.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const n=e;return this.isTypeEditable(n.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const n=e;this.onModelUpdated(n.model)}}setParams(e){const t=new a_;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")}`}},vme={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"}]},yme=class extends tB{constructor(){super(vme,[Zv]),this.eReadOnlyText=ut,this.eDateWrapper=ut,this.FilterModelFormatterClass=eB,this.filterType="date",this.defaultOptions=c_}setParams(e){super.setParams(e),this.createDateComponent();const t=this.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}updateParams(e){super.updateParams(e),this.dateComp.updateParams(this.getDateComponentParams()),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.readOnly&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){const n=e?vo(e.dateFrom):null;this.dateComp.setDate(n),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){Bn(this.eDateWrapper,e),Bn(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){const e=this.dateComp.getDate();if(this.reactive){const t=this.params;t.onUiChange();const n=t.model,s=Ho(e),o=s==null?null:{...n??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:s};t.onModelChange(o,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t==null||t.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=p0(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())}},wme={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},Cme=class extends Cn{constructor(){super(wme,[Zv]),this.eDateInput=ut,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled()){if(this.isApply){this.applyOnFocusOut=!e,e&&this.params.onDateChanged();return}e||this.params.onDateChanged()}}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}setParams(e){var h;const t=this.eDateInput.getInputElement(),n=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=n&&al();const{minValidYear:s,maxValidYear:o,minValidDate:r,maxValidDate:i,buttons:a,includeTime:l,colDef:c}=e.filterParams||{},u=this.beans.dataTypeSvc,d=l??((h=u==null?void 0:u.getDateIncludesTimeFlag)==null?void 0:h.call(u,c.cellDataType))??!1;if(n?d?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",r&&s&&Je(85),i&&o&&Je(86),r&&i){const[f,p]=[r,i].map(g=>g instanceof Date?g:vo(g));f&&p&&f.getTime()>p.getTime()&&Je(87)}r?r instanceof Date?t.min=QE(r):t.min=r:s&&(t.min=`${s}-01-01`),i?i instanceof Date?t.max=QE(i):t.max=i:o&&(t.max=`${o}-12-31`),this.isApply=e.location==="floatingFilter"&&!!(a!=null&&a.includes("apply"))}refresh(e){this.params=e,this.setParams(e)}getDate(){return vo(this.eDateInput.getValue())}setDate(e){var s;const t=this.params.filterParams.colDef.cellDataType,n=((s=this.beans.dataTypeSvc)==null?void 0:s.getDateIncludesTimeFlag(t))??!1;this.eDateInput.setValue(Ho(e,n))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e!=null&&e.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){var t;return((t=e==null?void 0:e.filterParams)==null?void 0:t.browserDatePicker)??!0}},d_=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function h_(e){const{allowedCharPattern:t}=e??{};return t??null}function f_(e){return e==null||isNaN(e)?null:e}function nB(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[f_(n),f_(s)].slice(0,pp(o,t))}var bme=class extends l_{constructor(){super("numberFilter",nB,d_),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=h_(this.params),t=is({tag:"div",cls:"ag-filter-body",role:"presentation"});return this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,n,s){const o=this.createManagedBean(s?new _c({allowedCharPattern:s}):new o0);o.addCss(`ag-filter-${n}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const n=s=>this.removeComponents(s,e,t);n(this.eValuesFrom),n(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,r)=>{s<r&&t.push(f_(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 u_{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=Q2}conditionToString(e,t,n,s,o){const{filter:r,filterTo:i,type:a}=e,l=this.formatValue.bind(this);if(t){const c=this.conditionForToolPanel(a,n,()=>l(r),()=>l(i),s,o);if(c!=null)return c}return n?`${l(r)}-${l(i)}`:r!=null?l(r):`${a}`}},Sme=class extends J2{constructor(){super(nB,d_),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=ut,this.onValueChanged=()=>{}}setupGui(e){var s;this.eInput=this.createManagedBean(new _c((s=this.params)==null?void 0:s.config));const t=this.eInput.getGui();e.appendChild(t);const n=o=>this.onValueChanged(o);this.addManagedListeners(t,{input:n,keydown:n})}setEditable(e){this.eInput.setDisabled(!e)}getValue(){return this.eInput.getValue()}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setParams({ariaLabel:e,autoComplete:t}){const{eInput:n}=this;n.setInputAriaLabel(e),t!==void 0&&n.setAutoComplete(t)}};function p_(e){const t=e==null?void 0:e.trim();return t===""?e:t}function rB(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[n||null,s||null].slice(0,pp(o,t))}var Eme={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},iB=class extends tB{constructor(){super(...arguments),this.eFloatingFilterInputContainer=ut,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(Eme)}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 r=p0(e.filterParams,s),i=Os(this,this.syncUpWithParentFilter.bind(this),r);n.setValueChangedListener(i)}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,n=t.getValue();ks(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(n,!0)}syncUpWithParentFilter(e){const t=e.key===Oe.ENTER,n=this.reactive;if(n&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:s,params:o,lastType:r}=this;let i=s.getValue();if(o.filterParams.trimInput&&(i=p_(i),s.setValue(i,!0)),n){const a=o,l=a.model,c=this.convertValue(i),u=c==null?null:{...l??{filterType:this.filterType,type:r??this.optionsFactory.defaultOption},filter:c};a.onModelChange(u,{afterFloatingFilter:!0})}else o.parentFilterInstance(a=>{a==null||a.onFloatingFilterChanged(r||null,i||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},_me=class extends We{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new o0),this.eTextInput=this.createManagedBean(new _c),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),n=this.eTextInput.getGui();e.appendChild(t),e.appendChild(n),this.setupListeners(t,s=>this.onValueChanged(s)),this.setupListeners(n,s=>this.onValueChanged(s))}setEditable(e){this.numberInputActive=e,this.eNumberInput.setDisplayed(this.numberInputActive),this.eTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eNumberInput.setAutoComplete(e),this.eTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}setValueChangedListener(e){this.onValueChanged=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},Rme=class extends iB{constructor(){super(...arguments),this.FilterModelFormatterClass=sB,this.filterType="number",this.defaultOptions=d_}updateParams(e){h_(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=h_(e.filterParams),this.allowedCharPattern?this.createManagedBean(new oB({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new _me)}convertValue(e){return e?Number(e):null}},g_=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],Dme=class extends l_{constructor(){super("textFilter",rB,g_),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},s=this.getValues(e);return s.length>0&&(n.filter=s[0]),s.length>1&&(n.filterTo=s[1]),n}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,r)=>{s<r&&t.push(ia(n.getValue()))}),t}createEValue(){const e=is({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:n}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,n,"to"),e}createFromToElement(e,t,n){const s=this.createManagedBean(new _c);s.addCss(`ag-filter-${n}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeEValues(e,t){const n=r=>this.removeComponents(r,e,t),{eValuesFrom:s,eValuesTo:o}=this;n(s),n(o)}},aB=class extends u_{constructor(){super(...arguments),this.filterTypeKeys=pme}conditionToString(e,t,n,s,o){const{filter:r,filterTo:i,type:a}=e;if(t){const l=u=>()=>dl(this,"filterSummaryTextQuote",[u]),c=this.conditionForToolPanel(a,n,l(r),l(i),s,o);if(c!=null)return c}return n?`${r}-${i}`:r!=null?`${r}`:`${a}`}},Tme=({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}},Ime=e=>e,xme=e=>e==null?null:e.toString().toLowerCase(),Fme=class extends X2{constructor(){super(rB,g_),this.filterType="text",this.FilterModelFormatterClass=aB}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??Tme,this.formatter=t.textFormatter??(t.caseSensitive?Ime:xme)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,n,s){const o=e.map(h=>this.formatter(h))||[],r=this.formatter(t),{api:i,colDef:a,column:l,context:c,filterParams:{textFormatter:u}}=this.params;if(n.type==="blank")return _y(t);if(n.type==="notBlank")return!_y(t);const d={api:i,colDef:a,column:l,context:c,node:s.node,data:s.data,filterOption:n.type,value:r,textFormatter:u};return o.some(h=>this.matcher({...d,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=n=>{const s={...n},{filter:o,filterTo:r}=n;return o&&(s.filter=p_(o)??null),r&&(s.filterTo=p_(r)??null),s};return hV(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},Pme=class extends iB{constructor(){super(...arguments),this.FilterModelFormatterClass=aB,this.filterType="text",this.defaultOptions=g_}createFloatingFilterInputService(){return this.createManagedBean(new oB)}};function Ame(e){var t;return!!((t=e.quickFilter)!=null&&t.isFilterPresent())}function kme(e){var t;return(t=e.quickFilter)==null?void 0:t.getText()}function Ome(e){var t;(t=e.quickFilter)==null||t.resetCache()}var Mme=class extends We{constructor(){super(...arguments),this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){const e=this.resetCache.bind(this),t=this.gos;this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{t.get("includeHiddenColumnsInQuickFilter")||this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",n=>this.setFilter(n.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(t.get("quickFilterText")),this.parser=t.get("quickFilterParser"),this.matcher=t.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){var l;const{autoColSvc:e,colModel:t,gos:n,pivotResultCols:s}=this.beans,o=t.isPivotMode(),r=e==null?void 0:e.getColumns(),i=t.getColDefCols();let a=(o&&!n.get("applyQuickFilterBeforePivotOrAgg")?(l=s==null?void 0:s.getPivotResultCols())==null?void 0:l.list:i)??[];r&&(a=a.concat(r)),this.colsToUse=n.get("includeHiddenColumnsInQuickFilter")?a:a.filter(c=>c.isVisible()||c.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(n=>t?this.doesRowPassCache(e,n):this.doesRowPassNoCache(e,n))}resetCache(){this.beans.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseFilter(e){return dt(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){Je(70,{newFilter:e});return}const t=this.parseFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),n=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,n&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(n=>{const s=this.getTextForColumn(n,e);return 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(`
|
|
257
257
|
`)}},Nme={moduleName:"ClientSideRowModelFilter",version:ct,rowModels:["clientSide"],beans:[Lge]},m_={moduleName:"FilterCore",version:ct,beans:[rme],apiFunctions:{isAnyFilterPresent:sme,onFilterChanged:ome},css:[Uge],dependsOn:[Nme]},lB={moduleName:"FilterValue",version:ct,beans:[ame]},Ry={moduleName:"ColumnFilter",version:ct,beans:[nme,ime],dynamicBeans:{headerFilterCellCtrl:Vge},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:Wge,getColumnFilterInstance:zge,destroyFilter:jge,setFilterModel:Kge,getFilterModel:qge,getColumnFilterModel:Yge,setColumnFilterModel:Zge,showColumnFilter:Xge,hideColumnFilter:Jge,getColumnFilterHandler:Qge,doFilterAction:eme},dependsOn:[m_,Ey,lB,Hge]},Lme={moduleName:"CustomFilter",version:ct,userComponents:{agReadOnlyFloatingFilter:cme},dependsOn:[Ry]},Vme={moduleName:"TextFilter",version:ct,dependsOn:[Ry],userComponents:{agTextColumnFilter:{classImp:Dme,params:{useForm:!0}},agTextColumnFloatingFilter:Pme},dynamicBeans:{agTextColumnFilterHandler:Fme}},Bme={moduleName:"NumberFilter",version:ct,dependsOn:[Ry],userComponents:{agNumberColumnFilter:{classImp:bme,params:{useForm:!0}},agNumberColumnFloatingFilter:Rme},dynamicBeans:{agNumberColumnFilterHandler:Sme}},$me={moduleName:"DateFilter",version:ct,dependsOn:[Ry],userComponents:{agDateColumnFilter:{classImp:fme,params:{useForm:!0}},agDateInput:Cme,agDateColumnFloatingFilter:yme},dynamicBeans:{agDateColumnFilterHandler:mme}},Hme={moduleName:"QuickFilterCore",version:ct,rowModels:["clientSide"],beans:[Mme],dependsOn:[m_,lB]},Gme={moduleName:"QuickFilter",version:ct,apiFunctions:{isQuickFilterPresent:Ame,getQuickFilter:kme,resetQuickFilter:Ome},dependsOn:[Hme]},Ume={moduleName:"ExternalFilter",version:ct,dependsOn:[m_]},Wme=".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}}",v_=(e,t,n)=>{var a,l,c;const{editModelSvc:s}=e,o=(l=(a=s==null?void 0:s.getCellValidationModel())==null?void 0:a.getCellValidation(t))==null?void 0:l.errorMessages,r=(c=s==null?void 0:s.getRowValidationModel().getRowValidation(t))==null?void 0:c.errorMessages,i=o||r;return i!=null&&i.length?i.join(n("tooltipValidationErrorSeparator",". ")):void 0},zme=class extends We{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,r=i_(o),{column:i,eGui:a}=t,l=i.getColDef();!s&&r&&!l.headerComponent&&(s=Fv(()=>a.querySelector(".ag-header-cell-text")));const c="header",d=this.beans.colNames.getDisplayNameForColumn(i,"header",!0),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Ft(o,{location:c,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>({column:i,colDef:i.getColDef()})};let p=this.createTooltipFeature(f);return p&&(p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip())),p}setupHeaderGroupTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,r=i_(o),{column:i,eGui:a}=t,l=i.getColGroupDef();!s&&r&&!(l!=null&&l.headerGroupComponent)&&(s=Fv(()=>a.querySelector(".ag-header-group-text")));const c="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(i,"header"),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Ft(o,{location:c,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>{const g={column:i};return l&&(g.colDef=l),g}},p=this.createTooltipFeature(f);return p&&t.createBean(p)}enableCellTooltipFeature(e,t,n){const{beans:s}=this,{gos:o,editSvc:r}=s,{column:i,rowNode:a}=e;let l="cell";const c=()=>{const f=!!!(r!=null&&r.isEditing(e))&&v_(s,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=i.getColDef(),g=a.data;if(p.tooltipField&&dt(g))return cp(g,p.tooltipField,i.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(Ft(o,{location:"cell",colDef:i.getColDef(),column:i,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},u=i_(o);n||(u&&!e.isCellRenderer()?n=()=>{const h=!!(r!=null&&r.isEditing(e));if(!h&&v_(s,e,this.getLocaleTextFunc()))return!0;if(!i.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=()=>!(r!=null&&r.isEditing(e)));const d={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:c,shouldDisplayTooltip:n,getAdditionalParams:()=>({column:i,colDef:i.getColDef(),rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(d,s)}setupFullWidthRowTooltip(e,t,n,s){const o={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>n,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:s},r=this.beans,i=r.context;e&&t.destroyBean(e,i);const a=this.createTooltipFeature(o,r);if(a)return t.createBean(a,i)}setupCellEditorTooltip(e,t){var a,l;const{beans:n}=this,{context:s}=n,o=((a=t.getValidationElement)==null?void 0:a.call(t,!0))||!((l=t.isPopup)!=null&&l.call(t))&&e.eGui;if(!o)return;const r={getGui:()=>o,getTooltipValue:()=>v_(n,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{var p,g;const{editModelSvc:c}=n,u=(p=c==null?void 0:c.getRowValidationModel())==null?void 0:p.getRowValidationMap(),d=(g=c==null?void 0:c.getCellValidationModel())==null?void 0:g.getCellValidationMap(),h=!!u&&u.size>0,f=!!d&&d.size>0;return h||f}},i=this.createTooltipFeature(r,n);if(i)return e.createBean(i,s)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=dt(t.tooltipField)||dt(t.tooltipValueGetter)||dt(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},jme=class extends mae{createTooltipComp(e,t){const n=lie(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}},cB={moduleName:"Tooltip",version:ct,beans:[zme],dynamicBeans:{tooltipFeature:YL,highlightTooltipFeature:vae,tooltipStateManager:jme},userComponents:{agTooltipComponent:Cae},dependsOn:[Ey],css:[Wme]},Td=class{constructor(e){this.cellValueChanges=e}},y_=class extends Td{constructor(e,t,n,s){super(e),this.initialRange=t,this.finalRange=n,this.ranges=s}},Kme=10,uB=class{constructor(e){this.actionStack=[],this.maxStackSize=e||Kme,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}},qme=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&&vue(this.activeRowEdit,t);if(!(n||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:i,column:a,oldValue:l,value:c}=e,u={rowPinned:r,rowIndex:i,columnId:a.getColId(),newValue:c,oldValue:l};this.cellValueChanges.push(u)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const n=e.get("undoRedoCellEditingLimit");if(n<=0)return;this.undoStack=new uB(n),this.redoStack=new uB(n),this.addListeners();const s=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:o=>{o.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:s,newColumnsLoaded:s,columnGroupOpened:s,columnRowGroupChanged:s,columnMoved:s,columnPinned:s,columnVisible:s,rowDragEnd:s}),t.whenReady(this,o=>{this.gridBodyCtrl=o.gridBodyCtrl})}getCurrentUndoStackSize(){var e;return((e=this.undoStack)==null?void 0:e.getCurrentStackSize())??0}getCurrentRedoStackSize(){var e;return((e=this.redoStack)==null?void 0:e.getCurrentStackSize())??0}undo(e){const{eventSvc:t,undoStack:n,redoStack:s}=this;t.dispatchEvent({type:"undoStarted",source:e});const o=this.undoRedo(n,s,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:o})}redo(e){const{eventSvc:t,undoStack:n,redoStack:s}=this;t.dispatchEvent({type:"redoStarted",source:e});const o=this.undoRedo(s,n,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:o})}undoRedo(e,t,n,s,o){if(!e)return!1;const r=e.pop();return r!=null&&r.cellValueChanges?(this.processAction(r,i=>i[s],o),r instanceof y_?this.processRange(r.ranges||[r[n]]):this.processCell(r.cellValueChanges),t.push(r),!0):!1}processAction(e,t,n){for(const s of e.cellValueChanges){const{rowIndex:o,rowPinned:r,columnId:i}=s,a={rowIndex:o,rowPinned:r},l=ma(this.beans,a);l.displayed&&l.setDataValue(i,t(s),n)}}processRange(e){let t;const n=this.beans.rangeSvc;n.removeAllCellRanges(!0),e.forEach((s,o)=>{if(!s)return;const r=s.startRow,i=s.endRow;o===e.length-1&&(t={rowPinned:r.rowPinned,rowIndex:r.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:i.rowIndex,rowEndPinned:i.rowPinned,columnStart:s.startColumn,columns:s.columns};n.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:n,rowPinned:s}=t,o={rowIndex:n,rowPinned:s},r=ma(this.beans,o),i={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(i)}setLastFocusedCell(e){const{rowIndex:t,columnId:n,rowPinned:s}=e,{colModel:o,focusSvc:r,rangeSvc:i}=this.beans,a=o.getCol(n);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:s};r.setFocusedCell({...c,forceBrowserFocus:!0}),i==null||i.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Td(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const n=new Td(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Td(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new y_(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;const{rangeSvc:t,gos:n}=this.beans;t&&la(n)?e=new y_(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new Td(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1},batchEditingStarted:()=>this.startBigChange("batchEditing"),batchEditingStopped:({changes:e})=>this.stopBigChange("batchEditing",e),bulkEditingStarted:()=>this.startBigChange("bulkEditing"),bulkEditingStopped:({changes:e})=>this.stopBigChange("bulkEditing",e)})}startBigChange(e){this.updateBigChange(e,!0)}updateBigChange(e,t){e==="bulkEditing"?this.bulkEditing=t:this.batchEditing=t}stopBigChange(e,t){if(e==="bulkEditing"&&!this.bulkEditing||e==="batchEditing"&&!this.batchEditing||(this.updateBigChange(e,!1),(t==null?void 0:t.length)===0))return;const n=new Td(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},Yme=".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}",Zme={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},Xme=class extends hy{constructor(){super(Zme,[s0]),this.eEditor=ut}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=ut}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:n}=this,{cellStartedEdit:s,eventKey:o,suppressPreventDefault:r}=e;n.getInputElement().setAttribute("title",""),t.init(n,e);let i,a=!0;s?(this.focusAfterAttached=!0,o===Oe.BACKSPACE||o===Oe.DELETE?i="":o&&o.length===1?r?a=!1:i=o:(i=t.getStartValue(),o!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,i=t.getStartValue()),a&&i!=null&&n.setStartValue(i),this.addGuiEventListener("keydown",l=>{const{key:c}=l;(c===Oe.PAGE_UP||c===Oe.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){var s,o;const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;al()||t.getFocusableElement().focus();const n=t.getInputElement();this.highlightAllOnFocus?n.select():(o=(s=this.cellEditorInput).setCaret)==null||o.call(s)}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),n=e.getInputElement();t.focus(),n.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},Jme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},Qme=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Jme}getAgComponents(){return[LL]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:r}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:n}=this,{min:s,max:o,getValidationErrors:r}=n;let i=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(s){const l=s instanceof Date?s:new Date(s);if(t<l){const c=l.toLocaleDateString();i.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(o){const l=o instanceof Date?o:new Date(o);if(t>l){const c=l.toLocaleDateString();i.push(a("maxDateValidation",`Date must be before ${c}`,[c]))}}}return i.length||(i=null),r?r({value:t,cellEditorParams:n,internalErrors:i}):i}getValue(){const{eEditor:e,params:t}=this,n=e.getDate();return!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)}},eve=class extends Dy{constructor(){super(new Qme(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},tve={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},nve=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return tve}getAgComponents(){return[LL]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:r}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,n=e.getInputElement().value,s=this.formatDate(this.parseDate(n??void 0)),{min:o,max:r,getValidationErrors:i}=t;let a=[];if(s){const l=new Date(s),c=this.getLocaleTextFunc();if(o){const u=new Date(o);if(l<u){const d=u.toLocaleDateString();a.push(c("minDateValidation",`Date must be after ${d}`,[d]))}}if(r){const u=new Date(r);if(l>u){const d=u.toLocaleDateString();a.push(c("maxDateValidation",`Date must be before ${d}`,[d]))}}}return a.length||(a=null),i?i({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,n=this.formatDate(t.getDate());return!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):vo(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Ho(e??null,this.includeTime??!1)??void 0}},sve=class extends Dy{constructor(){super(new nve(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},ove={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},rve=class extends hy{constructor(){super(ove,[Die]),this.eEditor=ut}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:n,eventKey:s,maxLength:o,cols:r,rows:i}=e;this.focusAfterAttached=n,t.getInputElement().setAttribute("title",""),t.setMaxLength(o||200).setCols(r||60).setRows(i||10);let a;n?(this.focusAfterAttached=!0,s===Oe.BACKSPACE||s===Oe.DELETE?a="":s&&s.length===1?a=s:(a=this.getStartValue(e),s!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,a=this.getStartValue(e)),a!=null&&t.setValue(a,!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}getStartValue(e){const{value:t}=e;return(t==null?void 0:t.toString())??t}onKeyDown(e){const t=e.key;(t===Oe.LEFT||t===Oe.UP||t===Oe.RIGHT||t===Oe.DOWN||e.shiftKey&&t===Oe.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:n}=this,s=this.getLocaleTextFunc();e.setInputAriaLabel(s("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),n&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:n}=t,s=e.getValue();return!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 r=[];return typeof o=="string"&&t!=null&&o.length>t&&r.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:o,internalErrors:r,cellEditorParams:e}):r}},ive={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},ave=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return ive}getAgComponents(){return[Tie]}init(e,t){this.eEditor=e,this.params=t;const{max:n,min:s,precision:o,step:r}=t;n!=null&&e.setMax(n),s!=null&&e.setMin(s),o!=null&&e.setPrecision(o),r!=null&&e.setStep(r);const i=e.getInputElement();t.preventStepping?e.addManagedElementListeners(i,{keydown:this.preventStepping}):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:n,getValidationErrors:s}=e,r=this.eEditor.getInputElement().valueAsNumber,i=this.getLocaleTextFunc();let a=[];return typeof r=="number"&&(t!=null&&r<t&&a.push(i("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),n!=null&&r>n&&a.push(i("maxValueValidation",`Must be less than or equal to ${n}.`,[String(n)]))),a.length||(a=null),s?s({value:r,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===Oe.UP||e.key===Oe.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!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(){al()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},lve=class extends Dy{constructor(){super(new ave(()=>this.getLocaleTextFunc()))}},cve={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},uve=class extends hy{constructor(){super(cve,[Vie]),this.eEditor=ut,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:n,gos:s}=this,{values:o,value:r,eventKey:i}=e;if(Vn(o)){Je(58);return}this.startedByEnter=i!=null?i===Oe.ENTER:!1;let a=!1;o.forEach(d=>{const h={value:d},f=n.formatValue(e.column,null,d),p=f!=null;h.text=p?f:d,t.addOption(h),a=a||r===d}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:u}=e;l!=null&&t.setPickerGap(l),u!=null&&t.setPickerMaxHeight(u),c!=null&&t.setPickerMaxWidth(c),s.get("editType")!=="fullRow"&&this.addManagedListeners(this.eEditor,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eEditor.showPicker()})}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:n}=e,s=this.getValue();let o=[];if(t&&!t.includes(s)){const r=this.getLocaleTextFunc();o.push(r("invalidSelectionValidation","Invalid selection."))}else o=null;return n?n({value:s,internalErrors:o,cellEditorParams:e}):o}},dve={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},hve=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return dve}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 r=[];return t!=null&&typeof s=="string"&&s.length>t&&r.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:s,cellEditorParams:e,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();return!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(){al()&&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 hve(()=>this.getLocaleTextFunc()))}};function fve(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function pve(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 gve(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function mve(e){var t;(t=e.undoRedo)==null||t.undo("api")}function vve(e){var t;(t=e.undoRedo)==null||t.redo("api")}function yve(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function wve(e){var s;const t=(s=e.editModelSvc)==null?void 0:s.getEditMap(),n=[];return t==null||t.forEach((o,r)=>{const{rowIndex:i,rowPinned:a}=r;o.forEach((l,c)=>{const{editorValue:u,pendingValue:d,sourceValue:h,state:f}=l,p=va(l);let g=u??d;g===pr&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:c,colId:c.getColId(),colKey:c.getColId(),rowIndex:i,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function Cve(e,t=!1){var s;const{editSvc:n}=e;if(n!=null&&n.isBatchEditing()){if(t)for(const o of((s=e.editModelSvc)==null?void 0:s.getEditPositions())??[])o.state==="editing"&&n.revertSingleCellEdit(o);else xc(e,{persist:!0});_d(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function bve(e,t){var s;const n=Wn(e,t);return((s=e.editSvc)==null?void 0:s.isEditing(n))??!1}function Sve(e,t){const{key:n,colKey:s,rowIndex:o,rowPinned:r}=t,{editSvc:i,colModel:a}=e,l=a.getCol(s);if(!l){Je(12,{colKey:s});return}const u=ma(e,{rowIndex:o,rowPinned:r||null});if(!u){Je(290,{rowIndex:o,rowPinned:r});return}if(!l.isCellEditable(u))return;r==null&&fB(e,o),hB(e,s),i==null||i.startEditing({rowNode:u,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function Eve(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function _ve(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function Rve(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var Dve={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},Tve=class extends HE{constructor(e){super(Dve),this.params=e}postConstruct(){yc(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=s=>{S0(this.gos,s,t.node,t.column,!0)||t.onKeyDown(s)};this.addManagedElementListeners(e,{keydown:n})}};function Ive(e,{column:t},n,s,o="ui"){var c;if(n instanceof KeyboardEvent&&(n.key===Oe.TAB||n.key===Oe.ENTER||n.key===Oe.F2||n.key===Oe.BACKSPACE&&s))return!0;if((n==null?void 0:n.shiftKey)&&((c=e.rangeSvc)==null?void 0:c.getCellRanges().length)!=0)return!1;const i=t==null?void 0:t.getColDef(),a=xve(e.gos,i),l=n==null?void 0:n.type;return l==="click"&&(n==null?void 0:n.detail)===1&&a===1||l==="dblclick"&&(n==null?void 0:n.detail)===2&&a===2?!0:o==="api"?s??!1:!1}function xve(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function w_(e,{rowNode:t,column:n},s="ui"){const o=n.getColDef().editable,r=e.editModelSvc;return n.isColumnFunc(t,o)||!!r&&r.hasEdits({rowNode:t,column:n},{withOpenEditor:!0})}function Fve(e,t,n="ui"){const s=w_(e,t,n);return s===!0||n==="ui"?s:e.colModel.getCols().some(r=>w_(e,{rowNode:t.rowNode,column:r},n))}var Ty=(e,t=!1)=>{if(e!==void 0)return va(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 r=e[s];if(r.data&&(Ty(t==null?void 0:t.getEdit({rowNode:r,column:n}))||Ty(t==null?void 0:t.getEdit({rowNode:r.pinnedSibling,column:n})))||gB(r.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 Pve=class extends We{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}setComp(e){this.cellComp=e,this.applyCellStyles()}applyCellStyles(){var o;const{cellCtrl:e,editSvc:t,beans:n}=this;if(t!=null&&t.isBatchEditing()&&t.isEditing()){const r=pB(n,e)||mB(n,e)||vB(n,e);this.applyBatchingStyle(r)}else this.applyBatchingStyle(!1);const s=!!((o=this.editModelSvc)!=null&&o.getCellValidationModel().hasCellValidation(this.cellCtrl));this.cellComp.toggleCss("ag-cell-editing-error",s)}applyBatchingStyle(e){var t;this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&((t=this.editSvc)==null?void 0:t.isBatchEditing()))??!1)}},Ave=class extends We{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){var i;const{rowCtrl:e,editModelSvc:t,beans:n}=this;let s=e.rowNode,o=t==null?void 0:t.getEditRow(s);const r=(i=this.editModelSvc)==null?void 0:i.getRowValidationModel().hasRowValidation({rowNode:s});if(!o&&s.pinnedSibling&&(s=s.pinnedSibling,o=t==null?void 0:t.getEditRow(s)),o){const a=Array.from(o.keys()).some(l=>{const c={rowNode:s,column:l};return pB(n,c,!0)||mB(n,c)||vB(n,c)});this.applyStyle(r,a);return}this.applyStyle(r)}applyStyle(e=!1,t=!1){var o,r;const n=((o=this.editSvc)==null?void 0:o.isBatchEditing())??!1,s=this.gos.get("editType")==="fullRow";(r=this.rowCtrl)==null||r.forEachGui(void 0,({rowComp:i})=>{i.toggleCss("ag-row-editing",s&&t),i.toggleCss("ag-row-batch-edit",s&&t&&n),i.toggleCss("ag-row-inline-editing",t),i.toggleCss("ag-row-not-inline-editing",!t),i.toggleCss("ag-row-editing-invalid",s&&t&&e)})}},kve=({rowModel:e,pinnedRowModel:t,editModelSvc:n},s)=>{const o=new Set;e.forEachNode(r=>s.has(r)&&o.add(r)),t==null||t.forEachPinnedRow("top",r=>s.has(r)&&o.add(r)),t==null||t.forEachPinnedRow("bottom",r=>s.has(r)&&o.add(r));for(const r of s)o.has(r)||n.removeEdits({rowNode:r});return o},Ove=({editModelSvc:e},t,n)=>{var s;for(const o of t)(s=e==null?void 0:e.getEditRow(o))==null||s.forEach((r,i)=>!n.has(i)&&e.removeEdits({rowNode:o,column:i}))},Mve=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),s=new Set(n.keys());Ove(e,kve(e,s),t)},Nve=new Set(["undo","redo","paste","bulk","rangeSvc"]),Lve=new Set(["ui","api"]),yB={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},Vve=new Set(Object.keys(yB)),Bve=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Iy={cancel:!0,source:"api"},$ve={cancel:!1,source:"api"},Id={checkSiblings:!0},gp={force:!0,suppressFlash:!0},Hve=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=Mve(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()?_d(e,this.model.getEditPositions()):this.stopEditing(void 0,$ve)),!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=Ive(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 npe(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??Id)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:n=!0,event:s=null,source:o="ui",ignoreEventKey:r=!1,silent:i}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=Wn(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,s,n,o);if(l===!1&&o!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,o)&&!t.continueEditing&&this.stopEditing(void 0,{source:o}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:s,source:o,ignoreEventKey:r,startedEdit:n,silent:i})}stopEditing(e,t){var v,C,S;const{event:n,cancel:s,source:o="ui",forceCancel:r,forceStop:i}=t||{},{beans:a,model:l}=this;if(Vve.has(o)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const c=this.committing?yB[o]:o;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,Id))||!this.strategy||this.stopping)return!1;this.stopping=!0;const d=Wn(a,e);d&&(d.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),f=!1;const p=!s&&(!!this.shouldStopEditing(e,n,c)||this.committing&&!this.batch)||(i??!1),g=s&&!!this.shouldCancelEditing(e,n,c)||(r??!1);if(p||g){xc(a,{persist:!0,isCancelling:g||s,isStopping:p});const b=l.getEditMap(),w=this.processEdits(b,s,o);(v=this.strategy)==null||v.stop(s,n);for(const D of w)l.clearEditValue(D);this.bulkRefresh(void 0,h);for(const D of l.getEditPositions(b)){const R=Wn(a,D),T=va(D);R==null||R.refreshCell({force:!0,suppressFlash:!T})}h=b,f||(f=p)}else if(n instanceof KeyboardEvent&&this.batch&&((C=this.strategy)!=null&&C.midBatchInputsAllowed(e))&&this.isEditing(e,{withOpenEditor:!0})){const{key:b}=n,w=b===Oe.ENTER,D=b===Oe.ESCAPE,R=b===Oe.TAB;(w||R||D)&&(w||R?xc(a,{persist:!0}):D&&this.revertSingleCellEdit(d),this.isBatchEditing()?(S=this.strategy)==null||S.cleanupEditors():_d(a,l.getEditPositions(),{event:n,cancel:D}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else xc(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),J0(a),this.model.hasEdits()||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()),this.bulkRefresh(),g&&this.beans.rowRenderer.refreshRows({rowNodes:Array.from(h.keys())}),this.isBatchEditing()&&(this.beans.rowRenderer.refreshRows({suppressFlash:!0,force:!0}),f&&p&&this.dispatchBatchEvent("batchEditingStopped",h)),this.stopping=!1,f}navigateAfterEdit(e,t){var c;if(!e||!t)return;const{event:n,suppressNavigateAfterEdit:s}=e;if(!(n instanceof KeyboardEvent)||s)return;const{key:r,shiftKey:i}=n,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(r!==Oe.ENTER||!a)return;const l=i?Oe.UP:Oe.DOWN;(c=this.beans.navigation)==null||c.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,n){const s=Array.from(e.keys()),o=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,r=[];for(const i of s){const a=e.get(i);for(const l of a.keys()){const c=a.get(l),u={rowNode:i,column:l},d=va(c);!t&&d&&!o&&(this.setNodeDataValue(i,l,c.pendingValue,void 0,n)||r.push(u))}}return r}setNodeDataValue(e,t,n,s,o="edit"){const{beans:r}=this,i=Wn(r,{rowNode:e,column:t}),a=Lve.has(o)?"edit":o;i&&(i.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,n,a);return i&&(i.suppressRefreshCell=!1),s&&(i==null||i.refreshCell(gp)),l}setEditMap(e,t){var s;this.strategy??(this.strategy=this.createStrategy()),(s=this.strategy)==null||s.setEditMap(e,t),this.bulkRefresh();let n=gp;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...Gve(e),...gp}),this.beans.rowRenderer.refreshCells(n)}dispatchEditValuesChanged({rowNode:e,column:t},n={}){if(!e||!t||!n)return;const{pendingValue:s,sourceValue:o}=n,{rowIndex:r,rowPinned:i,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:r,rowPinned:i,column:t,source:"api",data:a,newValue:s,oldValue:o,value:s,colDef:t.getColDef()})}bulkRefresh(e={},t,n={}){var a;const{beans:s,gos:o}=this,{editModelSvc:r,rowModel:i}=s;os(o)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),n):t&&((a=r==null?void 0:r.getEditMap(!1))==null||a.forEach((l,c)=>{for(const u of l.keys())this.refCell({rowNode:c,column:u},l.get(u),n)})))}refCell({rowNode:e,column:t},n,s={}){var d,h,f;const{beans:o,gos:r}=this,i=new Set([e]),a=new Set,l=e.pinnedSibling;l&&i.add(l);const c=e.sibling;c&&a.add(c);let u=e.parent;for(;u;)(d=u.sibling)!=null&&d.footer&&r.get("groupTotalRow")||!u.parent&&u.sibling&&r.get("grandTotalRow")?a.add(u.sibling):a.add(u),u=u.parent;for(const p of i)this.dispatchEditValuesChanged({rowNode:p,column:t},n);for(const p of i)(h=Wn(o,{rowNode:p,column:t}))==null||h.refreshCell(s);for(const p of a)(f=Wn(o,{rowNode:p,column:t}))==null||f.refreshCell(s)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:n}=e,{gos:s,beans:o}=this;if(n.group){if(s.get("treeData")){if(!n.data&&!s.get("enableGroupEdit"))return!1}else if(!s.get("enableGroupEdit"))return!1}const r=wB(s)==="fullRow"?Fve(o,e,t):w_(o,e,t);return r&&(this.strategy??(this.strategy=this.createStrategy())),r}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,n=!0){var s,o,r,i;if(this.hasValidationErrors(e)){const a=Wn(this.beans,e);return this.cellEditingInvalidCommitBlocks()?((s=t==null?void 0:t.preventDefault)==null||s.call(t),n&&(!(a!=null&&a.hasBrowserFocus())&&(a==null||a.focusCell()),(i=(r=(o=a==null?void 0:a.comp)==null?void 0:o.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)),"block-stop"):(a&&this.revertSingleCellEdit(a),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){var s,o,r,i;const n=Wn(this.beans,e);(s=n==null?void 0:n.comp)!=null&&s.getCellEditor()&&(_d(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),Ed(this.beans,e,{silent:!0}),Fc(this.beans),n==null||n.refreshCell(gp),t&&(n==null||n.focusCell(),(i=(r=(o=n==null?void 0:n.comp)==null?void 0:o.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)))}hasValidationErrors(e){var s;Fc(this.beans);const t=Wn(this.beans,e);t&&(t.refreshCell(gp),(s=t.rowCtrl.rowEditStyleFeature)==null||s.applyRowStyles());let n=!1;return e!=null&&e.rowNode?(n||(n=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(n||(n=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(n||(n=this.model.getCellValidationModel().getCellValidationMap().size>0),n||(n=this.model.getRowValidationModel().getRowValidationMap().size>0)),n}moveToNextCell(e,t,n,s="ui"){var a;let o;const r=this.isEditing(),i=r&&this.checkNavWithValidation(void 0,n)==="block-stop";return e instanceof Rd&&r&&(o=(a=this.strategy)==null?void 0:a.moveToNextEditingCell(e,t,n,s,i)),o===null||(o=o||!!this.beans.focusSvc.focusedHeader,o===!1&&!i&&this.stopEditing()),o}getCellDataValue({rowNode:e,column:t},n=!0){if(!e||!t)return;let s=this.model.getEdit({rowNode:e,column:t});const o=e.pinnedSibling;if(o){const i=this.model.getEdit({rowNode:o,column:t});i&&(s=i)}const r=n?(s==null?void 0:s.editorValue)??(s==null?void 0:s.pendingValue):s==null?void 0:s.pendingValue;return r===pr||!s?(s==null?void 0:s.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):r}addStopEditingWhenGridLosesFocus(e){Zfe(this,this.beans,e)}createPopupEditorWrapper(e){return new Tve(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var s;try{if((!this.isEditing()||this.committing)&&!Bve.has(n))return;const{beans:o}=this;this.strategy??(this.strategy=this.createStrategy());const r=this.isBatchEditing()?"ui":this.committing?n??"api":"api";if(!n||Nve.has(n))return wy(o,e,t,n,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,n);const i=this.model.getEdit(e);if(i){if(i.pendingValue===t)return!1;if(i.sourceValue!==t)return wy(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0;if(i.sourceValue===t)return(s=o.editModelSvc)==null||s.removeEdits(e),this.dispatchEditValuesChanged(e,{...i,pendingValue:t}),!0}return wy(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){Qfe(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,Id))return;const{rowNode:s,column:o}=e,{compDetails:r,valueToDisplay:i}=t;if(r){const{params:l}=r;return l.data=this.model.getEditRowDataValue(s,Id),{compDetails:r}}const a=this.model.getEditRow(e.rowNode,Id);if(i!==void 0&&(a!=null&&a.has(o)))return{valueToDisplay:this.valueSvc.getValue(o,s)}}cleanupEditors(){var e;(e=this.strategy)==null||e.cleanupEditors()}dispatchCellEvent(e,t,n,s){var o;(o=this.strategy)==null||o.dispatchCellEvent(e,t,n,s)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return 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 c,u;if(!n||n.length===0)return;const{beans:s,rangeSvc:o,valueSvc:r}=this;xc(s,{persist:!0});const i=this.model.getEditMap(!0),a=(u=(c=i.get(e))==null?void 0:c.get(t))==null?void 0:u.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(o==null||o.forEachRowInRange(d,h=>{const f=ma(s,h);if(f===void 0)return;const p=i.get(f)??new Map;for(const g of d.columns)if(g&&this.isCellEditable({rowNode:f,column:g},"api")){const v=r.getValue(g,f,!0,"api");let C=r.parseValue(g,f??null,a,v);Number.isNaN(C)&&(C=null),p.set(g,{editorValue:void 0,pendingValue:C,sourceValue:v,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}p.size>0&&i.set(f,p)}),this.setEditMap(i),this.batch){this.cleanupEditors(),J0(s),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(i)})}),this.bulkRefresh();const l=Wn(s,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new Pve(e,t)}createRowStyleFeature(e,t){return new Ave(e,t)}setEditingCells(e,t){const{beans:n}=this,{colModel:s,valueSvc:o}=n,r=new Map;for(let{colId:i,column:a,colKey:l,rowIndex:c,rowPinned:u,newValue:d,state:h}of e){const f=i?s.getCol(i):l?s.getCol(l):a;if(!f)continue;const p=ma(n,{rowIndex:c,rowPinned:u});if(!p)continue;const g=o.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!va({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=r.get(p);v||(v=new Map,r.set(p,v)),d===void 0&&(d=pr),v.set(f,{editorValue:void 0,pendingValue:d,sourceValue:g,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(r,t)}onCellFocused(e){var r;const t=Wn(this.beans,e);if(!t||!this.isEditing(t,Id))return;const n=this.model.getEdit(t);if(!n||!va(n))return;const o=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(r=this.beans.ariaAnnounce)==null||r.announceValue(o,"pendingChange")}allowedFocusTargetOnValidation(e){return Wn(this.beans,e)}};function Gve(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,r=e.type==="cellFocused"?e.sourceEvent:null;n&&(t=Wn(o,n));const{gos:i,editModelSvc:a}=o,l=e.type==="cellFocusCleared";if(s.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:u,rowPinned:d}=e,h={column:c,rowNode:ma(o,{rowIndex:u,rowPinned:d})},f=i.get("invalidEditValueMode")==="block";if(f)return;const p=!f,g=!!(a!=null&&a.getCellValidationModel().hasCellValidation(h)),v=p&&g;(n||l?s.stopEditing(void 0,{cancel:v,source:l&&p?"api":void 0,event:r}):!0)||(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"}))}t==null||t.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){var o,r;const n=this.model.getEditPositions(),s={all:[],pass:[],fail:[]};for(const i of n){s.all.push(i);const a=this.model.getCellValidationModel().getCellValidation(i);if((((o=a==null?void 0:a.errorMessages)==null?void 0:o.length)??0)>0){s.fail.push(i);continue}s.pass.push(i)}if(e)for(const i of n)Cy(this.beans,i,{cancel:e}),this.model.stop(i);else{const i=this.processValidationResults(s);if(i.destroy.length>0)for(const a of i.destroy)Cy(this.beans,a,{event:t,cancel:e}),this.model.stop(a);if(i.keep.length>0)for(const a of i.keep){const l=Wn(this.beans,a);(r=this.editSvc)!=null&&r.cellEditingInvalidCommitBlocks()||l&&this.editSvc.revertSingleCellEdit(l)}}return!0}cleanupEditors({rowNode:e}={},t){xc(this.beans,{persist:!1});const n=this.model.getEditPositions(),s=[];if(e)for(const o of n)o.rowNode!==e&&s.push(o);else for(const o of n)s.push(o);_d(this.beans,s),J0(this.beans,t)}setFocusOutOnEditor(e){var t,n,s;(s=(n=(t=e.comp)==null?void 0:t.getCellEditor())==null?void 0:n.focusOut)==null||s.call(n)}setFocusInOnEditor(e){const t=e.comp,n=t==null?void 0:t.getCellEditor();if(n!=null&&n.focusIn)n.focusIn();else{const s=this.beans.gos.get("editType")==="fullRow";e.focusCell(s),e.onEditorAttachedFuncs.push(()=>{var o,r;return(r=(o=t==null?void 0:t.getCellEditor())==null?void 0:o.focusIn)==null?void 0:r.call(o)})}}setupEditors(e){const{event:t,ignoreEventKey:n=!1,startedEdit:s,position:o,cells:r=this.model.getEditPositions()}=e,i=t instanceof KeyboardEvent&&!n&&t.key||void 0;Jfe(this.beans,r,o,i,t,s)}dispatchCellEvent(e,t,n,s){const o=Wn(this.beans,e);o&&this.eventSvc.dispatchEvent({...o.createEvent(t??null,n),...s})}dispatchRowEvent(e,t,n){if(n)return;const s=Z0(this.beans,e);s&&this.eventSvc.dispatchEvent(s.createRowEvent(t))}shouldStop(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return s&&n==="api"?!0:s&&(n==="ui"||n==="edit")?!1:n==="api"?!0:t instanceof KeyboardEvent&&!s?t.key===Oe.ENTER:null}shouldCancel(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!s&&t.key===Oe.ESCAPE||s&&n==="api"||n==="api")}setEditMap(e,t){var s;t!=null&&t.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const n=[];if(e.forEach((o,r)=>{o.forEach((i,a)=>{i.state==="editing"&&n.push({...i,rowNode:r,column:a})})}),t!=null&&t.update&&(e=new Map([...this.model.getEditMap(),...e])),(s=this.model)==null||s.setEditMap(e),n.length>0){const o=n.at(-1),r=o.pendingValue===pr?void 0:o.pendingValue;this.start({position:o,event:new KeyboardEvent("keydown",{key:r}),source:"api"});const i=Wn(this.beans,o);i&&this.setFocusInOnEditor(i)}}destroy(){this.cleanupEditors(),super.destroy()}},Uve=class extends CB{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:s}=e||{};if(!Z0(this.beans,{rowNode:this.rowNode}))return!0;const r=super.shouldStop({rowNode:this.rowNode},t,n);return r!==null?r:this.rowNode?s!==this.rowNode:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:n,startedEdit:s,event:o,ignoreEventKey:r}=e,{rowNode:i}=t;this.rowNode!==i&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],c=[];for(const u of a)u.isCellEditable(i)&&c.push(u);if(c.length!=0){this.dispatchRowEvent({rowNode:i},"rowEditingStarted",n),this.startedRows.push(i);for(const u of c){const d={rowNode:i,column:u};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=i,this.setupEditors({cells:l,position:t,startedEdit:s,event:o,ignoreEventKey:r})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){var o;const{rowNode:n}=this;if(n&&!this.model.hasRowEdits(n))return!1;const s=[];if(e||this.model.getEditMap().forEach((r,i)=>{if(!(!r||r.size===0)){for(const a of r.values())if(va(a)){s.push(i);break}}}),Fc(this.beans),!e&&((o=this.editSvc)==null?void 0:o.checkNavWithValidation({rowNode:n}))==="block-stop")return!1;super.stop(e,t);for(const r of s)this.dispatchRowEvent({rowNode:r},"rowValueChanged");return this.cleanupEditors({rowNode:n},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,n=e.previousParams;if((n==null?void 0:n.rowIndex)===t||e.sourceEvent instanceof KeyboardEvent)return;const s=Wn(this.beans,n);this.gos.get("invalidEditValueMode")==="block"&&s&&(this.model.getCellValidationModel().getCellValidation(s)||this.model.getRowValidationModel().getRowValidation(s))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);for(const n of this.startedRows)this.dispatchRowEvent({rowNode:n},"rowEditingStopped");this.startedRows.length=0}moveToNextEditingCell(e,t,n,s="ui",o=!1){var h,f,p,g;const r=e.cellPosition;let i;this.model.suspend(!0);try{i=(h=this.beans.navigation)==null?void 0:h.findNextCellToFocusOn(r,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(i===!1)return null;if(i==null)return!1;const a=i.cellPosition,l=e.isCellEditable(),c=i.isCellEditable(),u=a&&r.rowIndex===a.rowIndex&&r.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return c&&!o?d?i.focusCell(!0,n):((f=i.comp)!=null&&f.getCellEditor()||Ed(this.beans,i,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(i),i.focusCell(!1,n)):(c&&o&&this.setFocusInOnEditor(i),i.focusCell(!0,n)),!u&&!o&&((p=this.editSvc)==null||p.stopEditing({rowNode:e.rowNode},{event:n}),this.cleanupEditors(i,!0),d?i.focusCell(!0,n):this.editSvc.startEditing(i,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),(g=e.rowCtrl)==null||g.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:n},s)=>{var r;if(n!=="editing")return;const o=Wn(this.beans,{rowNode:t,column:s});o&&!((r=o.comp)!=null&&r.getCellEditor())&&Ed(this.beans,o,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},Wve=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:r}=e||{};return(!this.rowNode||!this.column)&&o&&r?null:this.rowNode!==o||this.column!==r}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:n,event:s,ignoreEventKey:o}=e;(this.rowNode!==t.rowNode||this.column!==t.column)&&super.cleanupEditors(),this.rowNode=t.rowNode,this.column=t.column,this.model.start(t),this.setupEditors({cells:[t],position:t,startedEdit:n,event:s,ignoreEventKey:o})}dispatchRowEvent(e,t,n){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){return super.stop(e,t),this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:n}=this.beans,{rowIndex:s,column:o,rowPinned:r}=e,i=ma(this.beans,{rowIndex:s,rowPinned:r}),a=X0(o),l=t.getCol(a),c=e.previousParams;if(c){const u=X0(c.column);if((c==null?void 0:c.rowIndex)===s&&u===a&&(c==null?void 0:c.rowPinned)===r)return}n!=null&&n.isEditing({rowNode:i,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,n,s="ui",o=!1){var p,g,v,C,S,b;const r=this.beans.focusSvc.getFocusedCell();r&&(e=bd(this.beans,r)??e);const i=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),o||(e.eGui.focus(),(g=this.editSvc)==null||g.stopEditing(e,{source:(p=this.editSvc)!=null&&p.isBatchEditing()?"ui":"api",event:n}));try{a=(v=this.beans.navigation)==null?void 0:v.findNextCellToFocusOn(i,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,u=e.isCellEditable(),d=a.isCellEditable(),h=c&&i.rowIndex===c.rowIndex&&i.rowPinned===c.rowPinned;u&&!o&&this.setFocusOutOnEditor(e);const f=this.gos.get("suppressStartEditOnTab");if(!h&&!o&&(super.cleanupEditors(a,!0),f?a.focusCell(!0,n):this.editSvc.startEditing(a,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),d&&!o){if(a.focusCell(!1,n),f)a.focusCell(!0,n);else if(!((C=a.comp)!=null&&C.getCellEditor())){const w=(S=this.editSvc)==null?void 0:S.isEditing(a,{withOpenEditor:!0});Ed(this.beans,a,{event:n,cellStartedEdit:!0,silent:w}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else d&&o&&this.setFocusInOnEditor(a),a.focusCell(!0,n);return(b=e.rowCtrl)==null||b.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},gl={moduleName:"EditCore",version:ct,beans:[Yfe,Hve],apiFunctions:{getEditingCells:wve,getEditRowValues:yve,getCellEditorInstances:Xfe,startEditingCell:Sve,stopEditing:Cve,isEditing:bve,validateEdit:Eve},dynamicBeans:{singleCell:Wve,fullRow:Uve},dependsOn:[Ey,cB],css:[Yme]},zve={moduleName:"UndoRedoEdit",version:ct,beans:[qme],apiFunctions:{undoCellEditing:mve,redoCellEditing:vve,getCurrentUndoSize:_ve,getCurrentRedoSize:Rve},dependsOn:[gl]},jve={moduleName:"TextEditor",version:ct,userComponents:{agCellEditor:dB,agTextCellEditor:dB},dependsOn:[gl]},Kve={moduleName:"NumberEditor",version:ct,userComponents:{agNumberCellEditor:{classImp:lve}},dependsOn:[gl]},qve={moduleName:"DateEditor",version:ct,userComponents:{agDateCellEditor:eve,agDateStringCellEditor:sve},dependsOn:[gl]},Yve={moduleName:"CheckboxEditor",version:ct,userComponents:{agCheckboxCellEditor:Xme},dependsOn:[gl]},Zve={moduleName:"SelectEditor",version:ct,userComponents:{agSelectCellEditor:uve},dependsOn:[gl]},Xve={moduleName:"LargeTextEditor",version:ct,userComponents:{agLargeTextCellEditor:rve},dependsOn:[gl]},Jve={moduleName:"CustomEditor",version:ct,dependsOn:[gl]},Qve=class extends We{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,hd(e.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(e){const t=this.columns;t!=null&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),ure(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,r=(((h=this.columns)==null?void 0:h.treeDepth)??-1)==s,i=this.generateSelectionCols();if(cre(i,((f=this.columns)==null?void 0:f.list)??[])&&r)return;n();const{colGroupSvc:l}=this.beans,c=(l==null?void 0:l.findDepth(e.tree))??0,u=(l==null?void 0:l.balanceTreeForAutoCols(i,c))??[];this.columns={list:i,tree:u,treeDepth:c,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!ua(v));return[...i,...g]})}updateColumns(e){var n;const t=hd(e.source);for(const s of((n=this.columns)==null?void 0:n.list)??[]){const o=this.createSelectionColDef(e.currentValue);s.setColDef(o,null,t),Hr(this.beans,{state:[{...o,colId:s.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>Xf(n,e)))??null}getColumns(){var e;return((e=this.columns)==null?void 0:e.list)??null}isSelectionColumnEnabled(){var i,a;const{gos:e,beans:t}=this,n=e.get("rowSelection");if(typeof n!="object"||!mc(e))return!1;const s=(((a=(i=t.autoColSvc)==null?void 0:i.getColumns())==null?void 0:a.length)??0)>0;if(n.checkboxLocation==="autoGroupColumn"&&s)return!1;const o=!!dd(n),r=Lv(n);return o||r}createSelectionColDef(e){const{gos:t}=this,n=e??t.get("selectionColumnDef"),s=t.get("enableRtl"),{rowSpan:o,spanRows:r,...i}=n??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:s?"right":"left",comparator(a,l,c,u){const d=c.isSelected(),h=u.isSelected();return d===h?0:d?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...i,colId:lL,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new wc(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const s=t&&typeof t!="string"?dd(t):void 0,o=e&&typeof e!="string"?dd(e):void 0,r=s!==o,i=t&&typeof t!="string"?Lv(t):void 0,a=e&&typeof e!="string"?Lv(e):void 0,l=i!==a,c=Vv(e),u=Vv(t);(r||l||c!==u)&&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,c;if(!((l=this.columns)!=null&&l.list.length))return;const s=e.length+t.length+n.length;if(s===0)return;const o=this.columns.list[0];if(!o.isVisible())return;const r=()=>{let u;switch(o.pinned){case"left":case!0:u=e;break;case"right":u=n;break;default:u=t}u&&$r(u,o)};(((c=this.beans.rowNumbersSvc)==null?void 0:c.getColumn(cL))?2:1)===s&&r()}};function eye(e,t){var i;if(!t.nodes.every(a=>a.rowPinned&&!ip(a)?(Je(59),!1):a.id===void 0?(Je(60),!1):!0))return;const{nodes:s,source:o,newValue:r}=t;(i=e.selectionSvc)==null||i.setNodesSelected({nodes:s,source:o??"api",newValue:r})}function tye(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.selectAllRowNodes({source:n,selectAll:t})}function nye(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.deselectAllRowNodes({source:n,selectAll:t})}function sye(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function oye(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function rye(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function iye(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function aye(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function lye(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var cye=class extends Sce{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=Yf(e),this.groupSelectsFiltered=$v(e)==="filteredDescendants",this.masterSelectsDetail=sL(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=Yf(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:r,keepDescendants:i=!1}){var c;if(s.length===0)return 0;const{gos:a}=this;if(!mc(a)&&e)return Je(132),0;if(s.length>1&&!this.isMultiSelect())return Je(130),0;let l=0;for(let u=0;u<s.length;u++){const d=s[u],h=xd(d);if(h.rowPinned&&!ip(h)){Je(59);continue}if(h.id===void 0){Je(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,o,r)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((c=h.childrenAfterGroup)!=null&&c.length)&&(l+=this.selectChildren(h,e,r))}return n||(s.length===1&&r==="api"&&this.selectionCtx.setRoot(xd(s[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(xd(s[0]),i,r)),l>0&&(this.updateGroupsFromChildrenSelections(r),this.dispatchSelectionChanged(r))),l}selectRange(e,t,n){let s=0;return e.forEach(o=>{const r=xd(o);if(r.group&&this.groupSelectsDescendants)return;this.selectRowNode(r,t,void 0,n)&&s++}),s>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n)),s}selectChildren(e,t,n){const s=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return s?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:n,nodes:s}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((n,s)=>{e(n)&&t.set(s,n)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:n,rowModel:s}=this.beans;if(!os(n))return!1;const o=s.rootNode;if(!o)return!1;t||(t=new lp(!0,o),t.active=!1);let r=!1;return t.forEachChangedNodeDepthFirst(i=>{if(i!==o){const a=this.calculateSelectedFromChildren(i);r=this.selectRowNode(i,a===null?!1:a,void 0,e)||r}}),r}clearOtherNodes(e,t,n){const s=new Map;let o=0;return this.selectedNodes.forEach(r=>{const i=r.id==e.id;if((t?!dye(e,r):!0)&&!i){const l=this.selectedNodes.get(r.id);o+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:n}),this.groupSelectsDescendants&&r.parent&&s.set(r.parent.id,r.parent)}}),s.forEach(r=>{const i=this.calculateSelectedFromChildren(r);this.selectRowNode(r,i===null?!1:i,void 0,n)}),o}onRowSelected(e){const t=e.node;this.groupSelectsDescendants&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}createDaemonNode(e){if(!e.id)return;const t=new cl(this.beans);return t.id=e.id,t.data=e.data,t.__selected=e.__selected,t.level=e.level,t}syncInOldRowNode(e,t){t&&e.id!==t.id&&this.selectedNodes.get(t.id)==e&&this.selectedNodes.set(t.id,t)}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.__selected=!0,this.selectedNodes.set(e.id,e)):e.__selected=!1}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes.forEach(e=>{this.selectRowNode(e,!1)}),this.selectedNodes.clear()}getBestCostNodeSelection(){const{gos:e,rowModel:t}=this.beans;if(!os(e))return;const n=t.getTopLevelNodes();if(n===null)return;const s=[];function o(r){for(let i=0,a=r.length;i<a;i++){const l=r[i];l.isSelected()?s.push(l):l.group&&l.childrenAfterGroup&&o(l.childrenAfterGroup)}}return o(n),s}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const n=os(this.gos);let s=!1;const o=r=>{const i=this.selectRowNode(xd(r),!1,void 0,e);s||(s=i)};if(t==="currentPage"||t==="filtered"){if(!n){En(102);return}this.getNodesToSelect(t).forEach(o)}else this.selectedNodes.forEach(o),this.reset(e);if(this.selectionCtx.selectAll=!1,n&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(e);s||(s=r)}s&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,n=0;return this.getNodesToSelect(e).forEach(s=>{this.groupSelectsDescendants&&s.group||(s.isSelected()?t++:s.selectable&&n++)}),{selectedCount:t,notSelectedCount:n}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:n}=this.getSelectedCounts(e);return 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 r=i=>{var a;n(i),(a=i.childrenAfterFilter)==null||a.forEach(r)};r(o);return}this.groupSelectsDescendants||n(o)}),t;const s=this.beans.rowModel;return e==="filtered"?(s.forEachNodeAfterFilter(n),t):(s.forEachNode(n),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:n}=this.beans,s=t.getFirstRow(),o=t.getLastRow();for(let r=s;r<=o;r++){const i=n.getRow(r);i&&e(i)}}selectAllRowNodes(e){const{gos:t,selectionCtx:n}=this;if(!mc(t)){Je(132);return}if(Zoe(t)&&!qf(t)){Je(130);return}if(!this.canSelectAll())return;const{source:s,selectAll:o}=e;let r=!1;if(this.getNodesToSelect(o).forEach(i=>{const a=this.selectRowNode(xd(i),!0,void 0,s);r||(r=a)}),n.selectAll=!0,os(t)&&this.groupSelectsDescendants){const i=this.updateGroupsFromChildrenSelections(s);r||(r=i)}r&&this.dispatchSelectionChanged(s)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,n){if(e||(e=[]),!Array.isArray(e)){En(103);return}const s=new Set(e),o=[];this.beans.rowModel.forEachNode(r=>{s.has(r.id)&&o.push(r)}),n&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:o,source:t})}canSelectAll(){return os(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!mc(t))return;const s="selectableChanged",o=e!==void 0,r=os(t)&&this.groupSelectsDescendants,i=[],a=c=>{var d;if(o&&!c.group)return;if(r&&c.group){const h=((d=c.childrenAfterGroup)==null?void 0:d.some(f=>f.selectable))??!1;this.setRowSelectable(c,h,!0);return}!this.updateRowSelectable(c,!0)&&c.isSelected()&&i.push(c)};if(r){if(e===void 0){const c=n.rootNode;e=c?new lp(!1,c):void 0}e==null||e.forEachChangedNodeDepthFirst(a,!o,!o)}else n.forEachNode(a);i.length&&this.setNodesSelected({nodes:i,newValue:!1,source:s}),!o&&r&&((l=this.updateGroupsFromChildrenSelections)==null||l.call(this,s))}updateSelectableAfterGrouping(e){var t;this.updateSelectable(e),this.groupSelectsDescendants&&((t=this.updateGroupsFromChildrenSelections)!=null&&t.call(this,"rowGroupChanged",e))&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){var r,i;if(!this.masterSelectsDetail)return;const n=(i=(r=e.detailNode)==null?void 0:r.detailGridInfo)==null?void 0:i.api;if(!n)return;const s=uye(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(!qf(t)){Je(269);return}switch(e.isSelected()){case!0:{n.selectAll();break}case!1:{n.deselectAll();break}case void 0:{const s=this.detailSelection.get(e.id);if(s){const o=[];for(const r of s){const i=n.getRowNode(r);i&&o.push(i)}n.setNodesSelected({nodes:o,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function xd(e){return ip(e)?e.pinnedSibling:e.footer?e.sibling:e}function uye(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 dye(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 hye={moduleName:"SharedRowSelection",version:ct,beans:[Qve],apiFunctions:{setNodesSelected:eye,selectAll:tye,deselectAll:nye,selectAllFiltered:sye,deselectAllFiltered:oye,selectAllOnCurrentPage:rye,deselectAllOnCurrentPage:iye,getSelectedNodes:aye,getSelectedRows:lye}},fye={moduleName:"RowSelection",version:ct,rowModels:["clientSide","infinite","viewport"],beans:[cye],dependsOn:[hye]};function pye(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function gye(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){Je(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function mye(e,t,n){var o,r;const s=vge(e);if(s){if(((o=e.rowGroupColsSvc)==null?void 0:o.columns.length)===0){if(t<0){En(238);return}s.setRowCount(t,n);return}En(28);return}(r=Sy(e))==null||r.setRowCount(t,n)}function vye(e){var t;return ld(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function yye(e){return e.rowModel.isLastRowIndexKnown()}var wye={moduleName:"CsrmSsrmSharedApi",version:ct,apiFunctions:{expandAll:pye,collapseAll:gye}},Cye={moduleName:"RowModelSharedApi",version:ct,apiFunctions:{onRowHeightChanged:EB,resetRowHeights:_B}},bye={moduleName:"SsrmInfiniteSharedApi",version:ct,apiFunctions:{setRowCount:mye,getCacheBlockState:vye,isLastRowIndexKnown:yye}},Sye=class extends We{constructor(){super(...arguments),this.beanName="alignedGridsSvc",this.consuming=!1}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";return typeof e=="function"&&(e=e()),e.map(s=>{var r;if(!s){En(18),t||En(20);return}if(this.isGridApi(s))return s;const o=s;return"current"in o?(r=o.current)==null?void 0:r.api:(o.api||En(19),o.api)}).filter(s=>!!s&&!s.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){if(!this.consuming)for(const t of this.getAlignedGridApis())t.isDestroyed()||t.dispatchEvent(e)}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const n=[];return e.columns?e.columns.forEach(s=>{n.push(t(s))}):e.column&&n.push(t(e.column)),n}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":Je(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const n of e.columnGroups){let s=null;n&&(s=t.getProvidedColGroup(n.getGroupId())),!(n&&!s)&&t.setColumnGroupOpened(s,n.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let n=null;const s=this.beans,{colResize:o,ctrlsSvc:r,colModel:i}=s;if(t&&(n=i.getColDefCol(t.getColId())),t&&!n)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const d=e.api.getColumnState().map(h=>({colId:h.colId}));Hr(s,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));Hr(s,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));Hr(s,{state:d},"alignedGridChanged")}break;case"columnResized":{const u=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of u.flexColumns??[])d[h.getId()]&&delete d[h.getId()];o==null||o.setColumnWidths(Object.values(d),!1,u.finished,"alignedGridChanged");break}}const c=r.getGridBodyCtrl().isVerticalScrollShowing();for(const u of this.getAlignedGridApis())u.setGridOption("alwaysShowVerticalScroll",c)}},Eye={moduleName:"AlignedGrids",version:ct,beans:[Sye],dependsOn:[l2]},_ye=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),r=new Array(e.length);o._leafs=r;let i=0;const a=s==null?void 0:s.getNestedDataGetter(),l=a?new Set:null,c=(u,d)=>{const h=u.level+1;for(let f=0,p=d.length;f<p;++f){const g=d[f];if(!g)continue;const v=this.createRowNode(g,h);if(v.sourceRowIndex=i,r[i++]=v,l&&!l.has(g)){l.add(g),v.treeParent=u;const C=a(g);C&&c(v,C)}}};c(o,e),r.length=i}setImmutableRowData(e,t){var C;const{rootNode:n,gos:s}=this;this.dispatchRowDataUpdateStarted(t);const o=ud(s),r=e.changedRowNodes,{adds:i,updates:a}=r,l=new Set,c=[],u=(C=this.beans.groupStage)==null?void 0:C.getNestedDataGetter();let d=s.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,f=!1;const p=(S,b)=>{if(!d&&d!==void 0){const w=S.sourceRowIndex;d=w<=h,h=w}S.data!==b&&(S.updateData(b),i.has(S)||a.add(S),!S.selectable&&S.isSelected()&&c.push(S))},g=(S,b,w)=>{for(let D=0,R=b.length;D<R;++D){const T=b[D];if(!T)continue;let I=this.getRowNode(o({data:T,level:w}));if(I?(p(I,T),f||(f=!!u&&I.treeParent!==S)):(I=this.createRowNode(T,w),i.add(I)),!u||l.has(I)){l.add(I);continue}l.add(I),I.treeParent=S;const x=u(T);x&&g(I,x,w+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,r,c)||d||i.size>0;if(v){const S=n._leafs??(n._leafs=[]);d===void 0?xye(S,l,r):Iye(S,l)&&(r.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},n){const s=this.rootNode._leafs;for(let o=0,r=s.length;o<r;o++){const i=s[o];e.has(i)||(t.add(i),i.isSelected()&&n.push(i),this.deleteNode(i))}return t.size>0}updateRowData(e,t){var a;if(this.dispatchRowDataUpdateStarted(e.add),(a=this.beans.groupStage)!=null&&a.getNestedDataGetter())return Je(268),{remove:[],update:[],add:[]};const n=[],s=ud(this.gos),o=this.executeRemove(s,e,t,n),r=this.executeUpdate(s,e,t,n),i=this.executeAdd(e,t);return this.deselect(n),{remove:o,update:r,add:i}}executeRemove(e,{remove:t},{adds:n,updates:s,removals:o},r){const i=this.rootNode._leafs,a=i==null?void 0:i.length,l=t==null?void 0:t.length;if(!l||!a)return[];let c=0,u=a,d=0,h;const f=new Array(l);for(let p=0;p<l;++p){const g=this.lookupNode(e,t[p]);if(!g)continue;const v=g.sourceRowIndex;v<u&&(u=v),v>d&&(d=v),g.isSelected()&&r.push(g),this.deleteNode(g),n.delete(g)?(h??(h=new Set),h.add(g)):(s.delete(g),o.add(g)),f[c++]=g}return f.length=c,c&&Tye(i,u,d,o,h),f}executeUpdate(e,{update:t},{adds:n,updates:s},o){const r=t==null?void 0:t.length;if(!r)return[];const i=new Array(r);let a=0;for(let l=0;l<r;l++){const c=t[l],u=this.lookupNode(e,c);u&&(u.updateData(c),!u.selectable&&u.isSelected()&&o.push(u),i[a++]=u,n.has(u)||s.add(u))}return i.length=a,i}executeAdd(e,t){var n;const s=(n=this.rootNode)._leafs??(n._leafs=[]),o=s.length,r=e.add,i=r==null?void 0:r.length;if(!i)return[];const a=o+i;let l=this.sanitizeAddIndex(s,e.addIndex);if(l<o){for(let d=o-1,h=a-1;d>=l;--d){const f=s[d];f.sourceRowIndex=h,s[h--]=f}t.reordered=!0}s.length=a;const c=new Array(i),u=t.adds;for(let d=0;d<i;d++){const h=this.createRowNode(r[d],0);u.add(h),h.sourceRowIndex=l,s[l]=h,c[d]=h,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}deselect(e){var s;const t="rowDataChanged",n=this.beans.selectionSvc;e.length&&(n==null||n.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t})),(s=n==null?void 0:n.updateGroupsFromChildrenSelections)==null||s.call(n,t),e.length&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t,selectedNodes:(n==null?void 0:n.getSelectedNodes())??null,serverSideState:null})}createRowNode(e,t){const n=new cl(this.beans);n.parent=this.rootNode,n.level=t,n.group=!1,n.expanded=!1,n.setDataAndId(e,String(this.nextId++));const s=n.id,o=this.allNodesMap;return o[s]&&Je(2,{nodeId:s}),o[s]=n,n}deleteNode(e){var o;e.clearRowTopAndRowIndex();const t=e.id,n=this.allNodesMap;n[t]===e&&delete n[t];const s=e.pinnedSibling;s&&((o=this.beans.pinnedRowModel)==null||o.pinRow(s,null))}lookupNode(e,t){if(!e)return Dye(this.rootNode._leafs,t);const n=e({data:t,level:0}),s=this.allNodesMap[n];return s||(En(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=Rye(e,t)),t}},Rye=(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 i;e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",((i=e._leafs)==null?void 0:i.length)!==0&&(e._leafs=[]);const t=[],n=[],s=[],o=[];e.childrenAfterGroup=t,e.childrenAfterSort=n,e.childrenAfterAggFilter=s,e.childrenAfterFilter=o;const r=e.sibling;return r&&(r.childrenAfterGroup=t,r.childrenAfterSort=n,r.childrenAfterAggFilter=s,r.childrenAfterFilter=o,r.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},Dye=(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 En(5,{data:t}),null},Tye=(e,t,n,s,o)=>{t=Math.max(0,t);for(let r=t,i=e.length;r<i;++r){const a=e[r];r<=n&&(s.has(a)||o!=null&&o.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},Iye=(e,t)=>{const n=t.size;e.length=n;let s=0,o=!1,r=!1;for(const i of t){const a=i.sourceRowIndex;a===s?r||(r=o):(a>=0?r=!0:o=!0,i.sourceRowIndex=s,e[s]=i),++s}return r},xye=(e,t,{removals:n,adds:s})=>{const o=e.length;e.length=t.size;let r=0;for(let i=0;i<o;++i){const a=e[i];n.has(a)||(r!==i&&(a.sourceRowIndex=r,e[r]=a),++r)}for(const i of s)i.sourceRowIndex<0&&(i.sourceRowIndex=r,e[r++]=i);e.length=r},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 r=t[s],i=s===0,a=s===o;r.firstChild!==i&&(r.firstChild=i,r.dispatchRowEvent("firstChildChanged")),r.lastChild!==a&&(r.lastChild=a,r.dispatchRowEvent("lastChildChanged")),r.childIndex!==s&&(r.childIndex=s,r.dispatchRowEvent("childIndexChanged"))}},Fye=class extends We{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e){const t=this.beans.sortSvc.getSortOptions(),n=t.length>0&&!!e.changedRowNodes&&this.gos.get("deltaSort");this.sort(t,n,e.changedRowNodes,e.changedPath)}sort(e,t,n,s){const{gos:o,colModel:r,rowGroupColsSvc:i,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,u=o.get("groupMaintainOrder"),d=r.getCols().some(S=>S.isRowGroupActive()),h=i==null?void 0:i.columns,f=r.isPivotMode(),p=o.getCallback("postSortRows");let g=!1,v;const C=S=>{var R,T;const b=f&&S.leafGroup;let w=u&&d&&!S.leafGroup;w&&(v??(v=this.shouldSortContainsGroupCols(e)),w&&(w=!v));let D=null;if(w){let I=!1;if(h){const x=S.level+1;x<h.length&&(I=h[x].getSort()===null)}I||(D=kye(S))}else!e.length||b||(t&&n?D=Pye(a,S,n,s,e):D=a.doFullSort(S.childrenAfterAggFilter,e));if(D||(D=((R=S.childrenAfterAggFilter)==null?void 0:R.slice(0))??[]),g||(g=((T=S.childrenAfterSort)==null?void 0:T[0])!==D[0]),S.childrenAfterSort=D,DB(S),p){const I={nodes:S.childrenAfterSort};p(I)}};if(s==null||s.forEachChangedNodeDepthFirst(C),g&&o.get("groupHideOpenParents")){const S=c==null?void 0:c.getShowRowGroupCols();S!=null&&S.length&&l.refreshCells({columns:S,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(bi(this.gos)){for(let n=0;n<t;++n){const s=e[n].column;if(s.isPrimary()&&s.isRowGroupActive())return!0}return!1}for(let n=0;n<t;++n)if(e[n].column.getColDef().showRowGroup)return!0;return!1}},Pye=(e,t,n,s,o)=>{const r=t.childrenAfterAggFilter,i=t.childrenAfterSort;if(!i)return e.doFullSort(r,o);const a=new Set,l=[],{updates:c,adds:u}=n;for(let h=0,f=r.length;h<f;++h){const p=r[h];c.has(p)||u.has(p)||s&&!s.canSkip(p)?l.push({currentPos:l.length,rowNode:p}):a.add(p)}const d=i.filter(h=>a.has(h)).map((h,f)=>({currentPos:f,rowNode:h}));return l.sort((h,f)=>e.compareRowNodes(o,h,f)),Aye(e,o,l,d)},Aye=(e,t,n,s)=>{let o=0,r=0;const i=n.length,a=s.length,l=new Array(i+a);let c=0;for(;o<i&&r<a;){const u=n[o],d=s[r];e.compareRowNodes(t,u,d)<0?(l[c++]=u.rowNode,++o):(l[c++]=d.rowNode,++r)}for(;o<i;)l[c++]=n[o++].rowNode;for(;r<a;)l[c++]=s[r++].rowNode;return l},kye=e=>{const t=e.childrenAfterSort,n=e.childrenAfterAggFilter,s=t==null?void 0:t.length,o=n==null?void 0:n.length;if(!s||!o)return null;const r=new Array(o),i=new Set;for(let l=0;l<o;++l)i.add(n[l]);let a=0;for(let l=0;l<s;++l){const c=t[l];i.delete(c)&&(r[a++]=c)}if(i.size===0&&a===s)return t;for(const l of i)r[a++]=l;return r.length=a,r},Oye=class extends We{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.rowCountReady=!1,this.nodeManager=void 0,this.rowsToDisplay=[],this.rowDataUpdatedPending=!1,this.asyncTransactions=null,this.asyncTransactionsTimer=0,this.started=!1,this.refreshingModel=!1,this.rowNodesCountReady=!1,this.stages=[],this.stagesRefreshProps=new Map,this.onRowHeightChanged_debounced=Os(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new cl(e);this.rootNode=t,this.nodeManager=this.createBean(new _ye(t));const n=this.refreshModel.bind(this,{step:"group"}),s=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:s,columnRowGroupChanged:n,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:n,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,n=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(s=>!!s);this.stages=n;for(let s=n.length-1;s>=0;--s)for(const o of n[s].refreshProps)t.set(o,s);this.addManagedPropertyListeners([...t.keys()],s=>{var r;const o=(r=s.changeSet)==null?void 0:r.properties;o&&this.onPropChange(o)}),this.addManagedPropertyListener("rowData",()=>this.onPropChange(["rowData"])),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.started=!0,this.rowNodesCountReady?this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0}):this.setInitialData()}setInitialData(){this.gos.get("rowData")&&this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,n,s){let o,r=!1;do{o=!1;const i=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(i,n),c=Math.min(a,s);for(let u=l;u<=c;u++){const d=this.getRow(u);if(d.rowHeightEstimated){const h=ol(this.beans,d);d.setRowHeight(h.height),o=!0,r=!0}}o&&this.setRowTopAndRowIndex()}while(o);return r}onPropChange(e){const{nodeManager:t,gos:n,beans:s}=this,o=s.groupStage;if(!t)return;const r=new Set(e),i=o==null?void 0:o.onPropChange(r);let a;r.has("rowData")?a=n.get("rowData"):i&&(a=o==null?void 0:o.extractData()),a&&!Array.isArray(a)&&(a=null,Je(1));const l={step:"nothing",changedProps:r};a&&(!i&&!this.isEmpty()&&a.length>0&&n.exists("getRowId")&&!n.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!n.get("suppressAnimationFrame"),l.changedRowNodes=new py,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const c=l.rowDataUpdated?"group":this.getRefreshedStage(e);c&&(l.step=c,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:n}=this,s=t.length;let o=s;for(let r=0,i=e.length;r<i&&o;++r)o=Math.min(o,n.get(e[r])??o);return o<s?t[o].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:n}=this,s=t.environment.getDefaultRowHeight();let o=0;const r=Ms(this.gos,"normal");for(let i=0,a=n.length;i<a;++i){const l=n[i],c=l.id;if(c!=null&&(e==null||e.add(c)),l.rowHeight==null){const u=ol(t,l,r,s);l.setRowHeight(u.height,u.estimated)}l.setRowTop(o),l.setRowIndex(i),o+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const n=e.active,s=i=>{(i==null?void 0:i.id)!=null&&!t.has(i.id)&&i.clearRowTopAndRowIndex()},o=i=>{s(i),s(i.detailNode),s(i.sibling);const a=i.childrenAfterGroup;if(!i.hasChildren()||!a)return;const l=i.level==-1;if(!(n&&!l&&!i.expanded))for(let u=0,d=a.length;u<d;++u)o(a[u])},r=this.rootNode;r&&o(r)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){var o,r;const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const s=(o=e.sibling)!=null&&o.displayed?1:0;return(((r=e.childrenAfterSort)==null?void 0:r.length)??0)+s}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:n,rowsToDisplay:s}=this;if(!n||!s.length||s[0]===n)return e;const r=n.childrenAfterSort,i=l=>{let c=r[l];if(this.gos.get("groupHideOpenParents"))for(;c.expanded&&c.childrenAfterSort&&c.childrenAfterSort.length>0;)c=c.childrenAfterSort[0];return c.rowIndex},a=t.footerSvc;return a?a==null?void 0:a.getTopDisplayIndex(s,e,r,i):i(e)}getTopLevelIndexFromDisplayedIndex(e){var a;const{rootNode:t,rowsToDisplay:n}=this;if(!t||!n.length||n[0]===t)return e;let o=this.getRow(e);o.footer&&(o=o.sibling);let r=o.parent;for(;r&&r!==t;)o=r,r=o.parent;const i=((a=t.childrenAfterSort)==null?void 0:a.indexOf(o))??-1;return i>=0?i:e}getRowBounds(e){const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:cd(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const s=t.length===0||t.some(o=>o.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:s,keepRenderedRows:!0,animate:cd(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:cd(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new lp(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:n,rowDataUpdated:s}=e;return!(!t||n||!s||t.removals.size||t.adds.size)}refreshModel(e){var c,u;const{nodeManager:t,beans:n,eventSvc:s,started:o,refreshingModel:r}=this;if(!t)return;const i=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&i));if(o&&i&&s.dispatchEvent({type:"rowDataUpdated"}),!o||r||n.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=i);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,(c=n.masterDetailSvc)==null||c.refreshModel(e),i&&e.step!=="group"&&((u=n.colFilter)==null||u.refreshModel()),e.step){case"group":this.doGrouping(e);case"filter":this.doFilter(a);case"pivot":this.doPivot(a);case"aggregate":this.doAggregate(a);case"filter_aggregates":this.doFilterAggregates(a);case"sort":this.doSort(e.changedRowNodes,a);case"map":this.doRowsToDisplay()}const l=new Set;this.setRowTopAndRowIndex(l),this.clearRowTopAndRowIndex(a,l),this.refreshingModel=!1,s.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}isEmpty(){var e,t,n;return!((t=(e=this.rootNode)==null?void 0:e._leafs)!=null&&t.length)||!((n=this.beans.colModel)!=null&&n.ready)}isRowsToRender(){return this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let n=!1,s=!1;const o=[],r=Yf(this.gos);return this.forEachNodeAfterFilterAndSort(i=>{if(s)return;if(n&&(i===t||i===e)&&(s=!0,r&&i.group)){TB(o,i);return}if(!n){if(i!==t&&i!==e)return;n=!0,t===e&&(s=!0)}(!i.group||!r)&&o.push(i)}),o}getTopLevelNodes(){var e;return((e=this.rootNode)==null?void 0:e.childrenAfterGroup)??null}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,n=t.length;if(this.isEmpty()||n===0)return-1;let s=0,o=n-1;if(e<=0)return 0;if(t[o].rowTop<=e)return o;let i=-1,a=-1;for(;;){const l=Math.floor((s+o)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTop<e?s=l+1:c.rowTop>e&&(o=l-1),i===s&&a===o))return l;i=s,a=o}}isRowInPixel(e,t){const n=e.rowTop,s=n+e.rowHeight;return n<=t&&s>t}forEachLeafNode(e){var n;const t=(n=this.rootNode)==null?void 0:n._leafs;if(t)for(let s=0,o=t.length;s<o;++s)e(t[s],s)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let n=0,s=t.length;n<s;++n)e(t[n],n)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterSort)}forEachPivotNode(e,t,n){const{colModel:s,rowGroupColsSvc:o}=this.beans;if(!s.isPivotMode())return;if(!(o!=null&&o.columns.length)){e(this.rootNode,0);return}const r=n?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,i=>i.leafGroup?null:i[r])}depthFirstSearchRowNodes(e,t=!1,n=r=>r.childrenAfterGroup,s=this.rootNode,o=0){let r=o;if(!s)return r;const i=s===this.rootNode;if(i||e(s,r++),s.hasChildren()&&!s.footer){const a=n(s);if(a){const l=this.beans.footerSvc;r=(l==null?void 0:l.addTotalRows(r,s,e,t,i,"top"))??r;for(const c of a)r=this.depthFirstSearchRowNodes(e,t,n,c,r);return(l==null?void 0:l.addTotalRows(r,s,e,t,i,"bottom"))??r}}return r}doAggregate(e){var n;const t=this.rootNode;t&&((n=this.beans.aggStage)==null||n.execute({rowNode:t,changedPath:e}))}doFilterAggregates(e){const t=this.rootNode,n=this.beans.filterAggStage;if(n){n.execute({rowNode:t,changedPath:e});return}t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const n=this.beans.sortStage;if(n){n.execute({rowNode:this.rootNode,changedRowNodes:e,changedPath:t});return}t.forEachChangedNodeDepthFirst(s=>{s.childrenAfterSort=s.childrenAfterAggFilter.slice(0),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 r=t._leafs;t.childrenAfterGroup=r,t.updateHasChildren();const i=t.sibling;i&&(i.childrenAfterGroup=r)}(s||e.rowDataUpdated)&&((o=this.beans.colFilter)==null||o.refreshModel()),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;if(t){t.execute({rowNode:this.rootNode,changedPath:e});return}e.forEachChangedNodeDepthFirst(n=>{n.childrenAfterFilter=n.childrenAfterGroup,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(d0)===0?(o=this.beans.groupStage)==null?void 0:o.getNode(e):void 0}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const n=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),n)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var a;const{nodeManager:e,beans:t,eventSvc:n,asyncTransactions:s}=this;if(!e)return;(a=t.valueCache)==null||a.onDataChanged();const o=[],r=[],i=new py;for(const{rowDataTransaction:l,callback:c}of s??[]){this.rowNodesCountReady=!0;const u=e.updateRowData(l,i);o.push(u),c&&r.push(c.bind(null,u))}this.commitTransactions(i),r.length>0&&setTimeout(()=>{for(let l=0,c=r.length;l<c;l++)r[l]()},0),o.length>0&&n.dispatchEvent({type:"asyncTransactionsFlushed",results:o}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){var o;const t=this.nodeManager;if(!t)return null;(o=this.beans.valueCache)==null||o.onDataChanged(),this.rowNodesCountReady=!0;const n=new 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 r=n[s];r.data&&e.push(r),r.group&&TB(e,r)}};function Mye(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function Nye(e,t){const n=pl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function Lye(e){var t;return((t=pl(e))==null?void 0:t.isEmpty())??!0}function Vye(e,t){var n;(n=pl(e))==null||n.forEachLeafNode(t)}function Bye(e,t){var n;(n=pl(e))==null||n.forEachNodeAfterFilter(t)}function $ye(e,t){var n;(n=pl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function Hye(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=pl(e))==null?void 0:n.updateRowData(t)})}function Gye(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var s;return(s=pl(e))==null?void 0:s.batchUpdateRowData(t,n)})}function Uye(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=pl(e))==null?void 0:t.flushAsyncTransactions()})}function Wye(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var IB={moduleName:"ClientSideRowModel",version:ct,rowModels:["clientSide"],beans:[Oye,Fye],dependsOn:[L2]},zye={moduleName:"ClientSideRowModelApi",version:ct,apiFunctions:{onGroupExpandedOrCollapsed:Mye,refreshClientSideRowModel:Nye,isRowDataEmpty:Lye,forEachLeafNode:Vye,forEachNodeAfterFilter:Bye,forEachNodeAfterFilterAndSort:$ye,applyTransaction:Hye,applyTransactionAsync:Gye,flushAsyncTransactions:Uye,getBestCostNodeSelection:Wye,resetRowHeights:_B,onRowHeightChanged:EB},dependsOn:[wye,Cye]},jye=class extends We{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel}serialize(e,t={}){const{allColumns:n,columnKeys:s,skipRowGroups:o,exportRowNumbers:r}=t,i=this.getColumnsToExport({allColumns:n,skipRowGroups:o,columnKeys:s,exportRowNumbers:r});return[this.prepareSession(i),this.prependContent(t),this.exportColumnGroups(t,i),this.exportHeaders(t,i),this.processPinnedTopRows(t,i),this.processRows(t,i),this.processPinnedBottomRows(t,i),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,n,s){var p;const o=t.shouldRowBeSkipped||(()=>!1),i=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!i,l=this.colModel.isPivotMode()?s.leafGroup:!s.group,c=!!s.footer,u=s.allChildrenCount===1&&((p=s.childrenAfterGroup)==null?void 0:p.length)===1&&qoe(this.gos,s);if(!l&&!c&&(t.skipRowGroups||u||a)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.stub||s.level===-1&&!l&&!c||o(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,r=o?o.createColumnGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(r,n,e.processGroupHeaderCallback)}return n}}exportHeaders(e,t){return n=>{if(!e.skipColumnHeaders){const s=n.onNewHeaderRow();t.forEach((o,r)=>{s.onColumn(o,r,void 0)})}return n}}processPinnedTopRows(e,t){return n=>{var o,r;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="top").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedTopRow(i.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("top",s),n}}processRows(e,t){return n=>{var c;const s=this.rowModel,o=os(this.gos),r=ld(this.gos),i=!o&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(u=>u.rowPinned==null).sort((u,d)=>u.rowIndex-d.rowIndex).map(u=>s.getRow(u.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())o?s.forEachPivotNode(a,!0,l==="filteredAndSorted"):r?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||i){const u=((c=this.beans.selectionSvc)==null?void 0:c.getSelectedNodes())??[];this.replicateSortedOrder(u),u.forEach(a)}else l==="all"?s.forEachNode(a):o||r?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return n}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:n}=this.beans;if(!t||!n)return;const s=t.getSortOptions(),o=(r,i)=>{var a,l;return r.rowIndex!=null&&i.rowIndex!=null?r.rowIndex-i.rowIndex:r.level===i.level?((a=r.parent)==null?void 0:a.id)===((l=i.parent)==null?void 0:l.id)?n.compareRowNodes(s,{rowNode:r,currentPos:r.rowIndex??-1},{rowNode:i,currentPos:i.rowIndex??-1}):o(r.parent,i.parent):r.level>i.level?o(r.parent,i):o(r,i.parent)};e.sort(o)}processPinnedBottomRows(e,t){return n=>{var o,r;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="bottom").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedBottomRow(i.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("bottom",s),n}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:n=!1,exportRowNumbers:s=!1,columnKeys:o}=e,{colModel:r,gos:i,visibleCols:a}=this,l=r.isPivotMode(),c=h=>ua(h)?!1:!da(h)||s;if(o!=null&&o.length)return r.getColsForKeys(o).filter(c);const u=i.get("treeData");let d=[];return t&&!l?d=r.getCols():d=a.allCols,d=d.filter(h=>c(h)&&(n&&!u?!LE(h):!0)),d}recursivelyAddHeaderGroups(e,t,n){const s=[];for(const o of e){const r=o;if(r.getChildren)for(const i of r.getChildren()??[])s.push(i)}e.length>0&&rs(e[0])&&this.doAddHeaderHeader(t,e,n),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,n)}doAddHeaderHeader(e,t,n){const s=e.onNewHeaderGroupingRow();let o=0;for(const r of t){const i=r;let a;n?a=n(Ft(this.gos,{columnGroup:i})):a=this.beans.colNames.getDisplayNameForColumnGroup(i,"header");const c=(i.isExpandable()?i.getLeafColumns():[]).reduce((u,d,h,f)=>{let p=Tn(u);return d.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],u.push(p)):p&&p[1]==null&&(p[1]=h-1),h===f.length-1&&p&&p[1]==null&&(p[1]=h),u},[]);s.onColumn(i,a||"",o++,i.getLeafColumns().length-1,c)}}},Kye={moduleName:"SharedExport",version:ct,beans:[jye]},xB=`\r
|
|
258
|
-
`,qye=class extends Ege{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():(Je(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=xB),this.isFirstLine=!1}},Yye=class extends Sge{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){Je(51);return}const t=this.getMergedParams(e),n=this.getData(t),s=new Blob(["\uFEFF",n],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(Ft(this.gos,{})):t.fileName;_ge(this.getFileName(o),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:s,valueSvc:o,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new qye({colModel:t,colNames:n,valueSvc:o,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:s})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function Zye(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function Xye(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var Jye={moduleName:"CsvExport",version:ct,beans:[Yye],apiFunctions:{getDataAsCsv:Zye,exportDataAsCsv:Xye},dependsOn:[Kye]},Qye=class extends We{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:s,rowNodes:o}=this;for(let r=0;r<e;r++){const i=n+r,a=new cl(s);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),o.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:s}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:s}}}setDataAndId(e,t,n){dt(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Vn(this.params.datasource.getRows)){Je(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:s,filterModel:o},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:s,filterModel:o,context:Ft(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((s,o)=>{this.startRow+o<n&&e(s,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((o,r)=>{const i=e.rowData?e.rowData[r]:void 0;!o.id&&o.alreadyRendered&&i&&(t[r]=new cl(n),t[r].setRowIndex(o.rowIndex),t[r].setRowTop(o.rowTop),t[r].setRowHeight(o.rowHeight),o.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const s=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,s)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},ewe=2,twe=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 Qye(e,this,t));return this.blocks[n.id]=n,this.blockCount++,this.purgeBlocksIfNeeded(n),t.rowNodeBlockLoader.addBlock(n),n}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(sl(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(i=>i!=e),n=(i,a)=>a.lastAccessed-i.lastAccessed;t.sort(n);const s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,r=ewe-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,c=s?a>=o:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(i)||this.isBlockFocused(i))return;this.removeBlockFromCache(i)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:s}=e;return t.rowIndex>=n&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:s}=this.params,r=(e.id+1)*n+s;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,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 r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(o&&s+1!==l.id){i=!0;continue}s=l.id,l.forEachNode(c=>{const u=c===e||c===t;(o||u)&&n.push(c),u&&(o=!o)},r,this.rowCount)}return i||o?[]:n}},nwe=class extends We{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new cl(e);this.rootNode=t,t.level=-1,this.rowHeight=vc(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=vc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Of(this.cacheParams.sortModel,((t=this.beans.sortSvc)==null?void 0:t.getSortModel())??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){var n;return((n=this.infiniteCache)==null?void 0:n.getRowNodesInRange(e,t))??[]}reset(){var n;if(!this.datasource)return;ud(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:s,eventSvc:o,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:s,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:vc(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new twe(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 swe(e){var t;(t=Sy(e))==null||t.refreshCache()}function owe(e){var t;(t=Sy(e))==null||t.purgeCache()}function rwe(e){var t;return(t=Sy(e))==null?void 0:t.getRowCount()}var iwe=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=Yoe(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Os(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){$r(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){sl(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:s}=t.getBlockStateJson();e[n]=s}),e}printCacheStatus(){sl(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},awe={moduleName:"InfiniteRowModelCore",version:ct,rowModels:["infinite"],beans:[nwe,iwe]},lwe={moduleName:"InfiniteRowModel",version:ct,apiFunctions:{refreshInfiniteCache:swe,purgeInfiniteCache:owe,getInfiniteRowCount:rwe},dependsOn:[awe,bye]},cwe="↑",uwe="↓",dwe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},hwe=class extends Cn{constructor(){super(dwe),this.eValue=ut,this.eDelta=ut,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,r=t>=0,i=this.eDelta;r?i.textContent=cwe+o:i.textContent=uwe+o,i.classList.toggle("ag-value-change-delta-up",r),i.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),ks(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:s}=e,{eValue:o,lastValue:r,beans:i}=this;if(n===r||(dt(s)?o.textContent=s:dt(n)?o.textContent=n:ks(o),(c=i.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=r&&typeof r=="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return r&&o.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},fwe=".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}",pwe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},gwe=class extends Cn{constructor(){super(pwe),this.eCurrent=ut,this.refreshCount=0,this.registerCSS(fwe)}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=is({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=s,s.textContent=n.textContent,this.getGui().insertBefore(s,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var r;e===this.refreshCount&&((r=this.ePrevious)==null||r.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var o;let n=e.value;if(Vn(n)&&(n=""),n===this.lastValue||(o=this.beans.filterManager)!=null&&o.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const s=this.eCurrent;return dt(e.valueFormatted)?s.textContent=e.valueFormatted:dt(e.value)?s.textContent=n:ks(s),!0}},mwe=class extends We{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),s=this.beans.gos.get("cellFadeDuration")){const o=this.animations[t];o.delete(e);const r=Date.now(),i=r+n,a=r+n+s,l={phase:"flash",flashEndTime:i,fadeEndTime:a};o.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&i+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=i)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const s=this.animations[n],o=`ag-cell-${n}`,r=`${o}-animation`;for(const[i,a]of s){if(!i.isAlive()||!i.comp){s.delete(i);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=i;switch(l){case"flash":f.toggleCss(o,!1),f.toggleCss(r,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(o,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),s.delete(i);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=gue(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 vwe(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 ywe={moduleName:"HighlightChanges",version:ct,beans:[mwe],userComponents:{agAnimateShowChangeCellRenderer:hwe,agAnimateSlideCellRenderer:gwe},apiFunctions:{flashCells:vwe}};function wwe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Cwe(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=bwe(e)),e.version=ct,e}function bwe(e){return e.cellSelection=Swe(e,"rangeSelection"),e}function Swe(e,t){if(e&&typeof e=="object")return e[t]}var Ewe=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 r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(s))),(s.columnOrder||s.columnVisibility||s.columnSizing||s.columnPinning||s.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(s,!!o),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(s))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(s))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=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:r,rowSelection:i,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",s)&&this.setFilterState(s),l("rowGroupExpansion",o)&&this.setRowGroupExpansionState(r,o,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},s=()=>t("filter",this.getFilterState()),{gos:o,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:s,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(o.get("groupDefaultExpanded")!==0||o.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:i=>{(i.newPage||i.newPageSize)&&t("pagination",this.getPaginationState())}}),r&&this.addManagedListeners(r,{filterStateChanged:s})}setFirstDataRenderedState(e,t,n){const{scroll:s,cellSelection:o,focusedCell:r,columnOrder:i,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",o)&&this.setCellSelectionState(o),l("scroll",s)&&this.setScrollState(s),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:s=>{if(s.finished){const o=this.getRangeSelectionState();t("rangeSelection",o),t("cellSelection",o)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return wge(zv(e),e.colModel.isPivotMode())}setColumnState(e,t,n,s){const{sort:o,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(E,A)=>{const k=!(s!=null&&s.has(E))&&!!(A||t==="api");return h||(h=k),k},p={},g=E=>{let A=p[E];return A||(A={colId:E},p[E]=A,A)},v={},C=f("sort",o);C&&(o==null||o.sortModel.forEach(({colId:E,sort:A},k)=>{const M=g(E);M.sort=A,M.sortIndex=k})),(C||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((E,A)=>{const k=g(E);k.rowGroup=!0,k.rowGroupIndex=A})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:E,aggFunc:A})=>{g(E).aggFunc=A})),(b||!n)&&(v.aggFunc=null);const w=f("pivot",a);w&&(a==null||a.pivotColIds.forEach((E,A)=>{const k=g(E);k.pivot=!0,k.pivotIndex=A}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(w||!n)&&(v.pivot=null,v.pivotIndex=null);const D=f("columnPinning",l);if(D){for(const E of(l==null?void 0:l.leftColIds)??[])g(E).pinned="left";for(const E of(l==null?void 0:l.rightColIds)??[])g(E).pinned="right"}(D||!n)&&(v.pinned=null);const R=f("columnVisibility",c);if(R)for(const E of(c==null?void 0:c.hiddenColIds)??[])g(E).hide=!0;(R||!n)&&(v.hide=null);const T=f("columnSizing",u);if(T)for(const{colId:E,flex:A,width:k}of(u==null?void 0:u.columnSizingModel)??[]){const M=g(E);M.flex=A??null,M.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")),F=x?I.map(E=>g(E)):Object.values(p);(F.length||h)&&(this.columnStates=F,Hr(this.beans,{state:F,applyOrder:x,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const s=this.columnGroupStates;this.columnGroupStates=void 0;const o=this.beans,{pivotResultCols:r,colGroupSvc:i}=o;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);Hr(o,{state:a,applyOrder:e},t)}s&&(i==null||i.setColumnGroupState(s,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Cge(t)}setColumnGroupState(e,t,n){var a;const s=this.beans.colGroupSvc;if(!s||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const o=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=s.getColumnGroupState().map(({groupId:l})=>{const c=o.has(l);return c&&o.delete(l),{groupId:l,open:c}});for(const l of o)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),s.setColumnGroupState(i,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),s=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||s||n?{filterModel:t,columnFilterState:n,advancedFilterModel:s}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:s,advancedFilterModel:o}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||s!==void 0)&&(t==null||t.setFilterState(n??null,s??null,"columnFilter")),o!==void 0&&(t==null||t.setAdvFilterModel(o??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:s,type:o,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:s,type:o,startRow:r,endRow:i,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:s,visibleCols:o}=this.beans;if(!la(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of i.colIds){const u=s.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=s.getCol(i.startColId);if(!l){const c=o.allCols,u=new Set(a);l=c.find(d=>u.has(d))}r.push({...i,columns:a,startColumn:l})}n.setCellRanges(r)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:s,rowRenderer:o,animationFrameSvc:r,ctrlsSvc:i}=this.beans;s.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),o.redraw({afterScroll:!0}),r==null||r.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:s,rowIndex:o,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(s),rowIndex:o,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),s=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!s))return{page:n,pageSize:s}}setPaginationState(e,t){const{pagination:n,gos:s}=this.beans;if(!n)return;const{pageSize:o,page:r}=e??{page:0,pageSize:s.get("paginationPageSize")},i=t==="gridInitializing";o&&!s.get("paginationAutoPageSize")&&n.setPageSize(o,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var s;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((s=t==null?void 0:t.toggledNodes)!=null&&s.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const s=this.beans.expansionSvc;if(!s)return;const o=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};s.setExpansionState(o,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const s=this.cachedState;for(const o of Object.keys(t)){const r=t[o];Of(r,s[o])||(n=!0)}this.cachedState={...s,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Of(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")}},_we={moduleName:"GridState",version:ct,beans:[Ewe],apiFunctions:{getState:wwe,setState:Cwe}};function Rwe(e){return e.rowModel.isLastRowIndexKnown()}function Dwe(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Twe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function Iwe(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function xwe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function Fwe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function Pwe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function Awe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function kwe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Owe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var Mwe=class extends We{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const s=Math.max(vc(t),1),o=Math.floor(e/s);t.pagination.setPageSize(o,"autoCalculated")};this.isBodyRendered?Os(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},mp="paginationPageSizeSelector",Nwe={tag:"span",cls:"ag-paging-page-size"},Lwe=class extends Cn{constructor(){super(Nwe),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(mp,()=>{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(mp)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const o=this.gos.exists("paginationPageSize"),r=this.gos.get(mp)!==!0;Je(94,{pageSizeSet:o,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Je(95,{paginationPageSizeOption:t,paginationPageSizeSelector:mp}),e.unshift("")}const s=String(n?"":t);this.selectPageSizeComp?(il(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(s,!0)):this.createPageSizeSelectorComp(e,s),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),s=n("pageSizeSelectorLabel","Page Size:"),o=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new r0).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(mp);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,s)=>n-s)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},Vwe={selector:"AG-PAGE-SIZE-SELECTOR",component:Lwe},Bwe=".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}",$we=class extends HV{constructor(){super(),this.btFirst=ut,this.btPrevious=ut,this.btNext=ut,this.btLast=ut,this.lbRecordCount=ut,this.lbFirstRowOnPage=ut,this.lbLastRowOnPage=ut,this.lbCurrent=ut,this.lbTotal=ut,this.pageSizeComp=ut,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(Bwe)}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(),[Vwe]);const{btFirst:t,btPrevious:n,btNext:s,btLast:o}=this;this.activateTabIndex([t,n,s,o]),t.insertAdjacentElement("afterbegin",hr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",hr(e?"next":"previous",this.beans)),s.insertAdjacentElement("afterbegin",hr(e?"previous":"next",this.beans)),o.insertAdjacentElement("afterbegin",hr(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(r):Mle(this.beans,r),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:s=>{(s.key===Oe.ENTER||s.key===Oe.SPACE)&&(s.preventDefault(),n())}})}Ole(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}):bge(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){Yse(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),s=e?n:null,o=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*o+1,a=i+r-1,e&&a>s&&(a=s));const l=i+r-1,c=!e&&n<l,u=this.formatNumber(i);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?o+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,C;if(e)v=this.formatNumber(t),C=this.formatNumber(s);else{const S=h("more","more");v=S,C=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=C,this.announceAriaStatus(u,d,C,g,v)}announceAriaStatus(e,t,n,s,o){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${i} ${s} ${l} ${o}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},Hwe={selector:"AG-PAGINATION",component:$we},Gwe=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 Hwe}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,r=n*o;let i=n*(o+1)-1;if(i>s&&(i=s),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===s)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,s=e-1;this.totalPages=Math.floor(s/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>s&&(this.bottomDisplayedRowIndex=s)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:s=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:s,keepRenderedRows:t})}},Uwe={moduleName:"Pagination",version:ct,beans:[Gwe,Mwe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:Rwe,paginationGetPageSize:Dwe,paginationGetCurrentPage:Twe,paginationGetTotalPages:Iwe,paginationGetRowCount:xwe,paginationGoToNextPage:Fwe,paginationGoToPreviousPage:Pwe,paginationGoToFirstPage:Awe,paginationGoToLastPage:kwe,paginationGoToPage:Owe},dependsOn:[Ey]};function Wwe(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 zwe(e,t){return e.rowModel.getRowNode(t)}function jwe(e,t,n,s){e.rowRenderer.addRenderedRowListener(t,n,s)}function Kwe(e){return e.rowRenderer.getRenderedNodes()}function qwe(e,t,n){e.rowModel.forEachNode(t,n)}function Ywe(e){return e.rowRenderer.firstRenderedRow}function Zwe(e){return e.rowRenderer.lastRenderedRow}function Xwe(e,t){return e.rowModel.getRow(t)}function Jwe(e){return e.rowModel.getRowCount()}var Qwe={moduleName:"RowApi",version:ct,apiFunctions:{redrawRows:Wwe,setRowNodeExpanded:PB,getRowNode:zwe,addRenderedRowListener:jwe,getRenderedNodes:Kwe,forEachNode:qwe,getFirstDisplayedRowIndex:Ywe,getLastDisplayedRowIndex:Zwe,getDisplayedRowAtIndex:Xwe,getDisplayedRowCount:Jwe}},eCe={moduleName:"ScrollApi",version:ct,apiFunctions:{getVerticalPixelRange:fve,getHorizontalPixelRange:pve,ensureColumnVisible:hB,ensureIndexVisible:fB,ensureNodeVisible:gve}};function tCe(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 nCe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function sCe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function oCe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function rCe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function iCe(e){return{rowHeight:vc(e),headerHeight:sp(e)}}function aCe(e,t={}){var r;const n=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=i.getCellRenderer();a!=null&&n.push(ep(a))}if((r=t.columns)!=null&&r.length)return n;const s=[],o=n_(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(o&&!s_(i.rowNode,o)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&s.push(ep(c))}}return[...s,...n]}var lCe={moduleName:"RenderApi",version:ct,apiFunctions:{setGridAriaProperty:tCe,refreshCells:nCe,refreshHeader:sCe,isAnimationFrameQueueEmpty:oCe,flushAllAnimationFrames:rCe,getSizesForCurrentTheme:iCe,getCellRendererInstances:aCe}};function cCe(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 uCe(e,t){var n;t&&typeof t=="object"?AB(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var dCe=class extends We{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");s=r!=null&&r.length>0&&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 c;const o=u=>fd(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return o(s);const r=kB(this.beans),i=u=>n.leftCols.some(d=>Xf(d,u)),a=u=>n.rightCols.some(d=>Xf(d,u)),l=e.colKeys.filter(u=>!ua(u)&&!da(u)&&!i(u)&&!a(u));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),o(s)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:s,skipHeader:o,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let C=-1;const S=Object.fromEntries(c.map(({colId:D,...R})=>[D,R])),b=o??this.gos.get("skipHeaderOnAutoSize"),w=r??b;for(;C!==0;){C=0;const D=[];for(const R of s){if(!R||lre(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 F=hCe(T,I,x);T.setActualWidth(F,u),v.add(T),C++}D.push(T)}D.length&&g.refresh(u)}w||this.autoSizeColumnGroupsByColumns(s,u,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:s,ctrlsSvc:o}=this.beans,r=new Set,i=s.getColsForKeys(e);for(const l of i){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||r.add(c),c=c.getParent()}let a;for(const l of r){for(const c of o.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),s=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",s);const o=new Tc(e);return o.addEventListener("doubleTap",s),()=>{e.removeEventListener("dblclick",s),o.destroy()}}addColumnGroupResize(e,t,n){const s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{const r=[],i=t.getDisplayedLeafColumns();for(const a of i)a.getColDef().suppressAutoSize||r.push(a.getColId());r.length>0&&this.autoSizeCols({colKeys:r,skipHeader:s,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",o),()=>e.removeEventListener("dblclick",o)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=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):Je(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,s){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,s));return}const o={};for(const{key:v,...C}of(s==null?void 0:s.columnLimits)??[])o[typeof v=="string"?v:v.getColId()]=C;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=ca(r);if(s!=null&&s.onlyScaleUp&&i>e||e===i&&r.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const S=o==null?void 0:o[C.getId()],b=(S==null?void 0:S.minWidth)??(s==null?void 0:s.defaultMinWidth),w=(S==null?void 0:S.maxWidth)??(s==null?void 0:s.defaultMaxWidth),D=C.getActualWidth();return(b==null||D>=b)&&(w==null||D<=w)}))return;const l=[],c=[];for(const v of r){const C=((p=s==null?void 0:s.colKeys)==null?void 0:p.some(S=>Xf(v,S)))??!0;v.getColDef().suppressSizeToFit||!C?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{$r(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const C=o==null?void 0:o[v.getId()],S=(C==null?void 0:C.minWidth)??(s==null?void 0:s.defaultMinWidth),b=(C==null?void 0:C.maxWidth)??(s==null?void 0:s.defaultMaxWidth),w=v.getActualWidth();typeof S=="number"&&w<S?v.setActualWidth(S,t,!0):typeof b=="number"&&w>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-ca(c);if(v<=0)for(const C of l){const S=((g=o==null?void 0:o[C.getId()])==null?void 0:g.minWidth)??(s==null?void 0:s.defaultMinWidth)??C.minWidth;C.setActualWidth(S,t,!0)}else{const C=v/ca(l);let S=v;for(let b=l.length-1;b>=0;b--){const w=l[b],D=o==null?void 0:o[w.getId()],R=(D==null?void 0:D.minWidth)??(s==null?void 0:s.defaultMinWidth),T=(D==null?void 0:D.maxWidth)??(s==null?void 0:s.defaultMaxWidth),I=w.getMinWidth(),x=w.getMaxWidth(),F=typeof R=="number"&&R>I?R:I,E=typeof T=="number"&&T<x?T:x;let A=Math.round(w.getActualWidth()*C);A<F?(A=F,h(w),d=!1):A>E?(A=E,h(w),d=!1):b===0&&(A=S),w.setActualWidth(A,t,!0),S-=A}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&fd(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const s=n.type;if(s==="fitGridWidth"){const{columnLimits:o,defaultMinWidth:r,defaultMaxWidth:i}=n,a=o==null?void 0:o.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else s==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(s)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var s;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(s=this.beans.colDelayRenderSvc)==null||s.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function hCe(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 Bf(n.eGridBody)-o}var fCe={moduleName:"ColumnAutoSize",version:ct,beans:[dCe],apiFunctions:{sizeColumnsToFit:cCe,autoSizeColumns:AB,autoSizeAllColumns:uCe},dependsOn:[o2]},pCe=".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 gCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function mCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function vCe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function yCe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function wCe(e,t,n){var s;return(s=e.pinnedRowModel)==null?void 0:s.forEachPinnedRow(t,n)}var CCe={moduleName:"PinnedRow",version:ct,beans:[vce],css:[pCe],apiFunctions:{getPinnedTopRowCount:gCe,getPinnedBottomRowCount:mCe,getPinnedTopRow:vCe,getPinnedBottomRow:yCe,forEachPinnedRow:wCe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},bCe=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}},SCe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:s,rowModel:o,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const C=(w,D)=>{p=w,g=null,v=D},S=w=>{const D=!w.isExpandable()&&!w.group&&!w.detail&&(u?!u({rowNode:w}):!0);if(w.rowIndex==null||!D){C(null,null);return}if(p==null||w.level!==p.level||w.footer||g&&w.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){C(w,r.getValue(t,w));return}const R=r.getValue(t,w);if(f){const T=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 bCe(t,p),c.set(p,g)}g.addSpannedNode(w),c.set(w,g)};switch(e){case"center":(b=o.forEachDisplayedNode)==null||b.call(o,w=>{(!i||i.isRowInPage(w.rowIndex))&&S(w)}),this.centerValueNodeMap=c;break;case"top":s==null||s.forEachPinnedRow("top",S),this.topValueNodeMap=c;break;case"bottom":s==null||s.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},ECe=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 SCe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,s=e.column,o=e.rowIndex,r=this.spanningColumns.get(s);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(o);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(o);break;default:i=n.getRow(o)}if(i)return r.getCellSpan(i)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,s]of this.spanningColumns)if(s.isCellSpanning(e)){const o=s.getCellSpan(e);t(n,o)}}destroy(){super.destroy(),this.spanningColumns.clear()}},_Ce=class extends Rd{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,s,o,r,i){this.eWrapper=n,super.setComp(e,t,n,s,o,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||Rv(e,t.rowIndex)}setAriaRowSpan(){eoe(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}},RCe=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 _Ce(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(){}},DCe=class extends We{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),s=n.size,o=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of o)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(r.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){r.set(u.firstNode,d),n.delete(u.firstNode);return}i=!0;const h=new RCe(u.firstNode,this.beans,!1,!1,!1);r.set(u.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===s;if(!(!i&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const s=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(s)return s.getAllCellCtrls().find(o=>o.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},TCe={moduleName:"CellSpan",version:ct,beans:[ECe,DCe]},ICe=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);e_(this.beans.expressionSvc,s===this.cellClassRules?void 0:this.cellClassRules,s,o,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=s}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let s;if(typeof n=="function"){const o=this.getCellClassParams(e,t);s=n(o)}else s=n;s&&this.cellComp.setUserStyles(s)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,s=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const o=this.beans.cellStyles.getStaticCellClasses(n,s);this.staticClasses=o;for(const r of o)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:s}=this.cellCtrl;return Ft(this.beans.gos,{value:n,data:s.data,node:s,colDef:t,column:e,rowIndex:s.rowIndex})}},xCe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,s){e_(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 ICe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(o=>{n(o)})}},FCe={moduleName:"CellStyle",version:ct,beans:[xCe]},PCe={moduleName:"RowStyle",version:ct,beans:[vpe]};function ACe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var kCe=class extends We{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:s,gos:o,element:r,columns:i}=this,a=s.colHover;if(n??!!o.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},OCe="ag-column-hover",MCe=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(OCe,n)}addHeaderFilterColumnHoverListener(e,t,n,s){this.createHoverFeature(e,[n],s);const o=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:o}),o()}createHoverFeature(e,t,n){e.createManagedBean(new kCe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},NCe={moduleName:"ColumnHover",version:ct,beans:[MCe],apiFunctions:{isColumnHovered:ACe}},LCe=class extends We{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var r;const n=((r=this.wrapSvc)==null?void 0:r.wrap(e,t))??t,s=!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 r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,s=this.asyncListeners.get(e),o=!!(s!=null&&s.delete(n));o||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,o)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{yy.has(i)&&t(i,a)},s=(i,a)=>{yy.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:s});const o=this.eventSvc;o.addGlobalListener(n,!1),o.addGlobalListener(s,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:s}=this,o=(n==null?void 0:n.unwrapGlobal(e))??e;if(s.has(o)){const{syncListener:i,asyncListener:a}=s.get(o);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),s.delete(e)}else this.syncGlobalListeners.delete(o),t.removeGlobalListener(o,!1)}destroyEventListeners(e,t){e.forEach((n,s)=>{n.forEach(o=>this.eventSvc.removeListener(s,o,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:s})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(s,!0)}),e.clear()}};function VCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.addListener(t,n)}function BCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.removeListener(t,n)}function $Ce(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function HCe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var GCe={moduleName:"EventApi",version:ct,apiFunctions:{addEventListener:VCe,addGlobalListener:$Ce,removeEventListener:BCe,removeGlobalListener:HCe},beans:[LCe]},UCe={moduleName:"Locale",version:ct,beans:[yge]},WCe=class extends We{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Os(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:s}=this.beans,o=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=ol(this.beans,d).height;for(const g of o){let v=h==null?void 0:h[g.getColId()];const C=n==null?void 0:n.getCellSpan(g,d);if(C){if(C.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),r=!0)};(a=s==null?void 0:s.forEachPinnedRow)==null||a.call(s,"top",i),(l=s==null?void 0:s.forEachPinnedRow)==null||l.call(s,"bottom",i),(c=t.forEachDisplayedNode)==null||c.call(t,i),r&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const s=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,s!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:s,visibleCols:o}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=o.getLeftColsForRow(t);break;case"right":r=o.getRightColsForRow(t);break;case null:r=s.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const s=t.parentElement,{rowNode:o,column:r}=e,i=this.beans,a=u=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=gc(s),g=d+h+f+p,C=t.offsetHeight+g;if(u<5){const b=Ds(i),w=!(b!=null&&b.contains(t)),D=C==0;if(w||D){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(o,C,r)},l=()=>a(0);l();const c=tl(i,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(o,void 0,r)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(o=>o.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const s of t){const o=n.__autoHeights[s.getColId()];if(!o||n.rowHeight<o)return!1}}return!0}},zCe={moduleName:"RowAutoHeight",version:ct,beans:[WCe]},jCe={moduleName:"AllCommunity",version:ct,dependsOn:[IB,Jye,lwe,Nge,jve,Kve,qve,Yve,Zve,Xve,Jve,zve,Vme,Bme,$me,Lme,Gme,Ume,_we,Eye,Uwe,l2,Qwe,eCe,lCe,fCe,Pue,CCe,fye,Qpe,FCe,NCe,PCe,GCe,nge,ywe,cB,UCe,zCe,Fue,zye,TCe]};let OB=!1;OB||(Voe.registerModules([jCe,IB]),OB=!0);class KCe{constructor(t,n){Qn(this,"gridApi",null);Qn(this,"container");Qn(this,"config");Qn(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:s,onRowSelected:o,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{s&&s(a)},onRowSelected:a=>{o&&o(a)}};return this.gridApi=pge(this.container,i),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const s={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const s={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(s=>{var o;(o=this.gridApi)==null||o.removeEventListener(n,s)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const qCe=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"),YCe=ot({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const s=e,o=n,r=B(null);Qb(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=B(null),a=q(()=>({width:"100%",height:s.height||"500px"})),l=q(()=>({...s,theme:qCe}));function c(){if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:s.height};i.value=new KCe(r.value,g),i.value.init(),u()}function u(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;o("onGridReady",g)}function d(g){var C,S;if(!g)return;(C=i.value)==null||C.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width}:null).filter(b=>b!==null);(S=i.value)==null||S.setColumnWidth(v)}function h(){var g;(g=i.value)==null||g.destroy(),i.value=null}function f(){var g;return((g=i.value)==null?void 0:g.getApi())||void 0}function p(){return i.value||null}return et(()=>s.columnDefs,(g,v)=>{const C=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");C!==S&&d(g)},{deep:!0}),ms(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),rn(()=>{c()}),ms(()=>{h()}),(g,v)=>(z(),ce("div",{ref_key:"gridContainerRef",ref:r,style:hn(a.value),class:Q(["ag-theme-quartz",["ag-table-container",s.isSorting?"is-sorting":""]])},null,6))}});function Fd(e){return fN(e)}const ZCe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:Fd(ac),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!1},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:Fd(ac)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:Fd(ac)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:Fd(ac)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:Fd(ac),cellRendererParams:n=>{var s,o,r;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated.value,tooltip:((r=(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:Fd(ac),cellRendererParams:n=>{var s,o,r;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.completedOn.value,tooltip:((r=(o=n==null?void 0:n.data)==null?void 0:o.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>kf.fromType(n))],xy={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},XCe={field:"blank",headerName:"",flex:1,editable:!1,sortable:!1,filter:!1,cellClass:"ag-cell-optimized",suppressMovable:!0,suppressNavigable:!0,suppressAutoSize:!1,suppressSizeToFit:!1},JCe=()=>({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(fJ),suppressMovable:!0}),QCe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},ebe=(e,t,n)=>{const{getCachedValue:s,setCachedValue:o}=Rh({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const u=await s(t);if(u&&typeof u=="string")try{return JSON.parse(u)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},i=B([]),a=JCe(),l=async u=>{const d=await r(),h=new Map;d==null||d.forEach(A=>{A.width&&h.set(A.field,A.width)});const f=ZCe(),p=kf.fromType(QCe),v=((u==null?void 0:u.map(A=>{var k;return{headerName:A.name,field:`metric_${A.id}`,editable:((k=A==null?void 0:A.auth_permission)==null?void 0:k.permission)==2,sortable:!0,filter:!1,flex:1,context:{...A},hide:!(A.is_primary||A.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:_v(ac),headerComponentParams:M=>({headerType:A.metric_type.code=="number"||A.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${A.id}`)}}))||[]).map(A=>kf.fromType(A)),C=[a,...f,...v,XCe,p],S=C.filter(A=>A.pinned==="left"),b=C.filter(A=>A.pinned==="right"||A.field==="blank"),w=C.filter(A=>!A.pinned&&A.field!=="blank");if(!d||d.length===0){i.value=C;return}const D=new Map(d.map(A=>[A.field,A])),R=new Map(w.map(A=>[A.field,A])),T=[];for(const A of d)if(A.field&&R.has(A.field)){const k=R.get(A.field);T.push({...k,hide:A.hide,width:A.width}),R.delete(A.field)}const I=Array.from(R.values()),x=[...T,...I],F=S.map(A=>{const k=D.get(A.field);return k!=null&&k.width?{...A,width:k.width}:A}),E=b.map(A=>{const k=D.get(A.field);return k!=null&&k.width?{...A,width:k.width}:A});i.value=[...F,...x,...E]};et(e,u=>l(u),{immediate:!0});const c=Tr((u,d)=>{var C,S;if(u.source!==void 0)if(["uiColumnResized","uiColumnMoved","api"].indexOf(u.source)===-1){console.warn("Skipping saveColumnConfig for source:",u.source);return}else console.warn("Executing saveColumnConfig for source:",u.source);else console.warn("Executing saveColumnConfig for source:",u);const h=(C=n==null?void 0:n.value)==null?void 0:C.getColumnDefs(),f=(S=n==null?void 0:n.value)==null?void 0:S.getColumnState().reduce((b,w)=>(b[w.colId]=Number(w.width),b),{}),p=new Map;Object.entries(f||{}).forEach(([b,w])=>{p.set(b,w)}),i.value=h||i.value;const g=h==null?void 0:h.filter(b=>!b.pinned&&b.field!=="blank"),v=(g==null?void 0:g.map(b=>({field:b.field,hide:b.hide,width:p.get(b.field)||b.width,pinned:b.pinned})))||[];d&&o(t,JSON.stringify(v))},ai);return{columnDefs:i,checkboxColumn:a,saveColumnConfig:c}},tbe=()=>{const e=un.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},nbe=e=>{var A,k,M;const{showMessage:t,showErrorNetMessage:n}=gf(),s=es(),o={domainApi:tbe(),wsCode:un.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(M=(k=(A=s==null?void 0:s.appContext)==null?void 0:A.config)==null?void 0:k.globalProperties)==null?void 0:M.apiConfig;if(!r||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new Ok(r,o);i.on("call-api",O=>{O.success?t(O.apiCode,"success"):n(O)});const a=lo({}),l=B([]),c=B(!1),u=B(null),d=B(null),h=B(1),f=B(20);let p=Promise.resolve();const{setCachedUsers:g}=B9(),v=O=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:O}),C=50,S=async(O,W,X)=>{if(!O.length)return[];const J=J4(O,W);return(await Promise.all(J.map(X))).flat()},b=async O=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:O})).data.map(X=>[X==null?void 0:X.id,X.permission])}catch(W){return console.error("Failed to fetch item permissions chunk:",W),[]}},w=async(O,W)=>{try{const X=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:O,per_page:O.length*W.length,metric_ids:W}),J=X.data.map(ae=>{const ee=new Map(ae.item_metrics.map(G=>[G.metric_id,{value:G.value,auth_permission:G==null?void 0:G.auth_permission}])),V=Object.fromEntries(W.map(G=>[G,ee.get(G)??null]));return[ae==null?void 0:ae.id,V]}),ie=new Set(X.data.map(ae=>ae==null?void 0:ae.id));for(const ae of O)if(!ie.has(ae)){const ee=Object.fromEntries(W.map(V=>[V,{value:null,auth_permission:void 0}]));J.push([ae,ee])}return J}catch(X){return console.error("Failed to fetch a chunk of metric values:",X),O.map(ie=>[ie,Object.fromEntries(W.map(ae=>[ae,void 0]))])}},D=async O=>{try{const W=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:O,per_page:O.length}),X=W.data.flatMap(J=>J.assignees);return g(X),W.data.map(J=>[J==null?void 0:J.id,J==null?void 0:J.assignees])}catch(W){return console.error("Failed to fetch a chunk of assigned users:",W),[]}},R=async O=>{if(!O.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const W=await S(O,C,b);return Object.fromEntries(W)}catch(W){return console.error("Failed to fetch item permissions:",W),{}}},T=async(O,W)=>!O.length||!W.length?{}:(p=p.then(async()=>{try{const ie=[];let ae=0;for(let V=0;V<W.length;V+=5){ae++;const G=W.slice(V,V+5),te=[];for(let ve=0;ve<G.length;ve++){const re=G[ve],oe=await S(O,C,K=>w(K,[re]));te.push(oe),await new Promise(K=>setTimeout(K,500))}ie.push(...te);const pe=V+5>=W.length}const ee={};for(const V of ie.flat()){const[G,te]=V;ee[G]||(ee[G]={}),Object.assign(ee[G],te)}return ee}catch(X){return console.error("Failed to fetch metric values:",X),{}}}),p),I=async O=>{if(!O.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const W=await S(O,C,D);return Object.fromEntries(W)}catch(W){return console.error("Failed to fetch assigned users:",W),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async O=>{const{cursor:W,offset:X,size:J,searchQuery:ie}=O;let ae=[];c.value=!0,u.value=null;try{const ee=await i.getAllItem_cursor({...O,cursor:W||void 0,offset:X||void 0,pageSize:J||f.value,...v(ie),sortBy:O.sort_by});return l.value=ee.data,d.value=ee.meta,h.value=ee.meta.current_page||0,ae=ee.data.map(V=>V==null?void 0:V.id),ee}catch(ee){throw u.value=ee,console.error("Failed to fetch items (cursor):",ee),ee}finally{const ee=async()=>{try{const[V,G]=await Promise.all([I(ae),R(ae)]);e.value.updateItemData({assignees:V,permission:G},ae);const te=await T(ae,e.value.metricIds);e.value.setMetricValues(te,new Set(ae),e.value.metricIds)}catch(V){console.error("Post-fetch processing failed:",V)}};c.value=!1,setTimeout(ee)}},getAssignableStatus:async O=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:O})}catch(W){throw console.error("Failed to fetch assignable status:",W),W}},getMetricList:async O=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:O})}catch(W){throw console.error("Failed to fetch metric list:",W),W}},getMetricValues:T,getAssignedUsers:I}};function sbe(e){return{updateRowData:(s,o)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);o.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(r.push(u),s.assignees){const h=R9((s.assignees[c]||[]).map(RF));u.data.assignees=h,i.add("assignees")}s.permission&&(u.data.permissions=s.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),i.add("description"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(s,o,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(o).map(c=>[c,new Map(r.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(s).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=i.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&i.refreshCells({rowNodes:l,columns:Array.from(r).map(c=>`metric_${c}`),force:!0})}}}function obe(e,t,n,s,o){let r=!0;return{async getRows(i){try{s(!0),r&&(o(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,u),s(!1),o(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),s(!1),o(!1)}}}}function rbe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:s,gridApi:o,fetcher:r}=e,i=B(!0),a=B(!0),l=B(!1),c=()=>{n.value=!n.value},u=v=>{if(i.value=!1,o.value=v,!v)return null;const{addEventListener:C,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=obe(r,e.perPage,()=>s.value,w=>{i.value=w},w=>{a.value=w});return S==null||S("datasource",b),C==null||C("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var C,S;if((C=o.value)==null||C.hideOverlay(),v!==void 0&&(s.value=v),(S=o.value)==null||S.deselectAll(),t.value=[],i.value=!0,!o.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,o.value.purgeInfiniteCache(),o.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=o.value)==null||v.deselectAll(),t.value=[]},f=Tr(v=>{d(v)},ai),p=()=>{o.value},g=B(!1);return{isLoading:i,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const ibe={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."]}}},abe=e=>{var t;return(t=Object.entries(ibe.changelog).find(([n,s])=>n===e))==null?void 0:t[1].changes},lbe={key:1},cbe=Et(ot({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=B(null),o=e,r=()=>{s.value&&s.value.show()},i=B(""),a=B("idle"),l=B({file:null,format:null}),{apiServices:c}=ts(!1,{}),u=B(!1),d=async()=>{u.value=!0;const T=o.workspaceId,I=o.entityId;if(!T||!I||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(T,I))throw new Error("No response from downloadTemplate API")}catch(x){console.error("Error downloading template:",x)}u.value=!1},h=n,f=()=>{h("import-success"),S()},p=async T=>{var F,E,A;const I=new FormData,x=((F=T.name.split(".").pop())==null?void 0:F.toString())||"";if(I.append("file",T),I.append("format",x),I.append("entity_id",o.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,I),g()}catch(k){throw console.error("Error uploading file:",k),v(((A=(E=k.response)==null?void 0:E.data)==null?void 0:A.message)||"An unknown error occurred during file upload."),k}},g=()=>{a.value="success"},v=T=>{i.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:r});const b=q(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),w=q(()=>l.value.file?!1:(console.error("No file selected"),!0)),D=B(null),R=()=>{var T;(T=D.value)==null||T.clear(),i.value="",l.value={file:null,format:null},a.value="idle"};return(T,I)=>(z(),je(H(Gk),{"popup-name":b.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:R},nh({default:ge(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(z(),je(aN,{key:0,state:a.value,"error-message":i.value,overwrite:!0},null,8,["state","error-message"])):(z(),ce("div",lbe,[be("div",{class:Q(T.$style["step-section"])},[be("span",{class:Q(T.$style["step-title"])},"Step 1: Download current data",2),be("span",{class:Q(T.$style["step-description"])},[...I[1]||(I[1]=[st(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),be("br",null,null,-1),be("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),fe(H(ht),{class:Q(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:ge(()=>[fe(H(at),{src:"Download"})]),default:ge(()=>[I[2]||(I[2]=st(" Download file ",-1))]),_:1},8,["class","disabled"])],2),be("div",{class:Q(T.$style["step-section"])},[be("span",{class:Q(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),fe(H(TO),{modelValue:l.value,"onUpdate:modelValue":I[0]||(I[0]=x=>l.value=x),ref_key:"filUploaderRef",ref:D},null,8,["modelValue"])],2),be("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(H(ht),{style:{flex:"1"},variant:"secondary",onClick:S},{default:ge(()=>[...I[3]||(I[3]=[st(" Cancel ",-1)])]),_:1}),fe(H(ht),{disabled:w.value,style:{flex:"1"},variant:"primary",onClick:C},{default:ge(()=>[...I[4]||(I[4]=[st(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ge(()=>[fe(H(ht),{style:{flex:"1"},variant:"primary",onClick:f},{default:ge(()=>[...I[5]||(I[5]=[st(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:ge(()=>[fe(H(ht),{style:{flex:"1"},variant:"primary",onClick:R},{default:ge(()=>[...I[6]||(I[6]=[st(" 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"}}]]),ube=Et(ot({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=To,s=Yb(),{setUserPermissions:o,setEntityPermissions:r}=s,{entityPermissions:i}=Qs(s),a=qt,l=B(null),c={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},u=B(""),d=q(()=>{var Ye;const ke=((Ye=i.value)==null?void 0:Ye.has_create_item_permission)==1||!1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!ke},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!ke,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!ke,id:"overwrite_scenes_option"}]}),h=e;kf.initialize({wrapVueCellRenderer:_v,wrapVueCellEditor:fN});const f=ef(),{switchInstanceFunc:p}=Qs(f);rn(()=>{const ke=es();p.value=ke==null?void 0:ke.appContext.config.globalProperties.switchInstance;const Ye=new BroadcastChannel("focusable_channel");vt(()=>{setTimeout(()=>{Ye.postMessage("Focusable elements updated")},7e3)})});const g=B(null),v=B([]),C=Wm(),{rowCount:S}=Qs(C),b=B(!1),w=B(""),D=B(),R=GA(),{metricList:T}=Qs(R),I=B(""),x=B(!1),F=B(new Set),E=B(new Map),{apiServices:A}=ts(!1,h),{columnDefs:k,checkboxColumn:M,saveColumnConfig:O}=ebe(T,h.entityId,g),W=B();et(()=>k,()=>{var ke;(ke=W.value)==null||ke.updateColumnDefs(k.value)},{deep:!0});const X=(ke,Ye)=>{O(ke,Ye)},{updateRowData:J,setMetricValues:ie}=sbe(g),ae=q(()=>({isSearching:w.value.length>0,isFiltering:!(Object.keys(Ae.value||{}).length==1&&Object.keys(Ae.value)[0]=="preflight_status")&&Object.keys(Ae.value||{}).length>0})),ee=q(um),V=q(()=>k.value.filter(ke=>{var Ye;return((Ye=ke.field)==null?void 0:Ye.startsWith("metric_"))&&!ke.hide}).map(ke=>{var Ye;return((Ye=ke.field)==null?void 0:Ye.replace("metric_",""))||""}));Xr("timezone",ee);const G=q(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:V.value,updateItemData:J,setMetricValues:ie})),{fetchItems:te,getMetricList:pe,cusorMap:ve,getMetricValues:re}=nbe(G),oe=q(()=>{if(!g.value)return!1;const ke=g.value.getSelectedRows().length;return ke>0&&ke>=S.value.total}),K=q(()=>{var ke;return((ke=l.value)==null?void 0:ke.name)||"Items"}),me=ke=>{setTimeout(()=>{vt(()=>{var Ye,Qt;g.value&&(ke?(Ye=g.value)==null||Ye.showNoRowsOverlay():(Qt=g.value)==null||Qt.hideOverlay())})},500)},se=(ke,Ye)=>{var Qt;S.value.total=ke.meta.total??0,(Qt=ke.meta.next)!=null&&Qt.cursor&&(ve[Ye+1]=ke.meta.next.cursor),I.value=ke.meta["X-Tsr-signature"]||"",ke.meta.total===0?me(!0):me(!1)},Se=DO(),U=B(null),{sortingAPIConfiguration:Z,isSortingRunning:de}=Qs(Se),Ae=B({preflight_status:"1"}),Fe=q(()=>({...Ae.value,search:w.value}));Xr("filterParams",Fe);const Le=B([]),ye=async({page:ke,pageSize:Ye,filterText:Qt})=>{var Go;(Go=g.value)==null||Go.hideOverlay();const Xt=ve[ke],Co=!Xt&&ke>1?(ke-1)*Ye:void 0,wa=Z.value;wa.length>0&&(de.value=!0);try{const Ca={cursor:Xt,size:Ye,searchQuery:Qt,offset:Co,sort_by:wa,...Ae.value},oo=await te(Ca);if(!oo)return{rows:[],total:0};const vp=(Kn=>{const Ai=Kn.data.map(bo=>TF(bo,ee.value));return Ai.forEach(bo=>{F.value.add(String(bo.id)),E.value.set(String(bo.id),{})}),Ai})(oo);return se(oo,ke),{rows:vp,total:S.value.total}}catch(Ca){return console.error("Failed to fetch items:",Ca),{rows:[],total:0}}finally{de.value=!1}},{isLoading:N,toggleSidebar:$,onGridReady:le,handleUnSelect:Ge,handleSelectAll:we,onSearch:ze,firstLoad:Ue}=rbe({selectRowData:B([]),isSidebarOpen:b,quickFilterText:w,gridApi:g,perPage:c.ROWS_PER_PAGE,fetcher:ye}),_e=B([]),Ve=()=>{var ke;_e.value=((ke=g.value)==null?void 0:ke.getSelectedRows())||[]},gt=lo({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),kt=q(()=>({blockLoadDebounceMillis:1e3,columnDefs:k.value,rowModelType:"infinite",cacheBlockSize:c.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:c.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:c.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:Ut,noRowsOverlayComponent:_v(JQ),noRowsOverlayComponentParams:()=>ae.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:ke=>ke.data.id,getRowClass:ke=>{if(!ke.data)return["row-empty"];const Ye=["row-highlight"];return ke.data.id||Ye.push("row-inactive"),ke.data.isDeleted&&Ye.push("row-deleted"),ke.data.disabled&&Ye.push("row-deleted"),ke.data.isArchived&&Ye.push("row-archived"),ke.data.isLocked&&Ye.push("row-locked"),Ye},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:A.value,sorting:de.value},onCellKeyDown:ke=>{var Ye,Qt,Xt;if(ke.data.isDeleted)return!1;if(((Ye=ke==null?void 0:ke.event)==null?void 0:Ye.key)==="Enter"){const{api:Co,node:wa,column:Go}=ke,Ca=Co.getCellRendererInstances({rowNodes:[wa],columns:[Go]});if(Ca.length>0){const oo=Ca[0];oo&&typeof((Qt=oo.componsenExposed)==null?void 0:Qt.focus)=="function"&&((Xt=oo.componsenExposed)==null||Xt.focus())}}},isRowSelectable:ke=>!ke.group,suppressKeyboardEvent:ke=>{var Xt;if((Xt=ke.data)!=null&&Xt.isDeleted)return!0;const Ye=ke.event.key,Qt=ke.editing;return Qt&&Ye==="Tab"?!0:Qt&&Ye==="Enter"?!1:Ye==="Enter"?(ke.event.preventDefault(),ke.event.stopPropagation(),!0):Ye==="ArrowUp"||Ye==="ArrowDown"||Ye==="ArrowLeft"||Ye==="ArrowRight"||Ye==="Tab"||Ye==="Enter"},navigateToNextCell:()=>null,onBodyScroll:ke=>{const Ye=ke.api.getFirstDisplayedRowIndex(),Qt=ke.api.getLastDisplayedRowIndex();gt.rowsDisplay.fromIndex=Ye,gt.rowsDisplay.toIndex=Qt,gt.columnsDisplay=ke.api.getAllDisplayedVirtualColumns().map(Xt=>Xt.getColId())},onViewportChanged:ke=>{gt.columnsDisplay=ke.api.getAllDisplayedVirtualColumns().map(Ye=>Ye.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(ke){if(ke.data.isDeleted&&ke.api.stopEditing(),ke.colDef.field=="options"){const Ye=ke.api.getCellRendererInstances({rowNodes:[ke.node],columns:[ke.column]});Ye.length>0&&Ye[0].focusUi()}},tabToNextCell:ke=>{let Ye=ke.nextCellPosition;if(Ye&&Ye.column.getColId()==="ag-Grid-SelectionColumn"){const Qt=ke.api.getAllDisplayedColumns(),Xt=Qt.indexOf(Ye.column),Co=ke.backwards?-1:1,wa=Qt[Xt+Co];if(wa)return{rowIndex:Ye.rowIndex,column:wa,rowPinned:Ye.rowPinned}}return Ye}}));function Ut(){if(!g.value)return;let ke=0;g.value.forEachNode(Ye=>{Ye.data&&ke++}),S.value.loaded=Math.min(ke,S.value.total)}et(()=>Z,()=>{g.value&&(I.value="",F.value.clear(),g.value.deselectAll(),Object.keys(ve).forEach(ke=>delete ve[Number(ke)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const en=B(),zt=B(),Ne=()=>{var ke;(ke=zt.value)==null||ke.open()},qe=()=>{var ke;(ke=en.value)==null||ke.open()},wt=async()=>{Ue.value=!0,g.value&&(I.value="",F.value.clear(),Object.keys(ve).forEach(ke=>delete ve[Number(ke)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},Nt=q(()=>un.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Wt=B();q(()=>{var ke;return(ke=abe(Nt.value))==null?void 0:ke.map(Ye=>`<div>• ${Ye}</div>`).join(`
|
|
259
|
-
`)});function nt(ke){var Ye;ke==="new_scene"?(Ye=Wt.value)==null||Ye.show():ke==="import_scenes"?qe():ke==="overwrite_scenes"&&Ne()}const Is=ke=>{v.value=ke.api.getSelectedRows().map(Ye=>Ye.id)},Ur=ke=>{const Ye=le(ke);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",Xt=>X(Xt,!0)),Ye.addEventListener("columnResized",Xt=>X(Xt,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport")),Ye},xi=()=>{var ke;u.value=(((ke=document.getElementById("item-table-layout-id"))==null?void 0:ke.clientHeight)??0)-78+"px"};rn(()=>{vt(()=>{xi()}),window.addEventListener("resize",xi);function ke(){requestAnimationFrame(ke)}ke()}),ms(()=>{window.removeEventListener("resize",xi)});const gr=async({code:ke,name:Ye})=>{await ze(ke),setTimeout(()=>{var Qt;(Qt=D.value)==null||Qt.setValue(Ye)},300)},ya=ke=>{if(!g.value)return;const Ye=g.value.getRowNode(ke);Ye?(g.value.ensureIndexVisible(Number(Ye.rowIndex),"middle"),g.value.flashCells({rowNodes:[Ye],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(S.value.total-1,"bottom")},ml=ke=>ke.metric_type.code==="number"?"number":"default",Fi=async()=>{if(h.entityId)try{const ke=await pe(h.entityId);T.value=ke.data.map(Ye=>({...Ye,sortType:ml(Ye)}))}catch(ke){console.error("Failed to initialize metric list:",ke),T.value=[]}},Pi=async()=>{if(A.value)try{const ke=await A.value.getUserPermission(h.workspaceId);o(ke)}catch(ke){console.error("Failed to fetch user permissions:",ke)}},mr=async()=>{if(A.value)try{const ke=await A.value.getEntityDetail(h.workspaceId,h.entityId);r(ke.permission),l.value=ke}catch(ke){console.error("Failed to fetch entity details:",ke)}},Wr=hv(),{setUser:Pd}=Wr,kn=async()=>{if(A.value)try{const ke=await A.value.getMe();return Pd(ke),ke}catch(ke){console.error("Failed to fetch user details:",ke)}},fs=async()=>{var ke;if(A.value)try{const Ye=await A.value.getWorkspaces(h.workspaceId),Qt=(ke=Ye.data[0])==null?void 0:ke.ws_user_role_id;return Qt&&Wr.setUserRoleId(Qt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};et(()=>[h.entityId,h.workspaceId],async([ke,Ye])=>{!ke||!Ye||(kn(),fs(),Fi(),Pi(),mr())},{immediate:!0,deep:!0}),et(V,(ke,Ye)=>{const Qt=ke.filter(Xt=>!(Ye!=null&&Ye.includes(Xt)));Qt.length>0&&re(Array.from(F.value),Qt).then(Xt=>{ie(Xt,F.value,Qt)})},{immediate:!0,deep:!0}),et(I,(ke,Ye)=>{x.value=!!(Ye&&ke&&Ye!==ke)}),t({refreshTable:wt});const b_=ke=>{Ae.value=ke,wt()},Ad=ke=>{Le.value=ke,wt()},kd=ke=>{k.value=ke||[],X({},!0)},Od=q(()=>{var Xt;const ke=un.getInstance().getItem("ws.terminology"),Ye=ke?JSON.parse(ke):null;return`New ${((Xt=Ye==null?void 0:Ye.find(Co=>Co.code==="scene"))==null?void 0:Xt.name)||"Scene"}`});return B('<p><br>Here is template notess..</p><p><strong>this is Bold</strong>,<i> this is Italic</i>,<u> this is underline</u><br>this is hightlight , <br>1</p><p>1</p><ul class="todo-list"><li data-list-item-id="ed7bc572523bb0f35972903183a9d7346"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">1</span></li><li data-list-item-id="ef5b3e469bed2b79951b489fd3a25ffaa"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">2</span></li><li data-list-item-id="ed25bcd78b8b608ed432f01164608cb0d"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">3</span></li><li data-list-item-id="e05c8f5e183d4de144c2a6a8059691d5f"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">4</span></li></ul><p>This is list</p><ul><li data-list-item-id="ed6b9c0b0b97baf09030ee79ea57c40a9">1</li><li data-list-item-id="ef1fc34bceeb4a82abc8c61fe28972c9b">2</li><li data-list-item-id="e950cf66600b9cc40f130a396a6831a75">3</li><li data-list-item-id="e64b6e87f244f9268e45b32b785308a6e">4</li></ul><p> </p>'),(ke,Ye)=>{const Qt=Eo("focusable");return z(),je(H(lJ),{"is-sidebar-open":b.value,onCloseSidebar:H($),onSidebarClear:H($),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:H($)},{"header-left":ge(()=>{var Xt;return[((Xt=H(i))==null?void 0:Xt.has_create_item_permission)==1?(z(),je(H(pS),{key:0,variant:["primary"],options:d.value,onSelect:nt,onHandleClick:Ye[1]||(Ye[1]=Co=>nt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ge(()=>[Ke(fe(H(ht),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Co=>nt("new_scene")),label:Od.value},null,8,["label"]),[[Qt,1]])]),_:1},8,["options"])):Xe("",!0)]}),"header-actions":ge(()=>[fe(H(Mee),{"onUpdate:assignees":Ad,onApplyFilter:b_,loading:H(Ue),entityId:h.entityId},null,8,["loading","entityId"]),Ke(fe(H(tS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=Xt=>w.value=Xt),onSearch:H(ze),class:Q(ke.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=Xt=>H(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:D},null,8,["modelValue","onSearch","class"]),[[H(n),{isLoading:H(Ue),fullwidth:!0}]]),Ke((z(),je(H(LA),{status:H(N)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:ge(()=>[Ke((z(),je(H(ht),{variant:["secondary","icon"],disabled:H(N),onClick:wt},{default:ge(()=>[fe(H(at),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[Qt,5],[H(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[H(n),{isLoading:H(Ue),fullwidth:!0}]]),Ke(fe(H(OQ),{"model-value":H(k),onChange:Ye[4]||(Ye[4]=Xt=>kd(Xt)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:W,"checkbox-column":H(M),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[H(n),{isLoading:H(Ue),fullwidth:!0}]])]),grid:ge(({availableHeight:Xt})=>[fe(H(YCe),Kt({id:"item_table_main",ref_key:"agGrid",ref:U},kt.value,{height:Xt+"px",isSorting:H(de),onOnGridReady:Ur,onSelectionChanged:Is}),null,16,["height","isSorting"])]),footer:ge(()=>[be("div",{class:Q(ke.$style.tableFooter),id:"table_footer"},[be("span",null,[Ye[5]||(Ye[5]=st(" Showing ",-1)),be("b",null,Ct(H(S).loaded)+" of "+Ct(H(S).total),1)])],2)]),"new-row":ge(()=>[fe(H(dee),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:gr,onFocusOnId:ya},null,512)]),"bulk-update-actions":ge(()=>[!b.value&&v.value.length>0?Ke((z(),je(H(eJ),{key:0,selectRowData:_e.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:H(Ge),onSelectAll:H(we),"take-name":K.value,"selected-all":oe.value,"total-rows":H(S).total,"visible-rows":H(S).loaded,onUpdated:Ve,loading:H(N)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ko,!b.value&&v.value.length>0]]):Xe("",!0)]),snackbar:ge(()=>[fe(H(UJ))]),popup:ge(()=>[fe(Ise,{ref_key:"popupCreateSceneRef",ref:en,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"]),fe(cbe,{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.124",dbe={key:0},hbe=Et(ot({__name:"app",setup(e){const t=q(()=>n.id.length===0||n.workspaceId.length===0),n=lo({id:"",workspaceId:"",apiConfig:{}}),s=gf(),{showMessage:o,showErrorNetMessage:r}=s,i=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=B(null),c=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};eh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",MB);try{if(l.value=es(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||un.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:un.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new Ok(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),ms(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=q(()=>n.id),d=q(()=>n.workspaceId);return Xr("workspaceId",d),Xr("entityId",u),(h,f)=>(z(),ce("div",{class:Q(h.$style.dashboardPluginWrapper)},[t.value?(z(),ce("span",dbe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(z(),je(H(ube),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),C_=async(e={},t={})=>{const n=bT(hbe),s=uY();n.use(s);const o=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,o.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${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",qt),n.directive("focusable",Wi);const i=await Rse();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=C_),On.default=C_,On.initDashboard=C_,Object.defineProperties(On,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
258
|
+
`,qye=class extends Ege{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():(Je(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=xB),this.isFirstLine=!1}},Yye=class extends Sge{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){Je(51);return}const t=this.getMergedParams(e),n=this.getData(t),s=new Blob(["\uFEFF",n],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(Ft(this.gos,{})):t.fileName;_ge(this.getFileName(o),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:s,valueSvc:o,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new qye({colModel:t,colNames:n,valueSvc:o,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:s})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function Zye(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function Xye(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var Jye={moduleName:"CsvExport",version:ct,beans:[Yye],apiFunctions:{getDataAsCsv:Zye,exportDataAsCsv:Xye},dependsOn:[Kye]},Qye=class extends We{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:s,rowNodes:o}=this;for(let r=0;r<e;r++){const i=n+r,a=new cl(s);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),o.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:s}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:s}}}setDataAndId(e,t,n){dt(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Vn(this.params.datasource.getRows)){Je(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:s,filterModel:o},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:s,filterModel:o,context:Ft(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((s,o)=>{this.startRow+o<n&&e(s,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((o,r)=>{const i=e.rowData?e.rowData[r]:void 0;!o.id&&o.alreadyRendered&&i&&(t[r]=new cl(n),t[r].setRowIndex(o.rowIndex),t[r].setRowTop(o.rowTop),t[r].setRowHeight(o.rowHeight),o.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const s=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,s)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},ewe=2,twe=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 Qye(e,this,t));return this.blocks[n.id]=n,this.blockCount++,this.purgeBlocksIfNeeded(n),t.rowNodeBlockLoader.addBlock(n),n}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(sl(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(i=>i!=e),n=(i,a)=>a.lastAccessed-i.lastAccessed;t.sort(n);const s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,r=ewe-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,c=s?a>=o:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(i)||this.isBlockFocused(i))return;this.removeBlockFromCache(i)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:s}=e;return t.rowIndex>=n&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:s}=this.params,r=(e.id+1)*n+s;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,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 r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(o&&s+1!==l.id){i=!0;continue}s=l.id,l.forEachNode(c=>{const u=c===e||c===t;(o||u)&&n.push(c),u&&(o=!o)},r,this.rowCount)}return i||o?[]:n}},nwe=class extends We{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new cl(e);this.rootNode=t,t.level=-1,this.rowHeight=vc(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=vc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Of(this.cacheParams.sortModel,((t=this.beans.sortSvc)==null?void 0:t.getSortModel())??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){var n;return((n=this.infiniteCache)==null?void 0:n.getRowNodesInRange(e,t))??[]}reset(){var n;if(!this.datasource)return;ud(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:s,eventSvc:o,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:s,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:vc(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new twe(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 swe(e){var t;(t=Sy(e))==null||t.refreshCache()}function owe(e){var t;(t=Sy(e))==null||t.purgeCache()}function rwe(e){var t;return(t=Sy(e))==null?void 0:t.getRowCount()}var iwe=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=Yoe(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Os(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){$r(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){sl(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:s}=t.getBlockStateJson();e[n]=s}),e}printCacheStatus(){sl(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},awe={moduleName:"InfiniteRowModelCore",version:ct,rowModels:["infinite"],beans:[nwe,iwe]},lwe={moduleName:"InfiniteRowModel",version:ct,apiFunctions:{refreshInfiniteCache:swe,purgeInfiniteCache:owe,getInfiniteRowCount:rwe},dependsOn:[awe,bye]},cwe="↑",uwe="↓",dwe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},hwe=class extends Cn{constructor(){super(dwe),this.eValue=ut,this.eDelta=ut,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,r=t>=0,i=this.eDelta;r?i.textContent=cwe+o:i.textContent=uwe+o,i.classList.toggle("ag-value-change-delta-up",r),i.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),ks(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:s}=e,{eValue:o,lastValue:r,beans:i}=this;if(n===r||(dt(s)?o.textContent=s:dt(n)?o.textContent=n:ks(o),(c=i.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=r&&typeof r=="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return r&&o.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},fwe=".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}",pwe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},gwe=class extends Cn{constructor(){super(pwe),this.eCurrent=ut,this.refreshCount=0,this.registerCSS(fwe)}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=is({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=s,s.textContent=n.textContent,this.getGui().insertBefore(s,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var r;e===this.refreshCount&&((r=this.ePrevious)==null||r.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var o;let n=e.value;if(Vn(n)&&(n=""),n===this.lastValue||(o=this.beans.filterManager)!=null&&o.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const s=this.eCurrent;return dt(e.valueFormatted)?s.textContent=e.valueFormatted:dt(e.value)?s.textContent=n:ks(s),!0}},mwe=class extends We{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),s=this.beans.gos.get("cellFadeDuration")){const o=this.animations[t];o.delete(e);const r=Date.now(),i=r+n,a=r+n+s,l={phase:"flash",flashEndTime:i,fadeEndTime:a};o.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&i+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=i)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const s=this.animations[n],o=`ag-cell-${n}`,r=`${o}-animation`;for(const[i,a]of s){if(!i.isAlive()||!i.comp){s.delete(i);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=i;switch(l){case"flash":f.toggleCss(o,!1),f.toggleCss(r,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(o,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),s.delete(i);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=gue(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 vwe(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 ywe={moduleName:"HighlightChanges",version:ct,beans:[mwe],userComponents:{agAnimateShowChangeCellRenderer:hwe,agAnimateSlideCellRenderer:gwe},apiFunctions:{flashCells:vwe}};function wwe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Cwe(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=bwe(e)),e.version=ct,e}function bwe(e){return e.cellSelection=Swe(e,"rangeSelection"),e}function Swe(e,t){if(e&&typeof e=="object")return e[t]}var Ewe=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 r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(s))),(s.columnOrder||s.columnVisibility||s.columnSizing||s.columnPinning||s.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(s,!!o),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(s))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(s))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=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:r,rowSelection:i,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",s)&&this.setFilterState(s),l("rowGroupExpansion",o)&&this.setRowGroupExpansionState(r,o,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},s=()=>t("filter",this.getFilterState()),{gos:o,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:s,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(o.get("groupDefaultExpanded")!==0||o.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:i=>{(i.newPage||i.newPageSize)&&t("pagination",this.getPaginationState())}}),r&&this.addManagedListeners(r,{filterStateChanged:s})}setFirstDataRenderedState(e,t,n){const{scroll:s,cellSelection:o,focusedCell:r,columnOrder:i,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",o)&&this.setCellSelectionState(o),l("scroll",s)&&this.setScrollState(s),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:s=>{if(s.finished){const o=this.getRangeSelectionState();t("rangeSelection",o),t("cellSelection",o)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return wge(zv(e),e.colModel.isPivotMode())}setColumnState(e,t,n,s){const{sort:o,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(E,A)=>{const k=!(s!=null&&s.has(E))&&!!(A||t==="api");return h||(h=k),k},p={},g=E=>{let A=p[E];return A||(A={colId:E},p[E]=A,A)},v={},C=f("sort",o);C&&(o==null||o.sortModel.forEach(({colId:E,sort:A},k)=>{const M=g(E);M.sort=A,M.sortIndex=k})),(C||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((E,A)=>{const k=g(E);k.rowGroup=!0,k.rowGroupIndex=A})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:E,aggFunc:A})=>{g(E).aggFunc=A})),(b||!n)&&(v.aggFunc=null);const w=f("pivot",a);w&&(a==null||a.pivotColIds.forEach((E,A)=>{const k=g(E);k.pivot=!0,k.pivotIndex=A}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(w||!n)&&(v.pivot=null,v.pivotIndex=null);const D=f("columnPinning",l);if(D){for(const E of(l==null?void 0:l.leftColIds)??[])g(E).pinned="left";for(const E of(l==null?void 0:l.rightColIds)??[])g(E).pinned="right"}(D||!n)&&(v.pinned=null);const R=f("columnVisibility",c);if(R)for(const E of(c==null?void 0:c.hiddenColIds)??[])g(E).hide=!0;(R||!n)&&(v.hide=null);const T=f("columnSizing",u);if(T)for(const{colId:E,flex:A,width:k}of(u==null?void 0:u.columnSizingModel)??[]){const M=g(E);M.flex=A??null,M.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")),F=x?I.map(E=>g(E)):Object.values(p);(F.length||h)&&(this.columnStates=F,Hr(this.beans,{state:F,applyOrder:x,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const s=this.columnGroupStates;this.columnGroupStates=void 0;const o=this.beans,{pivotResultCols:r,colGroupSvc:i}=o;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);Hr(o,{state:a,applyOrder:e},t)}s&&(i==null||i.setColumnGroupState(s,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Cge(t)}setColumnGroupState(e,t,n){var a;const s=this.beans.colGroupSvc;if(!s||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const o=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=s.getColumnGroupState().map(({groupId:l})=>{const c=o.has(l);return c&&o.delete(l),{groupId:l,open:c}});for(const l of o)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),s.setColumnGroupState(i,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),s=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||s||n?{filterModel:t,columnFilterState:n,advancedFilterModel:s}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:s,advancedFilterModel:o}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||s!==void 0)&&(t==null||t.setFilterState(n??null,s??null,"columnFilter")),o!==void 0&&(t==null||t.setAdvFilterModel(o??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:s,type:o,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:s,type:o,startRow:r,endRow:i,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:s,visibleCols:o}=this.beans;if(!la(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of i.colIds){const u=s.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=s.getCol(i.startColId);if(!l){const c=o.allCols,u=new Set(a);l=c.find(d=>u.has(d))}r.push({...i,columns:a,startColumn:l})}n.setCellRanges(r)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:s,rowRenderer:o,animationFrameSvc:r,ctrlsSvc:i}=this.beans;s.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),o.redraw({afterScroll:!0}),r==null||r.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:s,rowIndex:o,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(s),rowIndex:o,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),s=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!s))return{page:n,pageSize:s}}setPaginationState(e,t){const{pagination:n,gos:s}=this.beans;if(!n)return;const{pageSize:o,page:r}=e??{page:0,pageSize:s.get("paginationPageSize")},i=t==="gridInitializing";o&&!s.get("paginationAutoPageSize")&&n.setPageSize(o,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var s;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((s=t==null?void 0:t.toggledNodes)!=null&&s.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const s=this.beans.expansionSvc;if(!s)return;const o=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};s.setExpansionState(o,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const s=this.cachedState;for(const o of Object.keys(t)){const r=t[o];Of(r,s[o])||(n=!0)}this.cachedState={...s,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Of(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")}},_we={moduleName:"GridState",version:ct,beans:[Ewe],apiFunctions:{getState:wwe,setState:Cwe}};function Rwe(e){return e.rowModel.isLastRowIndexKnown()}function Dwe(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Twe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function Iwe(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function xwe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function Fwe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function Pwe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function Awe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function kwe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Owe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var Mwe=class extends We{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const s=Math.max(vc(t),1),o=Math.floor(e/s);t.pagination.setPageSize(o,"autoCalculated")};this.isBodyRendered?Os(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},mp="paginationPageSizeSelector",Nwe={tag:"span",cls:"ag-paging-page-size"},Lwe=class extends Cn{constructor(){super(Nwe),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(mp,()=>{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(mp)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const o=this.gos.exists("paginationPageSize"),r=this.gos.get(mp)!==!0;Je(94,{pageSizeSet:o,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Je(95,{paginationPageSizeOption:t,paginationPageSizeSelector:mp}),e.unshift("")}const s=String(n?"":t);this.selectPageSizeComp?(il(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(s,!0)):this.createPageSizeSelectorComp(e,s),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),s=n("pageSizeSelectorLabel","Page Size:"),o=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new r0).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(mp);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,s)=>n-s)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},Vwe={selector:"AG-PAGE-SIZE-SELECTOR",component:Lwe},Bwe=".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}",$we=class extends HV{constructor(){super(),this.btFirst=ut,this.btPrevious=ut,this.btNext=ut,this.btLast=ut,this.lbRecordCount=ut,this.lbFirstRowOnPage=ut,this.lbLastRowOnPage=ut,this.lbCurrent=ut,this.lbTotal=ut,this.pageSizeComp=ut,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(Bwe)}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(),[Vwe]);const{btFirst:t,btPrevious:n,btNext:s,btLast:o}=this;this.activateTabIndex([t,n,s,o]),t.insertAdjacentElement("afterbegin",hr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",hr(e?"next":"previous",this.beans)),s.insertAdjacentElement("afterbegin",hr(e?"previous":"next",this.beans)),o.insertAdjacentElement("afterbegin",hr(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(r):Mle(this.beans,r),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:s=>{(s.key===Oe.ENTER||s.key===Oe.SPACE)&&(s.preventDefault(),n())}})}Ole(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}):bge(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){Yse(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),s=e?n:null,o=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*o+1,a=i+r-1,e&&a>s&&(a=s));const l=i+r-1,c=!e&&n<l,u=this.formatNumber(i);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?o+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,C;if(e)v=this.formatNumber(t),C=this.formatNumber(s);else{const S=h("more","more");v=S,C=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=C,this.announceAriaStatus(u,d,C,g,v)}announceAriaStatus(e,t,n,s,o){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${i} ${s} ${l} ${o}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},Hwe={selector:"AG-PAGINATION",component:$we},Gwe=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 Hwe}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,r=n*o;let i=n*(o+1)-1;if(i>s&&(i=s),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===s)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,s=e-1;this.totalPages=Math.floor(s/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>s&&(this.bottomDisplayedRowIndex=s)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:s=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:s,keepRenderedRows:t})}},Uwe={moduleName:"Pagination",version:ct,beans:[Gwe,Mwe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:Rwe,paginationGetPageSize:Dwe,paginationGetCurrentPage:Twe,paginationGetTotalPages:Iwe,paginationGetRowCount:xwe,paginationGoToNextPage:Fwe,paginationGoToPreviousPage:Pwe,paginationGoToFirstPage:Awe,paginationGoToLastPage:kwe,paginationGoToPage:Owe},dependsOn:[Ey]};function Wwe(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 zwe(e,t){return e.rowModel.getRowNode(t)}function jwe(e,t,n,s){e.rowRenderer.addRenderedRowListener(t,n,s)}function Kwe(e){return e.rowRenderer.getRenderedNodes()}function qwe(e,t,n){e.rowModel.forEachNode(t,n)}function Ywe(e){return e.rowRenderer.firstRenderedRow}function Zwe(e){return e.rowRenderer.lastRenderedRow}function Xwe(e,t){return e.rowModel.getRow(t)}function Jwe(e){return e.rowModel.getRowCount()}var Qwe={moduleName:"RowApi",version:ct,apiFunctions:{redrawRows:Wwe,setRowNodeExpanded:PB,getRowNode:zwe,addRenderedRowListener:jwe,getRenderedNodes:Kwe,forEachNode:qwe,getFirstDisplayedRowIndex:Ywe,getLastDisplayedRowIndex:Zwe,getDisplayedRowAtIndex:Xwe,getDisplayedRowCount:Jwe}},eCe={moduleName:"ScrollApi",version:ct,apiFunctions:{getVerticalPixelRange:fve,getHorizontalPixelRange:pve,ensureColumnVisible:hB,ensureIndexVisible:fB,ensureNodeVisible:gve}};function tCe(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 nCe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function sCe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function oCe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function rCe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function iCe(e){return{rowHeight:vc(e),headerHeight:sp(e)}}function aCe(e,t={}){var r;const n=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=i.getCellRenderer();a!=null&&n.push(ep(a))}if((r=t.columns)!=null&&r.length)return n;const s=[],o=n_(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(o&&!s_(i.rowNode,o)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&s.push(ep(c))}}return[...s,...n]}var lCe={moduleName:"RenderApi",version:ct,apiFunctions:{setGridAriaProperty:tCe,refreshCells:nCe,refreshHeader:sCe,isAnimationFrameQueueEmpty:oCe,flushAllAnimationFrames:rCe,getSizesForCurrentTheme:iCe,getCellRendererInstances:aCe}};function cCe(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 uCe(e,t){var n;t&&typeof t=="object"?AB(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var dCe=class extends We{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");s=r!=null&&r.length>0&&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 c;const o=u=>fd(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return o(s);const r=kB(this.beans),i=u=>n.leftCols.some(d=>Xf(d,u)),a=u=>n.rightCols.some(d=>Xf(d,u)),l=e.colKeys.filter(u=>!ua(u)&&!da(u)&&!i(u)&&!a(u));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),o(s)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:s,skipHeader:o,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let C=-1;const S=Object.fromEntries(c.map(({colId:D,...R})=>[D,R])),b=o??this.gos.get("skipHeaderOnAutoSize"),w=r??b;for(;C!==0;){C=0;const D=[];for(const R of s){if(!R||lre(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 F=hCe(T,I,x);T.setActualWidth(F,u),v.add(T),C++}D.push(T)}D.length&&g.refresh(u)}w||this.autoSizeColumnGroupsByColumns(s,u,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:s,ctrlsSvc:o}=this.beans,r=new Set,i=s.getColsForKeys(e);for(const l of i){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||r.add(c),c=c.getParent()}let a;for(const l of r){for(const c of o.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),s=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",s);const o=new Tc(e);return o.addEventListener("doubleTap",s),()=>{e.removeEventListener("dblclick",s),o.destroy()}}addColumnGroupResize(e,t,n){const s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{const r=[],i=t.getDisplayedLeafColumns();for(const a of i)a.getColDef().suppressAutoSize||r.push(a.getColId());r.length>0&&this.autoSizeCols({colKeys:r,skipHeader:s,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",o),()=>e.removeEventListener("dblclick",o)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=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):Je(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,s){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,s));return}const o={};for(const{key:v,...C}of(s==null?void 0:s.columnLimits)??[])o[typeof v=="string"?v:v.getColId()]=C;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=ca(r);if(s!=null&&s.onlyScaleUp&&i>e||e===i&&r.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const S=o==null?void 0:o[C.getId()],b=(S==null?void 0:S.minWidth)??(s==null?void 0:s.defaultMinWidth),w=(S==null?void 0:S.maxWidth)??(s==null?void 0:s.defaultMaxWidth),D=C.getActualWidth();return(b==null||D>=b)&&(w==null||D<=w)}))return;const l=[],c=[];for(const v of r){const C=((p=s==null?void 0:s.colKeys)==null?void 0:p.some(S=>Xf(v,S)))??!0;v.getColDef().suppressSizeToFit||!C?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{$r(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const C=o==null?void 0:o[v.getId()],S=(C==null?void 0:C.minWidth)??(s==null?void 0:s.defaultMinWidth),b=(C==null?void 0:C.maxWidth)??(s==null?void 0:s.defaultMaxWidth),w=v.getActualWidth();typeof S=="number"&&w<S?v.setActualWidth(S,t,!0):typeof b=="number"&&w>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-ca(c);if(v<=0)for(const C of l){const S=((g=o==null?void 0:o[C.getId()])==null?void 0:g.minWidth)??(s==null?void 0:s.defaultMinWidth)??C.minWidth;C.setActualWidth(S,t,!0)}else{const C=v/ca(l);let S=v;for(let b=l.length-1;b>=0;b--){const w=l[b],D=o==null?void 0:o[w.getId()],R=(D==null?void 0:D.minWidth)??(s==null?void 0:s.defaultMinWidth),T=(D==null?void 0:D.maxWidth)??(s==null?void 0:s.defaultMaxWidth),I=w.getMinWidth(),x=w.getMaxWidth(),F=typeof R=="number"&&R>I?R:I,E=typeof T=="number"&&T<x?T:x;let A=Math.round(w.getActualWidth()*C);A<F?(A=F,h(w),d=!1):A>E?(A=E,h(w),d=!1):b===0&&(A=S),w.setActualWidth(A,t,!0),S-=A}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&fd(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const s=n.type;if(s==="fitGridWidth"){const{columnLimits:o,defaultMinWidth:r,defaultMaxWidth:i}=n,a=o==null?void 0:o.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else s==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(s)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var s;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(s=this.beans.colDelayRenderSvc)==null||s.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function hCe(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 Bf(n.eGridBody)-o}var fCe={moduleName:"ColumnAutoSize",version:ct,beans:[dCe],apiFunctions:{sizeColumnsToFit:cCe,autoSizeColumns:AB,autoSizeAllColumns:uCe},dependsOn:[o2]},pCe=".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 gCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function mCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function vCe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function yCe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function wCe(e,t,n){var s;return(s=e.pinnedRowModel)==null?void 0:s.forEachPinnedRow(t,n)}var CCe={moduleName:"PinnedRow",version:ct,beans:[vce],css:[pCe],apiFunctions:{getPinnedTopRowCount:gCe,getPinnedBottomRowCount:mCe,getPinnedTopRow:vCe,getPinnedBottomRow:yCe,forEachPinnedRow:wCe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},bCe=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}},SCe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:s,rowModel:o,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const C=(w,D)=>{p=w,g=null,v=D},S=w=>{const D=!w.isExpandable()&&!w.group&&!w.detail&&(u?!u({rowNode:w}):!0);if(w.rowIndex==null||!D){C(null,null);return}if(p==null||w.level!==p.level||w.footer||g&&w.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){C(w,r.getValue(t,w));return}const R=r.getValue(t,w);if(f){const T=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 bCe(t,p),c.set(p,g)}g.addSpannedNode(w),c.set(w,g)};switch(e){case"center":(b=o.forEachDisplayedNode)==null||b.call(o,w=>{(!i||i.isRowInPage(w.rowIndex))&&S(w)}),this.centerValueNodeMap=c;break;case"top":s==null||s.forEachPinnedRow("top",S),this.topValueNodeMap=c;break;case"bottom":s==null||s.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},ECe=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 SCe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,s=e.column,o=e.rowIndex,r=this.spanningColumns.get(s);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(o);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(o);break;default:i=n.getRow(o)}if(i)return r.getCellSpan(i)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,s]of this.spanningColumns)if(s.isCellSpanning(e)){const o=s.getCellSpan(e);t(n,o)}}destroy(){super.destroy(),this.spanningColumns.clear()}},_Ce=class extends Rd{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,s,o,r,i){this.eWrapper=n,super.setComp(e,t,n,s,o,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||Rv(e,t.rowIndex)}setAriaRowSpan(){eoe(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}},RCe=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 _Ce(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(){}},DCe=class extends We{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),s=n.size,o=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of o)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(r.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){r.set(u.firstNode,d),n.delete(u.firstNode);return}i=!0;const h=new RCe(u.firstNode,this.beans,!1,!1,!1);r.set(u.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===s;if(!(!i&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const s=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(s)return s.getAllCellCtrls().find(o=>o.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},TCe={moduleName:"CellSpan",version:ct,beans:[ECe,DCe]},ICe=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);e_(this.beans.expressionSvc,s===this.cellClassRules?void 0:this.cellClassRules,s,o,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=s}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let s;if(typeof n=="function"){const o=this.getCellClassParams(e,t);s=n(o)}else s=n;s&&this.cellComp.setUserStyles(s)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,s=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const o=this.beans.cellStyles.getStaticCellClasses(n,s);this.staticClasses=o;for(const r of o)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:s}=this.cellCtrl;return Ft(this.beans.gos,{value:n,data:s.data,node:s,colDef:t,column:e,rowIndex:s.rowIndex})}},xCe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,s){e_(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 ICe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(o=>{n(o)})}},FCe={moduleName:"CellStyle",version:ct,beans:[xCe]},PCe={moduleName:"RowStyle",version:ct,beans:[vpe]};function ACe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var kCe=class extends We{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:s,gos:o,element:r,columns:i}=this,a=s.colHover;if(n??!!o.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},OCe="ag-column-hover",MCe=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(OCe,n)}addHeaderFilterColumnHoverListener(e,t,n,s){this.createHoverFeature(e,[n],s);const o=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:o}),o()}createHoverFeature(e,t,n){e.createManagedBean(new kCe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},NCe={moduleName:"ColumnHover",version:ct,beans:[MCe],apiFunctions:{isColumnHovered:ACe}},LCe=class extends We{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var r;const n=((r=this.wrapSvc)==null?void 0:r.wrap(e,t))??t,s=!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 r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,s=this.asyncListeners.get(e),o=!!(s!=null&&s.delete(n));o||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,o)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{yy.has(i)&&t(i,a)},s=(i,a)=>{yy.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:s});const o=this.eventSvc;o.addGlobalListener(n,!1),o.addGlobalListener(s,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:s}=this,o=(n==null?void 0:n.unwrapGlobal(e))??e;if(s.has(o)){const{syncListener:i,asyncListener:a}=s.get(o);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),s.delete(e)}else this.syncGlobalListeners.delete(o),t.removeGlobalListener(o,!1)}destroyEventListeners(e,t){e.forEach((n,s)=>{n.forEach(o=>this.eventSvc.removeListener(s,o,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:s})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(s,!0)}),e.clear()}};function VCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.addListener(t,n)}function BCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.removeListener(t,n)}function $Ce(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function HCe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var GCe={moduleName:"EventApi",version:ct,apiFunctions:{addEventListener:VCe,addGlobalListener:$Ce,removeEventListener:BCe,removeGlobalListener:HCe},beans:[LCe]},UCe={moduleName:"Locale",version:ct,beans:[yge]},WCe=class extends We{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Os(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:s}=this.beans,o=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=ol(this.beans,d).height;for(const g of o){let v=h==null?void 0:h[g.getColId()];const C=n==null?void 0:n.getCellSpan(g,d);if(C){if(C.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),r=!0)};(a=s==null?void 0:s.forEachPinnedRow)==null||a.call(s,"top",i),(l=s==null?void 0:s.forEachPinnedRow)==null||l.call(s,"bottom",i),(c=t.forEachDisplayedNode)==null||c.call(t,i),r&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const s=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,s!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:s,visibleCols:o}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=o.getLeftColsForRow(t);break;case"right":r=o.getRightColsForRow(t);break;case null:r=s.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const s=t.parentElement,{rowNode:o,column:r}=e,i=this.beans,a=u=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=gc(s),g=d+h+f+p,C=t.offsetHeight+g;if(u<5){const b=Ds(i),w=!(b!=null&&b.contains(t)),D=C==0;if(w||D){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(o,C,r)},l=()=>a(0);l();const c=tl(i,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(o,void 0,r)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(o=>o.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const s of t){const o=n.__autoHeights[s.getColId()];if(!o||n.rowHeight<o)return!1}}return!0}},zCe={moduleName:"RowAutoHeight",version:ct,beans:[WCe]},jCe={moduleName:"AllCommunity",version:ct,dependsOn:[IB,Jye,lwe,Nge,jve,Kve,qve,Yve,Zve,Xve,Jve,zve,Vme,Bme,$me,Lme,Gme,Ume,_we,Eye,Uwe,l2,Qwe,eCe,lCe,fCe,Pue,CCe,fye,Qpe,FCe,NCe,PCe,GCe,nge,ywe,cB,UCe,zCe,Fue,zye,TCe]};let OB=!1;OB||(Voe.registerModules([jCe,IB]),OB=!0);class KCe{constructor(t,n){Qn(this,"gridApi",null);Qn(this,"container");Qn(this,"config");Qn(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:s,onRowSelected:o,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{s&&s(a)},onRowSelected:a=>{o&&o(a)}};return this.gridApi=pge(this.container,i),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const s={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const s={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(s=>{var o;(o=this.gridApi)==null||o.removeEventListener(n,s)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const qCe=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"),YCe=ot({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const s=e,o=n,r=B(null);Qb(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=B(null),a=q(()=>({width:"100%",height:s.height||"500px"})),l=q(()=>({...s,theme:qCe}));function c(){if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:s.height};i.value=new KCe(r.value,g),i.value.init(),u()}function u(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;o("onGridReady",g)}function d(g){var C,S;if(!g)return;(C=i.value)==null||C.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width}:null).filter(b=>b!==null);(S=i.value)==null||S.setColumnWidth(v)}function h(){var g;(g=i.value)==null||g.destroy(),i.value=null}function f(){var g;return((g=i.value)==null?void 0:g.getApi())||void 0}function p(){return i.value||null}return et(()=>s.columnDefs,(g,v)=>{const C=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");C!==S&&d(g)},{deep:!0}),ms(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),rn(()=>{c()}),ms(()=>{h()}),(g,v)=>(z(),ce("div",{ref_key:"gridContainerRef",ref:r,style:hn(a.value),class:Q(["ag-theme-quartz",["ag-table-container",s.isSorting?"is-sorting":""]])},null,6))}});function Fd(e){return fN(e)}const ZCe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:Fd(ac),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!1},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:Fd(ac)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:Fd(ac)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:Fd(ac)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:Fd(ac),cellRendererParams:n=>{var s,o,r;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated.value,tooltip:((r=(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:Fd(ac),cellRendererParams:n=>{var s,o,r;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.completedOn.value,tooltip:((r=(o=n==null?void 0:n.data)==null?void 0:o.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>kf.fromType(n))],xy={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},XCe=()=>({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(fJ),suppressMovable:!0}),JCe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},QCe=(e,t,n)=>{const{getCachedValue:s,setCachedValue:o}=Rh({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const u=await s(t);if(u&&typeof u=="string")try{return JSON.parse(u)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},i=B([]),a=XCe(),l=async u=>{const d=await r(),h=new Map;d==null||d.forEach(A=>{A.width&&h.set(A.field,A.width)});const f=ZCe(),p=kf.fromType(JCe),v=((u==null?void 0:u.map(A=>{var k;return{headerName:A.name,field:`metric_${A.id}`,editable:((k=A==null?void 0:A.auth_permission)==null?void 0:k.permission)==2,sortable:!0,filter:!1,flex:1,context:{...A},hide:!(A.is_primary||A.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:_v(ac),headerComponentParams:M=>({headerType:A.metric_type.code=="number"||A.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${A.id}`)}}))||[]).map(A=>kf.fromType(A)),C=[a,...f,...v,p],S=C.filter(A=>A.pinned==="left"),b=C.filter(A=>A.pinned==="right"||A.field==="blank"),w=C.filter(A=>!A.pinned&&A.field!=="blank");if(!d||d.length===0){i.value=C;return}const D=new Map(d.map(A=>[A.field,A])),R=new Map(w.map(A=>[A.field,A])),T=[];for(const A of d)if(A.field&&R.has(A.field)){const k=R.get(A.field);T.push({...k,hide:A.hide,width:A.width}),R.delete(A.field)}const I=Array.from(R.values()),x=[...T,...I],F=S.map(A=>{const k=D.get(A.field);return k!=null&&k.width?{...A,width:k.width}:A}),E=b.map(A=>{const k=D.get(A.field);return k!=null&&k.width?{...A,width:k.width}:A});i.value=[...F,...x,...E]};et(e,u=>l(u),{immediate:!0});const c=Tr((u,d)=>{var C,S;if(u.source!==void 0)if(["uiColumnResized","uiColumnMoved","api"].indexOf(u.source)===-1){console.warn("Skipping saveColumnConfig for source:",u.source);return}else console.warn("Executing saveColumnConfig for source:",u.source);else console.warn("Executing saveColumnConfig for source:",u);const h=(C=n==null?void 0:n.value)==null?void 0:C.getColumnDefs(),f=(S=n==null?void 0:n.value)==null?void 0:S.getColumnState().reduce((b,w)=>(b[w.colId]=Number(w.width),b),{}),p=new Map;Object.entries(f||{}).forEach(([b,w])=>{p.set(b,w)}),i.value=h||i.value;const g=h==null?void 0:h.filter(b=>!b.pinned&&b.field!=="blank"),v=(g==null?void 0:g.map(b=>({field:b.field,hide:b.hide,width:p.get(b.field)||b.width,pinned:b.pinned})))||[];d&&o(t,JSON.stringify(v))},ai);return{columnDefs:i,checkboxColumn:a,saveColumnConfig:c}},ebe=()=>{const e=un.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},tbe=e=>{var A,k,M;const{showMessage:t,showErrorNetMessage:n}=gf(),s=es(),o={domainApi:ebe(),wsCode:un.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(M=(k=(A=s==null?void 0:s.appContext)==null?void 0:A.config)==null?void 0:k.globalProperties)==null?void 0:M.apiConfig;if(!r||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new Ok(r,o);i.on("call-api",O=>{O.success?t(O.apiCode,"success"):n(O)});const a=lo({}),l=B([]),c=B(!1),u=B(null),d=B(null),h=B(1),f=B(20);let p=Promise.resolve();const{setCachedUsers:g}=B9(),v=O=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:O}),C=50,S=async(O,W,X)=>{if(!O.length)return[];const J=J4(O,W);return(await Promise.all(J.map(X))).flat()},b=async O=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:O})).data.map(X=>[X==null?void 0:X.id,X.permission])}catch(W){return console.error("Failed to fetch item permissions chunk:",W),[]}},w=async(O,W)=>{try{const X=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:O,per_page:O.length*W.length,metric_ids:W}),J=X.data.map(ae=>{const ee=new Map(ae.item_metrics.map(G=>[G.metric_id,{value:G.value,auth_permission:G==null?void 0:G.auth_permission}])),V=Object.fromEntries(W.map(G=>[G,ee.get(G)??null]));return[ae==null?void 0:ae.id,V]}),ie=new Set(X.data.map(ae=>ae==null?void 0:ae.id));for(const ae of O)if(!ie.has(ae)){const ee=Object.fromEntries(W.map(V=>[V,{value:null,auth_permission:void 0}]));J.push([ae,ee])}return J}catch(X){return console.error("Failed to fetch a chunk of metric values:",X),O.map(ie=>[ie,Object.fromEntries(W.map(ae=>[ae,void 0]))])}},D=async O=>{try{const W=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:O,per_page:O.length}),X=W.data.flatMap(J=>J.assignees);return g(X),W.data.map(J=>[J==null?void 0:J.id,J==null?void 0:J.assignees])}catch(W){return console.error("Failed to fetch a chunk of assigned users:",W),[]}},R=async O=>{if(!O.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const W=await S(O,C,b);return Object.fromEntries(W)}catch(W){return console.error("Failed to fetch item permissions:",W),{}}},T=async(O,W)=>!O.length||!W.length?{}:(p=p.then(async()=>{try{const ie=[];let ae=0;for(let V=0;V<W.length;V+=5){ae++;const G=W.slice(V,V+5),te=[];for(let ve=0;ve<G.length;ve++){const re=G[ve],oe=await S(O,C,K=>w(K,[re]));te.push(oe),await new Promise(K=>setTimeout(K,500))}ie.push(...te);const pe=V+5>=W.length}const ee={};for(const V of ie.flat()){const[G,te]=V;ee[G]||(ee[G]={}),Object.assign(ee[G],te)}return ee}catch(X){return console.error("Failed to fetch metric values:",X),{}}}),p),I=async O=>{if(!O.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const W=await S(O,C,D);return Object.fromEntries(W)}catch(W){return console.error("Failed to fetch assigned users:",W),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async O=>{const{cursor:W,offset:X,size:J,searchQuery:ie}=O;let ae=[];c.value=!0,u.value=null;try{const ee=await i.getAllItem_cursor({...O,cursor:W||void 0,offset:X||void 0,pageSize:J||f.value,...v(ie),sortBy:O.sort_by});return l.value=ee.data,d.value=ee.meta,h.value=ee.meta.current_page||0,ae=ee.data.map(V=>V==null?void 0:V.id),ee}catch(ee){throw u.value=ee,console.error("Failed to fetch items (cursor):",ee),ee}finally{const ee=async()=>{try{const[V,G]=await Promise.all([I(ae),R(ae)]);e.value.updateItemData({assignees:V,permission:G},ae);const te=await T(ae,e.value.metricIds);e.value.setMetricValues(te,new Set(ae),e.value.metricIds)}catch(V){console.error("Post-fetch processing failed:",V)}};c.value=!1,setTimeout(ee)}},getAssignableStatus:async O=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:O})}catch(W){throw console.error("Failed to fetch assignable status:",W),W}},getMetricList:async O=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:O})}catch(W){throw console.error("Failed to fetch metric list:",W),W}},getMetricValues:T,getAssignedUsers:I}};function nbe(e){return{updateRowData:(s,o)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);o.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(r.push(u),s.assignees){const h=R9((s.assignees[c]||[]).map(RF));u.data.assignees=h,i.add("assignees")}s.permission&&(u.data.permissions=s.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),i.add("description"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(s,o,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(o).map(c=>[c,new Map(r.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(s).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=i.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&i.refreshCells({rowNodes:l,columns:Array.from(r).map(c=>`metric_${c}`),force:!0})}}}function sbe(e,t,n,s,o){let r=!0;return{async getRows(i){try{s(!0),r&&(o(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,u),s(!1),o(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),s(!1),o(!1)}}}}function obe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:s,gridApi:o,fetcher:r}=e,i=B(!0),a=B(!0),l=B(!1),c=()=>{n.value=!n.value},u=v=>{if(i.value=!1,o.value=v,!v)return null;const{addEventListener:C,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=sbe(r,e.perPage,()=>s.value,w=>{i.value=w},w=>{a.value=w});return S==null||S("datasource",b),C==null||C("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var C,S;if((C=o.value)==null||C.hideOverlay(),v!==void 0&&(s.value=v),(S=o.value)==null||S.deselectAll(),t.value=[],i.value=!0,!o.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,o.value.purgeInfiniteCache(),o.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=o.value)==null||v.deselectAll(),t.value=[]},f=Tr(v=>{d(v)},ai),p=()=>{o.value},g=B(!1);return{isLoading:i,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const rbe={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."]}}},ibe=e=>{var t;return(t=Object.entries(rbe.changelog).find(([n,s])=>n===e))==null?void 0:t[1].changes},abe={key:1},lbe=Et(ot({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=B(null),o=e,r=()=>{s.value&&s.value.show()},i=B(""),a=B("idle"),l=B({file:null,format:null}),{apiServices:c}=ts(!1,{}),u=B(!1),d=async()=>{u.value=!0;const T=o.workspaceId,I=o.entityId;if(!T||!I||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(T,I))throw new Error("No response from downloadTemplate API")}catch(x){console.error("Error downloading template:",x)}u.value=!1},h=n,f=()=>{h("import-success"),S()},p=async T=>{var F,E,A;const I=new FormData,x=((F=T.name.split(".").pop())==null?void 0:F.toString())||"";if(I.append("file",T),I.append("format",x),I.append("entity_id",o.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,I),g()}catch(k){throw console.error("Error uploading file:",k),v(((A=(E=k.response)==null?void 0:E.data)==null?void 0:A.message)||"An unknown error occurred during file upload."),k}},g=()=>{a.value="success"},v=T=>{i.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:r});const b=q(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),w=q(()=>l.value.file?!1:(console.error("No file selected"),!0)),D=B(null),R=()=>{var T;(T=D.value)==null||T.clear(),i.value="",l.value={file:null,format:null},a.value="idle"};return(T,I)=>(z(),je(H(Gk),{"popup-name":b.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:R},nh({default:ge(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(z(),je(aN,{key:0,state:a.value,"error-message":i.value,overwrite:!0},null,8,["state","error-message"])):(z(),ce("div",abe,[be("div",{class:Q(T.$style["step-section"])},[be("span",{class:Q(T.$style["step-title"])},"Step 1: Download current data",2),be("span",{class:Q(T.$style["step-description"])},[...I[1]||(I[1]=[st(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),be("br",null,null,-1),be("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),fe(H(ht),{class:Q(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:ge(()=>[fe(H(at),{src:"Download"})]),default:ge(()=>[I[2]||(I[2]=st(" Download file ",-1))]),_:1},8,["class","disabled"])],2),be("div",{class:Q(T.$style["step-section"])},[be("span",{class:Q(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),fe(H(TO),{modelValue:l.value,"onUpdate:modelValue":I[0]||(I[0]=x=>l.value=x),ref_key:"filUploaderRef",ref:D},null,8,["modelValue"])],2),be("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(H(ht),{style:{flex:"1"},variant:"secondary",onClick:S},{default:ge(()=>[...I[3]||(I[3]=[st(" Cancel ",-1)])]),_:1}),fe(H(ht),{disabled:w.value,style:{flex:"1"},variant:"primary",onClick:C},{default:ge(()=>[...I[4]||(I[4]=[st(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ge(()=>[fe(H(ht),{style:{flex:"1"},variant:"primary",onClick:f},{default:ge(()=>[...I[5]||(I[5]=[st(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:ge(()=>[fe(H(ht),{style:{flex:"1"},variant:"primary",onClick:R},{default:ge(()=>[...I[6]||(I[6]=[st(" 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"}}]]),cbe=Et(ot({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=To,s=Yb(),{setUserPermissions:o,setEntityPermissions:r}=s,{entityPermissions:i}=Qs(s),a=qt,l=B(null),c={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},u=B(""),d=q(()=>{var Ye;const ke=((Ye=i.value)==null?void 0:Ye.has_create_item_permission)==1||!1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!ke},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!ke,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!ke,id:"overwrite_scenes_option"}]}),h=e;kf.initialize({wrapVueCellRenderer:_v,wrapVueCellEditor:fN});const f=ef(),{switchInstanceFunc:p}=Qs(f);rn(()=>{const ke=es();p.value=ke==null?void 0:ke.appContext.config.globalProperties.switchInstance;const Ye=new BroadcastChannel("focusable_channel");vt(()=>{setTimeout(()=>{Ye.postMessage("Focusable elements updated")},7e3)})});const g=B(null),v=B([]),C=Wm(),{rowCount:S}=Qs(C),b=B(!1),w=B(""),D=B(),R=GA(),{metricList:T}=Qs(R),I=B(""),x=B(!1),F=B(new Set),E=B(new Map),{apiServices:A}=ts(!1,h),{columnDefs:k,checkboxColumn:M,saveColumnConfig:O}=QCe(T,h.entityId,g),W=B();et(()=>k,()=>{var ke;(ke=W.value)==null||ke.updateColumnDefs(k.value)},{deep:!0});const X=(ke,Ye)=>{O(ke,Ye)},{updateRowData:J,setMetricValues:ie}=nbe(g),ae=q(()=>({isSearching:w.value.length>0,isFiltering:!(Object.keys(Ae.value||{}).length==1&&Object.keys(Ae.value)[0]=="preflight_status")&&Object.keys(Ae.value||{}).length>0})),ee=q(um),V=q(()=>k.value.filter(ke=>{var Ye;return((Ye=ke.field)==null?void 0:Ye.startsWith("metric_"))&&!ke.hide}).map(ke=>{var Ye;return((Ye=ke.field)==null?void 0:Ye.replace("metric_",""))||""}));Xr("timezone",ee);const G=q(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:V.value,updateItemData:J,setMetricValues:ie})),{fetchItems:te,getMetricList:pe,cusorMap:ve,getMetricValues:re}=tbe(G),oe=q(()=>{if(!g.value)return!1;const ke=g.value.getSelectedRows().length;return ke>0&&ke>=S.value.total}),K=q(()=>{var ke;return((ke=l.value)==null?void 0:ke.name)||"Items"}),me=ke=>{setTimeout(()=>{vt(()=>{var Ye,Qt;g.value&&(ke?(Ye=g.value)==null||Ye.showNoRowsOverlay():(Qt=g.value)==null||Qt.hideOverlay())})},500)},se=(ke,Ye)=>{var Qt;S.value.total=ke.meta.total??0,(Qt=ke.meta.next)!=null&&Qt.cursor&&(ve[Ye+1]=ke.meta.next.cursor),I.value=ke.meta["X-Tsr-signature"]||"",ke.meta.total===0?me(!0):me(!1)},Se=DO(),U=B(null),{sortingAPIConfiguration:Z,isSortingRunning:de}=Qs(Se),Ae=B({preflight_status:"1"}),Fe=q(()=>({...Ae.value,search:w.value}));Xr("filterParams",Fe);const Le=B([]),ye=async({page:ke,pageSize:Ye,filterText:Qt})=>{var Go;(Go=g.value)==null||Go.hideOverlay();const Xt=ve[ke],Co=!Xt&&ke>1?(ke-1)*Ye:void 0,wa=Z.value;wa.length>0&&(de.value=!0);try{const Ca={cursor:Xt,size:Ye,searchQuery:Qt,offset:Co,sort_by:wa,...Ae.value},oo=await te(Ca);if(!oo)return{rows:[],total:0};const vp=(Kn=>{const Ai=Kn.data.map(bo=>TF(bo,ee.value));return Ai.forEach(bo=>{F.value.add(String(bo.id)),E.value.set(String(bo.id),{})}),Ai})(oo);return se(oo,ke),{rows:vp,total:S.value.total}}catch(Ca){return console.error("Failed to fetch items:",Ca),{rows:[],total:0}}finally{de.value=!1}},{isLoading:N,toggleSidebar:$,onGridReady:le,handleUnSelect:Ge,handleSelectAll:we,onSearch:ze,firstLoad:Ue}=obe({selectRowData:B([]),isSidebarOpen:b,quickFilterText:w,gridApi:g,perPage:c.ROWS_PER_PAGE,fetcher:ye}),_e=B([]),Ve=()=>{var ke;_e.value=((ke=g.value)==null?void 0:ke.getSelectedRows())||[]},gt=lo({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),kt=q(()=>({blockLoadDebounceMillis:1e3,columnDefs:k.value,rowModelType:"infinite",cacheBlockSize:c.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:c.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:c.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:Ut,noRowsOverlayComponent:_v(JQ),noRowsOverlayComponentParams:()=>ae.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:ke=>ke.data.id,getRowClass:ke=>{if(!ke.data)return["row-empty"];const Ye=["row-highlight"];return ke.data.id||Ye.push("row-inactive"),ke.data.isDeleted&&Ye.push("row-deleted"),ke.data.disabled&&Ye.push("row-deleted"),ke.data.isArchived&&Ye.push("row-archived"),ke.data.isLocked&&Ye.push("row-locked"),Ye},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:A.value,sorting:de.value},onCellKeyDown:ke=>{var Ye,Qt,Xt;if(ke.data.isDeleted)return!1;if(((Ye=ke==null?void 0:ke.event)==null?void 0:Ye.key)==="Enter"){const{api:Co,node:wa,column:Go}=ke,Ca=Co.getCellRendererInstances({rowNodes:[wa],columns:[Go]});if(Ca.length>0){const oo=Ca[0];oo&&typeof((Qt=oo.componsenExposed)==null?void 0:Qt.focus)=="function"&&((Xt=oo.componsenExposed)==null||Xt.focus())}}},isRowSelectable:ke=>!ke.group,suppressKeyboardEvent:ke=>{var Xt;if((Xt=ke.data)!=null&&Xt.isDeleted)return!0;const Ye=ke.event.key,Qt=ke.editing;return Qt&&Ye==="Tab"?!0:Qt&&Ye==="Enter"?!1:Ye==="Enter"?(ke.event.preventDefault(),ke.event.stopPropagation(),!0):Ye==="ArrowUp"||Ye==="ArrowDown"||Ye==="ArrowLeft"||Ye==="ArrowRight"||Ye==="Tab"||Ye==="Enter"},navigateToNextCell:()=>null,onBodyScroll:ke=>{const Ye=ke.api.getFirstDisplayedRowIndex(),Qt=ke.api.getLastDisplayedRowIndex();gt.rowsDisplay.fromIndex=Ye,gt.rowsDisplay.toIndex=Qt,gt.columnsDisplay=ke.api.getAllDisplayedVirtualColumns().map(Xt=>Xt.getColId())},onViewportChanged:ke=>{gt.columnsDisplay=ke.api.getAllDisplayedVirtualColumns().map(Ye=>Ye.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(ke){if(ke.data.isDeleted&&ke.api.stopEditing(),ke.colDef.field=="options"){const Ye=ke.api.getCellRendererInstances({rowNodes:[ke.node],columns:[ke.column]});Ye.length>0&&Ye[0].focusUi()}},tabToNextCell:ke=>{let Ye=ke.nextCellPosition;if(Ye&&Ye.column.getColId()==="ag-Grid-SelectionColumn"){const Qt=ke.api.getAllDisplayedColumns(),Xt=Qt.indexOf(Ye.column),Co=ke.backwards?-1:1,wa=Qt[Xt+Co];if(wa)return{rowIndex:Ye.rowIndex,column:wa,rowPinned:Ye.rowPinned}}return Ye}}));function Ut(){if(!g.value)return;let ke=0;g.value.forEachNode(Ye=>{Ye.data&&ke++}),S.value.loaded=Math.min(ke,S.value.total)}et(()=>Z,()=>{g.value&&(I.value="",F.value.clear(),g.value.deselectAll(),Object.keys(ve).forEach(ke=>delete ve[Number(ke)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const en=B(),zt=B(),Ne=()=>{var ke;(ke=zt.value)==null||ke.open()},qe=()=>{var ke;(ke=en.value)==null||ke.open()},wt=async()=>{Ue.value=!0,g.value&&(I.value="",F.value.clear(),Object.keys(ve).forEach(ke=>delete ve[Number(ke)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},Nt=q(()=>un.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Wt=B();q(()=>{var ke;return(ke=ibe(Nt.value))==null?void 0:ke.map(Ye=>`<div>• ${Ye}</div>`).join(`
|
|
259
|
+
`)});function nt(ke){var Ye;ke==="new_scene"?(Ye=Wt.value)==null||Ye.show():ke==="import_scenes"?qe():ke==="overwrite_scenes"&&Ne()}const Is=ke=>{v.value=ke.api.getSelectedRows().map(Ye=>Ye.id)},Ur=ke=>{const Ye=le(ke);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",Xt=>X(Xt,!0)),Ye.addEventListener("columnResized",Xt=>X(Xt,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport")),Ye},xi=()=>{var ke;u.value=(((ke=document.getElementById("item-table-layout-id"))==null?void 0:ke.clientHeight)??0)-78+"px"};rn(()=>{vt(()=>{xi()}),window.addEventListener("resize",xi);function ke(){requestAnimationFrame(ke)}ke()}),ms(()=>{window.removeEventListener("resize",xi)});const gr=async({code:ke,name:Ye})=>{await ze(ke),setTimeout(()=>{var Qt;(Qt=D.value)==null||Qt.setValue(Ye)},300)},ya=ke=>{if(!g.value)return;const Ye=g.value.getRowNode(ke);Ye?(g.value.ensureIndexVisible(Number(Ye.rowIndex),"middle"),g.value.flashCells({rowNodes:[Ye],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(S.value.total-1,"bottom")},ml=ke=>ke.metric_type.code==="number"?"number":"default",Fi=async()=>{if(h.entityId)try{const ke=await pe(h.entityId);T.value=ke.data.map(Ye=>({...Ye,sortType:ml(Ye)}))}catch(ke){console.error("Failed to initialize metric list:",ke),T.value=[]}},Pi=async()=>{if(A.value)try{const ke=await A.value.getUserPermission(h.workspaceId);o(ke)}catch(ke){console.error("Failed to fetch user permissions:",ke)}},mr=async()=>{if(A.value)try{const ke=await A.value.getEntityDetail(h.workspaceId,h.entityId);r(ke.permission),l.value=ke}catch(ke){console.error("Failed to fetch entity details:",ke)}},Wr=hv(),{setUser:Pd}=Wr,kn=async()=>{if(A.value)try{const ke=await A.value.getMe();return Pd(ke),ke}catch(ke){console.error("Failed to fetch user details:",ke)}},fs=async()=>{var ke;if(A.value)try{const Ye=await A.value.getWorkspaces(h.workspaceId),Qt=(ke=Ye.data[0])==null?void 0:ke.ws_user_role_id;return Qt&&Wr.setUserRoleId(Qt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};et(()=>[h.entityId,h.workspaceId],async([ke,Ye])=>{!ke||!Ye||(kn(),fs(),Fi(),Pi(),mr())},{immediate:!0,deep:!0}),et(V,(ke,Ye)=>{const Qt=ke.filter(Xt=>!(Ye!=null&&Ye.includes(Xt)));Qt.length>0&&re(Array.from(F.value),Qt).then(Xt=>{ie(Xt,F.value,Qt)})},{immediate:!0,deep:!0}),et(I,(ke,Ye)=>{x.value=!!(Ye&&ke&&Ye!==ke)}),t({refreshTable:wt});const b_=ke=>{Ae.value=ke,wt()},Ad=ke=>{Le.value=ke,wt()},kd=ke=>{k.value=ke||[],X({},!0)},Od=q(()=>{var Xt;const ke=un.getInstance().getItem("ws.terminology"),Ye=ke?JSON.parse(ke):null;return`New ${((Xt=Ye==null?void 0:Ye.find(Co=>Co.code==="scene"))==null?void 0:Xt.name)||"Scene"}`});return B('<p><br>Here is template notess..</p><p><strong>this is Bold</strong>,<i> this is Italic</i>,<u> this is underline</u><br>this is hightlight , <br>1</p><p>1</p><ul class="todo-list"><li data-list-item-id="ed7bc572523bb0f35972903183a9d7346"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">1</span></li><li data-list-item-id="ef5b3e469bed2b79951b489fd3a25ffaa"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">2</span></li><li data-list-item-id="ed25bcd78b8b608ed432f01164608cb0d"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">3</span></li><li data-list-item-id="e05c8f5e183d4de144c2a6a8059691d5f"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">4</span></li></ul><p>This is list</p><ul><li data-list-item-id="ed6b9c0b0b97baf09030ee79ea57c40a9">1</li><li data-list-item-id="ef1fc34bceeb4a82abc8c61fe28972c9b">2</li><li data-list-item-id="e950cf66600b9cc40f130a396a6831a75">3</li><li data-list-item-id="e64b6e87f244f9268e45b32b785308a6e">4</li></ul><p> </p>'),(ke,Ye)=>{const Qt=Eo("focusable");return z(),je(H(lJ),{"is-sidebar-open":b.value,onCloseSidebar:H($),onSidebarClear:H($),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:H($)},{"header-left":ge(()=>{var Xt;return[((Xt=H(i))==null?void 0:Xt.has_create_item_permission)==1?(z(),je(H(pS),{key:0,variant:["primary"],options:d.value,onSelect:nt,onHandleClick:Ye[1]||(Ye[1]=Co=>nt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ge(()=>[Ke(fe(H(ht),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Co=>nt("new_scene")),label:Od.value},null,8,["label"]),[[Qt,1]])]),_:1},8,["options"])):Xe("",!0)]}),"header-actions":ge(()=>[fe(H(Mee),{"onUpdate:assignees":Ad,onApplyFilter:b_,loading:H(Ue),entityId:h.entityId},null,8,["loading","entityId"]),Ke(fe(H(tS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=Xt=>w.value=Xt),onSearch:H(ze),class:Q(ke.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=Xt=>H(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:D},null,8,["modelValue","onSearch","class"]),[[H(n),{isLoading:H(Ue),fullwidth:!0}]]),Ke((z(),je(H(LA),{status:H(N)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:ge(()=>[Ke((z(),je(H(ht),{variant:["secondary","icon"],disabled:H(N),onClick:wt},{default:ge(()=>[fe(H(at),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[Qt,5],[H(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[H(n),{isLoading:H(Ue),fullwidth:!0}]]),Ke(fe(H(OQ),{"model-value":H(k),onChange:Ye[4]||(Ye[4]=Xt=>kd(Xt)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:W,"checkbox-column":H(M),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[H(n),{isLoading:H(Ue),fullwidth:!0}]])]),grid:ge(({availableHeight:Xt})=>[fe(H(YCe),Kt({id:"item_table_main",ref_key:"agGrid",ref:U},kt.value,{height:Xt+"px",isSorting:H(de),onOnGridReady:Ur,onSelectionChanged:Is}),null,16,["height","isSorting"])]),footer:ge(()=>[be("div",{class:Q(ke.$style.tableFooter),id:"table_footer"},[be("span",null,[Ye[5]||(Ye[5]=st(" Showing ",-1)),be("b",null,Ct(H(S).loaded)+" of "+Ct(H(S).total),1)])],2)]),"new-row":ge(()=>[fe(H(dee),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:gr,onFocusOnId:ya},null,512)]),"bulk-update-actions":ge(()=>[!b.value&&v.value.length>0?Ke((z(),je(H(eJ),{key:0,selectRowData:_e.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:H(Ge),onSelectAll:H(we),"take-name":K.value,"selected-all":oe.value,"total-rows":H(S).total,"visible-rows":H(S).loaded,onUpdated:Ve,loading:H(N)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ko,!b.value&&v.value.length>0]]):Xe("",!0)]),snackbar:ge(()=>[fe(H(UJ))]),popup:ge(()=>[fe(Ise,{ref_key:"popupCreateSceneRef",ref:en,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"]),fe(lbe,{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.126",ube={key:0},dbe=Et(ot({__name:"app",setup(e){const t=q(()=>n.id.length===0||n.workspaceId.length===0),n=lo({id:"",workspaceId:"",apiConfig:{}}),s=gf(),{showMessage:o,showErrorNetMessage:r}=s,i=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=B(null),c=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};eh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",MB);try{if(l.value=es(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||un.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:un.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new Ok(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),ms(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=q(()=>n.id),d=q(()=>n.workspaceId);return Xr("workspaceId",d),Xr("entityId",u),(h,f)=>(z(),ce("div",{class:Q(h.$style.dashboardPluginWrapper)},[t.value?(z(),ce("span",ube," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(z(),je(H(cbe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),C_=async(e={},t={})=>{const n=bT(dbe),s=uY();n.use(s);const o=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,o.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${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",qt),n.directive("focusable",Wi);const i=await Rse();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=C_),On.default=C_,On.initDashboard=C_,Object.defineProperties(On,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|