@arbocollab/arbo-plugin-item-table 0.0.31 → 0.0.32

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.
@@ -32987,7 +32987,7 @@ const $Z = /* @__PURE__ */ dt({
32987
32987
  return y.textContent = h, y.style.fontWeight = f, y.style.fontSize = g, y.style.color = m, y;
32988
32988
  }, s = document.createElement("div");
32989
32989
  s.style.display = "flex", s.style.flexDirection = "column";
32990
- const r = document.createElement("div"), a = document.createElement("div"), l = o("Valid formats:", "normal", "14px", "#02C39A"), u = o("Invalid formats:", "normal", "14px", "#FF5200"), c = o("2025.12.31, 2025-12-31, 2025/12/31 ", "normal", "14px", ""), d = o("12.31.2025, 2025.31.12,.. ", "normal", "14px", "");
32990
+ const r = document.createElement("div"), a = document.createElement("div"), l = o("Valid formats:", "normal", "14px", "#02C39A"), u = o("Invalid formats:", "normal", "14px", "#FF5200"), c = o(" 2025.12.31, 2025-12-31, 2025/12/31 ", "normal", "14px", ""), d = o(" 12.31.2025, 2025.31.12", "normal", "14px", "");
32991
32991
  return r.appendChild(l), r.appendChild(c), a.appendChild(u), a.appendChild(d), s.appendChild(r), s.appendChild(a), s.outerHTML;
32992
32992
  })(), i = bn;
32993
32993
  return (o, s) => (K(), Ce("div", {
@@ -33186,7 +33186,12 @@ const $Z = /* @__PURE__ */ dt({
33186
33186
  id: o.entityId
33187
33187
  }, null, 8, ["modelValue", "workspace-id", "id"])
33188
33188
  ], 2),
33189
- ye(GA)
33189
+ we("div", {
33190
+ class: z(k.$style["step-section"]),
33191
+ style: { "padding-top": "0", "padding-bottom": "0" }
33192
+ }, [
33193
+ ye(GA)
33194
+ ], 2)
33190
33195
  ]))
33191
33196
  ]),
33192
33197
  _: 2
@@ -75662,7 +75667,12 @@ const kme = { key: 1 }, Ome = /* @__PURE__ */ dt({
75662
75667
  ref: R
75663
75668
  }, null, 8, ["modelValue"])
75664
75669
  ], 2),
75665
- ye(GA)
75670
+ we("div", {
75671
+ class: z(x.$style["step-section"]),
75672
+ style: { "padding-top": "0", "padding-bottom": "0" }
75673
+ }, [
75674
+ ye(GA)
75675
+ ], 2)
75666
75676
  ]))
75667
75677
  ]),
75668
75678
  _: 2
@@ -76219,7 +76229,7 @@ const kme = { key: 1 }, Ome = /* @__PURE__ */ dt({
76219
76229
  "beta-tag": "_beta-tag_1lefh_57"
76220
76230
  }, Kme = {
76221
76231
  $style: jme
76222
- }, qme = /* @__PURE__ */ wt(Hme, [["__cssModules", Kme]]), gL = "0.0.31", Yme = { key: 0 }, Zme = /* @__PURE__ */ dt({
76232
+ }, qme = /* @__PURE__ */ wt(Hme, [["__cssModules", Kme]]), gL = "0.0.32", Yme = { key: 0 }, Zme = /* @__PURE__ */ dt({
76223
76233
  __name: "app",
76224
76234
  setup(e) {
76225
76235
  const t = j(() => n.id.length === 0 || n.workspaceId.length === 0), n = $o({
@@ -106,7 +106,7 @@ This will fail in production.`);r=ja,r._s.has(e)||(o?WC(e,t,i,r):BP(e,i,r),M.env
106
106
  </clipPath>
107
107
  </defs>
108
108
  </svg>`,s=bd(),{showMessage:r}=s,a=Z(!1),l=Z(!1),c=e,u=Z({file:null,format:null,isValid:void 0}),d=j(()=>{var I;return((I=c.acceptTypes)==null?void 0:I.map(O=>`.${O}`).join(","))||".xlsx,.xls,.csv"}),h=j(()=>u.value.format?o(u.value.format):""),f=j(()=>{var I;if(!u.value.isValid)return`Invalid file type. Please upload a ${(I=c.acceptTypes)==null?void 0:I.join(", ")} file.`}),g=j(()=>!!u.value.file),m=()=>{var I;(I=i.value)==null||I.click()},y=j(()=>u.value.file?u.value.file.name:""),b=I=>{var x;const O=c.acceptTypes||["xlsx","xls","csv"],k=(x=I.name.split(".").pop())==null?void 0:x.toLowerCase();return k?O.includes(k):!1},S=I=>{var k,x;const O=b(I);I&&O?(u.value.isValid=O,a.value=!O,u.value.file=I,u.value.format=((k=I.name.split(".").pop())==null?void 0:k.toLowerCase())||null):r(`Invalid file type. Please upload a ${(x=c.acceptTypes)==null?void 0:x.join(", ")} file.`,"error")},F=I=>{const O=I.target;if(O.files&&O.files[0]){const k=O.files[0];S(k)}},C=()=>{l.value=!0},R=()=>{l.value=!1},E=I=>{if(l.value=!1,I.dataTransfer&&I.dataTransfer.files&&I.dataTransfer.files[0]){const O=I.dataTransfer.files[0];S(O)}},_=n;return ct(u,I=>{_("update:modelValue",I)},{deep:!0}),t({internalValue:u,clear:()=>{u.value={file:null,format:null},a.value=!1}}),(I,O)=>{const k=af("tooltip");return K(),Ce("div",{class:z([I.$style["drop-area"],{[I.$style["is-dragging"]]:l.value,[I.$style.error]:a.value}]),onDragenter:rn(C,["prevent"]),onDragover:rn(C,["prevent"]),onDragleave:rn(R,["prevent"]),onDrop:rn(E,["prevent"]),onClick:m},[g.value?ot("",!0):(K(),Ce("div",{key:0,class:z(I.$style["drop-area-content"])},[ye(gt,{src:"Upload",size:"24",color:"#3C9BFA"}),we("span",null,[ye(ft,{variant:["tertiary","text"],class:z(I.$style["upload-btn"])},{default:Se(()=>[...O[0]||(O[0]=[ut(" Click to upload ",-1)])]),_:1},8,["class"]),O[1]||(O[1]=ut(" or drag and drop files here ",-1))])],2)),g.value?nt((K(),Ce("div",{key:1,class:z(I.$style["drop-area-file"])},[we("div",{innerHTML:h.value},null,8,y7),nt((K(),Ce("span",{class:z(I.$style["file-name"])},[ut(bt(y.value),1)],2)),[[k,{content:y.value}]])],2)),[[k,f.value]]):ot("",!0),we("input",{ref_key:"fileInput",ref:i,type:"file",style:{display:"none"},accept:d.value,onChange:F},null,40,C7)],34)}}}),[["__cssModules",{$style:{"upload-btn":"_upload-btn_1ybeg_1","drop-area":"_drop-area_1ybeg_8","is-dragging":"_is-dragging_1ybeg_18",error:"_error_1ybeg_22","drop-area-content":"_drop-area-content_1ybeg_26","drop-area-file":"_drop-area-file_1ybeg_34","file-name":"_file-name_1ybeg_42","clear-button":"_clear-button_1ybeg_51"}}]]),w7={width:"14",height:"12",viewBox:"0 0 14 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b7=["fill"],S7=Ct(lt({__name:"FilterBox",emits:["update:assignees"],setup(e,{emit:t}){const{hide:n,isVisible:i,triggerRef:o,popupRef:s}=Qs({offset:[0,0]}),r=t,a=j(()=>ZP.get("ws.user-access-id")||""),l=Z(!1);ct(l,u=>{u?r("update:assignees",[a.value]):r("update:assignees",[]),n()});const c=j(()=>l.value?"#000":"#3C9BFA");return(u,d)=>(K(),Ce("div",null,[ye(ft,{variant:"secondary",ref_key:"triggerRef",ref:o,actived:X(i),style:mn({border:l.value?"1px solid var(--primary-color)":""})},{prefix:Se(()=>[(K(),Ce("svg",w7,[we("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:c.value},null,8,b7)]))]),default:Se(()=>[d[1]||(d[1]=ut(" Filter ",-1))]),_:1},8,["actived","style"]),we("div",{ref_key:"popupRef",ref:s},[we("div",{class:z(u.$style.row)},[ye(ew,{size:"small",label:"Show Archived Items",modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=h=>l.value=h)},null,8,["modelValue"]),d[2]||(d[2]=ut(" Assigned to me ",-1))],2)],512)]))}}),[["__cssModules",{$style:{row:"_row_1akrr_1"}}]]),E7={style:{color:"#ff5200"}},_1=Ct(lt({__name:"ImportVisual",props:{state:{},errorMessage:{},overwrite:{type:Boolean}},setup(e){return(t,n)=>(K(),Ce("div",{class:z(t.$style["inform-layout"])},[e.state==="importing"?(K(),Ce("div",{key:0,class:z(t.$style["import-error"]),style:{width:"500px"}},[ye(X(kp),{src:"UploadInProgress","max-height":180,"max-width":180})],2)):e.state==="error"?(K(),Ce("div",{key:1,class:z(t.$style["import-error"]),style:{width:"500px"}},[ye(X(kp),{src:"Unsuccessful1","max-height":180,"max-width":180}),we("span",{class:z(t.$style["step-title"])}," File doesn’t meet requirements. Check file and try again. ",2),we("div",E7,[we("span",{class:z(t.$style["step-description"])},"Error code",2),we("span",{class:z(t.$style["step-description"])},bt(e.errorMessage),3)])],2)):e.state==="success"?(K(),Ce(kt,{key:2},[ye(X(kp),{src:"Successful1","max-height":180,"max-width":180}),we("span",{class:z(t.$style["step-title"])},bt(e.overwrite?`Existing data will be overwritten in the background.
109
- Refresh to see updates.`:"Work will be created in background. Refresh to see updates."),3)],64)):ot("",!0)],2))}}),[["__cssModules",{$style:{"inform-layout":"_inform-layout_1og33_1","import-error":"_import-error_1og33_11","step-title":"_step-title_1og33_22","step-description":"_step-description_1og33_27"}}]]),x1=Ct(lt({__name:"DateRule",setup(e){const n=(()=>{const o=(h,f,g,m)=>{const y=document.createElement("span");return y.textContent=h,y.style.fontWeight=f,y.style.fontSize=g,y.style.color=m,y},s=document.createElement("div");s.style.display="flex",s.style.flexDirection="column";const r=document.createElement("div"),a=document.createElement("div"),l=o("Valid formats:","normal","14px","#02C39A"),c=o("Invalid formats:","normal","14px","#FF5200"),u=o("2025.12.31, 2025-12-31, 2025/12/31 ","normal","14px",""),d=o("12.31.2025, 2025.31.12,.. ","normal","14px","");return r.appendChild(l),r.appendChild(u),a.appendChild(c),a.appendChild(d),s.appendChild(r),s.appendChild(a),s.outerHTML})(),i=yn;return(o,s)=>(K(),Ce("div",{class:z(o.$style["date-format-guide"])},[we("span",{class:z(o.$style["step-title-2"])},[s[0]||(s[0]=ut(" Date format guide ",-1)),nt(ye(X(gt),{src:"InfoCircle",color:"#A6A6A6"},null,512),[[X(i),{content:X(n)}]])],2),we("div",{class:z(o.$style["date-rule-section"])},[s[3]||(s[3]=we("span",null,"Enter dates in one of these formats:",-1)),we("ul",{class:z(o.$style["step-description"])},[we("li",{class:z(o.$style["date-rule"])},[...s[1]||(s[1]=[we("b",null,"DD MM YYYY",-1),ut(" (Day-Month-Year) ",-1)])],2),we("li",{class:z(o.$style["date-rule"])},[...s[2]||(s[2]=[we("b",null,"YYYY MM DD",-1),ut(" (Year-Month-Day) ",-1)])],2)],2)],2)],2))}}),[["__cssModules",{$style:{"date-format-guide":"_date-format-guide_ef59d_1","step-title-2":"_step-title-2_ef59d_13","date-rule-section":"_date-rule-section_ef59d_25","step-description":"_step-description_ef59d_29","date-rule":"_date-rule_ef59d_25"}}]]),R7={key:1},D7=Ct(lt({__name:"PopupCreateScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const i=Z(null),o=e,s=()=>{i.value&&i.value.show()},r=Z(""),a=Z("idle"),l=j(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Create new work"})[a.value]),c=Z(null),u=Z({file:null,format:null}),{apiServices:d}=po(!1,o),h=async k=>{var P,N;if(((P=d==null?void 0:d.value)==null?void 0:P.getStatuses)===void 0){console.error("API services not available",(N=d==null?void 0:d.value)==null?void 0:N.getStatuses);return}return await d.value.getStatuses(o.workspaceId,o.entityId,k)},f=Z(!1),g=async()=>{f.value=!0;const k=o.workspaceId,x=o.entityId;if(!k||!x||!d.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await d.value.downloadTemplate(k,x))throw new Error("No response from downloadTemplate API")}catch(P){console.error("Error downloading template:",P)}f.value=!1},m=async k=>{var N,G,se;const x=new FormData,P=((N=k.name.split(".").pop())==null?void 0:N.toString())||"";if(x.append("file",k),x.append("format",P),x.append("template_flow_status_id",R.value||""),!d.value||!o.workspaceId||!o.entityId){console.error("API services not available");return}try{const B=await d.value.addNewSceneViaImportFile(o.workspaceId,o.entityId,x);y()}catch(B){throw console.error("Error uploading file:",B),b(((se=(G=B.response)==null?void 0:G.data)==null?void 0:se.message)||"An unknown error occurred during file upload."),B}},y=()=>{a.value="success"},b=k=>{r.value=k,a.value="error"},S=n,F=()=>{S("import-success"),O()},C=async()=>{if(!u.value||!u.value.file){console.error("No file to upload");return}a.value="importing",await m(u.value.file)};t({open:s});const R=Z(null),E=j(()=>!u.value.file||!u.value.format||!u.value.isValid||!R.value),_=Z(null),I=()=>{var k,x;(k=c.value)==null||k.clear(),r.value="",u.value={file:null,format:null},R.value=null,(x=_==null?void 0:_.value)==null||x.clear(),a.value="idle"},O=()=>{var k;I(),(k=i.value)==null||k.hide()};return(k,x)=>(K(),Xe(X(QP),{"popup-name":l.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:i,onHidden:I},Su({default:Se(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(K(),Xe(_1,{key:0,state:a.value,"error-message":r.value},null,8,["state","error-message"])):(K(),Ce("div",R7,[we("div",{class:z(k.$style["step-section"])},[we("span",{class:z(k.$style["step-title"])},"Step 1: Download sample file",2),we("span",{class:z(k.$style["step-description"])}," Get a sample file with all columns ready for editing. ",2),ye(X(ft),{class:z(k.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:f.value,onHandleClick:g},{prefix:Se(()=>[ye(X(gt),{src:"Download"})]),default:Se(()=>[x[2]||(x[2]=ut(" Download sample file ",-1))]),_:1},8,["class","disabled"])],2),we("div",{class:z(k.$style["step-section"])},[we("span",{class:z(k.$style["step-title"])},"Step 2: Upload your file (.xlsx, .xls, .csv)",2),ye(X(D1),{modelValue:u.value,"onUpdate:modelValue":x[0]||(x[0]=P=>u.value=P),ref_key:"filUploaderRef",ref:c},null,8,["modelValue"])],2),we("div",{class:z(k.$style["step-section"])},[we("span",{class:z(k.$style["step-title"])},"Step 3: Select status",2),we("span",{class:z(k.$style["step-description"])},"Choose a status for the new work.",2),ye(X(p7),{ref_key:"statusRef",ref:_,modelValue:R.value,"onUpdate:modelValue":x[1]||(x[1]=P=>R.value=P),"get-status-func":h,"workspace-id":o.workspaceId,id:o.entityId},null,8,["modelValue","workspace-id","id"])],2),ye(x1)]))]),_:2},[a.value==="idle"?{name:"footer",fn:Se(()=>[ye(X(ft),{style:{flex:"1"},variant:"secondary",onClick:O},{default:Se(()=>[...x[3]||(x[3]=[ut(" Cancel ",-1)])]),_:1}),ye(X(ft),{disabled:E.value,style:{flex:"1"},variant:"primary",onClick:C},{default:Se(()=>[...x[4]||(x[4]=[ut(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:Se(()=>[ye(X(ft),{style:{flex:"1"},variant:"primary",onClick:F},{default:Se(()=>[...x[5]||(x[5]=[ut(" Close ",-1)])]),_:1})]),key:"1"}:a.value=="error"?{name:"footer",fn:Se(()=>[ye(X(ft),{style:{flex:"1"},variant:"primary",onClick:I},{default:Se(()=>[...x[6]||(x[6]=[ut(" Try Again ",-1)])]),_:1})]),key:"2"}:void 0]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_jt1wo_1","step-title":"_step-title_jt1wo_11","step-title-2":"_step-title-2_jt1wo_17","step-description":"_step-description_jt1wo_23","date-format-guide":"_date-format-guide_jt1wo_28","import-error":"_import-error_jt1wo_39","drop-area":"_drop-area_jt1wo_49","is-dragging":"_is-dragging_jt1wo_49","drop-area-content":"_drop-area-content_jt1wo_52",browse:"_browse_jt1wo_61","download-sample-btn":"_download-sample-btn_jt1wo_65"}}]]),Qp={id:void 0,assignees:lK,status:RK,dateRange:cK,isStarted:Ya,isCompleted:Ya,lastUpdated:Ya,completedOn:Ya,isDeleted:Ya,isArchived:Ya,isProcessing:Ya,name:XP,options:A8,metric:CK,__checkboxSelection:void 0},_7={id:!1,assignees:!0,status:!0,dateRange:!0,isStarted:!1,isCompleted:!1,lastUpdated:!1,completedOn:!1,isDeleted:!1,isArchived:!1,isProcessing:!1,name:!1,options:!0,metric:!1,__checkboxSelection:!1},x7={id:void 0,assignees:$P,status:jP,dateRange:uK,isStarted:void 0,isCompleted:void 0,lastUpdated:void 0,completedOn:void 0,isDeleted:void 0,isArchived:void 0,isProcessing:void 0,name:XP,options:JP,metric:void 0,__checkboxSelection:void 0},F1={id:[100,100],assignees:[200,200],status:[200,200],dateRange:[255,255],isStarted:[150,150],isCompleted:[150,150],lastUpdated:[180,180],completedOn:[180,180],isDeleted:[void 0,void 0],isArchived:[void 0,void 0],isProcessing:[void 0,void 0],name:[350,500],options:[50,50],metric:[200,300],__checkboxSelection:[50,50]},F7={dateRange:{cellEditorPopupPosition:"under",cellEditorPopup:!1},name:{cellEditorPopupPosition:"over",cellEditor:!1,cellEditorPopup:!1},metric:{suppressKeyboardEvent:void 0,suppressNavigable:!1,suppressMovable:!1,cellClass:"ag-cell-optimized"}};function Sw(e){var o,s,r,a;const t=((o=e==null?void 0:e.data)==null?void 0:o.permissions)||void 0,n={assignees:(t==null?void 0:t.has_update_assignee_permission)||0,completedOn:0,name:0,permissions:0,status:(t==null?void 0:t.has_edit_template_flow_status_permission)||0,dateRange:(t==null?void 0:t.has_edit_date_permission)||0,isStarted:0,isDeleted:0,isArchived:0,isProcessing:0,lastUpdated:0,id:0,isCompleted:0,options:1};if(e.data===void 0)return{disabled:!1,readOnly:!1};if(((s=e.colDef)==null?void 0:s.field)=="options")return{disabled:!1,readOnly:!1};if(!t)return;let i={disabled:!1,readOnly:(t==null?void 0:t.has_edit_permission)==0};if(((r=e.colDef)==null?void 0:r.field)!=="name"){const l=n[(a=e.colDef)==null?void 0:a.field];i=l?{disabled:l===-1,readOnly:l!==-1&&l!==1}:{disabled:!1,readOnly:!0}}return i}class Ad{static initialize(t){this.wrappers=t}static getWrappers(){if(!this.wrappers)throw new Error("CellRendererFactory: Not initialized. Please call CellRendererFactory.initialize() first.");return this.wrappers}static buildCommonCellParams(t){var r,a;const n=t.data||((r=t.node)==null?void 0:r.data),i=(a=t.colDef)==null?void 0:a.field,o=i&&n?n[i]:void 0,s=Sw(t);return{...t,value:o,disabled:s==null?void 0:s.disabled,readOnly:s==null?void 0:s.readOnly}}static fromType(t){var g,m;const{wrapVueCellRenderer:n,wrapVueCellEditor:i}=this.getWrappers(),o=t.field;let s;o.includes("metric")&&Qp.metric?s=Qp.metric:Qp[o]?s=Qp[o]:s=YP;const r=x7[o],a=_7[o]??!1,l={minWidth:((g=F1[o])==null?void 0:g[0])||200,maxWidth:((m=F1[o])==null?void 0:m[1])||300},c=F7[o]||{},u=y=>!!y&&typeof y!="string",d=u(s)?n(s):s;let h={};return h={cellEditorSelector:y=>{const b=Sw(y);if(!(!(b!=null&&b.disabled)&&!(b!=null&&b.readOnly)&&a))return;let F;return u(r)?F=i(r):F=r,{component:F,params:this.buildCommonCellParams(y)}},singleClickEdit:!0,cellEditorPopup:!0,cellEditorPopupPosition:"under",...c},{headerName:t.headerName,...l,...t,...h,editable:y=>{const b=Sw(y);return!(b!=null&&b.disabled)&&!(b!=null&&b.readOnly)&&a},cellRenderer:d,cellRendererParams:t.cellRendererParams??this.buildCommonCellParams,headerComponentParams:y=>({...typeof t.headerComponentParams=="function"?t.headerComponentParams(y):t.headerComponentParams})}}}_n(Ad,"wrappers",null);function T7(e){return"stopEditing"in e}const P7=lt({name:"AgGridVue3CellWrapper",props:{component:{type:Object,required:!0},params:{type:Object,required:!0},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},value:{type:null,default:void 0},data:{type:Object,default:void 0},id:{type:[String,Number],default:void 0},tooltip:{type:[String,Number],default:void 0},isNoData:{type:Boolean,default:!1},workspaceId:{type:String,default:void 0},entityId:{type:String,default:void 0},axiosService:{type:Object,default:void 0},isSearching:{type:Boolean,default:!1},isFiltering:{type:Boolean,default:!1},sortType:{type:String,default:"default"},maxRating:{type:Number,default:5}},setup(e){var n;const t=((n=e.component)==null?void 0:n.default)||e.component;return t||console.error("[Vue3CellWrapper] Invalid component provided:",e.component),()=>ye(t,{...e})}}),I7=()=>`${Math.max(50,Math.round(I3(0,100)))}%`,A7=8;function T1(e){return class{constructor(){_n(this,"container");_n(this,"vNode",null);_n(this,"componentInstance",null);_n(this,"params");_n(this,"isEditor",!1)}init(n){var c,u,d,h;if(!n){console.error("[Vue3CellWrapper] Missing context information: workspaceId or entityId. Cannot initialize wrapper.");return}const i=performance.now(),o=n.context.apiClass;this.params=n,this.isEditor=T7(n),this.container=document.createElement("div"),this.container.classList.add("ag-vue3-cell-wrapper",`${e.name||"unknown-component"}`),this.container.style.setProperty("--loading-overlay-width",I7()),this.container.style.width="100%",this.container.style.height="100%";const s=Object.freeze(n),r=n,a={component:e,params:s,disabled:!1,readOnly:r.readOnly??!1,value:n.value,maxRating:r.maxRating??void 0,data:n.data,id:(c=n==null?void 0:n.data)==null?void 0:c.id,workspaceId:n.context.workspaceId,entityId:n.context.entityId,axiosService:o,tooltip:r.tooltip??void 0,isSearching:r.isSearching??!1,isNoData:r.isNoData??!1};this.vNode=ye(P7,a),OR(this.vNode,this.container);const l=performance.now()-i;l>A7&&console.warn(`[Vue3CellWrapper] Slow render detected (${l.toFixed(1)}ms) for component "${(u=n.colDef)==null?void 0:u.field}" and field "${(d=n.data)==null?void 0:d.id}"`),this.componentInstance=(h=this.vNode.component)==null?void 0:h.proxy,this.componentInstance||console.warn("[Vue3CellWrapper] Component instance not available after render")}getGui(){return this.container}refresh(n){return!1}getValue(){var n,i,o;return this.params._editorValue!==void 0?this.params._editorValue:this.componentInstance?((o=(i=this.componentInstance).getValue)==null?void 0:o.call(i))??this.componentInstance.value:(console.warn("[Vue3CellWrapper] getValue() called but component instance not available"),(n=this.params)==null?void 0:n.value)}isPopup(){var n;return this.isEditor?(n=this.componentInstance)!=null&&n.isPopup?this.componentInstance.isPopup():!0:!1}getPopupPosition(){var i,o,s;return this.isEditor?(i=this.componentInstance)!=null&&i.getPopupPosition?this.componentInstance.getPopupPosition():((s=(o=this.params)==null?void 0:o.colDef)==null?void 0:s.cellEditorPopupPosition)??"under":void 0}afterGuiAttached(){!this.isEditor||this.componentInstance}destroy(){if(!(!this.container||!this.vNode))try{this.componentInstance&&(typeof this.componentInstance.$destroy=="function"&&this.componentInstance.$destroy(),typeof this.componentInstance.destroy=="function"&&this.componentInstance.destroy()),Promise.resolve().then(()=>{try{OR(null,this.container)}catch(n){console.warn("[Vue3CellWrapper] Error during unmount:",n)}})}catch(n){console.error("[Vue3CellWrapper] Error during cleanup:",n)}finally{this.vNode=null,this.componentInstance=null}}}}function eg(e){return T1(e)}function P1(e){return T1(e)}var el=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,n){const i=t?this.allAsyncListeners:this.allSyncListeners;let o=i.get(e);return!o&&n&&(o=new Set,i.set(e,o)),o}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,n=!1){this.getListeners(e,n,!0).add(t)}removeEventListener(e,t,n=!1){const i=this.getListeners(e,n,!1);i&&(i.delete(t),i.size===0&&(n?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){this.getGlobalListeners(t).add(e)}removeGlobalListener(e,t=!1){this.getGlobalListeners(t).delete(e)}dispatchEvent(e){this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const n=e.type;if(t&&"event"in e){const a=e.event;a instanceof Event&&(e.eventPath=a.composedPath())}const{frameworkOverrides:i}=this,o=a=>{const l=i?()=>i.wrapIncoming(a):a;t?this.dispatchAsync(l):l()},s=this.getListeners(n,t,!1);if(((s==null?void 0:s.size)??0)>0){const a=new Set(s);for(const l of a)s!=null&&s.has(l)&&o(()=>l(e))}const r=this.getGlobalListeners(t);if(r.size>0){const a=new Set(r);for(const l of a)o(()=>l(n,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}};function lr(e){return e==null||e===""?null:e}function Ke(e){return e!=null&&e!==""}function fn(e){return!Ke(e)}function Ew(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function kd(e,t){const n=e?JSON.stringify(e):null,i=t?JSON.stringify(t):null;return n===i}function k7(e,t,n=!1){const i=e==null,o=t==null;if(e!=null&&e.toNumber&&(e=e.toNumber()),t!=null&&t.toNumber&&(t=t.toNumber()),i&&o)return 0;if(i)return-1;if(o)return 1;function s(r,a){return r>a?1:r<a?-1:0}if(typeof e!="string"||!n)return s(e,t);try{return e.localeCompare(t)}catch{return s(e,t)}}var O7=/[&<>"']/g,M7={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function _c(e){return(e==null?void 0:e.toString().toString())??null}function Od(e){var t;return((t=_c(e))==null?void 0:t.replace(O7,n=>M7[n]))??null}function Cs(e){return e.eRootDiv.getRootNode()}function wn(e){return Cs(e).activeElement}function Xn(e){const{gos:t,eRootDiv:n}=e;let i=null;const o=t.get("getDocument");return o&&Ke(o)?i=o():n&&(i=n.ownerDocument),i&&Ke(i)?i:document}function I1(e){const t=wn(e);return t===null||t===Xn(e).body}function A1(e){return Xn(e).defaultView||window}function Rw(e){let t=null,n=null;try{t=Xn(e).fullscreenElement}catch{}finally{t||(t=Cs(e));const i=t.querySelector("body");i?n=i:t instanceof ShadowRoot?n=t:t instanceof Document?n=t==null?void 0:t.documentElement:n=t}return n}function L7(e){const t=Rw(e);return(t==null?void 0:t.clientWidth)??(window.innerWidth||-1)}function N7(e){const t=Rw(e);return(t==null?void 0:t.clientHeight)??(window.innerHeight||-1)}function Ko(e,t,n){n==null||typeof n=="string"&&n==""?k1(e,t):wo(e,t,n)}function wo(e,t,n){e.setAttribute(O1(t),n.toString())}function k1(e,t){e.removeAttribute(O1(t))}function O1(e){return`aria-${e}`}function zr(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function V7(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function B7(e){return e.getAttribute("aria-label")}function xc(e,t){Ko(e,"label",t)}function Md(e,t){Ko(e,"labelledby",t)}function M1(e,t){Ko(e,"live",t)}function H7(e,t){Ko(e,"atomic",t)}function G7(e,t){Ko(e,"relevant",t)}function $7(e,t){Ko(e,"invalid",t)}function W7(e,t){Ko(e,"disabled",t)}function L1(e,t){Ko(e,"hidden",t)}function Dw(e,t){wo(e,"expanded",t)}function z7(e,t){wo(e,"setsize",t)}function U7(e,t){wo(e,"posinset",t)}function j7(e,t){wo(e,"multiselectable",t)}function K7(e,t){wo(e,"rowcount",t)}function tg(e,t){wo(e,"rowindex",t)}function q7(e,t){wo(e,"rowspan",t)}function Y7(e,t){wo(e,"colcount",t)}function N1(e,t){wo(e,"colindex",t)}function Z7(e,t){wo(e,"colspan",t)}function X7(e,t){wo(e,"sort",t)}function J7(e){k1(e,"sort")}function V1(e,t){Ko(e,"selected",t)}function Q7(e,t){Ko(e,"controls",t)}function e9(e,t){Q7(e,t.id),Md(t,e.id)}function B1(e,t){Ko(e,"owns",t)}function ng(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var t9="[tabindex], input, select, button, textarea, [href]",H1="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Ld(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(H1)?!1:ws(e)}function pn(e,t,n={}){const{skipAriaHidden:i}=n;e.classList.toggle("ag-hidden",!t),i||L1(e,!t)}function n9(e,t,n={}){const{skipAriaHidden:i}=n;e.classList.toggle("ag-invisible",!t),i||L1(e,!t)}function Nd(e,t){const n="disabled",i=t?s=>s.setAttribute(n,""):s=>s.removeAttribute(n);i(e);const o=e.querySelectorAll("input")??[];for(const s of o)i(s)}function tl(e,t,n){let i=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof n=="number"){if(++i>n)break}else if(e===n)break}return!1}function nl(e){const{height:t,width:n,borderTopWidth:i,borderRightWidth:o,borderBottomWidth:s,borderLeftWidth:r,paddingTop:a,paddingRight:l,paddingBottom:c,paddingLeft:u,marginTop:d,marginRight:h,marginBottom:f,marginLeft:g,boxSizing:m}=window.getComputedStyle(e),y=Number.parseFloat;return{height:y(t||"0"),width:y(n||"0"),borderTopWidth:y(i||"0"),borderRightWidth:y(o||"0"),borderBottomWidth:y(s||"0"),borderLeftWidth:y(r||"0"),paddingTop:y(a||"0"),paddingRight:y(l||"0"),paddingBottom:y(c||"0"),paddingLeft:y(u||"0"),marginTop:y(d||"0"),marginRight:y(h||"0"),marginBottom:y(f||"0"),marginLeft:y(g||"0"),boxSizing:m}}function _w(e){const t=nl(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function Vd(e){const t=nl(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function G1(e){const{height:t,marginBottom:n,marginTop:i}=nl(e);return Math.floor(t+n+i)}function ig(e){const{width:t,marginLeft:n,marginRight:i}=nl(e);return Math.floor(t+n+i)}function $1(e){const t=e.getBoundingClientRect(),{borderTopWidth:n,borderLeftWidth:i,borderRightWidth:o,borderBottomWidth:s}=nl(e);return{top:t.top+(n||0),left:t.left+(i||0),right:t.right+(o||0),bottom:t.bottom+(s||0)}}function og(e,t){let n=e.scrollLeft;return t&&(n=Math.abs(n)),n}function sg(e,t,n){n&&(t*=-1),e.scrollLeft=t}function ii(e){for(;e!=null&&e.firstChild;)e.firstChild.remove()}function qo(e){e!=null&&e.parentNode&&e.remove()}function W1(e){return!!e.offsetParent}function ws(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!W1(e)||window.getComputedStyle(e).visibility!=="visible")}function xw(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function z1(e,t,n){n&&n.nextSibling===t||(e.firstChild?n?n.nextSibling?e.insertBefore(t,n.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t):e.appendChild(t))}function U1(e,t){for(let n=0;n<t.length;n++){const i=t[n],o=e.children[n];o!==i&&e.insertBefore(i,o)}}function i9(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}function Bd(e,t){if(t)for(const n of Object.keys(t)){const i=t[n];if(!(n!=null&&n.length)||i==null)continue;const o=i9(n),s=i.toString(),r=s.replace(/\s*!important/g,""),a=r.length!=s.length?"important":void 0;e.style.setProperty(o,r,a)}}function rg(e){return()=>{const t=e();return t?Fw(t)||j1(t):!0}}function Fw(e){return e.clientWidth<e.scrollWidth}function j1(e){return e.clientHeight<e.scrollHeight}function ag(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):bs(e,t)}function bs(e,t){t=Tw(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function Hd(e,t){t=Tw(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function Tw(e){return typeof e=="number"?`${e}px`:e}function Pw(e){return e instanceof Node||e instanceof HTMLElement}function Qi(e,t,n){n==null||n===""?e.removeAttribute(t):e.setAttribute(t,n.toString())}function Ur(e,t,n){const o=A1(e).ResizeObserver,s=o?new o(n):null;return s==null||s.observe(t),()=>s==null?void 0:s.disconnect()}function cr(e,t){const n=A1(e);n.requestAnimationFrame?n.requestAnimationFrame(t):n.webkitRequestAnimationFrame?n.webkitRequestAnimationFrame(t):n.setTimeout(t,0)}var K1="data-ref",Iw;function q1(){return Iw??(Iw=document.createTextNode(" ")),Iw.cloneNode()}function Gd(e){const{attrs:t,children:n,cls:i,ref:o,role:s,tag:r}=e,a=document.createElement(r);if(i&&(a.className=i),o&&a.setAttribute(K1,o),s&&a.setAttribute("role",s),t)for(const l of Object.keys(t))a.setAttribute(l,t[l]);if(n)if(typeof n=="string")a.textContent=n;else{let l=!0;for(const c of n)c&&(typeof c=="string"?(a.appendChild(document.createTextNode(c)),l=!1):typeof c=="function"?a.appendChild(c()):(l&&(a.appendChild(q1()),l=!1),a.append(Gd(c)),a.appendChild(q1())))}return a}var o9=["touchstart","touchend","touchmove","touchcancel","scroll"],s9=["wheel"],Aw={},Y1=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return n=>{if(typeof Aw[n]=="boolean")return Aw[n];const i=document.createElement(e[n]||"div");return n="on"+n,Aw[n]=n in i}})();function r9(e,t){return!t||!e?!1:l9(t).indexOf(e)>=0}function a9(e){const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentElement;return t}function l9(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():a9(t)}function c9(e,t,n){const i=u9(t);let o;i!=null&&(o={passive:i}),e.addEventListener(t,n,o)}var u9=e=>{const t=o9.includes(e),n=s9.includes(e);if(t)return!0;if(n)return!1};function Z1(e,t,n){if(n===0)return!1;const i=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(i,o)<=n}var $d=(e,t)=>{const n=e.identifier;for(let i=0,o=t.length;i<o;++i){const s=t[i];if(s.identifier===n)return s}return null};function Wd(e,t){return e.gos.isElementInThisInstance(t.target)}function d9(e,t,n){const o=e.getBoundingClientRect().height,s=L7(n)-2,r=N7(n)-2;if(!e.offsetParent)return;const l=$1(e.offsetParent),{clientY:c,clientX:u}=t;let d=c-l.top-o/2,h=u-l.left-10;const f=Xn(n),g=f.defaultView||window,m=g.pageYOffset||f.documentElement.scrollTop,y=g.pageXOffset||f.documentElement.scrollLeft;s>0&&h+e.clientWidth>s+y&&(h=s+y-e.clientWidth),h<0&&(h=0),r>0&&d+e.clientHeight>r+m&&(d=r+m-e.clientHeight),d<0&&(d=0),e.style.left=`${h}px`,e.style.top=`${d}px`}var lg=(e,...t)=>{for(const n of t){const[i,o,s,r]=n;i.addEventListener(o,s,r),e.push(n)}},kw=e=>{if(e){for(const[t,n,i,o]of e)t.removeEventListener(n,i,o);e.length=0}},jr=e=>{e.cancelable&&e.preventDefault()};function h9(e,t){return t}function X1(e){return(e==null?void 0:e.getLocaleTextFunc())??h9}function f9(e,t,n,i){const o=t[n];return e.getLocaleTextFunc()(n,typeof o=="function"?o(i):o,i)}function p9(e){return(t,n,i)=>e({key:t,defaultValue:n,variableValues:i})}function g9(e){return(t,n,i)=>{let o=e==null?void 0:e[t];if(o&&(i!=null&&i.length)){let s=0;for(;!(s>=i.length||o.indexOf("${variable}")===-1);)o=o.replace("${variable}",i[s++])}return o??n}}var Ss=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,n){this.localEventService||(this.localEventService=new el),this.localEventService.addEventListener(e,t,n)}removeEventListener(e,t,n){var i;(i=this.localEventService)==null||i.removeEventListener(e,t,n)}dispatchLocalEvent(e){var t;(t=this.localEventService)==null||t.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventSvc,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const n=[];for(const i of Object.keys(t)){const o=t[i];o&&n.push(this._setupListener(e,i,o))}return n}_setupListener(e,t,n){if(this.destroyed)return()=>null;let i;if(m9(e))e.__addEventListener(t,n),i=()=>(e.__removeEventListener(t,n),null);else{const o=v9(e);e instanceof HTMLElement?c9(e,t,n):o?e.addListener(t,n):e.addEventListener(t,n),i=o?()=>(e.removeListener(t,n),null):()=>(e.removeEventListener(t,n),null)}return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==i),null)}setupPropertyListener(e,t){const{gos:n}=this;n.addPropertyEventListener(e,t);const i=()=>(n.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==i),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const n=e.join("-")+this.propertyListenerId++,i=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[n])return;this.lastChangeSetIdLookup[n]=o.changeSet.id}const s={type:"propertyChanged",changeSet:o.changeSet,source:o.source};t(s)};for(const o of e)this.setupPropertyListener(o,i)}getLocaleTextFunc(){return X1(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const n=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),n}createBean(e,t,n){return(t||this.stubContext).createBean(e,n)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function m9(e){return e.__addEventListener!==void 0}function v9(e){return e.eventServiceType==="global"}var be=class extends Ss{},J1={};function Ow(e,t){J1[t]||(e(),J1[t]=!0)}var y9={pending:!1,funcs:[]},C9={pending:!1,funcs:[]};function Mw(e,t="setTimeout",n){const i=t==="raf"?C9:y9;if(i.funcs.push(e),i.pending)return;i.pending=!0;const o=()=>{const s=i.funcs.slice();i.funcs.length=0,i.pending=!1;for(const r of s)r()};t==="raf"?cr(n,o):window.setTimeout(o,0)}function oi(e,t,n){let i;return function(...o){const s=this;window.clearTimeout(i),i=window.setTimeout(function(){e.isAlive()&&t.apply(s,o)},n)}}function Q1(e,t){let n=0;return function(...i){const o=this,s=Date.now();s-n<t||(n=s,e.apply(o,i))}}function w9(e,t,n,i=100){const o=Date.now();let s=null,r=!1;const a=()=>{s!=null&&(window.clearInterval(s),s=null)};e.addDestroyFunc(a);const l=()=>{const c=Date.now()-o>i;(t()||c)&&(n(),r=!0,a())};l(),r||(s=window.setInterval(l,10))}var eI=new Set(["__proto__","constructor","prototype"]);function b9(e,t){if(e!=null){if(Array.isArray(e)){for(let n=0;n<e.length;n++)t(n.toString(),e[n]);return}for(const n of Object.keys(e).filter(i=>!eI.has(i)))t(n,e[n])}}function _i(e,t,n=!0,i=!1){Ke(t)&&b9(t,(o,s)=>{let r=e[o];r!==s&&(i&&r==null&&s!=null&&typeof s=="object"&&s.constructor===Object&&(r={},e[o]=r),tI(s)&&tI(r)&&!Array.isArray(r)?_i(r,s,n,i):(n||s!==void 0)&&(e[o]=s))})}function tI(e){return typeof e=="object"&&e!==null}var Lw=class Er{static applyGlobalGridOptions(t){if(!Er.gridOptions)return{...t};let n={};return _i(n,Er.gridOptions,!0,!0),Er.mergeStrategy==="deep"?_i(n,t,!0,!0):n={...n,...t},Er.gridOptions.context&&(n.context=Er.gridOptions.context),t.context&&(Er.mergeStrategy==="deep"&&n.context&&_i(t.context,n.context,!0,!0),n.context=t.context),n}static applyGlobalGridOption(t,n){if(Er.mergeStrategy==="deep"){const i=S9(t);if(i&&typeof i=="object"&&typeof n=="object")return Er.applyGlobalGridOptions({[t]:n})[t]}return n}};Lw.gridOptions=void 0,Lw.mergeStrategy="shallow";var Nw=Lw;function S9(e){var t;return(t=Nw.gridOptions)==null?void 0:t[e]}var E9={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,rowNumbers:!1,enableFilterHandlers:!1},nI="https://www.ag-grid.com";function Kr(e,t,...n){e.get("debug")&&console.log("AG Grid: "+t,...n)}function zd(e,...t){Ow(()=>console.warn("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function Fc(e,...t){Ow(()=>console.error("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}var iI=new Set,cg={},Tc={},ug,oI=!1,sI=!1,R9=!1;function D9(e){const[t,n]=e.version.split(".")||[],[i,o]=ug.split(".")||[];return t===i&&n===o}function _9(e){var i;ug||(ug=e.version);const t=o=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${o} Please update all modules to the same version.`;e.version?D9(e)||Fc(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${ug}.`)):Fc(t(`'${e.moduleName}' is incompatible.`));const n=(i=e.validate)==null?void 0:i.call(e);n&&!n.isValid&&Fc(`${n.message}`)}function Ud(e,t,n=!1){n||(oI=!0),_9(e);const i=e.rowModels??["all"];iI.add(e);let o;t!==void 0?(sI=!0,Tc[t]===void 0&&(Tc[t]={}),o=Tc[t]):o=cg;for(const s of i)o[s]===void 0&&(o[s]={}),o[s][e.moduleName]=e;if(e.dependsOn)for(const s of e.dependsOn)Ud(s,t,n)}function x9(e){delete Tc[e]}function Vw(e,t,n){const i=o=>{var s,r,a;return!!((s=cg[o])!=null&&s[e])||!!((a=(r=Tc[t])==null?void 0:r[o])!=null&&a[e])};return i(n)||i("all")}function Bw(){return sI}function F9(e,t){const n=Tc[e]??{};return[...Object.values(cg.all??{}),...Object.values(n.all??{}),...Object.values(cg[t]??{}),...Object.values(n[t]??{})]}function T9(){return new Set(iI)}function P9(){return oI}function I9(){return R9}var A9=class{static register(e){Ud(e,void 0)}static registerModules(e){for(const t of e)Ud(t,void 0)}},Ue="34.3.1",rI=2e3,aI=100,lI="_version_",dg=null,Pc=`${nI}/javascript-data-grid`;function k9(e){dg=e}function O9(e){Pc=e}function cI(e,t,n){return(dg==null?void 0:dg(e,t))??[V9(e,t,n)]}function Hw(e,t,n,i,o){e(`${i?"warning":"error"} #${t}`,...cI(t,n,o))}function M9(e){if(!e)return String(e);const t={};for(const n of Object.keys(e))typeof e[n]!="object"&&typeof e[n]!="function"&&(t[n]=e[n]);return JSON.stringify(t)}function L9(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=M9(e)),t}function hg(e){return e===void 0?"undefined":e===null?"null":e}function Gw(e,t){return`${e}?${t.toString()}`}function N9(e,t,n){const i=Array.from(t.entries()).sort((s,r)=>r[1].length-s[1].length);let o=Gw(e,t);for(const[s,r]of i){if(s===lI)continue;const a=o.length-n;if(a<=0)break;const l="...",c=a+l.length,u=r.length-c>aI?r.slice(0,r.length-c)+l:r.slice(0,aI)+l;t.set(s,u),o=Gw(e,t)}return o}function uI(e,t){const n=new URLSearchParams;if(n.append(lI,Ue),t)for(const s of Object.keys(t))n.append(s,L9(t[s]));const i=`${Pc}/errors/${e}`,o=Gw(i,n);return o.length<=rI?o:N9(i,n,rI)}var V9=(e,t,n)=>{const i=uI(e,t);return`${`${n?n+`
109
+ Refresh to see updates.`:"Work will be created in background. Refresh to see updates."),3)],64)):ot("",!0)],2))}}),[["__cssModules",{$style:{"inform-layout":"_inform-layout_1og33_1","import-error":"_import-error_1og33_11","step-title":"_step-title_1og33_22","step-description":"_step-description_1og33_27"}}]]),x1=Ct(lt({__name:"DateRule",setup(e){const n=(()=>{const o=(h,f,g,m)=>{const y=document.createElement("span");return y.textContent=h,y.style.fontWeight=f,y.style.fontSize=g,y.style.color=m,y},s=document.createElement("div");s.style.display="flex",s.style.flexDirection="column";const r=document.createElement("div"),a=document.createElement("div"),l=o("Valid formats:","normal","14px","#02C39A"),c=o("Invalid formats:","normal","14px","#FF5200"),u=o(" 2025.12.31, 2025-12-31, 2025/12/31 ","normal","14px",""),d=o(" 12.31.2025, 2025.31.12","normal","14px","");return r.appendChild(l),r.appendChild(u),a.appendChild(c),a.appendChild(d),s.appendChild(r),s.appendChild(a),s.outerHTML})(),i=yn;return(o,s)=>(K(),Ce("div",{class:z(o.$style["date-format-guide"])},[we("span",{class:z(o.$style["step-title-2"])},[s[0]||(s[0]=ut(" Date format guide ",-1)),nt(ye(X(gt),{src:"InfoCircle",color:"#A6A6A6"},null,512),[[X(i),{content:X(n)}]])],2),we("div",{class:z(o.$style["date-rule-section"])},[s[3]||(s[3]=we("span",null,"Enter dates in one of these formats:",-1)),we("ul",{class:z(o.$style["step-description"])},[we("li",{class:z(o.$style["date-rule"])},[...s[1]||(s[1]=[we("b",null,"DD MM YYYY",-1),ut(" (Day-Month-Year) ",-1)])],2),we("li",{class:z(o.$style["date-rule"])},[...s[2]||(s[2]=[we("b",null,"YYYY MM DD",-1),ut(" (Year-Month-Day) ",-1)])],2)],2)],2)],2))}}),[["__cssModules",{$style:{"date-format-guide":"_date-format-guide_ef59d_1","step-title-2":"_step-title-2_ef59d_13","date-rule-section":"_date-rule-section_ef59d_25","step-description":"_step-description_ef59d_29","date-rule":"_date-rule_ef59d_25"}}]]),R7={key:1},D7=Ct(lt({__name:"PopupCreateScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const i=Z(null),o=e,s=()=>{i.value&&i.value.show()},r=Z(""),a=Z("idle"),l=j(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Create new work"})[a.value]),c=Z(null),u=Z({file:null,format:null}),{apiServices:d}=po(!1,o),h=async k=>{var P,N;if(((P=d==null?void 0:d.value)==null?void 0:P.getStatuses)===void 0){console.error("API services not available",(N=d==null?void 0:d.value)==null?void 0:N.getStatuses);return}return await d.value.getStatuses(o.workspaceId,o.entityId,k)},f=Z(!1),g=async()=>{f.value=!0;const k=o.workspaceId,x=o.entityId;if(!k||!x||!d.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await d.value.downloadTemplate(k,x))throw new Error("No response from downloadTemplate API")}catch(P){console.error("Error downloading template:",P)}f.value=!1},m=async k=>{var N,G,se;const x=new FormData,P=((N=k.name.split(".").pop())==null?void 0:N.toString())||"";if(x.append("file",k),x.append("format",P),x.append("template_flow_status_id",R.value||""),!d.value||!o.workspaceId||!o.entityId){console.error("API services not available");return}try{const B=await d.value.addNewSceneViaImportFile(o.workspaceId,o.entityId,x);y()}catch(B){throw console.error("Error uploading file:",B),b(((se=(G=B.response)==null?void 0:G.data)==null?void 0:se.message)||"An unknown error occurred during file upload."),B}},y=()=>{a.value="success"},b=k=>{r.value=k,a.value="error"},S=n,F=()=>{S("import-success"),O()},C=async()=>{if(!u.value||!u.value.file){console.error("No file to upload");return}a.value="importing",await m(u.value.file)};t({open:s});const R=Z(null),E=j(()=>!u.value.file||!u.value.format||!u.value.isValid||!R.value),_=Z(null),I=()=>{var k,x;(k=c.value)==null||k.clear(),r.value="",u.value={file:null,format:null},R.value=null,(x=_==null?void 0:_.value)==null||x.clear(),a.value="idle"},O=()=>{var k;I(),(k=i.value)==null||k.hide()};return(k,x)=>(K(),Xe(X(QP),{"popup-name":l.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:i,onHidden:I},Su({default:Se(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(K(),Xe(_1,{key:0,state:a.value,"error-message":r.value},null,8,["state","error-message"])):(K(),Ce("div",R7,[we("div",{class:z(k.$style["step-section"])},[we("span",{class:z(k.$style["step-title"])},"Step 1: Download sample file",2),we("span",{class:z(k.$style["step-description"])}," Get a sample file with all columns ready for editing. ",2),ye(X(ft),{class:z(k.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:f.value,onHandleClick:g},{prefix:Se(()=>[ye(X(gt),{src:"Download"})]),default:Se(()=>[x[2]||(x[2]=ut(" Download sample file ",-1))]),_:1},8,["class","disabled"])],2),we("div",{class:z(k.$style["step-section"])},[we("span",{class:z(k.$style["step-title"])},"Step 2: Upload your file (.xlsx, .xls, .csv)",2),ye(X(D1),{modelValue:u.value,"onUpdate:modelValue":x[0]||(x[0]=P=>u.value=P),ref_key:"filUploaderRef",ref:c},null,8,["modelValue"])],2),we("div",{class:z(k.$style["step-section"])},[we("span",{class:z(k.$style["step-title"])},"Step 3: Select status",2),we("span",{class:z(k.$style["step-description"])},"Choose a status for the new work.",2),ye(X(p7),{ref_key:"statusRef",ref:_,modelValue:R.value,"onUpdate:modelValue":x[1]||(x[1]=P=>R.value=P),"get-status-func":h,"workspace-id":o.workspaceId,id:o.entityId},null,8,["modelValue","workspace-id","id"])],2),we("div",{class:z(k.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ye(x1)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:Se(()=>[ye(X(ft),{style:{flex:"1"},variant:"secondary",onClick:O},{default:Se(()=>[...x[3]||(x[3]=[ut(" Cancel ",-1)])]),_:1}),ye(X(ft),{disabled:E.value,style:{flex:"1"},variant:"primary",onClick:C},{default:Se(()=>[...x[4]||(x[4]=[ut(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:Se(()=>[ye(X(ft),{style:{flex:"1"},variant:"primary",onClick:F},{default:Se(()=>[...x[5]||(x[5]=[ut(" Close ",-1)])]),_:1})]),key:"1"}:a.value=="error"?{name:"footer",fn:Se(()=>[ye(X(ft),{style:{flex:"1"},variant:"primary",onClick:I},{default:Se(()=>[...x[6]||(x[6]=[ut(" Try Again ",-1)])]),_:1})]),key:"2"}:void 0]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_jt1wo_1","step-title":"_step-title_jt1wo_11","step-title-2":"_step-title-2_jt1wo_17","step-description":"_step-description_jt1wo_23","date-format-guide":"_date-format-guide_jt1wo_28","import-error":"_import-error_jt1wo_39","drop-area":"_drop-area_jt1wo_49","is-dragging":"_is-dragging_jt1wo_49","drop-area-content":"_drop-area-content_jt1wo_52",browse:"_browse_jt1wo_61","download-sample-btn":"_download-sample-btn_jt1wo_65"}}]]),Qp={id:void 0,assignees:lK,status:RK,dateRange:cK,isStarted:Ya,isCompleted:Ya,lastUpdated:Ya,completedOn:Ya,isDeleted:Ya,isArchived:Ya,isProcessing:Ya,name:XP,options:A8,metric:CK,__checkboxSelection:void 0},_7={id:!1,assignees:!0,status:!0,dateRange:!0,isStarted:!1,isCompleted:!1,lastUpdated:!1,completedOn:!1,isDeleted:!1,isArchived:!1,isProcessing:!1,name:!1,options:!0,metric:!1,__checkboxSelection:!1},x7={id:void 0,assignees:$P,status:jP,dateRange:uK,isStarted:void 0,isCompleted:void 0,lastUpdated:void 0,completedOn:void 0,isDeleted:void 0,isArchived:void 0,isProcessing:void 0,name:XP,options:JP,metric:void 0,__checkboxSelection:void 0},F1={id:[100,100],assignees:[200,200],status:[200,200],dateRange:[255,255],isStarted:[150,150],isCompleted:[150,150],lastUpdated:[180,180],completedOn:[180,180],isDeleted:[void 0,void 0],isArchived:[void 0,void 0],isProcessing:[void 0,void 0],name:[350,500],options:[50,50],metric:[200,300],__checkboxSelection:[50,50]},F7={dateRange:{cellEditorPopupPosition:"under",cellEditorPopup:!1},name:{cellEditorPopupPosition:"over",cellEditor:!1,cellEditorPopup:!1},metric:{suppressKeyboardEvent:void 0,suppressNavigable:!1,suppressMovable:!1,cellClass:"ag-cell-optimized"}};function Sw(e){var o,s,r,a;const t=((o=e==null?void 0:e.data)==null?void 0:o.permissions)||void 0,n={assignees:(t==null?void 0:t.has_update_assignee_permission)||0,completedOn:0,name:0,permissions:0,status:(t==null?void 0:t.has_edit_template_flow_status_permission)||0,dateRange:(t==null?void 0:t.has_edit_date_permission)||0,isStarted:0,isDeleted:0,isArchived:0,isProcessing:0,lastUpdated:0,id:0,isCompleted:0,options:1};if(e.data===void 0)return{disabled:!1,readOnly:!1};if(((s=e.colDef)==null?void 0:s.field)=="options")return{disabled:!1,readOnly:!1};if(!t)return;let i={disabled:!1,readOnly:(t==null?void 0:t.has_edit_permission)==0};if(((r=e.colDef)==null?void 0:r.field)!=="name"){const l=n[(a=e.colDef)==null?void 0:a.field];i=l?{disabled:l===-1,readOnly:l!==-1&&l!==1}:{disabled:!1,readOnly:!0}}return i}class Ad{static initialize(t){this.wrappers=t}static getWrappers(){if(!this.wrappers)throw new Error("CellRendererFactory: Not initialized. Please call CellRendererFactory.initialize() first.");return this.wrappers}static buildCommonCellParams(t){var r,a;const n=t.data||((r=t.node)==null?void 0:r.data),i=(a=t.colDef)==null?void 0:a.field,o=i&&n?n[i]:void 0,s=Sw(t);return{...t,value:o,disabled:s==null?void 0:s.disabled,readOnly:s==null?void 0:s.readOnly}}static fromType(t){var g,m;const{wrapVueCellRenderer:n,wrapVueCellEditor:i}=this.getWrappers(),o=t.field;let s;o.includes("metric")&&Qp.metric?s=Qp.metric:Qp[o]?s=Qp[o]:s=YP;const r=x7[o],a=_7[o]??!1,l={minWidth:((g=F1[o])==null?void 0:g[0])||200,maxWidth:((m=F1[o])==null?void 0:m[1])||300},c=F7[o]||{},u=y=>!!y&&typeof y!="string",d=u(s)?n(s):s;let h={};return h={cellEditorSelector:y=>{const b=Sw(y);if(!(!(b!=null&&b.disabled)&&!(b!=null&&b.readOnly)&&a))return;let F;return u(r)?F=i(r):F=r,{component:F,params:this.buildCommonCellParams(y)}},singleClickEdit:!0,cellEditorPopup:!0,cellEditorPopupPosition:"under",...c},{headerName:t.headerName,...l,...t,...h,editable:y=>{const b=Sw(y);return!(b!=null&&b.disabled)&&!(b!=null&&b.readOnly)&&a},cellRenderer:d,cellRendererParams:t.cellRendererParams??this.buildCommonCellParams,headerComponentParams:y=>({...typeof t.headerComponentParams=="function"?t.headerComponentParams(y):t.headerComponentParams})}}}_n(Ad,"wrappers",null);function T7(e){return"stopEditing"in e}const P7=lt({name:"AgGridVue3CellWrapper",props:{component:{type:Object,required:!0},params:{type:Object,required:!0},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},value:{type:null,default:void 0},data:{type:Object,default:void 0},id:{type:[String,Number],default:void 0},tooltip:{type:[String,Number],default:void 0},isNoData:{type:Boolean,default:!1},workspaceId:{type:String,default:void 0},entityId:{type:String,default:void 0},axiosService:{type:Object,default:void 0},isSearching:{type:Boolean,default:!1},isFiltering:{type:Boolean,default:!1},sortType:{type:String,default:"default"},maxRating:{type:Number,default:5}},setup(e){var n;const t=((n=e.component)==null?void 0:n.default)||e.component;return t||console.error("[Vue3CellWrapper] Invalid component provided:",e.component),()=>ye(t,{...e})}}),I7=()=>`${Math.max(50,Math.round(I3(0,100)))}%`,A7=8;function T1(e){return class{constructor(){_n(this,"container");_n(this,"vNode",null);_n(this,"componentInstance",null);_n(this,"params");_n(this,"isEditor",!1)}init(n){var c,u,d,h;if(!n){console.error("[Vue3CellWrapper] Missing context information: workspaceId or entityId. Cannot initialize wrapper.");return}const i=performance.now(),o=n.context.apiClass;this.params=n,this.isEditor=T7(n),this.container=document.createElement("div"),this.container.classList.add("ag-vue3-cell-wrapper",`${e.name||"unknown-component"}`),this.container.style.setProperty("--loading-overlay-width",I7()),this.container.style.width="100%",this.container.style.height="100%";const s=Object.freeze(n),r=n,a={component:e,params:s,disabled:!1,readOnly:r.readOnly??!1,value:n.value,maxRating:r.maxRating??void 0,data:n.data,id:(c=n==null?void 0:n.data)==null?void 0:c.id,workspaceId:n.context.workspaceId,entityId:n.context.entityId,axiosService:o,tooltip:r.tooltip??void 0,isSearching:r.isSearching??!1,isNoData:r.isNoData??!1};this.vNode=ye(P7,a),OR(this.vNode,this.container);const l=performance.now()-i;l>A7&&console.warn(`[Vue3CellWrapper] Slow render detected (${l.toFixed(1)}ms) for component "${(u=n.colDef)==null?void 0:u.field}" and field "${(d=n.data)==null?void 0:d.id}"`),this.componentInstance=(h=this.vNode.component)==null?void 0:h.proxy,this.componentInstance||console.warn("[Vue3CellWrapper] Component instance not available after render")}getGui(){return this.container}refresh(n){return!1}getValue(){var n,i,o;return this.params._editorValue!==void 0?this.params._editorValue:this.componentInstance?((o=(i=this.componentInstance).getValue)==null?void 0:o.call(i))??this.componentInstance.value:(console.warn("[Vue3CellWrapper] getValue() called but component instance not available"),(n=this.params)==null?void 0:n.value)}isPopup(){var n;return this.isEditor?(n=this.componentInstance)!=null&&n.isPopup?this.componentInstance.isPopup():!0:!1}getPopupPosition(){var i,o,s;return this.isEditor?(i=this.componentInstance)!=null&&i.getPopupPosition?this.componentInstance.getPopupPosition():((s=(o=this.params)==null?void 0:o.colDef)==null?void 0:s.cellEditorPopupPosition)??"under":void 0}afterGuiAttached(){!this.isEditor||this.componentInstance}destroy(){if(!(!this.container||!this.vNode))try{this.componentInstance&&(typeof this.componentInstance.$destroy=="function"&&this.componentInstance.$destroy(),typeof this.componentInstance.destroy=="function"&&this.componentInstance.destroy()),Promise.resolve().then(()=>{try{OR(null,this.container)}catch(n){console.warn("[Vue3CellWrapper] Error during unmount:",n)}})}catch(n){console.error("[Vue3CellWrapper] Error during cleanup:",n)}finally{this.vNode=null,this.componentInstance=null}}}}function eg(e){return T1(e)}function P1(e){return T1(e)}var el=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,n){const i=t?this.allAsyncListeners:this.allSyncListeners;let o=i.get(e);return!o&&n&&(o=new Set,i.set(e,o)),o}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,n=!1){this.getListeners(e,n,!0).add(t)}removeEventListener(e,t,n=!1){const i=this.getListeners(e,n,!1);i&&(i.delete(t),i.size===0&&(n?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){this.getGlobalListeners(t).add(e)}removeGlobalListener(e,t=!1){this.getGlobalListeners(t).delete(e)}dispatchEvent(e){this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const n=e.type;if(t&&"event"in e){const a=e.event;a instanceof Event&&(e.eventPath=a.composedPath())}const{frameworkOverrides:i}=this,o=a=>{const l=i?()=>i.wrapIncoming(a):a;t?this.dispatchAsync(l):l()},s=this.getListeners(n,t,!1);if(((s==null?void 0:s.size)??0)>0){const a=new Set(s);for(const l of a)s!=null&&s.has(l)&&o(()=>l(e))}const r=this.getGlobalListeners(t);if(r.size>0){const a=new Set(r);for(const l of a)o(()=>l(n,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}};function lr(e){return e==null||e===""?null:e}function Ke(e){return e!=null&&e!==""}function fn(e){return!Ke(e)}function Ew(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function kd(e,t){const n=e?JSON.stringify(e):null,i=t?JSON.stringify(t):null;return n===i}function k7(e,t,n=!1){const i=e==null,o=t==null;if(e!=null&&e.toNumber&&(e=e.toNumber()),t!=null&&t.toNumber&&(t=t.toNumber()),i&&o)return 0;if(i)return-1;if(o)return 1;function s(r,a){return r>a?1:r<a?-1:0}if(typeof e!="string"||!n)return s(e,t);try{return e.localeCompare(t)}catch{return s(e,t)}}var O7=/[&<>"']/g,M7={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function _c(e){return(e==null?void 0:e.toString().toString())??null}function Od(e){var t;return((t=_c(e))==null?void 0:t.replace(O7,n=>M7[n]))??null}function Cs(e){return e.eRootDiv.getRootNode()}function wn(e){return Cs(e).activeElement}function Xn(e){const{gos:t,eRootDiv:n}=e;let i=null;const o=t.get("getDocument");return o&&Ke(o)?i=o():n&&(i=n.ownerDocument),i&&Ke(i)?i:document}function I1(e){const t=wn(e);return t===null||t===Xn(e).body}function A1(e){return Xn(e).defaultView||window}function Rw(e){let t=null,n=null;try{t=Xn(e).fullscreenElement}catch{}finally{t||(t=Cs(e));const i=t.querySelector("body");i?n=i:t instanceof ShadowRoot?n=t:t instanceof Document?n=t==null?void 0:t.documentElement:n=t}return n}function L7(e){const t=Rw(e);return(t==null?void 0:t.clientWidth)??(window.innerWidth||-1)}function N7(e){const t=Rw(e);return(t==null?void 0:t.clientHeight)??(window.innerHeight||-1)}function Ko(e,t,n){n==null||typeof n=="string"&&n==""?k1(e,t):wo(e,t,n)}function wo(e,t,n){e.setAttribute(O1(t),n.toString())}function k1(e,t){e.removeAttribute(O1(t))}function O1(e){return`aria-${e}`}function zr(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function V7(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function B7(e){return e.getAttribute("aria-label")}function xc(e,t){Ko(e,"label",t)}function Md(e,t){Ko(e,"labelledby",t)}function M1(e,t){Ko(e,"live",t)}function H7(e,t){Ko(e,"atomic",t)}function G7(e,t){Ko(e,"relevant",t)}function $7(e,t){Ko(e,"invalid",t)}function W7(e,t){Ko(e,"disabled",t)}function L1(e,t){Ko(e,"hidden",t)}function Dw(e,t){wo(e,"expanded",t)}function z7(e,t){wo(e,"setsize",t)}function U7(e,t){wo(e,"posinset",t)}function j7(e,t){wo(e,"multiselectable",t)}function K7(e,t){wo(e,"rowcount",t)}function tg(e,t){wo(e,"rowindex",t)}function q7(e,t){wo(e,"rowspan",t)}function Y7(e,t){wo(e,"colcount",t)}function N1(e,t){wo(e,"colindex",t)}function Z7(e,t){wo(e,"colspan",t)}function X7(e,t){wo(e,"sort",t)}function J7(e){k1(e,"sort")}function V1(e,t){Ko(e,"selected",t)}function Q7(e,t){Ko(e,"controls",t)}function e9(e,t){Q7(e,t.id),Md(t,e.id)}function B1(e,t){Ko(e,"owns",t)}function ng(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var t9="[tabindex], input, select, button, textarea, [href]",H1="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Ld(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(H1)?!1:ws(e)}function pn(e,t,n={}){const{skipAriaHidden:i}=n;e.classList.toggle("ag-hidden",!t),i||L1(e,!t)}function n9(e,t,n={}){const{skipAriaHidden:i}=n;e.classList.toggle("ag-invisible",!t),i||L1(e,!t)}function Nd(e,t){const n="disabled",i=t?s=>s.setAttribute(n,""):s=>s.removeAttribute(n);i(e);const o=e.querySelectorAll("input")??[];for(const s of o)i(s)}function tl(e,t,n){let i=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof n=="number"){if(++i>n)break}else if(e===n)break}return!1}function nl(e){const{height:t,width:n,borderTopWidth:i,borderRightWidth:o,borderBottomWidth:s,borderLeftWidth:r,paddingTop:a,paddingRight:l,paddingBottom:c,paddingLeft:u,marginTop:d,marginRight:h,marginBottom:f,marginLeft:g,boxSizing:m}=window.getComputedStyle(e),y=Number.parseFloat;return{height:y(t||"0"),width:y(n||"0"),borderTopWidth:y(i||"0"),borderRightWidth:y(o||"0"),borderBottomWidth:y(s||"0"),borderLeftWidth:y(r||"0"),paddingTop:y(a||"0"),paddingRight:y(l||"0"),paddingBottom:y(c||"0"),paddingLeft:y(u||"0"),marginTop:y(d||"0"),marginRight:y(h||"0"),marginBottom:y(f||"0"),marginLeft:y(g||"0"),boxSizing:m}}function _w(e){const t=nl(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function Vd(e){const t=nl(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function G1(e){const{height:t,marginBottom:n,marginTop:i}=nl(e);return Math.floor(t+n+i)}function ig(e){const{width:t,marginLeft:n,marginRight:i}=nl(e);return Math.floor(t+n+i)}function $1(e){const t=e.getBoundingClientRect(),{borderTopWidth:n,borderLeftWidth:i,borderRightWidth:o,borderBottomWidth:s}=nl(e);return{top:t.top+(n||0),left:t.left+(i||0),right:t.right+(o||0),bottom:t.bottom+(s||0)}}function og(e,t){let n=e.scrollLeft;return t&&(n=Math.abs(n)),n}function sg(e,t,n){n&&(t*=-1),e.scrollLeft=t}function ii(e){for(;e!=null&&e.firstChild;)e.firstChild.remove()}function qo(e){e!=null&&e.parentNode&&e.remove()}function W1(e){return!!e.offsetParent}function ws(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!W1(e)||window.getComputedStyle(e).visibility!=="visible")}function xw(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function z1(e,t,n){n&&n.nextSibling===t||(e.firstChild?n?n.nextSibling?e.insertBefore(t,n.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t):e.appendChild(t))}function U1(e,t){for(let n=0;n<t.length;n++){const i=t[n],o=e.children[n];o!==i&&e.insertBefore(i,o)}}function i9(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}function Bd(e,t){if(t)for(const n of Object.keys(t)){const i=t[n];if(!(n!=null&&n.length)||i==null)continue;const o=i9(n),s=i.toString(),r=s.replace(/\s*!important/g,""),a=r.length!=s.length?"important":void 0;e.style.setProperty(o,r,a)}}function rg(e){return()=>{const t=e();return t?Fw(t)||j1(t):!0}}function Fw(e){return e.clientWidth<e.scrollWidth}function j1(e){return e.clientHeight<e.scrollHeight}function ag(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):bs(e,t)}function bs(e,t){t=Tw(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function Hd(e,t){t=Tw(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function Tw(e){return typeof e=="number"?`${e}px`:e}function Pw(e){return e instanceof Node||e instanceof HTMLElement}function Qi(e,t,n){n==null||n===""?e.removeAttribute(t):e.setAttribute(t,n.toString())}function Ur(e,t,n){const o=A1(e).ResizeObserver,s=o?new o(n):null;return s==null||s.observe(t),()=>s==null?void 0:s.disconnect()}function cr(e,t){const n=A1(e);n.requestAnimationFrame?n.requestAnimationFrame(t):n.webkitRequestAnimationFrame?n.webkitRequestAnimationFrame(t):n.setTimeout(t,0)}var K1="data-ref",Iw;function q1(){return Iw??(Iw=document.createTextNode(" ")),Iw.cloneNode()}function Gd(e){const{attrs:t,children:n,cls:i,ref:o,role:s,tag:r}=e,a=document.createElement(r);if(i&&(a.className=i),o&&a.setAttribute(K1,o),s&&a.setAttribute("role",s),t)for(const l of Object.keys(t))a.setAttribute(l,t[l]);if(n)if(typeof n=="string")a.textContent=n;else{let l=!0;for(const c of n)c&&(typeof c=="string"?(a.appendChild(document.createTextNode(c)),l=!1):typeof c=="function"?a.appendChild(c()):(l&&(a.appendChild(q1()),l=!1),a.append(Gd(c)),a.appendChild(q1())))}return a}var o9=["touchstart","touchend","touchmove","touchcancel","scroll"],s9=["wheel"],Aw={},Y1=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return n=>{if(typeof Aw[n]=="boolean")return Aw[n];const i=document.createElement(e[n]||"div");return n="on"+n,Aw[n]=n in i}})();function r9(e,t){return!t||!e?!1:l9(t).indexOf(e)>=0}function a9(e){const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentElement;return t}function l9(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():a9(t)}function c9(e,t,n){const i=u9(t);let o;i!=null&&(o={passive:i}),e.addEventListener(t,n,o)}var u9=e=>{const t=o9.includes(e),n=s9.includes(e);if(t)return!0;if(n)return!1};function Z1(e,t,n){if(n===0)return!1;const i=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(i,o)<=n}var $d=(e,t)=>{const n=e.identifier;for(let i=0,o=t.length;i<o;++i){const s=t[i];if(s.identifier===n)return s}return null};function Wd(e,t){return e.gos.isElementInThisInstance(t.target)}function d9(e,t,n){const o=e.getBoundingClientRect().height,s=L7(n)-2,r=N7(n)-2;if(!e.offsetParent)return;const l=$1(e.offsetParent),{clientY:c,clientX:u}=t;let d=c-l.top-o/2,h=u-l.left-10;const f=Xn(n),g=f.defaultView||window,m=g.pageYOffset||f.documentElement.scrollTop,y=g.pageXOffset||f.documentElement.scrollLeft;s>0&&h+e.clientWidth>s+y&&(h=s+y-e.clientWidth),h<0&&(h=0),r>0&&d+e.clientHeight>r+m&&(d=r+m-e.clientHeight),d<0&&(d=0),e.style.left=`${h}px`,e.style.top=`${d}px`}var lg=(e,...t)=>{for(const n of t){const[i,o,s,r]=n;i.addEventListener(o,s,r),e.push(n)}},kw=e=>{if(e){for(const[t,n,i,o]of e)t.removeEventListener(n,i,o);e.length=0}},jr=e=>{e.cancelable&&e.preventDefault()};function h9(e,t){return t}function X1(e){return(e==null?void 0:e.getLocaleTextFunc())??h9}function f9(e,t,n,i){const o=t[n];return e.getLocaleTextFunc()(n,typeof o=="function"?o(i):o,i)}function p9(e){return(t,n,i)=>e({key:t,defaultValue:n,variableValues:i})}function g9(e){return(t,n,i)=>{let o=e==null?void 0:e[t];if(o&&(i!=null&&i.length)){let s=0;for(;!(s>=i.length||o.indexOf("${variable}")===-1);)o=o.replace("${variable}",i[s++])}return o??n}}var Ss=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,n){this.localEventService||(this.localEventService=new el),this.localEventService.addEventListener(e,t,n)}removeEventListener(e,t,n){var i;(i=this.localEventService)==null||i.removeEventListener(e,t,n)}dispatchLocalEvent(e){var t;(t=this.localEventService)==null||t.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventSvc,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const n=[];for(const i of Object.keys(t)){const o=t[i];o&&n.push(this._setupListener(e,i,o))}return n}_setupListener(e,t,n){if(this.destroyed)return()=>null;let i;if(m9(e))e.__addEventListener(t,n),i=()=>(e.__removeEventListener(t,n),null);else{const o=v9(e);e instanceof HTMLElement?c9(e,t,n):o?e.addListener(t,n):e.addEventListener(t,n),i=o?()=>(e.removeListener(t,n),null):()=>(e.removeEventListener(t,n),null)}return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==i),null)}setupPropertyListener(e,t){const{gos:n}=this;n.addPropertyEventListener(e,t);const i=()=>(n.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==i),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const n=e.join("-")+this.propertyListenerId++,i=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[n])return;this.lastChangeSetIdLookup[n]=o.changeSet.id}const s={type:"propertyChanged",changeSet:o.changeSet,source:o.source};t(s)};for(const o of e)this.setupPropertyListener(o,i)}getLocaleTextFunc(){return X1(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const n=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),n}createBean(e,t,n){return(t||this.stubContext).createBean(e,n)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function m9(e){return e.__addEventListener!==void 0}function v9(e){return e.eventServiceType==="global"}var be=class extends Ss{},J1={};function Ow(e,t){J1[t]||(e(),J1[t]=!0)}var y9={pending:!1,funcs:[]},C9={pending:!1,funcs:[]};function Mw(e,t="setTimeout",n){const i=t==="raf"?C9:y9;if(i.funcs.push(e),i.pending)return;i.pending=!0;const o=()=>{const s=i.funcs.slice();i.funcs.length=0,i.pending=!1;for(const r of s)r()};t==="raf"?cr(n,o):window.setTimeout(o,0)}function oi(e,t,n){let i;return function(...o){const s=this;window.clearTimeout(i),i=window.setTimeout(function(){e.isAlive()&&t.apply(s,o)},n)}}function Q1(e,t){let n=0;return function(...i){const o=this,s=Date.now();s-n<t||(n=s,e.apply(o,i))}}function w9(e,t,n,i=100){const o=Date.now();let s=null,r=!1;const a=()=>{s!=null&&(window.clearInterval(s),s=null)};e.addDestroyFunc(a);const l=()=>{const c=Date.now()-o>i;(t()||c)&&(n(),r=!0,a())};l(),r||(s=window.setInterval(l,10))}var eI=new Set(["__proto__","constructor","prototype"]);function b9(e,t){if(e!=null){if(Array.isArray(e)){for(let n=0;n<e.length;n++)t(n.toString(),e[n]);return}for(const n of Object.keys(e).filter(i=>!eI.has(i)))t(n,e[n])}}function _i(e,t,n=!0,i=!1){Ke(t)&&b9(t,(o,s)=>{let r=e[o];r!==s&&(i&&r==null&&s!=null&&typeof s=="object"&&s.constructor===Object&&(r={},e[o]=r),tI(s)&&tI(r)&&!Array.isArray(r)?_i(r,s,n,i):(n||s!==void 0)&&(e[o]=s))})}function tI(e){return typeof e=="object"&&e!==null}var Lw=class Er{static applyGlobalGridOptions(t){if(!Er.gridOptions)return{...t};let n={};return _i(n,Er.gridOptions,!0,!0),Er.mergeStrategy==="deep"?_i(n,t,!0,!0):n={...n,...t},Er.gridOptions.context&&(n.context=Er.gridOptions.context),t.context&&(Er.mergeStrategy==="deep"&&n.context&&_i(t.context,n.context,!0,!0),n.context=t.context),n}static applyGlobalGridOption(t,n){if(Er.mergeStrategy==="deep"){const i=S9(t);if(i&&typeof i=="object"&&typeof n=="object")return Er.applyGlobalGridOptions({[t]:n})[t]}return n}};Lw.gridOptions=void 0,Lw.mergeStrategy="shallow";var Nw=Lw;function S9(e){var t;return(t=Nw.gridOptions)==null?void 0:t[e]}var E9={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,rowNumbers:!1,enableFilterHandlers:!1},nI="https://www.ag-grid.com";function Kr(e,t,...n){e.get("debug")&&console.log("AG Grid: "+t,...n)}function zd(e,...t){Ow(()=>console.warn("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function Fc(e,...t){Ow(()=>console.error("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}var iI=new Set,cg={},Tc={},ug,oI=!1,sI=!1,R9=!1;function D9(e){const[t,n]=e.version.split(".")||[],[i,o]=ug.split(".")||[];return t===i&&n===o}function _9(e){var i;ug||(ug=e.version);const t=o=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${o} Please update all modules to the same version.`;e.version?D9(e)||Fc(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${ug}.`)):Fc(t(`'${e.moduleName}' is incompatible.`));const n=(i=e.validate)==null?void 0:i.call(e);n&&!n.isValid&&Fc(`${n.message}`)}function Ud(e,t,n=!1){n||(oI=!0),_9(e);const i=e.rowModels??["all"];iI.add(e);let o;t!==void 0?(sI=!0,Tc[t]===void 0&&(Tc[t]={}),o=Tc[t]):o=cg;for(const s of i)o[s]===void 0&&(o[s]={}),o[s][e.moduleName]=e;if(e.dependsOn)for(const s of e.dependsOn)Ud(s,t,n)}function x9(e){delete Tc[e]}function Vw(e,t,n){const i=o=>{var s,r,a;return!!((s=cg[o])!=null&&s[e])||!!((a=(r=Tc[t])==null?void 0:r[o])!=null&&a[e])};return i(n)||i("all")}function Bw(){return sI}function F9(e,t){const n=Tc[e]??{};return[...Object.values(cg.all??{}),...Object.values(n.all??{}),...Object.values(cg[t]??{}),...Object.values(n[t]??{})]}function T9(){return new Set(iI)}function P9(){return oI}function I9(){return R9}var A9=class{static register(e){Ud(e,void 0)}static registerModules(e){for(const t of e)Ud(t,void 0)}},Ue="34.3.1",rI=2e3,aI=100,lI="_version_",dg=null,Pc=`${nI}/javascript-data-grid`;function k9(e){dg=e}function O9(e){Pc=e}function cI(e,t,n){return(dg==null?void 0:dg(e,t))??[V9(e,t,n)]}function Hw(e,t,n,i,o){e(`${i?"warning":"error"} #${t}`,...cI(t,n,o))}function M9(e){if(!e)return String(e);const t={};for(const n of Object.keys(e))typeof e[n]!="object"&&typeof e[n]!="function"&&(t[n]=e[n]);return JSON.stringify(t)}function L9(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=M9(e)),t}function hg(e){return e===void 0?"undefined":e===null?"null":e}function Gw(e,t){return`${e}?${t.toString()}`}function N9(e,t,n){const i=Array.from(t.entries()).sort((s,r)=>r[1].length-s[1].length);let o=Gw(e,t);for(const[s,r]of i){if(s===lI)continue;const a=o.length-n;if(a<=0)break;const l="...",c=a+l.length,u=r.length-c>aI?r.slice(0,r.length-c)+l:r.slice(0,aI)+l;t.set(s,u),o=Gw(e,t)}return o}function uI(e,t){const n=new URLSearchParams;if(n.append(lI,Ue),t)for(const s of Object.keys(t))n.append(s,L9(t[s]));const i=`${Pc}/errors/${e}`,o=Gw(i,n);return o.length<=rI?o:N9(i,n,rI)}var V9=(e,t,n)=>{const i=uI(e,t);return`${`${n?n+`
110
110
  `:""}Visit ${i}`}${n?"":`
111
111
  Alternatively register the ValidationModule to see the full message in the console.`}`};function Ie(...e){Hw(zd,e[0],e[1],!0)}function tn(...e){Hw(Fc,e[0],e[1],!1)}function jd(e,t,n){Hw(Fc,e,t,!1,n)}function B9(e,t){const n=t[0];return`error #${n} `+cI(n,t[1],e).join(" ")}function Es(...e){return B9(void 0,e)}function dI(e,t){return e.get("rowModelType")===t}function kn(e,t){return dI(e,"clientSide")}function Ic(e,t){return dI(e,"serverSide")}function si(e,t){return e.get("domLayout")===t}function il(e){return gg(e)!==void 0}function hI(e){return typeof e.get("getRowHeight")=="function"}function H9(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function qr(e,t,n=!1,i){const{gos:o,environment:s}=e;if(i==null&&(i=s.getDefaultRowHeight()),hI(o)){if(n)return{height:i,estimated:!0};const l={node:t,data:t.data},c=o.getCallback("getRowHeight")(l);if($w(c))return c===0&&Ie(23),{height:Math.max(1,c),estimated:!1}}if(t.detail&&o.get("masterDetail"))return G9(o);const r=o.get("rowHeight");return{height:r&&$w(r)?r:i,estimated:!1}}function G9(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return $w(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function ol(e){const{environment:t,gos:n}=e,i=n.get("rowHeight");if(!i||fn(i))return t.getDefaultRowHeight();const o=t.refreshRowHeightVariable();return o!==-1?o:(Ie(24),t.getDefaultRowHeight())}function $w(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function fI(e,t,n){const i=t[e.getDomDataKey()];return i?i[n]:void 0}function sl(e,t,n,i){const o=e.getDomDataKey();let s=t[o];fn(s)&&(s={},t[o]=s),s[n]=i}function Ac(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function pI(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||si(e,"print"))}function Rs(e){const t=e.get("autoGroupColumnDef");return!(t!=null&&t.comparator)&&!e.get("treeData")}function Ww(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function gI(e){return e.get("grandTotalRow")}function mI(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function vI(e,t,n){return!!t.group&&!t.footer&&mI(e,n)}function kc(e){const t=e.getCallback("getRowId");return t===void 0?t:n=>{let i=t(n);return typeof i!="string"&&(Ow(()=>Ie(25,{id:i}),"getRowIdString"),i=String(i)),i}}function $9(e,t){const n=e.get("groupHideParentOfSingleChild");return!!(n===!0||n==="leafGroupsOnly"&&t.leafGroup||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)}function W9(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}function Oc(e){return(e==null?void 0:e.checkboxes)??!0}function fg(e){return(e==null?void 0:e.mode)==="multiRow"&&(e.headerCheckbox??!0)}function pg(e){if(typeof e=="object")return e.checkboxLocation??"selectionColumn"}function zw(e){return(e==null?void 0:e.hideDisabledCheckboxes)??!1}function z9(e){return typeof e.get("rowSelection")!="string"}function ur(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function yI(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const n=e.get("suppressRowClickSelection"),i=e.get("suppressRowDeselection");return n&&i?!1:n?"enableDeselection":i?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function U9(e){const t=yI(e);return t===!0||t==="enableSelection"}function j9(e){const t=yI(e);return t===!0||t==="enableDeselection"}function Uw(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t==null?void 0:t.isRowSelectable}function gg(e){const t="beanName"in e&&e.beanName==="gos"?e.get("rowSelection"):e.rowSelection;if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(t==null?void 0:t.mode){case"multiRow":case"singleRow":return t.mode;default:return}}function Kd(e){return gg(e)==="multiRow"}function K9(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):(t==null?void 0:t.enableSelectionWithoutKeys)??!1}function mg(e){const t=e.get("rowSelection");if(typeof t=="string"){const n=e.get("groupSelectsChildren"),i=e.get("groupSelectsFiltered");return n&&i?"filteredDescendants":n?"descendants":"self"}return(t==null?void 0:t.mode)==="multiRow"?t.groupSelects:void 0}function CI(e,t=!0){const n=e.get("rowSelection");return typeof n!="object"?t?"all":void 0:n.mode==="multiRow"?n.selectAll:"all"}function q9(e){const t=e.get("rowSelection");return typeof t=="string"?!1:(t==null?void 0:t.mode)==="multiRow"?t.ctrlASelectsRows??!1:!1}function qd(e){const t=mg(e);return t==="descendants"||t==="filteredDescendants"}function wI(e){const t=e.get("rowSelection");return typeof t=="object"&&t.masterSelects||"self"}function Y9(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function eo(e){return e.get("columnMenu")==="legacy"}function Z9(e){return!eo(e)}function X9(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}function mt(e,t){return e.addCommon(t)}function bI({gos:e},t){return t.button===2||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}var J9={resizable:!0,sortable:!0},Q9=0;function SI(){return Q9++}function Yr(e){return e instanceof rl}var rl=class extends be{constructor(e,t,n,i){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=n,this.primary=i,this.isColumn=!0,this.instanceId=SI(),this.autoHeaderHeight=null,this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new el,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=Od(n)}destroy(){var e;super.destroy(),(e=this.beans.rowSpanSvc)==null||e.deregister(this)}getInstanceId(){return this.instanceId}setState(){const{colDef:e,beans:{sortSvc:t,pinnedCols:n,colFlex:i}}=this;t==null||t.initCol(this);const o=e.hide;o!==void 0?this.visible=!o:this.visible=!e.initialHide,n==null||n.initCol(this),i==null||i.initCol(this)}setColDef(e,t,n){var o;const i=e.spanRows!==this.colDef.spanRows;this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),i&&((o=this.beans.rowSpanSvc)==null||o.deregister(this),this.initRowSpan()),this.dispatchColEvent("colDefChanged",n)}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.setState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.initRowSpan(),this.addPivotListener()}initDotNotation(){const{gos:e,colDef:{field:t,tooltipField:n}}=this,i=e.get("suppressFieldDotNotation");this.fieldContainsDots=Ke(t)&&t.includes(".")&&!i,this.tooltipFieldContainsDots=Ke(n)&&n.includes(".")&&!i}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){var e;(e=this.beans.tooltipSvc)==null||e.initCol(this)}initRowSpan(){var e;this.colDef.spanRows&&((e=this.beans.rowSpanSvc)==null||e.register(this))}addPivotListener(){const e=this.beans.pivotColDefSvc,t=this.colDef.pivotValueColumn;!e||!t||this.addManagedListeners(t,{colDefChanged:n=>{const i=e.recreateColDef(this.colDef);this.setColDef(i,i,n.source)}})}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const n=e.width,i=e.initialWidth;return n!=null?t=n:i!=null?t=i:t=200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){var t;return((t=this.beans.showRowGroupCols)==null?void 0:t.isRowGroupDisplayed(this,e))??!1}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}__addEventListener(e,t){this.colEventSvc.addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc.removeEventListener(e,t)}addEventListener(e,t){var i,o,s;this.frameworkEventListenerService=(o=(i=this.beans.frameworkOverrides).createLocalEventListenerWrapper)==null?void 0:o.call(i,this.frameworkEventListenerService,this.colEventSvc);const n=((s=this.frameworkEventListenerService)==null?void 0:s.wrap(e,t))??t;this.colEventSvc.addEventListener(e,n)}removeEventListener(e,t){var i;const n=((i=this.frameworkEventListenerService)==null?void 0:i.unwrap(e,t))??t;this.colEventSvc.removeEventListener(e,n)}createColumnFunctionCallbackParams(e){return mt(this.gos,{node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){var t;return((t=this.beans.cellNavigation)==null?void 0:t.isSuppressNavigable(this,e))??!1}isCellEditable(e){var t;return((t=this.beans.editSvc)==null?void 0:t.isCellEditable({rowNode:e,column:this}))??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){var t;return((t=this.beans.selectionSvc)==null?void 0:t.isCellCheckboxSelection(this,e))??!1}isSuppressPaste(e){var t;return this.isColumnFunc(e,((t=this.colDef)==null?void 0:t.suppressPaste)??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??J9[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const n=this.createColumnFunctionCallbackParams(e);return t(n)}return!1}createColumnEvent(e,t){return mt(this.gos,{type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return fn(this.sort)}isSorting(){return Ke(this.sort)}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){var e;return Ie(261),!!((e=this.beans.colHover)!=null&&e.isHovered(this))}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.dispatchColEvent("lastLeftPinnedChanged",t))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const n=e===!0;this.visible!==n&&(this.visible=n,this.dispatchColEvent("visibleChanged",t)),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.getColDef().suppressSpanHeaderHeight}getFirstRealParent(){let e=this.getOriginalParent();for(;e!=null&&e.isPadding();)e=e.getOriginalParent();return e}getColumnGroupPaddingInfo(){let e=this.getParent();if(!(e!=null&&e.isPadding()))return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let n=!0;for(;e;){if(!e.isPadding()){n=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:n}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return mt(this.gos,{node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(fn(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),n=this.colDef.colSpan(t);return Math.max(n,1)}getRowSpan(e){if(fn(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),n=this.colDef.rowSpan(t);return Math.max(n,1)}setActualWidth(e,t,n=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex!=null&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),n||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.dispatchColEvent("widthChanged",e)}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}dispatchColEvent(e,t,n){const i=this.createColumnEvent(e,t);n&&_i(i,n),this.colEventSvc.dispatchEvent(i)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function fi(e){return e instanceof vg}var vg=class extends be{constructor(e,t,n,i){super(),this.colGroupDef=e,this.groupId=t,this.padding=n,this.level=i,this.isColumn=!1,this.expandable=!1,this.instanceId=SI(),this.expandableListenerRemoveCallback=null,this.expanded=!!(e!=null&&e.openByDefault)}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}forEachLeafColumn(e){if(this.children)for(const t of this.children)Yr(t)?e(t):fi(t)&&t.forEachLeafColumn(e)}addLeafColumns(e){if(this.children)for(const t of this.children)Yr(t)?e.push(t):fi(t)&&t.addLeafColumns(e)}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);for(const t of this.getLeafColumns())t.__addEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=()=>{for(const t of this.getLeafColumns())t.__removeEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,n=!1;const i=this.findChildrenRemovingPadding();for(let s=0,r=i.length;s<r;s++){const a=i[s];if(!a.isVisible())continue;const l=a.getColumnGroupShow();l==="open"?(e=!0,n=!0):l==="closed"?(t=!0,n=!0):(e=!0,t=!0)}const o=e&&t&&n;this.expandable!==o&&(this.expandable=o,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=n=>{for(const i of n)fi(i)&&i.isPadding()?t(i.children):e.push(i)};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},eq={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function EI(e,t,n){const i={},o=e.gos;return Object.assign(i,o.get("defaultColGroupDef")),Object.assign(i,t),o.validateColDef(i,n),i}var tq=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=Ew(e);let n=0;for(;;){let i=e??t;if(i?n!==0&&(i+="_"+n):i=n,!this.existingKeys[i]){const o=String(i);return e&&n>0&&Ie(273,{providedId:e,usedId:o}),this.existingKeys[o]=!0,o}n++}}};function on(e){if(e!=null&&e.length)return e[e.length-1]}function Zr(e,t,n){if(e===t)return!0;if(!e||!t)return e==null&&t==null;const i=e.length;if(i!==t.length)return!1;for(let o=0;o<i;o++)if(e[o]!==t[o]&&!(n!=null&&n(e[o],t[o])))return!1;return!0}function Yd(e,t){if(e)for(const n of e)t(n)}function Yo(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function RI(e,t,n){for(let i=0;i<t.length;i++)Yo(e,t[i]);for(let i=t.length-1;i>=0;i--)e.splice(n,0,t[i])}var yg="ag-Grid-AutoColumn",DI="ag-Grid-SelectionColumn",_I="ag-Grid-RowNumbersColumn";function xI(e){const t=[],n=i=>{for(let o=0;o<i.length;o++){const s=i[o];Yr(s)?t.push(s):fi(s)&&n(s.getChildren())}};return n(e),t}function dr(e){return e.reduce((t,n)=>t+n.getActualWidth(),0)}function Cg(e,t,n){const i={};if(!t)return;pr(null,t,s=>{i[s.getInstanceId()]=s}),n&&pr(null,n,s=>{i[s.getInstanceId()]=null});const o=Object.values(i).filter(s=>s!=null);e.context.destroyBeans(o)}function jw(e){return e.getId().startsWith(yg)}function hr(e){const t=typeof e=="string"?e:"getColId"in e?e.getColId():e.colId;return(t==null?void 0:t.startsWith(DI))??!1}function fr(e){const t=typeof e=="string"?e:"getColId"in e?e.getColId():e.colId;return(t==null?void 0:t.startsWith(_I))??!1}function nq(e){return hr(e)||fr(e)}function wg(e){let t=[];return e instanceof Array?t=e:typeof e=="string"&&(t=e.split(",")),t}function iq(e,t){return Zr(e,t,(n,i)=>n.getColId()===i.getColId())}function oq(e){e.map={};for(const t of e.list)e.map[t.getId()]=t}function Mc(e){return e==="optionsUpdated"?"gridOptionsChanged":e}function Zd(e,t){const n=e===t,i=e.getColDef()===t,o=e.getColId()==t;return n||i||o}var sq=(e,t)=>(n,i)=>{const o={value1:void 0,value2:void 0};let s=!1;return e&&(e[n]!==void 0&&(o.value1=e[n],s=!0),Ke(i)&&e[i]!==void 0&&(o.value2=e[i],s=!0)),!s&&t&&(t[n]!==void 0&&(o.value1=t[n]),Ke(i)&&t[i]!==void 0&&(o.value2=t[i])),o},rq=(e,t)=>{fi(e)&&e.setupExpandable(),e.originalParent=t};function aq(e,t=null,n,i,o){const s=new tq,{existingCols:r,existingGroups:a,existingColKeys:l}=lq(i);s.addExistingKeys(l);const c=FI(e,t,0,n,r,s,a,o),{colGroupSvc:u}=e,d=(u==null?void 0:u.findMaxDepth(c,0))??0,h=u?u.balanceColumnTree(c,0,d,s):c;return pr(null,h,rq),{columnTree:h,treeDepth:d}}function lq(e){const t=[],n=[],i=[];return e&&pr(null,e,o=>{if(fi(o)){const s=o;n.push(s)}else{const s=o;i.push(s.getId()),t.push(s)}}),{existingCols:t,existingGroups:n,existingColKeys:i}}function FI(e,t,n,i,o,s,r,a){if(!t)return[];const{colGroupSvc:l}=e,c=new Array(t.length);for(let u=0;u<c.length;u++){const d=t[u];l&&pq(d)?c[u]=l.createProvidedColumnGroup(i,d,n,o,s,r,a):c[u]=cq(e,i,d,o,s,a)}return c}function cq(e,t,n,i,o,s){var l;const r=dq(n,i);r&&(i==null||i.splice(r.idx,1));let a=r==null?void 0:r.column;if(a){const c=Kw(e,n,a.getColId());a.setColDef(c,n,s),uq(e,a,c,s)}else{const c=o.getUniqueKey(n.colId,n.field),u=Kw(e,n,c);a=new rl(u,n,c,t),e.context.createBean(a)}return(l=e.dataTypeSvc)==null||l.addColumnListeners(a),a}function TI(e,t,n,i,o,s,r,a){const{sortSvc:l,pinnedCols:c,colFlex:u}=e;n!==void 0&&t.setVisible(!n,a),l&&(l.updateColSort(t,i,a),o!==void 0&&l.setColSortIndex(t,o)),s!==void 0&&(c==null||c.setColPinned(t,s)),r!==void 0&&(u==null||u.setColFlex(t,r))}function uq(e,t,n,i){TI(e,t,n.hide,n.sort,n.sortIndex,n.pinned,n.flex,i);const o=t.getFlex();if(!(o!=null&&o>0))if(n.width!=null)t.setActualWidth(n.width,i);else{const s=t.getActualWidth();t.setActualWidth(s,i)}}function dq(e,t){if(t)for(let n=0;n<t.length;n++){const i=t[n].getUserProvidedColDef();if(!i)continue;if(e.colId!=null){if(t[n].getId()===e.colId)return{idx:n,column:t[n]};continue}if(e.field!=null){if(i.field===e.field)return{idx:n,column:t[n]};continue}if(i===e)return{idx:n,column:t[n]}}}function Kw(e,t,n,i){const{gos:o,dataTypeSvc:s}=e,r={},a=o.get("defaultColDef");_i(r,a,!1,!0);const l=hq(e,r,t,n);l&&fq(e,l,r);const c=r.cellDataType;_i(r,t,!1,!0),c!==void 0&&(r.cellDataType=c);const u=o.get("autoGroupColumnDef"),d=Rs(o);return t.rowGroup&&u&&d&&_i(r,{sort:u.sort,initialSort:u.initialSort},!1,!0),s&&(s.postProcess(r),s.validateColDef(r)),o.validateColDef(r,n,i),r}function hq(e,t,n,i){var r;const o=(r=e.dataTypeSvc)==null?void 0:r.updateColDefAndGetColumnType(t,n,i),s=n.type??o??t.type;return t.type=s,s?wg(s):void 0}function fq(e,t,n){if(!t.length)return;const i=Object.assign({},eq),o=e.gos.get("columnTypes")||{};for(const s of Object.keys(o)){const r=o[s];s in i?Ie(34,{key:s}):(r.type&&Ie(35),i[s]=r)}for(const s of t){const r=i[s.trim()];r?_i(n,r,!1,!0):Ie(36,{t:s})}}function pq(e){return e.children!==void 0}function pr(e,t,n){if(t)for(let i=0;i<t.length;i++){const o=t[i];fi(o)&&pr(o,o.getChildren(),n),n(o,e)}}function PI(e,t){const n=[],i=[],o=[];return e.forEach(r=>{const a=r.getColDef().lockPosition;a==="right"?o.push(r):a==="left"||a===!0?n.push(r):i.push(r)}),t.get("enableRtl")?[...o,...i,...n]:[...n,...i,...o]}function II(e,t){let n=!0;return pr(null,t,i=>{if(!fi(i))return;const o=i,s=o.getColGroupDef();if(!(s==null?void 0:s.marryChildren))return;const a=[];for(const h of o.getLeafColumns()){const f=e.indexOf(h);a.push(f)}const l=Math.max.apply(Math,a),c=Math.min.apply(Math,a),u=l-c,d=o.getLeafColumns().length-1;u>d&&(n=!1)}),n}function AI(e,t){if(!e||e.length==0)return;const n=t(e[0]);for(let i=1;i<e.length;i++)if(n!==t(e[i]))return;return n}function kI(e,t,n){if(!t.length)return;const i=t.length===1?t[0]:null,o=AI(t,s=>s.getPinned());e.dispatchEvent({type:"columnPinned",pinned:o??null,columns:t,column:i,source:n})}function gq(e,t,n){if(!t.length)return;const i=t.length===1?t[0]:null,o=AI(t,s=>s.isVisible());e.dispatchEvent({type:"columnVisible",visible:o,columns:t,column:i,source:n})}function mq(e,t,n,i){e.dispatchEvent({type:t,columns:n,column:n&&n.length==1?n[0]:null,source:i})}function Lc(e,t,n,i,o=null){t!=null&&t.length&&e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:o,finished:n,source:i})}function Zo(e,t,n){var R;const{colModel:i,rowGroupColsSvc:o,pivotColsSvc:s,autoColSvc:r,selectionColSvc:a,colAnimation:l,visibleCols:c,pivotResultCols:u,environment:d,valueColsSvc:h,eventSvc:f,gos:g}=e,m=i.getColDefCols()??[],y=a==null?void 0:a.getColumns();if(!m.length&&!(y!=null&&y.length))return!1;if(t!=null&&t.state&&!t.state.forEach)return Ie(32),!1;const b=(E,_,I,O,k)=>{if(!E)return;const x=sq(_,t.defaultState),P=x("flex").value1;if(TI(e,E,x("hide").value1,x("sort").value1,x("sortIndex").value1,x("pinned").value1,P,n),P==null){const N=x("width").value1;if(N!=null){const G=E.getColDef().minWidth??d.getDefaultColumnMinWidth();G!=null&&N>=G&&E.setActualWidth(N,n)}}k||!E.isPrimary()||(h==null||h.syncColumnWithState(E,n,x),o==null||o.syncColumnWithState(E,n,x,I),s==null||s.syncColumnWithState(E,n,x,O))},S=(E,_,I)=>{var ue,De;const O=OI(e,n),k=_.slice(),x={},P={},N=[],G=[],se=[];let B=0;const H=(o==null?void 0:o.columns.slice())??[],J=(s==null?void 0:s.columns.slice())??[];for(const ae of E){const Fe=ae.colId;if(Fe.startsWith(yg)){N.push(ae),se.push(ae);continue}if(hr(Fe)){G.push(ae),se.push(ae);continue}const Je=I(Fe);Je?(b(Je,ae,x,P,!1),Yo(k,Je)):(se.push(ae),B+=1)}const $=ae=>b(ae,null,x,P,!1);k.forEach($),o==null||o.sortColumns(LI.bind(o,x,H)),s==null||s.sortColumns(LI.bind(s,P,J)),i.refreshCols(!1,n);const ce=(ae,Fe,Me=[])=>{for(const Je of Fe){const pt=ae(Je.colId);Yo(Me,pt),b(pt,Je,null,null,!0)}Me.forEach($)};return ce(ae=>(r==null?void 0:r.getColumn(ae))??null,N,(ue=r==null?void 0:r.getColumns())==null?void 0:ue.slice()),ce(ae=>(a==null?void 0:a.getColumn(ae))??null,G,(De=a==null?void 0:a.getColumns())==null?void 0:De.slice()),yq(t,i,g),c.refresh(n),f.dispatchEvent({type:"columnEverythingChanged",source:n}),O(),{unmatchedAndAutoStates:se,unmatchedCount:B}};l==null||l.start();let{unmatchedAndAutoStates:F,unmatchedCount:C}=S(t.state||[],m,E=>i.getColDefCol(E));if(F.length>0||Ke(t.defaultState)){const E=((R=u==null?void 0:u.getPivotResultCols())==null?void 0:R.list)??[];C=S(F,E,_=>(u==null?void 0:u.getPivotResultCol(_))??null).unmatchedCount}return l==null||l.finish(),C===0}function vq(e,t){var S,F;const{colModel:n,autoColSvc:i,selectionColSvc:o,eventSvc:s,gos:r}=e,a=n.getColDefCols();if(!(a!=null&&a.length))return;const l=n.getColDefColTree(),c=xI(l),u=[];let d=1e3,h=1e3;const f=C=>{const R=MI(C);fn(R.rowGroupIndex)&&R.rowGroup&&(R.rowGroupIndex=d++),fn(R.pivotIndex)&&R.pivot&&(R.pivotIndex=h++),u.push(R)};(S=i==null?void 0:i.getColumns())==null||S.forEach(f),(F=o==null?void 0:o.getColumns())==null||F.forEach(f),c==null||c.forEach(f),Zo(e,{state:u},t);const g=(i==null?void 0:i.getColumns())??[],b=[...(o==null?void 0:o.getColumns())??[],...g,...a].map(C=>({colId:C.colId}));Zo(e,{state:b,applyOrder:!0},t),s.dispatchEvent(mt(r,{type:"columnsReset",source:t}))}function OI(e,t){const{rowGroupColsSvc:n,pivotColsSvc:i,valueColsSvc:o,colModel:s,sortSvc:r,eventSvc:a}=e,l={rowGroupColumns:(n==null?void 0:n.columns.slice())??[],pivotColumns:(i==null?void 0:i.columns.slice())??[],valueColumns:(o==null?void 0:o.columns.slice())??[]},c=bg(e),u={};for(const d of c)u[d.colId]=d;return()=>{const d=(E,_,I,O)=>{const k=_.map(O),x=I.map(O);if(Zr(k,x))return;const N=new Set(_);for(const se of I)N.delete(se)||N.add(se);const G=[...N];a.dispatchEvent({type:E,columns:G,column:G.length===1?G[0]:null,source:t})},h=E=>{const _=[];return s.forAllCols(I=>{const O=u[I.getColId()];O&&E(O,I)&&_.push(I)}),_},f=E=>E.getColId();d("columnRowGroupChanged",l.rowGroupColumns,(n==null?void 0:n.columns)??[],f),d("columnPivotChanged",l.pivotColumns,(i==null?void 0:i.columns)??[],f);const m=h((E,_)=>{const I=E.aggFunc!=null,O=I!=_.isValueActive(),k=I&&E.aggFunc!=_.getAggFunc();return O||k});m.length>0&&mq(a,"columnValueChanged",m,t),Lc(a,h((E,_)=>E.width!=_.getActualWidth()),!0,t),kI(a,h((E,_)=>E.pinned!=_.getPinned()),t),gq(a,h((E,_)=>E.hide==_.isVisible()),t);const C=h((E,_)=>E.sort!=_.getSort()||E.sortIndex!=_.getSortIndex());C.length>0&&(r==null||r.dispatchSortChangedEvents(t,C));const R=bg(e);wq(c,R,t,s,a)}}function bg(e){const{colModel:t,rowGroupColsSvc:n,pivotColsSvc:i}=e,o=t.getColDefCols();if(fn(o)||!t.isAlive())return[];const s=n==null?void 0:n.columns,r=i==null?void 0:i.columns,a=[],l=u=>{const d=u.isRowGroupActive()&&s?s.indexOf(u):null,h=u.isPivotActive()&&r?r.indexOf(u):null,f=u.isValueActive()?u.getAggFunc():null,g=u.getSort()!=null?u.getSort():null,m=u.getSortIndex()!=null?u.getSortIndex():null;a.push({colId:u.getColId(),width:u.getActualWidth(),hide:!u.isVisible(),pinned:u.getPinned(),sort:g,sortIndex:m,aggFunc:f,rowGroup:u.isRowGroupActive(),rowGroupIndex:d,pivot:u.isPivotActive(),pivotIndex:h,flex:u.getFlex()??null})};t.forAllCols(u=>l(u));const c=new Map(t.getCols().map((u,d)=>[u.getColId(),d]));return a.sort((u,d)=>{const h=c.has(u.colId)?c.get(u.colId):-1,f=c.has(d.colId)?c.get(d.colId):-1;return h-f}),a}function MI(e){const t=(g,m)=>g??m??null,n=e.getColDef(),i=t(n.sort,n.initialSort),o=t(n.sortIndex,n.initialSortIndex),s=t(n.hide,n.initialHide),r=t(n.pinned,n.initialPinned),a=t(n.width,n.initialWidth),l=t(n.flex,n.initialFlex);let c=t(n.rowGroupIndex,n.initialRowGroupIndex),u=t(n.rowGroup,n.initialRowGroup);c==null&&!u&&(c=null,u=null);let d=t(n.pivotIndex,n.initialPivotIndex),h=t(n.pivot,n.initialPivot);d==null&&!h&&(d=null,h=null);const f=t(n.aggFunc,n.initialAggFunc);return{colId:e.getColId(),sort:i,sortIndex:o,hide:s,pinned:r,width:a,flex:l,rowGroup:u,rowGroupIndex:c,pivot:h,pivotIndex:d,aggFunc:f}}function yq(e,t,n){if(!e.applyOrder||!e.state)return;const i=[];for(const o of e.state)o.colId!=null&&i.push(o.colId);Cq(t.cols,i,t,n)}function Cq(e,t,n,i){if(e==null)return;let o=[];const s={};for(const a of t){if(s[a])continue;const l=e.map[a];l&&(o.push(l),s[a]=!0)}let r=0;for(const a of e.list){const l=a.getColId();if(s[l]!=null)continue;l.startsWith(yg)?o.splice(r++,0,a):o.push(a)}if(o=PI(o,i),!II(o,n.getColTree())){Ie(39);return}e.list=o}function wq(e,t,n,i,o){const s={};for(const u of t)s[u.colId]=u;const r={};for(const u of e)s[u.colId]&&(r[u.colId]=!0);const a=e.filter(u=>r[u.colId]),l=t.filter(u=>r[u.colId]),c=[];l.forEach((u,d)=>{const h=a==null?void 0:a[d];if(h&&h.colId!==u.colId){const f=i.getCol(h.colId);f&&c.push(f)}}),c.length&&o.dispatchEvent({type:"columnMoved",columns:c,column:c.length===1?c[0]:null,finished:!0,source:n})}var LI=(e,t,n,i)=>{const o=e[n.getId()],s=e[i.getId()],r=o!=null,a=s!=null;if(r&&a)return o-s;if(r)return-1;if(a)return 1;const l=t.indexOf(n),c=t.indexOf(i),u=l>=0,d=c>=0;return u&&d?l-c:u?-1:1},bq=class extends be{constructor(){super(...arguments),this.beanName="colModel",this.pivotMode=!1,this.ready=!1,this.changeEventsDispatching=!1}postConstruct(){this.pivotMode=this.gos.get("pivotMode"),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents","rowNumbers","hidePaddedHeaderRows"],e=>this.refreshAll(Mc(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),Mc(e.source)))}createColsFromColDefs(e){var S,F,C;const{beans:t}=this,{valueCache:n,colAutosize:i,rowGroupColsSvc:o,pivotColsSvc:s,valueColsSvc:r,visibleCols:a,eventSvc:l,groupHierarchyColSvc:c}=t,u=this.colDefs?OI(t,e):void 0;n==null||n.expire();const d=(S=this.colDefCols)==null?void 0:S.list,h=(F=this.colDefCols)==null?void 0:F.tree,f=aq(t,this.colDefs,!0,h,e);Cg(t,(C=this.colDefCols)==null?void 0:C.tree,f.columnTree);const g=f.columnTree,m=f.treeDepth,y=xI(g),b={};for(const R of y)b[R.getId()]=R;this.colDefCols={tree:g,treeDepth:m,list:y,map:b},this.createColumnsForService([c],this.colDefCols,e),o==null||o.extractCols(e,d),s==null||s.extractCols(e,d),r==null||r.extractCols(e,d),this.ready=!0,this.refreshCols(!0,e),a.refresh(e),l.dispatchEvent({type:"columnEverythingChanged",source:e}),u&&(this.changeEventsDispatching=!0,u(),this.changeEventsDispatching=!1),l.dispatchEvent({type:"newColumnsLoaded",source:e}),e==="gridInitializing"&&(i==null||i.applyAutosizeStrategy())}refreshCols(e,t){var y;if(!this.colDefCols)return;const n=(y=this.cols)==null?void 0:y.tree;this.saveColOrder();const{autoColSvc:i,selectionColSvc:o,rowNumbersSvc:s,quickFilter:r,pivotResultCols:a,showRowGroupCols:l,rowAutoHeight:c,visibleCols:u,colViewport:d,eventSvc:h}=this.beans,f=this.selectCols(a,this.colDefCols);this.createColumnsForService([i,o,s],f,t);const g=H9(this.gos,this.showingPivotResult);(!e||g)&&this.restoreColOrder(f),this.positionLockedCols(f),l==null||l.refresh(),r==null||r.refreshCols(),this.setColSpanActive(),c==null||c.setAutoHeightActive(f),u.clear(),d.clear(),!Zr(n,this.cols.tree)&&h.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(e,t,n){for(const i of e)i&&(i.createColumns(t,o=>{this.lastOrder=o(this.lastOrder),this.lastPivotOrder=o(this.lastPivotOrder)},n),i.addColumns(t))}selectCols(e,t){const n=(e==null?void 0:e.getPivotResultCols())??null;this.showingPivotResult=n!=null;const{map:i,list:o,tree:s,treeDepth:r}=n??t;return this.cols={list:o.slice(),map:{...i},tree:s.slice(),treeDepth:r},n&&(n.list.some(l=>{var c;return((c=this.cols)==null?void 0:c.map[l.getColId()])!==void 0})||(this.lastPivotOrder=null)),this.cols}getColsToShow(){if(!this.cols)return[];const{valueColsSvc:e,selectionColSvc:t,gos:n}=this.beans,i=this.isPivotMode()&&!this.showingPivotResult,o=t==null?void 0:t.isSelectionColumnEnabled(),s=n.get("rowNumbers"),r=e==null?void 0:e.columns;return this.cols.list.filter(l=>{const c=jw(l);if(i){const u=r==null?void 0:r.includes(l);return c||u||o&&hr(l)||s&&fr(l)}else return c||l.isVisible()})}refreshAll(e){this.ready&&(this.refreshCols(!1,e),this.beans.visibleCols.refresh(e))}setColsVisible(e,t=!1,n){Zo(this.beans,{state:e.map(i=>({colId:typeof i=="string"?i:i.getColId(),hide:!t}))},n)}restoreColOrder(e){const t=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!t)return;const n=t.filter(d=>e.map[d.getId()]!=null);if(n.length===0)return;if(n.length===e.list.length){e.list=n;return}const i=d=>{const h=d.getOriginalParent();return h?h.getChildren().length>1?!0:i(h):!1};if(!n.some(d=>i(d))){const d=new Set(n);for(const h of e.list)d.has(h)||n.push(h);e.list=n;return}const o=new Map;for(let d=0;d<n.length;d++){const h=n[d];o.set(h,d)}const s=e.list.filter(d=>!o.has(d));if(s.length===0){e.list=n;return}const r=(d,h)=>{const f=h?h.getOriginalParent():d.getOriginalParent();if(!f)return null;let g=null,m=null;for(const y of f.getChildren())if(!(y===h||y===d)){if(y instanceof rl){const b=o.get(y);if(b==null)continue;(g==null||g<b)&&(g=b,m=y);continue}y.forEachLeafColumn(b=>{const S=o.get(b);S!=null&&(g==null||g<S)&&(g=S,m=b)})}return m??r(d,f)},a=[],l=new Map;for(const d of s){const h=r(d,null);if(h==null){a.push(d);continue}const f=l.get(h);f===void 0?l.set(h,d):Array.isArray(f)?f.push(d):l.set(h,[f,d])}const c=new Array(e.list.length);let u=c.length-1;for(let d=a.length-1;d>=0;d--)c[u--]=a[d];for(let d=n.length-1;d>=0;d--){const h=n[d],f=l.get(h);if(f)if(Array.isArray(f))for(let g=f.length-1;g>=0;g--){const m=f[g];c[u--]=m}else c[u--]=f;c[u--]=h}e.list=c}positionLockedCols(e){e.list=PI(e.list,this.gos)}saveColOrder(){var e,t;this.showingPivotResult?this.lastPivotOrder=((e=this.cols)==null?void 0:e.list)??null:this.lastOrder=((t=this.cols)==null?void 0:t.list)??null}getColumnDefs(e){var t,n;return this.colDefCols&&((n=this.beans.colDefFactory)==null?void 0:n.getColumnDefs(this.colDefCols.list,this.showingPivotResult,this.lastOrder,((t=this.cols)==null?void 0:t.list)??[],e))}setColSpanActive(){var e;this.colSpanActive=!!((e=this.cols)!=null&&e.list.some(t=>t.getColDef().colSpan!=null))}isPivotMode(){return this.pivotMode}setPivotMode(e,t){if(e===this.pivotMode||(this.pivotMode=e,!this.ready))return;this.refreshCols(!1,t);const{visibleCols:n,eventSvc:i}=this.beans;n.refresh(t),i.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){var t;const e=(t=this.beans.pivotColsSvc)==null?void 0:t.columns;return this.pivotMode&&!!(e!=null&&e.length)}recreateColumnDefs(e){var n;if(!this.cols)return;(n=this.beans.autoColSvc)==null||n.updateColumns(e);const t=Mc(e.source);this.createColsFromColDefs(t)}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){var e;Cg(this.beans,(e=this.colDefCols)==null?void 0:e.tree),super.destroy()}getColTree(){var e;return((e=this.cols)==null?void 0:e.tree)??[]}getColDefColTree(){var e;return((e=this.colDefCols)==null?void 0:e.tree)??[]}getColDefCols(){var e;return((e=this.colDefCols)==null?void 0:e.list)??null}getCols(){var e;return((e=this.cols)==null?void 0:e.list)??[]}forAllCols(e){var s,r,a,l,c;const{pivotResultCols:t,autoColSvc:n,selectionColSvc:i,groupHierarchyColSvc:o}=this.beans;Yd((s=this.colDefCols)==null?void 0:s.list,e),Yd((r=n==null?void 0:n.columns)==null?void 0:r.list,e),Yd((a=i==null?void 0:i.columns)==null?void 0:a.list,e),Yd((l=o==null?void 0:o.columns)==null?void 0:l.list,e),Yd((c=t==null?void 0:t.getPivotResultCols())==null?void 0:c.list,e)}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){var t;return(t=this.colDefCols)!=null&&t.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)}getColById(e){var t;return((t=this.cols)==null?void 0:t.map[e])??null}getColFromCollection(e,t){if(t==null)return null;const{map:n,list:i}=t;if(typeof e=="string"&&n[e])return n[e];for(let a=0;a<i.length;a++)if(Zd(i[a],e))return i[a];const{autoColSvc:o,selectionColSvc:s,groupHierarchyColSvc:r}=this.beans;return(o==null?void 0:o.getColumn(e))??(s==null?void 0:s.getColumn(e))??(r==null?void 0:r.getColumn(e))??null}},NI=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let n;return typeof t!="number"?n=0:n=t+1,this.existingIds[e]=n,n}};function Xd(e,t,n){return n&&e.addDestroyFunc(()=>t.destroyBean(n)),n??e}var je=null;function VI(e){return typeof(e==null?void 0:e.getGui)=="function"}var BI=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){var i;if(!e)return;if(e.indexOf(" ")>=0){const o=(e||"").split(" ");if(o.length>1){for(const s of o)this.toggleCss(s,t);return}}this.cssClassStates[e]!==t&&e.length&&((i=this.getGui())==null||i.classList.toggle(e,t),this.cssClassStates[e]=t)}},Sq=0,Jd=class extends Ss{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=Sq++,this.cssManager=new BI(()=>this.eGui),this.componentSelectors=new Map((t??[]).map(n=>[n.selector,n])),e&&this.setTemplate(e)}preConstruct(){var t,n;this.wireTemplate(this.getGui());const e="component-"+((n=(t=Object.getPrototypeOf(this))==null?void 0:t.constructor)==null?void 0:n.name);for(const i of this.css??[])this.beans.environment.addGlobalCSS(i,e)}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getDataRefAttribute(e){return e.getAttribute?e.getAttribute(K1):null}applyElementsToComponent(e,t,n,i=null){if(t===void 0&&(t=this.getDataRefAttribute(e)),t){const o=this[t];if(o===je)this[t]=i??e;else{const s=n==null?void 0:n[t];if(!this.suppressDataRefValidation&&!s)throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${o}`)}}}createChildComponentsFromTags(e,t){const n=[];for(const i of e.childNodes??[])n.push(i);for(const i of n){if(!(i instanceof HTMLElement))continue;const o=this.createComponentFromElement(i,s=>{const r=s.getGui();if(r)for(const a of i.attributes??[])r.setAttribute(a.name,a.value)},t);if(o){if(o.addItems&&i.children.length){this.createChildComponentsFromTags(i,t);const s=Array.prototype.slice.call(i.children);o.addItems(s)}this.swapComponentForNode(o,e,i)}else i.childNodes&&this.createChildComponentsFromTags(i,t)}}createComponentFromElement(e,t,n){const i=e.nodeName,o=this.getDataRefAttribute(e),s=i.indexOf("AG-")===0,r=s?this.componentSelectors.get(i):null;let a=null;if(r){const l=n&&o?n[o]:void 0;a=new r.component(l),a.setParentComponent(this),this.createBean(a,null,t)}else if(s)throw new Error(`selector: ${i}`);return this.applyElementsToComponent(e,o,n,a),a}swapComponentForNode(e,t,n){const i=e.getGui();t.replaceChild(i,n),t.insertBefore(document.createComment(n.nodeName),i),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e){const t=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui());for(const n of e)n.setAttribute("tabindex",t.toString())}setTemplate(e,t,n){let i;typeof e=="string"||e==null?i=xw(e):i=Gd(e),this.setTemplateFromElement(i,t,n)}setTemplateFromElement(e,t,n,i=!1){if(this.eGui=e,this.suppressDataRefValidation=i,t)for(let o=0;o<t.length;o++){const s=t[o];this.componentSelectors.set(s.selector,s)}this.wireTemplate(e,n)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}getContainerAndElement(e,t){let n=t;return e==null?null:(n||(n=this.eGui),Pw(e)?{element:e,parent:n}:{element:e.getGui(),parent:n})}prependChild(e,t){const{element:n,parent:i}=this.getContainerAndElement(e,t)||{};!n||!i||i.insertAdjacentElement("afterbegin",n)}appendChild(e,t){const{element:n,parent:i}=this.getContainerAndElement(e,t)||{};!n||!i||i.appendChild(n)}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:n}=t;n9(this.eGui,e,{skipAriaHidden:n})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:n}=t;pn(this.eGui,e,{skipAriaHidden:n});const i={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(i)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),super.destroy()}addGuiEventListener(e,t,n){this.eGui.addEventListener(e,t,n),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,t))}addCss(e){this.cssManager.toggleCss(e,!0)}removeCss(e){this.cssManager.toggleCss(e,!1)}toggleCss(e,t){this.cssManager.toggleCss(e,t)}registerCSS(e){this.css||(this.css=[]),this.css.push(e)}},Xt=class extends Jd{};function HI(e){return typeof e=="object"&&!!e.component}function Eq(e,t){return new Rn(n=>{n(window.setInterval(e,t))})}var Rn=class Ah{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(n=>this.onDone(n),n=>this.onReject(n))}static all(t){return t.length?new Ah(n=>{let i=t.length;const o=new Array(i);t.forEach((s,r)=>{s.then(a=>{o[r]=a,i--,i===0&&n(o)})})}):Ah.resolve()}static resolve(t=null){return new Ah(n=>n(t))}then(t){return new Ah(n=>{this.status===1?n(t(this.resolution)):this.waiters.push(i=>n(t(i)))})}onDone(t){this.status=1,this.resolution=t;for(const n of this.waiters)n(t)}onReject(t){}};function Rq(e){return e?e.prototype&&"getGui"in e.prototype:!1}function GI(e,t,n,i){const{name:o}=n;let s,r,a,l,c,u;if(t){const d=t,h=d[o+"Selector"],f=h?h(i):null,g=m=>{typeof m=="string"?s=m:m!=null&&m!==!0&&(e.isFrameworkComponent(m)?a=m:r=m)};f?(g(f.component),l=f.params,c=f.popup,u=f.popupPosition):g(d[o])}return{compName:s,jsComp:r,fwComp:a,paramsFromSelector:l,popupFromSelector:c,popupPositionFromSelector:u}}var Dq=class extends be{constructor(){super(...arguments),this.beanName="userCompFactory"}wireBeans(e){this.agCompUtils=e.agCompUtils,this.registry=e.registry,this.frameworkCompWrapper=e.frameworkCompWrapper,this.gridOptions=e.gridOptions}getCompDetailsFromGridOptions(e,t,n,i=!1){return this.getCompDetails(this.gridOptions,e,t,n,i)}getCompDetails(e,t,n,i,o=!1){var F;const{name:s,cellRenderer:r}=t;let{compName:a,jsComp:l,fwComp:c,paramsFromSelector:u,popupFromSelector:d,popupPositionFromSelector:h}=GI(this.beans.frameworkOverrides,e,t,i),f,g;const m=C=>{const R=this.registry.getUserComponent(s,C);R&&(l=R.componentFromFramework?void 0:R.component,c=R.componentFromFramework?R.component:void 0,f=R.params,g=R.processParams)};if(a!=null&&m(a),l==null&&c==null&&n!=null&&m(n),l&&r&&!Rq(l)&&(l=(F=this.agCompUtils)==null?void 0:F.adaptFunction(t,l)),!l&&!c){const{validation:C}=this.beans;o&&(a!==n||!n)?a?C!=null&&C.isProvidedUserComp(a)||tn(50,{compName:a}):n?C||tn(260,{...this.gos.getModuleErrorParams(),propName:s,compName:n}):tn(216,{name:s}):n&&!C&&tn(146,{comp:n});return}const y=this.mergeParams(e,t,i,u,f,g),b=l==null,S=l??c;return{componentFromFramework:b,componentClass:S,params:y,type:t,popupFromSelector:d,popupPositionFromSelector:h,newAgStackInstance:()=>this.newAgStackInstance(S,b,y,t)}}newAgStackInstance(e,t,n,i){var a;const o=!t;let s;o?s=new e:s=this.frameworkCompWrapper.wrap(e,i.mandatoryMethods,i.optionalMethods,i),this.createBean(s);const r=(a=s.init)==null?void 0:a.call(s,n);return r==null?Rn.resolve(s):r.then(()=>s)}mergeParams(e,t,n,i=null,o,s){const r={...n,...o},a=e,l=a==null?void 0:a[t.name+"Params"];if(typeof l=="function"){const c=l(n);_i(r,c)}else typeof l=="object"&&_i(r,l);return _i(r,i),s?s(r):r}},_q={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},xq={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},Fq={name:"headerComponent",optionalMethods:["refresh"]},Tq={name:"innerHeaderComponent"},Pq={name:"innerHeaderGroupComponent"},Iq={name:"headerGroupComponent"},Aq={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},kq={name:"loadingCellRenderer",cellRenderer:!0},Oq={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},Mq={name:"loadingOverlayComponent",optionalMethods:["refresh"]},Lq={name:"noRowsOverlayComponent",optionalMethods:["refresh"]},Nq={name:"tooltipComponent"},qw={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},Vq={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},Bq={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},Hq={name:"loadingCellRenderer",cellRenderer:!0},Gq={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},$q={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function Wq(e,t){return e.getCompDetailsFromGridOptions(xq,"agDragAndDropImage",t,!0)}function zq(e,t,n){return e.getCompDetails(t,Fq,"agColumnHeader",n)}function Uq(e,t,n){return e.getCompDetails(t,Tq,void 0,n)}function jq(e,t){const n=t.columnGroup.getColGroupDef();return e.getCompDetails(n,Iq,"agColumnGroupHeader",t)}function Kq(e,t,n){return e.getCompDetails(t,Pq,void 0,n)}function qq(e,t){return e.getCompDetailsFromGridOptions(Bq,void 0,t,!0)}function Yq(e,t){return e.getCompDetailsFromGridOptions(Hq,"agLoadingCellRenderer",t,!0)}function Zq(e,t){return e.getCompDetailsFromGridOptions(Gq,"agGroupRowRenderer",t,!0)}function Xq(e,t){return e.getCompDetailsFromGridOptions($q,"agDetailCellRenderer",t,!0)}function $I(e,t,n){return e.getCompDetails(t,Aq,void 0,n)}function WI(e,t,n){return e.getCompDetails(t,kq,"agSkeletonCellRenderer",n,!0)}function zI(e,t,n){return e.getCompDetails(t,Oq,"agCellEditor",n,!0)}function Jq(e,t,n,i){const o=t.filter;return HI(o)&&(t={filter:o.component,filterParams:t.filterParams}),e.getCompDetails(t,qw,i,n,!0)}function Qq(e,t,n){return e.getCompDetails(t,_q,"agDateInput",n,!0)}function eY(e,t){return e.getCompDetailsFromGridOptions(Mq,"agLoadingOverlay",t,!0)}function tY(e,t){return e.getCompDetailsFromGridOptions(Lq,"agNoRowsOverlay",t,!0)}function nY(e,t){return e.getCompDetails(t.colDef,Nq,"agTooltipComponent",t,!0)}function iY(e,t,n,i){return e.getCompDetails(t,Vq,i,n)}function UI(e,t){return GI(e,t,qw)}function Yw(e,t,n){return e.mergeParams(t,qw,n)}function Qd(e){const t=e;return(t==null?void 0:t.getFrameworkComponentInstance)!=null?t.getFrameworkComponentInstance():e}function oY(e){return typeof e=="object"&&!!e.getComp}var de={BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",SPACE:" ",LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown",DELETE:"Delete",F2:"F2",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",PAGE_HOME:"Home",PAGE_END:"End",A:"KeyA",C:"KeyC",D:"KeyD",V:"KeyV",X:"KeyX",Y:"KeyY",Z:"KeyZ"},Zw=class extends Jd{isPopup(){return!0}setParentComponent(e){e.addCss("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;(e==null?void 0:e.isAlive())&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},Xw,Jw,Qw,eb,tb,nb,ib;function Xr(){return Xw===void 0&&(Xw=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),Xw}function jI(){return Jw===void 0&&(Jw=/(firefox)/i.test(navigator.userAgent)),Jw}function KI(){return Qw===void 0&&(Qw=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),Qw}function al(){return eb===void 0&&(eb=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),eb}function ob(e){if(!e)return null;const t=e.tabIndex,n=e.getAttribute("tabIndex");return t===-1&&(n===null||n===""&&!jI())?null:t.toString()}function sY(){if(ib!==void 0)return ib;if(!document.body)return-1;let e=1e6;const t=jI()?6e6:1e9,n=document.createElement("div");for(document.body.appendChild(n);;){const i=e*2;if(n.style.height=i+"px",i>t||n.clientHeight!==i)break;e=i}return n.remove(),ib=e,e}function rY(){return nb==null&&qI(),nb}function qI(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let n=t.offsetWidth-t.clientWidth;n===0&&t.clientWidth===0&&(n=null),t.parentNode&&t.remove(),n!=null&&(nb=n,tb=n===0)}function YI(){return tb==null&&qI(),tb}var sb="T",aY=new RegExp(`[${sb} ]`),lY=new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${sb}\\d{2}:\\d{2}:\\d{2}\\D?)?`);function Ds(e,t){return e.toString().padStart(t,"0")}function to(e,t=!0,n=sb){if(!e)return null;let i=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(o=>Ds(o,2)).join("-");return t&&(i+=n+[e.getHours(),e.getMinutes(),e.getSeconds()].map(o=>Ds(o,2)).join(":")),i}function Sg(e,t=!0){return e?t?[String(e.getFullYear()),String(e.getMonth()+1),Ds(e.getDate(),2),Ds(e.getHours(),2),`:${Ds(e.getMinutes(),2)}`,`:${Ds(e.getSeconds(),2)}`]:[e.getFullYear(),e.getMonth()+1,Ds(e.getDate(),2)].map(String):null}var rb=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"},ZI=["January","February","March","April","May","June","July","August","September","October","November","December"],ab=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function lb(e,t){if(t==null)return to(e,!1);const n=Ds(e.getFullYear(),4),i={YYYY:()=>n.slice(n.length-4,n.length),YY:()=>n.slice(n.length-2,n.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>ZI[e.getMonth()],MMM:()=>ZI[e.getMonth()].slice(0,3),MM:()=>Ds(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${rb(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${rb(e.getDate())}`,DD:()=>Ds(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>ab[e.getDay()],ddd:()=>ab[e.getDay()].slice(0,3),dd:()=>ab[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${rb(e.getDay())}`,d:()=>`${e.getDay()}`},o=new RegExp(Object.keys(i).join("|"),"g");return t.replace(o,s=>s in i?i[s]():s)}function Eg(e,t=!1){return!!Oi(e,t)}function cY(e){return Eg(e,!0)}function Oi(e,t=!1,n){if(!e||!n&&!lY.test(e))return null;const[i,o]=e.split(aY);if(!i)return null;const s=i.split("-").map(f=>Number.parseInt(f,10));if(s.filter(f=>!isNaN(f)).length!==3)return null;const[r,a,l]=s,c=new Date(r,a-1,l);if(c.getFullYear()!==r||c.getMonth()!==a-1||c.getDate()!==l||!o&&t)return null;if(!o||o==="00:00:00")return c;const[u,d,h]=o.split(":").map(f=>Number.parseInt(f,10));if(u>=0&&u<24)c.setHours(u);else if(t)return null;if(d>=0&&d<60)c.setMinutes(d);else if(t)return null;if(h>=0&&h<60)c.setSeconds(h);else if(t)return null;return c}function cb(e){const{inputValue:t,allSuggestions:n,hideIrrelevant:i,filterByPercentageOfBestMatch:o}=e;let s=(n??[]).map((l,c)=>({value:l,relevance:uY(t,l),idx:c}));if(s.sort((l,c)=>l.relevance-c.relevance),i&&(s=s.filter(l=>l.relevance<Math.max(l.value.length,t.length))),s.length>0&&o&&o>0){const c=s[0].relevance*o;s=s.filter(u=>c-u.relevance<0)}const r=[],a=[];for(const l of s)r.push(l.value),a.push(l.idx);return{values:r,indices:a}}function uY(e,t){e.length<t.length&&([e,t]=[t,e]);let n=[],i=[];const o=e.length,s=t.length;for(let a=0;a<=s;a++)n[a]=a;let r=0;for(let a=1;a<=o;a++){i[0]=a;for(let l=1;l<=s;l++){const c=e[a-1],u=t[l-1];if(c.toLocaleLowerCase()===u.toLocaleLowerCase())++r,c===u&&++r,a>1&&l>1&&e[a-2].toLocaleLowerCase()===t[l-2].toLocaleLowerCase()&&(++r,e[a-2]===t[l-2]&&++r),a<o/2-10&&++r,i[l]=n[l-1];else{const d=i[l-1],h=n[l],f=n[l-1];i[l]=1+Math.min(d,h,f)}}[n,i]=[i,n]}return n[s]/(r+1)}function XI(e){var n;return e.altKey||e.ctrlKey||e.metaKey?!1:((n=e.key)==null?void 0:n.length)===1}var ub=!1,Rg=0;function dY(e){Rg>0||(e.addEventListener("keydown",Dg),e.addEventListener("mousedown",Dg))}function hY(e){Rg>0||(e.removeEventListener("keydown",Dg),e.removeEventListener("mousedown",Dg))}function Dg(e){const t=ub,n=e.type==="keydown";n&&(e.ctrlKey||e.metaKey||e.altKey)||t!==n&&(ub=n)}function fY(e){const t=Xn(e);return dY(t),Rg++,()=>{Rg--,hY(t)}}function pY(){return ub}function Nc(e,t,n=!1){const i=t9;let o=H1;t&&(o+=", "+t),n&&(o+=', [tabindex="-1"]');const s=Array.prototype.slice.apply(e.querySelectorAll(i)).filter(l=>ws(l)),r=Array.prototype.slice.apply(e.querySelectorAll(o));return r.length?((l,c)=>l.filter(u=>c.indexOf(u)===-1))(s,r):s}function ll(e,t=!1,n=!1,i=!1){const o=Nc(e,i?".ag-tab-guard":null,n),s=t?on(o):o[0];return s?(s.focus({preventScroll:!0}),!0):!1}function cl(e,t,n,i){const o=Nc(t,n?':not([tabindex="-1"])':null),s=wn(e);let r;n?r=o.findIndex(l=>l.contains(s)):r=o.indexOf(s);const a=r+(i?-1:1);return a<0||a>=o.length?null:o[a]}function JI(e,t=5){let n=0;for(;e&&ob(e)===null&&++n<=t;)e=e.parentElement;return ob(e)===null?null:e}var gY=".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}.ag-label-align-right>*{flex:none}.ag-label-align-top{align-items:flex-start;flex-direction:column;>*{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}",mY=class extends Jd{constructor(e,t,n){super(t,n),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{},this.registerCSS(gY)}postConstruct(){this.addCss("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:n,labelAlignment:i,disabled:o}=this.config;o!=null&&this.setDisabled(o),e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),n!=null&&this.setLabelWidth(n),this.setLabelAlignment(i||this.labelAlignment),this.refreshLabel()}refreshLabel(){const{label:e,eLabel:t}=this;ii(t),typeof e=="string"?t.innerText=e+this.labelSeparator:e&&t.appendChild(e),e===""?(pn(t,!1),zr(t,"presentation")):(pn(t,!0),zr(t,null))}setLabelSeparator(e){return this.labelSeparator===e?this:(this.labelSeparator=e,this.label!=null&&this.refreshLabel(),this)}getLabelId(){const e=this.eLabel;return e.id=e.id||`ag-${this.getCompId()}-label`,e.id}getLabel(){return this.label}setLabel(e){return this.label===e?this:(this.label=e,this.refreshLabel(),this)}setLabelAlignment(e){const n=this.getGui().classList;return n.toggle("ag-label-align-left",e==="left"),n.toggle("ag-label-align-right",e==="right"),n.toggle("ag-label-align-top",e==="top"),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return this.label==null?this:(ag(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return Nd(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},QI=class extends mY{constructor(e,t,n,i){super(e,t,n),this.className=i}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:n}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),n!=null&&this.onValueChange(n),this.className&&this.addCss(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),n=this.getLabel();n==null||n==""||B7(e)!==null?Md(e,""):Md(e,t??"")}setAriaLabel(e){return xc(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return bs(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e?this:(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}};function vY(e){return{tag:"div",role:"presentation",children:[{tag:"div",ref:"eLabel",cls:"ag-input-field-label"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-input-wrapper",role:"presentation",children:[{tag:e,ref:"eInput",cls:"ag-input-field-input"}]}]}}var ul=class extends QI{constructor(e,t,n="text",i="input"){super(e,(e==null?void 0:e.template)??vY(i),[],t),this.inputType=n,this.displayFieldTag=i,this.eLabel=je,this.eWrapper=je,this.eInput=je}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);const{eLabel:e,eWrapper:t,eInput:n,className:i}=this;e.classList.add(`${i}-label`),t.classList.add(`${i}-input-wrapper`),n.classList.add(`${i}-input`),this.addCss("ag-input-field"),n.id=n.id||`ag-${this.getCompId()}-input`;const{inputName:o,inputWidth:s}=this.config;o!=null&&this.setInputName(o),s!=null&&this.setInputWidth(s),this.addInputListeners(),this.activateTabIndex([n])}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(e){this.displayFieldTag==="input"&&(this.inputType=e,Qi(this.eInput,"type",e))}getInputElement(){return this.eInput}setInputWidth(e){return ag(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){const t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return Qi(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return xc(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return Nd(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)Qi(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";Qi(this.eInput,"autocomplete",t)}return this}},db=class extends ul{constructor(e,t="ag-checkbox",n="checkbox"){super(e,t,n),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;typeof e=="boolean"&&this.setReadOnly(e),typeof t=="boolean"&&this.setPassive(t)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){const t=this.getInputElement();return t.name=e,this}isSelected(){return this.selected}setSelected(e,t){if(this.isSelected()===e)return;this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0;const n=this.eInput;n.checked=e,n.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue)}dispatchChange(e,t,n){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:n});const i=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:i.id,name:i.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),n=this.selected=e.target.checked;this.refreshSelectedClass(n),this.dispatchChange(n,t,e)}refreshSelectedClass(e){const t=this.eWrapper.classList;t.toggle("ag-checked",e===!0),t.toggle("ag-indeterminate",e==null)}},hb={selector:"AG-CHECKBOX",component:db},yY=class extends db{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedEventListeners({checkboxChanged:this.onChange.bind(this)})}onChange(e){const t=this.eInput;e.selected&&e.name&&t.name&&t.name===e.name&&e.id&&t.id!==e.id&&this.setValue(!1,!0)}},dl=class extends ul{constructor(e,t="ag-text-field",n="text"){super(e,t,n)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){const n=this.eInput;return n.value!==e&&(n.value=Ke(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`),t=n=>{XI(n)&&n.key&&!e.test(n.key)&&n.preventDefault()};this.addManagedListeners(this.eInput,{keydown:t,paste:n=>{var o;const i=(o=n.clipboardData)==null?void 0:o.getData("text");i!=null&&i.split("").some(s=>!e.test(s))&&n.preventDefault()}})}},_g={selector:"AG-INPUT-TEXT-FIELD",component:dl},CY=class extends ul{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const n=super.setValue(e,t);return this.eInput.value=e,n}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},wY={selector:"AG-INPUT-TEXT-AREA",component:CY},fb=class extends dl{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct();const e=this.eInput;this.addManagedListeners(e,{blur:()=>{const s=Number.parseFloat(e.value),r=isNaN(s)?"":this.normalizeValue(s.toString());this.value!==r&&this.setValue(r)},wheel:this.onWheel.bind(this)}),e.step="any";const{precision:t,min:n,max:i,step:o}=this.config;typeof t=="number"&&this.setPrecision(t),typeof n=="number"&&this.setMin(n),typeof i=="number"&&this.setMax(i),typeof o=="number"&&this.setStep(o)}onWheel(e){wn(this.beans)===this.eInput&&e.preventDefault()}normalizeValue(e){return e===""?"":(this.precision!=null&&(e=this.adjustPrecision(e)),e)}adjustPrecision(e,t){const n=this.precision;if(n==null)return e;if(t){const o=Number.parseFloat(e).toFixed(n);return Number.parseFloat(o).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=n)return e;if(n>0)return`${i[0]}.${i[1].slice(0,n)}`}return i[0]}setMin(e){return this.min===e?this:(this.min=e,Qi(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,Qi(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,Qi(this.eInput,"step",e),this)}setValue(e,t){return this.setValueOrInputValue(n=>super.setValue(n,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(t=>super.setValue(t,!0),t=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,n){if(Ke(n)){let i=this.isScientificNotation(n);if(i&&this.eInput.validity.valid)return e(n);if(!i){n=this.adjustPrecision(n);const o=this.normalizeValue(n);i=n!=o}if(i)return t(n)}return e(n)}getValue(){const e=this.eInput;if(!e.validity.valid)return;const t=e.value;return this.isScientificNotation(t)?this.adjustPrecision(t,!0):super.getValue()}isScientificNotation(e){return typeof e=="string"&&e.includes("e")}},bY={selector:"AG-INPUT-NUMBER-FIELD",component:fb},SY=class extends dl{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=Xr();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){wn(this.beans)===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?to(e??null,!!this.includeTime)??void 0:e;return this.min===t?this:(this.min=t,Qi(this.eInput,"min",t),this)}setMax(e){const t=e instanceof Date?to(e??null,!!this.includeTime)??void 0:e;return this.max===t?this:(this.max=t,Qi(this.eInput,"max",t),this)}setStep(e){return this.step===e?this:(this.step=e,Qi(this.eInput,"step",e),this)}setIncludeTime(e){return this.includeTime===e?this:(this.includeTime=e,super.setInputType(e?"datetime-local":"date"),e&&this.setStep(1),this)}getDate(){if(this.eInput.validity.valid)return Oi(this.getValue())??void 0}setDate(e,t){this.setValue(to(e??null,this.includeTime),t)}},eA={selector:"AG-INPUT-DATE-FIELD",component:SY},EY=".ag-list-item{align-items:center;display:flex;height:var(--ag-list-item-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&.ag-active-item{background-color:var(--ag-row-hover-color)}}",RY="ag-active-item",DY=(e,t)=>({tag:"div",cls:`ag-list-item ag-${e}-list-item`,attrs:{role:"option"},children:[{tag:"span",ref:"eText",children:t}]}),_Y=class extends Jd{constructor(e,t,n){super(DY(e,t)),this.label=t,this.value=n,this.eText=je}postConstruct(){this.createTooltip(),this.addEventListeners()}setHighlighted(e){const t=this.getGui();t.classList.toggle(RY,e),V1(t,e),this.dispatchLocalEvent({type:"itemHighlighted",highlighted:e})}getHeight(){return this.getGui().clientHeight}setIndex(e,t){const n=this.getGui();U7(n,e),z7(n,t)}createTooltip(){const e={getTooltipValue:()=>this.label,getGui:()=>this.getGui(),getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>Fw(this.eText)},t=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("highlightTooltipFeature",!1,e,this));t&&(this.tooltipFeature=t)}addEventListeners(){const e=this.getParentComponent();e&&(this.addGuiEventListener("mouseover",()=>{e.highlightItem(this)}),this.addGuiEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),e.setValue(this.value)}))}},xY=class extends Jd{constructor(e="default"){super({tag:"div",cls:`ag-list ag-${e}-list`}),this.cssIdentifier=e,this.options=[],this.listItems=[],this.highlightedItem=null,this.registerCSS(EY)}postConstruct(){const e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()})}handleKeyDown(e){const t=e.key;switch(t){case de.ENTER:if(!this.highlightedItem)this.setValue(this.getValue());else{const n=this.listItems.indexOf(this.highlightedItem);this.setValueByIndex(n)}break;case de.DOWN:case de.UP:e.preventDefault(),this.navigate(t);break;case de.PAGE_DOWN:case de.PAGE_UP:case de.PAGE_HOME:case de.PAGE_END:e.preventDefault(),this.navigateToPage(t);break}}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){const{value:t,text:n}=e,i=n??t;return this.options.push({value:t,text:i}),this.renderOption(t,i),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0);for(const e of this.listItems)e.destroy();ii(this.getGui()),this.listItems=[],this.refreshAriaRole()}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(t),this;const n=this.options.findIndex(i=>i.value===e);if(n!==-1){const i=this.options[n];this.value=i.value,this.displayValue=i.text,this.highlightItem(this.listItems[n]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(t=>t.value===this.value);e!==-1&&this.highlightItem(this.listItems[e])}highlightItem(e){const t=e.getGui();if(!ws(t))return;this.clearHighlighted(),e.setHighlighted(!0),this.highlightedItem=e;const n=this.getGui(),{scrollTop:i,clientHeight:o}=n,{offsetTop:s,offsetHeight:r}=t;(s+r>i+o||s<i)&&t.scrollIntoView({block:"nearest"})}hideItemTooltip(){var e,t;(t=(e=this.highlightedItem)==null?void 0:e.tooltipFeature)==null||t.attemptToHideTooltip()}destroy(){this.hideItemTooltip(),super.destroy()}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}clearHighlighted(){var e;(e=this.highlightedItem)==null||e.setHighlighted(!1),this.highlightedItem=null}renderOption(e,t){const n=new _Y(this.cssIdentifier,t,e);n.setParentComponent(this);const i=this.createManagedBean(n);this.listItems.push(i),this.getGui().appendChild(i.getGui())}navigate(e){const t=e===de.DOWN;let n;const{listItems:i,highlightedItem:o}=this;if(!o)n=t?i[0]:on(i);else{let r=i.indexOf(o)+(t?1:-1);r=Math.min(Math.max(r,0),i.length-1),n=i[r]}this.highlightItem(n)}navigateToPage(e){const{listItems:t,highlightedItem:n}=this;if(!n||t.length===0)return;const i=t.indexOf(n),o=this.options.length-1,s=t[0].getHeight(),r=Math.floor(this.getGui().clientHeight/s);let a=-1;e===de.PAGE_HOME?a=0:e===de.PAGE_END?a=o:e===de.PAGE_DOWN?a=Math.min(i+r,o):e===de.PAGE_UP&&(a=Math.max(i-r,0)),a!==-1&&this.highlightItem(t[a])}refreshAriaRole(){zr(this.getGui(),this.options.length===0?"presentation":"listbox")}updateIndices(){this.refreshAriaRole();const e=this.listItems,t=e.length;e.forEach((n,i)=>{n.setIndex(i+1,t)})}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},FY=".ag-picker-field-display{flex:1 1 auto}.ag-picker-field{align-items:center;display:flex}.ag-picker-field-icon{border:0;cursor:pointer;display:flex;margin:0;padding:0}.ag-picker-field-wrapper{background-color:var(--ag-picker-button-background-color);border:var(--ag-picker-button-border);border-radius:5px;min-height:max(var(--ag-list-item-height),calc(var(--ag-spacing)*4));overflow:hidden;&:where(.ag-picker-has-focus),&:where(:focus-within){background-color:var(--ag-picker-button-focus-background-color);border:var(--ag-picker-button-focus-border);box-shadow:var(--ag-focus-shadow);&:where(.invalid){box-shadow:var(--ag-focus-error-shadow)}}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:disabled{opacity:.5}}",TY={tag:"div",cls:"ag-picker-field",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-picker-field-wrapper ag-picker-collapsed",children:[{tag:"div",ref:"eDisplayField",cls:"ag-picker-field-display"},{tag:"div",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},PY=class extends QI{constructor(e){if(super(e,(e==null?void 0:e.template)||TY,(e==null?void 0:e.agComponents)||[],e==null?void 0:e.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=je,this.eWrapper=je,this.eDisplayField=je,this.eIcon=je,this.registerCSS(FY),this.ariaRole=e==null?void 0:e.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:n,variableWidth:i,minPickerWidth:o,maxPickerWidth:s}=e;t!=null&&(this.pickerGap=t),this.variableWidth=!!i,n!=null&&this.setPickerMaxHeight(n),o!=null&&this.setPickerMinWidth(o),s!=null&&this.setPickerMaxWidth(s)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:n,inputWidth:i}=this.config;if(n){const o=this.beans.iconSvc.createIconNoSpan(n);o&&this.eIcon.appendChild(o)}i!=null&&this.setInputWidth(i)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),Dw(e,!1),this.ariaRole&&zr(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&(e==null?void 0:e.target)===t)return;e.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case de.UP:case de.DOWN:case de.ENTER:case de.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case de.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker());break}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const t=this.getLocaleTextFunc(),{config:{pickerAriaLabelKey:n,pickerAriaLabelValue:i,modalPicker:o=!0},maxPickerHeight:s,minPickerWidth:r,maxPickerWidth:a,variableWidth:l,beans:c,eWrapper:u}=this,d={modal:o,eChild:e,closeOnEsc:!0,closedCallback:()=>{const m=I1(c);this.beforeHidePicker(),m&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:t(n,i),anchorToElement:u};e.style.position="absolute";const h=c.popupSvc,f=h.addPopup(d);l?(r&&(e.style.minWidth=r),e.style.width=Tw(ig(u)),a&&(e.style.maxWidth=a)):ag(e,a??ig(u));const g=s??`${_w(h.getPopupParent())}px`;return e.style.setProperty("max-height",g),this.alignPickerToComponent(),f.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerGap:e,config:{pickerType:t},beans:{popupSvc:n,gos:i},eWrapper:o,pickerComponent:s}=this,r=i.get("enableRtl")?"right":"left";n.positionPopupByComponent({type:t,eventSource:o,ePopup:s.getGui(),position:"under",alignSide:r,keepWithinBounds:!0,nudgeY:e})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;const t=this.getAriaElement();Dw(t,e);const n=this.eWrapper.classList;n.toggle("ag-picker-expanded",e),n.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){var t;(t=this.pickerComponent)!=null&&t.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&(this.hideCurrentPicker(),this.dispatchLocalEvent({type:"pickerHidden"}))}setInputWidth(e){return ag(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return typeof e=="number"&&(e=`${e}px`),this.minPickerWidth=e??void 0,this}setPickerMaxWidth(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerWidth=e??void 0,this}setPickerMaxHeight(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerHeight=e??void 0,this}destroy(){this.hidePicker(),super.destroy()}},IY=".ag-select{align-items:center;display:flex;&.ag-disabled{opacity:.5}}:where(.ag-select){.ag-picker-field-wrapper{cursor:default}&.ag-disabled .ag-picker-field-wrapper:focus{box-shadow:none}&:not(.ag-cell-editor,.ag-label-align-top){min-height:var(--ag-list-item-height)}.ag-picker-field-display{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-picker-field-icon{align-items:center;display:flex}}:where(.ag-ltr) :where(.ag-select){.ag-picker-field-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding)/2);padding-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-select){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:calc(var(--ag-cell-horizontal-padding)/2)}}.ag-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);overflow:hidden auto}.ag-select-list-item{cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;:where(span){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}:where(.ag-ltr) .ag-select-list-item{padding-left:calc(var(--ag-cell-horizontal-padding)/2)}:where(.ag-rtl) .ag-select-list-item{padding-right:calc(var(--ag-cell-horizontal-padding)/2)}",pb=class extends PY{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"selectOpen",ariaRole:"combobox",...e}),this.registerCSS(IY)}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{shouldDisplayTooltip:rg(()=>this.eDisplayField),getGui:()=>this.getGui()})),super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:n}=this.config;e!=null&&this.addOptions(e),t!=null&&this.setValue(t,!0),n&&t==null&&(this.eDisplayField.textContent=n),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){const e=this.createBean(new xY("select"));this.listComponent=e,e.setParentComponent(this);const t=e.getAriaElement(),n=`ag-select-list-${e.getCompId()}`;t.setAttribute("id",n),e9(this.getAriaElement(),t),e.addManagedElementListeners(e.getGui(),{mousedown:i=>{i==null||i.preventDefault()}}),e.addManagedListeners(e,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})},fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}beforeHidePicker(){var e;(e=this.listComponent)==null||e.hideItemTooltip(),super.beforeHidePicker()}onKeyDown(e){var n;const{key:t}=e;switch(t===de.TAB&&this.hidePicker(),t){case de.ENTER:case de.UP:case de.DOWN:case de.PAGE_UP:case de.PAGE_DOWN:case de.PAGE_HOME:case de.PAGE_END:e.preventDefault(),this.isPickerDisplayed?(n=this.listComponent)==null||n.handleKeyDown(e):super.onKeyDown(e);break;case de.ESCAPE:super.onKeyDown(e);break;case de.SPACE:this.isPickerDisplayed?e.preventDefault():super.onKeyDown(e);break}}showPicker(){const e=this.listComponent;e&&(super.showPicker(),e.refreshHighlighted())}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){var e;return(e=this.listComponent)==null||e.clearOptions(),this.setValue(void 0,!0),this}setValue(e,t,n){const{listComponent:i,config:{placeholder:o},eDisplayField:s,tooltipFeature:r}=this;if(this.value===e||!i)return this;if(n||i.setValue(e,!0),i.getValue()===this.getValue())return this;let l=i.getDisplayValue();return l==null&&o&&(l=o),s.textContent=l,r==null||r.setTooltipAndRefresh(l??null),super.setValue(e,t)}destroy(){this.listComponent=this.destroyBean(this.listComponent),super.destroy()}},AY={selector:"AG-SELECT",component:pb},kY=':where(.ag-root-wrapper,.ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart),:where(.ag-root-wrapper,.ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart) :where([class^=ag-]){box-sizing:border-box;&:after,&:before{box-sizing:border-box}&:where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}&:where(button){color:inherit}}:where(.ag-root-wrapper,ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart) :where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-popup-child{top:0;z-index:5;&:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-chart,.ag-dnd-ghost,.ag-external,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);--ag-indentation-level:0}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled,[disabled]{.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}',gb=typeof window!="object"||!((HM=(BM=window==null?void 0:window.document)==null?void 0:BM.fonts)!=null&&HM.forEach),Vc=(e,t,n,i,o,s)=>{if(gb)return;i&&(e=`@layer ${CSS.escape(i)} { ${e} }`);let r=Bc.map.get(t);if(r||(r=[],Bc.map.set(t,r)),r.some(u=>u.css===e))return;const a=document.createElement("style");s&&a.setAttribute("nonce",s),a.dataset.agGlobalCss=n,a.textContent=e;const l={css:e,el:a,priority:o};let c;for(const u of r){if(u.priority>o)break;c=u}if(c){c.el.insertAdjacentElement("afterend",a);const u=r.indexOf(c);r.splice(u+1,0,l)}else t.insertBefore(a,t.querySelector(":not(title, meta)")),r.push(l)},tA=(e,t,n,i)=>{Vc(kY,e,"shared",t,0,n),i==null||i.forEach((o,s)=>o.forEach(r=>Vc(r,e,s,t,0,n)))},OY=e=>{Bc.grids.add(e)},MY=e=>{if(Bc.grids.delete(e),Bc.grids.size===0){Bc.map=new WeakMap;for(const t of document.head.querySelectorAll("style[data-ag-global-css]"))t.remove()}},nA,Bc=(nA=typeof window=="object"?window:{}).agStyleInjectionState??(nA.agStyleInjectionState={map:new WeakMap,grids:new Set}),_s=e=>new iA(e),Jr="$default",LY=0,iA=class{constructor({feature:e,params:t,modeParams:n={},css:i,cssImports:o}){this.feature=e,this.css=i,this.cssImports=o,this.modeParams={[Jr]:{...n[Jr]??{},...t??{}},...n}}use(e,t,n){let i=this._inject;if(i==null){let{css:o}=this;if(o){const s=`ag-theme-${this.feature??"part"}-${++LY}`;typeof o=="function"&&(o=o()),o=`:where(.${s}) {
112
112
  ${o}
@@ -185,8 +185,8 @@ If you are trying to annotate ${i} with application data, use the '${i}.context'
185
185
  `)}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 i=new this(t);return n.forEach(o=>i.set(o)),i}static accessor(t){const i=(this[vM]=this[vM]={accessors:{}}).accessors,o=this.prototype;function s(r){const a=wh(r);i[a]||(Que(o,r),i[a]=!0)}return ge.isArray(t)?t.forEach(s):s(t),this}};Vi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ge.reduceDescriptors(Vi.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}}),ge.freezeMethods(Vi);function LS(e,t){const n=this||Ch,i=t||n,o=Vi.from(i.headers);let s=i.data;return ge.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function yM(e){return!!(e&&e.__CANCEL__)}function nu(e,t,n){It.call(this,e??"canceled",It.ERR_CANCELED,t,n),this.name="CanceledError"}ge.inherits(nu,It,{__CANCEL__:!0});function CM(e,t,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new It("Request failed with status code "+n.status,[It.ERR_BAD_REQUEST,It.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ede(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function tde(e,t){e=e||10;const n=new Array(e),i=new Array(e);let o=0,s=0,r;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=i[s];r||(r=c),n[o]=l,i[o]=c;let d=s,h=0;for(;d!==o;)h+=n[d++],d=d%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-r<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function nde(e,t){let n=0,i=1e3/t,o,s;const r=(c,u=Date.now())=>{n=u,o=null,s&&(clearTimeout(s),s=null),e(...c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=i?r(c,u):(o=c,s||(s=setTimeout(()=>{s=null,r(o)},i-d)))},()=>o&&r(o)]}const hm=(e,t,n=3)=>{let i=0;const o=tde(50,250);return nde(s=>{const r=s.loaded,a=s.lengthComputable?s.total:void 0,l=r-i,c=o(l),u=r<=a;i=r;const d={loaded:r,total:a,progress:a?r/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-r)/c:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},wM=(e,t)=>{const n=e!=null;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},bM=e=>(...t)=>ge.asap(()=>e(...t)),ide=gi.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,gi.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(gi.origin),gi.navigator&&/(msie|trident)/i.test(gi.navigator.userAgent)):()=>!0,ode=gi.hasStandardBrowserEnv?{write(e,t,n,i,o,s,r){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];ge.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),ge.isString(i)&&a.push(`path=${i}`),ge.isString(o)&&a.push(`domain=${o}`),s===!0&&a.push("secure"),ge.isString(r)&&a.push(`SameSite=${r}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function sde(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function rde(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function SM(e,t,n){let i=!sde(t);return e&&(i||n==!1)?rde(e,t):t}const EM=e=>e instanceof Vi?{...e}:e;function Cl(e,t){t=t||{};const n={};function i(c,u,d,h){return ge.isPlainObject(c)&&ge.isPlainObject(u)?ge.merge.call({caseless:h},c,u):ge.isPlainObject(u)?ge.merge({},u):ge.isArray(u)?u.slice():u}function o(c,u,d,h){if(ge.isUndefined(u)){if(!ge.isUndefined(c))return i(void 0,c,d,h)}else return i(c,u,d,h)}function s(c,u){if(!ge.isUndefined(u))return i(void 0,u)}function r(c,u){if(ge.isUndefined(u)){if(!ge.isUndefined(c))return i(void 0,c)}else return i(void 0,u)}function a(c,u,d){if(d in t)return i(c,u);if(d in e)return i(void 0,c)}const l={url:s,method:s,data:s,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(c,u,d)=>o(EM(c),EM(u),d,!0)};return ge.forEach(Object.keys({...e,...t}),function(u){const d=l[u]||o,h=d(e[u],t[u],u);ge.isUndefined(h)&&d!==a||(n[u]=h)}),n}const RM=e=>{const t=Cl({},e);let{data:n,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:s,headers:r,auth:a}=t;if(t.headers=r=Vi.from(r),t.url=fM(SM(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&r.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),ge.isFormData(n)){if(gi.hasStandardBrowserEnv||gi.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(ge.isFunction(n.getHeaders)){const l=n.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([u,d])=>{c.includes(u.toLowerCase())&&r.set(u,d)})}}if(gi.hasStandardBrowserEnv&&(i&&ge.isFunction(i)&&(i=i(t)),i||i!==!1&&ide(t.url))){const l=o&&s&&ode.read(s);l&&r.set(o,l)}return t},ade=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,i){const o=RM(e);let s=o.data;const r=Vi.from(o.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=o,u,d,h,f,g;function m(){f&&f(),g&&g(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function b(){if(!y)return;const F=Vi.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),R={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:F,config:e,request:y};CM(function(_){n(_),m()},function(_){i(_),m()},R),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(i(new It("Request aborted",It.ECONNABORTED,e,y)),y=null)},y.onerror=function(C){const R=C&&C.message?C.message:"Network Error",E=new It(R,It.ERR_NETWORK,e,y);E.event=C||null,i(E),y=null},y.ontimeout=function(){let C=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const R=o.transitional||gM;o.timeoutErrorMessage&&(C=o.timeoutErrorMessage),i(new It(C,R.clarifyTimeoutError?It.ETIMEDOUT:It.ECONNABORTED,e,y)),y=null},s===void 0&&r.setContentType(null),"setRequestHeader"in y&&ge.forEach(r.toJSON(),function(C,R){y.setRequestHeader(R,C)}),ge.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),a&&a!=="json"&&(y.responseType=o.responseType),c&&([h,g]=hm(c,!0),y.addEventListener("progress",h)),l&&y.upload&&([d,f]=hm(l),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",f)),(o.cancelToken||o.signal)&&(u=F=>{y&&(i(!F||F.type?new nu(null,e,y):F),y.abort(),y=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const S=ede(o.url);if(S&&gi.protocols.indexOf(S)===-1){i(new It("Unsupported protocol "+S+":",It.ERR_BAD_REQUEST,e));return}y.send(s||null)})},lde=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let i=new AbortController,o;const s=function(c){if(!o){o=!0,a();const u=c instanceof Error?c:this.reason;i.abort(u instanceof It?u:new nu(u instanceof Error?u.message:u))}};let r=t&&setTimeout(()=>{r=null,s(new It(`timeout ${t} of ms exceeded`,It.ETIMEDOUT))},t);const a=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:l}=i;return l.unsubscribe=()=>ge.asap(a),l}},cde=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let i=0,o;for(;i<n;)o=i+t,yield e.slice(i,o),i=o},ude=async function*(e,t){for await(const n of dde(e))yield*cde(n,t)},dde=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:i}=await t.read();if(n)break;yield i}}finally{await t.cancel()}},DM=(e,t,n,i)=>{const o=ude(e,t);let s=0,r,a=l=>{r||(r=!0,i&&i(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=s+=d;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),o.return()}},{highWaterMark:2})},_M=64*1024,{isFunction:fm}=ge,hde=(({Request:e,Response:t})=>({Request:e,Response:t}))(ge.global),{ReadableStream:xM,TextEncoder:FM}=ge.global,TM=(e,...t)=>{try{return!!e(...t)}catch{return!1}},fde=e=>{e=ge.merge.call({skipUndefined:!0},hde,e);const{fetch:t,Request:n,Response:i}=e,o=t?fm(t):typeof fetch=="function",s=fm(n),r=fm(i);if(!o)return!1;const a=o&&fm(xM),l=o&&(typeof FM=="function"?(g=>m=>g.encode(m))(new FM):async g=>new Uint8Array(await new n(g).arrayBuffer())),c=s&&a&&TM(()=>{let g=!1;const m=new n(gi.origin,{body:new xM,method:"POST",get duplex(){return g=!0,"half"}}).headers.has("Content-Type");return g&&!m}),u=r&&a&&TM(()=>ge.isReadableStream(new i("").body)),d={stream:u&&(g=>g.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(g=>{!d[g]&&(d[g]=(m,y)=>{let b=m&&m[g];if(b)return b.call(m);throw new It(`Response type '${g}' is not supported`,It.ERR_NOT_SUPPORT,y)})});const h=async g=>{if(g==null)return 0;if(ge.isBlob(g))return g.size;if(ge.isSpecCompliantForm(g))return(await new n(gi.origin,{method:"POST",body:g}).arrayBuffer()).byteLength;if(ge.isArrayBufferView(g)||ge.isArrayBuffer(g))return g.byteLength;if(ge.isURLSearchParams(g)&&(g=g+""),ge.isString(g))return(await l(g)).byteLength},f=async(g,m)=>{const y=ge.toFiniteNumber(g.getContentLength());return y??h(m)};return async g=>{let{url:m,method:y,data:b,signal:S,cancelToken:F,timeout:C,onDownloadProgress:R,onUploadProgress:E,responseType:_,headers:I,withCredentials:O="same-origin",fetchOptions:k}=RM(g),x=t||fetch;_=_?(_+"").toLowerCase():"text";let P=lde([S,F&&F.toAbortSignal()],C),N=null;const G=P&&P.unsubscribe&&(()=>{P.unsubscribe()});let se;try{if(E&&c&&y!=="get"&&y!=="head"&&(se=await f(I,b))!==0){let ue=new n(m,{method:"POST",body:b,duplex:"half"}),De;if(ge.isFormData(b)&&(De=ue.headers.get("content-type"))&&I.setContentType(De),ue.body){const[ae,Fe]=wM(se,hm(bM(E)));b=DM(ue.body,_M,ae,Fe)}}ge.isString(O)||(O=O?"include":"omit");const B=s&&"credentials"in n.prototype,H={...k,signal:P,method:y.toUpperCase(),headers:I.normalize().toJSON(),body:b,duplex:"half",credentials:B?O:void 0};N=s&&new n(m,H);let J=await(s?x(N,k):x(m,H));const $=u&&(_==="stream"||_==="response");if(u&&(R||$&&G)){const ue={};["status","statusText","headers"].forEach(Me=>{ue[Me]=J[Me]});const De=ge.toFiniteNumber(J.headers.get("content-length")),[ae,Fe]=R&&wM(De,hm(bM(R),!0))||[];J=new i(DM(J.body,_M,ae,()=>{Fe&&Fe(),G&&G()}),ue)}_=_||"text";let ce=await d[ge.findKey(d,_)||"text"](J,g);return!$&&G&&G(),await new Promise((ue,De)=>{CM(ue,De,{data:ce,headers:Vi.from(J.headers),status:J.status,statusText:J.statusText,config:g,request:N})})}catch(B){throw G&&G(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new It("Network Error",It.ERR_NETWORK,g,N),{cause:B.cause||B}):It.from(B,B&&B.code,g,N)}}},pde=new Map,PM=e=>{let t=e&&e.env||{};const{fetch:n,Request:i,Response:o}=t,s=[i,o,n];let r=s.length,a=r,l,c,u=pde;for(;a--;)l=s[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:fde(t)),u=c;return c};PM();const NS={http:Lue,xhr:ade,fetch:{get:PM}};ge.forEach(NS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const IM=e=>`- ${e}`,gde=e=>ge.isFunction(e)||e===null||e===!1;function mde(e,t){e=ge.isArray(e)?e:[e];const{length:n}=e;let i,o;const s={};for(let r=0;r<n;r++){i=e[r];let a;if(o=i,!gde(i)&&(o=NS[(a=String(i)).toLowerCase()],o===void 0))throw new It(`Unknown adapter '${a}'`);if(o&&(ge.isFunction(o)||(o=o.get(t))))break;s[a||"#"+r]=o}if(!o){const r=Object.entries(s).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=n?r.length>1?`since :
186
186
  `+r.map(IM).join(`
187
187
  `):" "+IM(r[0]):"as no adapter specified";throw new It("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const AM={getAdapter:mde,adapters:NS};function VS(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nu(null,e)}function kM(e){return VS(e),e.headers=Vi.from(e.headers),e.data=LS.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),AM.getAdapter(e.adapter||Ch.adapter,e)(e).then(function(i){return VS(e),i.data=LS.call(e,e.transformResponse,i),i.headers=Vi.from(i.headers),i},function(i){return yM(i)||(VS(e),i&&i.response&&(i.response.data=LS.call(e,e.transformResponse,i.response),i.response.headers=Vi.from(i.response.headers))),Promise.reject(i)})}const OM="1.13.2",pm={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{pm[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});const MM={};pm.transitional=function(t,n,i){function o(s,r){return"[Axios v"+OM+"] Transitional option '"+s+"'"+r+(i?". "+i:"")}return(s,r,a)=>{if(t===!1)throw new It(o(r," has been removed"+(n?" in "+n:"")),It.ERR_DEPRECATED);return n&&!MM[r]&&(MM[r]=!0,console.warn(o(r," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,r,a):!0}},pm.spelling=function(t){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};function vde(e,t,n){if(typeof e!="object")throw new It("options must be an object",It.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let o=i.length;for(;o-- >0;){const s=i[o],r=t[s];if(r){const a=e[s],l=a===void 0||r(a,s,e);if(l!==!0)throw new It("option "+s+" must be "+l,It.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new It("Unknown option "+s,It.ERR_BAD_OPTION)}}const gm={assertOptions:vde,validators:pm},As=gm.validators;let wl=class{constructor(t){this.defaults=t||{},this.interceptors={request:new pM,response:new pM}}async request(t,n){try{return await this._request(t,n)}catch(i){if(i instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{i.stack?s&&!String(i.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(i.stack+=`
188
- `+s):i.stack=s}catch{}}throw i}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Cl(this.defaults,n);const{transitional:i,paramsSerializer:o,headers:s}=n;i!==void 0&&gm.assertOptions(i,{silentJSONParsing:As.transitional(As.boolean),forcedJSONParsing:As.transitional(As.boolean),clarifyTimeoutError:As.transitional(As.boolean)},!1),o!=null&&(ge.isFunction(o)?n.paramsSerializer={serialize:o}:gm.assertOptions(o,{encode:As.function,serialize:As.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),gm.assertOptions(n,{baseUrl:As.spelling("baseURL"),withXsrfToken:As.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=s&&ge.merge(s.common,s[n.method]);s&&ge.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=Vi.concat(r,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!l){const g=[kM.bind(this),void 0];for(g.unshift(...a),g.push(...c),h=g.length,u=Promise.resolve(n);d<h;)u=u.then(g[d++],g[d++]);return u}h=a.length;let f=n;for(;d<h;){const g=a[d++],m=a[d++];try{f=g(f)}catch(y){m.call(this,y);break}}try{u=kM.call(this,f)}catch(g){return Promise.reject(g)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=Cl(this.defaults,t);const n=SM(t.baseURL,t.url,t.allowAbsoluteUrls);return fM(n,t.params,t.paramsSerializer)}};ge.forEach(["delete","get","head","options"],function(t){wl.prototype[t]=function(n,i){return this.request(Cl(i||{},{method:t,url:n,data:(i||{}).data}))}}),ge.forEach(["post","put","patch"],function(t){function n(i){return function(s,r,a){return this.request(Cl(a||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:s,data:r}))}}wl.prototype[t]=n(),wl.prototype[t+"Form"]=n(!0)});let yde=class vL{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const i=this;this.promise.then(o=>{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](o);i._listeners=null}),this.promise.then=o=>{let s;const r=new Promise(a=>{i.subscribe(a),s=a}).then(o);return r.cancel=function(){i.unsubscribe(s)},r},t(function(s,r,a){i.reason||(i.reason=new nu(s,r,a),n(i.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=i=>{t.abort(i)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new vL(function(o){t=o}),cancel:t}}};function Cde(e){return function(n){return e.apply(null,n)}}function wde(e){return ge.isObject(e)&&e.isAxiosError===!0}const BS={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(BS).forEach(([e,t])=>{BS[t]=e});function LM(e){const t=new wl(e),n=JO(wl.prototype.request,t);return ge.extend(n,wl.prototype,t,{allOwnKeys:!0}),ge.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return LM(Cl(e,o))},n}const Ln=LM(Ch);Ln.Axios=wl,Ln.CanceledError=nu,Ln.CancelToken=yde,Ln.isCancel=yM,Ln.VERSION=OM,Ln.toFormData=um,Ln.AxiosError=It,Ln.Cancel=Ln.CanceledError,Ln.all=function(t){return Promise.all(t)},Ln.spread=Cde,Ln.isAxiosError=wde,Ln.mergeConfig=Cl,Ln.AxiosHeaders=Vi,Ln.formToJSON=e=>mM(ge.isHTMLForm(e)?new FormData(e):e),Ln.getAdapter=AM.getAdapter,Ln.HttpStatusCode=BS,Ln.default=Ln;const{Axios:Xme,AxiosError:Jme,CanceledError:Qme,isCancel:eve,CancelToken:tve,VERSION:nve,all:ive,Cancel:ove,isAxiosError:bde,spread:sve,toFormData:rve,AxiosHeaders:ave,HttpStatusCode:lve,formToJSON:cve,getAdapter:uve,mergeConfig:dve}=Ln,Sde=e=>{const n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2){const i=n.pop();return(i==null?void 0:i.split(";").shift())??null}return null},Ede=6e4,Rde=(()=>{const e=Ln.create({timeout:Ede,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(t=>{const n=Sde("account.token");return n&&t.headers&&(t.headers.Authorization=`Bearer ${n}`),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=>t,async t=>{var i;const n=t.config;return((i=t.response)==null?void 0:i.status)===401&&!n._retry&&(n._retry=!0),Promise.reject(t)}),e})();class bh extends Error{constructor(t,n,i,o,s){super(t),this.name="ApiError",this.statusCode=n,this.code=i,this.details=o,this.type=s,Object.setPrototypeOf(this,bh.prototype)}}const Sh=e=>{var t,n;if(bde(e)){const i=(t=e.response)==null?void 0:t.status,o=(n=e.response)==null?void 0:n.data,s=(o==null?void 0:o.message)||e.message||"An unexpected error occurred",r=(o==null?void 0:o.code)||e.code,a=(o==null?void 0:o.details)||o;let l="UNKNOWN";return!i||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":i>=500?l="SERVER":i===Cc.UNAUTHORIZED||i===Cc.FORBIDDEN?l="AUTH":i===Cc.UNPROCESSABLE_ENTITY||i===Cc.BAD_REQUEST?l="VALIDATION":i>=Cc.BAD_REQUEST&&(l="CLIENT"),new bh(s,i,r,a,l)}return e instanceof Error?new bh(e.message,void 0,void 0,void 0,"UNKNOWN"):new bh("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class Dde{constructor(){this.axios=Rde}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,s])=>{s!=null&&s!==""&&(Array.isArray(s)?s.forEach(r=>n.append(o,String(r))):typeof s=="object"?n.append(o,JSON.stringify(s)):n.append(o,String(s)))});const i=n.toString();return i?`?${i}`:""}async get(t="",n,i){try{const o=this.buildUrl(t),s=n?this.buildQueryParams(n):"";return(await this.axios.get(`${o}${s}`,i)).data}catch(o){throw Sh(o)}}async post(t="",n,i,o){try{const s=this.buildUrl(t),r=n?this.buildQueryParams(n):"";return(await this.axios.post(`${s}${r}`,i,o)).data}catch(s){throw Sh(s)}}async put(t="",n,i){try{const o=this.buildUrl(t);return(await this.axios.put(o,n,i)).data}catch(o){throw Sh(o)}}async patch(t="",n,i){try{const o=this.buildUrl(t);return(await this.axios.patch(o,n,i)).data}catch(o){throw Sh(o)}}async delete(t="",n,i){try{const o=this.buildUrl(t);return(await this.axios.delete(o,{data:n,...i})).data}catch(o){throw Sh(o)}}}const _de=({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"},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}/workspace/${t}/entities/${n}/items/export-format?format=xlsx`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/workspace/${t}/entities/${n}/items/import`,method:"post",code:"importItems"},exportItems:{url:`${e}/workspace/${t}/entities/${n}/items/export?format=xlsx`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/workspace/${t}/entities/${n}/items/update-from-file`,method:"post",code:"updateFromFile"},getStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"getStatuses"},metricList:{url:`${e}/workspace/${t}/entities/${n}/metric`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/workspace/${t}/items/{itemId}`,method:"put",code:"item"},createNewScene:{url:`${e}/workspace/${t}/items`,method:"post",code:"createNewScene"}}),xde=(e,t)=>{const n=new Blob([e]),i=window.URL.createObjectURL(n),o=document.createElement("a");o.href=i,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(i)};class NM extends Dde{constructor(t,{domainApi:n,wsCode:i,entityId:o}){super(),this.events={};const s=_de({domainApi:n,wsCode:i,entityId:o}),r={};Object.keys(s).forEach(a=>{const l=a;t[l]?r[l]=t[l]:(console.warn(`API config for ${l} is missing, using base config.`),r[l]=s[l])}),this.apiConfig=r}on(t,n){this.events[t]||(this.events[t]=[]),this.events[t].push(n)}off(t,n){this.events[t]&&(this.events[t]=this.events[t].filter(i=>i!==n))}emit(t,...n){const i=this.events[t];i&&i.forEach(o=>{try{o(...n)}catch(s){console.error(`Error in event listener for ${t}:`,s)}})}async _requestHandler({method:t,path:n,params:i,payload:o,code:s,responseType:r}){const a=typeof FormData<"u"&&o instanceof FormData,l={};a&&(l["Content-Type"]="multipart/form-data");let c;try{if(c=await this.axios.request({method:t,url:n,params:i,data:o,headers:l,responseType:r}),(c.headers["content-type"]||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const d=c.headers["content-disposition"]?c.headers["content-disposition"].split("filename=")[1]:"exported_items.xlsx";xde(c.data,d)}if(c.status>=400&&c.status<=500)throw new Error(`Client error (${c.status}): ${c.statusText}`);return this.emit("call-api",{apiCode:s,path:n,params:i,payload:o,res:c,success:!0}),c.data}catch(u){throw console.error("API Request Error:",u),this.emit("call-api",{path:n,params:i,payload:o,error:u,success:!1,apiCode:s,res:u==null?void 0:u.response}),u}}generateUrl(t,n){let i=t;return Object.entries(n).forEach(([o,s])=>{i=i.replace(`{${o}}`,String(s))}),i}async request(t,n,i={}){const{url:o,code:s,method:r}=this.apiConfig[t],a=this.generateUrl(o,n),l={method:r,path:a,params:i.params,payload:i.payload,code:s,responseType:i.responseType};return this._requestHandler(l)}async getAllItem_cursor(t){var s,r;const n=t.workspaceId,i={entity_ids:((s=t.entityIds)==null?void 0:s.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,name_or_code_like:t.search||t.q,include_signature:1,include:"last_updated_by,property",include_permission:"{include_permission}",assignee_all_ina:((r=t.assignees)==null?void 0:r.join(","))||void 0},o=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:i,payload:{sort_by:o}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},i={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:i,payload:n})}async getMetricList({workspaceId:t,entityId:n}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",include_permission:1,per_page:20}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:i,metric_ids:o}){const s={item_ids:n,metric_ids:o};return this.request("metricValues",{workspaceId:t},{params:{per_page:i,include_permission:1},payload:s})}async multipleAssignableUser(t){const n=t.workspaceId,i=t.itemIds,o={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:i||[]};return this.request("multipleAssignableUser",{workspaceId:n},{payload:o})}async getAssignableStatus(t){const n=t.workspaceId,i={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:i})}async updateSceneName({workspaceId:t,entityId:n,itemId:i,name:o}){const s={id:i,entity_id:n,name:o,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:i},{payload:s})}async deleteScene(t,n,i){const o={item_ids:[i]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:o})}async deleteThumbnail(t,n){const i={item_ids:n};return this.request("delete_thumbnail",{workspaceId:t},{payload:i})}async deleteRendition(t,n,i=!1){const o={item_ids:n,delete_all:i?1:void 0};return this.request("delete_rendition",{workspaceId:t},{payload:o})}async archiveScene(t,n,i){const o={item_ids:i,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:o})}async changeDate({workspaceId:t,itemIds:n,startDate:i,dueDate:o}){const s={item_ids:n,start_date:i,due_date:o};return this.request("bulkDateUpdate",{workspaceId:t},{payload:s})}async updateAssignee(t,n,i){const o={item_ids:n,ws_user_role_ids:i};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:o})}async removeAssignee(t,n,i){const o={item_ids:n,ws_user_role_ids:i};return this.request("removeAssignee",{workspaceId:t},{payload:o})}async replaceAssignee(t,n,i){const o={item_ids:n,ws_user_role_ids:i};return this.request("bulkAssignUpdate",{workspaceId:t},{params:{replace:1},payload:o})}async addAssignee(t,n,i){const o={item_ids:n,ws_user_role_ids:i};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:o})}async unAssignAll(t,n,i){const o={item_ids:i,ws_user_role_ids:[]};return this.request("removeAssignee",{workspaceId:t,entityId:n},{payload:o})}async createNewScene({workspaceId:t,entityId:n,name:i}){const o={entity_id:n,name:i};return this.request("createNewScene",{workspaceId:t},{payload:o})}async updateItemStatus({workspaceId:t,itemIds:n,statusId:i}){const o={item_ids:n,template_flow_status_id:i};return this.request("bulkStatusUpdate",{workspaceId:t},{payload:o})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems(t,n){const i={item_ids:n};return this.request("bulkDelete",{workspaceId:t},{payload:i})}async bulkUnarchiveItems(t,n){const i={item_ids:n,status:1};return this.request("bulkUnarchive",{workspaceId:t},{payload:i})}async bulkArchiveItems(t,n){const i={item_ids:n,status:0};return this.request("bulkArchive",{workspaceId:t},{payload:i})}async getPermissionForItems({workspaceId:t,itemIds:n}){const i={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:i,params:{per_page:500}})}async unarchiveScene(t,n,i){const o={item_ids:i,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"})}async downloadExportedItemsFile(t,n){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob"})}async getStatuses(t,n,i){return this.request("getStatuses",{workspaceId:t,entityId:n},{params:i})}async addNewSceneViaImportFile(t,n,i){return this.request("importItems",{workspaceId:t,entityId:n},{payload:i})}async overwriteScenesViaImportFile(t,n,i){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:i})}}const Fde=e=>{const{showMessage:t}=bd(),n=Si(),i={domainApi:"https://api.dev.arbocollab.com/api",wsCode:sessionStorage.getItem("ws.code")||"w:yngazem",entityId:e.value.entityId},o=n==null?void 0:n.appContext.config.globalProperties.apiConfig,s=new NM(o,i);s.on("call-api",k=>{var x,P;k.success?t(k.apiCode,"success"):t(((P=(x=k.res)==null?void 0:x.data)==null?void 0:P.message)||k.apiCode,"error")});const r=Ao({}),a=Z([]),l=Z(!1),c=Z(null),u=Z(null),d=Z(1),h=Z(20),{setCachedUsers:f}=Z6(),g=k=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",status_eq:1,include_permission:"{include_permission}",include_permission_names:!0,q:k}),m=500,y=async(k,x,P)=>{if(!k.length)return[];const N=QW(k,x);return(await Promise.all(N.map(P))).flat()},b=async k=>{try{return(await s.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:k})).data.map(P=>[P.id,P.permission])}catch(x){return console.error("Failed to fetch item permissions chunk:",x),[]}},S=async(k,x)=>{try{return(await s.getMetricValues({workspaceId:e.value.workspaceId,item_ids:k,per_page:k.length*x.length,metric_ids:x})).data.map(N=>{const G=new Map(N.item_metrics.map(B=>[B.metric_id,B.value])),se=Object.fromEntries(x.map(B=>[B,G.get(B)??null]));return[N.id,se]})}catch(P){return console.error("Failed to fetch a chunk of metric values:",P),[]}},F=async k=>{try{const x=await s.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:k,per_page:k.length}),P=x.data.flatMap(N=>N.assignees);return f(P),x.data.map(N=>[N.id,N.assignees])}catch(x){return console.error("Failed to fetch a chunk of assigned users:",x),[]}},C=async k=>{if(!k.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const x=await y(k,m,b);return Object.fromEntries(x)}catch(x){return console.error("Failed to fetch item permissions:",x),{}}},R=async(k,x)=>{if(!k.length||!x.length)return{};try{const P=await y(k,m,N=>S(N,x));return Object.fromEntries(P)}catch(P){return console.error("Failed to fetch metric values:",P),{}}},E=async k=>{if(!k.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const x=await y(k,m,F);return Object.fromEntries(x)}catch(x){return console.error("Failed to fetch assigned users:",x),{}}};return{items:a,loading:l,error:c,pagination:u,currentPage:d,pageSize:h,cusorMap:r,fetchItems:async k=>{const{cursor:x,offset:P,size:N,searchQuery:G}=k;let se=[];l.value=!0,c.value=null;try{const B=await s.getAllItem_cursor({cursor:x||void 0,offset:P||void 0,pageSize:N||h.value,...g(G),sortBy:k.sort_by,assignees:k.assignees});return a.value=B.data,u.value=B.meta,d.value=B.meta.current_page||0,se=B.data.map(H=>H.id),B}catch(B){throw c.value=B,console.error("Failed to fetch items (cursor):",B),B}finally{const B=async()=>{try{const[H,J,$]=await Promise.all([E(se),R(se,e.value.metricIds),C(se)]);e.value.updateItemData({assignees:H,metricValues:J,permission:$},se)}catch(H){console.error("Post-fetch processing failed:",H)}};l.value=!1,setTimeout(B)}},getAssignableStatus:async k=>{try{return await s.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:k})}catch(x){throw console.error("Failed to fetch assignable status:",x),x}},getMetricList:async k=>{try{return await s.getMetricList({workspaceId:e.value.workspaceId,entityId:k})}catch(x){throw console.error("Failed to fetch metric list:",x),x}},getMetricValues:R,getAssignedUsers:E}};function Tde(e){return{updateRowData:(i,o)=>{const s=Array.from(o).map(u=>{var d,h,f;return{id:u,assignees:((d=i.assignees)==null?void 0:d[u])||[],permissions:((h=i.permission)==null?void 0:h[u])||null,metricValues:((f=i.metricValues)==null?void 0:f[u])||null}});if(!e.value)return;const r=[],a=new Map,c=e.value.getColumnDefs().map(u=>{if(u.field&&u.field.startsWith("metric_")&&(u.hide===!1||u.hide===void 0))return u.field}).filter(Boolean);s.forEach(u=>{var h;const d=(h=e.value)==null?void 0:h.getRowNode(u.id);if(d){r.push(d);const f=u.assignees?N6(u.assignees.map(IF)):null;if(d.data.assignees=f,d.data.permissions=u.permissions||null,c.forEach(g=>{d.data[g]=d.data[g]??null}),u.metricValues){const g=u.metricValues;Object.keys(g).forEach(m=>{d.data[`metric_${m}`]=g[m]||null,a.set(`metric_${m}`,!0)})}}}),e.value.refreshCells({rowNodes:r,columns:["assignees",...Array.from(a.keys()),"name","dateRange","status"],force:!0})},setMetricValues:(i,o,s)=>{const r=e.value;if(!r)return;const a=new Map(Array.from(o).map(c=>[c,new Map(s.map(u=>[u,null]))]));Object.entries(i).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,h)})});const l=Array.from(a.entries()).map(([c,u])=>{const d=r.getRowNode(c);return d&&d.data?(u.forEach((h,f)=>{const g=`metric_${f}`;d.data[g]=h}),d):null});l.length>0&&r.refreshCells({rowNodes:l,columns:Array.from(s).map(c=>`metric_${c}`),force:!0})}}}function Pde(e,t,n){return{async getRows(i){try{const o=Math.floor(i.startRow/t)+1,{rows:s,total:r}=await e({page:o,pageSize:t,filterText:n(),sort_by:i.sortModel});let a=-1;Number.isFinite(r)?a=r:s.length<t&&(a=i.startRow+s.length),i.context={pageSize:t,text:n()},i.successCallback(s,a)}catch(o){console.error("Datasource fetch error:",o),i.failCallback()}}}}function Ide(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:i,gridApi:o,columnDefs:s,fetcher:r}=e,a=Z(!0),l=()=>{n.value=!n.value,o.value&&setTimeout(()=>{var g;(g=o.value)==null||g.sizeColumnsToFit()},300)},c=g=>{if(a.value=!1,o.value=g,!g)return null;const{sizeColumnsToFit:m,addEventListener:y,setGridOption:b}=g;if(m==null||m(),!r)return console.error("Fetcher function is undefined"),null;const S=Pde(r,e.perPage,()=>i.value);return b==null||b("datasource",S),y==null||y("selectionChanged",()=>{t.value=g.getSelectedRows()}),y==null||y("columnMoved",()=>{var E;const F=(E=g.getColumnState())==null?void 0:E.map(_=>_.colId),C=s.value.reduce((_,I)=>(I.field&&_&&(_[I.field]=I),_),{}),R=F.map(_=>C[_]).filter(Boolean);s.value=R}),g||null},u=g=>{var m,y;if((m=o.value)==null||m.hideOverlay(),g!==void 0&&(i.value=g),(y=o.value)==null||y.deselectAll(),t.value=[],a.value=!0,!o.value||!r){console.error("Grid API or fetcher is not available"),a.value=!1;return}o.value.purgeInfiniteCache(),o.value.ensureIndexVisible(0,"top"),setTimeout(()=>{a.value=!1},300)},d=()=>{var g;(g=o.value)==null||g.deselectAll(),t.value=[]},h=g=>{s.value=g},f=Ho(g=>{u(g)},gp);return{isLoading:a,toggleSidebar:l,onGridReady:c,onSearch:f,handleUnSelect:d,updateTableConfig:h}}const Ade={key:1},kde=Ct(lt({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const i=Z(null),o=e,s=()=>{i.value&&i.value.show()},r=Z(""),a=Z("idle"),l=Z({file:null,format:null}),{apiServices:c}=po(!1,{}),u=Z(!1),d=async()=>{u.value=!0;const _=o.workspaceId,I=o.entityId;if(!_||!I||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(_,I))throw new Error("No response from downloadTemplate API")}catch(O){console.error("Error downloading template:",O)}u.value=!1},h=n,f=()=>{h("import-success"),S()},g=async _=>{var k,x,P;const I=new FormData,O=((k=_.name.split(".").pop())==null?void 0:k.toString())||"";if(I.append("file",_),I.append("format",O),!c.value){console.error("API services not available");return}try{const N=await c.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,I);m()}catch(N){throw console.error("Error uploading file:",N),y(((P=(x=N.response)==null?void 0:x.data)==null?void 0:P.message)||"An unknown error occurred during file upload."),N}},m=()=>{a.value="success"},y=_=>{r.value=_,a.value="error"},b=async()=>{!l.value||!l.value.file||await g(l.value.file)},S=()=>{var _;E(),(_=i.value)==null||_.hide()};t({close:S,open:s});const F=j(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),C=j(()=>l.value.file?!1:(console.error("No file selected"),!0)),R=Z(null),E=()=>{var _;(_=R.value)==null||_.clear(),r.value="",l.value={file:null,format:null},a.value="idle"};return(_,I)=>(K(),Xe(X(QP),{"popup-name":F.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:i,onHidden:E},Su({default:Se(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(K(),Xe(_1,{key:0,state:a.value,"error-message":r.value,overwrite:!0},null,8,["state","error-message"])):(K(),Ce("div",Ade,[we("div",{class:z(_.$style["step-section"])},[we("span",{class:z(_.$style["step-title"])},"Step 1: Download current data",2),we("span",{class:z(_.$style["step-description"])},[...I[1]||(I[1]=[ut(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),we("br",null,null,-1),we("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),ye(X(ft),{class:z(_.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:Se(()=>[ye(X(gt),{src:"Download"})]),default:Se(()=>[I[2]||(I[2]=ut(" Download file ",-1))]),_:1},8,["class","disabled"])],2),we("div",{class:z(_.$style["step-section"])},[we("span",{class:z(_.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),ye(X(D1),{modelValue:l.value,"onUpdate:modelValue":I[0]||(I[0]=O=>l.value=O),ref_key:"filUploaderRef",ref:R},null,8,["modelValue"])],2),ye(x1)]))]),_:2},[a.value==="idle"?{name:"footer",fn:Se(()=>[ye(X(ft),{style:{flex:"1"},variant:"secondary",onClick:S},{default:Se(()=>[...I[3]||(I[3]=[ut(" Cancel ",-1)])]),_:1}),ye(X(ft),{disabled:C.value,style:{flex:"1"},variant:"primary",onClick:b},{default:Se(()=>[...I[4]||(I[4]=[ut(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:Se(()=>[ye(X(ft),{style:{flex:"1"},variant:"primary",onClick:f},{default:Se(()=>[...I[5]||(I[5]=[ut(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:Se(()=>[ye(X(ft),{style:{flex:"1"},variant:"primary",onClick:E},{default:Se(()=>[...I[6]||(I[6]=[ut(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_13ctn_1","step-title":"_step-title_13ctn_11","step-title-2":"_step-title-2_13ctn_17","step-description":"_step-description_13ctn_23","date-format-guide":"_date-format-guide_13ctn_28","import-error":"_import-error_13ctn_39","drop-area":"_drop-area_13ctn_49","is-dragging":"_is-dragging_13ctn_49","drop-area-content":"_drop-area-content_13ctn_52",browse:"_browse_13ctn_61","download-sample-btn":"_download-sample-btn_13ctn_65"}}]]),Ode=`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
188
+ `+s):i.stack=s}catch{}}throw i}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Cl(this.defaults,n);const{transitional:i,paramsSerializer:o,headers:s}=n;i!==void 0&&gm.assertOptions(i,{silentJSONParsing:As.transitional(As.boolean),forcedJSONParsing:As.transitional(As.boolean),clarifyTimeoutError:As.transitional(As.boolean)},!1),o!=null&&(ge.isFunction(o)?n.paramsSerializer={serialize:o}:gm.assertOptions(o,{encode:As.function,serialize:As.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),gm.assertOptions(n,{baseUrl:As.spelling("baseURL"),withXsrfToken:As.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=s&&ge.merge(s.common,s[n.method]);s&&ge.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=Vi.concat(r,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!l){const g=[kM.bind(this),void 0];for(g.unshift(...a),g.push(...c),h=g.length,u=Promise.resolve(n);d<h;)u=u.then(g[d++],g[d++]);return u}h=a.length;let f=n;for(;d<h;){const g=a[d++],m=a[d++];try{f=g(f)}catch(y){m.call(this,y);break}}try{u=kM.call(this,f)}catch(g){return Promise.reject(g)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=Cl(this.defaults,t);const n=SM(t.baseURL,t.url,t.allowAbsoluteUrls);return fM(n,t.params,t.paramsSerializer)}};ge.forEach(["delete","get","head","options"],function(t){wl.prototype[t]=function(n,i){return this.request(Cl(i||{},{method:t,url:n,data:(i||{}).data}))}}),ge.forEach(["post","put","patch"],function(t){function n(i){return function(s,r,a){return this.request(Cl(a||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:s,data:r}))}}wl.prototype[t]=n(),wl.prototype[t+"Form"]=n(!0)});let yde=class vL{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const i=this;this.promise.then(o=>{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](o);i._listeners=null}),this.promise.then=o=>{let s;const r=new Promise(a=>{i.subscribe(a),s=a}).then(o);return r.cancel=function(){i.unsubscribe(s)},r},t(function(s,r,a){i.reason||(i.reason=new nu(s,r,a),n(i.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=i=>{t.abort(i)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new vL(function(o){t=o}),cancel:t}}};function Cde(e){return function(n){return e.apply(null,n)}}function wde(e){return ge.isObject(e)&&e.isAxiosError===!0}const BS={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(BS).forEach(([e,t])=>{BS[t]=e});function LM(e){const t=new wl(e),n=JO(wl.prototype.request,t);return ge.extend(n,wl.prototype,t,{allOwnKeys:!0}),ge.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return LM(Cl(e,o))},n}const Ln=LM(Ch);Ln.Axios=wl,Ln.CanceledError=nu,Ln.CancelToken=yde,Ln.isCancel=yM,Ln.VERSION=OM,Ln.toFormData=um,Ln.AxiosError=It,Ln.Cancel=Ln.CanceledError,Ln.all=function(t){return Promise.all(t)},Ln.spread=Cde,Ln.isAxiosError=wde,Ln.mergeConfig=Cl,Ln.AxiosHeaders=Vi,Ln.formToJSON=e=>mM(ge.isHTMLForm(e)?new FormData(e):e),Ln.getAdapter=AM.getAdapter,Ln.HttpStatusCode=BS,Ln.default=Ln;const{Axios:Xme,AxiosError:Jme,CanceledError:Qme,isCancel:eve,CancelToken:tve,VERSION:nve,all:ive,Cancel:ove,isAxiosError:bde,spread:sve,toFormData:rve,AxiosHeaders:ave,HttpStatusCode:lve,formToJSON:cve,getAdapter:uve,mergeConfig:dve}=Ln,Sde=e=>{const n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2){const i=n.pop();return(i==null?void 0:i.split(";").shift())??null}return null},Ede=6e4,Rde=(()=>{const e=Ln.create({timeout:Ede,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(t=>{const n=Sde("account.token");return n&&t.headers&&(t.headers.Authorization=`Bearer ${n}`),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=>t,async t=>{var i;const n=t.config;return((i=t.response)==null?void 0:i.status)===401&&!n._retry&&(n._retry=!0),Promise.reject(t)}),e})();class bh extends Error{constructor(t,n,i,o,s){super(t),this.name="ApiError",this.statusCode=n,this.code=i,this.details=o,this.type=s,Object.setPrototypeOf(this,bh.prototype)}}const Sh=e=>{var t,n;if(bde(e)){const i=(t=e.response)==null?void 0:t.status,o=(n=e.response)==null?void 0:n.data,s=(o==null?void 0:o.message)||e.message||"An unexpected error occurred",r=(o==null?void 0:o.code)||e.code,a=(o==null?void 0:o.details)||o;let l="UNKNOWN";return!i||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":i>=500?l="SERVER":i===Cc.UNAUTHORIZED||i===Cc.FORBIDDEN?l="AUTH":i===Cc.UNPROCESSABLE_ENTITY||i===Cc.BAD_REQUEST?l="VALIDATION":i>=Cc.BAD_REQUEST&&(l="CLIENT"),new bh(s,i,r,a,l)}return e instanceof Error?new bh(e.message,void 0,void 0,void 0,"UNKNOWN"):new bh("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class Dde{constructor(){this.axios=Rde}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,s])=>{s!=null&&s!==""&&(Array.isArray(s)?s.forEach(r=>n.append(o,String(r))):typeof s=="object"?n.append(o,JSON.stringify(s)):n.append(o,String(s)))});const i=n.toString();return i?`?${i}`:""}async get(t="",n,i){try{const o=this.buildUrl(t),s=n?this.buildQueryParams(n):"";return(await this.axios.get(`${o}${s}`,i)).data}catch(o){throw Sh(o)}}async post(t="",n,i,o){try{const s=this.buildUrl(t),r=n?this.buildQueryParams(n):"";return(await this.axios.post(`${s}${r}`,i,o)).data}catch(s){throw Sh(s)}}async put(t="",n,i){try{const o=this.buildUrl(t);return(await this.axios.put(o,n,i)).data}catch(o){throw Sh(o)}}async patch(t="",n,i){try{const o=this.buildUrl(t);return(await this.axios.patch(o,n,i)).data}catch(o){throw Sh(o)}}async delete(t="",n,i){try{const o=this.buildUrl(t);return(await this.axios.delete(o,{data:n,...i})).data}catch(o){throw Sh(o)}}}const _de=({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"},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}/workspace/${t}/entities/${n}/items/export-format?format=xlsx`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/workspace/${t}/entities/${n}/items/import`,method:"post",code:"importItems"},exportItems:{url:`${e}/workspace/${t}/entities/${n}/items/export?format=xlsx`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/workspace/${t}/entities/${n}/items/update-from-file`,method:"post",code:"updateFromFile"},getStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"getStatuses"},metricList:{url:`${e}/workspace/${t}/entities/${n}/metric`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/workspace/${t}/items/{itemId}`,method:"put",code:"item"},createNewScene:{url:`${e}/workspace/${t}/items`,method:"post",code:"createNewScene"}}),xde=(e,t)=>{const n=new Blob([e]),i=window.URL.createObjectURL(n),o=document.createElement("a");o.href=i,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(i)};class NM extends Dde{constructor(t,{domainApi:n,wsCode:i,entityId:o}){super(),this.events={};const s=_de({domainApi:n,wsCode:i,entityId:o}),r={};Object.keys(s).forEach(a=>{const l=a;t[l]?r[l]=t[l]:(console.warn(`API config for ${l} is missing, using base config.`),r[l]=s[l])}),this.apiConfig=r}on(t,n){this.events[t]||(this.events[t]=[]),this.events[t].push(n)}off(t,n){this.events[t]&&(this.events[t]=this.events[t].filter(i=>i!==n))}emit(t,...n){const i=this.events[t];i&&i.forEach(o=>{try{o(...n)}catch(s){console.error(`Error in event listener for ${t}:`,s)}})}async _requestHandler({method:t,path:n,params:i,payload:o,code:s,responseType:r}){const a=typeof FormData<"u"&&o instanceof FormData,l={};a&&(l["Content-Type"]="multipart/form-data");let c;try{if(c=await this.axios.request({method:t,url:n,params:i,data:o,headers:l,responseType:r}),(c.headers["content-type"]||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const d=c.headers["content-disposition"]?c.headers["content-disposition"].split("filename=")[1]:"exported_items.xlsx";xde(c.data,d)}if(c.status>=400&&c.status<=500)throw new Error(`Client error (${c.status}): ${c.statusText}`);return this.emit("call-api",{apiCode:s,path:n,params:i,payload:o,res:c,success:!0}),c.data}catch(u){throw console.error("API Request Error:",u),this.emit("call-api",{path:n,params:i,payload:o,error:u,success:!1,apiCode:s,res:u==null?void 0:u.response}),u}}generateUrl(t,n){let i=t;return Object.entries(n).forEach(([o,s])=>{i=i.replace(`{${o}}`,String(s))}),i}async request(t,n,i={}){const{url:o,code:s,method:r}=this.apiConfig[t],a=this.generateUrl(o,n),l={method:r,path:a,params:i.params,payload:i.payload,code:s,responseType:i.responseType};return this._requestHandler(l)}async getAllItem_cursor(t){var s,r;const n=t.workspaceId,i={entity_ids:((s=t.entityIds)==null?void 0:s.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,name_or_code_like:t.search||t.q,include_signature:1,include:"last_updated_by,property",include_permission:"{include_permission}",assignee_all_ina:((r=t.assignees)==null?void 0:r.join(","))||void 0},o=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:i,payload:{sort_by:o}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},i={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:i,payload:n})}async getMetricList({workspaceId:t,entityId:n}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",include_permission:1,per_page:20}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:i,metric_ids:o}){const s={item_ids:n,metric_ids:o};return this.request("metricValues",{workspaceId:t},{params:{per_page:i,include_permission:1},payload:s})}async multipleAssignableUser(t){const n=t.workspaceId,i=t.itemIds,o={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:i||[]};return this.request("multipleAssignableUser",{workspaceId:n},{payload:o})}async getAssignableStatus(t){const n=t.workspaceId,i={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:i})}async updateSceneName({workspaceId:t,entityId:n,itemId:i,name:o}){const s={id:i,entity_id:n,name:o,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:i},{payload:s})}async deleteScene(t,n,i){const o={item_ids:[i]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:o})}async deleteThumbnail(t,n){const i={item_ids:n};return this.request("delete_thumbnail",{workspaceId:t},{payload:i})}async deleteRendition(t,n,i=!1){const o={item_ids:n,delete_all:i?1:void 0};return this.request("delete_rendition",{workspaceId:t},{payload:o})}async archiveScene(t,n,i){const o={item_ids:i,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:o})}async changeDate({workspaceId:t,itemIds:n,startDate:i,dueDate:o}){const s={item_ids:n,start_date:i,due_date:o};return this.request("bulkDateUpdate",{workspaceId:t},{payload:s})}async updateAssignee(t,n,i){const o={item_ids:n,ws_user_role_ids:i};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:o})}async removeAssignee(t,n,i){const o={item_ids:n,ws_user_role_ids:i};return this.request("removeAssignee",{workspaceId:t},{payload:o})}async replaceAssignee(t,n,i){const o={item_ids:n,ws_user_role_ids:i};return this.request("bulkAssignUpdate",{workspaceId:t},{params:{replace:1},payload:o})}async addAssignee(t,n,i){const o={item_ids:n,ws_user_role_ids:i};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:o})}async unAssignAll(t,n,i){const o={item_ids:i,ws_user_role_ids:[]};return this.request("removeAssignee",{workspaceId:t,entityId:n},{payload:o})}async createNewScene({workspaceId:t,entityId:n,name:i}){const o={entity_id:n,name:i};return this.request("createNewScene",{workspaceId:t},{payload:o})}async updateItemStatus({workspaceId:t,itemIds:n,statusId:i}){const o={item_ids:n,template_flow_status_id:i};return this.request("bulkStatusUpdate",{workspaceId:t},{payload:o})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems(t,n){const i={item_ids:n};return this.request("bulkDelete",{workspaceId:t},{payload:i})}async bulkUnarchiveItems(t,n){const i={item_ids:n,status:1};return this.request("bulkUnarchive",{workspaceId:t},{payload:i})}async bulkArchiveItems(t,n){const i={item_ids:n,status:0};return this.request("bulkArchive",{workspaceId:t},{payload:i})}async getPermissionForItems({workspaceId:t,itemIds:n}){const i={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:i,params:{per_page:500}})}async unarchiveScene(t,n,i){const o={item_ids:i,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"})}async downloadExportedItemsFile(t,n){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob"})}async getStatuses(t,n,i){return this.request("getStatuses",{workspaceId:t,entityId:n},{params:i})}async addNewSceneViaImportFile(t,n,i){return this.request("importItems",{workspaceId:t,entityId:n},{payload:i})}async overwriteScenesViaImportFile(t,n,i){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:i})}}const Fde=e=>{const{showMessage:t}=bd(),n=Si(),i={domainApi:"https://api.dev.arbocollab.com/api",wsCode:sessionStorage.getItem("ws.code")||"w:yngazem",entityId:e.value.entityId},o=n==null?void 0:n.appContext.config.globalProperties.apiConfig,s=new NM(o,i);s.on("call-api",k=>{var x,P;k.success?t(k.apiCode,"success"):t(((P=(x=k.res)==null?void 0:x.data)==null?void 0:P.message)||k.apiCode,"error")});const r=Ao({}),a=Z([]),l=Z(!1),c=Z(null),u=Z(null),d=Z(1),h=Z(20),{setCachedUsers:f}=Z6(),g=k=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",status_eq:1,include_permission:"{include_permission}",include_permission_names:!0,q:k}),m=500,y=async(k,x,P)=>{if(!k.length)return[];const N=QW(k,x);return(await Promise.all(N.map(P))).flat()},b=async k=>{try{return(await s.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:k})).data.map(P=>[P.id,P.permission])}catch(x){return console.error("Failed to fetch item permissions chunk:",x),[]}},S=async(k,x)=>{try{return(await s.getMetricValues({workspaceId:e.value.workspaceId,item_ids:k,per_page:k.length*x.length,metric_ids:x})).data.map(N=>{const G=new Map(N.item_metrics.map(B=>[B.metric_id,B.value])),se=Object.fromEntries(x.map(B=>[B,G.get(B)??null]));return[N.id,se]})}catch(P){return console.error("Failed to fetch a chunk of metric values:",P),[]}},F=async k=>{try{const x=await s.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:k,per_page:k.length}),P=x.data.flatMap(N=>N.assignees);return f(P),x.data.map(N=>[N.id,N.assignees])}catch(x){return console.error("Failed to fetch a chunk of assigned users:",x),[]}},C=async k=>{if(!k.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const x=await y(k,m,b);return Object.fromEntries(x)}catch(x){return console.error("Failed to fetch item permissions:",x),{}}},R=async(k,x)=>{if(!k.length||!x.length)return{};try{const P=await y(k,m,N=>S(N,x));return Object.fromEntries(P)}catch(P){return console.error("Failed to fetch metric values:",P),{}}},E=async k=>{if(!k.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const x=await y(k,m,F);return Object.fromEntries(x)}catch(x){return console.error("Failed to fetch assigned users:",x),{}}};return{items:a,loading:l,error:c,pagination:u,currentPage:d,pageSize:h,cusorMap:r,fetchItems:async k=>{const{cursor:x,offset:P,size:N,searchQuery:G}=k;let se=[];l.value=!0,c.value=null;try{const B=await s.getAllItem_cursor({cursor:x||void 0,offset:P||void 0,pageSize:N||h.value,...g(G),sortBy:k.sort_by,assignees:k.assignees});return a.value=B.data,u.value=B.meta,d.value=B.meta.current_page||0,se=B.data.map(H=>H.id),B}catch(B){throw c.value=B,console.error("Failed to fetch items (cursor):",B),B}finally{const B=async()=>{try{const[H,J,$]=await Promise.all([E(se),R(se,e.value.metricIds),C(se)]);e.value.updateItemData({assignees:H,metricValues:J,permission:$},se)}catch(H){console.error("Post-fetch processing failed:",H)}};l.value=!1,setTimeout(B)}},getAssignableStatus:async k=>{try{return await s.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:k})}catch(x){throw console.error("Failed to fetch assignable status:",x),x}},getMetricList:async k=>{try{return await s.getMetricList({workspaceId:e.value.workspaceId,entityId:k})}catch(x){throw console.error("Failed to fetch metric list:",x),x}},getMetricValues:R,getAssignedUsers:E}};function Tde(e){return{updateRowData:(i,o)=>{const s=Array.from(o).map(u=>{var d,h,f;return{id:u,assignees:((d=i.assignees)==null?void 0:d[u])||[],permissions:((h=i.permission)==null?void 0:h[u])||null,metricValues:((f=i.metricValues)==null?void 0:f[u])||null}});if(!e.value)return;const r=[],a=new Map,c=e.value.getColumnDefs().map(u=>{if(u.field&&u.field.startsWith("metric_")&&(u.hide===!1||u.hide===void 0))return u.field}).filter(Boolean);s.forEach(u=>{var h;const d=(h=e.value)==null?void 0:h.getRowNode(u.id);if(d){r.push(d);const f=u.assignees?N6(u.assignees.map(IF)):null;if(d.data.assignees=f,d.data.permissions=u.permissions||null,c.forEach(g=>{d.data[g]=d.data[g]??null}),u.metricValues){const g=u.metricValues;Object.keys(g).forEach(m=>{d.data[`metric_${m}`]=g[m]||null,a.set(`metric_${m}`,!0)})}}}),e.value.refreshCells({rowNodes:r,columns:["assignees",...Array.from(a.keys()),"name","dateRange","status"],force:!0})},setMetricValues:(i,o,s)=>{const r=e.value;if(!r)return;const a=new Map(Array.from(o).map(c=>[c,new Map(s.map(u=>[u,null]))]));Object.entries(i).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,h)})});const l=Array.from(a.entries()).map(([c,u])=>{const d=r.getRowNode(c);return d&&d.data?(u.forEach((h,f)=>{const g=`metric_${f}`;d.data[g]=h}),d):null});l.length>0&&r.refreshCells({rowNodes:l,columns:Array.from(s).map(c=>`metric_${c}`),force:!0})}}}function Pde(e,t,n){return{async getRows(i){try{const o=Math.floor(i.startRow/t)+1,{rows:s,total:r}=await e({page:o,pageSize:t,filterText:n(),sort_by:i.sortModel});let a=-1;Number.isFinite(r)?a=r:s.length<t&&(a=i.startRow+s.length),i.context={pageSize:t,text:n()},i.successCallback(s,a)}catch(o){console.error("Datasource fetch error:",o),i.failCallback()}}}}function Ide(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:i,gridApi:o,columnDefs:s,fetcher:r}=e,a=Z(!0),l=()=>{n.value=!n.value,o.value&&setTimeout(()=>{var g;(g=o.value)==null||g.sizeColumnsToFit()},300)},c=g=>{if(a.value=!1,o.value=g,!g)return null;const{sizeColumnsToFit:m,addEventListener:y,setGridOption:b}=g;if(m==null||m(),!r)return console.error("Fetcher function is undefined"),null;const S=Pde(r,e.perPage,()=>i.value);return b==null||b("datasource",S),y==null||y("selectionChanged",()=>{t.value=g.getSelectedRows()}),y==null||y("columnMoved",()=>{var E;const F=(E=g.getColumnState())==null?void 0:E.map(_=>_.colId),C=s.value.reduce((_,I)=>(I.field&&_&&(_[I.field]=I),_),{}),R=F.map(_=>C[_]).filter(Boolean);s.value=R}),g||null},u=g=>{var m,y;if((m=o.value)==null||m.hideOverlay(),g!==void 0&&(i.value=g),(y=o.value)==null||y.deselectAll(),t.value=[],a.value=!0,!o.value||!r){console.error("Grid API or fetcher is not available"),a.value=!1;return}o.value.purgeInfiniteCache(),o.value.ensureIndexVisible(0,"top"),setTimeout(()=>{a.value=!1},300)},d=()=>{var g;(g=o.value)==null||g.deselectAll(),t.value=[]},h=g=>{s.value=g},f=Ho(g=>{u(g)},gp);return{isLoading:a,toggleSidebar:l,onGridReady:c,onSearch:f,handleUnSelect:d,updateTableConfig:h}}const Ade={key:1},kde=Ct(lt({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const i=Z(null),o=e,s=()=>{i.value&&i.value.show()},r=Z(""),a=Z("idle"),l=Z({file:null,format:null}),{apiServices:c}=po(!1,{}),u=Z(!1),d=async()=>{u.value=!0;const _=o.workspaceId,I=o.entityId;if(!_||!I||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(_,I))throw new Error("No response from downloadTemplate API")}catch(O){console.error("Error downloading template:",O)}u.value=!1},h=n,f=()=>{h("import-success"),S()},g=async _=>{var k,x,P;const I=new FormData,O=((k=_.name.split(".").pop())==null?void 0:k.toString())||"";if(I.append("file",_),I.append("format",O),!c.value){console.error("API services not available");return}try{const N=await c.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,I);m()}catch(N){throw console.error("Error uploading file:",N),y(((P=(x=N.response)==null?void 0:x.data)==null?void 0:P.message)||"An unknown error occurred during file upload."),N}},m=()=>{a.value="success"},y=_=>{r.value=_,a.value="error"},b=async()=>{!l.value||!l.value.file||await g(l.value.file)},S=()=>{var _;E(),(_=i.value)==null||_.hide()};t({close:S,open:s});const F=j(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),C=j(()=>l.value.file?!1:(console.error("No file selected"),!0)),R=Z(null),E=()=>{var _;(_=R.value)==null||_.clear(),r.value="",l.value={file:null,format:null},a.value="idle"};return(_,I)=>(K(),Xe(X(QP),{"popup-name":F.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:i,onHidden:E},Su({default:Se(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(K(),Xe(_1,{key:0,state:a.value,"error-message":r.value,overwrite:!0},null,8,["state","error-message"])):(K(),Ce("div",Ade,[we("div",{class:z(_.$style["step-section"])},[we("span",{class:z(_.$style["step-title"])},"Step 1: Download current data",2),we("span",{class:z(_.$style["step-description"])},[...I[1]||(I[1]=[ut(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),we("br",null,null,-1),we("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),ye(X(ft),{class:z(_.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:Se(()=>[ye(X(gt),{src:"Download"})]),default:Se(()=>[I[2]||(I[2]=ut(" Download file ",-1))]),_:1},8,["class","disabled"])],2),we("div",{class:z(_.$style["step-section"])},[we("span",{class:z(_.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),ye(X(D1),{modelValue:l.value,"onUpdate:modelValue":I[0]||(I[0]=O=>l.value=O),ref_key:"filUploaderRef",ref:R},null,8,["modelValue"])],2),we("div",{class:z(_.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ye(x1)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:Se(()=>[ye(X(ft),{style:{flex:"1"},variant:"secondary",onClick:S},{default:Se(()=>[...I[3]||(I[3]=[ut(" Cancel ",-1)])]),_:1}),ye(X(ft),{disabled:C.value,style:{flex:"1"},variant:"primary",onClick:b},{default:Se(()=>[...I[4]||(I[4]=[ut(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:Se(()=>[ye(X(ft),{style:{flex:"1"},variant:"primary",onClick:f},{default:Se(()=>[...I[5]||(I[5]=[ut(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:Se(()=>[ye(X(ft),{style:{flex:"1"},variant:"primary",onClick:E},{default:Se(()=>[...I[6]||(I[6]=[ut(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_13ctn_1","step-title":"_step-title_13ctn_11","step-title-2":"_step-title-2_13ctn_17","step-description":"_step-description_13ctn_23","date-format-guide":"_date-format-guide_13ctn_28","import-error":"_import-error_13ctn_39","drop-area":"_drop-area_13ctn_49","is-dragging":"_is-dragging_13ctn_49","drop-area-content":"_drop-area-content_13ctn_52",browse:"_browse_13ctn_61","download-sample-btn":"_download-sample-btn_13ctn_65"}}]]),Ode=`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
189
189
  <rect width="32" height="32" rx="4" fill="#CCF3EB"/>
190
190
  <path d="M11 9C9.89688 9 9 9.89688 9 11V21C9 22.1031 9.89688 23 11 23H21C22.1031 23 23 22.1031 23 21V11C23 9.89688 22.1031 9 21 9H11ZM19.5312 14.5312L15.5312 18.5312C15.2375 18.825 14.7625 18.825 14.4719 18.5312L12.4719 16.5312C12.1781 16.2375 12.1781 15.7625 12.4719 15.4719C12.7656 15.1813 13.2406 15.1781 13.5312 15.4719L15 16.9406L18.4688 13.4688C18.7625 13.175 19.2375 13.175 19.5281 13.4688C19.8187 13.7625 19.8219 14.2375 19.5281 14.5281L19.5312 14.5312Z" fill="#00A18D"/>
191
191
  </svg>
192
- `,Mde=Ct(lt({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=zC(),{setUserPermissions:i,setEntityPermissions:o}=n,{entityPermissions:s}=nr(n),{addNotification:r}=bd(),a=Z(null),l={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},c=j(()=>{var q;const ke=((q=s.value)==null?void 0:q.has_create_item_permission)===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"}]}),u=e;Ad.initialize({wrapVueCellRenderer:eg,wrapVueCellEditor:P1});const d=Z(null),h=Z([]),f=YC(),{rowCount:g}=nr(f),m=Z(!1),y=Z(""),b=Z(),S=Z(""),F=Z(!1),C=Z(new Set),R=Z(new Map),{apiServices:E}=po(!1,u),{columnDefs:_,checkboxColumn:I,saveColumnConfig:O}=Xce(b,u.entityId),{updateRowData:k,setMetricValues:x}=Tde(d),P=j(()=>y.value.length>0),N=j(()=>!1),G=j(dC),se=j(()=>_.value.filter(ke=>{var q;return((q=ke.field)==null?void 0:q.startsWith("metric_"))&&!ke.hide}).map(ke=>{var q;return((q=ke.field)==null?void 0:q.replace("metric_",""))||""}));Fa("timezone",G);const B=j(()=>({autoFetch:!1,workspaceId:u.workspaceId,entityId:u.entityId,metricIds:se.value,updateItemData:k})),{fetchItems:H,getMetricList:J,cusorMap:$,getMetricValues:ce}=Fde(B),ue=j(()=>{if(!d.value)return!1;const ke=d.value.getSelectedRows().length;return ke>0&&ke>=g.value.total}),De=j(()=>{var ke;return((ke=a.value)==null?void 0:ke.name)||"Items"}),ae=(ke,q)=>{var fe,$e,vt;g.value.total=ke.meta.total??0,(fe=ke.meta.next)!=null&&fe.cursor&&($[q+1]=ke.meta.next.cursor),S.value=ke.meta["X-Tsr-content-sha256"]||"",ke.meta.total===0?($e=d.value)==null||$e.showNoRowsOverlay():(vt=d.value)==null||vt.hideOverlay()},Fe=R1(),{sortingAPIConfiguration:Me,isSortingRunning:Je}=nr(Fe),pt=Z([]),Mt=async({page:ke,pageSize:q,filterText:fe})=>{var Le;(Le=d.value)==null||Le.hideOverlay();const $e=$[ke],vt=!$e&&ke>1?(ke-1)*q:void 0,Ft=Me.value;Ft.length>0&&(Je.value=!0);try{const An=await H({cursor:$e,size:q,searchQuery:fe,offset:vt,sort_by:Ft,assignees:pt.value});if(!An)return{rows:[],total:0};const ra=(xo=>{const Os=xo.data.map(Qo=>kF(Qo,G.value));return Os.forEach(Qo=>{C.value.add(String(Qo.id)),R.value.set(String(Qo.id),{})}),Os})(An);return ae(An,ke),{rows:ra,total:g.value.total}}catch(An){return console.error("Failed to fetch items:",An),{rows:[],total:0}}finally{Je.value=!1}},{isLoading:Be,toggleSidebar:jt,onGridReady:nn,handleUnSelect:Ot,onSearch:V}=Ide({selectRowData:Z([]),isSidebarOpen:m,quickFilterText:y,gridApi:d,columnDefs:_,perPage:l.ROWS_PER_PAGE,fetcher:Mt}),Y=j(()=>({blockLoadDebounceMillis:1e3,columnDefs:_.value,rowModelType:"infinite",cacheBlockSize:l.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,headerCheckbox:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},suppressHeaderFocus:!1,pagination:!1,rowHeight:l.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!0,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:l.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:pe,noRowsOverlayComponent:eg(g7),noRowsOverlayComponentParams:()=>({isSearching:P.value,isFiltering:N.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 q=["row-highlight"];return ke.data.id||q.push("row-inactive"),ke.data.isDeleted&&q.push("row-deleted"),ke.data.isArchived&&q.push("row-archived"),q},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:u.workspaceId,entityId:u.entityId,apiServices:E.value,sorting:Je.value}}));function pe(){if(!d.value)return;const ke=d.value.getCacheBlockState();if(!ke)return;const q=Object.values(ke).reduce((fe,$e)=>($e==null?void 0:$e.pageStatus)==="loaded"?fe+($e.endRow-$e.startRow):fe,0);g.value.loaded=Math.min(q,g.value.total)}ct(()=>Me,()=>{d.value&&(S.value="",C.value.clear(),d.value.deselectAll(),Object.keys($).forEach(ke=>delete $[Number(ke)]),d.value.purgeInfiniteCache(),d.value.ensureIndexVisible(0),d.value.refreshCells({force:!0}))},{deep:!0});const Te=Z(),Ee=Z(),_e=()=>{var ke;(ke=Ee.value)==null||ke.open()},Ve=()=>{var ke;(ke=Te.value)==null||ke.open()},Ae=()=>{console.log("Refreshing table"),d.value&&(S.value="",C.value.clear(),Object.keys($).forEach(ke=>delete $[Number(ke)]),d.value.refreshInfiniteCache())},Pe=j(()=>sessionStorage.getItem("ITEM_TABLE_APP_VERSION")||""),xe=Z();function it(ke){var q;ke==="new_scene"?(q=xe.value)==null||q.show():ke==="import_scenes"?Ve():ke==="overwrite_scenes"&&_e()}const We=ke=>{h.value=ke.api.getSelectedRows().map(q=>q.id)},at=ke=>{const q=nn(ke);return q&&(q.addEventListener("modelUpdated",pe),q.addEventListener("bodyScroll",()=>q.stopEditing())),q==null||q.sizeColumnsToFit(),q},dt=(ke,q)=>{if(!d.value)return;const fe=d.value.getRowNode(ke);fe?(d.value.ensureIndexVisible(Number(fe.rowIndex),"middle"),d.value.flashCells({rowNodes:[fe],flashDuration:3e3,fadeDuration:1e3})):d.value.ensureIndexVisible(g.value.total-1,"bottom")},xt=async ke=>{var fe;let q;if(!(!E.value||!ke.trim())){Be.value=!0;try{q=await E.value.createNewScene({workspaceId:u.workspaceId,entityId:u.entityId,name:ke}),g.value.total<50&&await Ae()}catch($e){console.error("Error creating new scene:",$e)}finally{Be.value=!1,q!=null&&q.id&&r({id:String(q==null?void 0:q.id),message:`${ke} created successfully`,actions:[{label:"View",variant:"secondary",action:()=>{dt(String(q==null?void 0:q.id))}},{label:"Scene Hub",variant:"primary",action:()=>{const $e=Vo({type:"scene_hub",config:{ws_code:u.workspaceId,baseDomain:sessionStorage.getItem("URL_BASE")||"app.arbocollab.com",scene_id:String(q==null?void 0:q.id)}}).url;window.open($e,"_blank")},btnIcon:"CustomSceneHub"}],icon:Ode,type:"interactive"}),(fe=xe.value)==null||fe.hide()}}},Lt=ke=>ke.metric_type.code==="number"?"number":"default",Ht=async()=>{if(u.entityId)try{const ke=await J(u.entityId);b.value=ke.data.map(q=>({...q,sortType:Lt(q)}))}catch(ke){console.error("Failed to initialize metric list:",ke),b.value=[]}},Dn=async()=>{if(E.value)try{const ke=await E.value.getUserPermission(u.workspaceId);i(ke)}catch(ke){console.error("Failed to fetch user permissions:",ke)}},cn=async()=>{if(E.value)try{const ke=await E.value.getEntityDetail(u.workspaceId,u.entityId);o(ke.permission),a.value=ke}catch(ke){console.error("Failed to fetch entity details:",ke)}};ct(()=>[u.entityId,u.workspaceId],async([ke,q])=>{!ke||!q||(Ht(),Dn(),cn())},{immediate:!0,deep:!0}),ct(se,(ke,q)=>{const fe=ke.filter($e=>!(q!=null&&q.includes($e)));fe.length>0&&ce(Array.from(C.value),fe).then($e=>{x($e,C.value,fe)})},{immediate:!0,deep:!0}),ct(S,(ke,q)=>{F.value=!!(q&&ke&&q!==ke)}),t({refreshTable:Ae});const qn=ke=>{pt.value=ke,Ae()};return(ke,q)=>(K(),Xe(X(dK),{"is-sidebar-open":m.value,onCloseSidebar:X(jt),onSidebarClear:X(jt),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:X(jt)},{"header-left":Se(()=>[we("h1",{class:z(ke.$style.tableTitle)},"Scenes",2),we("div",{class:z(ke.$style["beta-tag"])},"Beta",2),ye(X(QC),{variant:["primary"],options:c.value,onSelect:it,onHandleClick:q[1]||(q[1]=fe=>it("new_scene")),id:"create_scene_dropdown"},{prefix:Se(()=>[ye(X(ft),{id:"create_new_scene",variant:["primary"],onClick:q[0]||(q[0]=fe=>it("new_scene")),label:"New"})]),_:1},8,["options"]),we("span",null,bt(Pe.value),1)]),"header-actions":Se(()=>[ye(X(S7),{"onUpdate:assignees":qn}),ye(X(KC),{modelValue:y.value,"onUpdate:modelValue":q[2]||(q[2]=fe=>y.value=fe),onSearch:X(V),class:z(ke.$style.itemSearchBox),onClear:q[3]||(q[3]=fe=>X(V)("")),id:"item_search_box"},null,8,["modelValue","onSearch","class"]),ye(X(HP),{status:X(Be)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":F.value},{default:Se(()=>[ye(X(ft),{variant:"secondary",onClick:Ae},{prefix:Se(()=>[ye(X(gt),{src:"ArrowsRotate"})]),default:Se(()=>[q[4]||(q[4]=ut(" Refresh ",-1))]),_:1})]),_:1},8,["status","show-badge"]),ye(X(h7),{"model-value":X(_),"onUpdate:modelValue":X(O),checkboxColumn:X(I),id:"table_customization"},null,8,["model-value","onUpdate:modelValue","checkboxColumn"])]),grid:Se(({availableHeight:fe})=>[ye(X(zce),xn({id:"item_table_main",ref:"agGrid"},Y.value,{height:fe+"px",isSorting:X(Je),onOnGridReady:at,onSelectionChanged:We}),null,16,["height","isSorting"])]),footer:Se(()=>[we("div",{class:z(ke.$style.tableFooter),id:"table_footer"},[we("span",null,[q[5]||(q[5]=ut(" Showing ",-1)),we("b",null,bt(X(g).loaded)+" of "+bt(X(g).total),1)])],2)]),"new-row":Se(()=>[ye(X(v7),{onCreateNewItem:xt,ref_key:"createNewSceneRef",ref:xe},null,512)]),"bulk-update-actions":Se(()=>{var fe;return[!m.value&&h.value.length>0?(K(),Xe(X(J8),{key:0,selectRowData:((fe=d.value)==null?void 0:fe.getSelectedRows())||[],"workspace-id":u.workspaceId,"entity-id":u.entityId,"grid-api":d.value,onUnselect:X(Ot),"take-name":De.value,"selected-all":ue.value},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","take-name","selected-all"])):ot("",!0)]}),snackbar:Se(()=>[ye(X(xK))]),popup:Se(()=>[ye(D7,{ref_key:"popupCreateSceneRef",ref:Te,"workspace-id":u.workspaceId,"entity-id":u.entityId,onImportSuccess:Ae},null,8,["workspace-id","entity-id"]),ye(kde,{ref_key:"popupOverwriteScenesRef",ref:Ee,"workspace-id":u.workspaceId,"entity-id":u.entityId,onImportSuccess:Ae},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"]))}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1lefh_1",tableFooter:"_tableFooter_1lefh_7",footerStart:"_footerStart_1lefh_17",newRow:"_newRow_1lefh_25","warning-text":"_warning-text_1lefh_44","has-error":"_has-error_1lefh_49",itemSearchBox:"_itemSearchBox_1lefh_53","beta-tag":"_beta-tag_1lefh_57"}}]]),VM="0.0.31",Lde={key:0},Nde=Ct(lt({__name:"app",setup(e){const t=j(()=>n.id.length===0||n.workspaceId.length===0),n=Ao({id:"",workspaceId:"",apiConfig:{}}),i=bd(),{showMessage:o}=i,s=c=>{var u,d;c.success?o(c.apiCode,"success"):o(((d=(u=c.res)==null?void 0:u.data)==null?void 0:d.message)||c.apiCode,"error")},r=Z(null);hv(()=>{var c,u,d;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",VM);try{if(r.value=Si(),!r.value)throw new Error("Current instance is null");n.id=((c=r.value)==null?void 0:c.appContext.config.globalProperties.id)||"",n.workspaceId=((u=r.value)==null?void 0:u.appContext.config.globalProperties.workspaceId)||sessionStorage.getItem("ws.code")||"";const h={domainApi:"https://api.dev.arbocollab.com/api",wsCode:sessionStorage.getItem("ws.code")||"w:yngazem",entityId:n.id};n.apiConfig=((d=r.value)==null?void 0:d.appContext.config.globalProperties.apiConfig)||{};const f=new NM(n.apiConfig,h);f.on("call-api",s),r.value.appContext.config.globalProperties.apiServices=f}catch(h){console.error("Error getting current instance:",h)}}),Yn(()=>{r.value.appContext.config.globalProperties.apiServices.off("call-api",s)});const a=j(()=>n.id),l=j(()=>n.workspaceId);return Fa("workspaceId",l),Fa("entityId",a),(c,u)=>(K(),Ce("div",{class:z(c.$style.dashboardPluginWrapper)},[t.value?(K(),Ce("span",Lde," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):a.value?(K(),Xe(X(Mde),{key:1,entityId:a.value,workspaceId:l.value},null,8,["entityId","workspaceId"])):ot("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),HS=async(e={},t={})=>{const n=MR(Nde),i=b8();n.use(i);const o=["apiConfig","workspaceId","id"],s={};return Object.entries(e).forEach(([r,a])=>{a!==void 0&&(n.config.globalProperties[r]=a,s[r]=a,o.includes(r)&&typeof a=="string"?sessionStorage.setItem(r,a):console.error(`[Config Error] Key "${r}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=s,Object.values(t).forEach(r=>{r&&typeof r.install=="function"&&n.use(r)}),n.config.errorHandler=(r,a,l)=>{console.error("[Vue Error]",r),l&&console.error("[Info]",l)},console.log(`%cArbo Dashboard Plugin v${VM}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),n};typeof window<"u"&&(window.arboDashboard=HS),un.default=HS,un.initDashboard=HS,Object.defineProperties(un,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
192
+ `,Mde=Ct(lt({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=zC(),{setUserPermissions:i,setEntityPermissions:o}=n,{entityPermissions:s}=nr(n),{addNotification:r}=bd(),a=Z(null),l={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},c=j(()=>{var q;const ke=((q=s.value)==null?void 0:q.has_create_item_permission)===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"}]}),u=e;Ad.initialize({wrapVueCellRenderer:eg,wrapVueCellEditor:P1});const d=Z(null),h=Z([]),f=YC(),{rowCount:g}=nr(f),m=Z(!1),y=Z(""),b=Z(),S=Z(""),F=Z(!1),C=Z(new Set),R=Z(new Map),{apiServices:E}=po(!1,u),{columnDefs:_,checkboxColumn:I,saveColumnConfig:O}=Xce(b,u.entityId),{updateRowData:k,setMetricValues:x}=Tde(d),P=j(()=>y.value.length>0),N=j(()=>!1),G=j(dC),se=j(()=>_.value.filter(ke=>{var q;return((q=ke.field)==null?void 0:q.startsWith("metric_"))&&!ke.hide}).map(ke=>{var q;return((q=ke.field)==null?void 0:q.replace("metric_",""))||""}));Fa("timezone",G);const B=j(()=>({autoFetch:!1,workspaceId:u.workspaceId,entityId:u.entityId,metricIds:se.value,updateItemData:k})),{fetchItems:H,getMetricList:J,cusorMap:$,getMetricValues:ce}=Fde(B),ue=j(()=>{if(!d.value)return!1;const ke=d.value.getSelectedRows().length;return ke>0&&ke>=g.value.total}),De=j(()=>{var ke;return((ke=a.value)==null?void 0:ke.name)||"Items"}),ae=(ke,q)=>{var fe,$e,vt;g.value.total=ke.meta.total??0,(fe=ke.meta.next)!=null&&fe.cursor&&($[q+1]=ke.meta.next.cursor),S.value=ke.meta["X-Tsr-content-sha256"]||"",ke.meta.total===0?($e=d.value)==null||$e.showNoRowsOverlay():(vt=d.value)==null||vt.hideOverlay()},Fe=R1(),{sortingAPIConfiguration:Me,isSortingRunning:Je}=nr(Fe),pt=Z([]),Mt=async({page:ke,pageSize:q,filterText:fe})=>{var Le;(Le=d.value)==null||Le.hideOverlay();const $e=$[ke],vt=!$e&&ke>1?(ke-1)*q:void 0,Ft=Me.value;Ft.length>0&&(Je.value=!0);try{const An=await H({cursor:$e,size:q,searchQuery:fe,offset:vt,sort_by:Ft,assignees:pt.value});if(!An)return{rows:[],total:0};const ra=(xo=>{const Os=xo.data.map(Qo=>kF(Qo,G.value));return Os.forEach(Qo=>{C.value.add(String(Qo.id)),R.value.set(String(Qo.id),{})}),Os})(An);return ae(An,ke),{rows:ra,total:g.value.total}}catch(An){return console.error("Failed to fetch items:",An),{rows:[],total:0}}finally{Je.value=!1}},{isLoading:Be,toggleSidebar:jt,onGridReady:nn,handleUnSelect:Ot,onSearch:V}=Ide({selectRowData:Z([]),isSidebarOpen:m,quickFilterText:y,gridApi:d,columnDefs:_,perPage:l.ROWS_PER_PAGE,fetcher:Mt}),Y=j(()=>({blockLoadDebounceMillis:1e3,columnDefs:_.value,rowModelType:"infinite",cacheBlockSize:l.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,headerCheckbox:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},suppressHeaderFocus:!1,pagination:!1,rowHeight:l.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!0,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:l.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:pe,noRowsOverlayComponent:eg(g7),noRowsOverlayComponentParams:()=>({isSearching:P.value,isFiltering:N.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 q=["row-highlight"];return ke.data.id||q.push("row-inactive"),ke.data.isDeleted&&q.push("row-deleted"),ke.data.isArchived&&q.push("row-archived"),q},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:u.workspaceId,entityId:u.entityId,apiServices:E.value,sorting:Je.value}}));function pe(){if(!d.value)return;const ke=d.value.getCacheBlockState();if(!ke)return;const q=Object.values(ke).reduce((fe,$e)=>($e==null?void 0:$e.pageStatus)==="loaded"?fe+($e.endRow-$e.startRow):fe,0);g.value.loaded=Math.min(q,g.value.total)}ct(()=>Me,()=>{d.value&&(S.value="",C.value.clear(),d.value.deselectAll(),Object.keys($).forEach(ke=>delete $[Number(ke)]),d.value.purgeInfiniteCache(),d.value.ensureIndexVisible(0),d.value.refreshCells({force:!0}))},{deep:!0});const Te=Z(),Ee=Z(),_e=()=>{var ke;(ke=Ee.value)==null||ke.open()},Ve=()=>{var ke;(ke=Te.value)==null||ke.open()},Ae=()=>{console.log("Refreshing table"),d.value&&(S.value="",C.value.clear(),Object.keys($).forEach(ke=>delete $[Number(ke)]),d.value.refreshInfiniteCache())},Pe=j(()=>sessionStorage.getItem("ITEM_TABLE_APP_VERSION")||""),xe=Z();function it(ke){var q;ke==="new_scene"?(q=xe.value)==null||q.show():ke==="import_scenes"?Ve():ke==="overwrite_scenes"&&_e()}const We=ke=>{h.value=ke.api.getSelectedRows().map(q=>q.id)},at=ke=>{const q=nn(ke);return q&&(q.addEventListener("modelUpdated",pe),q.addEventListener("bodyScroll",()=>q.stopEditing())),q==null||q.sizeColumnsToFit(),q},dt=(ke,q)=>{if(!d.value)return;const fe=d.value.getRowNode(ke);fe?(d.value.ensureIndexVisible(Number(fe.rowIndex),"middle"),d.value.flashCells({rowNodes:[fe],flashDuration:3e3,fadeDuration:1e3})):d.value.ensureIndexVisible(g.value.total-1,"bottom")},xt=async ke=>{var fe;let q;if(!(!E.value||!ke.trim())){Be.value=!0;try{q=await E.value.createNewScene({workspaceId:u.workspaceId,entityId:u.entityId,name:ke}),g.value.total<50&&await Ae()}catch($e){console.error("Error creating new scene:",$e)}finally{Be.value=!1,q!=null&&q.id&&r({id:String(q==null?void 0:q.id),message:`${ke} created successfully`,actions:[{label:"View",variant:"secondary",action:()=>{dt(String(q==null?void 0:q.id))}},{label:"Scene Hub",variant:"primary",action:()=>{const $e=Vo({type:"scene_hub",config:{ws_code:u.workspaceId,baseDomain:sessionStorage.getItem("URL_BASE")||"app.arbocollab.com",scene_id:String(q==null?void 0:q.id)}}).url;window.open($e,"_blank")},btnIcon:"CustomSceneHub"}],icon:Ode,type:"interactive"}),(fe=xe.value)==null||fe.hide()}}},Lt=ke=>ke.metric_type.code==="number"?"number":"default",Ht=async()=>{if(u.entityId)try{const ke=await J(u.entityId);b.value=ke.data.map(q=>({...q,sortType:Lt(q)}))}catch(ke){console.error("Failed to initialize metric list:",ke),b.value=[]}},Dn=async()=>{if(E.value)try{const ke=await E.value.getUserPermission(u.workspaceId);i(ke)}catch(ke){console.error("Failed to fetch user permissions:",ke)}},cn=async()=>{if(E.value)try{const ke=await E.value.getEntityDetail(u.workspaceId,u.entityId);o(ke.permission),a.value=ke}catch(ke){console.error("Failed to fetch entity details:",ke)}};ct(()=>[u.entityId,u.workspaceId],async([ke,q])=>{!ke||!q||(Ht(),Dn(),cn())},{immediate:!0,deep:!0}),ct(se,(ke,q)=>{const fe=ke.filter($e=>!(q!=null&&q.includes($e)));fe.length>0&&ce(Array.from(C.value),fe).then($e=>{x($e,C.value,fe)})},{immediate:!0,deep:!0}),ct(S,(ke,q)=>{F.value=!!(q&&ke&&q!==ke)}),t({refreshTable:Ae});const qn=ke=>{pt.value=ke,Ae()};return(ke,q)=>(K(),Xe(X(dK),{"is-sidebar-open":m.value,onCloseSidebar:X(jt),onSidebarClear:X(jt),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:X(jt)},{"header-left":Se(()=>[we("h1",{class:z(ke.$style.tableTitle)},"Scenes",2),we("div",{class:z(ke.$style["beta-tag"])},"Beta",2),ye(X(QC),{variant:["primary"],options:c.value,onSelect:it,onHandleClick:q[1]||(q[1]=fe=>it("new_scene")),id:"create_scene_dropdown"},{prefix:Se(()=>[ye(X(ft),{id:"create_new_scene",variant:["primary"],onClick:q[0]||(q[0]=fe=>it("new_scene")),label:"New"})]),_:1},8,["options"]),we("span",null,bt(Pe.value),1)]),"header-actions":Se(()=>[ye(X(S7),{"onUpdate:assignees":qn}),ye(X(KC),{modelValue:y.value,"onUpdate:modelValue":q[2]||(q[2]=fe=>y.value=fe),onSearch:X(V),class:z(ke.$style.itemSearchBox),onClear:q[3]||(q[3]=fe=>X(V)("")),id:"item_search_box"},null,8,["modelValue","onSearch","class"]),ye(X(HP),{status:X(Be)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":F.value},{default:Se(()=>[ye(X(ft),{variant:"secondary",onClick:Ae},{prefix:Se(()=>[ye(X(gt),{src:"ArrowsRotate"})]),default:Se(()=>[q[4]||(q[4]=ut(" Refresh ",-1))]),_:1})]),_:1},8,["status","show-badge"]),ye(X(h7),{"model-value":X(_),"onUpdate:modelValue":X(O),checkboxColumn:X(I),id:"table_customization"},null,8,["model-value","onUpdate:modelValue","checkboxColumn"])]),grid:Se(({availableHeight:fe})=>[ye(X(zce),xn({id:"item_table_main",ref:"agGrid"},Y.value,{height:fe+"px",isSorting:X(Je),onOnGridReady:at,onSelectionChanged:We}),null,16,["height","isSorting"])]),footer:Se(()=>[we("div",{class:z(ke.$style.tableFooter),id:"table_footer"},[we("span",null,[q[5]||(q[5]=ut(" Showing ",-1)),we("b",null,bt(X(g).loaded)+" of "+bt(X(g).total),1)])],2)]),"new-row":Se(()=>[ye(X(v7),{onCreateNewItem:xt,ref_key:"createNewSceneRef",ref:xe},null,512)]),"bulk-update-actions":Se(()=>{var fe;return[!m.value&&h.value.length>0?(K(),Xe(X(J8),{key:0,selectRowData:((fe=d.value)==null?void 0:fe.getSelectedRows())||[],"workspace-id":u.workspaceId,"entity-id":u.entityId,"grid-api":d.value,onUnselect:X(Ot),"take-name":De.value,"selected-all":ue.value},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","take-name","selected-all"])):ot("",!0)]}),snackbar:Se(()=>[ye(X(xK))]),popup:Se(()=>[ye(D7,{ref_key:"popupCreateSceneRef",ref:Te,"workspace-id":u.workspaceId,"entity-id":u.entityId,onImportSuccess:Ae},null,8,["workspace-id","entity-id"]),ye(kde,{ref_key:"popupOverwriteScenesRef",ref:Ee,"workspace-id":u.workspaceId,"entity-id":u.entityId,onImportSuccess:Ae},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"]))}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1lefh_1",tableFooter:"_tableFooter_1lefh_7",footerStart:"_footerStart_1lefh_17",newRow:"_newRow_1lefh_25","warning-text":"_warning-text_1lefh_44","has-error":"_has-error_1lefh_49",itemSearchBox:"_itemSearchBox_1lefh_53","beta-tag":"_beta-tag_1lefh_57"}}]]),VM="0.0.32",Lde={key:0},Nde=Ct(lt({__name:"app",setup(e){const t=j(()=>n.id.length===0||n.workspaceId.length===0),n=Ao({id:"",workspaceId:"",apiConfig:{}}),i=bd(),{showMessage:o}=i,s=c=>{var u,d;c.success?o(c.apiCode,"success"):o(((d=(u=c.res)==null?void 0:u.data)==null?void 0:d.message)||c.apiCode,"error")},r=Z(null);hv(()=>{var c,u,d;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",VM);try{if(r.value=Si(),!r.value)throw new Error("Current instance is null");n.id=((c=r.value)==null?void 0:c.appContext.config.globalProperties.id)||"",n.workspaceId=((u=r.value)==null?void 0:u.appContext.config.globalProperties.workspaceId)||sessionStorage.getItem("ws.code")||"";const h={domainApi:"https://api.dev.arbocollab.com/api",wsCode:sessionStorage.getItem("ws.code")||"w:yngazem",entityId:n.id};n.apiConfig=((d=r.value)==null?void 0:d.appContext.config.globalProperties.apiConfig)||{};const f=new NM(n.apiConfig,h);f.on("call-api",s),r.value.appContext.config.globalProperties.apiServices=f}catch(h){console.error("Error getting current instance:",h)}}),Yn(()=>{r.value.appContext.config.globalProperties.apiServices.off("call-api",s)});const a=j(()=>n.id),l=j(()=>n.workspaceId);return Fa("workspaceId",l),Fa("entityId",a),(c,u)=>(K(),Ce("div",{class:z(c.$style.dashboardPluginWrapper)},[t.value?(K(),Ce("span",Lde," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):a.value?(K(),Xe(X(Mde),{key:1,entityId:a.value,workspaceId:l.value},null,8,["entityId","workspaceId"])):ot("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),HS=async(e={},t={})=>{const n=MR(Nde),i=b8();n.use(i);const o=["apiConfig","workspaceId","id"],s={};return Object.entries(e).forEach(([r,a])=>{a!==void 0&&(n.config.globalProperties[r]=a,s[r]=a,o.includes(r)&&typeof a=="string"?sessionStorage.setItem(r,a):console.error(`[Config Error] Key "${r}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=s,Object.values(t).forEach(r=>{r&&typeof r.install=="function"&&n.use(r)}),n.config.errorHandler=(r,a,l)=>{console.error("[Vue Error]",r),l&&console.error("[Info]",l)},console.log(`%cArbo Dashboard Plugin v${VM}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),n};typeof window<"u"&&(window.arboDashboard=HS),un.default=HS,un.initDashboard=HS,Object.defineProperties(un,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbocollab/arbo-plugin-item-table",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "type": "module",
5
5
  "main": "./lib/index.umd.js",
6
6
  "module": "./lib/index.es.js",