@arbocollab/arbo-plugin-item-table 0.1.65 → 0.1.66

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.
@@ -136,7 +136,7 @@ Only state can be modified.`);r[0]="$state",Eu=!1,o.set(i,r,o.state.value),Eu=!0
136
136
  state: () => new MyClass()
137
137
  Found in store "${x.$id}".`),p&&i&&n.hydrate&&n.hydrate(x.$state,p),c=!0,u=!0,x}/*! #__NO_SIDE_EFFECTS__ */function Yl(e,t,n){let o;const s=typeof t=="function";o=s?n:t;function i(r,a){const l=Sw();if(r=(K.env.NODE_ENV==="test"&&jl&&jl._testing?null:r)||(l?En(wm,null):null),r&&qh(r),K.env.NODE_ENV!=="production"&&!jl)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
138
138
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
139
- This will fail in production.`);r=jl,r._s.has(e)||(s?qb(e,t,o,r):kA(e,o,r),K.env.NODE_ENV!=="production"&&(i._pinia=r));const c=r._s.get(e);if(K.env.NODE_ENV!=="production"&&a){const u="__hot:"+e,d=s?qb(u,t,o,r,!0):kA(u,Qs({},o),r,!0);a._hotUpdate(d),delete r.state.value[u],r._s.delete(u)}if(K.env.NODE_ENV!=="production"&&Zr){const u=So();if(u&&u.proxy&&!a){const d=u.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[e]=c}}return c}return i.$id=e,i}function Ho(e){const t=Mt(e),n={};for(const o in t){const s=t[o];s.effect?n[o]=Z({get:()=>e[o],set(i){e[o]=i}}):(pn(s)||Hs(s))&&(n[o]=Ci(e,o))}return n}const Rm=Yl("permissionStore",()=>{const e=B([]),t=B(),n=B({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:r=>{e.value=r},setEntityPermissions:r=>{t.value=r},setItemPermission:(r,a)=>{n.value[r]=a}}}),OA="woohoo_getWoohooUserInterface_read",Dm="media_getReviewUserInterface_read",MA="update_getUpdateUserInterface_read",tY=(e,t,n,o,s)=>{const i=Rm(),{userPermissions:r}=Ho(i),a=Z(()=>{const U=Cn.getInstance().getItem("BASE_URL"),q=Cn.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:Q,entity_id:X,scene_id:he}=e.value;return{baseDomain:U||"",ws_code:Q||"",entity_id:X||"",scene_id:he||"",reviewDomain:q||"",take_id:X||"",woohoo_id:X||"",parent_id:X||""}}),l=Z(()=>{var q;const U=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:r.value.includes(Dm),canCopyLink:!0,canRename:(U==null?void 0:U.has_edit_permission)??!1,canOpenTakeInReview:r.value.includes(Dm),canOpenTakeInUpdate:r.value.includes(MA),canOpenTakeInWoohoo:r.value.includes(OA),canDeleteRendition:((q=U==null?void 0:U.media)==null?void 0:q.has_delete_rendition_permission)??!1,canDeleteThumbnail:(U==null?void 0:U.has_edit_thumbnail_permission)??!1,canArchiveScene:U==null?void 0:U.has_archive_permission,canUnarchiveScene:U==null?void 0:U.has_archive_permission,canDeleteScene:(U==null?void 0:U.has_delete_permission)??!1}}),c=Z(()=>({project:Lo({type:"project",config:a.value}).url,take_review:Lo({type:"review_take",config:a.value}).url,review:Lo({type:"review_scene",config:a.value}).url,review_scene:Lo({type:"review_scene",config:a.value}).url,woohoo:Lo({type:"woohoo",config:a.value}).url,update:Lo({type:"update",config:a.value}).url,scene_hub:Lo({type:"scene_hub",config:a.value}).url})),u=(U,q)=>{const Q=U.metaKey||U.ctrlKey,X=c.value[q]||"";if(X){if(q==="scene_hub"){if(Q){window.open(X,"_blank");return}if(!o){console.error("Switch instance not found.",{openSceneHub:o,windowFunc:globalThis.window.$switchInstance});return}o(a.value.scene_id||"");return}Q?window.open(X,"_blank"):window.location.href=X}},d=async(U,q)=>{var Q;try{const X=await((Q=e.value.axiosService.value)==null?void 0:Q.deleteRendition({workspaceId:a.value.ws_code,itemIds:[a.value.scene_id||""],deleteAll:!0}));(X==null?void 0:X.message)!="Done"&&console.error("Failed to delete rendition.")}catch(X){console.error("Error deleting rendition",X)}finally{s()}},h=async(U,q)=>{var Q;try{await((Q=e.value.axiosService.value)==null?void 0:Q.deleteThumbnail({workspaceId:a.value.ws_code,itemIds:[a.value.scene_id||""]}))}catch(X){console.error("Error deleting thumbnail",X)}finally{s()}},f=async(U,q)=>{var Q;try{const X=await((Q=e.value.axiosService.value)==null?void 0:Q.archiveScene(a.value.ws_code,a.value.entity_id,[a.value.scene_id]));(X==null?void 0:X.message)!="Done"&&console.error("Failed to archive scene."),q&&q("archived")}catch(X){console.error("Error archiving item",X)}finally{s()}},p=async(U,q)=>{var Q;try{const X=await((Q=e.value.axiosService.value)==null?void 0:Q.deleteScene(a.value.ws_code,a.value.entity_id,a.value.scene_id));(X==null?void 0:X.message)!="Done"&&console.error("Failed to delete scene."),q&&q("deleted")}catch(X){console.error("Error deleting item",X)}finally{s()}},g=U=>{const q=c.value.scene_hub||"";q&&(navigator.clipboard.writeText(q),s())},v=async(U,q)=>{var Q;try{const X=await((Q=e.value.axiosService.value)==null?void 0:Q.unarchiveScene(a.value.ws_code,a.value.entity_id,[a.value.scene_id]));(X==null?void 0:X.message)!="Done"&&console.error("Failed to unarchive scene."),q&&q("unarchived")}catch(X){console.error("Error unarchiving item",X)}finally{s()}},y=U=>u(U,"scene_hub"),b=U=>u(U,"review_scene"),{tooltip:S,copyToClipboard:C}=wb(c.value.scene_hub||"",void 0,!0),E=U=>{C(U)},_=U=>n(U),x=U=>u(U,"review"),A=U=>u(U,"update"),k=U=>u(U,"woohoo"),T=U=>d(),D=U=>h(),F=U=>f(U,t),P=U=>v(U,t),$=U=>p(U,t),ne=Z(()=>{let U=[];return!a.value.scene_id&&e.value.optionBlock&&U.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length?e.value.optionBlock:[{id:"quick-actions",groupLabel:"Quick actions",type:"row",options:[{id:"scene-tile",label:"",icon:"CustomSceneHub",description:"Full view",action:y,hide:!l.value.canOpenSceneHub,type:"icon"},{id:"open-in-arbo-review",label:"",icon:"PenRuler",description:"Open in Review",action:b,hide:!l.value.canOpenReview,type:"icon"},{id:"copy-link",label:"",icon:"Link",description:S.value,action:E,hide:!l.value.canCopyLink,type:"icon"}]},{id:"action",groupLabel:"Action",type:"column",options:[{id:"rename",label:"Rename",icon:"Pen",action:_,hide:!l.value.canRename,type:"icon"}]},{id:"download-options-take",type:"column",groupLabel:"Download Options",options:[{id:"open-take-in",label:"Open in",icon:"ArrowUpRightFromSquare",subMenu:{id:"sub-menu",type:"column",groupLabel:"Sub Menu",options:[{id:"review",label:"Review",icon:"PenRuler",action:x,hide:!l.value.canOpenTakeInReview,type:"icon"},{id:"update",label:"Update",icon:"UserCheck",action:A,hide:!l.value.canOpenTakeInUpdate,type:"icon"},{id:"woohoo-details",label:"Woohoo Details",icon:"ChartPie",action:k,hide:!l.value.canOpenTakeInWoohoo,type:"icon"}]}}]},{id:"download-options-delete",type:"column",groupLabel:"Download Options",options:[{id:"delete-rendition",label:"Delete rendition",icon:"Clapperboard",action:T,hide:!l.value.canDeleteRendition,type:"icon"},{id:"delete-thumbnail",label:"Delete thumbnail",icon:"Image",action:D,hide:!l.value.canDeleteThumbnail,type:"icon"}]},{id:"download-options-archive",type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:F,hide:l.value.canArchiveScene==0,disabled:l.value.canArchiveScene!==1,description:l.value.canArchiveScene==-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:P,hide:l.value.canUnarchiveScene==0,disabled:l.value.canUnarchiveScene!==1,description:l.value.canUnarchiveScene===-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:$,hide:!l.value.canDeleteScene,type:"icon"}]}]});return{linkMap:c,handleOpen:u,copyLink:g,deleteRendition:d,deleteThumbnail:h,archiveItem:f,deleteItem:p,unArchiveItem:v,options:ne}};function vo(e){const t=B(!1),n=B(!1),o=Z(()=>{var d;const c=e.value,u=!!c.readOnly;return{readOnly:u,disabled:!!c.disabled,hovered:n.value,focused:t.value,isEmpty:c.empty??!1,error:!!c.error,actived:!!((d=c.active)!=null&&d.value),clickable:u?!1:c.clickable??!1}}),s=()=>{t.value=!0,_t(()=>{const c=l(e.value.inputRef);c==null||c.focus()})},i=()=>{t.value=!1},r=()=>{n.value=!0},a=()=>{n.value=!1},l=c=>{if(!c)return null;const u=c.value||c;return(u instanceof HTMLElement?u:u==null?void 0:u.$el)||null};return Xt(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.addEventListener("focus",s),c.addEventListener("blur",i)),u&&(u.addEventListener("mouseenter",r),u.addEventListener("mouseleave",a))}),lo(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.removeEventListener("focus",s),c.removeEventListener("blur",i)),u&&(u.removeEventListener("mouseenter",r),u.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:o,handleFocus:s}}const Ru=e=>{const t=B(!1),n=Z(()=>t.value);return Xt(()=>{var a,l,c,u;const o=(a=e.params)==null?void 0:a.api,s=(l=e.params)==null?void 0:l.node,i=s==null?void 0:s.rowIndex,r=(u=(c=e.params)==null?void 0:c.colDef)==null?void 0:u.field;return o==null||o.addEventListener("cellEditingStarted",d=>{d.rowIndex===i&&d.colDef.field===r&&(t.value=!0)}),o==null||o.addEventListener("cellEditingStopped",d=>{d.rowIndex===i&&d.colDef.field===r&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}},NA=St(it({__name:"StatusBadge",props:{size:{default:16},color:{default:"#02C39A"},label:{default:""},status:{default:"active"},statusTooltip:{default:"Online"},showBadge:{type:Boolean,default:!0},loading:{type:Boolean}},setup(e){const t=as,{triggerRef:n,popupRef:o}=eo({trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),s=Z(()=>{switch(i.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"#02C39A"}}),i=e;return(r,a)=>(j(),ae("div",{class:J(r.$style["status-badge-wrapper"]),style:cn({"--badge-size":`${i.size}px`,"--badge-color":s.value})},[Pt(r.$slots,"default"),Ue(ge("div",{class:J(r.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[_i,i.showBadge],[H(t),{isLoading:i.loading,fullwidth:!0}]]),ge("div",{ref_key:"popupRef",ref:o,class:J(r.$style["badge-tooltip"])},yt(i.statusTooltip),3)],6))}}),[["__cssModules",{$style:{"status-badge-wrapper":"_status-badge-wrapper_1rb3z_1","badge-indicator":"_badge-indicator_1rb3z_6",active:"_active_1rb3z_19",offline:"_offline_1rb3z_22",busy:"_busy_1rb3z_25",away:"_away_1rb3z_28","badge-tooltip":"_badge-tooltip_1rb3z_32"}}]]),Yh=Yl("switchStore",()=>{const e=B(null),t=En("switchInstance");return{openSceneHub:(s,i)=>{if(s){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");t("scene_hub",{id:s,commentId:i},{showLoading:!1})}},openPeopleInsight:s=>{const i=t||e.value;if(!i)throw console.error("Switch instance not found"),new Error("Switch instance not found");s||console.trace("No people_id provided, defaulting to empty string"),i("people_insight",{tab:"home",id:s||""},{showLoading:!1})},switchInstanceFunc:e}}),nY=it({__name:"MiniPeopleCard",props:{user:{},status:{default:"active"},timezone:{default:sm()},userConfig:{default:()=>({size:96,isUseShortLabel:!0,bgColor:"#E0E0E0",color:"#757575",isMe:!1})},showInsightButton:{type:Boolean,default:!0},showCopyLinkButton:{type:Boolean,default:!0},apiUpdateFunction:{type:Function,default:void 0},refreshInterval:{default:3e4},enableAutoRefresh:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},private:{type:Boolean,default:!1}},emits:["insightClick","copyLink","dataUpdated"],setup(e,{emit:t}){const n=Yt,o=as,s=e,i=t,r={active:"Active in the last 10 minutes",offline:"Logged out of TESSR",busy:"User is busy",away:"No activity in the last 10 minutes"},a={active:"#02C39A",offline:"#808080",busy:"#FF0000",away:"#F7941D"},l=B(s.status),c=B(s.timezone),u=B(!0),d=B(null),h=Z(()=>r[l.value]),f=Z(()=>a[l.value]),p=Z(()=>{var P;return(P=s.user)==null?void 0:P.name}),g=B(!1),v=Z(()=>c.value?u7(c.value,"HH:mm"):""),y=Z(()=>c.value?`(${d7(c.value)})`:""),b=async()=>{var P,$,ne;if(s.apiUpdateFunction)try{const U=await s.apiUpdateFunction(s.user.id);if(!U){g.value=!0,console.error("No data returned from API");return}(P=U==null?void 0:U.private_info)!=null&&P.is_offline?l.value="offline":($=U.private_info)!=null&&$.last_active?l.value="active":l.value="away",(ne=U.private_info)!=null&&ne.timezone&&(c.value=U.private_info.timezone),i("dataUpdated",U)}catch(U){g.value=!0,console.error("Failed to fetch user data:",U)}finally{u.value=!1}},S=()=>{!s.apiUpdateFunction||!s.enableAutoRefresh||(d.value!==null&&clearInterval(d.value),d.value=setInterval(b,s.refreshInterval))},C=()=>{d.value!==null&&(clearInterval(d.value),d.value=null)},E=Z(()=>{const P=globalThis.location.origin,$=Cn.getInstance().getItem("ws.code");return Lo({type:"people_insight",config:{ws_code:$,baseDomain:P,user_id:s.user.id}}).url}),{copyToClipboard:_,tooltip:x}=wb(E.value,()=>i("copyLink",s.user.id)),A=Yh(),{openPeopleInsight:k}=A,T=P=>{if(P.ctrlKey||P.metaKey){window.open(E.value,"_blank");return}try{k(String(s.user.id))}catch{window.open(E.value,"_blank")}},D=P=>{T(P),i("insightClick",s.user.id)};Je([()=>s.enableAutoRefresh,()=>s.refreshInterval,()=>s.apiUpdateFunction],()=>{C(),s.enableAutoRefresh&&s.apiUpdateFunction&&S()}),Xt(async()=>{s.apiUpdateFunction&&(await b(),S())}),lo(C);const F=Z(()=>({name:s.user.name,initial:s.user.initial,id:s.user.id,profile_image:s.user.profile_image,color:s.user.color,size:98}));return(P,$)=>(j(),ae("div",{class:J([P.$style["mini-people-card"],{[P.$style.loading]:u.value},"bg-skeleton"])},[ge("div",{class:J(P.$style["avatar-section"])},[!s.private&&!g.value?(j(),ze(NA,{key:0,size:16,status:l.value,loading:u.value,"status-tooltip":h.value},{default:pe(()=>[ce(Sh,qt({readOnly:!0},F.value),null,16)]),_:1},8,["status","loading","status-tooltip"])):(j(),ze(Sh,qt({key:1,readOnly:!0},F.value),null,16))],2),ge("div",{class:J(P.$style["user-info"])},[ge("div",{class:J(P.$style["info-row"])},[ge("h3",{class:J(P.$style["user-name"])},yt(p.value),3),!s.private&&!g.value?Ue((j(),ae("span",{key:0,class:J(P.$style["status-badge"]),style:cn({color:f.value})},[nt(yt(l.value),1)],6)),[[H(o),{isLoading:u.value,fullwidth:!0}]]):Ze("",!0)],2),c.value&&!g.value?(j(),ae("div",{key:0,class:J([P.$style["info-row"],P.$style["time-row"]])},[Ue((j(),ae("div",{class:J(P.$style["time-display"])},[ce(rt,{source:"remote",src:"Clock",class:J(P.$style["clock-icon"])},null,8,["class"]),ge("span",{class:J(P.$style["time-text"])},[ge("strong",null,yt(v.value),1),ge("span",{class:J(P.$style.separator)},"|",2),ge("span",null,yt(y.value),1)],2)],2)),[[H(o),{isLoading:u.value,fullwidth:!0}]])],2)):Ze("",!0),!e.readOnly&&!s.private&&!g.value?(j(),ae("div",{key:1,class:J([P.$style["info-row"],P.$style.actions])},[e.showInsightButton?(j(),ze(ct,{key:0,label:"Insights",variant:"primary",size:"default",style:{flex:"1"},onClick:Tt(D,["prevent","stop"]),disabled:s.disabled},null,8,["disabled"])):Ze("",!0),e.showCopyLinkButton?Ue((j(),ze(ct,{key:1,variant:["icon","secondary"],size:"default","aria-label":"Copy link",onClick:Tt(H(_),["prevent","stop"]),disabled:s.disabled},{default:pe(()=>[ce(rt,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[H(n),{content:H(x),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Ze("",!0)],2)):Ze("",!0)],2)],2))}}),oY=St(nY,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_i0gsv_1",loading:"_loading_i0gsv_21","avatar-section":"_avatar-section_i0gsv_24","user-info":"_user-info_i0gsv_29","info-row":"_info-row_i0gsv_35","time-row":"_time-row_i0gsv_42","time-display":"_time-display_i0gsv_48","time-text":"_time-text_i0gsv_53","actions-row":"_actions-row_i0gsv_60","user-name":"_user-name_i0gsv_64","status-badge":"_status-badge_i0gsv_75",active:"_active_i0gsv_88",offline:"_offline_i0gsv_91",busy:"_busy_i0gsv_94",away:"_away_i0gsv_97","user-local-time":"_user-local-time_i0gsv_100","clock-icon":"_clock-icon_i0gsv_108",separator:"_separator_i0gsv_120",timezone:"_timezone_i0gsv_123","refresh-btn":"_refresh-btn_i0gsv_126",spinning:"_spinning_i0gsv_129",spin:"_spin_i0gsv_129","insight-btn":"_insight-btn_i0gsv_132","copy-link-btn":"_copy-link-btn_i0gsv_136","last-update":"_last-update_i0gsv_139","loading-overlay":"_loading-overlay_i0gsv_145","loading-spinner":"_loading-spinner_i0gsv_157"}}]]),sY=St(it({name:"MoreOption",__name:"MoreOption",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e,{expose:t}){const n=Ur,o=Yt,s=e,{isEditing:i}=Ru(s),r=()=>{var h,f;const u=(h=s.params)==null?void 0:h.api,d={rowIndex:(f=u==null?void 0:u.getRowNode(String(s.id)))==null?void 0:f.rowIndex,colKey:"options"};u==null||u.startEditingCell(d)},a=Z(()=>{var d,h;const u=(h=(d=s.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(s.id));return((u==null?void 0:u.rowIndex)??0)+10}),l=()=>{var u,d;(d=(u=s.params)==null?void 0:u.api)==null||d.stopEditing()},c=B();return t({focus(){var u;(u=c.value)==null||u.focus()},blur(){var u,d;console.log("Blurring MoreOption button for row:",s.id,(u=c.value)==null?void 0:u.blur),(d=c.value)==null||d.blur()}}),(u,d)=>Ue((j(),ze(ct,{class:J(u.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:H(i),onClick:Tt(r,["stop"]),onEscape:l,ref_key:"buttonRef",ref:c},{default:pe(()=>[ce(rt,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[H(o),"More actions"],[H(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_w8s4g_1"}}]]),iY=["src","width","height","alt"],Tm=St(it({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=as,{getCachedValue:n,setCachedValue:o}=wh({dbName:"visual-cache-db",storeName:"visuals"}),s=h=>{if(h!==void 0)return typeof h=="number"?`${h}px`:typeof h=="string"&&/^\d+$/.test(h)?`${h}px`:h},i=e,r=Z(()=>({minWidth:s(i.minWidth),maxWidth:s(i.maxWidth),minHeight:s(i.minHeight),maxHeight:s(i.maxHeight),aspectRatio:i.ratio,width:s(i.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await o(h,f)},c=Z(()=>({name:i.src,size:Number(i.size||100),color:""})),{url:u,loading:d}=jT(c,"visual",l,a);return(h,f)=>Ue((j(),ae("div",{class:J([h.$style.visualWrapper,{[h.$style.loading]:H(d)}]),style:cn(r.value)},[ge("img",{src:H(u),width:e.size,height:e.size,alt:"visual-"+e.src,style:cn(r.value)},null,12,iY)],6)),[[H(t),{isLoading:H(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),ei=St(it({name:"ListItem",directives:{tooltip:Yt},__name:"ListItem",props:{label:{},value:{},type:{},selected:{type:Boolean},disabled:{type:Boolean},hover:{type:Boolean},clickable:{type:Boolean,default:!0},danger:{type:Boolean},data:{},icon:{},readOnly:{type:Boolean,default:!1},show:{type:Boolean},focusIndex:{}},emits:["click","handleClick","keydown","update:selected","select","escape"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=B(!1),r=B(!1);function a(_){if(!_||typeof _!="object")return!1;const x=_;return typeof x.name=="string"&&typeof x.id=="string"&&typeof x.initial=="string"}const l=Z(()=>o.type==="status"||o.type==="assignee"||o.type==="icon"||!!E.prefix),c=Z(()=>!!E.suffix||o.danger&&i.value),u=Z(()=>{var _;return o.type==="status"&&typeof((_=o.data)==null?void 0:_.color)=="string"?{backgroundColor:o.data.color,border:bh(o.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),d=dg(),h=Z(()=>({[d.active]:o.selected??!1,[d.disabled]:o.disabled??!1,[d.hover]:o.hover??!1,[d.clickable]:(o.clickable??!0)&&!o.disabled,[d.danger]:o.danger??!1,[d["has-prefix"]]:l.value,[d["has-suffix"]]:c.value,[d.readOnly]:o.readOnly})),f=Z(()=>({content:"Cancel",...C})),p=Z(()=>({content:"Confirm",theme:"warning",...C}));function g(_){return{name:_.name,initial:_.initial,id:_.id,profile_image:_.profile_image??null,color:_.color,size:24}}function v(){i.value=!1}function y(_){_?s("click",_):(o.clickable??!0)&&(s("update:selected",!o.selected),s("select",!o.selected))}function b(_){if(!o.disabled){if(o.danger&&!i.value){i.value=!0;return}else o.danger||y(_);s("handleClick",_)}}const S=()=>{i.value?v():s("escape")},C=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),E=ww();return Je(()=>o.show,_=>{_===!1&&(i.value=!1)}),t({select:()=>{b(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(_,x)=>{const A=bs("tooltip"),k=bs("focusable");return Ue((j(),ze(ct,{variant:["menu-item"],class:J([_.$style["list-item"],h.value]),onHandleClick:b,onMouseenter:x[0]||(x[0]=T=>r.value=!0),onMouseleave:x[1]||(x[1]=T=>r.value=!1),onEscape:S},{default:pe(()=>[l.value?(j(),ae("div",{key:0,class:J(_.$style["list-item__prefix"])},[Pt(_.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(j(),ze(rt,{key:0,src:e.icon,source:"remote",class:J(_.$style["item-icon"])},null,8,["src","class"])):e.type==="status"?(j(),ae("div",{key:1,class:J(_.$style["status-indicator"]),style:cn(u.value)},null,6)):e.type==="assignee"&&a(e.data)?(j(),ze(Sh,qt({key:2},g(e.data),{class:_.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Ze("",!0)])],2)):Ze("",!0),ge("div",{class:J(_.$style["list-item__label"])},[Pt(_.$slots,"label",{selected:e.selected},()=>[nt(yt(e.label),1)])],2),c.value?(j(),ae("div",{key:1,class:J(_.$style["list-item__suffix"])},[Pt(_.$slots,"suffix",{item:_.$props,hovered:r.value},()=>[e.danger&&i.value?(j(),ae("div",{key:0,class:J(_.$style["confirm-action"])},[Ue((j(),ze(ct,{variant:["secondary","icon"],size:"small",onClick:Tt(v,["stop","prevent"])},{default:pe(()=>[ce(rt,{src:"Xmark",source:"remote"})]),_:1})),[[A,f.value]]),Ue((j(),ze(ct,{variant:["danger","primary","icon"],size:"small",onClick:Tt(y,["stop","prevent"])},{default:pe(()=>[ce(rt,{src:"Check",source:"remote"})]),_:1})),[[A,p.value]])],2)):Ze("",!0)])],2)):Ze("",!0)]),_:3},8,["class"])),[[k,o.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_1isqe_1",disabled:"_disabled_1isqe_15",danger:"_danger_1isqe_22","has-prefix":"_has-prefix_1isqe_25","has-suffix":"_has-suffix_1isqe_25",clickable:"_clickable_1isqe_39",readOnly:"_readOnly_1isqe_42",hover:"_hover_1isqe_46",active:"_active_1isqe_52","list-item__prefix":"_list-item__prefix_1isqe_77","list-item__label":"_list-item__label_1isqe_85","list-item__suffix":"_list-item__suffix_1isqe_99","status-indicator":"_status-indicator_1isqe_106","item-icon":"_item-icon_1isqe_112","arbo-icon-state":"_arbo-icon-state_1isqe_117","item-avatar":"_item-avatar_1isqe_120","confirm-action":"_confirm-action_1isqe_129"}}]]),rY=["tabindex"],yo=St(it({__name:"DisplayWrapper",props:{prefix:{},suffix:{},inputType:{},readOnly:{type:Boolean},disabled:{type:Boolean},hovered:{type:Boolean},focused:{type:Boolean},error:{type:Boolean},actived:{type:Boolean},clickable:{type:Boolean},size:{},bordered:{type:Boolean},tabIndex:{}},emits:["event","escape"],setup(e,{expose:t,emit:n}){const o=e,s=n;ww();const i=dg(),r=B(null),a=B("default"),l=Z(()=>{if(typeof o.size=="number")return`${o.size}px`;switch(o.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),c=Z(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),u=Z(()=>({[i["display-wrapper"]]:!0,[i.disabled]:o.disabled,[i.readOnly]:o.readOnly,[i.error]:o.error,[i.clickable]:o.clickable,[i.active]:o.actived,[i.hovered]:o.hovered,[i.focused]:!o.readOnly&&!o.disabled&&o.focused,[i.bordered]:o.bordered})),d=()=>{var C,E;const g=((C=r.value)==null?void 0:C.querySelectorAll(":scope > .wrapper-prefix").length)||0,v=((E=r.value)==null?void 0:E.querySelectorAll(":scope > .wrapper-suffix").length)||0,y="var(--icon-size)",S=`calc(var(--gap-size) * ${g+v})`;return g&&!v?`repeat(${g}, ${y}) calc(100% - (${g} * ${y} + ${S}))`:!g&&v?`calc(100% - (${v} * ${y} + ${S})) repeat(${v}, ${y})`:g&&v?`repeat(${g}, ${y}) calc(100% - (${g} * ${y} + ${v} * ${y} + ${S})) repeat(${v}, ${y})`:"100%"},h=B("100%"),f=()=>{h.value=d()};qd(()=>{f()}),Xt(()=>{f()});const p=g=>{a.value=g};return t({rootEl:r,updateState:p,componentState:a,focus:()=>{_t(()=>{var g;(g=r.value)==null||g.focus()})},escape:()=>{s("escape")}}),(g,v)=>(j(),ae("div",{ref_key:"rootEl",ref:r,class:J([H(i)["display-wrapper"],u.value]),tabindex:e.tabIndex,style:cn({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":c.value})},[Pt(g.$slots,"prefix",{hovered:o.hovered,focused:o.focused}),Pt(g.$slots,"default",{hovered:o.hovered,focused:o.focused,updateComponentState:p,disabled:o.disabled}),Pt(g.$slots,"suffix",{hovered:o.hovered,focused:o.focused})],14,rY))}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_11gbb_1",readOnly:"_readOnly_11gbb_26",bordered:"_bordered_11gbb_29",disabled:"_disabled_11gbb_29",active:"_active_11gbb_29",focused:"_focused_11gbb_29",hovered:"_hovered_11gbb_34",error:"_error_11gbb_38",clickable:"_clickable_11gbb_51",suffix:"_suffix_11gbb_57",prefix:"_prefix_11gbb_58"}}]]),aY=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const lY=Object.prototype.toString,cY=e=>lY.call(e)==="[object Object]",Du=()=>{};function uY(e,t){function n(...o){return new Promise((s,i)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(s).catch(i)})}return n}function dY(e,t={}){let n,o,s=Du;const i=l=>{clearTimeout(l),s(),s=Du};let r;return l=>{const c=Nr(e),u=Nr(t.maxWait);return n&&i(n),c<=0||u!==void 0&&u<=0?(o&&(i(o),o=void 0),Promise.resolve(l())):new Promise((d,h)=>{s=t.rejectOnCancel?h:d,r=l,u&&!o&&(o=setTimeout(()=>{n&&i(n),o=void 0,d(r())},u)),n=setTimeout(()=>{o&&i(o),o=void 0,d(l())},c)})}}function Yb(e){return Array.isArray(e)?e:[e]}function hY(e,t=200,n={}){return uY(dY(t,n),e)}function fY(e,t,n){return Je(e,t,{...n,immediate:!0})}const LA=aY?window:void 0;function Zh(e){var t;const n=Nr(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function Zb(...e){const t=(o,s,i,r)=>(o.addEventListener(s,i,r),()=>o.removeEventListener(s,i,r)),n=Z(()=>{const o=Yb(Nr(e[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return fY(()=>{var o,s;return[(o=(s=n.value)===null||s===void 0?void 0:s.map(i=>Zh(i)))!==null&&o!==void 0?o:[LA].filter(i=>i!=null),Yb(Nr(n.value?e[1]:e[0])),Yb(H(n.value?e[2]:e[1])),Nr(n.value?e[3]:e[2])]},([o,s,i,r],a,l)=>{if(!(o!=null&&o.length)||!(s!=null&&s.length)||!(i!=null&&i.length))return;const c=cY(r)?{...r}:r,u=o.flatMap(d=>s.flatMap(h=>i.map(f=>t(d,h,f,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function Xb(e,t,n={}){const{window:o=LA,ignore:s=[],capture:i=!0,detectIframe:r=!1,controls:a=!1}=n;if(!o)return a?{stop:Du,cancel:Du,trigger:Du}:Du;let l=!0;const c=v=>Nr(s).some(y=>{if(typeof y=="string")return Array.from(o.document.querySelectorAll(y)).some(b=>b===v.target||v.composedPath().includes(b));{const b=Zh(y);return b&&(v.target===b||v.composedPath().includes(b))}});function u(v){const y=Nr(v);return y&&y.$.subTree.shapeFlag===16}function d(v,y){const b=Nr(v),S=b.$.subTree&&b.$.subTree.children;return S==null||!Array.isArray(S)?!1:S.some(C=>C.el===y.target||y.composedPath().includes(C.el))}const h=v=>{const y=Zh(e);if(v.target!=null&&!(!(y instanceof Element)&&u(e)&&d(e,v))&&!(!y||y===v.target||v.composedPath().includes(y))){if("detail"in v&&v.detail===0&&(l=!c(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[Zb(o,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:i}),Zb(o,"pointerdown",v=>{const y=Zh(e);l=!c(v)&&!!(y&&!v.composedPath().includes(y))},{passive:!0}),r&&Zb(o,"blur",v=>{setTimeout(()=>{var y;const b=Zh(e);((y=o.document.activeElement)===null||y===void 0?void 0:y.tagName)==="IFRAME"&&!(b!=null&&b.contains(o.document.activeElement))&&t(v)},0)},{passive:!0})].filter(Boolean),g=()=>p.forEach(v=>v());return a?{stop:g,cancel:()=>{l=!1},trigger:v=>{l=!0,h(v),l=!1}}:g}const pY=["type","value","placeholder","disabled","readonly","inputmode","maxlength"],Jb=St(it({__name:"InputText",props:{type:{default:"text"},autoEmit:{type:Boolean,default:!1},debounceDelay:{default:300},selectOnFocus:{type:Boolean,default:!1},submitOnEnter:{type:Boolean,default:!0},blurOnEscape:{type:Boolean,default:!0},modelValue:{},placeholder:{},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{}},emits:["update:modelValue","input","clear","focus","blur","change","enterValue","enter","escape","cancel","tab","keydown","keyup","paste","cut","select","onValidation"],setup(e,{expose:t,emit:n}){const o=Ur,s=Yt,i=e,r=n,a=B(null),l=B(i.modelValue||"");Je(l,()=>{r("onValidation",l.value)});const c=B(!1),u=B(i.modelValue||"");Je(()=>i.modelValue,M=>{l.value=M||"",u.value=M||""});const d=Z(()=>{var M;return((M=l.value)==null?void 0:M.length)>0}),h={text:M=>M.slice(0,i.maxLength||255),number:M=>{let Y=M.replace(/[^\d.-]/g,"");const L=Y.split(".");L.length>2&&(Y=L[0]+"."+L.slice(1).join("")),Y=Y.replace(/-/g,(fe,Le)=>Le===0?fe:"");const se=Y.replace(/[.-]/g,"");if(se.length>17){const fe=Y.includes("."),Me=Y.startsWith("-")?"-":"";if(fe){const[Ke,z]=Y.replace("-","").split(".");if(Ke.length+z.length>17){const re=17-Ke.length;Y=Me+Ke+"."+z.substring(0,Math.max(0,re))}}else Y=Me+se.substring(0,17)}return Y},email:M=>M.replace(/\s/g,"").slice(0,i.maxLength||255),url:M=>M.replace(/\s/g,"").slice(0,i.maxLength||255),tel:M=>M.replace(/[^\d+\-() ]/g,"").slice(0,i.maxLength||20)},f=M=>{const Y=h[i.type];return Y?Y(M):M},p=hY(M=>{i.autoEmit&&(r("update:modelValue",M),r("input",M))},i.debounceDelay),g=M=>{const Y=M;if(i.disabled||i.readOnly){Y.preventDefault();return}const L=Y.target,se=L.selectionStart||0,fe=l.value,Le=f(L.value);fe!==Le&&(l.value=Le,r("input",Le),i.autoEmit&&p(Le),L.value!==Le&&(L.value=Le,_t(()=>{let Me=se;if(Le.length<L.value.length)Me=se;else{const Ke=Le.length-fe.length;Me=se+Ke}Me=Math.max(0,Math.min(Me,Le.length)),L.setSelectionRange(Me,Me)})))},v=M=>{if(i.disabled||i.readOnly){M.preventDefault();return}c.value=!0;const Y=l.value;l.value="",r("update:modelValue",""),r("clear"),Y!==""&&r("change",""),M.preventDefault(),M.stopImmediatePropagation(),M.stopPropagation(),_t(()=>{var L;(L=a.value)==null||L.focus(),setTimeout(()=>{c.value=!1},100)})},y=M=>{i.disabled||i.readOnly||(r("focus",M),i.selectOnFocus&&_t(()=>{M.target.select()}))},b=M=>{if(c.value)return;const L=M.target.value;i.autoEmit||r("update:modelValue",L),u.value!==L&&(r("change",L),u.value=L),r("blur",L,M)},S=M=>{const L=M.target.value;r("enter",L,M),r("enterValue",L),i.submitOnEnter&&(M.preventDefault(),i.autoEmit||r("update:modelValue",L),u.value!==L&&(r("change",L),u.value=L))},C=M=>{const Y=M.target,L=Y.value;if(r("escape",L,M),M.preventDefault(),M.stopImmediatePropagation(),M.stopPropagation(),i.autoEmit){r("cancel"),i.blurOnEscape&&Y.blur();return}l.value=i.modelValue||"",a.value&&(a.value.value=l.value),r("cancel"),i.blurOnEscape&&Y.blur()},E=M=>{const L=M.target.value;r("tab",L,M),i.autoEmit||(r("update:modelValue",L),u.value!==L&&(r("change",L),u.value=L))},_=M=>{if(r("keydown",M),i.type==="number"&&(M.key==="e"||M.key==="E")){M.preventDefault();return}M.key==="Escape"?C(M):M.key==="Enter"?S(M):M.key==="Tab"?E(M):(M.key==="ArrowUp"||M.key==="ArrowDown")&&i.type==="number"&&M.preventDefault()},x=M=>{r("keyup",M)},A=M=>{if(i.disabled||i.readOnly){M.preventDefault();return}r("paste",M)},k=M=>{if(i.disabled||i.readOnly){M.preventDefault();return}r("cut",M)},T=M=>{r("select",M)},D=`input-text-${Math.random().toString(36).substr(2,9)}`,F=B(!1),P=Z(()=>{switch(i.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});Je(()=>l.value,M=>{i.validatorFnc?F.value=!!M&&!i.validatorFnc(M):F.value=!1});const $=B(null),ne=Z(()=>({disabled:i.disabled,readOnly:i.readOnly,error:F.value,inputRef:a,clickable:!i.disabled&&!i.readOnly,focused:i.focused,wrapperRef:$,bordered:!0})),{argsMain:U,isHover:q,isFocus:Q}=vo(ne);t({triggerFocus:()=>{_t(()=>{var M;(M=a.value)==null||M.focus()})},focus:()=>{X()},blur:()=>{_t(()=>{var M;(M=a.value)==null||M.blur()})},select:()=>{_t(()=>{var M;(M=a.value)==null||M.select()})},setSelectionRange:(M,Y)=>{_t(()=>{var L;(L=a.value)==null||L.setSelectionRange(M,Y)})},getValue:()=>l.value,setValue:M=>{l.value=f(M),a.value&&(a.value.value=l.value)}});const X=()=>{!i.disabled&&!i.readOnly&&_t(()=>{var M;(M=a.value)==null||M.focus()})},he=Z(()=>Q.value&&d.value);return(M,Y)=>(j(),ae("div",{class:J([M.$style["input-wrapper"],"input-editor"]),onClick:X},[Ue((j(),ze(yo,qt(H(U),{ref_key:"wrapperRef",ref:$,class:[M.$style["input-box"],{[M.$style["is-hovered"]]:H(q),[M.$style["is-focused"]]:H(Q),[M.$style["has-input"]]:d.value,[M.$style["is-editting"]]:he.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:i.bordered}),{prefix:pe(()=>[Pt(M.$slots,"prefix")]),suffix:pe(()=>[d.value&&!i.disabled&&!i.readOnly?Pt(M.$slots,"clear",{key:0},()=>[Ue((j(),ze(ct,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:Tt(v,["prevent","stop"]),size:18,rounded:!0,class:J(["wrapper-suffix",M.$style["clear-button"]])},{default:pe(()=>[ce(rt,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[H(s),{content:"Clear",contentClass:"extra-padding"}]])]):Pt(M.$slots,"suffix",{key:1})]),default:pe(()=>[ge("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:i.type||"text",value:l.value,placeholder:e.placeholder,class:J([M.$style["column-config__input"]]),id:D,disabled:e.disabled,readonly:e.readOnly,inputmode:P.value,maxlength:i.maxLength,onInput:g,onFocus:y,onBlur:b,onKeydown:_,onKeyup:x,onPaste:A,onCut:k,onSelect:T},null,42,pY)]),_:3},16,["class","bordered"])),[[H(o),i.focusIndex]]),F.value?Pt(M.$slots,"error",{key:0}):Ze("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_1eozu_1","is-disabled":"_is-disabled_1eozu_15","is-readonly":"_is-readonly_1eozu_15","is-hovered":"_is-hovered_1eozu_15","is-focused":"_is-focused_1eozu_19","column-config__input":"_column-config__input_1eozu_39","clear-button":"_clear-button_1eozu_54"}}]]),gY={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},Qb=it({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search"},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{default:void 0}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=B(null),r=Di(c=>{s("update:modelValue",c),s("search",c)},sr),a=()=>{s("update:modelValue",""),s("clear"),_t(()=>{var c;(c=i.value)==null||c.focus()})},l=B(o.modelValue);return t({focus:()=>{var c;(c=i.value)==null||c.focus()},setValue(c){l.value=c}}),(c,u)=>(j(),ze(Jb,{focusIndex:o.focusIndex,ref_key:"searchInput",ref:i,modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:H(r),onClear:a,onCancel:u[1]||(u[1]=d=>s("cancel")),"auto-emit":!0},{prefix:pe(()=>[ge("div",gY,[ce(rt,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),mY=["aria-activedescendant"],vY=["innerHTML"],yY=10,Jr=St(it({__name:"SearchList",props:{options:{default:()=>[]},selectedId:{},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},error:{default:null},params:{},maxHeight:{default:"282px"},width:{default:"200px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const o=Yt,s={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},i=e,r=n,a=B(""),l=B(-1),c=B(null),u=B(null),d=B(new Map),h=Z(()=>gb(a.value)),f=()=>{const M=h.value;if(!M||M.length<i.minQueryLength)return i.options;if(d.value.has(M))return d.value.get(M);const Y=i.options.map(L=>({item:L,score:m7(` ${L.label} `,M)})).filter(({score:L})=>L>0).sort((L,se)=>se.score-L.score).map(({item:L})=>L);return d.value.set(M,Y),Y},p=B([]);Je(()=>i.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=Z(()=>i.hasMore&&!i.loading&&!i.loadingMore),v=Di(M=>{a.value=M,l.value=-1,r("search",M)},sr),y=async M=>{X.value=0,await v(M||""),X.value=1},b=M=>a.value?v7(M,a.value):M,S=M=>{const L={[s.ARROW_DOWN]:()=>C(M),[s.ARROW_UP]:()=>E(M),[s.ENTER]:()=>A(M),[s.ESCAPE]:()=>k(M),[s.TAB]:()=>T(M)}[M.key];L&&L()},C=M=>{M.preventDefault(),_(1)},E=M=>{M.preventDefault(),_(-1)},_=M=>{const Y=p.value.length;if(Y===0)return;let L;M>0?L=(l.value+1)%Y:l.value>0?L=l.value-1:L=Y-1,l.value=L,x()},x=()=>{_t(()=>{var Y;const M=(Y=u.value)==null?void 0:Y.querySelectorAll('[role="menuitem"]')[l.value];M==null||M.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},A=M=>{if(M.preventDefault(),l.value>=0&&l.value<p.value.length){const L=p.value[l.value];D(L,M)}},k=M=>{M.preventDefault(),P()},T=M=>{r("tab",M)},D=(M,Y)=>{!M||M.disabled||(r("select",M,Y),l.value=-1,P())},F=M=>{M>=0&&M<p.value.length&&(l.value=M)},P=()=>{r("close")},$=()=>{if(!g.value||!u.value)return;const{scrollTop:M,clientHeight:Y,scrollHeight:L}=u.value;L-(M+Y)<=yY&&r("loadMore")},ne=()=>{var M,Y,L;(M=u.value)==null||M.addEventListener("scroll",$),(L=(Y=Q.value)==null?void 0:Y.$el)==null||L.addEventListener("keydown",S)},U=()=>{var M,Y,L;(M=u.value)==null||M.removeEventListener("scroll",$),(L=(Y=Q.value)==null?void 0:Y.$el)==null||L.removeEventListener("keydown",S)};Xt(()=>{ne()}),lo(()=>{U()}),Je(()=>i.loading,M=>{!M&&p.value.length>0&&(l.value=-1)});const q=M=>M?Array.isArray(i.selectedId)?i.selectedId.includes(String(M.id)):i.selectedId==M.id:!1,Q=B(null);Je(l,()=>{x()}),t({focus:()=>{_t(()=>{var M;(M=Q.value)==null||M.focus()})},reset:()=>{var M;(M=Q.value)==null||M.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:P,clearSearch:()=>{a.value=""},scrollTo:M=>{u.value&&(u.value.scrollTop=M)},selectIndex:M=>{M>=0&&M<p.value.length&&(l.value=M,x())}});const X=B(0);Je([()=>i.loading,()=>a.value,()=>i.options,()=>i.loadingMore],()=>{const M=i.options.length>0&&p.value.length>0,Y=!M&&a.value.length>0,L=!M&&a.value.length===0;i.loading?X.value=0:M?X.value=1:Y?X.value=2:L&&(X.value=3)},{immediate:!0,deep:!0});const he=()=>{r("cancel")};return(M,Y)=>(j(),ae("datalist",{ref_key:"searchListRef",ref:c,class:J([M.$style["search-list"],X.value===3||X.value===2?M.$style.empty:"",p.value.length>8?M.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:cn({width:e.width})},[ce(Qb,{ref_key:"searchBoxRef",ref:Q,modelValue:a.value,"onUpdate:modelValue":Y[0]||(Y[0]=L=>a.value=L),class:J(M.$style["search-box"]),disabled:e.loading,onSearch:y,onClear:Y[1]||(Y[1]=L=>y("")),onCancel:he},null,8,["modelValue","class","disabled"]),ge("div",{ref_key:"popupRef",ref:u,class:J(M.$style["list-container"]),style:cn({maxHeight:e.maxHeight})},[Pt(M.$slots,"extra-item",{query:a.value}),(j(!0),ae(xt,null,xn(p.value,(L,se)=>Ue((j(),ae("div",{key:`${L.id}-${se}`,role:"menuitem"},[Pt(M.$slots,"item",{item:L,index:se,selectedIndex:l.value,isSelected:q,handleSelect:D,handleItemHover:F,getHighlightedLabel:b,query:a.value,idx:se},()=>[L.hide?Ze("",!0):(j(),ze(ei,qt({key:0,ref_for:!0},L,{hover:se===l.value,selected:q(L),type:L.type,id:`item-${se}`,"aria-selected":se===l.value,onClick:fe=>D(L,fe),onMouseover:fe=>F(se),onEscape:P}),{prefix:pe(()=>[Pt(M.$slots,"prefix-item",{item:L})]),label:pe(()=>[a.value?Ue((j(),ae("span",{key:0,class:J(M.$style.match),innerHTML:b(L.label)},null,10,vY)),[[H(o),{content:L.label}]]):Ue((j(),ae("span",{key:1,class:J(M.$style["item-label"])},[nt(yt(L.label),1)],2)),[[H(o),{content:L.label}]])]),suffix:pe(({hovered:fe})=>[Pt(M.$slots,"action",{item:L,isHovered:se===l.value,hovered:fe,selected:l.value==se})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover"]))])])),[[_i,X.value===1]])),128)),X.value===0?Pt(M.$slots,"loading-more",{key:0},()=>[(j(),ae(xt,null,xn(8,L=>ge("div",{class:J(M.$style["loading-more"]),key:L},[ge("div",{class:J(M.$style["loading-skeleton"])},null,2),ge("div",{class:J(M.$style["loading-skeleton"])},null,2)],2)),64))]):Ze("",!0),X.value===2?(j(),ae("div",{key:1,class:J(M.$style["no-results"])},[Pt(M.$slots,"empty",{query:a.value},()=>[ge("div",{class:J(M.$style["no-results-content"])},[...Y[2]||(Y[2]=[ge("div",null,[nt(" No results. "),ge("br"),nt(" Try another search. ")],-1)])],2)])],2)):Ze("",!0),X.value===3?(j(),ae("div",{key:2,class:J(M.$style["no-results"])},[Pt(M.$slots,"empty-list",{},()=>[ge("div",{class:J(M.$style["no-results-content"])},[...Y[3]||(Y[3]=[ge("div",null,"No items available.",-1)])],2)])],2)):Ze("",!0),Pt(M.$slots,"footer")],6)],14,mY))}}),[["__cssModules",{$style:{"search-list":"_search-list_og79k_1",empty:"_empty_og79k_9",scrollable:"_scrollable_og79k_15","list-container":"_list-container_og79k_22","item-label":"_item-label_og79k_41","loading-state":"_loading-state_og79k_49","loading-more":"_loading-more_og79k_50","loading-skeleton":"_loading-skeleton_og79k_61","is-loading":"_is-loading_og79k_68","no-results":"_no-results_og79k_123","no-results-content":"_no-results-content_og79k_130",title:"_title_og79k_133",tips:"_tips_og79k_139",match:"_match_og79k_153","skeleton-loading":"_skeleton-loading_og79k_1"}}]]),Zl=it({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=ez,n=e,o=B(n.appendTo||void 0),s=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:o.value}),i=B(s());Je(()=>n,()=>{setTimeout(()=>{_t(()=>{o.value=n.appendTo||void 0,i.value=s()})},50)},{immediate:!0,deep:!0});const r=Z(()=>({id:n.user.id,name:n.user.name,profile_image:n.user.profile_image,color:n.user.color,initial:n.user.initial}));return(a,l)=>Ue((j(),ze(Sh,nR(Pw(r.value)),null,16)),[[H(t),i.value]])}}),wY=["innerHTML"],CY=20,VA=St(it({__name:"AssigneeGroupEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{}},emits:["updated","cancel","start-update","update-failed","update-completed"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,{id:i}=Lp(s),r=n,a=L=>{var fe,Le;const se=(Le=(fe=s.params)==null?void 0:fe.api)==null?void 0:Le.getRowNode(String(i.value));se==null||se.setDataValue("assignees",Nx(L.assignees)),r("updated",L),r("update-completed")},l=B(!1),c=B(!1),u=B(null),d=B(1),h=B(!0),f=B(0),p=B(""),g=En("bulkUpdate",B(!1)),v=En("isSelectAll",B(!1)),{isSubmitting:y,unAssignAll:b,replaceAssignees:S,handleSelect:C,assigneeList:E,mergedOptions:_,selectedUserIds:x}=um({...s,entityId:s.entityId,updateRowData:a,value:s.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{r("update-failed")}}),{apiServices:A}=Qn(!g.value,s),k=En("workspaceId"),T=async(L=1,se="",fe=!1)=>{var Le,Me,Ke,z,ue;if(!A.value||!s.id&&!s.ids)throw console.error("API service or item identifiers are undefined",A.value,s.id,s.ids),new Error("API service or item identifiers are undefined");if(fe?c.value=!0:l.value=!0,u.value=null,!((Le=A.value)!=null&&Le.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");try{const re=await((Me=A.value)==null?void 0:Me.multipleAssignableUser({workspaceId:String(k),itemIds:(s.ids??(s.id?[s.id]:[])).map(String),page:L,perPage:CY,q:se.trim()})),Fe=((Ke=mu(re.data))==null?void 0:Ke.map(cm))??[];E.value=fe?nu(E.value,Fe,"id"):Fe,f.value=re.meta.total,h.value=(((z=re==null?void 0:re.meta)==null?void 0:z.current_page)||0)<(((ue=re==null?void 0:re.meta)==null?void 0:ue.last_page)||0),d.value=L}catch(re){console.error("Error fetching assignable users:",re),u.value="Failed to load assignable users"}finally{l.value=!1,c.value=!1}},D=()=>{!c.value&&h.value&&T(d.value+1,p.value,!0)},F=Di(async L=>{p.value=L,await T(1,L,!1)},sr),P=()=>T(1,p.value,!1);Xt(()=>{var L;(L=ne.value)==null||L.focus()}),t({getValue:()=>{var L;return(L=_.value.find(se=>se.selected))==null?void 0:L.value},refresh:P,clearInternal:()=>{x.value=[]},focus:()=>{var L;(L=ne.value)==null||L.focus()}});const $=()=>{const L=Cn.getInstance().getItem("BASE_URL"),se=Lo({type:"access_setting",config:{baseDomain:L,ws_code:s.workspaceId,entity_id:k}}).url;window.open(se,"_blank")},ne=B(null);Xt(()=>{_t(()=>{var L;(L=ne.value)==null||L.focus()})}),Je([()=>s.id,()=>s.workspaceId,()=>s.ids],()=>{T()},{deep:!0,immediate:!0});const U=L=>{var fe;const se=Cn.getInstance().getItem("ws.code");return((fe=A.value)==null?void 0:fe.getUserInformation(se,L))||Promise.resolve(null)},q=async L=>{try{r("start-update");const se=await C(L);r("update-completed")}catch(se){r("update-failed"),console.error("Error updating assignees:",se)}},Q=async()=>{try{r("start-update");const L=await b();r("update-completed")}catch(L){r("update-failed"),console.error("Error unassigning all assignees:",L)}},X=async L=>{try{r("start-update");const se=await S(L);r("update-completed")}catch(se){r("update-failed"),console.error("Error replacing assignees:",se)}},he=()=>{var L,se;r("cancel"),(se=(L=s.params)==null?void 0:L.api)==null||se.stopEditing()};qi("popupAttachRef",ne);const M=B(),Y=B(!1);return Xt(()=>{_t(()=>{setTimeout(()=>{Y.value=!0},50)})}),(L,se)=>(j(),ae("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:M},[ce(Jr,qt({"selected-id":H(x)},{...s},{options:H(_),loading:l.value,ref_key:"popupRef",ref:ne,"loading-more":c.value,"has-more":h.value,onSelect:se[0]||(se[0]=fe=>{q(fe)}),"data-wrapper":"true",onSearch:H(F),onLoadMore:D,onCancel:he,onClose:he}),Yd({"extra-item":pe(()=>[ce(ct,{variant:"menu-item",onHandleClick:Q},{prefix:pe(()=>[ge("div",{class:J(L.$style["unassign-icon"])},[ce(rt,{src:"UserXMark",source:"remote"})],2)]),default:pe(()=>[se[1]||(se[1]=nt(" Unassign all ",-1))]),_:1})]),item:pe(({item:fe,selectedIndex:Le,isSelected:Me,handleItemHover:Ke,getHighlightedLabel:z,query:ue,idx:re})=>[ce(ei,qt(fe,{hover:re===Le,selected:Me(fe),type:fe.type,onClick:Tt(Fe=>q(fe),["stop","prevent"]),onMouseover:Fe=>Ke(re),class:L.$style["item-assignee"]}),{prefix:pe(()=>[Y.value?(j(),ze(Zl,{key:1,user:fe.data,"show-profile":!0,apiUpdateFunction:U,appendTo:M.value},null,8,["user","appendTo"])):(j(),ae("div",{key:0,class:J(L.$style["skeleton-avatar"])},null,2))]),label:pe(({selected:Fe})=>[ue?Ue((j(),ae("span",{key:0,class:J([L.$style["item-label"],L.$style.match]),style:{flex:"1"},innerHTML:z(fe.label)},null,10,wY)),[[H(o),{content:fe.label}]]):Ue((j(),ae("span",{key:1,class:J(L.$style["item-label"]),style:{flex:"1"}},[nt(yt(fe.label),1)],2)),[[H(o),{content:fe.label}]]),ge("div",{class:J(L.$style["item-action"])},[Ue((j(),ze(ct,{variant:["icon","tertiary"],size:24,highlightOnHover:!0,disabled:H(y),onClick:Tt(G=>q(fe),["stop","prevent"])},{prefix:pe(()=>[ce(rt,{src:Fe?"UserMinus":"UserPlus",source:"remote"},null,8,["src"])]),_:2},1032,["disabled","onClick"])),[[H(o),Fe?"Unassign":"Assign"]]),Ue((j(),ze(ct,{variant:["icon","tertiary"],size:24,highlightOnHover:!0,disabled:H(y),onClick:Tt(G=>{var ee;return X((ee=fe.data)==null?void 0:ee.id)},["stop","prevent"])},{prefix:pe(()=>[ce(rt,{src:"IdCardClip",source:"remote"})]),_:1},8,["disabled","onClick"])),[[H(o),"Unassign others and reassign"]])],2)]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),"empty-list":pe(()=>[ge("div",{class:J(L.$style["empty-state"])},[se[4]||(se[4]=nt(" No assignee available. ",-1)),se[5]||(se[5]=ge("br",null,null,-1)),ce(ct,{onClick:$,variant:["tertiary"],size:"small"},{default:pe(()=>[...se[3]||(se[3]=[nt(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[u.value?{name:"error",fn:pe(()=>[ge("div",{class:J(L.$style["error-message"])},[nt(yt(u.value)+" ",1),ce(ct,{onClick:P,size:"small"},{default:pe(()=>[...se[2]||(se[2]=[nt(" Retry ",-1)])]),_:1})],2)]),key:"0"}:void 0]),1040,["selected-id","options","loading","loading-more","has-more","onSearch"])],512))}}),[["__cssModules",{$style:{action:"_action_zb1un_1","item-assignee":"_item-assignee_zb1un_6","item-action":"_item-action_zb1un_6","item-label":"_item-label_zb1un_16","unassign-icon":"_unassign-icon_zb1un_25","error-message":"_error-message_zb1un_36","empty-state":"_empty-state_zb1un_46","skeleton-avatar":"_skeleton-avatar_zb1un_59"}}]]),bY=it({__name:"AssignneeUpdateButton",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},variant:{}},emits:["update"],setup(e,{emit:t}){const n=e;qi("bulkUpdate",!0);const o=t,s=B(null),i=f=>{var p;h.value=!1,o("update",f),(p=s.value)==null||p.clearInternal()},{triggerRef:r,popupRef:a,hide:l,isVisible:c}=eo({zIndex:2}),u=B(null),d=f=>{f.key==="Escape"&&a.value&&l()};Xt(()=>{var p;const f=u.value instanceof HTMLElement?u.value:(p=u.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",d)}),lo(()=>{var p;const f=u.value instanceof HTMLElement?u.value:(p=u.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",d)}),Je(c,f=>{var p,g;f?(p=s.value)==null||p.focus():(g=s.value)==null||g.clearInternal()});const h=B(!1);return(f,p)=>(j(),ae("div",{ref_key:"mainRef",ref:u},[ge("div",{ref_key:"triggerRef",ref:r},[ce(ct,{class:"action-button",variant:n.variant,loading:h.value},{default:pe(()=>[ce(rt,{src:"UserPlus",class:"icon"}),p[3]||(p[3]=nt(" Assignee ",-1))]),_:1},8,["variant","loading"])],512),ge("div",{ref_key:"popupRef",ref:a,style:{display:"none"}},[H(c)?(j(),ze(VA,qt({key:0,ref_key:"assigneeGroupEditorRef",ref:s},n,{ids:e.ids,onUpdated:i,onStartUpdate:p[0]||(p[0]=g=>h.value=!0),onUpdateFailed:p[1]||(p[1]=g=>h.value=!1),onUpdateCompleted:p[2]||(p[2]=g=>h.value=!1)}),null,16,["ids"])):Ze("",!0)],512)],512))}}),Xh=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],SY=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),Ha=(e,t)=>{const n=o=>{var s,i;if(o.key==="Tab"){const r=o.shiftKey||o.metaKey;o.preventDefault(),o.stopImmediatePropagation(),o.stopPropagation();const a=document.activeElement,l=(s=a==null?void 0:a.dataset)==null?void 0:s.index;if(l){let c=Xh.indexOf(l);const u=r?-1:1;for(const d of Xh){c=(c+u+Xh.length)%Xh.length;const h=Xh[c],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(o.key==="Enter")(i=o.target)==null||i.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(o.key==="Escape"){o.stopPropagation(),o.stopImmediatePropagation();const r=document.querySelector('[data-index="calendar-wrapper"]');r==null||r.focus()}};if(SY.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},EY=["aria-label"],_Y=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],RY={style:{flex:"1"}},DY=St(it({__name:"MainCalendar",props:sD({year:{},month:{},startDate:{},endDate:{},timezone:{default:"UTC"},activeField:{default:"start"},requireConfirm:{type:Boolean,default:!1},locale:{default:"en-US"},weekdayLabelStyle:{default:"narrow"},weekStart:{default:0},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Confirm"},immediatelyUpdate:{type:Boolean,default:!1},disabled:{type:Boolean},readOnly:{type:Boolean},disableConfirm:{type:Boolean,default:!1}},{tracingCase:{default:()=>({case:"",behavior:""})},tracingCaseModifiers:{}}),emits:sD(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{expose:t,emit:n}){const o=Yt,s=B(null),i=e,r=Z(()=>i.startDate&&i.endDate),a=LH(e,"tracingCase"),l=n,c=B(i.year),u=B(i.month);Je(()=>[i.year,i.month],([Y,L])=>{c.value=Y,u.value=L});const d=Z(()=>mt.fromObject({year:c.value,month:u.value,day:1},{zone:i.timezone}).setLocale(i.locale||"en-US").toFormat("LLLL yyyy")),h=Z(()=>mt.now().setZone(i.timezone)),f=Z(()=>i.startDate?mt.fromJSDate(i.startDate,{zone:i.timezone}):null),p=Z(()=>i.endDate?mt.fromJSDate(i.endDate,{zone:i.timezone}):null),g=B(f.value),v=B(p.value),y=B(f.value),b=B(p.value);Je([f,p],()=>{i.requireConfirm||(g.value=f.value,v.value=p.value,y.value=f.value,b.value=p.value)},{immediate:!0});const S=Z(()=>i.requireConfirm?g.value:f.value),C=Z(()=>i.requireConfirm?v.value:p.value);Je(()=>i.activeField,Y=>{const L=Y==="start"?S.value:C.value;L&&(c.value=L.year,u.value=L.month)}),Je(()=>{var Y,L;return[(Y=S.value)==null?void 0:Y.toISODate(),(L=C.value)==null?void 0:L.toISODate(),i.activeField]},()=>{const Y=i.activeField==="start"?S.value:C.value;Y&&(Y.year!==c.value||Y.month!==u.value)&&(c.value=Y.year,u.value=Y.month)});function E(Y){return Y.setZone("utc")}const _=B("");function x(Y){_.value=Y.toISODate()||"",_t(()=>{const L=document.querySelector(`.arbo-calendar-day[data-date="${_.value}"]`);L==null||L.focus()})}Je(()=>{var Y,L;return[c.value,u.value,i.activeField,(Y=S.value)==null?void 0:Y.toISODate(),(L=C.value)==null?void 0:L.toISODate()]},()=>{const Y=i.activeField==="start"?S.value:C.value;let L;Y&&Y.year===c.value&&Y.month===u.value?L=Y:S.value&&S.value.year===c.value&&S.value.month===u.value?L=S.value:L=h.value,x(L)});function A(Y){return Y.toFormat("d")}const k=Z(()=>{const Y=mt.fromObject({year:c.value,month:u.value,day:1},{zone:i.timezone}),L=Y.weekday,se=i.weekStart===1?(L+6)%7:L%7;let fe=Y.minus({days:se});const Le=[],Me=pu.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"}),Ke=dg();for(let ue=0;ue<42;ue++){const re=[];fe.month!==u.value&&re.push(Ke["is-outside"]),fe.hasSame(h.value,"day")&&re.push(Ke["is-today"]),S.value&&fe.hasSame(S.value,"day")&&re.push(Ke["is-selected-start"]),C.value&&fe.hasSame(C.value,"day")&&re.push(Ke["is-selected-end"]),S.value&&C.value&&fe>S.value&&fe<C.value&&re.push(Ke["is-in-range"]);const Fe=A(fe),G=Me[fe.weekday-1]||"";Le.push({dt:fe,iso:fe.toISODate()||"",label:fe.toFormat("d"),displayLabel:Fe,weekdayLabel:G,aria:fe.setLocale(i.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:re}),fe=fe.plus({days:1})}const z=[];for(let ue=0;ue<6;ue++)z.push(Le.slice(ue*7,ue*7+7));return z}),T=Z(()=>{const Y=pu.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"});return i.weekStart===1?Y:[Y[6],...Y.slice(0,6)]});function D(Y,L,se){const fe=Y==="start"?L.startOf("day"):L.endOf("day"),Le=E(fe),Me={year:fe.year,month:fe.month,day:fe.day,utc:Le.toISO()||""};Y==="start"?(l("select-start",Me,se??!0),l("select-start-utc",Me.utc)):(l("select-end",Me),l("select-end-utc",Me.utc))}function F(Y){let L=c.value,se=u.value+Y;for(;se<1;)se+=12,L-=1;for(;se>12;)se-=12,L+=1;c.value=L,u.value=se,l("update:year",L),l("update:month",se)}function P(Y){const se=(_.value?mt.fromISO(_.value,{zone:i.timezone}):h.value).plus({days:Y});se.month===u.value&&se.year===c.value&&x(se)}function $(Y=!1){const se=(_.value?mt.fromISO(_.value,{zone:i.timezone}):h.value).weekday%7,fe=Y?6-se:-se;P(fe)}const ne=Y=>{U(Y)};function U(Y){switch(Y.preventDefault(),Y.stopPropagation(),Y.key){case"ArrowLeft":Y.preventDefault(),P(-1);break;case"ArrowRight":Y.preventDefault(),P(1);break;case"ArrowUp":Y.preventDefault(),P(-7);break;case"ArrowDown":Y.preventDefault(),P(7);break;case"Home":Y.preventDefault(),$(!1);break;case"End":Y.preventDefault(),$(!0);break;case"PageUp":Y.preventDefault(),F(Y.shiftKey?-12:-1);break;case"PageDown":Y.preventDefault(),F(Y.shiftKey?12:1);break;case"Enter":case" ":{Y.preventDefault();const L=_.value?mt.fromISO(_.value,{zone:i.timezone}):h.value,se=k.value.flat().find(fe=>fe.iso===L.toISODate());se&&Q(se);break}}}const q=Y=>{const L=mt.now().setZone(i.timezone);c.value=L.year,u.value=L.month,l("update:year",L.year),l("update:month",L.month),x(L),l("gotoToday")};function Q(Y){var Ce,Pe;const L=!!f.value,se=!!p.value,fe=i.activeField,Le=((Ce=f.value)==null?void 0:Ce.toISODate())||"null",Me=((Pe=p.value)==null?void 0:Pe.toISODate())||"null",Ke=Y.dt.toISODate()||"",z=(xe,O)=>{a.value={case:xe,behavior:O}},ue=()=>`Selected start ${Ke} > existing end ${Me} -> reset both to ${Ke}`,re=()=>`Selected end ${Ke} < existing start ${Le} -> reset both to ${Ke}`,Fe=()=>{D("start",Y.dt,!0),D("end",Y.dt),l("update:activeField","end")},G=(xe=!1)=>{D("start",Y.dt,xe),xe&&l("update:activeField","end")},ee=(xe=!1)=>{D("end",Y.dt),xe&&l("close")};if(L&&se){fe==="start"?p.value&&Y.dt>p.value?(Fe(),z("INVERT_RANGE_FROM_START",ue())):(G(!1),z("UPDATE_START_IN_RANGE",`Updated start from ${Le} to ${Ke}; end remains ${Me}`)):f.value&&Y.dt<f.value?(Fe(),z("INVERT_RANGE_FROM_END",re())):(ee(!1),z("UPDATE_END_IN_RANGE",`Updated end from ${Me} to ${Ke}; start remains ${Le}`));return}if(!L&&se&&fe==="start"&&p.value&&Y.dt>p.value){Fe(),z("CREATE_RANGE_FROM_LATE_START",ue());return}if(L&&!se&&fe==="end"&&f.value&&Y.dt<f.value){Fe(),z("CREATE_RANGE_FROM_EARLY_END",re());return}if(!L&&!se){if(fe==="start"){G(!0),z("INIT_START",`Picked start ${Ke}; awaiting end selection`);return}ee(i.immediatelyUpdate),z("INIT_END",`Picked end ${Ke}; awaiting start selection`);return}if(!L&&se){if(fe==="start"){G(!0),z("FILL_MISSING_START",`Inserted start ${Ke}; existing end ${Me}`);return}ee(!1),z("STRICT_UPDATE_END_ONLY",`Updated end to ${Ke}; start still null`);return}if(L&&!se){if(fe==="start"){G(!0),z("RESELECT_START_BEFORE_END",`Replaced start with ${Ke}; end still null, switching to end`);return}ee(i.immediatelyUpdate),z("FILL_MISSING_END",`Picked end ${Ke}; start ${Le}`);return}}function X(){y.value=g.value,b.value=v.value,l("confirm")}function he(){g.value=y.value,v.value=b.value,l("cancel")}function M(){_t(()=>{var Y;(Y=s.value)==null||Y.focus()})}return Xt(()=>{M()}),t({focus:M}),(Y,L)=>(j(),ae("div",{ref_key:"calendarRef",ref:s,class:J([Y.$style["arbo-calendar"],{[Y.$style["arbo-date-range-picker"]]:r.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[ge("div",{class:J([Y.$style["arbo-calendar-header"],Y.$style["arbo-calendar-week"]]),role:"row"},[(j(!0),ae(xt,null,xn(T.value,se=>(j(),ae("div",{key:se,class:J(Y.$style["arbo-calendar-weekday"]),role:"columnheader"},yt(se),3))),128))],2),ge("div",{class:J(Y.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:L[0]||(L[0]=Tt(se=>H(Ha)(se,ne),["prevent","stop"]))},[(j(!0),ae(xt,null,xn(k.value,(se,fe)=>(j(),ae("div",{key:fe,class:J(Y.$style["arbo-calendar-week"])},[(j(!0),ae(xt,null,xn(se,Le=>(j(),ae("div",{key:Le.iso,class:J([Y.$style["arbo-calendar-day"],Le.classes,{[Y.$style["is-focused"]]:Le.iso===_.value}]),disabled:i.disabled,readOnly:i.readOnly,"aria-label":Le.aria,"data-date":Le.iso,"data-weekday":Le.weekdayLabel,tabindex:Le.iso===_.value?0:-1,onClick:Me=>Q(Le)},yt(Le.displayLabel),11,_Y))),128))],2))),128))],34),i.readOnly?Ze("",!0):(j(),ae("div",{key:0,class:J(Y.$style["arbo-calendar-actions"])},[ge("div",RY,[Ue((j(),ze(ct,{variant:"secondary",size:"medium",onClick:L[1]||(L[1]=se=>q()),onKeydown:H(Ha),"data-index":"today-btn"},{prefix:pe(()=>[ce(rt,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[H(o),"Today"]])]),ce(ct,{disabled:i.disabled,readOnly:i.readOnly,onKeydown:H(Ha),variant:"secondary",size:"medium",onClick:he,"data-index":"cancel-btn"},{default:pe(()=>[nt(yt(i.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),ce(ct,{disabled:i.disabled||i.disableConfirm,readOnly:i.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:H(Ha),onClick:X},{default:pe(()=>[nt(yt(i.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,EY))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_1a7wo_1","arbo-calendar-day":"_arbo-calendar-day_1a7wo_2","arbo-calendar-week":"_arbo-calendar-week_1a7wo_3","arbo-calendar":"_arbo-calendar_1a7wo_2","arbo-calendar-nav":"_arbo-calendar-nav_1a7wo_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_1a7wo_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_1a7wo_53","arbo-calendar-weekday":"_arbo-calendar-weekday_1a7wo_58","arbo-calendar-weeks":"_arbo-calendar-weeks_1a7wo_63","is-today":"_is-today_1a7wo_92","is-selected-start":"_is-selected-start_1a7wo_97","is-selected-end":"_is-selected-end_1a7wo_105","is-outside":"_is-outside_1a7wo_125","is-focused":"_is-focused_1a7wo_128","is-in-range":"_is-in-range_1a7wo_133","arbo-calendar-actions":"_arbo-calendar-actions_1a7wo_139","arbo-calendar-btn":"_arbo-calendar-btn_1a7wo_147",cancel:"_cancel_1a7wo_156",confirm:"_confirm_1a7wo_161"}}]]),TY=["onClick"],xY=["variant","onClick"],FY=St(it({__name:"CalendarNavigationControl",props:{year:{},month:{},minYear:{default:1970},maxYear:{default:2100},yearSpan:{default:12},monthLabels:{},locale:{default:"en-US"},monthLabelStyle:{default:"short"},ariaPrevLabel:{default:"Previous"},ariaNextLabel:{default:"Next"},ariaToolbarLabel:{default:"Calendar navigation"},ariaSelectYearLabel:{default:"Select year"},ariaSelectMonthLabel:{default:"Select month"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["update:year","update:month","mode-change","year-selected","month-selected"],setup(e,{expose:t,emit:n}){const o=e,s=Z(()=>{if(o.monthLabels&&o.monthLabels.length===12)return o.monthLabels;const P=o.locale||"en-US",$=o.monthLabelStyle||"short",ne=new Intl.DateTimeFormat(P,{month:$,timeZone:"UTC"});return Array.from({length:12},(q,Q)=>ne.format(new Date(Date.UTC(2020,Q,1))))}),i=n,r=B(o.year),a=B(o.month),l=B(o.year);Je(()=>o.year,P=>{P!==r.value&&(r.value=P,l.value=P)}),Je(()=>o.month,P=>{P!==a.value&&(a.value=P)});const c=B("days");function u(P){c.value!==P&&(c.value=P,i("mode-change",P))}const d=Z(()=>o.minYear),h=Z(()=>o.maxYear),f=Z(()=>{const P=o.yearSpan;return l.value-l.value%P}),p=Z(()=>f.value+o.yearSpan-1);function g(){const P=o.yearSpan,$=f.value-P;$>=d.value&&(l.value=$)}function v(){const P=o.yearSpan,$=f.value+P;$<=h.value&&(l.value=$)}const y=Z(()=>f.value-o.yearSpan<d.value),b=Z(()=>p.value+o.yearSpan>h.value),S=Z(()=>{const P=o.yearSpan;return Math.ceil(P/3)});function C(P){const ne=f.value+(P-1)*3;return Array.from({length:3},(U,q)=>ne+q).filter(U=>U<=p.value)}function E(){c.value==="months"?u("days"):u("months")}function _(){c.value==="years"?u("days"):u("years")}function x(P){r.value=P,l.value=P,i("update:year",P),i("year-selected",P),u("months")}function A(P){a.value=P,i("update:month",P),i("month-selected",P),u("days")}function k(){if(c.value==="days"){let P=r.value,$=a.value-1;if($<1&&($=12,P--),P<d.value)return;r.value=P,a.value=$,i("update:year",P),i("update:month",$)}else if(c.value==="months"){if(r.value-1<d.value)return;r.value--,i("update:year",r.value)}else c.value==="years"&&g()}function T(){if(c.value==="days"){let P=r.value,$=a.value+1;if($>12&&($=1,P++),P>h.value)return;r.value=P,a.value=$,i("update:year",P),i("update:month",$)}else if(c.value==="months"){if(r.value+1>h.value)return;r.value++,i("update:year",r.value)}else c.value==="years"&&v()}const D=Z(()=>c.value==="days"?r.value===d.value&&a.value===1:c.value==="months"?r.value-1<d.value:y.value),F=Z(()=>c.value==="days"?r.value===h.value&&a.value===12:c.value==="months"?r.value+1>h.value:b.value);return t({setNavigation:(P,$)=>{r.value=P,a.value=$}}),(P,$)=>(j(),ae("div",{class:J([P.$style["cal-nav-wrapper"]])},[Pt(P.$slots,"selection"),c.value==="days"?(j(),ae("div",{key:0,class:J(P.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[ce(ct,{variant:"tertiary",class:J([P.$style["cal-nav-btn"],P.$style.prev]),"aria-label":"Previous",disabled:D.value,label:"",onClick:k,"data-index":"prev-btn",onKeydownCapture:Bn(Tt(k,["prevent","stop"]),["enter"]),onKeydown:H(Ha)},{default:pe(({hovered:ne})=>[ce(rt,{src:"AnglesRight",source:"remote",color:ne?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),ge("div",{class:J(P.$style["cal-nav-center"])},[ce(ct,{"data-index":"month-btn",variant:"secondary",onClick:E,onKeydown:H(Ha)},{default:pe(()=>[nt(yt(s.value[a.value-1]),1)]),_:1},8,["onKeydown"]),ce(ct,{variant:"secondary",onClick:_,"data-index":"year-btn",onKeydown:H(Ha)},{default:pe(()=>[nt(yt(r.value),1)]),_:1},8,["onKeydown"])],2),ce(ct,{"data-index":"next-btn",variant:"tertiary",class:J([P.$style["cal-nav-btn"],P.$style.next]),"aria-label":"Next",disabled:F.value,label:"",onClick:T,onKeydownCapture:Bn(Tt(T,["prevent","stop"]),["enter"]),onKeydown:H(Ha)},{default:pe(({hovered:ne})=>[ce(rt,{src:"AnglesRight",source:"remote",color:ne?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Ze("",!0),c.value==="years"?(j(),ae("div",{key:1,class:J(P.$style["year-grid"])},[ge("div",{class:J(P.$style["year-grid-header"])},[ce(ct,{variant:"tertiary",class:J([P.$style["cal-nav-btn"],P.$style.prev]),"aria-label":"Next",disabled:y.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:pe(({hovered:ne})=>[ce(rt,{src:"AnglesRight",source:"remote",color:ne?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),ge("div",{class:J(P.$style["range-label"])},yt(f.value)+" - "+yt(p.value),3),ce(ct,{variant:"tertiary",class:J([P.$style["cal-nav-btn"],P.$style.next]),"aria-label":"Next",disabled:b.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:pe(({hovered:ne})=>[ce(rt,{src:"AnglesRight",source:"remote",color:ne?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),ge("div",{class:J(P.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(j(!0),ae(xt,null,xn(S.value,ne=>(j(),ae("div",{key:"yr-row-"+ne,class:J(P.$style["year-grid-row"])},[(j(!0),ae(xt,null,xn(C(ne),U=>(j(),ae("a",{key:U,tabindex:"0",class:J([P.$style["year-cell"],{[P.$style.selected]:U===r.value}]),onClick:q=>x(U)},yt(U),11,TY))),128))],2))),128))],2)],2)):c.value==="months"?(j(),ae("div",{key:2,class:J(P.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[ge("div",{class:J(P.$style.months)},[(j(!0),ae(xt,null,xn(s.value,(ne,U)=>(j(),ae("a",{tabindex:"0",key:ne,variant:U+1===a.value?"primary":"text",class:J([P.$style["month-cell"],{[P.$style.selected]:U+1===a.value}]),onClick:q=>A(U+1)},yt(ne),11,xY))),128))],2)],2)):(j(),ae("div",{key:3,class:J(P.$style["days-slot"])},[Pt(P.$slots,"default",{year:r.value,month:a.value,mode:c.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_unh71_1","cal-nav-bar":"_cal-nav-bar_unh71_12","cal-nav-btn":"_cal-nav-btn_unh71_20",prev:"_prev_unh71_33","year-grid-header":"_year-grid-header_unh71_37","cal-nav-center":"_cal-nav-center_unh71_46","cal-nav-label":"_cal-nav-label_unh71_52","month-grid":"_month-grid_unh71_66","year-grid":"_year-grid_unh71_37",months:"_months_unh71_75","month-cell":"_month-cell_unh71_82","year-cell":"_year-cell_unh71_83","pg-btn":"_pg-btn_unh71_105","year-grid-body":"_year-grid-body_unh71_118","year-grid-row":"_year-grid-row_unh71_125",selected:"_selected_unh71_131","days-slot":"_days-slot_unh71_137","range-label":"_range-label_unh71_141"}}]]);function IY(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:o,maxDate:s}=e,i=B(""),r=Z(()=>{const g=mt.fromFormat(i.value,t,{zone:n});return g.isValid?g:null}),a=Z(()=>{if(!o||!r.value)return!0;const g={year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()},v={year:r.value.year,month:r.value.month,day:r.value.day};return v.year>g.year?!0:v.year<g.year?!1:v.month>g.month?!0:v.month<g.month?!1:l(v,g)>=0}),l=(g,v)=>{const y=new Date(g.year,g.month-1,g.day),b=new Date(v.year,v.month-1,v.day);return y<b?-1:y>b?1:0},c=Z(()=>{if(!s||!r.value)return!0;const g={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate()},v={year:r.value.year,month:r.value.month,day:r.value.day};return v.year<g.year?!0:v.year>g.year?!1:v.month<g.month?!0:v.month>g.month?!1:l(v,g)<=0}),u=Z(()=>i.value.length==0||i.value.length>0&&r.value!==null&&a.value&&c.value),d=Z(()=>i.value.length===t.length&&u.value);return{inputValue:i,isValid:u,isComplete:d,clear:()=>{i.value=""},setDate:g=>{let v;g instanceof Date?v=mt.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?i.value=v.toFormat(t):i.value=""},getDate:()=>u.value?r.value:null}}const PY={key:0,style:{marginLeft:"8px"}},AY=["disabled","readonly","placeholder"],BA=St(it({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear","blur","tab"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,i=n,r=B(null),a=B(null),{isValid:l,isComplete:c,inputValue:u,clear:d,setDate:h,getDate:f}=IY({format:s.format,allowPastDates:s.allowPastDates,allowFutureDates:s.allowFutureDates,timezone:s.timezone,minDate:s.minDate,maxDate:s.maxDate}),p=Z(()=>s.active),g=Z(()=>({disabled:s.disabled,error:!l.value&&u.value.length>0,readOnly:s.readOnly,isEmpty:u.value.length===0,inputRef:r,wrapperRef:a,active:p})),{argsMain:v,isHover:y,isFocus:b}=vo(g),S=A=>{var T;const k=(T=A.clipboardData)==null?void 0:T.getData("text/plain");k&&(u.value=k.trim())},C=A=>{if(A.key==="Escape"){i("blur"),A.target.blur(),A.preventDefault(),A.stopPropagation(),A.stopImmediatePropagation();return}else A.key==="Tab"&&x(A)},E=()=>{d(),i("clear")};t({clear:E,setDate:h,getDate:f,focus:()=>{var A;return(A=r.value)==null?void 0:A.focus()}}),Je(()=>s.modelValue,A=>{A?h(A):d()},{immediate:!0}),Je([()=>c.value,()=>u.value],()=>{if(u.value.length===0)i("complete",null);else if(l.value&&!s.readOnly&&!s.disabled&&c.value){const A=f();(A||u.value.length===0)&&i("complete",A)}}),Je(()=>l.value,A=>{A||i("invalid","")});const _=Z(()=>!!s.isMultipleDate),x=A=>{A.preventDefault(),A.stopImmediatePropagation(),A.stopPropagation(),i("tab",A)};return(A,k)=>(j(),ze(yo,qt(H(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:pe(()=>[ge("div",{class:J([A.$style["date-input-wrapper"]])},[_.value?(j(),ae("span",PY," Multiple ")):Ue((j(),ae("input",{key:1,disabled:s.disabled,readonly:s.readOnly,ref_key:"inputRef",ref:r,type:"text","onUpdate:modelValue":k[0]||(k[0]=T=>pn(u)?u.value=T:null),onPaste:Tt(S,["prevent"]),placeholder:s.placeholder,class:J([A.$style["date-input"]]),onKeydown:C},null,42,AY)),[[C1,H(u)]]),Pt(A.$slots,"clear",{handleClear:E},()=>[(H(u).length>0||_.value)&&!s.readOnly&&!s.disabled&&(H(y)||H(b))?Ue((j(),ze(ct,{key:0,variant:["icon","primary"],onClick:Tt(E,["stop"]),size:16,rounded:!0},{default:pe(()=>[ce(rt,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[H(o),"Clear"]]):(j(),ze(rt,{key:1,src:"Calendar",source:"remote",class:J(A.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_1yset_1","icon-calendar":"_icon-calendar_1yset_9",focus:"_focus_1yset_12",hover:"_hover_1yset_12",active:"_active_1yset_12","date-input":"_date-input_1yset_1",invalid:"_invalid_1yset_38"}}]]),kY=it({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:yb()},format:{default:"LLL dd"},placeholder:{},enableRangeFeedback:{type:Boolean},messages:{},isCompleted:{type:Boolean},isStarted:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{},duePlaceholder:{default:"Due"},startPlaceholder:{default:"Start"},startTooltip:{default:"Select start date"},dueTooltip:{default:"Select due date"},showCalendarIcon:{type:Boolean,default:!0},locale:{default:"en-US"},immediatelyUpdate:{type:Boolean,default:!1},multipleStartDates:{type:Boolean},multipleDueDates:{type:Boolean}},emits:["clearStart","clearDue","clearAll","update","update:start","update:end","range:invalid","range:corrected","tracing","confirmed","closed","start-update","finish-update","tab"],setup(e,{expose:t,emit:n}){const o=B({case:"",behavior:""}),s=e,i=B(null),r=n,a=async(z,ue)=>{r("start-update"),await z(),r("finish-update"),_t(()=>{var re,Fe;ue(),(Fe=(re=s.params)==null?void 0:re.api)==null||Fe.stopEditing()})},l=(z,ue)=>{z(),_t(()=>{var re,Fe;ue(),(Fe=(re=s.params)==null?void 0:re.api)==null||Fe.stopEditing()})},c=()=>{var ue;const z=mt.now().setZone(s.timezone);L.value=z.year,se.value=z.month,(ue=Y.value)==null||ue.setNavigation(z.year,z.month)},u=Cs({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:y,beginInteraction:b,clearStart:S,clearDue:C}=S7(s,r),E=Z(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});Je(()=>s.multipleStartDates,z=>{h.value=!!z},{immediate:!0}),Je(()=>s.multipleDueDates,z=>{f.value=!!z},{immediate:!0});const _=B(null),x=B(null),A=z=>{z.preventDefault(),z.stopImmediatePropagation(),z.stopPropagation(),X()},k=()=>{var z;(z=x.value)==null||z.focus()},T=z=>{if(!z){u.start=!1,S();return}const ue=d.endDate?mt.fromJSDate(d.endDate,{zone:s.timezone}):null;if(ue&&D(z,ue)>0){const Fe={year:z.year,month:z.month,day:z.day};u.start=!1,y(Fe,!1),p(Fe),_t(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const re={year:z.year,month:z.month,day:z.day};u.start=!1,y(re,!0)},D=(z,ue)=>{const re=z.startOf("day"),Fe=ue.startOf("day");return re<Fe?-1:re>Fe?1:0},F=z=>{var ue;z.preventDefault(),z.stopImmediatePropagation(),z.stopPropagation(),(ue=document.querySelector('[data-index="prev-btn"]'))==null||ue.focus()},P=z=>{if(!z){u.end=!1,C();return}const ue=d.startDate?mt.fromJSDate(d.startDate,{zone:s.timezone}):null;if(ue&&D(z,ue)<0){const Fe={year:z.year,month:z.month,day:z.day};u.end=!1,y(Fe),p(Fe),_t(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const re={year:z.year,month:z.month,day:z.day};u.end=!1,p(re)},$=()=>{h.value=!1,S()},ne=()=>{f.value=!1,C()},U=()=>{he()},q=Z(()=>d.isSelectingStart||d.isSelectingEnd);function Q(){s.disabled||s.readOnly||(b(),d.isSelectingStart=!0,d.isSelectingEnd=!1,_t(()=>{var z;(z=i.value)==null||z.focus()}))}function X(){s.disabled||s.readOnly||(b(),d.isSelectingEnd=!0,d.isSelectingStart=!1,_t(()=>{var z;(z=_.value)==null||z.focus()}))}function he(){d.isSelectingStart=!1,d.isSelectingEnd=!1,r("closed")}function M(z){z.key==="Escape"?(z.stopPropagation(),he()):z.key=="Tab"&&r("tab",z)}const Y=B(null),L=B(new Date().getFullYear()),se=B(new Date().getMonth()+1);Je(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(L.value=d.startDate.getFullYear(),se.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(L.value=d.endDate.getFullYear(),se.value=d.endDate.getMonth()+1)},{immediate:!0});const fe=B(null);function Le(){if(Array.isArray(s.value)){const[ue,re]=s.value;d.startDate=ue||null,d.endDate=re||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const z=d.startDate||d.endDate||new Date;L.value=z.getFullYear(),se.value=z.getMonth()+1}Je(()=>{var z,ue,re,Fe,G,ee,Ce,Pe;return[((re=(ue=(z=s.value)==null?void 0:z[0])==null?void 0:ue.getTime)==null?void 0:re.call(ue))||((Fe=s.value)==null?void 0:Fe[0]),((Ce=(ee=(G=s.value)==null?void 0:G[1])==null?void 0:ee.getTime)==null?void 0:Ce.call(ee))||((Pe=s.value)==null?void 0:Pe[1]),s.timezone,s.format,s.placeholder,s.enableRangeFeedback]},()=>{Le()},{immediate:!0,deep:!0}),t({resetCalendarLogic:Le,openStart:Q,openEnd:X,closePicker:he,clearAll:U,isOpen:q,drpRef:fe,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?Q():X():Q()}});const Ke=B(null);return Je(()=>q.value,z=>{if(s.disabled||s.readOnly)return;const ue=Ke.value;ue&&(z?ue.show():ue.hide())},{immediate:!0}),(z,ue)=>(j(),ae("div",{class:J(z.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:x,onKeydown:M,tabindex:"1","data-index":"calendar-wrapper"},[ce(FY,{year:L.value,"onUpdate:year":ue[6]||(ue[6]=re=>L.value=re),month:se.value,"onUpdate:month":ue[7]||(ue[7]=re=>se.value=re),locale:s.locale,disabled:s.disabled,readOnly:s.readOnly,ref_key:"navigationRef",ref:Y},{selection:pe(()=>[ge("div",{class:J(z.$style["calendar-input-section"])},[ce(BA,{ref_key:"starDateRef",ref:i,"model-value":H(d).startDate,placeholder:s.startPlaceholder,timezone:s.timezone,active:H(d).isSelectingStart,onClick:Q,onClear:$,onComplete:T,onInvalid:ue[0]||(ue[0]=re=>u.start=!0),disabled:s.disabled,readOnly:s.readOnly,onBlur:k,onTab:A},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),ce(BA,{ref_key:"endDateRef",ref:_,"model-value":H(d).endDate,placeholder:s.duePlaceholder,timezone:s.timezone,active:H(d).isSelectingEnd,onClick:X,onClear:ne,disabled:s.disabled,onComplete:P,onInvalid:ue[1]||(ue[1]=re=>u.end=!0),readOnly:s.readOnly,isMultipleDate:H(f),onTab:F},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:pe(({year:re,month:Fe})=>[ce(DY,{disabled:s.disabled,disableConfirm:u.end||u.start,readOnly:s.readOnly,ref_key:"drpRef",ref:fe,"tracing-case":o.value,"onUpdate:tracingCase":ue[2]||(ue[2]=G=>o.value=G),year:re,month:Fe,"start-date":H(d).startDate,"end-date":H(d).endDate,"active-field":E.value,timezone:s.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:H(y),onSelectEnd:H(p),onGotoToday:c,onConfirm:ue[3]||(ue[3]=()=>{a(H(v),he)}),onCancel:ue[4]||(ue[4]=G=>l(H(g),he)),onClose:ue[5]||(ue[5]=G=>a(H(v),he))},null,8,["disabled","disableConfirm","readOnly","tracing-case","year","month","start-date","end-date","active-field","timezone","immediatelyUpdate","onSelectStart","onSelectEnd"])]),_:1},8,["year","month","locale","disabled","readOnly"])],34))}}),xm=St(kY,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_15w28_1","calendar-input-section":"_calendar-input-section_15w28_12","display-wrapper":"_display-wrapper_15w28_20","calendar-actions":"_calendar-actions_15w28_24","clear-all-btn":"_clear-all-btn_15w28_30"}}]]),OY={ref:"mainRef"},MY=it({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{}},emits:["updated"],setup(e,{emit:t}){const n=t,o=e,s=En("isSelectAll",B(!1)),i=En("bulkUpdate",B(!1)),r=Z(()=>!!o.entityId&&i.value&&s.value),{apiServices:a}=Qn(!i.value,o),l=En("filterParams",null),c=async A=>{var T,D,F;x.value=!0;let k={workspaceId:o.workspaceId,entityId:o.entityId,itemIds:o.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in A&&(k.startDate=A.start?lm(A.start):null),"end"in A&&(k.dueDate=A.end?lm(A.end):null),r.value?(k.itemIds=void 0,k.entityId=o.entityId):k.entityId=void 0,await((D=(T=a.value)==null?void 0:T.changeDate)==null?void 0:D.call(T,k)),n("updated",{workspaceId:o.workspaceId,itemIds:o.ids,data:k}),(F=y.value)==null||F.resetCalendarLogic()},u=()=>{if(!o.rowSelected||o.rowSelected.length===0){d();return}o.rowSelected.length===1?h():f()},d=()=>{v.value=!1,g.value=!1,_.value=[null,null]},h=()=>{const k=o.rowSelected[0].dateRange;_.value=[(k==null?void 0:k[0])??null,(k==null?void 0:k[1])??null],v.value=!1,g.value=!1},f=()=>{var k,T;if(o.rowSelected.some(D=>D.dateRange&&(D.dateRange[0]!==null||D.dateRange[1]!==null))){const D=p(0),F=p(1);if(g.value=D,v.value=F,D)_.value[0]=null;else{const P=((k=o.rowSelected[0].dateRange)==null?void 0:k[0])??null;_.value[0]=P}if(F)_.value[1]=null;else{const P=((T=o.rowSelected[0].dateRange)==null?void 0:T[1])??null;_.value[1]=P}}else g.value=!1,v.value=!1,_.value=[null,null]},p=A=>{const k=o.rowSelected.map(D=>{var F;return(F=D.dateRange)==null?void 0:F[A]});return k.length===0?!1:new Set(k.map(D=>{var F;return(F=D==null?void 0:D.getTime)==null?void 0:F.call(D)})).size>1},g=B(!1),v=B(!1),y=B(null),{triggerRef:b,popupRef:S,hide:C,isVisible:E}=eo(),_=B([null,null]);Je([()=>o.ids,()=>o.rowSelected,E],A=>{u(),_t(()=>{var k;(k=y.value)==null||k.focus()})},{immediate:!0,deep:!0});const x=B(!1);return(A,k)=>(j(),ae("div",OY,[ge("div",{ref_key:"triggerRef",ref:b},[ce(ct,{variant:o.variant,loading:x.value},{default:pe(()=>[ce(rt,{src:"Calendar"}),k[2]||(k[2]=nt(" Date ",-1))]),_:1},8,["variant","loading"])],512),ge("div",{ref_key:"popupRef",ref:S,style:{display:"none"}},[H(E)?(j(),ze(xm,{key:0,immediatelyUpdate:!1,value:_.value,onConfirmed:c,ref_key:"calendarRef",ref:y,onClosed:H(C),onStartUpdate:k[0]||(k[0]=T=>x.value=!0),onFinishUpdate:k[1]||(k[1]=T=>x.value=!1),multipleDueDates:v.value,multipleStartDates:g.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):Ze("",!0)],512)],512))}}),NY=e=>{if(Number(e.metric_type.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number(e.metric_type.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number(e.metric_type.id)==3)return"formula"},$A=Yl("metricStore",()=>{const e=B();return{metricList:e,setMetricList:o=>{e.value=o},checkEditType:o=>{var s;if(((s=o==null?void 0:o.auth_permission)==null?void 0:s.permission)==2)return NY(o)}}}),LY=["onKeydown"],VY=["width","height","viewBox"],BY=["d"],$Y="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",HA=it({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change","handleEnter","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=B(o.modelValue??0),r=B(null),a=Z(()=>{var D;return((D=o.params)==null?void 0:D.size)??24}),l=Z(()=>{var D;return((D=o.params)==null?void 0:D.iconViewBox)??"0 0 24 24"}),c=Z(()=>{var D;return((D=o.params)==null?void 0:D.iconPath)??$Y}),u=Z(()=>{var D;return((D=o.params)==null?void 0:D.wrapperTag)??"span"}),d=Z(()=>{var D;return o.disabled||((D=o.params)==null?void 0:D.disabled)||!1}),h=Z(()=>{var D;return o.readOnly||((D=o.params)==null?void 0:D.readOnly)||!1}),f=Z(()=>!d.value&&!h.value),p=Z(()=>d.value?"not-allowed":h.value?"default":"pointer");Je(()=>o.modelValue,D=>{typeof D=="number"&&D!==i.value&&(i.value=D)});const g=D=>{var F;return((F=o.params)==null?void 0:F.maxRating)-D+1<=i.value&&!v.value},v=B(!1),y=()=>{v.value=!0},b=()=>{v.value=!1},S=D=>{f.value&&C(D)},C=D=>{var P,$;if(!f.value)return;let F=((P=o.params)==null?void 0:P.maxRating)-D+1;F===i.value&&(F=0),i.value=F,s("update:modelValue",F),s("update",F),s("change",F),($=o.params)!=null&&$.onUpdate&&o.params.onUpdate(F)},E=D=>{var F;D!==i.value&&(i.value=D,s("update:modelValue",D),s("update",D),s("change",D),(F=o.params)!=null&&F.onUpdate&&o.params.onUpdate(D),_.value=D)},_=B(i.value),x=D=>{D.preventDefault(),D.stopPropagation(),D.stopImmediatePropagation(),i.value=_.value,s("cancel")},A=D=>{D.preventDefault(),E(i.value),s("handleEnter",i.value)},k=()=>{f.value&&(i.value=Math.min(i.value+1%(o.params.maxRating+1),o.params.maxRating),E(i.value))},T=()=>{f.value&&(i.value=Math.max(i.value-1,0),E(i.value))};return t({focus:()=>{var D;(D=r.value)==null||D.focus()}}),(D,F)=>(j(),ae("div",{class:J(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:cn({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:r,tabindex:"1",onKeydown:[Bn(Tt(T,["prevent"]),["left"]),Bn(Tt(k,["prevent"]),["right"]),Bn(Tt(T,["prevent"]),["down"]),Bn(Tt(k,["prevent"]),["up"]),Bn(Tt(A,["prevent"]),["enter"]),Bn(Tt(A,["prevent"]),["tab"]),Bn(Tt(x,["prevent"]),["escape"])]},[(j(!0),ae(xt,null,xn(e.params.maxRating,P=>(j(),ze(eD(u.value),{key:P,class:J(["rating-item",{filled:g(P),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:cn({cursor:p.value,order:e.params.maxRating-P,height:a.value+"px",width:a.value+"px"}),"aria-checked":g(P),"aria-disabled":d.value,"aria-readOnly":h.value,title:e.params.maxRating-P+1,tabindex:-1,onClick:Tt($=>S(P),["prevent","stop"]),onMouseenter:y,onMouseleave:b},{default:pe(()=>[Pt(D.$slots,"icon",{index:P,filled:g(P),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value},()=>[(j(),ae("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[ge("path",{d:c.value},null,8,BY)],8,VY))]),Pt(D.$slots,"overlay",{index:P,filled:g(P),disabled:d.value,readOnly:h.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,LY))}}),HY={style:{maxWidth:"180px",lineHeight:"15px"}},GY=["innerHTML"],GA=it({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,i=n,r=()=>{i("handleCancel")},a=()=>{i("close")},l=v=>{var y;if(v.format_type==="dropdown"&&v.format_value)try{const b=JSON.parse(v.format_value);if(Array.isArray(b)){const S=b.map(C=>({label:C.name,value:C.name,id:C.name}));return S.unshift({label:"-",value:void 0,id:"-"}),S}}catch(b){console.error("Failed to parse dropdown options",b)}if(v.format_type=="number"&&v.restricted_type=="exact"){const b=((y=v.restricted_value)==null?void 0:y.split(",").map(S=>({label:v.mapping[`!${S}`]||S,value:S,id:S})))||[];return b.unshift({label:"-",value:void 0,id:"-"}),b}return[]},c=Z(()=>l(s.config)),u=B(s.modelValue),d=v=>{u.value=v,i("update:modelValue",v),i("change",v||null)},h=B(c.value),f=B(!1),p=v=>{f.value=!0,v?h.value=c.value.filter(y=>y.label.toLowerCase().includes(v.toLowerCase())):h.value=c.value,setTimeout(()=>{f.value=!1},300)},g=B(null);return Xt(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,y)=>(j(),ze(Jr,{style:{width:326},loading:f.value,options:h.value,"selected-id":e.modelValue||void 0,onSearch:p,onSelect:y[0]||(y[0]=b=>d(b.id)),ref_key:"searchListRef",ref:g,onClose:a,onCancel:r},{item:pe(({item:b,getHighlightedLabel:S,selectedIndex:C,index:E})=>[ce(ei,{hover:C==E,selected:b.value===e.modelValue,label:b.label,onSelect:_=>d(b.value||null),onClick:_=>d(b.value||null)},{label:pe(()=>[ge("div",HY,[Ue(ge("span",{innerHTML:S(b.label)},null,8,GY),[[H(o),{content:b.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":pe(()=>[...y[1]||(y[1]=[nt("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),UY={class:"metric-input-wrapper"},WY={key:0,class:"error-text input-2"},UA=it({__name:"MetricEditorInput",props:{config:{},modelValue:{},saveOnBlur:{type:Boolean,default:!0},saveOnEscape:{type:Boolean,default:!1},showInlineError:{type:Boolean,default:!1}},emits:["update:modelValue","handleChange","cancel","enter","onValidation"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,i=B(s.modelValue),r=B(s.modelValue),a=B(!1),l=B(!0),c=B(""),u=Z(()=>l.value||s.showInlineError?{content:""}:{content:c.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),d=()=>{var q;const T=s.config.restricted_type.trim(),D=((q=s.config.restricted_value)==null?void 0:q.split(",").map(Number))||[],[F,P]=D,ne={range:`Enter a value between ${F} and ${P}`,not:`These values are not allowed: ${D.join(", ")}`,exact:"Value is not allowed"}[T];return l.value?"":ne},h=Z(()=>{var D;let T="";return Number((D=s.config)==null?void 0:D.format_value)&&(T+="."+Array.from({length:Number(s.config.format_value)}).map(()=>"0").join("")),`0${T}`});Je(()=>s.modelValue,T=>{i.value=T,r.value=T});const f=T=>im(s.config,T),p=n,g=B(null),v=T=>{const D=T===""?null:T,F=r.value===""?null:r.value;return D!==F},y=T=>{if(!v(T))return!1;const D=T===""?null:T;return i.value=D,r.value=D,p("update:modelValue",D),p("handleChange",D),!0},b=()=>{i.value=r.value,p("update:modelValue",r.value)},S=(T,D)=>{y(T),p("enter")},C=(T,D)=>{if(a.value){a.value=!1;return}s.saveOnBlur?y(T):b()},E=T=>{if(T===null||T===""){l.value=!0;return}l.value=im(s.config,Number(T)),c.value=l.value?"":d()},_=(T,D)=>{a.value=!0,s.saveOnEscape?y(T):b(),p("cancel"),setTimeout(()=>{a.value=!1},100)},x=T=>{E(T),p("onValidation",T)},A=()=>{a.value=!0,b(),p("cancel"),setTimeout(()=>{a.value=!1},100)},k=()=>{var T;i.value=null,r.value=null,p("update:modelValue",null),p("handleChange",null),(T=g.value)==null||T.focus()};return t({focus:()=>{var T;return(T=g.value)==null?void 0:T.focus()},blur:()=>{var T;return(T=g.value)==null?void 0:T.blur()},getValue:()=>i.value,getCachedValue:()=>r.value,save:()=>y(i.value),revert:b}),Xt(()=>{var T;(T=g.value)==null||T.focus()}),(T,D)=>Ue((j(),ae("div",UY,[ce(Jb,{modelValue:i.value,"onUpdate:modelValue":D[0]||(D[0]=F=>i.value=F),placeholder:h.value,validatorFnc:f,style:{"--bg-input":"#FAFAFA"},onEnter:S,onBlur:C,onClear:k,onEscape:_,onCancel:A,onOnValidation:x,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:g},null,8,["modelValue","placeholder"]),!l.value&&e.showInlineError?(j(),ae("span",WY,yt(c.value),1)):Ze("",!0)])),[[H(o),u.value]])}}),zY={key:2},jY={class:"wrapper-suffix"},KY={key:3},qY=St(it({__name:"MetricEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},config:{},attachTo:{},focus:{type:Boolean}},emits:["enter","cancel","blur","updateMetric"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,i=B(null),r=B(0),a=B(null),l=B(null),c=Z(()=>II(s.config)),u=B(!1),d=Z(()=>!!se.value),h=n,f=()=>{u.value=!1,L(),h("cancel")},p=B(!0),g=Me=>{if(Me===null||Me===""){p.value=!0;return}if(c.value!=="number"){p.value=!0;return}p.value=im(s.config,Number(Me)),y.value=b()},v=()=>{u.value=!0,U()},y=B(""),b=()=>{var ee;const Me=s.config.restricted_type.trim(),Ke=((ee=s.config.restricted_value)==null?void 0:ee.split(",").map(Number))||[],[z,ue]=Ke,Fe={range:`Enter a value between ${z} and ${ue}`,not:`These values are not allowed: ${Ke.join(", ")}`,exact:"Value is not allowed"}[Me];return p.value?"":Fe},S=Me=>{u.value=!0,i.value=Me},C=()=>{u.value=!0,L(),U()},E=Me=>{r.value=Me,u.value=!0,U()},_=()=>(s.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(Ke=>Ke.charAt(0).toUpperCase()+Ke.slice(1)).join("").replace(/Outline|Solid/g,""),x=B(null),A=B(!0),k=Z(()=>{var Me;return{disabled:s.disabled,error:!1,readOnly:!1,isEmpty:((Me=i.value)==null?void 0:Me.length)===0,wrapperRef:M,active:d,focus:s.focus,bordered:!0}}),T=B(null),D=Z(()=>A.value),F=Z(()=>({disabled:s.disabled,error:!1,readOnly:!1,isEmpty:r.value===0,wrapperRef:T,active:D,focus:A.value,bordered:!0})),{argsMain:P}=vo(F),{argsMain:$}=vo(k),ne=B(null),U=()=>{_t(()=>{var Me;(Me=ne.value)==null||Me.focus()})},q=Me=>{var Ke;if(Me.format_type==="dropdown"&&Me.format_value)try{const z=JSON.parse(Me.format_value);if(Array.isArray(z))return z.map(ue=>({label:ue.name,value:ue.name,id:ue.name}))}catch(z){console.error("Failed to parse dropdown options",z)}return Me.format_type=="number"&&Me.restricted_type=="exact"?((Ke=Me.restricted_value)==null?void 0:Ke.split(",").map(ue=>({label:Me.mapping[`!${ue}`]||ue,value:ue,id:ue})))||[]:[]},Q=Z(()=>q(s.config)),X=Z(()=>{var Me;return((Me=Q.value.find(Ke=>Ke.value===i.value))==null?void 0:Me.label)||i.value||"-"}),he=()=>{var Me;if(c.value=="rating")h("updateMetric",r.value==0?null:r.value);else if(c.value=="number"){const Ke=(Me=l.value)==null?void 0:Me.getValue();h("updateMetric",Ke||null)}else h("updateMetric",i.value||null);u.value=!1,L()},{triggerRef:M,popupRef:Y,hide:L,isVisible:se,show:fe}=eo({appendTo:()=>s.attachTo||"parent",zIndex:1e4,offset:[0,0]}),Le=()=>{switch(c.value){case"number":_t(()=>{var Me;(Me=l.value)==null||Me.focus()});break;case"dropdown":fe(),_t(()=>{var Me;(Me=x.value)==null||Me.focus()});break;case"rating":A.value=!0,_t(()=>{var Me;(Me=a.value)==null||Me.focus()});break}};return t({resetState:()=>{i.value=null,r.value=0,u.value=!1},focus:Le,hasChanges:()=>u.value}),Xt(()=>{_t(()=>{setTimeout(()=>{Le()},300)})}),(Me,Ke)=>(j(),ae("div",{class:J(Me.$style["metric-editor"])},[c.value=="number"?(j(),ze(UA,{key:0,config:s.config,modelValue:i.value,"onUpdate:modelValue":Ke[0]||(Ke[0]=z=>i.value=z),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:S,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue"])):c.value=="rating"?(j(),ze(yo,qt({key:1,"tab-index":1},H(P),{ref_key:"triggerRef2",ref:T,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:pe(()=>[ce(HA,{params:{maxRating:s.config.range},modelValue:r.value,"onUpdate:modelValue":Ke[1]||(Ke[1]=z=>r.value=z),onHandleEnter:E,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:pe(()=>[ce(rt,{source:"rating",src:_()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):c.value=="dropdown"?(j(),ae("div",zY,[ce(yo,qt(H($),{ref_key:"triggerRef",ref:M,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:pe(({})=>[ge("div",jY,[ce(rt,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:pe(()=>[Ue((j(),ae("span",null,[nt(yt(X.value||""),1)])),[[H(o),{content:X.value}]])]),_:1},16),ge("div",{ref_key:"popupRef",ref:Y},[H(se)?(j(),ze(GA,{key:0,ref_key:"metricEditorDropdownRef",ref:x,config:s.config,modelValue:i.value,"onUpdate:modelValue":Ke[2]||(Ke[2]=z=>i.value=z),onChange:C,onCancel:f},null,8,["config","modelValue"])):Ze("",!0)],512)])):(j(),ae("span",KY,"Formular")),Ue((j(),ze(ct,{ref_key:"confirmButtonRef",ref:ne,onHandleClick:he,"tab-index":"1",onKeypress:[Bn(Tt(Le,["shift","prevent"]),["tab"]),Bn(Tt(f,["prevent"]),["escape"])],disabled:!p.value},{default:pe(()=>[ce(rt,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[H(o),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),YY=St(it({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,i=n,r=B(!1),a=B(null),l=B(null),c=()=>{r.value=!r.value},u=()=>{var g;r.value=!1,(g=l.value)==null||g.resetState()},d=async()=>{var g;r.value=!0,await _t(),(g=l.value)==null||g.focus()},h=g=>{i("handleUpdate",{id:s.config.id.toString(),value:g})},f=()=>{var g;(g=a.value)==null||g.focus(),i("loseFocus")},p=g=>{const y={Escape:()=>{g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation(),i("focusOnSearch",g)},Tab:()=>{r.value&&u()},Enter:()=>{r.value||d()},ArrowDown:()=>{i("openSibling","down")},ArrowUp:()=>{i("openSibling","up")}}[g.key];y&&y()};return Je(r,g=>{g&&i("open")}),t({hide:u,show:d}),(g,v)=>(j(),ae("div",{class:J([g.$style["metric-item"],r.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[ge("div",{class:J(g.$style["metric-label"]),onClick:Tt(c,["stop"])},[Pt(g.$slots,"default",{open:r.value},()=>[Ue((j(),ae("span",{class:J(g.$style["metric-name"])},[nt(yt(e.label),1)],2)),[[H(o),{content:e.label}]]),e.morpheme&&r.value?(j(),ae("small",{key:0,class:J(g.$style["metric-morpheme"])}," ("+yt(e.morpheme)+") ",3)):Ze("",!0)])],2),ce(YD,{mode:"out-in",name:"slide"},{default:pe(()=>[r.value?(j(),ze(qY,{key:`editor-${e.config.id}`,"read-only":!1,focus:r.value,type:e.type,config:e.config,"attach-to":e.attachTo,ref_key:"metricEditorRef",ref:l,onCancel:f,onUpdateMetric:h},null,8,["focus","type","config","attach-to"])):Ze("",!0)]),_:1})],34))}}),[["__cssModules",{$style:{"metric-item":"_metric-item_18ft8_1","metric-label":"_metric-label_18ft8_11",open:"_open_18ft8_19","metric-name":"_metric-name_18ft8_23","metric-morpheme":"_metric-morpheme_18ft8_29"}}]]);var Tu=(e=>(e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.TOO_EARLY=425]="TOO_EARLY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",e))(Tu||{});function WA(e,t){return function(){return e.apply(t,arguments)}}const{toString:ZY}=Object.prototype,{getPrototypeOf:eS}=Object,{iterator:Fm,toStringTag:zA}=Symbol,Im=(e=>t=>{const n=ZY.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ai=e=>(e=e.toLowerCase(),t=>Im(t)===e),Pm=e=>t=>typeof t===e,{isArray:xu}=Array,Fu=Pm("undefined");function Jh(e){return e!==null&&!Fu(e)&&e.constructor!==null&&!Fu(e.constructor)&&us(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const jA=Ai("ArrayBuffer");function XY(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&jA(e.buffer),t}const JY=Pm("string"),us=Pm("function"),KA=Pm("number"),Qh=e=>e!==null&&typeof e=="object",QY=e=>e===!0||e===!1,Am=e=>{if(Im(e)!=="object")return!1;const t=eS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(zA in e)&&!(Fm in e)},eZ=e=>{if(!Qh(e)||Jh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},tZ=Ai("Date"),nZ=Ai("File"),oZ=Ai("Blob"),sZ=Ai("FileList"),iZ=e=>Qh(e)&&us(e.pipe),rZ=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||us(e.append)&&((t=Im(e))==="formdata"||t==="object"&&us(e.toString)&&e.toString()==="[object FormData]"))},aZ=Ai("URLSearchParams"),[lZ,cZ,uZ,dZ]=["ReadableStream","Request","Response","Headers"].map(Ai),hZ=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ef(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let o,s;if(typeof e!="object"&&(e=[e]),xu(e))for(o=0,s=e.length;o<s;o++)t.call(null,e[o],o,e);else{if(Jh(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),r=i.length;let a;for(o=0;o<r;o++)a=i[o],t.call(null,e[a],a,e)}}function qA(e,t){if(Jh(e))return null;t=t.toLowerCase();const n=Object.keys(e);let o=n.length,s;for(;o-- >0;)if(s=n[o],t===s.toLowerCase())return s;return null}const Xl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,YA=e=>!Fu(e)&&e!==Xl;function tS(){const{caseless:e,skipUndefined:t}=YA(this)&&this||{},n={},o=(s,i)=>{const r=e&&qA(n,i)||i;Am(n[r])&&Am(s)?n[r]=tS(n[r],s):Am(s)?n[r]=tS({},s):xu(s)?n[r]=s.slice():(!t||!Fu(s))&&(n[r]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&ef(arguments[s],o);return n}const fZ=(e,t,n,{allOwnKeys:o}={})=>(ef(t,(s,i)=>{n&&us(s)?e[i]=WA(s,n):e[i]=s},{allOwnKeys:o}),e),pZ=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),gZ=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},mZ=(e,t,n,o)=>{let s,i,r;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)r=s[i],(!o||o(r,e,t))&&!a[r]&&(t[r]=e[r],a[r]=!0);e=n!==!1&&eS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},vZ=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return o!==-1&&o===n},yZ=e=>{if(!e)return null;if(xu(e))return e;let t=e.length;if(!KA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},wZ=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&eS(Uint8Array)),CZ=(e,t)=>{const o=(e&&e[Fm]).call(e);let s;for(;(s=o.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},bZ=(e,t)=>{let n;const o=[];for(;(n=e.exec(t))!==null;)o.push(n);return o},SZ=Ai("HTMLFormElement"),EZ=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,s){return o.toUpperCase()+s}),ZA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),_Z=Ai("RegExp"),XA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};ef(n,(s,i)=>{let r;(r=t(s,i,e))!==!1&&(o[i]=r||s)}),Object.defineProperties(e,o)},RZ=e=>{XA(e,(t,n)=>{if(us(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const o=e[n];if(us(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},DZ=(e,t)=>{const n={},o=s=>{s.forEach(i=>{n[i]=!0})};return xu(e)?o(e):o(String(e).split(t)),n},TZ=()=>{},xZ=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function FZ(e){return!!(e&&us(e.append)&&e[zA]==="FormData"&&e[Fm])}const IZ=e=>{const t=new Array(10),n=(o,s)=>{if(Qh(o)){if(t.indexOf(o)>=0)return;if(Jh(o))return o;if(!("toJSON"in o)){t[s]=o;const i=xu(o)?[]:{};return ef(o,(r,a)=>{const l=n(r,s+1);!Fu(l)&&(i[a]=l)}),t[s]=void 0,i}}return o};return n(e,0)},PZ=Ai("AsyncFunction"),AZ=e=>e&&(Qh(e)||us(e))&&us(e.then)&&us(e.catch),JA=((e,t)=>e?setImmediate:t?((n,o)=>(Xl.addEventListener("message",({source:s,data:i})=>{s===Xl&&i===n&&o.length&&o.shift()()},!1),s=>{o.push(s),Xl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",us(Xl.postMessage)),kZ=typeof queueMicrotask<"u"?queueMicrotask.bind(Xl):typeof K<"u"&&K.nextTick||JA,Ve={isArray:xu,isArrayBuffer:jA,isBuffer:Jh,isFormData:rZ,isArrayBufferView:XY,isString:JY,isNumber:KA,isBoolean:QY,isObject:Qh,isPlainObject:Am,isEmptyObject:eZ,isReadableStream:lZ,isRequest:cZ,isResponse:uZ,isHeaders:dZ,isUndefined:Fu,isDate:tZ,isFile:nZ,isBlob:oZ,isRegExp:_Z,isFunction:us,isStream:iZ,isURLSearchParams:aZ,isTypedArray:wZ,isFileList:sZ,forEach:ef,merge:tS,extend:fZ,trim:hZ,stripBOM:pZ,inherits:gZ,toFlatObject:mZ,kindOf:Im,kindOfTest:Ai,endsWith:vZ,toArray:yZ,forEachEntry:CZ,matchAll:bZ,isHTMLForm:SZ,hasOwnProperty:ZA,hasOwnProp:ZA,reduceDescriptors:XA,freezeMethods:RZ,toObjectSet:DZ,toCamelCase:EZ,noop:TZ,toFiniteNumber:xZ,findKey:qA,global:Xl,isContextDefined:YA,isSpecCompliantForm:FZ,toJSONObject:IZ,isAsyncFn:PZ,isThenable:AZ,setImmediate:JA,asap:kZ,isIterable:e=>e!=null&&us(e[Fm])};function zt(e,t,n,o,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),s&&(this.response=s,this.status=s.status?s.status:null)}Ve.inherits(zt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ve.toJSONObject(this.config),code:this.code,status:this.status}}});const QA=zt.prototype,ek={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ek[e]={value:e}}),Object.defineProperties(zt,ek),Object.defineProperty(QA,"isAxiosError",{value:!0}),zt.from=(e,t,n,o,s,i)=>{const r=Object.create(QA);Ve.toFlatObject(e,r,function(u){return u!==Error.prototype},c=>c!=="isAxiosError");const a=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return zt.call(r,a,l,n,o,s),e&&r.cause==null&&Object.defineProperty(r,"cause",{value:e,configurable:!0}),r.name=e&&e.name||"Error",i&&Object.assign(r,i),r};const OZ=null;function nS(e){return Ve.isPlainObject(e)||Ve.isArray(e)}function tk(e){return Ve.endsWith(e,"[]")?e.slice(0,-2):e}function nk(e,t,n){return e?e.concat(t).map(function(s,i){return s=tk(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function MZ(e){return Ve.isArray(e)&&!e.some(nS)}const NZ=Ve.toFlatObject(Ve,{},null,function(t){return/^is[A-Z]/.test(t)});function km(e,t,n){if(!Ve.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Ve.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,v){return!Ve.isUndefined(v[g])});const o=n.metaTokens,s=n.visitor||u,i=n.dots,r=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Ve.isSpecCompliantForm(t);if(!Ve.isFunction(s))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(Ve.isDate(p))return p.toISOString();if(Ve.isBoolean(p))return p.toString();if(!l&&Ve.isBlob(p))throw new zt("Blob is not supported. Use a Buffer instead.");return Ve.isArrayBuffer(p)||Ve.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,g,v){let y=p;if(p&&!v&&typeof p=="object"){if(Ve.endsWith(g,"{}"))g=o?g:g.slice(0,-2),p=JSON.stringify(p);else if(Ve.isArray(p)&&MZ(p)||(Ve.isFileList(p)||Ve.endsWith(g,"[]"))&&(y=Ve.toArray(p)))return g=tk(g),y.forEach(function(S,C){!(Ve.isUndefined(S)||S===null)&&t.append(r===!0?nk([g],C,i):r===null?g:g+"[]",c(S))}),!1}return nS(p)?!0:(t.append(nk(v,g,i),c(p)),!1)}const d=[],h=Object.assign(NZ,{defaultVisitor:u,convertValue:c,isVisitable:nS});function f(p,g){if(!Ve.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),Ve.forEach(p,function(y,b){(!(Ve.isUndefined(y)||y===null)&&s.call(t,y,Ve.isString(b)?b.trim():b,g,h))===!0&&f(y,g?g.concat(b):[b])}),d.pop()}}if(!Ve.isObject(e))throw new TypeError("data must be an object");return f(e),t}function ok(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function oS(e,t){this._pairs=[],e&&km(e,this,t)}const sk=oS.prototype;sk.append=function(t,n){this._pairs.push([t,n])},sk.toString=function(t){const n=t?function(o){return t.call(this,o,ok)}:ok;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function LZ(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ik(e,t,n){if(!t)return e;const o=n&&n.encode||LZ;Ve.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=Ve.isURLSearchParams(t)?t.toString():new oS(t,n).toString(o),i){const r=e.indexOf("#");r!==-1&&(e=e.slice(0,r)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class rk{constructor(){this.handlers=[]}use(t,n,o){return this.handlers.push({fulfilled:t,rejected:n,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Ve.forEach(this.handlers,function(o){o!==null&&t(o)})}}const ak={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},VZ={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:oS,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},sS=typeof window<"u"&&typeof document<"u",iS=typeof navigator=="object"&&navigator||void 0,BZ=sS&&(!iS||["ReactNative","NativeScript","NS"].indexOf(iS.product)<0),$Z=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",HZ=sS&&window.location.href||"http://localhost",Go={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:sS,hasStandardBrowserEnv:BZ,hasStandardBrowserWebWorkerEnv:$Z,navigator:iS,origin:HZ},Symbol.toStringTag,{value:"Module"})),...VZ};function GZ(e,t){return km(e,new Go.classes.URLSearchParams,{visitor:function(n,o,s,i){return Go.isNode&&Ve.isBuffer(n)?(this.append(o,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function UZ(e){return Ve.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function WZ(e){const t={},n=Object.keys(e);let o;const s=n.length;let i;for(o=0;o<s;o++)i=n[o],t[i]=e[i];return t}function lk(e){function t(n,o,s,i){let r=n[i++];if(r==="__proto__")return!0;const a=Number.isFinite(+r),l=i>=n.length;return r=!r&&Ve.isArray(s)?s.length:r,l?(Ve.hasOwnProp(s,r)?s[r]=[s[r],o]:s[r]=o,!a):((!s[r]||!Ve.isObject(s[r]))&&(s[r]=[]),t(n,o,s[r],i)&&Ve.isArray(s[r])&&(s[r]=WZ(s[r])),!a)}if(Ve.isFormData(e)&&Ve.isFunction(e.entries)){const n={};return Ve.forEachEntry(e,(o,s)=>{t(UZ(o),s,n,0)}),n}return null}function zZ(e,t,n){if(Ve.isString(e))try{return(t||JSON.parse)(e),Ve.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(n||JSON.stringify)(e)}const tf={transitional:ak,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const o=n.getContentType()||"",s=o.indexOf("application/json")>-1,i=Ve.isObject(t);if(i&&Ve.isHTMLForm(t)&&(t=new FormData(t)),Ve.isFormData(t))return s?JSON.stringify(lk(t)):t;if(Ve.isArrayBuffer(t)||Ve.isBuffer(t)||Ve.isStream(t)||Ve.isFile(t)||Ve.isBlob(t)||Ve.isReadableStream(t))return t;if(Ve.isArrayBufferView(t))return t.buffer;if(Ve.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(o.indexOf("application/x-www-form-urlencoded")>-1)return GZ(t,this.formSerializer).toString();if((a=Ve.isFileList(t))||o.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return km(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),zZ(t)):t}],transformResponse:[function(t){const n=this.transitional||tf.transitional,o=n&&n.forcedJSONParsing,s=this.responseType==="json";if(Ve.isResponse(t)||Ve.isReadableStream(t))return t;if(t&&Ve.isString(t)&&(o&&!this.responseType||s)){const r=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(r)throw a.name==="SyntaxError"?zt.from(a,zt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Go.classes.FormData,Blob:Go.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ve.forEach(["delete","get","head","post","put","patch"],e=>{tf.headers[e]={}});const jZ=Ve.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),KZ=e=>{const t={};let n,o,s;return e&&e.split(`
139
+ This will fail in production.`);r=jl,r._s.has(e)||(s?qb(e,t,o,r):kA(e,o,r),K.env.NODE_ENV!=="production"&&(i._pinia=r));const c=r._s.get(e);if(K.env.NODE_ENV!=="production"&&a){const u="__hot:"+e,d=s?qb(u,t,o,r,!0):kA(u,Qs({},o),r,!0);a._hotUpdate(d),delete r.state.value[u],r._s.delete(u)}if(K.env.NODE_ENV!=="production"&&Zr){const u=So();if(u&&u.proxy&&!a){const d=u.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[e]=c}}return c}return i.$id=e,i}function Ho(e){const t=Mt(e),n={};for(const o in t){const s=t[o];s.effect?n[o]=Z({get:()=>e[o],set(i){e[o]=i}}):(pn(s)||Hs(s))&&(n[o]=Ci(e,o))}return n}const Rm=Yl("permissionStore",()=>{const e=B([]),t=B(),n=B({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:r=>{e.value=r},setEntityPermissions:r=>{t.value=r},setItemPermission:(r,a)=>{n.value[r]=a}}}),OA="woohoo_getWoohooUserInterface_read",Dm="media_getReviewUserInterface_read",MA="update_getUpdateUserInterface_read",tY=(e,t,n,o,s)=>{const i=Rm(),{userPermissions:r}=Ho(i),a=Z(()=>{const U=Cn.getInstance().getItem("BASE_URL"),q=Cn.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:Q,entity_id:X,scene_id:he}=e.value;return{baseDomain:U||"",ws_code:Q||"",entity_id:X||"",scene_id:he||"",reviewDomain:q||"",take_id:X||"",woohoo_id:X||"",parent_id:X||""}}),l=Z(()=>{var q;const U=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:r.value.includes(Dm),canCopyLink:!0,canRename:(U==null?void 0:U.has_edit_permission)??!1,canOpenTakeInReview:r.value.includes(Dm),canOpenTakeInUpdate:r.value.includes(MA),canOpenTakeInWoohoo:r.value.includes(OA),canDeleteRendition:((q=U==null?void 0:U.media)==null?void 0:q.has_delete_rendition_permission)??!1,canDeleteThumbnail:(U==null?void 0:U.has_edit_thumbnail_permission)??!1,canArchiveScene:U==null?void 0:U.has_archive_permission,canUnarchiveScene:U==null?void 0:U.has_archive_permission,canDeleteScene:(U==null?void 0:U.has_delete_permission)??!1}}),c=Z(()=>({project:Lo({type:"project",config:a.value}).url,take_review:Lo({type:"review_take",config:a.value}).url,review:Lo({type:"review_scene",config:a.value}).url,review_scene:Lo({type:"review_scene",config:a.value}).url,woohoo:Lo({type:"woohoo",config:a.value}).url,update:Lo({type:"update",config:a.value}).url,scene_hub:Lo({type:"scene_hub",config:a.value}).url})),u=(U,q)=>{const Q=U.metaKey||U.ctrlKey,X=c.value[q]||"";if(X){if(q==="scene_hub"){if(Q){window.open(X,"_blank");return}if(!o){console.error("Switch instance not found.",{openSceneHub:o,windowFunc:globalThis.window.$switchInstance});return}o(a.value.scene_id||"");return}Q?window.open(X,"_blank"):window.location.href=X}},d=async(U,q)=>{var Q;try{const X=await((Q=e.value.axiosService.value)==null?void 0:Q.deleteRendition({workspaceId:a.value.ws_code,itemIds:[a.value.scene_id||""],deleteAll:!0}));(X==null?void 0:X.message)!="Done"&&console.error("Failed to delete rendition.")}catch(X){console.error("Error deleting rendition",X)}finally{s()}},h=async(U,q)=>{var Q;try{await((Q=e.value.axiosService.value)==null?void 0:Q.deleteThumbnail({workspaceId:a.value.ws_code,itemIds:[a.value.scene_id||""]}))}catch(X){console.error("Error deleting thumbnail",X)}finally{s()}},f=async(U,q)=>{var Q;try{const X=await((Q=e.value.axiosService.value)==null?void 0:Q.archiveScene(a.value.ws_code,a.value.entity_id,[a.value.scene_id]));(X==null?void 0:X.message)!="Done"&&console.error("Failed to archive scene."),q&&q("archived")}catch(X){console.error("Error archiving item",X)}finally{s()}},p=async(U,q)=>{var Q;try{const X=await((Q=e.value.axiosService.value)==null?void 0:Q.deleteScene(a.value.ws_code,a.value.entity_id,a.value.scene_id));(X==null?void 0:X.message)!="Done"&&console.error("Failed to delete scene."),q&&q("deleted")}catch(X){console.error("Error deleting item",X)}finally{s()}},g=U=>{const q=c.value.scene_hub||"";q&&(navigator.clipboard.writeText(q),s())},v=async(U,q)=>{var Q;try{const X=await((Q=e.value.axiosService.value)==null?void 0:Q.unarchiveScene(a.value.ws_code,a.value.entity_id,[a.value.scene_id]));(X==null?void 0:X.message)!="Done"&&console.error("Failed to unarchive scene."),q&&q("unarchived")}catch(X){console.error("Error unarchiving item",X)}finally{s()}},y=U=>u(U,"scene_hub"),b=U=>u(U,"review_scene"),{tooltip:S,copyToClipboard:C}=wb(c.value.scene_hub||"",void 0,!0),E=U=>{C(U)},_=U=>n(U),x=U=>u(U,"review"),A=U=>u(U,"update"),k=U=>u(U,"woohoo"),T=U=>d(),D=U=>h(),F=U=>f(U,t),P=U=>v(U,t),$=U=>p(U,t),ne=Z(()=>{let U=[];return!a.value.scene_id&&e.value.optionBlock&&U.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length?e.value.optionBlock:[{id:"quick-actions",groupLabel:"Quick actions",type:"row",options:[{id:"scene-tile",label:"",icon:"CustomSceneHub",description:"Full view",action:y,hide:!l.value.canOpenSceneHub,type:"icon"},{id:"open-in-arbo-review",label:"",icon:"PenRuler",description:"Open in Review",action:b,hide:!l.value.canOpenReview,type:"icon"},{id:"copy-link",label:"",icon:"Link",description:S.value,action:E,hide:!l.value.canCopyLink,type:"icon"}]},{id:"action",groupLabel:"Action",type:"column",options:[{id:"rename",label:"Rename",icon:"Pen",action:_,hide:!l.value.canRename,type:"icon"}]},{id:"download-options-take",type:"column",groupLabel:"Download Options",options:[{id:"open-take-in",label:"Open in",icon:"ArrowUpRightFromSquare",subMenu:{id:"sub-menu",type:"column",groupLabel:"Sub Menu",options:[{id:"review",label:"Review",icon:"PenRuler",action:x,hide:!l.value.canOpenTakeInReview,type:"icon"},{id:"update",label:"Update",icon:"UserCheck",action:A,hide:!l.value.canOpenTakeInUpdate,type:"icon"},{id:"woohoo-details",label:"Woohoo Details",icon:"ChartPie",action:k,hide:!l.value.canOpenTakeInWoohoo,type:"icon"}]}}]},{id:"download-options-delete",type:"column",groupLabel:"Download Options",options:[{id:"delete-rendition",label:"Delete rendition",icon:"Clapperboard",action:T,hide:!l.value.canDeleteRendition,type:"icon"},{id:"delete-thumbnail",label:"Delete thumbnail",icon:"Image",action:D,hide:!l.value.canDeleteThumbnail,type:"icon"}]},{id:"download-options-archive",type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:F,hide:l.value.canArchiveScene==0,disabled:l.value.canArchiveScene!==1,description:l.value.canArchiveScene==-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:P,hide:l.value.canUnarchiveScene==0,disabled:l.value.canUnarchiveScene!==1,description:l.value.canUnarchiveScene===-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:$,hide:!l.value.canDeleteScene,type:"icon"}]}]});return{linkMap:c,handleOpen:u,copyLink:g,deleteRendition:d,deleteThumbnail:h,archiveItem:f,deleteItem:p,unArchiveItem:v,options:ne}};function vo(e){const t=B(!1),n=B(!1),o=Z(()=>{var d;const c=e.value,u=!!c.readOnly;return{readOnly:u,disabled:!!c.disabled,hovered:n.value,focused:t.value,isEmpty:c.empty??!1,error:!!c.error,actived:!!((d=c.active)!=null&&d.value),clickable:u?!1:c.clickable??!1}}),s=()=>{t.value=!0,_t(()=>{const c=l(e.value.inputRef);c==null||c.focus()})},i=()=>{t.value=!1},r=()=>{n.value=!0},a=()=>{n.value=!1},l=c=>{if(!c)return null;const u=c.value||c;return(u instanceof HTMLElement?u:u==null?void 0:u.$el)||null};return Xt(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.addEventListener("focus",s),c.addEventListener("blur",i)),u&&(u.addEventListener("mouseenter",r),u.addEventListener("mouseleave",a))}),lo(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.removeEventListener("focus",s),c.removeEventListener("blur",i)),u&&(u.removeEventListener("mouseenter",r),u.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:o,handleFocus:s}}const Ru=e=>{const t=B(!1),n=Z(()=>t.value);return Xt(()=>{var a,l,c,u;const o=(a=e.params)==null?void 0:a.api,s=(l=e.params)==null?void 0:l.node,i=s==null?void 0:s.rowIndex,r=(u=(c=e.params)==null?void 0:c.colDef)==null?void 0:u.field;return o==null||o.addEventListener("cellEditingStarted",d=>{d.rowIndex===i&&d.colDef.field===r&&(t.value=!0)}),o==null||o.addEventListener("cellEditingStopped",d=>{d.rowIndex===i&&d.colDef.field===r&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}},NA=St(it({__name:"StatusBadge",props:{size:{default:16},color:{default:"#02C39A"},label:{default:""},status:{default:"active"},statusTooltip:{default:"Online"},showBadge:{type:Boolean,default:!0},loading:{type:Boolean}},setup(e){const t=as,{triggerRef:n,popupRef:o}=eo({trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),s=Z(()=>{switch(i.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"#02C39A"}}),i=e;return(r,a)=>(j(),ae("div",{class:J(r.$style["status-badge-wrapper"]),style:cn({"--badge-size":`${i.size}px`,"--badge-color":s.value})},[Pt(r.$slots,"default"),Ue(ge("div",{class:J(r.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[_i,i.showBadge],[H(t),{isLoading:i.loading,fullwidth:!0}]]),ge("div",{ref_key:"popupRef",ref:o,class:J(r.$style["badge-tooltip"])},yt(i.statusTooltip),3)],6))}}),[["__cssModules",{$style:{"status-badge-wrapper":"_status-badge-wrapper_1rb3z_1","badge-indicator":"_badge-indicator_1rb3z_6",active:"_active_1rb3z_19",offline:"_offline_1rb3z_22",busy:"_busy_1rb3z_25",away:"_away_1rb3z_28","badge-tooltip":"_badge-tooltip_1rb3z_32"}}]]),Yh=Yl("switchStore",()=>{const e=B(null),t=En("switchInstance");return{openSceneHub:(s,i)=>{if(s){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");t("scene_hub",{id:s,commentId:i},{showLoading:!1})}},openPeopleInsight:s=>{const i=t||e.value;if(!i)throw console.error("Switch instance not found"),new Error("Switch instance not found");s||console.trace("No people_id provided, defaulting to empty string"),i("people_insight",{tab:"home",id:s||""},{showLoading:!1})},switchInstanceFunc:e}}),nY=it({__name:"MiniPeopleCard",props:{user:{},status:{default:"active"},timezone:{default:sm()},userConfig:{default:()=>({size:96,isUseShortLabel:!0,bgColor:"#E0E0E0",color:"#757575",isMe:!1})},showInsightButton:{type:Boolean,default:!0},showCopyLinkButton:{type:Boolean,default:!0},apiUpdateFunction:{type:Function,default:void 0},refreshInterval:{default:3e4},enableAutoRefresh:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},private:{type:Boolean,default:!1}},emits:["insightClick","copyLink","dataUpdated"],setup(e,{emit:t}){const n=Yt,o=as,s=e,i=t,r={active:"Active in the last 10 minutes",offline:"Logged out of TESSR",busy:"User is busy",away:"No activity in the last 10 minutes"},a={active:"#02C39A",offline:"#808080",busy:"#FF0000",away:"#F7941D"},l=B(s.status),c=B(s.timezone),u=B(!0),d=B(null),h=Z(()=>r[l.value]),f=Z(()=>a[l.value]),p=Z(()=>{var P;return(P=s.user)==null?void 0:P.name}),g=B(!1),v=Z(()=>c.value?u7(c.value,"HH:mm"):""),y=Z(()=>c.value?`(${d7(c.value)})`:""),b=async()=>{var P,$,ne;if(s.apiUpdateFunction)try{const U=await s.apiUpdateFunction(s.user.id);if(!U){g.value=!0,console.error("No data returned from API");return}(P=U==null?void 0:U.private_info)!=null&&P.is_offline?l.value="offline":($=U.private_info)!=null&&$.last_active?l.value="active":l.value="away",(ne=U.private_info)!=null&&ne.timezone&&(c.value=U.private_info.timezone),i("dataUpdated",U)}catch(U){g.value=!0,console.error("Failed to fetch user data:",U)}finally{u.value=!1}},S=()=>{!s.apiUpdateFunction||!s.enableAutoRefresh||(d.value!==null&&clearInterval(d.value),d.value=setInterval(b,s.refreshInterval))},C=()=>{d.value!==null&&(clearInterval(d.value),d.value=null)},E=Z(()=>{const P=globalThis.location.origin,$=Cn.getInstance().getItem("ws.code");return Lo({type:"people_insight",config:{ws_code:$,baseDomain:P,user_id:s.user.id}}).url}),{copyToClipboard:_,tooltip:x}=wb(E.value,()=>i("copyLink",s.user.id)),A=Yh(),{openPeopleInsight:k}=A,T=P=>{if(P.ctrlKey||P.metaKey){window.open(E.value,"_blank");return}try{k(String(s.user.id))}catch{window.open(E.value,"_blank")}},D=P=>{T(P),i("insightClick",s.user.id)};Je([()=>s.enableAutoRefresh,()=>s.refreshInterval,()=>s.apiUpdateFunction],()=>{C(),s.enableAutoRefresh&&s.apiUpdateFunction&&S()}),Xt(async()=>{s.apiUpdateFunction&&(await b(),S())}),lo(C);const F=Z(()=>({name:s.user.name,initial:s.user.initial,id:s.user.id,profile_image:s.user.profile_image,color:s.user.color,size:98}));return(P,$)=>(j(),ae("div",{class:J([P.$style["mini-people-card"],{[P.$style.loading]:u.value},"bg-skeleton"])},[ge("div",{class:J(P.$style["avatar-section"])},[!s.private&&!g.value?(j(),ze(NA,{key:0,size:16,status:l.value,loading:u.value,"status-tooltip":h.value},{default:pe(()=>[ce(Sh,qt({readOnly:!0},F.value),null,16)]),_:1},8,["status","loading","status-tooltip"])):(j(),ze(Sh,qt({key:1,readOnly:!0},F.value),null,16))],2),ge("div",{class:J(P.$style["user-info"])},[ge("div",{class:J(P.$style["info-row"])},[ge("h3",{class:J(P.$style["user-name"])},yt(p.value),3),!s.private&&!g.value?Ue((j(),ae("span",{key:0,class:J(P.$style["status-badge"]),style:cn({color:f.value})},[nt(yt(l.value),1)],6)),[[H(o),{isLoading:u.value,fullwidth:!0}]]):Ze("",!0)],2),c.value&&!g.value?(j(),ae("div",{key:0,class:J([P.$style["info-row"],P.$style["time-row"]])},[Ue((j(),ae("div",{class:J(P.$style["time-display"])},[ce(rt,{source:"remote",src:"Clock",class:J(P.$style["clock-icon"])},null,8,["class"]),ge("span",{class:J(P.$style["time-text"])},[ge("strong",null,yt(v.value),1),ge("span",{class:J(P.$style.separator)},"|",2),ge("span",null,yt(y.value),1)],2)],2)),[[H(o),{isLoading:u.value,fullwidth:!0}]])],2)):Ze("",!0),!e.readOnly&&!s.private&&!g.value?(j(),ae("div",{key:1,class:J([P.$style["info-row"],P.$style.actions])},[e.showInsightButton?(j(),ze(ct,{key:0,label:"Insights",variant:"primary",size:"default",style:{flex:"1"},onClick:Tt(D,["prevent","stop"]),disabled:s.disabled},null,8,["disabled"])):Ze("",!0),e.showCopyLinkButton?Ue((j(),ze(ct,{key:1,variant:["icon","secondary"],size:"default","aria-label":"Copy link",onClick:Tt(H(_),["prevent","stop"]),disabled:s.disabled},{default:pe(()=>[ce(rt,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[H(n),{content:H(x),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Ze("",!0)],2)):Ze("",!0)],2)],2))}}),oY=St(nY,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_i0gsv_1",loading:"_loading_i0gsv_21","avatar-section":"_avatar-section_i0gsv_24","user-info":"_user-info_i0gsv_29","info-row":"_info-row_i0gsv_35","time-row":"_time-row_i0gsv_42","time-display":"_time-display_i0gsv_48","time-text":"_time-text_i0gsv_53","actions-row":"_actions-row_i0gsv_60","user-name":"_user-name_i0gsv_64","status-badge":"_status-badge_i0gsv_75",active:"_active_i0gsv_88",offline:"_offline_i0gsv_91",busy:"_busy_i0gsv_94",away:"_away_i0gsv_97","user-local-time":"_user-local-time_i0gsv_100","clock-icon":"_clock-icon_i0gsv_108",separator:"_separator_i0gsv_120",timezone:"_timezone_i0gsv_123","refresh-btn":"_refresh-btn_i0gsv_126",spinning:"_spinning_i0gsv_129",spin:"_spin_i0gsv_129","insight-btn":"_insight-btn_i0gsv_132","copy-link-btn":"_copy-link-btn_i0gsv_136","last-update":"_last-update_i0gsv_139","loading-overlay":"_loading-overlay_i0gsv_145","loading-spinner":"_loading-spinner_i0gsv_157"}}]]),sY=St(it({name:"MoreOption",__name:"MoreOption",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e,{expose:t}){const n=Ur,o=Yt,s=e,{isEditing:i}=Ru(s),r=()=>{var h,f;const u=(h=s.params)==null?void 0:h.api,d={rowIndex:(f=u==null?void 0:u.getRowNode(String(s.id)))==null?void 0:f.rowIndex,colKey:"options"};u==null||u.startEditingCell(d)},a=Z(()=>{var d,h;const u=(h=(d=s.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(s.id));return((u==null?void 0:u.rowIndex)??0)+10}),l=()=>{var u,d;(d=(u=s.params)==null?void 0:u.api)==null||d.stopEditing()},c=B();return t({focus(){var u;(u=c.value)==null||u.focus()},blur(){var u,d;console.log("Blurring MoreOption button for row:",s.id,(u=c.value)==null?void 0:u.blur),(d=c.value)==null||d.blur()}}),(u,d)=>Ue((j(),ze(ct,{class:J(u.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:H(i),onClick:Tt(r,["stop"]),onEscape:l,ref_key:"buttonRef",ref:c},{default:pe(()=>[ce(rt,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[H(o),"More actions"],[H(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_w8s4g_1"}}]]),iY=["src","width","height","alt"],Tm=St(it({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=as,{getCachedValue:n,setCachedValue:o}=wh({dbName:"visual-cache-db",storeName:"visuals"}),s=h=>{if(h!==void 0)return typeof h=="number"?`${h}px`:typeof h=="string"&&/^\d+$/.test(h)?`${h}px`:h},i=e,r=Z(()=>({minWidth:s(i.minWidth),maxWidth:s(i.maxWidth),minHeight:s(i.minHeight),maxHeight:s(i.maxHeight),aspectRatio:i.ratio,width:s(i.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await o(h,f)},c=Z(()=>({name:i.src,size:Number(i.size||100),color:""})),{url:u,loading:d}=jT(c,"visual",l,a);return(h,f)=>Ue((j(),ae("div",{class:J([h.$style.visualWrapper,{[h.$style.loading]:H(d)}]),style:cn(r.value)},[ge("img",{src:H(u),width:e.size,height:e.size,alt:"visual-"+e.src,style:cn(r.value)},null,12,iY)],6)),[[H(t),{isLoading:H(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),ei=St(it({name:"ListItem",directives:{tooltip:Yt},__name:"ListItem",props:{label:{},value:{},type:{},selected:{type:Boolean},disabled:{type:Boolean},hover:{type:Boolean},clickable:{type:Boolean,default:!0},danger:{type:Boolean},data:{},icon:{},readOnly:{type:Boolean,default:!1},show:{type:Boolean},focusIndex:{}},emits:["click","handleClick","keydown","update:selected","select","escape"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=B(!1),r=B(!1);function a(_){if(!_||typeof _!="object")return!1;const x=_;return typeof x.name=="string"&&typeof x.id=="string"&&typeof x.initial=="string"}const l=Z(()=>o.type==="status"||o.type==="assignee"||o.type==="icon"||!!E.prefix),c=Z(()=>!!E.suffix||o.danger&&i.value),u=Z(()=>{var _;return o.type==="status"&&typeof((_=o.data)==null?void 0:_.color)=="string"?{backgroundColor:o.data.color,border:bh(o.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),d=dg(),h=Z(()=>({[d.active]:o.selected??!1,[d.disabled]:o.disabled??!1,[d.hover]:o.hover??!1,[d.clickable]:(o.clickable??!0)&&!o.disabled,[d.danger]:o.danger??!1,[d["has-prefix"]]:l.value,[d["has-suffix"]]:c.value,[d.readOnly]:o.readOnly})),f=Z(()=>({content:"Cancel",...C})),p=Z(()=>({content:"Confirm",theme:"warning",...C}));function g(_){return{name:_.name,initial:_.initial,id:_.id,profile_image:_.profile_image??null,color:_.color,size:24}}function v(){i.value=!1}function y(_){_?s("click",_):(o.clickable??!0)&&(s("update:selected",!o.selected),s("select",!o.selected))}function b(_){if(!o.disabled){if(o.danger&&!i.value){i.value=!0;return}else o.danger||y(_);s("handleClick",_)}}const S=()=>{i.value?v():s("escape")},C=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),E=ww();return Je(()=>o.show,_=>{_===!1&&(i.value=!1)}),t({select:()=>{b(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(_,x)=>{const A=bs("tooltip"),k=bs("focusable");return Ue((j(),ze(ct,{variant:["menu-item"],class:J([_.$style["list-item"],h.value]),onHandleClick:b,onMouseenter:x[0]||(x[0]=T=>r.value=!0),onMouseleave:x[1]||(x[1]=T=>r.value=!1),onEscape:S},{default:pe(()=>[l.value?(j(),ae("div",{key:0,class:J(_.$style["list-item__prefix"])},[Pt(_.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(j(),ze(rt,{key:0,src:e.icon,source:"remote",class:J(_.$style["item-icon"])},null,8,["src","class"])):e.type==="status"?(j(),ae("div",{key:1,class:J(_.$style["status-indicator"]),style:cn(u.value)},null,6)):e.type==="assignee"&&a(e.data)?(j(),ze(Sh,qt({key:2},g(e.data),{class:_.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Ze("",!0)])],2)):Ze("",!0),ge("div",{class:J(_.$style["list-item__label"])},[Pt(_.$slots,"label",{selected:e.selected},()=>[nt(yt(e.label),1)])],2),c.value?(j(),ae("div",{key:1,class:J(_.$style["list-item__suffix"])},[Pt(_.$slots,"suffix",{item:_.$props,hovered:r.value},()=>[e.danger&&i.value?(j(),ae("div",{key:0,class:J(_.$style["confirm-action"])},[Ue((j(),ze(ct,{variant:["secondary","icon"],size:"small",onClick:Tt(v,["stop","prevent"])},{default:pe(()=>[ce(rt,{src:"Xmark",source:"remote"})]),_:1})),[[A,f.value]]),Ue((j(),ze(ct,{variant:["danger","primary","icon"],size:"small",onClick:Tt(y,["stop","prevent"])},{default:pe(()=>[ce(rt,{src:"Check",source:"remote"})]),_:1})),[[A,p.value]])],2)):Ze("",!0)])],2)):Ze("",!0)]),_:3},8,["class"])),[[k,o.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_1isqe_1",disabled:"_disabled_1isqe_15",danger:"_danger_1isqe_22","has-prefix":"_has-prefix_1isqe_25","has-suffix":"_has-suffix_1isqe_25",clickable:"_clickable_1isqe_39",readOnly:"_readOnly_1isqe_42",hover:"_hover_1isqe_46",active:"_active_1isqe_52","list-item__prefix":"_list-item__prefix_1isqe_77","list-item__label":"_list-item__label_1isqe_85","list-item__suffix":"_list-item__suffix_1isqe_99","status-indicator":"_status-indicator_1isqe_106","item-icon":"_item-icon_1isqe_112","arbo-icon-state":"_arbo-icon-state_1isqe_117","item-avatar":"_item-avatar_1isqe_120","confirm-action":"_confirm-action_1isqe_129"}}]]),rY=["tabindex"],yo=St(it({__name:"DisplayWrapper",props:{prefix:{},suffix:{},inputType:{},readOnly:{type:Boolean},disabled:{type:Boolean},hovered:{type:Boolean},focused:{type:Boolean},error:{type:Boolean},actived:{type:Boolean},clickable:{type:Boolean},size:{},bordered:{type:Boolean},tabIndex:{}},emits:["event","escape"],setup(e,{expose:t,emit:n}){const o=e,s=n;ww();const i=dg(),r=B(null),a=B("default"),l=Z(()=>{if(typeof o.size=="number")return`${o.size}px`;switch(o.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),c=Z(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),u=Z(()=>({[i["display-wrapper"]]:!0,[i.disabled]:o.disabled,[i.readOnly]:o.readOnly,[i.error]:o.error,[i.clickable]:o.clickable,[i.active]:o.actived,[i.hovered]:o.hovered,[i.focused]:!o.readOnly&&!o.disabled&&o.focused,[i.bordered]:o.bordered})),d=()=>{var C,E;const g=((C=r.value)==null?void 0:C.querySelectorAll(":scope > .wrapper-prefix").length)||0,v=((E=r.value)==null?void 0:E.querySelectorAll(":scope > .wrapper-suffix").length)||0,y="var(--icon-size)",S=`calc(var(--gap-size) * ${g+v})`;return g&&!v?`repeat(${g}, ${y}) calc(100% - (${g} * ${y} + ${S}))`:!g&&v?`calc(100% - (${v} * ${y} + ${S})) repeat(${v}, ${y})`:g&&v?`repeat(${g}, ${y}) calc(100% - (${g} * ${y} + ${v} * ${y} + ${S})) repeat(${v}, ${y})`:"100%"},h=B("100%"),f=()=>{h.value=d()};qd(()=>{f()}),Xt(()=>{f()});const p=g=>{a.value=g};return t({rootEl:r,updateState:p,componentState:a,focus:()=>{_t(()=>{var g;(g=r.value)==null||g.focus()})},escape:()=>{s("escape")}}),(g,v)=>(j(),ae("div",{ref_key:"rootEl",ref:r,class:J([H(i)["display-wrapper"],u.value]),tabindex:e.tabIndex,style:cn({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":c.value})},[Pt(g.$slots,"prefix",{hovered:o.hovered,focused:o.focused}),Pt(g.$slots,"default",{hovered:o.hovered,focused:o.focused,updateComponentState:p,disabled:o.disabled}),Pt(g.$slots,"suffix",{hovered:o.hovered,focused:o.focused})],14,rY))}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_11gbb_1",readOnly:"_readOnly_11gbb_26",bordered:"_bordered_11gbb_29",disabled:"_disabled_11gbb_29",active:"_active_11gbb_29",focused:"_focused_11gbb_29",hovered:"_hovered_11gbb_34",error:"_error_11gbb_38",clickable:"_clickable_11gbb_51",suffix:"_suffix_11gbb_57",prefix:"_prefix_11gbb_58"}}]]),aY=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const lY=Object.prototype.toString,cY=e=>lY.call(e)==="[object Object]",Du=()=>{};function uY(e,t){function n(...o){return new Promise((s,i)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(s).catch(i)})}return n}function dY(e,t={}){let n,o,s=Du;const i=l=>{clearTimeout(l),s(),s=Du};let r;return l=>{const c=Nr(e),u=Nr(t.maxWait);return n&&i(n),c<=0||u!==void 0&&u<=0?(o&&(i(o),o=void 0),Promise.resolve(l())):new Promise((d,h)=>{s=t.rejectOnCancel?h:d,r=l,u&&!o&&(o=setTimeout(()=>{n&&i(n),o=void 0,d(r())},u)),n=setTimeout(()=>{o&&i(o),o=void 0,d(l())},c)})}}function Yb(e){return Array.isArray(e)?e:[e]}function hY(e,t=200,n={}){return uY(dY(t,n),e)}function fY(e,t,n){return Je(e,t,{...n,immediate:!0})}const LA=aY?window:void 0;function Zh(e){var t;const n=Nr(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function Zb(...e){const t=(o,s,i,r)=>(o.addEventListener(s,i,r),()=>o.removeEventListener(s,i,r)),n=Z(()=>{const o=Yb(Nr(e[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return fY(()=>{var o,s;return[(o=(s=n.value)===null||s===void 0?void 0:s.map(i=>Zh(i)))!==null&&o!==void 0?o:[LA].filter(i=>i!=null),Yb(Nr(n.value?e[1]:e[0])),Yb(H(n.value?e[2]:e[1])),Nr(n.value?e[3]:e[2])]},([o,s,i,r],a,l)=>{if(!(o!=null&&o.length)||!(s!=null&&s.length)||!(i!=null&&i.length))return;const c=cY(r)?{...r}:r,u=o.flatMap(d=>s.flatMap(h=>i.map(f=>t(d,h,f,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function Xb(e,t,n={}){const{window:o=LA,ignore:s=[],capture:i=!0,detectIframe:r=!1,controls:a=!1}=n;if(!o)return a?{stop:Du,cancel:Du,trigger:Du}:Du;let l=!0;const c=v=>Nr(s).some(y=>{if(typeof y=="string")return Array.from(o.document.querySelectorAll(y)).some(b=>b===v.target||v.composedPath().includes(b));{const b=Zh(y);return b&&(v.target===b||v.composedPath().includes(b))}});function u(v){const y=Nr(v);return y&&y.$.subTree.shapeFlag===16}function d(v,y){const b=Nr(v),S=b.$.subTree&&b.$.subTree.children;return S==null||!Array.isArray(S)?!1:S.some(C=>C.el===y.target||y.composedPath().includes(C.el))}const h=v=>{const y=Zh(e);if(v.target!=null&&!(!(y instanceof Element)&&u(e)&&d(e,v))&&!(!y||y===v.target||v.composedPath().includes(y))){if("detail"in v&&v.detail===0&&(l=!c(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[Zb(o,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:i}),Zb(o,"pointerdown",v=>{const y=Zh(e);l=!c(v)&&!!(y&&!v.composedPath().includes(y))},{passive:!0}),r&&Zb(o,"blur",v=>{setTimeout(()=>{var y;const b=Zh(e);((y=o.document.activeElement)===null||y===void 0?void 0:y.tagName)==="IFRAME"&&!(b!=null&&b.contains(o.document.activeElement))&&t(v)},0)},{passive:!0})].filter(Boolean),g=()=>p.forEach(v=>v());return a?{stop:g,cancel:()=>{l=!1},trigger:v=>{l=!0,h(v),l=!1}}:g}const pY=["type","value","placeholder","disabled","readonly","inputmode","maxlength"],Jb=St(it({__name:"InputText",props:{type:{default:"text"},autoEmit:{type:Boolean,default:!1},debounceDelay:{default:300},selectOnFocus:{type:Boolean,default:!1},submitOnEnter:{type:Boolean,default:!0},blurOnEscape:{type:Boolean,default:!0},modelValue:{},placeholder:{},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{}},emits:["update:modelValue","input","clear","focus","blur","change","enterValue","enter","escape","cancel","tab","keydown","keyup","paste","cut","select","onValidation"],setup(e,{expose:t,emit:n}){const o=Ur,s=Yt,i=e,r=n,a=B(null),l=B(i.modelValue||"");Je(l,()=>{r("onValidation",l.value)});const c=B(!1),u=B(i.modelValue||"");Je(()=>i.modelValue,M=>{l.value=M||"",u.value=M||""});const d=Z(()=>{var M;return((M=l.value)==null?void 0:M.length)>0}),h={text:M=>M.slice(0,i.maxLength||255),number:M=>{let Y=M.replace(/[^\d.-]/g,"");const L=Y.split(".");L.length>2&&(Y=L[0]+"."+L.slice(1).join("")),Y=Y.replace(/-/g,(fe,Le)=>Le===0?fe:"");const se=Y.replace(/[.-]/g,"");if(se.length>17){const fe=Y.includes("."),Me=Y.startsWith("-")?"-":"";if(fe){const[Ke,z]=Y.replace("-","").split(".");if(Ke.length+z.length>17){const re=17-Ke.length;Y=Me+Ke+"."+z.substring(0,Math.max(0,re))}}else Y=Me+se.substring(0,17)}return Y},email:M=>M.replace(/\s/g,"").slice(0,i.maxLength||255),url:M=>M.replace(/\s/g,"").slice(0,i.maxLength||255),tel:M=>M.replace(/[^\d+\-() ]/g,"").slice(0,i.maxLength||20)},f=M=>{const Y=h[i.type];return Y?Y(M):M},p=hY(M=>{i.autoEmit&&(r("update:modelValue",M),r("input",M))},i.debounceDelay),g=M=>{const Y=M;if(i.disabled||i.readOnly){Y.preventDefault();return}const L=Y.target,se=L.selectionStart||0,fe=l.value,Le=f(L.value);fe!==Le&&(l.value=Le,r("input",Le),i.autoEmit&&p(Le),L.value!==Le&&(L.value=Le,_t(()=>{let Me=se;if(Le.length<L.value.length)Me=se;else{const Ke=Le.length-fe.length;Me=se+Ke}Me=Math.max(0,Math.min(Me,Le.length)),L.setSelectionRange(Me,Me)})))},v=M=>{if(i.disabled||i.readOnly){M.preventDefault();return}c.value=!0;const Y=l.value;l.value="",r("update:modelValue",""),r("clear"),Y!==""&&r("change",""),M.preventDefault(),M.stopImmediatePropagation(),M.stopPropagation(),_t(()=>{var L;(L=a.value)==null||L.focus(),setTimeout(()=>{c.value=!1},100)})},y=M=>{i.disabled||i.readOnly||(r("focus",M),i.selectOnFocus&&_t(()=>{M.target.select()}))},b=M=>{if(c.value)return;const L=M.target.value;i.autoEmit||r("update:modelValue",L),u.value!==L&&(r("change",L),u.value=L),r("blur",L,M)},S=M=>{const L=M.target.value;r("enter",L,M),r("enterValue",L),i.submitOnEnter&&(M.preventDefault(),i.autoEmit||r("update:modelValue",L),u.value!==L&&(r("change",L),u.value=L))},C=M=>{const Y=M.target,L=Y.value;if(r("escape",L,M),M.preventDefault(),M.stopImmediatePropagation(),M.stopPropagation(),i.autoEmit){r("cancel"),i.blurOnEscape&&Y.blur();return}l.value=i.modelValue||"",a.value&&(a.value.value=l.value),r("cancel"),i.blurOnEscape&&Y.blur()},E=M=>{const L=M.target.value;r("tab",L,M),i.autoEmit||(r("update:modelValue",L),u.value!==L&&(r("change",L),u.value=L))},_=M=>{if(r("keydown",M),M.key===" "&&M.stopPropagation(),i.type==="number"&&(M.key==="e"||M.key==="E")){M.preventDefault();return}M.key==="Escape"?C(M):M.key==="Enter"?S(M):M.key==="Tab"?E(M):(M.key==="ArrowUp"||M.key==="ArrowDown")&&i.type==="number"&&M.preventDefault()},x=M=>{r("keyup",M)},A=M=>{if(i.disabled||i.readOnly){M.preventDefault();return}r("paste",M)},k=M=>{if(i.disabled||i.readOnly){M.preventDefault();return}r("cut",M)},T=M=>{r("select",M)},D=`input-text-${Math.random().toString(36).substr(2,9)}`,F=B(!1),P=Z(()=>{switch(i.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});Je(()=>l.value,M=>{i.validatorFnc?F.value=!!M&&!i.validatorFnc(M):F.value=!1});const $=B(null),ne=Z(()=>({disabled:i.disabled,readOnly:i.readOnly,error:F.value,inputRef:a,clickable:!i.disabled&&!i.readOnly,focused:i.focused,wrapperRef:$,bordered:!0})),{argsMain:U,isHover:q,isFocus:Q}=vo(ne);t({triggerFocus:()=>{_t(()=>{var M;(M=a.value)==null||M.focus()})},focus:()=>{X()},blur:()=>{_t(()=>{var M;(M=a.value)==null||M.blur()})},select:()=>{_t(()=>{var M;(M=a.value)==null||M.select()})},setSelectionRange:(M,Y)=>{_t(()=>{var L;(L=a.value)==null||L.setSelectionRange(M,Y)})},getValue:()=>l.value,setValue:M=>{l.value=f(M),a.value&&(a.value.value=l.value)}});const X=()=>{!i.disabled&&!i.readOnly&&_t(()=>{var M;(M=a.value)==null||M.focus()})},he=Z(()=>Q.value&&d.value);return(M,Y)=>(j(),ae("div",{class:J([M.$style["input-wrapper"],"input-editor"]),onClick:X},[Ue((j(),ze(yo,qt(H(U),{ref_key:"wrapperRef",ref:$,class:[M.$style["input-box"],{[M.$style["is-hovered"]]:H(q),[M.$style["is-focused"]]:H(Q),[M.$style["has-input"]]:d.value,[M.$style["is-editting"]]:he.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:i.bordered}),{prefix:pe(()=>[Pt(M.$slots,"prefix")]),suffix:pe(()=>[d.value&&!i.disabled&&!i.readOnly?Pt(M.$slots,"clear",{key:0},()=>[Ue((j(),ze(ct,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:Tt(v,["prevent","stop"]),size:18,rounded:!0,class:J(["wrapper-suffix",M.$style["clear-button"]])},{default:pe(()=>[ce(rt,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[H(s),{content:"Clear",contentClass:"extra-padding"}]])]):Pt(M.$slots,"suffix",{key:1})]),default:pe(()=>[ge("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:i.type||"text",value:l.value,placeholder:e.placeholder,class:J([M.$style["column-config__input"]]),id:D,disabled:e.disabled,readonly:e.readOnly,inputmode:P.value,maxlength:i.maxLength,onInput:g,onFocus:y,onBlur:b,onKeydown:_,onKeyup:x,onPaste:A,onCut:k,onSelect:T},null,42,pY)]),_:3},16,["class","bordered"])),[[H(o),i.focusIndex]]),F.value?Pt(M.$slots,"error",{key:0}):Ze("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_1eozu_1","is-disabled":"_is-disabled_1eozu_15","is-readonly":"_is-readonly_1eozu_15","is-hovered":"_is-hovered_1eozu_15","is-focused":"_is-focused_1eozu_19","column-config__input":"_column-config__input_1eozu_39","clear-button":"_clear-button_1eozu_54"}}]]),gY={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},Qb=it({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search"},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{default:void 0}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=B(null),r=Di(c=>{s("update:modelValue",c),s("search",c)},sr),a=()=>{s("update:modelValue",""),s("clear"),_t(()=>{var c;(c=i.value)==null||c.focus()})},l=B(o.modelValue);return t({focus:()=>{var c;(c=i.value)==null||c.focus()},setValue(c){l.value=c}}),(c,u)=>(j(),ze(Jb,{focusIndex:o.focusIndex,ref_key:"searchInput",ref:i,modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:H(r),onClear:a,onCancel:u[1]||(u[1]=d=>s("cancel")),"auto-emit":!0},{prefix:pe(()=>[ge("div",gY,[ce(rt,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),mY=["aria-activedescendant"],vY=["innerHTML"],yY=10,Jr=St(it({__name:"SearchList",props:{options:{default:()=>[]},selectedId:{},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},error:{default:null},params:{},maxHeight:{default:"282px"},width:{default:"200px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const o=Yt,s={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},i=e,r=n,a=B(""),l=B(-1),c=B(null),u=B(null),d=B(new Map),h=Z(()=>gb(a.value)),f=()=>{const M=h.value;if(!M||M.length<i.minQueryLength)return i.options;if(d.value.has(M))return d.value.get(M);const Y=i.options.map(L=>({item:L,score:m7(` ${L.label} `,M)})).filter(({score:L})=>L>0).sort((L,se)=>se.score-L.score).map(({item:L})=>L);return d.value.set(M,Y),Y},p=B([]);Je(()=>i.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=Z(()=>i.hasMore&&!i.loading&&!i.loadingMore),v=Di(M=>{a.value=M,l.value=-1,r("search",M)},sr),y=async M=>{X.value=0,await v(M||""),X.value=1},b=M=>a.value?v7(M,a.value):M,S=M=>{const L={[s.ARROW_DOWN]:()=>C(M),[s.ARROW_UP]:()=>E(M),[s.ENTER]:()=>A(M),[s.ESCAPE]:()=>k(M),[s.TAB]:()=>T(M)}[M.key];L&&L()},C=M=>{M.preventDefault(),_(1)},E=M=>{M.preventDefault(),_(-1)},_=M=>{const Y=p.value.length;if(Y===0)return;let L;M>0?L=(l.value+1)%Y:l.value>0?L=l.value-1:L=Y-1,l.value=L,x()},x=()=>{_t(()=>{var Y;const M=(Y=u.value)==null?void 0:Y.querySelectorAll('[role="menuitem"]')[l.value];M==null||M.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},A=M=>{if(M.preventDefault(),l.value>=0&&l.value<p.value.length){const L=p.value[l.value];D(L,M)}},k=M=>{M.preventDefault(),P()},T=M=>{r("tab",M)},D=(M,Y)=>{!M||M.disabled||(r("select",M,Y),l.value=-1,P())},F=M=>{M>=0&&M<p.value.length&&(l.value=M)},P=()=>{r("close")},$=()=>{if(!g.value||!u.value)return;const{scrollTop:M,clientHeight:Y,scrollHeight:L}=u.value;L-(M+Y)<=yY&&r("loadMore")},ne=()=>{var M,Y,L;(M=u.value)==null||M.addEventListener("scroll",$),(L=(Y=Q.value)==null?void 0:Y.$el)==null||L.addEventListener("keydown",S)},U=()=>{var M,Y,L;(M=u.value)==null||M.removeEventListener("scroll",$),(L=(Y=Q.value)==null?void 0:Y.$el)==null||L.removeEventListener("keydown",S)};Xt(()=>{ne()}),lo(()=>{U()}),Je(()=>i.loading,M=>{!M&&p.value.length>0&&(l.value=-1)});const q=M=>M?Array.isArray(i.selectedId)?i.selectedId.includes(String(M.id)):i.selectedId==M.id:!1,Q=B(null);Je(l,()=>{x()}),t({focus:()=>{_t(()=>{var M;(M=Q.value)==null||M.focus()})},reset:()=>{var M;(M=Q.value)==null||M.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:P,clearSearch:()=>{a.value=""},scrollTo:M=>{u.value&&(u.value.scrollTop=M)},selectIndex:M=>{M>=0&&M<p.value.length&&(l.value=M,x())}});const X=B(0);Je([()=>i.loading,()=>a.value,()=>i.options,()=>i.loadingMore],()=>{const M=i.options.length>0&&p.value.length>0,Y=!M&&a.value.length>0,L=!M&&a.value.length===0;i.loading?X.value=0:M?X.value=1:Y?X.value=2:L&&(X.value=3)},{immediate:!0,deep:!0});const he=()=>{r("cancel")};return(M,Y)=>(j(),ae("datalist",{ref_key:"searchListRef",ref:c,class:J([M.$style["search-list"],X.value===3||X.value===2?M.$style.empty:"",p.value.length>8?M.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:cn({width:e.width})},[ce(Qb,{ref_key:"searchBoxRef",ref:Q,modelValue:a.value,"onUpdate:modelValue":Y[0]||(Y[0]=L=>a.value=L),class:J(M.$style["search-box"]),disabled:e.loading,onSearch:y,onClear:Y[1]||(Y[1]=L=>y("")),onCancel:he},null,8,["modelValue","class","disabled"]),ge("div",{ref_key:"popupRef",ref:u,class:J(M.$style["list-container"]),style:cn({maxHeight:e.maxHeight})},[Pt(M.$slots,"extra-item",{query:a.value}),(j(!0),ae(xt,null,xn(p.value,(L,se)=>Ue((j(),ae("div",{key:`${L.id}-${se}`,role:"menuitem"},[Pt(M.$slots,"item",{item:L,index:se,selectedIndex:l.value,isSelected:q,handleSelect:D,handleItemHover:F,getHighlightedLabel:b,query:a.value,idx:se},()=>[L.hide?Ze("",!0):(j(),ze(ei,qt({key:0,ref_for:!0},L,{hover:se===l.value,selected:q(L),type:L.type,id:`item-${se}`,"aria-selected":se===l.value,onClick:fe=>D(L,fe),onMouseover:fe=>F(se),onEscape:P}),{prefix:pe(()=>[Pt(M.$slots,"prefix-item",{item:L})]),label:pe(()=>[a.value?Ue((j(),ae("span",{key:0,class:J(M.$style.match),innerHTML:b(L.label)},null,10,vY)),[[H(o),{content:L.label}]]):Ue((j(),ae("span",{key:1,class:J(M.$style["item-label"])},[nt(yt(L.label),1)],2)),[[H(o),{content:L.label}]])]),suffix:pe(({hovered:fe})=>[Pt(M.$slots,"action",{item:L,isHovered:se===l.value,hovered:fe,selected:l.value==se})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover"]))])])),[[_i,X.value===1]])),128)),X.value===0?Pt(M.$slots,"loading-more",{key:0},()=>[(j(),ae(xt,null,xn(8,L=>ge("div",{class:J(M.$style["loading-more"]),key:L},[ge("div",{class:J(M.$style["loading-skeleton"])},null,2),ge("div",{class:J(M.$style["loading-skeleton"])},null,2)],2)),64))]):Ze("",!0),X.value===2?(j(),ae("div",{key:1,class:J(M.$style["no-results"])},[Pt(M.$slots,"empty",{query:a.value},()=>[ge("div",{class:J(M.$style["no-results-content"])},[...Y[2]||(Y[2]=[ge("div",null,[nt(" No results. "),ge("br"),nt(" Try another search. ")],-1)])],2)])],2)):Ze("",!0),X.value===3?(j(),ae("div",{key:2,class:J(M.$style["no-results"])},[Pt(M.$slots,"empty-list",{},()=>[ge("div",{class:J(M.$style["no-results-content"])},[...Y[3]||(Y[3]=[ge("div",null,"No items available.",-1)])],2)])],2)):Ze("",!0),Pt(M.$slots,"footer")],6)],14,mY))}}),[["__cssModules",{$style:{"search-list":"_search-list_og79k_1",empty:"_empty_og79k_9",scrollable:"_scrollable_og79k_15","list-container":"_list-container_og79k_22","item-label":"_item-label_og79k_41","loading-state":"_loading-state_og79k_49","loading-more":"_loading-more_og79k_50","loading-skeleton":"_loading-skeleton_og79k_61","is-loading":"_is-loading_og79k_68","no-results":"_no-results_og79k_123","no-results-content":"_no-results-content_og79k_130",title:"_title_og79k_133",tips:"_tips_og79k_139",match:"_match_og79k_153","skeleton-loading":"_skeleton-loading_og79k_1"}}]]),Zl=it({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=ez,n=e,o=B(n.appendTo||void 0),s=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:o.value}),i=B(s());Je(()=>n,()=>{setTimeout(()=>{_t(()=>{o.value=n.appendTo||void 0,i.value=s()})},50)},{immediate:!0,deep:!0});const r=Z(()=>({id:n.user.id,name:n.user.name,profile_image:n.user.profile_image,color:n.user.color,initial:n.user.initial}));return(a,l)=>Ue((j(),ze(Sh,nR(Pw(r.value)),null,16)),[[H(t),i.value]])}}),wY=["innerHTML"],CY=20,VA=St(it({__name:"AssigneeGroupEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{}},emits:["updated","cancel","start-update","update-failed","update-completed"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,{id:i}=Lp(s),r=n,a=L=>{var fe,Le;const se=(Le=(fe=s.params)==null?void 0:fe.api)==null?void 0:Le.getRowNode(String(i.value));se==null||se.setDataValue("assignees",Nx(L.assignees)),r("updated",L),r("update-completed")},l=B(!1),c=B(!1),u=B(null),d=B(1),h=B(!0),f=B(0),p=B(""),g=En("bulkUpdate",B(!1)),v=En("isSelectAll",B(!1)),{isSubmitting:y,unAssignAll:b,replaceAssignees:S,handleSelect:C,assigneeList:E,mergedOptions:_,selectedUserIds:x}=um({...s,entityId:s.entityId,updateRowData:a,value:s.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{r("update-failed")}}),{apiServices:A}=Qn(!g.value,s),k=En("workspaceId"),T=async(L=1,se="",fe=!1)=>{var Le,Me,Ke,z,ue;if(!A.value||!s.id&&!s.ids)throw console.error("API service or item identifiers are undefined",A.value,s.id,s.ids),new Error("API service or item identifiers are undefined");if(fe?c.value=!0:l.value=!0,u.value=null,!((Le=A.value)!=null&&Le.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");try{const re=await((Me=A.value)==null?void 0:Me.multipleAssignableUser({workspaceId:String(k),itemIds:(s.ids??(s.id?[s.id]:[])).map(String),page:L,perPage:CY,q:se.trim()})),Fe=((Ke=mu(re.data))==null?void 0:Ke.map(cm))??[];E.value=fe?nu(E.value,Fe,"id"):Fe,f.value=re.meta.total,h.value=(((z=re==null?void 0:re.meta)==null?void 0:z.current_page)||0)<(((ue=re==null?void 0:re.meta)==null?void 0:ue.last_page)||0),d.value=L}catch(re){console.error("Error fetching assignable users:",re),u.value="Failed to load assignable users"}finally{l.value=!1,c.value=!1}},D=()=>{!c.value&&h.value&&T(d.value+1,p.value,!0)},F=Di(async L=>{p.value=L,await T(1,L,!1)},sr),P=()=>T(1,p.value,!1);Xt(()=>{var L;(L=ne.value)==null||L.focus()}),t({getValue:()=>{var L;return(L=_.value.find(se=>se.selected))==null?void 0:L.value},refresh:P,clearInternal:()=>{x.value=[]},focus:()=>{var L;(L=ne.value)==null||L.focus()}});const $=()=>{const L=Cn.getInstance().getItem("BASE_URL"),se=Lo({type:"access_setting",config:{baseDomain:L,ws_code:s.workspaceId,entity_id:k}}).url;window.open(se,"_blank")},ne=B(null);Xt(()=>{_t(()=>{var L;(L=ne.value)==null||L.focus()})}),Je([()=>s.id,()=>s.workspaceId,()=>s.ids],()=>{T()},{deep:!0,immediate:!0});const U=L=>{var fe;const se=Cn.getInstance().getItem("ws.code");return((fe=A.value)==null?void 0:fe.getUserInformation(se,L))||Promise.resolve(null)},q=async L=>{try{r("start-update");const se=await C(L);r("update-completed")}catch(se){r("update-failed"),console.error("Error updating assignees:",se)}},Q=async()=>{try{r("start-update");const L=await b();r("update-completed")}catch(L){r("update-failed"),console.error("Error unassigning all assignees:",L)}},X=async L=>{try{r("start-update");const se=await S(L);r("update-completed")}catch(se){r("update-failed"),console.error("Error replacing assignees:",se)}},he=()=>{var L,se;r("cancel"),(se=(L=s.params)==null?void 0:L.api)==null||se.stopEditing()};qi("popupAttachRef",ne);const M=B(),Y=B(!1);return Xt(()=>{_t(()=>{setTimeout(()=>{Y.value=!0},50)})}),(L,se)=>(j(),ae("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:M},[ce(Jr,qt({"selected-id":H(x)},{...s},{options:H(_),loading:l.value,ref_key:"popupRef",ref:ne,"loading-more":c.value,"has-more":h.value,onSelect:se[0]||(se[0]=fe=>{q(fe)}),"data-wrapper":"true",onSearch:H(F),onLoadMore:D,onCancel:he,onClose:he}),Yd({"extra-item":pe(()=>[ce(ct,{variant:"menu-item",onHandleClick:Q},{prefix:pe(()=>[ge("div",{class:J(L.$style["unassign-icon"])},[ce(rt,{src:"UserXMark",source:"remote"})],2)]),default:pe(()=>[se[1]||(se[1]=nt(" Unassign all ",-1))]),_:1})]),item:pe(({item:fe,selectedIndex:Le,isSelected:Me,handleItemHover:Ke,getHighlightedLabel:z,query:ue,idx:re})=>[ce(ei,qt(fe,{hover:re===Le,selected:Me(fe),type:fe.type,onClick:Tt(Fe=>q(fe),["stop","prevent"]),onMouseover:Fe=>Ke(re),class:L.$style["item-assignee"]}),{prefix:pe(()=>[Y.value?(j(),ze(Zl,{key:1,user:fe.data,"show-profile":!0,apiUpdateFunction:U,appendTo:M.value},null,8,["user","appendTo"])):(j(),ae("div",{key:0,class:J(L.$style["skeleton-avatar"])},null,2))]),label:pe(({selected:Fe})=>[ue?Ue((j(),ae("span",{key:0,class:J([L.$style["item-label"],L.$style.match]),style:{flex:"1"},innerHTML:z(fe.label)},null,10,wY)),[[H(o),{content:fe.label}]]):Ue((j(),ae("span",{key:1,class:J(L.$style["item-label"]),style:{flex:"1"}},[nt(yt(fe.label),1)],2)),[[H(o),{content:fe.label}]]),ge("div",{class:J(L.$style["item-action"])},[Ue((j(),ze(ct,{variant:["icon","tertiary"],size:24,highlightOnHover:!0,disabled:H(y),onClick:Tt(G=>q(fe),["stop","prevent"])},{prefix:pe(()=>[ce(rt,{src:Fe?"UserMinus":"UserPlus",source:"remote"},null,8,["src"])]),_:2},1032,["disabled","onClick"])),[[H(o),Fe?"Unassign":"Assign"]]),Ue((j(),ze(ct,{variant:["icon","tertiary"],size:24,highlightOnHover:!0,disabled:H(y),onClick:Tt(G=>{var ee;return X((ee=fe.data)==null?void 0:ee.id)},["stop","prevent"])},{prefix:pe(()=>[ce(rt,{src:"IdCardClip",source:"remote"})]),_:1},8,["disabled","onClick"])),[[H(o),"Unassign others and reassign"]])],2)]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),"empty-list":pe(()=>[ge("div",{class:J(L.$style["empty-state"])},[se[4]||(se[4]=nt(" No assignee available. ",-1)),se[5]||(se[5]=ge("br",null,null,-1)),ce(ct,{onClick:$,variant:["tertiary"],size:"small"},{default:pe(()=>[...se[3]||(se[3]=[nt(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[u.value?{name:"error",fn:pe(()=>[ge("div",{class:J(L.$style["error-message"])},[nt(yt(u.value)+" ",1),ce(ct,{onClick:P,size:"small"},{default:pe(()=>[...se[2]||(se[2]=[nt(" Retry ",-1)])]),_:1})],2)]),key:"0"}:void 0]),1040,["selected-id","options","loading","loading-more","has-more","onSearch"])],512))}}),[["__cssModules",{$style:{action:"_action_zb1un_1","item-assignee":"_item-assignee_zb1un_6","item-action":"_item-action_zb1un_6","item-label":"_item-label_zb1un_16","unassign-icon":"_unassign-icon_zb1un_25","error-message":"_error-message_zb1un_36","empty-state":"_empty-state_zb1un_46","skeleton-avatar":"_skeleton-avatar_zb1un_59"}}]]),bY=it({__name:"AssignneeUpdateButton",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},variant:{}},emits:["update"],setup(e,{emit:t}){const n=e;qi("bulkUpdate",!0);const o=t,s=B(null),i=f=>{var p;h.value=!1,o("update",f),(p=s.value)==null||p.clearInternal()},{triggerRef:r,popupRef:a,hide:l,isVisible:c}=eo({zIndex:2}),u=B(null),d=f=>{f.key==="Escape"&&a.value&&l()};Xt(()=>{var p;const f=u.value instanceof HTMLElement?u.value:(p=u.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",d)}),lo(()=>{var p;const f=u.value instanceof HTMLElement?u.value:(p=u.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",d)}),Je(c,f=>{var p,g;f?(p=s.value)==null||p.focus():(g=s.value)==null||g.clearInternal()});const h=B(!1);return(f,p)=>(j(),ae("div",{ref_key:"mainRef",ref:u},[ge("div",{ref_key:"triggerRef",ref:r},[ce(ct,{class:"action-button",variant:n.variant,loading:h.value},{default:pe(()=>[ce(rt,{src:"UserPlus",class:"icon"}),p[3]||(p[3]=nt(" Assignee ",-1))]),_:1},8,["variant","loading"])],512),ge("div",{ref_key:"popupRef",ref:a,style:{display:"none"}},[H(c)?(j(),ze(VA,qt({key:0,ref_key:"assigneeGroupEditorRef",ref:s},n,{ids:e.ids,onUpdated:i,onStartUpdate:p[0]||(p[0]=g=>h.value=!0),onUpdateFailed:p[1]||(p[1]=g=>h.value=!1),onUpdateCompleted:p[2]||(p[2]=g=>h.value=!1)}),null,16,["ids"])):Ze("",!0)],512)],512))}}),Xh=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],SY=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),Ha=(e,t)=>{const n=o=>{var s,i;if(o.key==="Tab"){const r=o.shiftKey||o.metaKey;o.preventDefault(),o.stopImmediatePropagation(),o.stopPropagation();const a=document.activeElement,l=(s=a==null?void 0:a.dataset)==null?void 0:s.index;if(l){let c=Xh.indexOf(l);const u=r?-1:1;for(const d of Xh){c=(c+u+Xh.length)%Xh.length;const h=Xh[c],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(o.key==="Enter")(i=o.target)==null||i.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(o.key==="Escape"){o.stopPropagation(),o.stopImmediatePropagation();const r=document.querySelector('[data-index="calendar-wrapper"]');r==null||r.focus()}};if(SY.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},EY=["aria-label"],_Y=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],RY={style:{flex:"1"}},DY=St(it({__name:"MainCalendar",props:sD({year:{},month:{},startDate:{},endDate:{},timezone:{default:"UTC"},activeField:{default:"start"},requireConfirm:{type:Boolean,default:!1},locale:{default:"en-US"},weekdayLabelStyle:{default:"narrow"},weekStart:{default:0},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Confirm"},immediatelyUpdate:{type:Boolean,default:!1},disabled:{type:Boolean},readOnly:{type:Boolean},disableConfirm:{type:Boolean,default:!1}},{tracingCase:{default:()=>({case:"",behavior:""})},tracingCaseModifiers:{}}),emits:sD(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{expose:t,emit:n}){const o=Yt,s=B(null),i=e,r=Z(()=>i.startDate&&i.endDate),a=LH(e,"tracingCase"),l=n,c=B(i.year),u=B(i.month);Je(()=>[i.year,i.month],([Y,L])=>{c.value=Y,u.value=L});const d=Z(()=>mt.fromObject({year:c.value,month:u.value,day:1},{zone:i.timezone}).setLocale(i.locale||"en-US").toFormat("LLLL yyyy")),h=Z(()=>mt.now().setZone(i.timezone)),f=Z(()=>i.startDate?mt.fromJSDate(i.startDate,{zone:i.timezone}):null),p=Z(()=>i.endDate?mt.fromJSDate(i.endDate,{zone:i.timezone}):null),g=B(f.value),v=B(p.value),y=B(f.value),b=B(p.value);Je([f,p],()=>{i.requireConfirm||(g.value=f.value,v.value=p.value,y.value=f.value,b.value=p.value)},{immediate:!0});const S=Z(()=>i.requireConfirm?g.value:f.value),C=Z(()=>i.requireConfirm?v.value:p.value);Je(()=>i.activeField,Y=>{const L=Y==="start"?S.value:C.value;L&&(c.value=L.year,u.value=L.month)}),Je(()=>{var Y,L;return[(Y=S.value)==null?void 0:Y.toISODate(),(L=C.value)==null?void 0:L.toISODate(),i.activeField]},()=>{const Y=i.activeField==="start"?S.value:C.value;Y&&(Y.year!==c.value||Y.month!==u.value)&&(c.value=Y.year,u.value=Y.month)});function E(Y){return Y.setZone("utc")}const _=B("");function x(Y){_.value=Y.toISODate()||"",_t(()=>{const L=document.querySelector(`.arbo-calendar-day[data-date="${_.value}"]`);L==null||L.focus()})}Je(()=>{var Y,L;return[c.value,u.value,i.activeField,(Y=S.value)==null?void 0:Y.toISODate(),(L=C.value)==null?void 0:L.toISODate()]},()=>{const Y=i.activeField==="start"?S.value:C.value;let L;Y&&Y.year===c.value&&Y.month===u.value?L=Y:S.value&&S.value.year===c.value&&S.value.month===u.value?L=S.value:L=h.value,x(L)});function A(Y){return Y.toFormat("d")}const k=Z(()=>{const Y=mt.fromObject({year:c.value,month:u.value,day:1},{zone:i.timezone}),L=Y.weekday,se=i.weekStart===1?(L+6)%7:L%7;let fe=Y.minus({days:se});const Le=[],Me=pu.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"}),Ke=dg();for(let ue=0;ue<42;ue++){const re=[];fe.month!==u.value&&re.push(Ke["is-outside"]),fe.hasSame(h.value,"day")&&re.push(Ke["is-today"]),S.value&&fe.hasSame(S.value,"day")&&re.push(Ke["is-selected-start"]),C.value&&fe.hasSame(C.value,"day")&&re.push(Ke["is-selected-end"]),S.value&&C.value&&fe>S.value&&fe<C.value&&re.push(Ke["is-in-range"]);const Fe=A(fe),G=Me[fe.weekday-1]||"";Le.push({dt:fe,iso:fe.toISODate()||"",label:fe.toFormat("d"),displayLabel:Fe,weekdayLabel:G,aria:fe.setLocale(i.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:re}),fe=fe.plus({days:1})}const z=[];for(let ue=0;ue<6;ue++)z.push(Le.slice(ue*7,ue*7+7));return z}),T=Z(()=>{const Y=pu.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"});return i.weekStart===1?Y:[Y[6],...Y.slice(0,6)]});function D(Y,L,se){const fe=Y==="start"?L.startOf("day"):L.endOf("day"),Le=E(fe),Me={year:fe.year,month:fe.month,day:fe.day,utc:Le.toISO()||""};Y==="start"?(l("select-start",Me,se??!0),l("select-start-utc",Me.utc)):(l("select-end",Me),l("select-end-utc",Me.utc))}function F(Y){let L=c.value,se=u.value+Y;for(;se<1;)se+=12,L-=1;for(;se>12;)se-=12,L+=1;c.value=L,u.value=se,l("update:year",L),l("update:month",se)}function P(Y){const se=(_.value?mt.fromISO(_.value,{zone:i.timezone}):h.value).plus({days:Y});se.month===u.value&&se.year===c.value&&x(se)}function $(Y=!1){const se=(_.value?mt.fromISO(_.value,{zone:i.timezone}):h.value).weekday%7,fe=Y?6-se:-se;P(fe)}const ne=Y=>{U(Y)};function U(Y){switch(Y.preventDefault(),Y.stopPropagation(),Y.key){case"ArrowLeft":Y.preventDefault(),P(-1);break;case"ArrowRight":Y.preventDefault(),P(1);break;case"ArrowUp":Y.preventDefault(),P(-7);break;case"ArrowDown":Y.preventDefault(),P(7);break;case"Home":Y.preventDefault(),$(!1);break;case"End":Y.preventDefault(),$(!0);break;case"PageUp":Y.preventDefault(),F(Y.shiftKey?-12:-1);break;case"PageDown":Y.preventDefault(),F(Y.shiftKey?12:1);break;case"Enter":case" ":{Y.preventDefault();const L=_.value?mt.fromISO(_.value,{zone:i.timezone}):h.value,se=k.value.flat().find(fe=>fe.iso===L.toISODate());se&&Q(se);break}}}const q=Y=>{const L=mt.now().setZone(i.timezone);c.value=L.year,u.value=L.month,l("update:year",L.year),l("update:month",L.month),x(L),l("gotoToday")};function Q(Y){var Ce,Pe;const L=!!f.value,se=!!p.value,fe=i.activeField,Le=((Ce=f.value)==null?void 0:Ce.toISODate())||"null",Me=((Pe=p.value)==null?void 0:Pe.toISODate())||"null",Ke=Y.dt.toISODate()||"",z=(xe,O)=>{a.value={case:xe,behavior:O}},ue=()=>`Selected start ${Ke} > existing end ${Me} -> reset both to ${Ke}`,re=()=>`Selected end ${Ke} < existing start ${Le} -> reset both to ${Ke}`,Fe=()=>{D("start",Y.dt,!0),D("end",Y.dt),l("update:activeField","end")},G=(xe=!1)=>{D("start",Y.dt,xe),xe&&l("update:activeField","end")},ee=(xe=!1)=>{D("end",Y.dt),xe&&l("close")};if(L&&se){fe==="start"?p.value&&Y.dt>p.value?(Fe(),z("INVERT_RANGE_FROM_START",ue())):(G(!1),z("UPDATE_START_IN_RANGE",`Updated start from ${Le} to ${Ke}; end remains ${Me}`)):f.value&&Y.dt<f.value?(Fe(),z("INVERT_RANGE_FROM_END",re())):(ee(!1),z("UPDATE_END_IN_RANGE",`Updated end from ${Me} to ${Ke}; start remains ${Le}`));return}if(!L&&se&&fe==="start"&&p.value&&Y.dt>p.value){Fe(),z("CREATE_RANGE_FROM_LATE_START",ue());return}if(L&&!se&&fe==="end"&&f.value&&Y.dt<f.value){Fe(),z("CREATE_RANGE_FROM_EARLY_END",re());return}if(!L&&!se){if(fe==="start"){G(!0),z("INIT_START",`Picked start ${Ke}; awaiting end selection`);return}ee(i.immediatelyUpdate),z("INIT_END",`Picked end ${Ke}; awaiting start selection`);return}if(!L&&se){if(fe==="start"){G(!0),z("FILL_MISSING_START",`Inserted start ${Ke}; existing end ${Me}`);return}ee(!1),z("STRICT_UPDATE_END_ONLY",`Updated end to ${Ke}; start still null`);return}if(L&&!se){if(fe==="start"){G(!0),z("RESELECT_START_BEFORE_END",`Replaced start with ${Ke}; end still null, switching to end`);return}ee(i.immediatelyUpdate),z("FILL_MISSING_END",`Picked end ${Ke}; start ${Le}`);return}}function X(){y.value=g.value,b.value=v.value,l("confirm")}function he(){g.value=y.value,v.value=b.value,l("cancel")}function M(){_t(()=>{var Y;(Y=s.value)==null||Y.focus()})}return Xt(()=>{M()}),t({focus:M}),(Y,L)=>(j(),ae("div",{ref_key:"calendarRef",ref:s,class:J([Y.$style["arbo-calendar"],{[Y.$style["arbo-date-range-picker"]]:r.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[ge("div",{class:J([Y.$style["arbo-calendar-header"],Y.$style["arbo-calendar-week"]]),role:"row"},[(j(!0),ae(xt,null,xn(T.value,se=>(j(),ae("div",{key:se,class:J(Y.$style["arbo-calendar-weekday"]),role:"columnheader"},yt(se),3))),128))],2),ge("div",{class:J(Y.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:L[0]||(L[0]=Tt(se=>H(Ha)(se,ne),["prevent","stop"]))},[(j(!0),ae(xt,null,xn(k.value,(se,fe)=>(j(),ae("div",{key:fe,class:J(Y.$style["arbo-calendar-week"])},[(j(!0),ae(xt,null,xn(se,Le=>(j(),ae("div",{key:Le.iso,class:J([Y.$style["arbo-calendar-day"],Le.classes,{[Y.$style["is-focused"]]:Le.iso===_.value}]),disabled:i.disabled,readOnly:i.readOnly,"aria-label":Le.aria,"data-date":Le.iso,"data-weekday":Le.weekdayLabel,tabindex:Le.iso===_.value?0:-1,onClick:Me=>Q(Le)},yt(Le.displayLabel),11,_Y))),128))],2))),128))],34),i.readOnly?Ze("",!0):(j(),ae("div",{key:0,class:J(Y.$style["arbo-calendar-actions"])},[ge("div",RY,[Ue((j(),ze(ct,{variant:"secondary",size:"medium",onClick:L[1]||(L[1]=se=>q()),onKeydown:H(Ha),"data-index":"today-btn"},{prefix:pe(()=>[ce(rt,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[H(o),"Today"]])]),ce(ct,{disabled:i.disabled,readOnly:i.readOnly,onKeydown:H(Ha),variant:"secondary",size:"medium",onClick:he,"data-index":"cancel-btn"},{default:pe(()=>[nt(yt(i.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),ce(ct,{disabled:i.disabled||i.disableConfirm,readOnly:i.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:H(Ha),onClick:X},{default:pe(()=>[nt(yt(i.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,EY))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_1a7wo_1","arbo-calendar-day":"_arbo-calendar-day_1a7wo_2","arbo-calendar-week":"_arbo-calendar-week_1a7wo_3","arbo-calendar":"_arbo-calendar_1a7wo_2","arbo-calendar-nav":"_arbo-calendar-nav_1a7wo_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_1a7wo_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_1a7wo_53","arbo-calendar-weekday":"_arbo-calendar-weekday_1a7wo_58","arbo-calendar-weeks":"_arbo-calendar-weeks_1a7wo_63","is-today":"_is-today_1a7wo_92","is-selected-start":"_is-selected-start_1a7wo_97","is-selected-end":"_is-selected-end_1a7wo_105","is-outside":"_is-outside_1a7wo_125","is-focused":"_is-focused_1a7wo_128","is-in-range":"_is-in-range_1a7wo_133","arbo-calendar-actions":"_arbo-calendar-actions_1a7wo_139","arbo-calendar-btn":"_arbo-calendar-btn_1a7wo_147",cancel:"_cancel_1a7wo_156",confirm:"_confirm_1a7wo_161"}}]]),TY=["onClick"],xY=["variant","onClick"],FY=St(it({__name:"CalendarNavigationControl",props:{year:{},month:{},minYear:{default:1970},maxYear:{default:2100},yearSpan:{default:12},monthLabels:{},locale:{default:"en-US"},monthLabelStyle:{default:"short"},ariaPrevLabel:{default:"Previous"},ariaNextLabel:{default:"Next"},ariaToolbarLabel:{default:"Calendar navigation"},ariaSelectYearLabel:{default:"Select year"},ariaSelectMonthLabel:{default:"Select month"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["update:year","update:month","mode-change","year-selected","month-selected"],setup(e,{expose:t,emit:n}){const o=e,s=Z(()=>{if(o.monthLabels&&o.monthLabels.length===12)return o.monthLabels;const P=o.locale||"en-US",$=o.monthLabelStyle||"short",ne=new Intl.DateTimeFormat(P,{month:$,timeZone:"UTC"});return Array.from({length:12},(q,Q)=>ne.format(new Date(Date.UTC(2020,Q,1))))}),i=n,r=B(o.year),a=B(o.month),l=B(o.year);Je(()=>o.year,P=>{P!==r.value&&(r.value=P,l.value=P)}),Je(()=>o.month,P=>{P!==a.value&&(a.value=P)});const c=B("days");function u(P){c.value!==P&&(c.value=P,i("mode-change",P))}const d=Z(()=>o.minYear),h=Z(()=>o.maxYear),f=Z(()=>{const P=o.yearSpan;return l.value-l.value%P}),p=Z(()=>f.value+o.yearSpan-1);function g(){const P=o.yearSpan,$=f.value-P;$>=d.value&&(l.value=$)}function v(){const P=o.yearSpan,$=f.value+P;$<=h.value&&(l.value=$)}const y=Z(()=>f.value-o.yearSpan<d.value),b=Z(()=>p.value+o.yearSpan>h.value),S=Z(()=>{const P=o.yearSpan;return Math.ceil(P/3)});function C(P){const ne=f.value+(P-1)*3;return Array.from({length:3},(U,q)=>ne+q).filter(U=>U<=p.value)}function E(){c.value==="months"?u("days"):u("months")}function _(){c.value==="years"?u("days"):u("years")}function x(P){r.value=P,l.value=P,i("update:year",P),i("year-selected",P),u("months")}function A(P){a.value=P,i("update:month",P),i("month-selected",P),u("days")}function k(){if(c.value==="days"){let P=r.value,$=a.value-1;if($<1&&($=12,P--),P<d.value)return;r.value=P,a.value=$,i("update:year",P),i("update:month",$)}else if(c.value==="months"){if(r.value-1<d.value)return;r.value--,i("update:year",r.value)}else c.value==="years"&&g()}function T(){if(c.value==="days"){let P=r.value,$=a.value+1;if($>12&&($=1,P++),P>h.value)return;r.value=P,a.value=$,i("update:year",P),i("update:month",$)}else if(c.value==="months"){if(r.value+1>h.value)return;r.value++,i("update:year",r.value)}else c.value==="years"&&v()}const D=Z(()=>c.value==="days"?r.value===d.value&&a.value===1:c.value==="months"?r.value-1<d.value:y.value),F=Z(()=>c.value==="days"?r.value===h.value&&a.value===12:c.value==="months"?r.value+1>h.value:b.value);return t({setNavigation:(P,$)=>{r.value=P,a.value=$}}),(P,$)=>(j(),ae("div",{class:J([P.$style["cal-nav-wrapper"]])},[Pt(P.$slots,"selection"),c.value==="days"?(j(),ae("div",{key:0,class:J(P.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[ce(ct,{variant:"tertiary",class:J([P.$style["cal-nav-btn"],P.$style.prev]),"aria-label":"Previous",disabled:D.value,label:"",onClick:k,"data-index":"prev-btn",onKeydownCapture:Bn(Tt(k,["prevent","stop"]),["enter"]),onKeydown:H(Ha)},{default:pe(({hovered:ne})=>[ce(rt,{src:"AnglesRight",source:"remote",color:ne?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),ge("div",{class:J(P.$style["cal-nav-center"])},[ce(ct,{"data-index":"month-btn",variant:"secondary",onClick:E,onKeydown:H(Ha)},{default:pe(()=>[nt(yt(s.value[a.value-1]),1)]),_:1},8,["onKeydown"]),ce(ct,{variant:"secondary",onClick:_,"data-index":"year-btn",onKeydown:H(Ha)},{default:pe(()=>[nt(yt(r.value),1)]),_:1},8,["onKeydown"])],2),ce(ct,{"data-index":"next-btn",variant:"tertiary",class:J([P.$style["cal-nav-btn"],P.$style.next]),"aria-label":"Next",disabled:F.value,label:"",onClick:T,onKeydownCapture:Bn(Tt(T,["prevent","stop"]),["enter"]),onKeydown:H(Ha)},{default:pe(({hovered:ne})=>[ce(rt,{src:"AnglesRight",source:"remote",color:ne?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Ze("",!0),c.value==="years"?(j(),ae("div",{key:1,class:J(P.$style["year-grid"])},[ge("div",{class:J(P.$style["year-grid-header"])},[ce(ct,{variant:"tertiary",class:J([P.$style["cal-nav-btn"],P.$style.prev]),"aria-label":"Next",disabled:y.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:pe(({hovered:ne})=>[ce(rt,{src:"AnglesRight",source:"remote",color:ne?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),ge("div",{class:J(P.$style["range-label"])},yt(f.value)+" - "+yt(p.value),3),ce(ct,{variant:"tertiary",class:J([P.$style["cal-nav-btn"],P.$style.next]),"aria-label":"Next",disabled:b.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:pe(({hovered:ne})=>[ce(rt,{src:"AnglesRight",source:"remote",color:ne?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),ge("div",{class:J(P.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(j(!0),ae(xt,null,xn(S.value,ne=>(j(),ae("div",{key:"yr-row-"+ne,class:J(P.$style["year-grid-row"])},[(j(!0),ae(xt,null,xn(C(ne),U=>(j(),ae("a",{key:U,tabindex:"0",class:J([P.$style["year-cell"],{[P.$style.selected]:U===r.value}]),onClick:q=>x(U)},yt(U),11,TY))),128))],2))),128))],2)],2)):c.value==="months"?(j(),ae("div",{key:2,class:J(P.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[ge("div",{class:J(P.$style.months)},[(j(!0),ae(xt,null,xn(s.value,(ne,U)=>(j(),ae("a",{tabindex:"0",key:ne,variant:U+1===a.value?"primary":"text",class:J([P.$style["month-cell"],{[P.$style.selected]:U+1===a.value}]),onClick:q=>A(U+1)},yt(ne),11,xY))),128))],2)],2)):(j(),ae("div",{key:3,class:J(P.$style["days-slot"])},[Pt(P.$slots,"default",{year:r.value,month:a.value,mode:c.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_unh71_1","cal-nav-bar":"_cal-nav-bar_unh71_12","cal-nav-btn":"_cal-nav-btn_unh71_20",prev:"_prev_unh71_33","year-grid-header":"_year-grid-header_unh71_37","cal-nav-center":"_cal-nav-center_unh71_46","cal-nav-label":"_cal-nav-label_unh71_52","month-grid":"_month-grid_unh71_66","year-grid":"_year-grid_unh71_37",months:"_months_unh71_75","month-cell":"_month-cell_unh71_82","year-cell":"_year-cell_unh71_83","pg-btn":"_pg-btn_unh71_105","year-grid-body":"_year-grid-body_unh71_118","year-grid-row":"_year-grid-row_unh71_125",selected:"_selected_unh71_131","days-slot":"_days-slot_unh71_137","range-label":"_range-label_unh71_141"}}]]);function IY(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:o,maxDate:s}=e,i=B(""),r=Z(()=>{const g=mt.fromFormat(i.value,t,{zone:n});return g.isValid?g:null}),a=Z(()=>{if(!o||!r.value)return!0;const g={year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()},v={year:r.value.year,month:r.value.month,day:r.value.day};return v.year>g.year?!0:v.year<g.year?!1:v.month>g.month?!0:v.month<g.month?!1:l(v,g)>=0}),l=(g,v)=>{const y=new Date(g.year,g.month-1,g.day),b=new Date(v.year,v.month-1,v.day);return y<b?-1:y>b?1:0},c=Z(()=>{if(!s||!r.value)return!0;const g={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate()},v={year:r.value.year,month:r.value.month,day:r.value.day};return v.year<g.year?!0:v.year>g.year?!1:v.month<g.month?!0:v.month>g.month?!1:l(v,g)<=0}),u=Z(()=>i.value.length==0||i.value.length>0&&r.value!==null&&a.value&&c.value),d=Z(()=>i.value.length===t.length&&u.value);return{inputValue:i,isValid:u,isComplete:d,clear:()=>{i.value=""},setDate:g=>{let v;g instanceof Date?v=mt.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?i.value=v.toFormat(t):i.value=""},getDate:()=>u.value?r.value:null}}const PY={key:0,style:{marginLeft:"8px"}},AY=["disabled","readonly","placeholder"],BA=St(it({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear","blur","tab"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,i=n,r=B(null),a=B(null),{isValid:l,isComplete:c,inputValue:u,clear:d,setDate:h,getDate:f}=IY({format:s.format,allowPastDates:s.allowPastDates,allowFutureDates:s.allowFutureDates,timezone:s.timezone,minDate:s.minDate,maxDate:s.maxDate}),p=Z(()=>s.active),g=Z(()=>({disabled:s.disabled,error:!l.value&&u.value.length>0,readOnly:s.readOnly,isEmpty:u.value.length===0,inputRef:r,wrapperRef:a,active:p})),{argsMain:v,isHover:y,isFocus:b}=vo(g),S=A=>{var T;const k=(T=A.clipboardData)==null?void 0:T.getData("text/plain");k&&(u.value=k.trim())},C=A=>{if(A.key==="Escape"){i("blur"),A.target.blur(),A.preventDefault(),A.stopPropagation(),A.stopImmediatePropagation();return}else A.key==="Tab"&&x(A)},E=()=>{d(),i("clear")};t({clear:E,setDate:h,getDate:f,focus:()=>{var A;return(A=r.value)==null?void 0:A.focus()}}),Je(()=>s.modelValue,A=>{A?h(A):d()},{immediate:!0}),Je([()=>c.value,()=>u.value],()=>{if(u.value.length===0)i("complete",null);else if(l.value&&!s.readOnly&&!s.disabled&&c.value){const A=f();(A||u.value.length===0)&&i("complete",A)}}),Je(()=>l.value,A=>{A||i("invalid","")});const _=Z(()=>!!s.isMultipleDate),x=A=>{A.preventDefault(),A.stopImmediatePropagation(),A.stopPropagation(),i("tab",A)};return(A,k)=>(j(),ze(yo,qt(H(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:pe(()=>[ge("div",{class:J([A.$style["date-input-wrapper"]])},[_.value?(j(),ae("span",PY," Multiple ")):Ue((j(),ae("input",{key:1,disabled:s.disabled,readonly:s.readOnly,ref_key:"inputRef",ref:r,type:"text","onUpdate:modelValue":k[0]||(k[0]=T=>pn(u)?u.value=T:null),onPaste:Tt(S,["prevent"]),placeholder:s.placeholder,class:J([A.$style["date-input"]]),onKeydown:C},null,42,AY)),[[C1,H(u)]]),Pt(A.$slots,"clear",{handleClear:E},()=>[(H(u).length>0||_.value)&&!s.readOnly&&!s.disabled&&(H(y)||H(b))?Ue((j(),ze(ct,{key:0,variant:["icon","primary"],onClick:Tt(E,["stop"]),size:16,rounded:!0},{default:pe(()=>[ce(rt,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[H(o),"Clear"]]):(j(),ze(rt,{key:1,src:"Calendar",source:"remote",class:J(A.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_1yset_1","icon-calendar":"_icon-calendar_1yset_9",focus:"_focus_1yset_12",hover:"_hover_1yset_12",active:"_active_1yset_12","date-input":"_date-input_1yset_1",invalid:"_invalid_1yset_38"}}]]),kY=it({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:yb()},format:{default:"LLL dd"},placeholder:{},enableRangeFeedback:{type:Boolean},messages:{},isCompleted:{type:Boolean},isStarted:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{},duePlaceholder:{default:"Due"},startPlaceholder:{default:"Start"},startTooltip:{default:"Select start date"},dueTooltip:{default:"Select due date"},showCalendarIcon:{type:Boolean,default:!0},locale:{default:"en-US"},immediatelyUpdate:{type:Boolean,default:!1},multipleStartDates:{type:Boolean},multipleDueDates:{type:Boolean}},emits:["clearStart","clearDue","clearAll","update","update:start","update:end","range:invalid","range:corrected","tracing","confirmed","closed","start-update","finish-update","tab"],setup(e,{expose:t,emit:n}){const o=B({case:"",behavior:""}),s=e,i=B(null),r=n,a=async(z,ue)=>{r("start-update"),await z(),r("finish-update"),_t(()=>{var re,Fe;ue(),(Fe=(re=s.params)==null?void 0:re.api)==null||Fe.stopEditing()})},l=(z,ue)=>{z(),_t(()=>{var re,Fe;ue(),(Fe=(re=s.params)==null?void 0:re.api)==null||Fe.stopEditing()})},c=()=>{var ue;const z=mt.now().setZone(s.timezone);L.value=z.year,se.value=z.month,(ue=Y.value)==null||ue.setNavigation(z.year,z.month)},u=Cs({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:y,beginInteraction:b,clearStart:S,clearDue:C}=S7(s,r),E=Z(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});Je(()=>s.multipleStartDates,z=>{h.value=!!z},{immediate:!0}),Je(()=>s.multipleDueDates,z=>{f.value=!!z},{immediate:!0});const _=B(null),x=B(null),A=z=>{z.preventDefault(),z.stopImmediatePropagation(),z.stopPropagation(),X()},k=()=>{var z;(z=x.value)==null||z.focus()},T=z=>{if(!z){u.start=!1,S();return}const ue=d.endDate?mt.fromJSDate(d.endDate,{zone:s.timezone}):null;if(ue&&D(z,ue)>0){const Fe={year:z.year,month:z.month,day:z.day};u.start=!1,y(Fe,!1),p(Fe),_t(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const re={year:z.year,month:z.month,day:z.day};u.start=!1,y(re,!0)},D=(z,ue)=>{const re=z.startOf("day"),Fe=ue.startOf("day");return re<Fe?-1:re>Fe?1:0},F=z=>{var ue;z.preventDefault(),z.stopImmediatePropagation(),z.stopPropagation(),(ue=document.querySelector('[data-index="prev-btn"]'))==null||ue.focus()},P=z=>{if(!z){u.end=!1,C();return}const ue=d.startDate?mt.fromJSDate(d.startDate,{zone:s.timezone}):null;if(ue&&D(z,ue)<0){const Fe={year:z.year,month:z.month,day:z.day};u.end=!1,y(Fe),p(Fe),_t(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const re={year:z.year,month:z.month,day:z.day};u.end=!1,p(re)},$=()=>{h.value=!1,S()},ne=()=>{f.value=!1,C()},U=()=>{he()},q=Z(()=>d.isSelectingStart||d.isSelectingEnd);function Q(){s.disabled||s.readOnly||(b(),d.isSelectingStart=!0,d.isSelectingEnd=!1,_t(()=>{var z;(z=i.value)==null||z.focus()}))}function X(){s.disabled||s.readOnly||(b(),d.isSelectingEnd=!0,d.isSelectingStart=!1,_t(()=>{var z;(z=_.value)==null||z.focus()}))}function he(){d.isSelectingStart=!1,d.isSelectingEnd=!1,r("closed")}function M(z){z.key==="Escape"?(z.stopPropagation(),he()):z.key=="Tab"&&r("tab",z)}const Y=B(null),L=B(new Date().getFullYear()),se=B(new Date().getMonth()+1);Je(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(L.value=d.startDate.getFullYear(),se.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(L.value=d.endDate.getFullYear(),se.value=d.endDate.getMonth()+1)},{immediate:!0});const fe=B(null);function Le(){if(Array.isArray(s.value)){const[ue,re]=s.value;d.startDate=ue||null,d.endDate=re||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const z=d.startDate||d.endDate||new Date;L.value=z.getFullYear(),se.value=z.getMonth()+1}Je(()=>{var z,ue,re,Fe,G,ee,Ce,Pe;return[((re=(ue=(z=s.value)==null?void 0:z[0])==null?void 0:ue.getTime)==null?void 0:re.call(ue))||((Fe=s.value)==null?void 0:Fe[0]),((Ce=(ee=(G=s.value)==null?void 0:G[1])==null?void 0:ee.getTime)==null?void 0:Ce.call(ee))||((Pe=s.value)==null?void 0:Pe[1]),s.timezone,s.format,s.placeholder,s.enableRangeFeedback]},()=>{Le()},{immediate:!0,deep:!0}),t({resetCalendarLogic:Le,openStart:Q,openEnd:X,closePicker:he,clearAll:U,isOpen:q,drpRef:fe,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?Q():X():Q()}});const Ke=B(null);return Je(()=>q.value,z=>{if(s.disabled||s.readOnly)return;const ue=Ke.value;ue&&(z?ue.show():ue.hide())},{immediate:!0}),(z,ue)=>(j(),ae("div",{class:J(z.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:x,onKeydown:M,tabindex:"1","data-index":"calendar-wrapper"},[ce(FY,{year:L.value,"onUpdate:year":ue[6]||(ue[6]=re=>L.value=re),month:se.value,"onUpdate:month":ue[7]||(ue[7]=re=>se.value=re),locale:s.locale,disabled:s.disabled,readOnly:s.readOnly,ref_key:"navigationRef",ref:Y},{selection:pe(()=>[ge("div",{class:J(z.$style["calendar-input-section"])},[ce(BA,{ref_key:"starDateRef",ref:i,"model-value":H(d).startDate,placeholder:s.startPlaceholder,timezone:s.timezone,active:H(d).isSelectingStart,onClick:Q,onClear:$,onComplete:T,onInvalid:ue[0]||(ue[0]=re=>u.start=!0),disabled:s.disabled,readOnly:s.readOnly,onBlur:k,onTab:A},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),ce(BA,{ref_key:"endDateRef",ref:_,"model-value":H(d).endDate,placeholder:s.duePlaceholder,timezone:s.timezone,active:H(d).isSelectingEnd,onClick:X,onClear:ne,disabled:s.disabled,onComplete:P,onInvalid:ue[1]||(ue[1]=re=>u.end=!0),readOnly:s.readOnly,isMultipleDate:H(f),onTab:F},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:pe(({year:re,month:Fe})=>[ce(DY,{disabled:s.disabled,disableConfirm:u.end||u.start,readOnly:s.readOnly,ref_key:"drpRef",ref:fe,"tracing-case":o.value,"onUpdate:tracingCase":ue[2]||(ue[2]=G=>o.value=G),year:re,month:Fe,"start-date":H(d).startDate,"end-date":H(d).endDate,"active-field":E.value,timezone:s.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:H(y),onSelectEnd:H(p),onGotoToday:c,onConfirm:ue[3]||(ue[3]=()=>{a(H(v),he)}),onCancel:ue[4]||(ue[4]=G=>l(H(g),he)),onClose:ue[5]||(ue[5]=G=>a(H(v),he))},null,8,["disabled","disableConfirm","readOnly","tracing-case","year","month","start-date","end-date","active-field","timezone","immediatelyUpdate","onSelectStart","onSelectEnd"])]),_:1},8,["year","month","locale","disabled","readOnly"])],34))}}),xm=St(kY,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_15w28_1","calendar-input-section":"_calendar-input-section_15w28_12","display-wrapper":"_display-wrapper_15w28_20","calendar-actions":"_calendar-actions_15w28_24","clear-all-btn":"_clear-all-btn_15w28_30"}}]]),OY={ref:"mainRef"},MY=it({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{}},emits:["updated"],setup(e,{emit:t}){const n=t,o=e,s=En("isSelectAll",B(!1)),i=En("bulkUpdate",B(!1)),r=Z(()=>!!o.entityId&&i.value&&s.value),{apiServices:a}=Qn(!i.value,o),l=En("filterParams",null),c=async A=>{var T,D,F;x.value=!0;let k={workspaceId:o.workspaceId,entityId:o.entityId,itemIds:o.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in A&&(k.startDate=A.start?lm(A.start):null),"end"in A&&(k.dueDate=A.end?lm(A.end):null),r.value?(k.itemIds=void 0,k.entityId=o.entityId):k.entityId=void 0,await((D=(T=a.value)==null?void 0:T.changeDate)==null?void 0:D.call(T,k)),n("updated",{workspaceId:o.workspaceId,itemIds:o.ids,data:k}),(F=y.value)==null||F.resetCalendarLogic()},u=()=>{if(!o.rowSelected||o.rowSelected.length===0){d();return}o.rowSelected.length===1?h():f()},d=()=>{v.value=!1,g.value=!1,_.value=[null,null]},h=()=>{const k=o.rowSelected[0].dateRange;_.value=[(k==null?void 0:k[0])??null,(k==null?void 0:k[1])??null],v.value=!1,g.value=!1},f=()=>{var k,T;if(o.rowSelected.some(D=>D.dateRange&&(D.dateRange[0]!==null||D.dateRange[1]!==null))){const D=p(0),F=p(1);if(g.value=D,v.value=F,D)_.value[0]=null;else{const P=((k=o.rowSelected[0].dateRange)==null?void 0:k[0])??null;_.value[0]=P}if(F)_.value[1]=null;else{const P=((T=o.rowSelected[0].dateRange)==null?void 0:T[1])??null;_.value[1]=P}}else g.value=!1,v.value=!1,_.value=[null,null]},p=A=>{const k=o.rowSelected.map(D=>{var F;return(F=D.dateRange)==null?void 0:F[A]});return k.length===0?!1:new Set(k.map(D=>{var F;return(F=D==null?void 0:D.getTime)==null?void 0:F.call(D)})).size>1},g=B(!1),v=B(!1),y=B(null),{triggerRef:b,popupRef:S,hide:C,isVisible:E}=eo(),_=B([null,null]);Je([()=>o.ids,()=>o.rowSelected,E],A=>{u(),_t(()=>{var k;(k=y.value)==null||k.focus()})},{immediate:!0,deep:!0});const x=B(!1);return(A,k)=>(j(),ae("div",OY,[ge("div",{ref_key:"triggerRef",ref:b},[ce(ct,{variant:o.variant,loading:x.value},{default:pe(()=>[ce(rt,{src:"Calendar"}),k[2]||(k[2]=nt(" Date ",-1))]),_:1},8,["variant","loading"])],512),ge("div",{ref_key:"popupRef",ref:S,style:{display:"none"}},[H(E)?(j(),ze(xm,{key:0,immediatelyUpdate:!1,value:_.value,onConfirmed:c,ref_key:"calendarRef",ref:y,onClosed:H(C),onStartUpdate:k[0]||(k[0]=T=>x.value=!0),onFinishUpdate:k[1]||(k[1]=T=>x.value=!1),multipleDueDates:v.value,multipleStartDates:g.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):Ze("",!0)],512)],512))}}),NY=e=>{if(Number(e.metric_type.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number(e.metric_type.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number(e.metric_type.id)==3)return"formula"},$A=Yl("metricStore",()=>{const e=B();return{metricList:e,setMetricList:o=>{e.value=o},checkEditType:o=>{var s;if(((s=o==null?void 0:o.auth_permission)==null?void 0:s.permission)==2)return NY(o)}}}),LY=["onKeydown"],VY=["width","height","viewBox"],BY=["d"],$Y="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",HA=it({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change","handleEnter","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=B(o.modelValue??0),r=B(null),a=Z(()=>{var D;return((D=o.params)==null?void 0:D.size)??24}),l=Z(()=>{var D;return((D=o.params)==null?void 0:D.iconViewBox)??"0 0 24 24"}),c=Z(()=>{var D;return((D=o.params)==null?void 0:D.iconPath)??$Y}),u=Z(()=>{var D;return((D=o.params)==null?void 0:D.wrapperTag)??"span"}),d=Z(()=>{var D;return o.disabled||((D=o.params)==null?void 0:D.disabled)||!1}),h=Z(()=>{var D;return o.readOnly||((D=o.params)==null?void 0:D.readOnly)||!1}),f=Z(()=>!d.value&&!h.value),p=Z(()=>d.value?"not-allowed":h.value?"default":"pointer");Je(()=>o.modelValue,D=>{typeof D=="number"&&D!==i.value&&(i.value=D)});const g=D=>{var F;return((F=o.params)==null?void 0:F.maxRating)-D+1<=i.value&&!v.value},v=B(!1),y=()=>{v.value=!0},b=()=>{v.value=!1},S=D=>{f.value&&C(D)},C=D=>{var P,$;if(!f.value)return;let F=((P=o.params)==null?void 0:P.maxRating)-D+1;F===i.value&&(F=0),i.value=F,s("update:modelValue",F),s("update",F),s("change",F),($=o.params)!=null&&$.onUpdate&&o.params.onUpdate(F)},E=D=>{var F;D!==i.value&&(i.value=D,s("update:modelValue",D),s("update",D),s("change",D),(F=o.params)!=null&&F.onUpdate&&o.params.onUpdate(D),_.value=D)},_=B(i.value),x=D=>{D.preventDefault(),D.stopPropagation(),D.stopImmediatePropagation(),i.value=_.value,s("cancel")},A=D=>{D.preventDefault(),E(i.value),s("handleEnter",i.value)},k=()=>{f.value&&(i.value=Math.min(i.value+1%(o.params.maxRating+1),o.params.maxRating),E(i.value))},T=()=>{f.value&&(i.value=Math.max(i.value-1,0),E(i.value))};return t({focus:()=>{var D;(D=r.value)==null||D.focus()}}),(D,F)=>(j(),ae("div",{class:J(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:cn({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:r,tabindex:"1",onKeydown:[Bn(Tt(T,["prevent"]),["left"]),Bn(Tt(k,["prevent"]),["right"]),Bn(Tt(T,["prevent"]),["down"]),Bn(Tt(k,["prevent"]),["up"]),Bn(Tt(A,["prevent"]),["enter"]),Bn(Tt(A,["prevent"]),["tab"]),Bn(Tt(x,["prevent"]),["escape"])]},[(j(!0),ae(xt,null,xn(e.params.maxRating,P=>(j(),ze(eD(u.value),{key:P,class:J(["rating-item",{filled:g(P),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:cn({cursor:p.value,order:e.params.maxRating-P,height:a.value+"px",width:a.value+"px"}),"aria-checked":g(P),"aria-disabled":d.value,"aria-readOnly":h.value,title:e.params.maxRating-P+1,tabindex:-1,onClick:Tt($=>S(P),["prevent","stop"]),onMouseenter:y,onMouseleave:b},{default:pe(()=>[Pt(D.$slots,"icon",{index:P,filled:g(P),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value},()=>[(j(),ae("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[ge("path",{d:c.value},null,8,BY)],8,VY))]),Pt(D.$slots,"overlay",{index:P,filled:g(P),disabled:d.value,readOnly:h.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,LY))}}),HY={style:{maxWidth:"180px",lineHeight:"15px"}},GY=["innerHTML"],GA=it({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,i=n,r=()=>{i("handleCancel")},a=()=>{i("close")},l=v=>{var y;if(v.format_type==="dropdown"&&v.format_value)try{const b=JSON.parse(v.format_value);if(Array.isArray(b)){const S=b.map(C=>({label:C.name,value:C.name,id:C.name}));return S.unshift({label:"-",value:void 0,id:"-"}),S}}catch(b){console.error("Failed to parse dropdown options",b)}if(v.format_type=="number"&&v.restricted_type=="exact"){const b=((y=v.restricted_value)==null?void 0:y.split(",").map(S=>({label:v.mapping[`!${S}`]||S,value:S,id:S})))||[];return b.unshift({label:"-",value:void 0,id:"-"}),b}return[]},c=Z(()=>l(s.config)),u=B(s.modelValue),d=v=>{u.value=v,i("update:modelValue",v),i("change",v||null)},h=B(c.value),f=B(!1),p=v=>{f.value=!0,v?h.value=c.value.filter(y=>y.label.toLowerCase().includes(v.toLowerCase())):h.value=c.value,setTimeout(()=>{f.value=!1},300)},g=B(null);return Xt(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,y)=>(j(),ze(Jr,{style:{width:326},loading:f.value,options:h.value,"selected-id":e.modelValue||void 0,onSearch:p,onSelect:y[0]||(y[0]=b=>d(b.id)),ref_key:"searchListRef",ref:g,onClose:a,onCancel:r},{item:pe(({item:b,getHighlightedLabel:S,selectedIndex:C,index:E})=>[ce(ei,{hover:C==E,selected:b.value===e.modelValue,label:b.label,onSelect:_=>d(b.value||null),onClick:_=>d(b.value||null)},{label:pe(()=>[ge("div",HY,[Ue(ge("span",{innerHTML:S(b.label)},null,8,GY),[[H(o),{content:b.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":pe(()=>[...y[1]||(y[1]=[nt("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),UY={class:"metric-input-wrapper"},WY={key:0,class:"error-text input-2"},UA=it({__name:"MetricEditorInput",props:{config:{},modelValue:{},saveOnBlur:{type:Boolean,default:!0},saveOnEscape:{type:Boolean,default:!1},showInlineError:{type:Boolean,default:!1}},emits:["update:modelValue","handleChange","cancel","enter","onValidation"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,i=B(s.modelValue),r=B(s.modelValue),a=B(!1),l=B(!0),c=B(""),u=Z(()=>l.value||s.showInlineError?{content:""}:{content:c.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),d=()=>{var q;const T=s.config.restricted_type.trim(),D=((q=s.config.restricted_value)==null?void 0:q.split(",").map(Number))||[],[F,P]=D,ne={range:`Enter a value between ${F} and ${P}`,not:`These values are not allowed: ${D.join(", ")}`,exact:"Value is not allowed"}[T];return l.value?"":ne},h=Z(()=>{var D;let T="";return Number((D=s.config)==null?void 0:D.format_value)&&(T+="."+Array.from({length:Number(s.config.format_value)}).map(()=>"0").join("")),`0${T}`});Je(()=>s.modelValue,T=>{i.value=T,r.value=T});const f=T=>im(s.config,T),p=n,g=B(null),v=T=>{const D=T===""?null:T,F=r.value===""?null:r.value;return D!==F},y=T=>{if(!v(T))return!1;const D=T===""?null:T;return i.value=D,r.value=D,p("update:modelValue",D),p("handleChange",D),!0},b=()=>{i.value=r.value,p("update:modelValue",r.value)},S=(T,D)=>{y(T),p("enter")},C=(T,D)=>{if(a.value){a.value=!1;return}s.saveOnBlur?y(T):b()},E=T=>{if(T===null||T===""){l.value=!0;return}l.value=im(s.config,Number(T)),c.value=l.value?"":d()},_=(T,D)=>{a.value=!0,s.saveOnEscape?y(T):b(),p("cancel"),setTimeout(()=>{a.value=!1},100)},x=T=>{E(T),p("onValidation",T)},A=()=>{a.value=!0,b(),p("cancel"),setTimeout(()=>{a.value=!1},100)},k=()=>{var T;i.value=null,r.value=null,p("update:modelValue",null),p("handleChange",null),(T=g.value)==null||T.focus()};return t({focus:()=>{var T;return(T=g.value)==null?void 0:T.focus()},blur:()=>{var T;return(T=g.value)==null?void 0:T.blur()},getValue:()=>i.value,getCachedValue:()=>r.value,save:()=>y(i.value),revert:b}),Xt(()=>{var T;(T=g.value)==null||T.focus()}),(T,D)=>Ue((j(),ae("div",UY,[ce(Jb,{modelValue:i.value,"onUpdate:modelValue":D[0]||(D[0]=F=>i.value=F),placeholder:h.value,validatorFnc:f,style:{"--bg-input":"#FAFAFA"},onEnter:S,onBlur:C,onClear:k,onEscape:_,onCancel:A,onOnValidation:x,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:g},null,8,["modelValue","placeholder"]),!l.value&&e.showInlineError?(j(),ae("span",WY,yt(c.value),1)):Ze("",!0)])),[[H(o),u.value]])}}),zY={key:2},jY={class:"wrapper-suffix"},KY={key:3},qY=St(it({__name:"MetricEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},config:{},attachTo:{},focus:{type:Boolean}},emits:["enter","cancel","blur","updateMetric"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,i=B(null),r=B(0),a=B(null),l=B(null),c=Z(()=>II(s.config)),u=B(!1),d=Z(()=>!!se.value),h=n,f=()=>{u.value=!1,L(),h("cancel")},p=B(!0),g=Me=>{if(Me===null||Me===""){p.value=!0;return}if(c.value!=="number"){p.value=!0;return}p.value=im(s.config,Number(Me)),y.value=b()},v=()=>{u.value=!0,U()},y=B(""),b=()=>{var ee;const Me=s.config.restricted_type.trim(),Ke=((ee=s.config.restricted_value)==null?void 0:ee.split(",").map(Number))||[],[z,ue]=Ke,Fe={range:`Enter a value between ${z} and ${ue}`,not:`These values are not allowed: ${Ke.join(", ")}`,exact:"Value is not allowed"}[Me];return p.value?"":Fe},S=Me=>{u.value=!0,i.value=Me},C=()=>{u.value=!0,L(),U()},E=Me=>{r.value=Me,u.value=!0,U()},_=()=>(s.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(Ke=>Ke.charAt(0).toUpperCase()+Ke.slice(1)).join("").replace(/Outline|Solid/g,""),x=B(null),A=B(!0),k=Z(()=>{var Me;return{disabled:s.disabled,error:!1,readOnly:!1,isEmpty:((Me=i.value)==null?void 0:Me.length)===0,wrapperRef:M,active:d,focus:s.focus,bordered:!0}}),T=B(null),D=Z(()=>A.value),F=Z(()=>({disabled:s.disabled,error:!1,readOnly:!1,isEmpty:r.value===0,wrapperRef:T,active:D,focus:A.value,bordered:!0})),{argsMain:P}=vo(F),{argsMain:$}=vo(k),ne=B(null),U=()=>{_t(()=>{var Me;(Me=ne.value)==null||Me.focus()})},q=Me=>{var Ke;if(Me.format_type==="dropdown"&&Me.format_value)try{const z=JSON.parse(Me.format_value);if(Array.isArray(z))return z.map(ue=>({label:ue.name,value:ue.name,id:ue.name}))}catch(z){console.error("Failed to parse dropdown options",z)}return Me.format_type=="number"&&Me.restricted_type=="exact"?((Ke=Me.restricted_value)==null?void 0:Ke.split(",").map(ue=>({label:Me.mapping[`!${ue}`]||ue,value:ue,id:ue})))||[]:[]},Q=Z(()=>q(s.config)),X=Z(()=>{var Me;return((Me=Q.value.find(Ke=>Ke.value===i.value))==null?void 0:Me.label)||i.value||"-"}),he=()=>{var Me;if(c.value=="rating")h("updateMetric",r.value==0?null:r.value);else if(c.value=="number"){const Ke=(Me=l.value)==null?void 0:Me.getValue();h("updateMetric",Ke||null)}else h("updateMetric",i.value||null);u.value=!1,L()},{triggerRef:M,popupRef:Y,hide:L,isVisible:se,show:fe}=eo({appendTo:()=>s.attachTo||"parent",zIndex:1e4,offset:[0,0]}),Le=()=>{switch(c.value){case"number":_t(()=>{var Me;(Me=l.value)==null||Me.focus()});break;case"dropdown":fe(),_t(()=>{var Me;(Me=x.value)==null||Me.focus()});break;case"rating":A.value=!0,_t(()=>{var Me;(Me=a.value)==null||Me.focus()});break}};return t({resetState:()=>{i.value=null,r.value=0,u.value=!1},focus:Le,hasChanges:()=>u.value}),Xt(()=>{_t(()=>{setTimeout(()=>{Le()},300)})}),(Me,Ke)=>(j(),ae("div",{class:J(Me.$style["metric-editor"])},[c.value=="number"?(j(),ze(UA,{key:0,config:s.config,modelValue:i.value,"onUpdate:modelValue":Ke[0]||(Ke[0]=z=>i.value=z),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:S,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue"])):c.value=="rating"?(j(),ze(yo,qt({key:1,"tab-index":1},H(P),{ref_key:"triggerRef2",ref:T,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:pe(()=>[ce(HA,{params:{maxRating:s.config.range},modelValue:r.value,"onUpdate:modelValue":Ke[1]||(Ke[1]=z=>r.value=z),onHandleEnter:E,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:pe(()=>[ce(rt,{source:"rating",src:_()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):c.value=="dropdown"?(j(),ae("div",zY,[ce(yo,qt(H($),{ref_key:"triggerRef",ref:M,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:pe(({})=>[ge("div",jY,[ce(rt,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:pe(()=>[Ue((j(),ae("span",null,[nt(yt(X.value||""),1)])),[[H(o),{content:X.value}]])]),_:1},16),ge("div",{ref_key:"popupRef",ref:Y},[H(se)?(j(),ze(GA,{key:0,ref_key:"metricEditorDropdownRef",ref:x,config:s.config,modelValue:i.value,"onUpdate:modelValue":Ke[2]||(Ke[2]=z=>i.value=z),onChange:C,onCancel:f},null,8,["config","modelValue"])):Ze("",!0)],512)])):(j(),ae("span",KY,"Formular")),Ue((j(),ze(ct,{ref_key:"confirmButtonRef",ref:ne,onHandleClick:he,"tab-index":"1",onKeypress:[Bn(Tt(Le,["shift","prevent"]),["tab"]),Bn(Tt(f,["prevent"]),["escape"])],disabled:!p.value},{default:pe(()=>[ce(rt,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[H(o),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),YY=St(it({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,i=n,r=B(!1),a=B(null),l=B(null),c=()=>{r.value=!r.value},u=()=>{var g;r.value=!1,(g=l.value)==null||g.resetState()},d=async()=>{var g;r.value=!0,await _t(),(g=l.value)==null||g.focus()},h=g=>{i("handleUpdate",{id:s.config.id.toString(),value:g})},f=()=>{var g;(g=a.value)==null||g.focus(),i("loseFocus")},p=g=>{const y={Escape:()=>{g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation(),i("focusOnSearch",g)},Tab:()=>{r.value&&u()},Enter:()=>{r.value||d()},ArrowDown:()=>{i("openSibling","down")},ArrowUp:()=>{i("openSibling","up")}}[g.key];y&&y()};return Je(r,g=>{g&&i("open")}),t({hide:u,show:d}),(g,v)=>(j(),ae("div",{class:J([g.$style["metric-item"],r.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[ge("div",{class:J(g.$style["metric-label"]),onClick:Tt(c,["stop"])},[Pt(g.$slots,"default",{open:r.value},()=>[Ue((j(),ae("span",{class:J(g.$style["metric-name"])},[nt(yt(e.label),1)],2)),[[H(o),{content:e.label}]]),e.morpheme&&r.value?(j(),ae("small",{key:0,class:J(g.$style["metric-morpheme"])}," ("+yt(e.morpheme)+") ",3)):Ze("",!0)])],2),ce(YD,{mode:"out-in",name:"slide"},{default:pe(()=>[r.value?(j(),ze(qY,{key:`editor-${e.config.id}`,"read-only":!1,focus:r.value,type:e.type,config:e.config,"attach-to":e.attachTo,ref_key:"metricEditorRef",ref:l,onCancel:f,onUpdateMetric:h},null,8,["focus","type","config","attach-to"])):Ze("",!0)]),_:1})],34))}}),[["__cssModules",{$style:{"metric-item":"_metric-item_18ft8_1","metric-label":"_metric-label_18ft8_11",open:"_open_18ft8_19","metric-name":"_metric-name_18ft8_23","metric-morpheme":"_metric-morpheme_18ft8_29"}}]]);var Tu=(e=>(e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.TOO_EARLY=425]="TOO_EARLY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",e))(Tu||{});function WA(e,t){return function(){return e.apply(t,arguments)}}const{toString:ZY}=Object.prototype,{getPrototypeOf:eS}=Object,{iterator:Fm,toStringTag:zA}=Symbol,Im=(e=>t=>{const n=ZY.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ai=e=>(e=e.toLowerCase(),t=>Im(t)===e),Pm=e=>t=>typeof t===e,{isArray:xu}=Array,Fu=Pm("undefined");function Jh(e){return e!==null&&!Fu(e)&&e.constructor!==null&&!Fu(e.constructor)&&us(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const jA=Ai("ArrayBuffer");function XY(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&jA(e.buffer),t}const JY=Pm("string"),us=Pm("function"),KA=Pm("number"),Qh=e=>e!==null&&typeof e=="object",QY=e=>e===!0||e===!1,Am=e=>{if(Im(e)!=="object")return!1;const t=eS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(zA in e)&&!(Fm in e)},eZ=e=>{if(!Qh(e)||Jh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},tZ=Ai("Date"),nZ=Ai("File"),oZ=Ai("Blob"),sZ=Ai("FileList"),iZ=e=>Qh(e)&&us(e.pipe),rZ=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||us(e.append)&&((t=Im(e))==="formdata"||t==="object"&&us(e.toString)&&e.toString()==="[object FormData]"))},aZ=Ai("URLSearchParams"),[lZ,cZ,uZ,dZ]=["ReadableStream","Request","Response","Headers"].map(Ai),hZ=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ef(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let o,s;if(typeof e!="object"&&(e=[e]),xu(e))for(o=0,s=e.length;o<s;o++)t.call(null,e[o],o,e);else{if(Jh(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),r=i.length;let a;for(o=0;o<r;o++)a=i[o],t.call(null,e[a],a,e)}}function qA(e,t){if(Jh(e))return null;t=t.toLowerCase();const n=Object.keys(e);let o=n.length,s;for(;o-- >0;)if(s=n[o],t===s.toLowerCase())return s;return null}const Xl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,YA=e=>!Fu(e)&&e!==Xl;function tS(){const{caseless:e,skipUndefined:t}=YA(this)&&this||{},n={},o=(s,i)=>{const r=e&&qA(n,i)||i;Am(n[r])&&Am(s)?n[r]=tS(n[r],s):Am(s)?n[r]=tS({},s):xu(s)?n[r]=s.slice():(!t||!Fu(s))&&(n[r]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&ef(arguments[s],o);return n}const fZ=(e,t,n,{allOwnKeys:o}={})=>(ef(t,(s,i)=>{n&&us(s)?e[i]=WA(s,n):e[i]=s},{allOwnKeys:o}),e),pZ=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),gZ=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},mZ=(e,t,n,o)=>{let s,i,r;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)r=s[i],(!o||o(r,e,t))&&!a[r]&&(t[r]=e[r],a[r]=!0);e=n!==!1&&eS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},vZ=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return o!==-1&&o===n},yZ=e=>{if(!e)return null;if(xu(e))return e;let t=e.length;if(!KA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},wZ=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&eS(Uint8Array)),CZ=(e,t)=>{const o=(e&&e[Fm]).call(e);let s;for(;(s=o.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},bZ=(e,t)=>{let n;const o=[];for(;(n=e.exec(t))!==null;)o.push(n);return o},SZ=Ai("HTMLFormElement"),EZ=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,s){return o.toUpperCase()+s}),ZA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),_Z=Ai("RegExp"),XA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};ef(n,(s,i)=>{let r;(r=t(s,i,e))!==!1&&(o[i]=r||s)}),Object.defineProperties(e,o)},RZ=e=>{XA(e,(t,n)=>{if(us(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const o=e[n];if(us(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},DZ=(e,t)=>{const n={},o=s=>{s.forEach(i=>{n[i]=!0})};return xu(e)?o(e):o(String(e).split(t)),n},TZ=()=>{},xZ=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function FZ(e){return!!(e&&us(e.append)&&e[zA]==="FormData"&&e[Fm])}const IZ=e=>{const t=new Array(10),n=(o,s)=>{if(Qh(o)){if(t.indexOf(o)>=0)return;if(Jh(o))return o;if(!("toJSON"in o)){t[s]=o;const i=xu(o)?[]:{};return ef(o,(r,a)=>{const l=n(r,s+1);!Fu(l)&&(i[a]=l)}),t[s]=void 0,i}}return o};return n(e,0)},PZ=Ai("AsyncFunction"),AZ=e=>e&&(Qh(e)||us(e))&&us(e.then)&&us(e.catch),JA=((e,t)=>e?setImmediate:t?((n,o)=>(Xl.addEventListener("message",({source:s,data:i})=>{s===Xl&&i===n&&o.length&&o.shift()()},!1),s=>{o.push(s),Xl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",us(Xl.postMessage)),kZ=typeof queueMicrotask<"u"?queueMicrotask.bind(Xl):typeof K<"u"&&K.nextTick||JA,Ve={isArray:xu,isArrayBuffer:jA,isBuffer:Jh,isFormData:rZ,isArrayBufferView:XY,isString:JY,isNumber:KA,isBoolean:QY,isObject:Qh,isPlainObject:Am,isEmptyObject:eZ,isReadableStream:lZ,isRequest:cZ,isResponse:uZ,isHeaders:dZ,isUndefined:Fu,isDate:tZ,isFile:nZ,isBlob:oZ,isRegExp:_Z,isFunction:us,isStream:iZ,isURLSearchParams:aZ,isTypedArray:wZ,isFileList:sZ,forEach:ef,merge:tS,extend:fZ,trim:hZ,stripBOM:pZ,inherits:gZ,toFlatObject:mZ,kindOf:Im,kindOfTest:Ai,endsWith:vZ,toArray:yZ,forEachEntry:CZ,matchAll:bZ,isHTMLForm:SZ,hasOwnProperty:ZA,hasOwnProp:ZA,reduceDescriptors:XA,freezeMethods:RZ,toObjectSet:DZ,toCamelCase:EZ,noop:TZ,toFiniteNumber:xZ,findKey:qA,global:Xl,isContextDefined:YA,isSpecCompliantForm:FZ,toJSONObject:IZ,isAsyncFn:PZ,isThenable:AZ,setImmediate:JA,asap:kZ,isIterable:e=>e!=null&&us(e[Fm])};function zt(e,t,n,o,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),s&&(this.response=s,this.status=s.status?s.status:null)}Ve.inherits(zt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ve.toJSONObject(this.config),code:this.code,status:this.status}}});const QA=zt.prototype,ek={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ek[e]={value:e}}),Object.defineProperties(zt,ek),Object.defineProperty(QA,"isAxiosError",{value:!0}),zt.from=(e,t,n,o,s,i)=>{const r=Object.create(QA);Ve.toFlatObject(e,r,function(u){return u!==Error.prototype},c=>c!=="isAxiosError");const a=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return zt.call(r,a,l,n,o,s),e&&r.cause==null&&Object.defineProperty(r,"cause",{value:e,configurable:!0}),r.name=e&&e.name||"Error",i&&Object.assign(r,i),r};const OZ=null;function nS(e){return Ve.isPlainObject(e)||Ve.isArray(e)}function tk(e){return Ve.endsWith(e,"[]")?e.slice(0,-2):e}function nk(e,t,n){return e?e.concat(t).map(function(s,i){return s=tk(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function MZ(e){return Ve.isArray(e)&&!e.some(nS)}const NZ=Ve.toFlatObject(Ve,{},null,function(t){return/^is[A-Z]/.test(t)});function km(e,t,n){if(!Ve.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Ve.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,v){return!Ve.isUndefined(v[g])});const o=n.metaTokens,s=n.visitor||u,i=n.dots,r=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Ve.isSpecCompliantForm(t);if(!Ve.isFunction(s))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(Ve.isDate(p))return p.toISOString();if(Ve.isBoolean(p))return p.toString();if(!l&&Ve.isBlob(p))throw new zt("Blob is not supported. Use a Buffer instead.");return Ve.isArrayBuffer(p)||Ve.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,g,v){let y=p;if(p&&!v&&typeof p=="object"){if(Ve.endsWith(g,"{}"))g=o?g:g.slice(0,-2),p=JSON.stringify(p);else if(Ve.isArray(p)&&MZ(p)||(Ve.isFileList(p)||Ve.endsWith(g,"[]"))&&(y=Ve.toArray(p)))return g=tk(g),y.forEach(function(S,C){!(Ve.isUndefined(S)||S===null)&&t.append(r===!0?nk([g],C,i):r===null?g:g+"[]",c(S))}),!1}return nS(p)?!0:(t.append(nk(v,g,i),c(p)),!1)}const d=[],h=Object.assign(NZ,{defaultVisitor:u,convertValue:c,isVisitable:nS});function f(p,g){if(!Ve.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),Ve.forEach(p,function(y,b){(!(Ve.isUndefined(y)||y===null)&&s.call(t,y,Ve.isString(b)?b.trim():b,g,h))===!0&&f(y,g?g.concat(b):[b])}),d.pop()}}if(!Ve.isObject(e))throw new TypeError("data must be an object");return f(e),t}function ok(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function oS(e,t){this._pairs=[],e&&km(e,this,t)}const sk=oS.prototype;sk.append=function(t,n){this._pairs.push([t,n])},sk.toString=function(t){const n=t?function(o){return t.call(this,o,ok)}:ok;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function LZ(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ik(e,t,n){if(!t)return e;const o=n&&n.encode||LZ;Ve.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=Ve.isURLSearchParams(t)?t.toString():new oS(t,n).toString(o),i){const r=e.indexOf("#");r!==-1&&(e=e.slice(0,r)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class rk{constructor(){this.handlers=[]}use(t,n,o){return this.handlers.push({fulfilled:t,rejected:n,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Ve.forEach(this.handlers,function(o){o!==null&&t(o)})}}const ak={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},VZ={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:oS,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},sS=typeof window<"u"&&typeof document<"u",iS=typeof navigator=="object"&&navigator||void 0,BZ=sS&&(!iS||["ReactNative","NativeScript","NS"].indexOf(iS.product)<0),$Z=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",HZ=sS&&window.location.href||"http://localhost",Go={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:sS,hasStandardBrowserEnv:BZ,hasStandardBrowserWebWorkerEnv:$Z,navigator:iS,origin:HZ},Symbol.toStringTag,{value:"Module"})),...VZ};function GZ(e,t){return km(e,new Go.classes.URLSearchParams,{visitor:function(n,o,s,i){return Go.isNode&&Ve.isBuffer(n)?(this.append(o,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function UZ(e){return Ve.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function WZ(e){const t={},n=Object.keys(e);let o;const s=n.length;let i;for(o=0;o<s;o++)i=n[o],t[i]=e[i];return t}function lk(e){function t(n,o,s,i){let r=n[i++];if(r==="__proto__")return!0;const a=Number.isFinite(+r),l=i>=n.length;return r=!r&&Ve.isArray(s)?s.length:r,l?(Ve.hasOwnProp(s,r)?s[r]=[s[r],o]:s[r]=o,!a):((!s[r]||!Ve.isObject(s[r]))&&(s[r]=[]),t(n,o,s[r],i)&&Ve.isArray(s[r])&&(s[r]=WZ(s[r])),!a)}if(Ve.isFormData(e)&&Ve.isFunction(e.entries)){const n={};return Ve.forEachEntry(e,(o,s)=>{t(UZ(o),s,n,0)}),n}return null}function zZ(e,t,n){if(Ve.isString(e))try{return(t||JSON.parse)(e),Ve.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(n||JSON.stringify)(e)}const tf={transitional:ak,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const o=n.getContentType()||"",s=o.indexOf("application/json")>-1,i=Ve.isObject(t);if(i&&Ve.isHTMLForm(t)&&(t=new FormData(t)),Ve.isFormData(t))return s?JSON.stringify(lk(t)):t;if(Ve.isArrayBuffer(t)||Ve.isBuffer(t)||Ve.isStream(t)||Ve.isFile(t)||Ve.isBlob(t)||Ve.isReadableStream(t))return t;if(Ve.isArrayBufferView(t))return t.buffer;if(Ve.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(o.indexOf("application/x-www-form-urlencoded")>-1)return GZ(t,this.formSerializer).toString();if((a=Ve.isFileList(t))||o.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return km(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),zZ(t)):t}],transformResponse:[function(t){const n=this.transitional||tf.transitional,o=n&&n.forcedJSONParsing,s=this.responseType==="json";if(Ve.isResponse(t)||Ve.isReadableStream(t))return t;if(t&&Ve.isString(t)&&(o&&!this.responseType||s)){const r=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(r)throw a.name==="SyntaxError"?zt.from(a,zt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Go.classes.FormData,Blob:Go.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ve.forEach(["delete","get","head","post","put","patch"],e=>{tf.headers[e]={}});const jZ=Ve.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),KZ=e=>{const t={};let n,o,s;return e&&e.split(`
140
140
  `).forEach(function(r){s=r.indexOf(":"),n=r.substring(0,s).trim().toLowerCase(),o=r.substring(s+1).trim(),!(!n||t[n]&&jZ[n])&&(n==="set-cookie"?t[n]?t[n].push(o):t[n]=[o]:t[n]=t[n]?t[n]+", "+o:o)}),t},ck=Symbol("internals");function nf(e){return e&&String(e).trim().toLowerCase()}function Om(e){return e===!1||e==null?e:Ve.isArray(e)?e.map(Om):String(e)}function qZ(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}const YZ=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function rS(e,t,n,o,s){if(Ve.isFunction(o))return o.call(this,t,n);if(s&&(t=n),!!Ve.isString(t)){if(Ve.isString(o))return t.indexOf(o)!==-1;if(Ve.isRegExp(o))return o.test(t)}}function ZZ(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,o)=>n.toUpperCase()+o)}function XZ(e,t){const n=Ve.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+n,{value:function(s,i,r){return this[o].call(this,t,s,i,r)},configurable:!0})})}let ds=class{constructor(t){t&&this.set(t)}set(t,n,o){const s=this;function i(a,l,c){const u=nf(l);if(!u)throw new Error("header name must be a non-empty string");const d=Ve.findKey(s,u);(!d||s[d]===void 0||c===!0||c===void 0&&s[d]!==!1)&&(s[d||l]=Om(a))}const r=(a,l)=>Ve.forEach(a,(c,u)=>i(c,u,l));if(Ve.isPlainObject(t)||t instanceof this.constructor)r(t,n);else if(Ve.isString(t)&&(t=t.trim())&&!YZ(t))r(KZ(t),n);else if(Ve.isObject(t)&&Ve.isIterable(t)){let a={},l,c;for(const u of t){if(!Ve.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?Ve.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}r(a,n)}else t!=null&&i(n,t,o);return this}get(t,n){if(t=nf(t),t){const o=Ve.findKey(this,t);if(o){const s=this[o];if(!n)return s;if(n===!0)return qZ(s);if(Ve.isFunction(n))return n.call(this,s,o);if(Ve.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=nf(t),t){const o=Ve.findKey(this,t);return!!(o&&this[o]!==void 0&&(!n||rS(this,this[o],o,n)))}return!1}delete(t,n){const o=this;let s=!1;function i(r){if(r=nf(r),r){const a=Ve.findKey(o,r);a&&(!n||rS(o,o[a],a,n))&&(delete o[a],s=!0)}}return Ve.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let o=n.length,s=!1;for(;o--;){const i=n[o];(!t||rS(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,o={};return Ve.forEach(this,(s,i)=>{const r=Ve.findKey(o,i);if(r){n[r]=Om(s),delete n[i];return}const a=t?ZZ(i):String(i).trim();a!==i&&delete n[i],n[a]=Om(s),o[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Ve.forEach(this,(o,s)=>{o!=null&&o!==!1&&(n[s]=t&&Ve.isArray(o)?o.join(", "):o)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
141
141
  `)}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 o=new this(t);return n.forEach(s=>o.set(s)),o}static accessor(t){const o=(this[ck]=this[ck]={accessors:{}}).accessors,s=this.prototype;function i(r){const a=nf(r);o[a]||(XZ(s,r),o[a]=!0)}return Ve.isArray(t)?t.forEach(i):i(t),this}};ds.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ve.reduceDescriptors(ds.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}}),Ve.freezeMethods(ds);function aS(e,t){const n=this||tf,o=t||n,s=ds.from(o.headers);let i=o.data;return Ve.forEach(e,function(a){i=a.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function uk(e){return!!(e&&e.__CANCEL__)}function Iu(e,t,n){zt.call(this,e??"canceled",zt.ERR_CANCELED,t,n),this.name="CanceledError"}Ve.inherits(Iu,zt,{__CANCEL__:!0});function dk(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new zt("Request failed with status code "+n.status,[zt.ERR_BAD_REQUEST,zt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function JZ(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function QZ(e,t){e=e||10;const n=new Array(e),o=new Array(e);let s=0,i=0,r;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=o[i];r||(r=c),n[s]=l,o[s]=c;let d=i,h=0;for(;d!==s;)h+=n[d++],d=d%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-r<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function eX(e,t){let n=0,o=1e3/t,s,i;const r=(c,u=Date.now())=>{n=u,s=null,i&&(clearTimeout(i),i=null),e(...c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=o?r(c,u):(s=c,i||(i=setTimeout(()=>{i=null,r(s)},o-d)))},()=>s&&r(s)]}const Mm=(e,t,n=3)=>{let o=0;const s=QZ(50,250);return eX(i=>{const r=i.loaded,a=i.lengthComputable?i.total:void 0,l=r-o,c=s(l),u=r<=a;o=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:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},hk=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},fk=e=>(...t)=>Ve.asap(()=>e(...t)),tX=Go.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Go.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Go.origin),Go.navigator&&/(msie|trident)/i.test(Go.navigator.userAgent)):()=>!0,nX=Go.hasStandardBrowserEnv?{write(e,t,n,o,s,i,r){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];Ve.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Ve.isString(o)&&a.push(`path=${o}`),Ve.isString(s)&&a.push(`domain=${s}`),i===!0&&a.push("secure"),Ve.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 oX(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function sX(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function pk(e,t,n){let o=!oX(t);return e&&(o||n==!1)?sX(e,t):t}const gk=e=>e instanceof ds?{...e}:e;function Jl(e,t){t=t||{};const n={};function o(c,u,d,h){return Ve.isPlainObject(c)&&Ve.isPlainObject(u)?Ve.merge.call({caseless:h},c,u):Ve.isPlainObject(u)?Ve.merge({},u):Ve.isArray(u)?u.slice():u}function s(c,u,d,h){if(Ve.isUndefined(u)){if(!Ve.isUndefined(c))return o(void 0,c,d,h)}else return o(c,u,d,h)}function i(c,u){if(!Ve.isUndefined(u))return o(void 0,u)}function r(c,u){if(Ve.isUndefined(u)){if(!Ve.isUndefined(c))return o(void 0,c)}else return o(void 0,u)}function a(c,u,d){if(d in t)return o(c,u);if(d in e)return o(void 0,c)}const l={url:i,method:i,data:i,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(c,u,d)=>s(gk(c),gk(u),d,!0)};return Ve.forEach(Object.keys({...e,...t}),function(u){const d=l[u]||s,h=d(e[u],t[u],u);Ve.isUndefined(h)&&d!==a||(n[u]=h)}),n}const mk=e=>{const t=Jl({},e);let{data:n,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:i,headers:r,auth:a}=t;if(t.headers=r=ds.from(r),t.url=ik(pk(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&r.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Ve.isFormData(n)){if(Go.hasStandardBrowserEnv||Go.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(Ve.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(Go.hasStandardBrowserEnv&&(o&&Ve.isFunction(o)&&(o=o(t)),o||o!==!1&&tX(t.url))){const l=s&&i&&nX.read(i);l&&r.set(s,l)}return t},iX=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,o){const s=mk(e);let i=s.data;const r=ds.from(s.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=s,u,d,h,f,p;function g(){f&&f(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(s.method.toUpperCase(),s.url,!0),v.timeout=s.timeout;function y(){if(!v)return;const S=ds.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:S,config:e,request:v};dk(function(x){n(x),g()},function(x){o(x),g()},E),v=null}"onloadend"in v?v.onloadend=y:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(y)},v.onabort=function(){v&&(o(new zt("Request aborted",zt.ECONNABORTED,e,v)),v=null)},v.onerror=function(C){const E=C&&C.message?C.message:"Network Error",_=new zt(E,zt.ERR_NETWORK,e,v);_.event=C||null,o(_),v=null},v.ontimeout=function(){let C=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const E=s.transitional||ak;s.timeoutErrorMessage&&(C=s.timeoutErrorMessage),o(new zt(C,E.clarifyTimeoutError?zt.ETIMEDOUT:zt.ECONNABORTED,e,v)),v=null},i===void 0&&r.setContentType(null),"setRequestHeader"in v&&Ve.forEach(r.toJSON(),function(C,E){v.setRequestHeader(E,C)}),Ve.isUndefined(s.withCredentials)||(v.withCredentials=!!s.withCredentials),a&&a!=="json"&&(v.responseType=s.responseType),c&&([h,p]=Mm(c,!0),v.addEventListener("progress",h)),l&&v.upload&&([d,f]=Mm(l),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",f)),(s.cancelToken||s.signal)&&(u=S=>{v&&(o(!S||S.type?new Iu(null,e,v):S),v.abort(),v=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const b=JZ(s.url);if(b&&Go.protocols.indexOf(b)===-1){o(new zt("Unsupported protocol "+b+":",zt.ERR_BAD_REQUEST,e));return}v.send(i||null)})},rX=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let o=new AbortController,s;const i=function(c){if(!s){s=!0,a();const u=c instanceof Error?c:this.reason;o.abort(u instanceof zt?u:new Iu(u instanceof Error?u.message:u))}};let r=t&&setTimeout(()=>{r=null,i(new zt(`timeout ${t} of ms exceeded`,zt.ETIMEDOUT))},t);const a=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:l}=o;return l.unsubscribe=()=>Ve.asap(a),l}},aX=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let o=0,s;for(;o<n;)s=o+t,yield e.slice(o,s),o=s},lX=async function*(e,t){for await(const n of cX(e))yield*aX(n,t)},cX=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:o}=await t.read();if(n)break;yield o}}finally{await t.cancel()}},vk=(e,t,n,o)=>{const s=lX(e,t);let i=0,r,a=l=>{r||(r=!0,o&&o(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await s.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let h=i+=d;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),s.return()}},{highWaterMark:2})},yk=64*1024,{isFunction:Nm}=Ve,uX=(({Request:e,Response:t})=>({Request:e,Response:t}))(Ve.global),{ReadableStream:wk,TextEncoder:Ck}=Ve.global,bk=(e,...t)=>{try{return!!e(...t)}catch{return!1}},dX=e=>{e=Ve.merge.call({skipUndefined:!0},uX,e);const{fetch:t,Request:n,Response:o}=e,s=t?Nm(t):typeof fetch=="function",i=Nm(n),r=Nm(o);if(!s)return!1;const a=s&&Nm(wk),l=s&&(typeof Ck=="function"?(p=>g=>p.encode(g))(new Ck):async p=>new Uint8Array(await new n(p).arrayBuffer())),c=i&&a&&bk(()=>{let p=!1;const g=new n(Go.origin,{body:new wk,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),u=r&&a&&bk(()=>Ve.isReadableStream(new o("").body)),d={stream:u&&(p=>p.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(g,v)=>{let y=g&&g[p];if(y)return y.call(g);throw new zt(`Response type '${p}' is not supported`,zt.ERR_NOT_SUPPORT,v)})});const h=async p=>{if(p==null)return 0;if(Ve.isBlob(p))return p.size;if(Ve.isSpecCompliantForm(p))return(await new n(Go.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(Ve.isArrayBufferView(p)||Ve.isArrayBuffer(p))return p.byteLength;if(Ve.isURLSearchParams(p)&&(p=p+""),Ve.isString(p))return(await l(p)).byteLength},f=async(p,g)=>{const v=Ve.toFiniteNumber(p.getContentLength());return v??h(g)};return async p=>{let{url:g,method:v,data:y,signal:b,cancelToken:S,timeout:C,onDownloadProgress:E,onUploadProgress:_,responseType:x,headers:A,withCredentials:k="same-origin",fetchOptions:T}=mk(p),D=t||fetch;x=x?(x+"").toLowerCase():"text";let F=rX([b,S&&S.toAbortSignal()],C),P=null;const $=F&&F.unsubscribe&&(()=>{F.unsubscribe()});let ne;try{if(_&&c&&v!=="get"&&v!=="head"&&(ne=await f(A,y))!==0){let M=new n(g,{method:"POST",body:y,duplex:"half"}),Y;if(Ve.isFormData(y)&&(Y=M.headers.get("content-type"))&&A.setContentType(Y),M.body){const[L,se]=hk(ne,Mm(fk(_)));y=vk(M.body,yk,L,se)}}Ve.isString(k)||(k=k?"include":"omit");const U=i&&"credentials"in n.prototype,q={...T,signal:F,method:v.toUpperCase(),headers:A.normalize().toJSON(),body:y,duplex:"half",credentials:U?k:void 0};P=i&&new n(g,q);let Q=await(i?D(P,T):D(g,q));const X=u&&(x==="stream"||x==="response");if(u&&(E||X&&$)){const M={};["status","statusText","headers"].forEach(fe=>{M[fe]=Q[fe]});const Y=Ve.toFiniteNumber(Q.headers.get("content-length")),[L,se]=E&&hk(Y,Mm(fk(E),!0))||[];Q=new o(vk(Q.body,yk,L,()=>{se&&se(),$&&$()}),M)}x=x||"text";let he=await d[Ve.findKey(d,x)||"text"](Q,p);return!X&&$&&$(),await new Promise((M,Y)=>{dk(M,Y,{data:he,headers:ds.from(Q.headers),status:Q.status,statusText:Q.statusText,config:p,request:P})})}catch(U){throw $&&$(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new zt("Network Error",zt.ERR_NETWORK,p,P),{cause:U.cause||U}):zt.from(U,U&&U.code,p,P)}}},hX=new Map,Sk=e=>{let t=e&&e.env||{};const{fetch:n,Request:o,Response:s}=t,i=[o,s,n];let r=i.length,a=r,l,c,u=hX;for(;a--;)l=i[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:dX(t)),u=c;return c};Sk();const lS={http:OZ,xhr:iX,fetch:{get:Sk}};Ve.forEach(lS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ek=e=>`- ${e}`,fX=e=>Ve.isFunction(e)||e===null||e===!1;function pX(e,t){e=Ve.isArray(e)?e:[e];const{length:n}=e;let o,s;const i={};for(let r=0;r<n;r++){o=e[r];let a;if(s=o,!fX(o)&&(s=lS[(a=String(o)).toLowerCase()],s===void 0))throw new zt(`Unknown adapter '${a}'`);if(s&&(Ve.isFunction(s)||(s=s.get(t))))break;i[a||"#"+r]=s}if(!s){const r=Object.entries(i).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 :
142
142
  `+r.map(Ek).join(`
@@ -247,4 +247,4 @@ See ${xN(e,t)}`;return Array.isArray(o)?o.concat(i):[o,i]}var Ope={1:"Charting A
247
247
  If you are trying to annotate ${o} with application data, use the '${o}.context' property instead.`),$f(u)}if(a.length>0&&s){const l=this.beans.frameworkOverrides.getDocLink(s);$f(`to see all the valid ${o} properties please check: ${l}`)}}};function tge(e,t,n){const o={},s=e.filter(i=>!t.some(r=>r===i));if(s.length>0)for(const i of s)o[i]=eE({inputValue:i,allSuggestions:n}).values;return o}var nge=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),oge={moduleName:"Validation",version:ut,beans:[ege]};function T2(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var sge=class extends He{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){var n;const t=!!((n=this.filterManager)!=null&&n.isChildFilterPresent());this.filterNodes(t,e)}filterNodes(e,t){const n=(o,s)=>{o.hasChildren()&&e&&!s?o.childrenAfterFilter=o.childrenAfterGroup.filter(i=>{const r=i.childrenAfterFilter&&i.childrenAfterFilter.length>0,a=i.data&&this.filterManager.doesRowPassFilter({rowNode:i});return r||a}):o.childrenAfterFilter=o.childrenAfterGroup,T2(o)};if(this.doingTreeDataFiltering()){const o=(i,r)=>{if(i.childrenAfterGroup)for(let a=0;a<i.childrenAfterGroup.length;a++){const l=i.childrenAfterGroup[a],c=r||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?o(i.childrenAfterGroup[a],c):n(l,c)}n(i,r)},s=i=>o(i,!1);t.executeFromRootNode(s)}else{const o=s=>n(s,!1);t.forEachChangedNodeDepthFirst(o,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},ige=class extends IE{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,n,o,s){this.comp=e;const i=Kf(this,this.beans.context,s);this.eButtonShowMainFilter=n,this.eFloatingFilterBody=o,this.setGui(t,i),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(i),this.setupLeft(i),this.setupHover(i),this.setupFocus(i),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(i),this.setupUi(),i.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(i);const r=()=>this.onColDefChanged(i);i.addManagedListeners(this.column,{colDefChanged:r}),i.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&r()}}),i.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,n=e.colDef;return It(t.gos,{colDef:n,column:e,floatingFilter:!0})}setupActive(){const e=this.column.getColDef(),t=!!e.filter,n=!!e.floatingFilter;this.active=t&&n}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=ci("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new fd(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.getLocaleTextFunc();Ju(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){var r;const{beans:t}=this;if(Hn(t)===this.eGui)return;const s=vc(t,this.eGui,null,e.shiftKey);if(s){(r=t.headerNavigation)==null||r.scrollToColumn(this.column),e.preventDefault(),s.focus();return}const i=this.findNextColumnWithFloatingFilter(e.shiftKey);i&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:i},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let n=this.column;do if(n=e?t.getColBefore(n):t.getColAfter(n),!n)break;while(!n.getColDef().filter||!n.getColDef().floatingFilter);return n}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case Ae.UP:case Ae.DOWN:case Ae.LEFT:case Ae.RIGHT:if(t)return;Cc(e);case Ae.ENTER:t&&mc(this.eGui)&&e.preventDefault();break;case Ae.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const n=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),o=!!e.relatedTarget&&cc(e.relatedTarget,"ag-floating-filter");if(n&&o&&e.target===this.eGui){const s=this.lastFocusEvent,i=!!(s&&s.key===Ae.TAB);if(s&&i){const r=s.shiftKey;mc(this.eGui,r)}}this.focusThis()}setupHover(e){var t;(t=this.beans.colHover)==null||t.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new FE(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){var e;this.suppressFilterButton=!((e=this.beans.menuSvc)!=null&&e.isFloatingFilterButtonEnabled(this.column)),this.highlightFilterButtonWhenActive=!Ns(this.gos)}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.colFilter)==null?void 0:t.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){var t;const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;(t=this.beans.menuSvc)==null||t.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:n,gos:o}=this,s=i=>{if((i==null?void 0:i.source)==="filterDestroyed"&&(!this.isAlive()||!(t!=null&&t.isAlive())))return;const r=this.comp.getFloatingFilterComp();r&&r.then(a=>{if(a){if(o.get("enableFilterHandlers")){const u=i;let d="filter";u!=null&&u.afterFloatingFilter?d="ui":u!=null&&u.afterDataChange?d="dataChanged":(i==null?void 0:i.source)==="api"&&(d="api"),this.updateFloatingFilterParams(this.userCompDetails,d);return}const l=t==null?void 0:t.getCurrentFloatingFilterParentModel(n),c=i?{...i,columns:i.columns??[],source:i.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,c)}})};[this.destroySyncListener]=e.addManagedListeners(n,{filterChanged:s}),t!=null&&t.isFilterActive(n)&&s(null)}setupWidth(e){const t=()=>{const n=`${this.column.getActualWidth()}px`;this.comp.setWidth(n)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){var e;if(!this.suppressFilterButton&&this.comp){const t=!!((e=this.beans.filterManager)!=null&&e.isFilterAllowed(this.column));this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const n=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const o=this.beans.colFilter,s=this.active?o==null?void 0:o.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,i=this.comp.getFloatingFilterComp();!i||!s?this.updateCompDetails(e,s,n):i.then(r=>{!r||o!=null&&o.areFilterCompsDifferent(this.userCompDetails??null,s)?this.updateCompDetails(e,s,n):this.updateFloatingFilterParams(s,"colDef")})}updateCompDetails(e,t,n){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),n&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){var o;if(!e)return;let n=e.params;(o=this.comp.getFloatingFilterComp())==null||o.then(s=>{var i;typeof(s==null?void 0:s.refresh)=="function"&&(this.gos.get("enableFilterHandlers")&&(n={...n,model:Ro(((i=this.beans.colFilter)==null?void 0:i.model)??{},this.column.getColId()),source:t}),s.refresh(n))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function rge(e,t){var o;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}(o=e.menuSvc)==null||o.showColumnMenu({column:n,positionBy:"auto"})}function age(e){var t;(t=e.menuSvc)==null||t.hidePopupMenu()}var lge={moduleName:"SharedMenu",version:ut,beans:[wle],apiFunctions:{showColumnMenu:rge,hidePopupMenu:age}},cge=class extends $re{postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getDefaultPopupParent(){return this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:n,event:o}=e,s=t.getBoundingClientRect(),i=this.getParentRect();this.setAlignedTo(t,n);let r=!1;const a=()=>{const l=this.keepXYWithinBounds(n,s.top-i.top,0),c=n.clientWidth>0?n.clientWidth:200;r||(n.style.minWidth=`${c}px`,r=!0);const d=i.right-i.left-c;let h;return this.gos.get("enableRtl")?(h=p(),h<0&&(h=f(),this.setAlignedStyles(n,"left")),h>d&&(h=0,this.setAlignedStyles(n,"right"))):(h=f(),h>d&&(h=p(),this.setAlignedStyles(n,"right")),h<0&&(h=0,this.setAlignedStyles(n,"left"))),{x:h,y:l};function f(){return s.right-i.left-2}function p(){return s.left-i.left-c}};this.positionPopup({ePopup:n,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",n,t,o instanceof MouseEvent?o:void 0)})}callPostProcessPopup(e,t,n,o,s){const i=this.gos.getCallback("postProcessPopup");if(i){const{column:r,rowNode:a}=e;i({column:r,rowNode:a,ePopup:n,type:t,eventSource:o,mouseEvent:s})}}getActivePopups(){return this.popupList.map(e=>e.element)}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const n of this.popupList)t.applyThemeClasses(n.wrapper)}}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return fa(e)}},vy={moduleName:"Popup",version:ut,beans:[cge]},uge=".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;>*{cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper,:where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}:where(.ag-floating-filter-full-body)>div{flex:1 1 auto}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>*{flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));&>*{margin-bottom:var(--ag-widget-vertical-spacing)}:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}";function dge(e){const t=e.filterManager;return!!(t!=null&&t.isColumnFilterPresent())||!!(t!=null&&t.isAggregateFilterPresent())}function hge(e,t){var n;return((n=e.filterManager)==null?void 0:n.getColumnFilterInstance(t))??Promise.resolve(void 0)}function fge(e,t){var o;const n=e.colModel.getColDefCol(t);if(n)return(o=e.colFilter)==null?void 0:o.destroyFilter(n,"api")}function pge(e,t){e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=e.filterManager)==null?void 0:n.setFilterModel(t)})}function gge(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function mge(e,t,n){const{gos:o,colModel:s,colFilter:i}=e;n&&!o.get("enableFilterHandlers")&&(qe(288),n=!1);const r=s.getColDefCol(t);return r?(i==null?void 0:i.getModelForColumn(r,n))??null:null}function vge(e,t,n){var o;return((o=e.filterManager)==null?void 0:o.setColumnFilterModel(t,n))??Promise.resolve()}function yge(e,t){var o;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}(o=e.menuSvc)==null||o.showFilterMenu({column:n,containerType:"columnFilter",positionBy:"auto"})}function wge(e){var t;(t=e.menuSvc)==null||t.hideFilterMenu()}function Cge(e,t){var o;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}return(o=e.colFilter)==null?void 0:o.getHandler(n,!0)}function bge(e,t){const{colModel:n,colFilter:o,gos:s}=e;if(!s.get("enableFilterHandlers")){qe(287);return}const{colId:i,action:r}=t;if(i){const a=n.getColById(i);a&&(o==null||o.updateModel(a,r))}else o==null||o.updateAllModels(r)}var Sge={filterHandler:()=>({doesFilterPass:()=>!0})},Ege=class extends He{constructor(){super(...arguments),this.beanName="colFilter",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=new Map,this.handlerMap={...VL},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){var n,o;this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)});const e=this.gos,t={...((o=(n=e.get("initialState"))==null?void 0:n.filter)==null?void 0:o.filterModel)??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",n){const{colModel:o,dataTypeSvc:s,filterManager:i}=this.beans;if(s!=null&&s.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const r=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,u)=>{const d=e[u];r.push(this.setModelOnFilterWrapper(c,d)),l.delete(u)}),l.forEach(c=>{const u=o.getColDefCol(c)||o.getCol(c);if(!u){qe(62,{colId:c});return}if(!u.isFilterAllowed()){qe(63,{colId:c});return}const d=this.getOrCreateFilterWrapper(u,!0);if(!d){qe(64,{colId:c});return}r.push(this.setModelOnFilterWrapper(d,e[c],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{r.push(this.setModelOnFilterWrapper(l,null))});zn.all(r).then(()=>{const l=this.getModel(!0),c=[];this.allColumnFilters.forEach((u,d)=>{const h=a?a[d]:null,f=l?l[d]:null;Ff(h,f)||c.push(u.column)}),c.length>0?i==null||i.onFilterChanged({columns:c,source:t}):n&&this.updateActive("filterChanged")})}getModel(e){var i;const t={},{allColumnFilters:n,initialModel:o,beans:{colModel:s}}=this;if(n.forEach((r,a)=>{const l=this.getModelFromFilterWrapper(r);ht(l)&&(t[a]=l)}),!e)for(const r of Object.keys(o)){const a=o[r];ht(a)&&!n.has(r)&&((i=s.getCol(r))!=null&&i.isFilterAllowed())&&(t[r]=a)}return t}setState(e,t,n="api"){if(this.state.clear(),t)for(const o of Object.keys(t)){const s=t[o];this.state.set(o,{model:Ro(this.model,o),state:s})}this.setModel(e,n,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let n=!1;return e.forEach((o,s)=>{const i=o.state;i!=null&&(n=!0,t[s]=i)}),n?t:void 0}getModelFromFilterWrapper(e){const n=e.column.getColId();if(e.isHandler)return Ro(this.model,n);const o=e.filter;return o?typeof o.getModel!="function"?(qe(66),null):o.getModel():Ro(this.initialModel,n)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return e.size?(e.forEach(t=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),!0):!1}updateActiveFilters(){const e=c=>c?c.isFilterActive?c.isFilterActive():(qe(67),!1):!1,{colModel:t,gos:n}=this.beans,o=!!O0(n),s=c=>{if(!c.isPrimary())return!0;const d=!t.isPivotActive();return!c.isValueActive()||!d?!1:t.isPivotMode()?!0:o},i=[],r=[],a=(c,u,d)=>{u&&(s(c)?i.push(d):r.push(d))},l=[];return this.allColumnFilters.forEach(c=>{const u=c.column,d=u.getColId();if(c.isHandler)l.push(zn.resolve().then(()=>{a(u,this.isHandlerActive(u),{colId:d,isHandler:!0,handler:c.handler,handlerParams:c.handlerParams})}));else{const h=il(c);h&&l.push(h.then(f=>{a(u,e(f),{colId:d,isHandler:!1,comp:f})}))}}),zn.all(l).then(()=>{this.activeAggregateFilters=i,this.activeColumnFilters=r})}updateFilterFlagInColumns(e,t){var o;const n=[];return this.allColumnFilters.forEach(s=>{const i=s.column;if(s.isHandler)n.push(zn.resolve().then(()=>{this.setColFilterActive(i,this.isHandlerActive(i),e,t)}));else{const r=il(s);r&&n.push(r.then(a=>{this.setColFilterActive(i,a.isFilterActive(),e,t)}))}}),(o=this.beans.groupFilter)==null||o.updateFilterFlags(e,t),zn.all(n)}doFiltersPass(e,t,n){const{data:o,aggData:s}=e,i=n?this.activeAggregateFilters:this.activeColumnFilters,r=n?s:o,a=this.model;for(let l=0;l<i.length;l++){const c=i[l],{colId:u,isHandler:d}=c;if(u!==t)if(d){const{handler:h,handlerParams:f}=c;if(!h.doesFilterPass({node:e,data:r,model:Ro(a,u),handlerParams:f}))return!1}else{const h=c.comp;if(typeof h.doesFilterPass!="function"){Sn(91);continue}if(!h.doesFilterPass({node:e,data:r}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t!=null&&t.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:n}=this.beans,o=()=>{this.isAlive()&&(n==null||n.onFilterChanged(e))};t.isRefreshInProgress()?setTimeout(o,0):o()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:n}=e,o=t==null?void 0:t.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",n).then(()=>{this.allColumnFilters.forEach(s=>{var a,l,c;const{column:i,isHandler:r}=s;o!==i.getColId()&&(r&&((l=(a=s.handler).onAnyFilterChanged)==null||l.call(a)),(c=il(s,r))==null||c.then(u=>{typeof(u==null?void 0:u.onAnyFilterChanged)=="function"&&u.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(n=>{var i,r;const o=n.isHandler;o&&((r=(i=n.handler).onNewRowsLoaded)==null||r.call(i));const s=il(n,o);s&&t.push(s.then(a=>{var l;(l=a.onNewRowsLoaded)==null||l.call(a)}))}),zn.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:n,colModel:o}=this.beans;return(s,i)=>{const r=i?o.getCol(i):e;return r?n.getValue(r,s,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t!=null&&t.isHandler)return this.isHandlerActive(e);const n=t==null?void 0:t.filter;return n?n.isFilterActive():Ro(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=ht(Ro(this.model,e.getColId()));if(t)return t;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterActive(e):!1}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?il(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const n=il(t);return n?n.then(o=>({comp:o,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const n=this.getOrCreateFilterWrapper(e,t);return n!=null&&n.isHandler?n.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let n=this.cachedFilter(e);return!n&&t&&(n=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,n)),n}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>{var n;return(n=this.beans.dataTypeSvc)==null?void 0:n.getBaseDataType(e)},t)}getDefaultFilterFromDataType(e,t=!1){return Sse(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":uae(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,n,o,s,i){const r=()=>{const c=this.createFilterCompParams(e,s,i),u=o(c,s);return Rie(this.beans.userCompFactory,t,u,n)},a=r();return a?{compDetails:a,createFilterUi:c=>(c?r():a).newAgStackInstance()}:null}createFilterInstance(e,t,n,o){var d,h;const s=this.beans.selectableFilter;s!=null&&s.isSelectable(t)&&(t=s.getFilterDef(e,t));const{handler:i,handlerParams:r,handlerGenerator:a}=this.createHandler(e,t,n)??{},l=this.createFilterComp(e,t,n,o,!!i,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:i,handlerGenerator:a,handlerParams:r};const{compDetails:c,createFilterUi:u}=l;return this.isGlobalButtons&&((h=(d=c.params)==null?void 0:d.buttons)!=null&&h.length||qe(281,{colId:e.getColId()})),{compDetails:c,handler:i,handlerGenerator:a,handlerParams:r,createFilterUi:u}}createBaseFilterParams(e,t){const{filterManager:n,rowModel:o}=this.beans;return It(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:s=>(n==null?void 0:n.doesRowPassOtherFilters(e.getColId(),s))??!0,rowModel:o})}createFilterCompParams(e,t,n,o){const s=this.filterChangedCallbackFactory(e),i=this.createBaseFilterParams(e,o);if(i.filterChangedCallback=s,i.filterModifiedCallback=o?()=>{}:r=>this.filterModified(e,r),t){const r=i,a=e.getColId(),l=Ro(this.model,a);r.model=l,r.state=this.state.get(a)??{model:l},r.onModelChange=(c,u)=>{this.updateStoredModel(a,c),this.refreshHandlerAndUi(e,c,"ui",!1,u).then(()=>{s({...u,source:"columnFilter"})})},r.onStateChange=c=>{this.updateState(e,c),this.updateOrRefreshFilterUi(e)},r.onAction=(c,u,d)=>{this.updateModel(e,c,u),this.dispatchLocalEvent({type:"filterAction",column:e,action:c,event:d})},r.getHandler=()=>this.getHandler(e,!0),r.onUiChange=c=>this.filterUiChanged(e,c),r.source=n}return i}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,n){const o=t(),s={created:!0,create:t,filterParams:e.params,compDetails:e,promise:o};return o.then(n),s}createFilterWrapper(e){var a;const{compDetails:t,handler:n,handlerGenerator:o,handlerParams:s,createFilterUi:i}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),l=>l),r=e.getColId();if(n)return delete this.initialModel[r],(a=n.init)==null||a.call(n,{...s,source:"init",model:Ro(this.model,r)}),{column:e,isHandler:!0,handler:n,handlerGenerator:o,handlerParams:s,filterUi:this.createFilterUiForHandler(t,i)};if(i){const l={column:e,filterUi:null,isHandler:!1};return l.filterUi=this.createFilterUiLegacy(t,i,c=>{l.filter=c??void 0}),l}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,n){var f;const{gos:o,frameworkOverrides:s,registry:i}=this.beans;let r;const a=p=>{const g=p.filter;if(sL(g)){const v=g.handler;return v||(r=g.doesFilterPass,r?()=>({doesFilterPass:r}):void 0)}return typeof g=="string"?g:void 0},l=o.get("enableFilterHandlers"),c=l?a(t):void 0,u=p=>()=>this.createBean(i.createDynamicBean(p,!0));let d,h;if(typeof c=="string"){const p=(f=o.get("filterHandlers"))==null?void 0:f[c];p!=null?d=p:Jre.has(c)&&(d=u(c),h=c)}else d=c;if(!d){let p;const{compName:g,jsComp:v,fwComp:y}=cL(s,t);g?p=g:v==null&&y==null&&t.filter===!0&&(p=n),h=this.handlerMap[p],h&&(d=u(h))}return d?{filterHandler:d,handlerNameOrCallback:r??h}:l?(no(o)&&qe(277,{colId:e.getColId()}),Sge):void 0}createHandler(e,t,n){const o=this.createHandlerFunc(e,t,n);if(!o)return;const s=$0(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:i,filterHandler:r}=o,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,r,s);return{handler:a,handlerParams:l,handlerGenerator:i??r}}createHandlerFromFunc(e,t,n){const o=e.getColDef(),s=t(It(this.gos,{column:e,colDef:o})),i=this.createHandlerParams(e,n);return{handler:s,handlerParams:i}}createHandlerParams(e,t){const n=e.getColDef(),o=e.getColId(),s=this.filterChangedCallbackFactory(e);return It(this.gos,{colDef:n,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:i=>{var r;return((r=this.beans.filterManager)==null?void 0:r.doesRowPassOtherFilters(o,i))??!0},onModelChange:(i,r)=>{this.updateStoredModel(o,i),this.refreshHandlerAndUi(e,i,"handler",!1,r).then(()=>{s({...r,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:n,groupFilter:o}=this.beans;this.allColumnFilters.forEach((i,r)=>{let a;i.column.isPrimary()?a=t.getColDefCol(r):a=t.getCol(r),!(a&&a===i.column)&&(e.push(i.column),this.disposeFilterWrapper(i,"columnChanged"),this.disposeColumnListener(r))});const s=o&&e.every(i=>o.isGroupFilter(i));e.length>0&&!s&&(n==null||n.onFilterChanged({columns:e,source:"api"}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:n,frameworkOverrides:o,selectableFilter:s}=this.beans,i=h=>{const f=this.getOrCreateFilterUi(e);f!=null&&f.then(p=>{h(Yf(p))})},r=e.getColDef(),a=s!=null&&s.isSelectable(r)?s.getFilterDef(e,r):r,l=gae(o,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",c=this.gos.get("enableFilterHandlers"),u=$0(n,a,this.createFilterCompParams(e,c,"init",!0)),d=It(this.gos,{column:e,filterParams:u,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t});if(c){const h=d,f=e.getColId(),p=this.filterChangedCallbackFactory(e);h.onUiChange=g=>this.floatingFilterUiChanged(e,g),h.model=Ro(this.model,f),h.onModelChange=(g,v)=>{this.updateStoredModel(f,g),this.refreshHandlerAndUi(e,g,"floating",!0,v).then(()=>{p({...v,source:"columnFilter"})})},h.getHandler=()=>this.getHandler(e,!0),h.source="init"}return Iie(n,r,d,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,n,o){const s="paramsUpdated";if(e.isHandler){const i=t.getColId();delete this.initialModel[i],this.state.delete(i);const r=e.filterUi,a=this.createFilterUiForHandler(n,o);e.filterUi=a;const l=this.eventSvc;r!=null&&r.created?r.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:s,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:s,column:t})}else this.destroyFilter(t,s)}destroyFilter(e,t="api"){const n=e.getColId(),o=this.allColumnFilters.get(n);this.disposeColumnListener(n),delete this.initialModel[n],o&&this.disposeFilterWrapper(o,t).then(s=>{var i;s&&this.isAlive()&&((i=this.beans.filterManager)==null||i.onFilterChanged({columns:[e],source:"api"}))})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let n=!1;const{column:o,isHandler:s,filterUi:i}=e,r=o.getColId();s&&(n=this.isHandlerActive(o),this.destroyBean(e.handler),delete this.model[r],this.state.delete(r));const a=()=>{this.setColFilterActive(o,!1,"filterDestroyed"),this.allColumnFilters.delete(r),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:o})};if(i){if(i.created)return i.promise.then(l=>(n=s?n:!!(l!=null&&l.isFilterActive()),this.destroyBean(l),a(),n));a()}return zn.resolve(n)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:(t==null?void 0:t.source)??"columnFilter"})}}filterParamsChanged(e,t="api"){var v,y,b,S,C,E;const n=this.allColumnFilters.get(e);if(!n)return;const o=this.beans,s=n.column,i=s.getColDef(),r=s.isFilterAllowed(),a=this.getDefaultFilter(s),l=o.selectableFilter,c=l!=null&&l.isSelectable(i)?l.getFilterDef(s,i):i,u=r?this.createHandlerFunc(s,c,this.getDefaultFilter(s)):void 0,d=!!u,h=n.isHandler;if(h!=d){this.destroyFilter(s,"paramsUpdated");return}const{compDetails:f,createFilterUi:p}=(r?this.createFilterComp(s,c,a,_=>_,d,"colDef"):null)??{compDetails:null,createFilterUi:null},g=(f==null?void 0:f.params)??$0(o.userCompFactory,c,this.createFilterCompParams(s,d,"colDef"));if(h){const _=(u==null?void 0:u.handlerNameOrCallback)??(u==null?void 0:u.filterHandler),x=Ro(this.model,e);if(n.handlerGenerator!=_){const A=n.handler,{handler:k,handlerParams:T}=this.createHandlerFromFunc(s,u.filterHandler,g);n.handler=k,n.handlerParams=T,n.handlerGenerator=_,delete this.model[e],(v=k.init)==null||v.call(k,{...T,source:"init",model:null}),this.destroyBean(A),x!=null&&((y=this.beans.filterManager)==null||y.onFilterChanged({columns:[s],source:t}))}else{const A=this.createHandlerParams(s,f==null?void 0:f.params);n.handlerParams=A,(S=(b=n.handler).refresh)==null||S.call(b,{...A,source:"colDef",model:x})}}if(this.areFilterCompsDifferent(((C=n.filterUi)==null?void 0:C.compDetails)??null,f)||!n.filterUi||!f){this.destroyFilterUi(n,s,f,p);return}n.filterUi.filterParams=g,(E=il(n,h))==null||E.then(_=>{(_!=null&&_.refresh?_.refresh(g):!0)===!1?this.destroyFilterUi(n,s,f,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:s,params:g})})}refreshHandlerAndUi(e,t,n,o,s){const i=this.cachedFilter(e);if(!i)return o&&this.getOrCreateFilterWrapper(e,!0),zn.resolve();if(!i.isHandler)return zn.resolve();const{filterUi:r,handler:a,handlerParams:l}=i;return Qre(()=>{if(r){const{created:c,filterParams:u}=r;if(c)return r.promise.then(d=>d?{filter:d,filterParams:u}:void 0);r.refreshed=!0}return zn.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},n,s)}setColumnFilterWrapper(e,t){const n=e.getColId();this.allColumnFilters.set(n,t),this.allColumnListeners.set(n,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(n)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:n}=e,{componentClass:o}=t;return!(n===o||(n==null?void 0:n.render)&&(o==null?void 0:o.render)&&n.render===o.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const n=this.getOrCreateFilterUi(t);return n?new Promise(o=>{n.then(s=>{o(Yf(s))})}):Promise.resolve(null)}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:e,source:t})=>this.setModel(e,t)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:e,model:t,resolve:n})=>{this.setModelForColumn(e,t).then(()=>n())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:o,model:s}=this,i=e.getColId(),r=o.get(i);return r?r.model??null:Ro(s,i)}const n=this.cachedFilter(e);return n?this.getModelFromFilterWrapper(n):null}setModelForColumn(e,t){var n;if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){let o=()=>{};const s=new Promise(i=>{o=i});return this.columnModelUpdates.push({key:e,model:t,resolve:o}),s}return new Promise(o=>{this.setModelForColumnLegacy(e,t).then(s=>o(s))})}getStateForColumn(e){return this.state.get(e)??{model:Ro(this.model,e)}}setModelForColumnLegacy(e,t){const n=this.beans.colModel.getColDefCol(e),o=n?this.getOrCreateFilterWrapper(n,!0):null;return o?this.setModelOnFilterWrapper(o,t):zn.resolve()}setColDefPropsForDataType(e,t,n){var u;const o=e.filter,s=o===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):o;if(typeof s!="string")return;let i,r;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;s==="agMultiColumnFilter"?{filterParams:i,filterValueGetter:r}=((u=a.multiFilter)==null?void 0:u.getParamsForDataType(l,c,t,n))??{}:{filterParams:i,filterValueGetter:r}=aae(s,l,c,t,n,a,this.getLocaleTextFunc()),e.filterParams=i,r&&(e.filterValueGetter=r)}setColFilterActive(e,t,n,o){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",n)),e.dispatchColEvent("filterChanged",n,o)}setModelOnFilterWrapper(e,t,n){return new zn(o=>{if(e.isHandler){const i=e.column,r=i.getColId(),a=this.model[r];if(this.updateStoredModel(r,t),n&&t===a){o();return}this.refreshHandlerAndUi(i,t,"api").then(()=>o());return}const s=il(e);if(s){s.then(i=>{if(typeof(i==null?void 0:i.setModel)!="function"){qe(65),o();return}(i.setModel(t)||zn.resolve()).then(()=>o())});return}o()})}updateStoredModel(e,t){ht(t)?this.model[e]=t:delete this.model[e];const n=this.state.get(e),o={model:t,state:n==null?void 0:n.state};this.state.set(e,o)}filterModified(e,t){var n;(n=this.getOrCreateFilterUi(e))==null||n.then(o=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:o,...t})})}filterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"filterUiChanged",column:e,...t})}floatingFilterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:e,...t})}updateModel(e,t,n){var r;const o=e.getColId(),s=this.cachedFilter(e),i=()=>s==null?void 0:s.filterUi;HL(t,i,()=>Ro(this.model,o),()=>this.state.get(o),a=>this.updateState(e,a),a=>{var l,c;return(c=(l=i())==null?void 0:l.filterParams)==null?void 0:c.onModelChange(a,n)},s!=null&&s.isHandler?(r=s.handler.processModelToApply)==null?void 0:r.bind(s.handler):void 0)}updateAllModels(e,t){const n=[];this.allColumnFilters.forEach((o,s)=>{var r;const i=this.beans.colModel.getColDefCol(s);i&&HL(e,()=>o.filterUi,()=>Ro(this.model,s),()=>this.state.get(s),a=>this.updateState(i,a),a=>{this.updateStoredModel(s,a),this.dispatchLocalEvent({type:"filterAction",column:i,action:e}),n.push(this.refreshHandlerAndUi(i,a,"ui"))},o!=null&&o.isHandler?(r=o.handler.processModelToApply)==null?void 0:r.bind(o.handler):void 0)}),n.length&&zn.all(n).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();$L(()=>{var n;return(n=this.cachedFilter(e))==null?void 0:n.filterUi},()=>Ro(this.model,t),()=>this.state.get(t))}updateState(e,t){this.state.set(e.getColId(),t),this.dispatchLocalEvent({type:"filterStateChanged",column:e,state:t})}canApplyAll(){const{state:e,model:t,activeFilterComps:n}=this;for(const s of n)if(s.source==="COLUMN_MENU")return!1;let o=!1;for(const s of e.keys()){const i=e.get(s);if(i.valid===!1)return!1;(i.model??null)!==Ro(t,s)&&(o=!0)}return o}hasUnappliedModel(e){var o;const{model:t,state:n}=this;return(((o=n.get(e))==null?void 0:o.model)??null)!==Ro(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;const n=this.beans.filterPanelSvc;return n!=null&&n.isActive?!!n.getState(e.getColId()):!1}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function _ge(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function Rge(e,t="api"){var n;(n=e.filterManager)==null||n.onFilterChanged({source:t})}var Dge=class extends He{constructor(){super(...arguments),this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(e){this.quickFilter=e.quickFilter,this.advancedFilter=e.advancedFilter,this.colFilter=e.colFilter}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:o})=>this.onAdvFilterEnabledChanged(o),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter&&this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});const{gos:n}=this;this.alwaysPassFilter=n.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=n.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"&&t(e)}setFilterState(e,t,n="api"){var o;this.isAdvFilterEnabled()||(o=this.colFilter)==null||o.setState(e,t,n)}setFilterModel(e,t="api",n){var o;if(this.isAdvFilterEnabled()){n||this.warnAdvFilters();return}(o=this.colFilter)==null||o.setModel(e,t)}getFilterModel(){var e;return((e=this.colFilter)==null?void 0:e.getModel())??{}}getFilterState(){var e;return(e=this.colFilter)==null?void 0:e.getState()}isColumnFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isFilterPresent())}isAggregateFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isAggFilterPresent())}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(e){var t,n;e?(t=this.colFilter)!=null&&t.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):(n=this.advancedFilter)!=null&&n.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){var e;return!!((e=this.advancedFilter)!=null&&e.isEnabled())}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){O0(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:n,columns:o=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):zn.resolve()).then(()=>{var i;const s={source:t,type:"filterChanged",columns:o};n&&ts(s,n),this.eventSvc.dispatchEvent(s),(i=this.colFilter)==null||i.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.colFilter)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilter)!=null&&e.isFilterPresent())}updateAggFiltering(){this.aggFiltering=!!O0(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,colIdToSkip:e})}doesRowPassAggregateFilters(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.externalFilterPresent&&!this.doesExternalFilterPass(t)||this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip)||this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(t))}isFilterAllowed(e){var t;return this.isAdvFilterEnabled()?!1:!!((t=this.colFilter)!=null&&t.isFilterAllowed(e))}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){var n;if(this.isAdvFilterEnabled()){if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){this.advFilterModelUpdateQueue.push(e);return}this.advancedFilter.setModel(e??null),this.onFilterChanged({source:t})}}toggleAdvFilterBuilder(e,t){this.isAdvFilterEnabled()&&this.advancedFilter.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvFilterColumns(){this.isAdvFilterEnabled()&&this.advancedFilter.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){var e;return this.isAdvFilterEnabled()?!1:!!((e=this.colFilter)!=null&&e.hasFloatingFilters())}getColumnFilterInstance(e){var t;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):((t=this.colFilter)==null?void 0:t.getFilterInstance(e))??Promise.resolve(void 0)}warnAdvFilters(){qe(68)}setupAdvFilterHeaderComp(e){var t;(t=this.advancedFilter)==null||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(const e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){var n;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):((n=this.colFilter)==null?void 0:n.setModelForColumn(e,t))??Promise.resolve()}},Tge=class extends He{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){var e;(e=this.hidePopup)==null||e.call(this)}showMenuAfterMouseEvent(e,t,n,o){e&&!e.isColumn||this.showPopup(e,s=>{var i;(i=this.popupSvc)==null||i.positionPopupUnderMouseEvent({column:e,type:n,mouseEvent:t,ePopup:s})},n,t.target,Ns(this.gos),o)}showMenuAfterButtonClick(e,t,n,o){if(e&&!e.isColumn)return;let s=-1,i="left";const r=Ns(this.gos);!r&&this.gos.get("enableRtl")&&(s=1,i="right");const a=r?void 0:4*s,l=r?void 0:4;this.showPopup(e,c=>{var u;(u=this.popupSvc)==null||u.positionPopupByComponent({type:n,eventSource:t,ePopup:c,nudgeX:a,nudgeY:l,alignSide:i,keepWithinBounds:!0,position:"under",column:e})},n,t,r,o)}showPopup(e,t,n,o,s,i){var g;const r=e?this.createBean(new iae(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!(r!=null&&r.hasFilter())||!e){Sn(57);return}const a=so({tag:"div",cls:`ag-menu${s?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:v=>this.trapFocusWithin(v,a)}),a.appendChild(r==null?void 0:r.getGui());let l;const c=()=>r==null?void 0:r.afterGuiDetached(),u=Ese(this.gos)?o??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,d=v=>{dV(e,!1,"contextMenu");const y=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),y&&o&&mr(o)){const b=mL(o);b==null||b.focus({preventScroll:!0})}c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,n,e),i==null||i()},h=this.getLocaleTextFunc(),f=s&&n!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),p=(g=this.popupSvc)==null?void 0:g.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:d,positionCallback:()=>t(a),anchorToElement:u,ariaLabel:f});p&&(this.hidePopup=l=p.hideFunc),r.afterInit().then(()=>{t(a),r.afterGuiAttached({container:n,hidePopup:l})}),dV(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,n,e)}trapFocusWithin(e,t){e.key!==Ae.TAB||e.defaultPrevented||vc(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),mc(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,n){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:n??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},xge=class extends He{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,n){if(!t)return;const o=e.getColDef(),{selectableFilter:s,valueSvc:i}=this.beans,r=n??(s==null?void 0:s.getFilterValueGetter(e.getColId()))??o.filterValueGetter;return r?this.executeFilterValueGetter(r,t.data,e,t,o):i.getValue(e,t)}executeFilterValueGetter(e,t,n,o,s){const{expressionSvc:i,valueSvc:r}=this.beans,a=It(this.gos,{data:t,node:o,column:n,colDef:s,getValue:r.getValueCallback.bind(r,o)});return typeof e=="function"?e(a):i==null?void 0:i.evaluate(e,a)}},Fge={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},Ige=class extends yn{constructor(){super(Fge,[Wv]),this.eFloatingFilterText=dt}init(e){this.params=e;const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0);if(this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const n=e,o=n.getHandler();if(o.getModelAsString){const s=o.getModelAsString(n.model);this.eFloatingFilterText.setValue(s)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const n=t.getModelAsString(e);this.eFloatingFilterText.setValue(n)}})}refresh(e){this.init(e)}},a_=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const n=e.filterOptions??t;this.filterOptions!==n&&(this.filterOptions=n,this.customFilterOptions={},this.mapCustomOptions()),this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){const{filterOptions:e}=this;if(e)for(const t of e){if(typeof t=="string")continue;const n=[["displayKey"],["displayName"],["predicate","test"]],o=s=>s.some(i=>t[i]!=null)?!0:(qe(72,{keys:s}),!1);if(!n.every(o)){this.filterOptions=e.filter(s=>s===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const n=t[0];if(typeof n=="string")return n;if(n.displayKey)return n.displayKey;qe(73)}else qe(74)}getCustomOption(e){return this.customFilterOptions[e]}};function lp(e,t,n){return n==null?e.splice(t):e.splice(t,n)}function yy(e){return e==null||typeof e=="string"&&e.trim().length===0}function Pge(e){return e==="AND"||e==="OR"?e:"AND"}function Age(e,t,n){if(e==null)return;const{predicate:o}=e;if(o!=null&&!t.some(s=>s==null))return o(t,n)}function kge(e,t){let n=e.length;return n>t&&(e.splice(t),qe(78),n=t),n}function cp(e,t){const n=t.getCustomOption(e);if(n){const{numberOfInputs:s}=n;return s??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}var l_=class extends pae{constructor(e,t,n){super(e,"simple-filter"),this.mapValuesFromModel=t,this.defaultOptions=n,this.eTypes=[],this.eJoinPanels=[],this.eJoinAnds=[],this.eJoinOrs=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}setParams(e){super.setParams(e);const t=new a_;this.optionsFactory=t,t.init(e,this.defaultOptions),this.commonUpdateSimpleParams(e),this.createOption(),this.createMissingConditionsAndOperators()}updateParams(e,t){this.optionsFactory.refresh(e,this.defaultOptions),super.updateParams(e,t),this.commonUpdateSimpleParams(e)}commonUpdateSimpleParams(e){this.setNumConditions(e),this.defaultJoinOperator=Pge(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions();const t=this.getGui();this.isReadOnly()?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex")}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,n)=>{const o=n===0?e:this.optionsFactory.defaultOption;t.setValue(o,!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){const n=!e.operator,o=!t.operator;if(!n&&o||n&&!o)return!1;let i;if(n){const r=e,a=t;i=this.areSimpleModelsEqual(r,a)}else{const r=e,a=t;i=r.operator===a.operator&&tl(r.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return i}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),zn.resolve();if(e.operator){const o=e;let s=o.conditions;s==null&&(s=[],qe(77));const i=kge(s,this.maxNumConditions),r=this.getNumConditions();if(i<r)this.removeConditionsAndOperators(i);else if(i>r)for(let l=r;l<i;l++)this.createJoinOperatorPanel(),this.createOption();const a=o.operator==="OR";this.eJoinAnds.forEach(l=>l.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),s.forEach((l,c)=>{this.eTypes[c].setValue(l.type,!0),this.setConditionIntoUi(l,c)})}else{const o=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(o.type,!0),this.setConditionIntoUi(o,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),zn.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(qe(79),t=1),this.maxNumConditions=t;let n=e.numAlwaysVisibleConditions??1;n<1&&(qe(80),n=1),n>t&&(qe(81),n=t),this.numAlwaysVisibleConditions=n}createOption(){const e=this.getGui(),t=this.createManagedBean(new iE);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const n=this.createEValue();this.eConditionBodies.push(n),e.appendChild(n),this.putOptionsIntoDropdown(t),this.resetType(t);const o=this.getNumConditions()-1;this.forEachPositionInput(o,s=>this.resetInput(s)),this.addChangedListeners(t,o)}createJoinOperatorPanel(){const e=so({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),n=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const o=this.eJoinPanels.length-1,s=this.joinOperatorId++;this.resetJoinOperatorAnd(t,o,s),this.resetJoinOperatorOr(n,o,s),this.isReadOnly()||(t.onValueChange(this.listener),n.onValueChange(this.listener))}createJoinOperator(e,t,n){const o=this.createManagedBean(new zie);e.push(o);const s="ag-filter-condition-operator";return o.addCss(s),o.addCss(`${s}-${n}`),t.appendChild(o.getGui()),o}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map(e=>typeof e=="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const n of t)e.addOption(n);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,n=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:n?this.getLocaleTextFunc()(n.displayKey,n.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let n=0;n<this.getNumConditions();n++)this.isConditionUiComplete(n)?e=n:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const n=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<n){this.removeConditionsAndOperators(n+1);const o=e+1,s=n-o;s>0&&this.removeConditionsAndOperators(o,s),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((o,s)=>{const i=this.isConditionDisabled(s,e);o.setDisabled(i||this.filterListOptions.length<=1),s===1&&(kf(this.eJoinPanels[0],i),this.eJoinAnds[0].setDisabled(i),this.eJoinOrs[0].setDisabled(i))}),this.eConditionBodies.forEach((o,s)=>{Ln(o,this.isConditionBodyVisible(s))});const n=(t??this.getJoinOperator())==="OR";for(const o of this.eJoinAnds)o.setValue(!n,!0);for(const o of this.eJoinOrs)o.setValue(n,!0);this.forEachInput((o,s,i,r)=>{this.setElementDisplayed(o,s<r),this.setElementDisabled(o,this.isConditionDisabled(i,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:n,eConditionBodies:o,eJoinPanels:s,eJoinAnds:i,eJoinOrs:r}=this;this.removeComponents(n,e,t),this.removeElements(o,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(s,a,t),this.removeComponents(i,a,t),this.removeComponents(r,a,t)}removeElements(e,t,n){const o=lp(e,t,n);for(const s of o)Li(s)}removeComponents(e,t,n){const o=lp(e,t,n);for(const s of o)Li(s.getGui()),this.destroyBean(s)}afterGuiAttached(e){var t;if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus)){let n;if(!this.isReadOnly()){const o=this.getInputs(0)[0];o instanceof yc&&this.isConditionBodyVisible(0)?n=o.getInputElement():n=(t=this.eTypes[0])==null?void 0:t.getFocusableElement()}(n??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){var r;super.afterGuiDetached();const e=this.params;if((r=this.beans.colFilter)!=null&&r.shouldKeepStateOnDetach(e.column))return;e.onStateChange({model:e.model});let t=-1,n=-1,o=!1;const s=this.getJoinOperator();for(let a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))t===-1&&(t=a,n=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),c=a<t;(l||c)&&(this.removeConditionsAndOperators(a,1),o=!0,c&&n--)}let i=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),i=!0),this.shouldAddNewConditionAtEnd(n===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),i=!0),i&&this.updateConditionStatusesAndValues(n,s),o&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=n}getModelAsString(e){var t,n;return((n=(t=this.params.getHandler())==null?void 0:t.getModelAsString)==null?void 0:n.call(t,e))??""}getPlaceholderText(e,t){let n=this.translate(e);if(typeof this.filterPlaceholder=="function"){const o=this.eTypes[t].getValue(),s=this.translate(o);n=this.filterPlaceholder({filterOptionKey:o,filterOption:s,placeholder:n})}else typeof this.filterPlaceholder=="string"&&(n=this.filterPlaceholder);return n}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,n,o,s)=>{if(!(t instanceof yc))return;const i=n===0&&s>1?"inRangeStart":n===0?"filterOoo":"inRangeEnd",r=n===0&&s>1?e("ariaFilterFromValue","Filter from value"):n===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(i,o)),t.setInputAriaLabel(r)})}setElementValue(e,t,n){e instanceof yc&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){nL(e)&&Ln(e.getGui(),t)}setElementDisabled(e,t){nL(e)&&kf(e.getGui(),t)}attachElementOnChange(e,t){e instanceof yc&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,n)=>{this.forEachPositionTypeInput(n,t,e)})}forEachPositionInput(e,t){const n=this.getConditionType(e);this.forEachPositionTypeInput(e,n,t)}forEachPositionTypeInput(e,t,n){const o=cp(t,this.optionsFactory),s=this.getInputs(e);for(let i=0;i<s.length;i++){const r=s[i];r!=null&&n(r,i,e,o)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return cp(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(n=>n==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinAnds.forEach((t,n)=>this.resetJoinOperatorAnd(t,n,this.joinOperatorId+n)),this.eJoinOrs.forEach((t,n)=>this.resetJoinOperatorOr(t,n,this.joinOperatorId+n)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.updateUiVisibility(),e||this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){const n=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(n).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),n)}resetJoinOperatorOr(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),n)}resetJoinOperator(e,t,n,o,s){this.updateJoinOperatorDisabled(e.setValue(n,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${s}`).setLabel(o),t)}updateJoinOperatorsDisabled(){const e=(t,n)=>this.updateJoinOperatorDisabled(t,n);this.eJoinAnds.forEach(e),this.eJoinOrs.forEach(e)}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const n=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((o,s,i)=>{i===t&&this.setElementValue(o,n[s]!=null?n[s]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,n,o)=>{this.setElementValue(t,n===0&&o===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,n=>{this.attachElementOnChange(n,this.listener)}))}hasInvalidInputs(){return!1}isReadOnly(){return!!this.params.readOnly}},x2=class{constructor(e,t,n,o,s,i){this.alive=!0,this.context=e,this.eParent=s;const r=Die(t,n,o);r&&r.newAgStackInstance().then(a=>{var u,d;if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;s.appendChild(a.getGui()),(u=a==null?void 0:a.afterGuiAttached)==null||u.call(a);const{tempValue:l,disabled:c}=this;l&&a.setDate(l),c!=null&&((d=a.setDisabled)==null||d.call(a,c)),i==null||i(this)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){const t=this.dateComp;t?t.setDate(e):this.tempValue=e}setDisabled(e){var n;const t=this.dateComp;t?(n=t.setDisabled)==null||n.call(t,e):this.disabled=e}setDisplayed(e){Ln(this.eParent,e)}setInputPlaceholder(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputPlaceholder)==null||n.call(t,e)}setInputAriaLabel(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputAriaLabel)==null||n.call(t,e)}afterGuiAttached(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.afterGuiAttached)==null||n.call(t,e)}updateParams(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.refresh)==null||n.call(t,e)}},c_=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function F2(e,t){const{dateFrom:n,dateTo:o,type:s}=e||{};return[n&&gs(n,void 0,!0)||null,o&&gs(o,void 0,!0)||null].slice(0,cp(s,t))}var I2=1e3,P2=1/0,Oge=class extends l_{constructor(){super("dateFilter",F2,c_),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=I2,this.maxValidYear=P2,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=(l,c)=>{const u=e[l];if(u!=null)if(isNaN(u))qe(82,{param:l});else return u==null?c:Number(u);return c},n=t("minValidYear",I2),o=t("maxValidYear",P2);this.minValidYear=n,this.maxValidYear=o,n>o&&qe(83);const{minValidDate:s,maxValidDate:i}=e,r=s instanceof Date?s:gs(s);this.minValidDate=r;const a=i instanceof Date?i:gs(i);this.maxValidDate=a,r&&a&&r>a&&qe(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:n,gos:o},params:s}=this,i=new x2(n,t,s.colDef,It(o,{onDateChanged:()=>this.onUiChanged(),filterParams:s,location:"filter"}),e);return this.addDestroyFunc(()=>i.destroy()),i}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=so({tag:"div",cls:"ag-filter-body"});return this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,n,o){const s=so({tag:"div",cls:`ag-filter-${o} ag-filter-date-${o}`});t.push(s),e.appendChild(s),n.push(this.createDateCompWrapper(s))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),lp(this.eConditionPanelsFrom,e,t),lp(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,n){const o=lp(e,t,n);for(const s of o)s.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:n,minValidYear:o,maxValidYear:s}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<o)return!1;if(n){if(e>n)return!1}else if(e.getUTCFullYear()>s)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((n,o,s,i)=>{s!==e||!t||o>=i||(t=t&&this.isValidDateValue(n.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),n={},o=this.getValues(e),s=this.params.useIsoSeparator?"T":" ";return o.length>0&&(n.dateFrom=Ls(o[0],!0,s)),o.length>1&&(n.dateTo=Ls(o[1],!0,s)),{dateFrom:null,dateTo:null,filterType:this.filterType,type:t,...n}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),n=e("ariaFilterValue","Filter Value");this.forEachInput(o=>{o.setInputPlaceholder(t),o.setInputAriaLabel(n)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,o,s,i)=>{o<i&&t.push(n.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},A2=class extends He{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,n=new a_;this.optionsFactory=n,n.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(n,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,n=this.optionsFactory;n.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:n,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(t==null)return!0;const{operator:n}=t,o=[];if(n){const r=t;o.push(...r.conditions??[])}else o.push(t);const s=n&&n==="OR"?"some":"every",i=this.params.getValue(e.node);return o[s](r=>this.individualConditionPasses(e,r,i))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:n,maxNumConditions:o}}=e;if(t==null)return;let i=KL(t)?t.conditions:[t];const r=(n==null?void 0:n.map(u=>typeof u=="string"?u:u.displayKey))??this.defaultOptions;if(!(!i||i.every(u=>r.find(d=>d===u.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const c=this.filterType;if((i&&!i.every(u=>u.filterType===c)||t.filterType!==c)&&(i=i.map(u=>({...u,filterType:c})),l=!0),typeof o=="number"&&i&&i.length>o&&(i=i.slice(0,o),l=!0),l){const u=i.length>1?{...t,filterType:c,conditions:i}:{...i[0],filterType:c};this.params={...e,model:u},e.onModelChange(u)}}individualConditionPasses(e,t,n){const o=this.optionsFactory,s=this.mapValuesFromModel(t,o),i=o.getCustomOption(t.type),r=Age(i,s,n);return r??(n==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,n,t,e))}},k2=class extends A2{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:n,includeBlanksInGreaterThan:o,includeBlanksInLessThan:s,includeBlanksInRange:i}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(n)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(o)return!0;break;case"lessThan":case"lessThanOrEqual":if(s)return!0;break;case"inRange":if(i)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,n){const o=n.type;if(!this.isValid(t))return o==="notEqual"||o==="notBlank";const s=this.comparator(),i=e[0]!=null?s(e[0],t):0;switch(o){case"equals":return i===0;case"notEqual":return i!==0;case"greaterThan":return i>0;case"greaterThanOrEqual":return i>=0;case"lessThan":return i<0;case"lessThanOrEqual":return i<=0;case"inRange":{const r=s(e[1],t);return this.params.filterParams.inRangeInclusive?i>=0&&r<=0:i>0&&r<0}case"blank":return yy(t);case"notBlank":return!yy(t);default:return qe(76,{filterModelType:o}),!0}}},O2={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},Mge={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},u_=class extends He{constructor(e,t,n){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=n}getModelAsString(e,t){const n=this.getLocaleTextFunc(),o=t==="filterToolPanel";if(!e)return o?rl(this,"filterSummaryInactive"):null;if(e.operator!=null){const i=e,a=(i.conditions??[]).map(c=>this.getModelAsString(c,t)),l=i.operator==="AND"?"andCondition":"orCondition";return a.join(` ${rl(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return o?rl(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):n(e.type,e.type);{const i=e,r=this.optionsFactory.getCustomOption(i.type),{displayKey:a,displayName:l,numberOfInputs:c}=r||{};return a&&l&&c===0?n(a,l):this.conditionToString(i,o,i.type==="inRange"||c===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:n}=e;this.optionsFactory=t,this.filterParams=n}conditionForToolPanel(e,t,n,o,s,i){let r;const a=this.getTypeKey(e);return a&&(r=rl(this,a)),s&&i&&(r=this.getLocaleTextFunc()(s,i)),r!=null?t?`${r} ${rl(this,"filterSummaryInRangeValues",[n(),o()])}`:`${r} ${n()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.valueFormatter;return t?t(e??null)??"":String(e)}},M2=class extends u_{constructor(e,t){super(e,t,n=>{const{dataTypeSvc:o,valueSvc:s}=this.beans,i=t.column,r=o==null?void 0:o.getDateFormatterFunction(i),a=r?r(n??void 0):n;return s.formatValue(i,null,a)}),this.filterTypeKeys=O2}conditionToString(e,t,n,o,s){const{type:i}=e,r=gs(e.dateFrom),a=gs(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>Q0(h,l),u=()=>r!==null?c(r):"null",d=()=>a!==null?c(a):"null";if(t){const h=this.conditionForToolPanel(i,n,u,d,o,s);if(h!=null)return h}return n?`${u()}-${d()}`:r!=null?c(r):`${i}`}};function Nge(e,t){const n=t;return n<e?-1:n>e?1:0}var Lge=class extends k2{constructor(){super(F2,c_),this.filterType="date",this.FilterModelFormatterClass=M2}comparator(){return this.params.filterParams.comparator??Nge}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},N2=class extends yn{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}const t=e.operator;let n;t?n=e.conditions[0]:n=e,this.lastType=n.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const n=e;return this.isTypeEditable(n.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const n=e;this.onModelUpdated(n.model)}}setParams(e){const t=new a_;this.optionsFactory=t,t.init(e.filterParams,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(t,e.filterParams)),this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){const n=this.optionsFactory.defaultOption;t||(this.lastType=n),this.readOnly=!!e.filterParams.readOnly;const o=this.isTypeEditable(n);this.setEditable(o)}refresh(e){this.params=e;const t=e,n=this.reactive;if((!n||t.source==="colDef")&&this.updateParams(e),n){const{source:o,model:s}=t;if(o==="dataChanged"||o==="ui")return;this.onModelUpdated(s)}}updateParams(e){const t=this.optionsFactory;t.refresh(e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){t!=null&&t.afterFloatingFilter||t!=null&&t.afterDataChange||this.onModelUpdated(e)}hasSingleInput(e){var n;const t=(n=this.optionsFactory.getCustomOption(e))==null?void 0:n.numberOfInputs;return t==null||t==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.readOnly&&this.hasSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},Vge={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eReadOnlyText"},{tag:"div",ref:"eDateWrapper",cls:"ag-date-floating-filter-wrapper"}]},Bge=class extends N2{constructor(){super(Vge,[Wv]),this.eReadOnlyText=dt,this.eDateWrapper=dt,this.FilterModelFormatterClass=M2,this.filterType="date",this.defaultOptions=c_}setParams(e){super.setParams(e),this.createDateComponent();const t=this.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}updateParams(e){super.updateParams(e),this.dateComp.updateParams(this.getDateComponentParams()),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.readOnly&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){const n=e?gs(e.dateFrom):null;this.dateComp.setDate(n),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){Ln(this.eDateWrapper,e),Ln(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){const e=this.dateComp.getDate();if(this.reactive){const t=this.params;t.onUiChange();const n=t.model,o=Ls(e),s=o==null?null:{...n??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:o};t.onModelChange(s,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t==null||t.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=pE(e,this.defaultDebounceMs);return It(this.gos,{onDateChanged:Po(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:n,params:o}=this;this.dateComp=new x2(e,t,o.column.getColDef(),this.getDateComponentParams(),n,s=>{s.setInputAriaLabel(this.getAriaLabel(o))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},$ge={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},Hge=class extends yn{constructor(){super($ge,[Wv]),this.eDateInput=dt,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled()){if(this.isApply){this.applyOnFocusOut=!e,e&&this.params.onDateChanged();return}e||this.params.onDateChanged()}}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}setParams(e){var h;const t=this.eDateInput.getInputElement(),n=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=n&&nl();const{minValidYear:o,maxValidYear:s,minValidDate:i,maxValidDate:r,buttons:a,includeTime:l,colDef:c}=e.filterParams||{},u=this.beans.dataTypeSvc,d=l??((h=u==null?void 0:u.getDateIncludesTimeFlag)==null?void 0:h.call(u,c.cellDataType))??!1;if(n?d?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",i&&o&&qe(85),r&&s&&qe(86),i&&r){const[f,p]=[i,r].map(g=>g instanceof Date?g:gs(g));f&&p&&f.getTime()>p.getTime()&&qe(87)}i?i instanceof Date?t.min=Q0(i):t.min=i:o&&(t.min=`${o}-01-01`),r?r instanceof Date?t.max=Q0(r):t.max=r:s&&(t.max=`${s}-12-31`),this.isApply=e.location==="floatingFilter"&&!!(a!=null&&a.includes("apply"))}refresh(e){this.params=e,this.setParams(e)}getDate(){return gs(this.eDateInput.getValue())}setDate(e){var o;const t=this.params.filterParams.colDef.cellDataType,n=((o=this.beans.dataTypeSvc)==null?void 0:o.getDateIncludesTimeFlag(t))??!1;this.eDateInput.setValue(Ls(e,n))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e!=null&&e.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){var t;return((t=e==null?void 0:e.filterParams)==null?void 0:t.browserDatePicker)??!0}},d_=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function h_(e){const{allowedCharPattern:t}=e??{};return t??null}function f_(e){return e==null||isNaN(e)?null:e}function L2(e,t){const{filter:n,filterTo:o,type:s}=e||{};return[f_(n),f_(o)].slice(0,cp(s,t))}var Gge=class extends l_{constructor(){super("numberFilter",L2,d_),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}setElementValue(e,t,n){const{numberFormatter:o}=this.params,s=!n&&o?o(t??null):t;super.setElementValue(e,s)}createEValue(){const e=h_(this.params),t=so({tag:"div",cls:"ag-filter-body",role:"presentation"});return this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,n,o){const s=this.createManagedBean(o?new wc({allowedCharPattern:o}):new sE);s.addCss(`ag-filter-${n}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeEValues(e,t){const n=o=>this.removeComponents(o,e,t);n(this.eValuesFrom),n(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(n,o,s,i)=>{o<i&&t.push(f_(this.stringToFloat(n.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}stringToFloat(e){if(typeof e=="number")return e;let t=sa(e);t!=null&&t.trim()===""&&(t=null);const n=this.params.numberParser;return n?n(t):t==null||t.trim()==="-"?null:Number.parseFloat(t)}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},o=this.getValues(e);return o.length>0&&(n.filter=o[0]),o.length>1&&(n.filterTo=o[1]),n}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}},V2=class extends u_{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=O2}conditionToString(e,t,n,o,s){const{filter:i,filterTo:r,type:a}=e,l=this.formatValue.bind(this);if(t){const c=this.conditionForToolPanel(a,n,()=>l(i),()=>l(r),o,s);if(c!=null)return c}return n?`${l(i)}-${l(r)}`:i!=null?l(i):`${a}`}},Uge=class extends k2{constructor(){super(L2,d_),this.filterType="number",this.FilterModelFormatterClass=V2}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},B2=class extends He{constructor(e){super(),this.params=e,this.eInput=dt,this.onValueChanged=()=>{}}setupGui(e){var o;this.eInput=this.createManagedBean(new wc((o=this.params)==null?void 0:o.config));const t=this.eInput.getGui();e.appendChild(t);const n=s=>this.onValueChanged(s);this.addManagedListeners(t,{input:n,keydown:n})}setEditable(e){this.eInput.setDisabled(!e)}getValue(){return this.eInput.getValue()}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setParams({ariaLabel:e,autoComplete:t}){const{eInput:n}=this;n.setInputAriaLabel(e),t!==void 0&&n.setAutoComplete(t)}};function p_(e){const t=e==null?void 0:e.trim();return t===""?e:t}function $2(e,t){const{filter:n,filterTo:o,type:s}=e||{};return[n||null,o||null].slice(0,cp(s,t))}var Wge={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},H2=class extends N2{constructor(){super(...arguments),this.eFloatingFilterInputContainer=dt,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(Wge)}onModelUpdated(e){this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(e))}setParams(e){this.setupFloatingFilterInputService(e),super.setParams(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.inputSvc=this.createFloatingFilterInputService(e),this.inputSvc.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){const t=e.browserAutoComplete??!1,{inputSvc:n,defaultDebounceMs:o,readOnly:s}=this;if(n.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=Yv(e.filterParams),!s){const i=pE(e.filterParams,o),r=Po(this,this.syncUpWithParentFilter.bind(this),i);n.setValueChangedListener(r)}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,n=t.getValue();Io(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(n,!0)}syncUpWithParentFilter(e){const t=e.key===Ae.ENTER,n=this.reactive;if(n&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:o,params:s,lastType:i}=this;let r=o.getValue();if(s.filterParams.trimInput&&(r=p_(r),o.setValue(r,!0)),n){const a=s,l=a.model,c=this.convertValue(r),u=c==null?null:{...l??{filterType:this.filterType,type:i??this.optionsFactory.defaultOption},filter:c};a.onModelChange(u,{afterFloatingFilter:!0})}else s.parentFilterInstance(a=>{a==null||a.onFloatingFilterChanged(i||null,r||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},zge=class extends He{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new sE),this.eTextInput=this.createManagedBean(new wc),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),n=this.eTextInput.getGui();e.appendChild(t),e.appendChild(n),this.setupListeners(t,o=>this.onValueChanged(o)),this.setupListeners(n,o=>this.onValueChanged(o))}setEditable(e){this.numberInputActive=e,this.eNumberInput.setDisplayed(this.numberInputActive),this.eTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eNumberInput.setAutoComplete(e),this.eTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}setValueChangedListener(e){this.onValueChanged=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},jge=class extends H2{constructor(){super(...arguments),this.FilterModelFormatterClass=V2,this.filterType="number",this.defaultOptions=d_}updateParams(e){h_(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=h_(e.filterParams),this.allowedCharPattern?this.createManagedBean(new B2({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new zge)}convertValue(e){return e?Number(e):null}},g_=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],Kge=class extends l_{constructor(){super("textFilter",$2,g_),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},o=this.getValues(e);return o.length>0&&(n.filter=o[0]),o.length>1&&(n.filterTo=o[1]),n}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,o,s,i)=>{o<i&&t.push(sa(n.getValue()))}),t}createEValue(){const e=so({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:n}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,n,"to"),e}createFromToElement(e,t,n){const o=this.createManagedBean(new wc);o.addCss(`ag-filter-${n}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const n=i=>this.removeComponents(i,e,t),{eValuesFrom:o,eValuesTo:s}=this;n(o),n(s)}},G2=class extends u_{constructor(){super(...arguments),this.filterTypeKeys=Mge}conditionToString(e,t,n,o,s){const{filter:i,filterTo:r,type:a}=e;if(t){const l=u=>()=>rl(this,"filterSummaryTextQuote",[u]),c=this.conditionForToolPanel(a,n,l(i),l(r),o,s);if(c!=null)return c}return n?`${i}-${r}`:i!=null?`${i}`:`${a}`}},qge=({filterOption:e,value:t,filterText:n})=>{if(n==null)return!1;switch(e){case"contains":return t.includes(n);case"notContains":return!t.includes(n);case"equals":return t===n;case"notEqual":return t!=n;case"startsWith":return t.indexOf(n)===0;case"endsWith":{const o=t.lastIndexOf(n);return o>=0&&o===t.length-n.length}default:return!1}},Yge=e=>e,Zge=e=>e==null?null:e.toString().toLowerCase(),Xge=class extends A2{constructor(){super($2,g_),this.filterType="text",this.FilterModelFormatterClass=G2}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??qge,this.formatter=t.textFormatter??(t.caseSensitive?Yge:Zge)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,n,o){const s=e.map(h=>this.formatter(h))||[],i=this.formatter(t),{api:r,colDef:a,column:l,context:c,filterParams:{textFormatter:u}}=this.params;if(n.type==="blank")return yy(t);if(n.type==="notBlank")return!yy(t);const d={api:r,colDef:a,column:l,context:c,node:o.node,data:o.data,filterOption:n.type,value:i,textFormatter:u};return s.some(h=>this.matcher({...d,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=n=>{const o={...n},{filter:s,filterTo:i}=n;return s&&(o.filter=p_(s)??null),i&&(o.filterTo=p_(i)??null),o};return KL(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},Jge=class extends H2{constructor(){super(...arguments),this.FilterModelFormatterClass=G2,this.filterType="text",this.defaultOptions=g_}createFloatingFilterInputService(){return this.createManagedBean(new B2)}};function Qge(e){var t;return!!((t=e.quickFilter)!=null&&t.isFilterPresent())}function eme(e){var t;return(t=e.quickFilter)==null?void 0:t.getText()}function tme(e){var t;(t=e.quickFilter)==null||t.resetCache()}var nme=class extends He{constructor(){super(...arguments),this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){const e=this.resetCache.bind(this),t=this.gos;this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{t.get("includeHiddenColumnsInQuickFilter")||this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",n=>this.setFilter(n.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(t.get("quickFilterText")),this.parser=t.get("quickFilterParser"),this.matcher=t.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){var l;const{autoColSvc:e,colModel:t,gos:n,pivotResultCols:o}=this.beans,s=t.isPivotMode(),i=e==null?void 0:e.getColumns(),r=t.getColDefCols();let a=(s&&!n.get("applyQuickFilterBeforePivotOrAgg")?(l=o==null?void 0:o.getPivotResultCols())==null?void 0:l.list:r)??[];i&&(a=a.concat(i)),this.colsToUse=n.get("includeHiddenColumnsInQuickFilter")?a:a.filter(c=>c.isVisible()||c.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(n=>t?this.doesRowPassCache(e,n):this.doesRowPassNoCache(e,n))}resetCache(){this.beans.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseFilter(e){return ht(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){qe(70,{newFilter:e});return}const t=this.parseFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),n=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,n&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(n=>{const o=this.getTextForColumn(n,e);return ht(o)&&o.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let n;e?(this.checkGenerateAggText(t),n=t.quickFilterAggregateText):n=this.getAggText(t);const{quickFilterParts:o,matcher:s}=this;return s(o,n)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let n=this.beans.filterValueSvc.getValue(e,t);const o=e.getColDef();if(o.getQuickFilterText){const s=It(this.gos,{value:n,node:t,data:t.data,column:e,colDef:o});n=o.getQuickFilterText(s)}return ht(n)?n.toString().toUpperCase():null}getAggText(e){const t=[];for(const n of this.colsToUse){const o=this.getTextForColumn(n,e);ht(o)&&t.push(o)}return t.join(`
248
248
  `)}},ome={moduleName:"ClientSideRowModelFilter",version:ut,rowModels:["clientSide"],beans:[sge]},m_={moduleName:"FilterCore",version:ut,beans:[Dge],apiFunctions:{isAnyFilterPresent:_ge,onFilterChanged:Rge},css:[uge],dependsOn:[ome]},U2={moduleName:"FilterValue",version:ut,beans:[xge]},wy={moduleName:"ColumnFilter",version:ut,beans:[Ege,Tge],dynamicBeans:{headerFilterCellCtrl:ige},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:dge,getColumnFilterInstance:hge,destroyFilter:fge,setFilterModel:pge,getFilterModel:gge,getColumnFilterModel:mge,setColumnFilterModel:vge,showColumnFilter:yge,hideColumnFilter:wge,getColumnFilterHandler:Cge,doFilterAction:bge},dependsOn:[m_,vy,U2,lge]},sme={moduleName:"CustomFilter",version:ut,userComponents:{agReadOnlyFloatingFilter:Ige},dependsOn:[wy]},ime={moduleName:"TextFilter",version:ut,dependsOn:[wy],userComponents:{agTextColumnFilter:{classImp:Kge,params:{useForm:!0}},agTextColumnFloatingFilter:Jge},dynamicBeans:{agTextColumnFilterHandler:Xge}},rme={moduleName:"NumberFilter",version:ut,dependsOn:[wy],userComponents:{agNumberColumnFilter:{classImp:Gge,params:{useForm:!0}},agNumberColumnFloatingFilter:jge},dynamicBeans:{agNumberColumnFilterHandler:Uge}},ame={moduleName:"DateFilter",version:ut,dependsOn:[wy],userComponents:{agDateColumnFilter:{classImp:Oge,params:{useForm:!0}},agDateInput:Hge,agDateColumnFloatingFilter:Bge},dynamicBeans:{agDateColumnFilterHandler:Lge}},lme={moduleName:"QuickFilterCore",version:ut,rowModels:["clientSide"],beans:[nme],dependsOn:[m_,U2]},cme={moduleName:"QuickFilter",version:ut,apiFunctions:{isQuickFilterPresent:Qge,getQuickFilter:eme,resetQuickFilter:tme},dependsOn:[lme]},ume={moduleName:"ExternalFilter",version:ut,dependsOn:[m_]},dme=".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}",v_=(e,t,n)=>{var a,l,c;const{editModelSvc:o}=e,s=(l=(a=o==null?void 0:o.getCellValidationModel())==null?void 0:a.getCellValidation(t))==null?void 0:l.errorMessages,i=(c=o==null?void 0:o.getRowValidationModel().getRowValidation(t))==null?void 0:c.errorMessages,r=s||i;return r!=null&&r.length?r.join(n("tooltipValidationErrorSeparator",". ")):void 0},hme=class extends He{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,o){e&&t.destroyBean(e);const s=this.gos,i=r_(s),{column:r,eGui:a}=t,l=r.getColDef();!o&&i&&!l.headerComponent&&(o=_v(()=>a.querySelector(".ag-header-cell-text")));const c="header",d=this.beans.colNames.getDisplayNameForColumn(r,"header",!0),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,It(s,{location:c,colDef:l,column:r,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:o,getAdditionalParams:()=>({column:r,colDef:r.getColDef()})};let p=this.createTooltipFeature(f);return p&&(p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip())),p}setupHeaderGroupTooltip(e,t,n,o){e&&t.destroyBean(e);const s=this.gos,i=r_(s),{column:r,eGui:a}=t,l=r.getColGroupDef();!o&&i&&!(l!=null&&l.headerGroupComponent)&&(o=_v(()=>a.querySelector(".ag-header-group-text")));const c="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(r,"header"),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,It(s,{location:c,colDef:l,column:r,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:o,getAdditionalParams:()=>{const g={column:r};return l&&(g.colDef=l),g}},p=this.createTooltipFeature(f);return p&&t.createBean(p)}enableCellTooltipFeature(e,t,n){const{beans:o}=this,{gos:s,editSvc:i}=o,{column:r,rowNode:a}=e;let l="cell";const c=()=>{const f=!!!(i!=null&&i.isEditing(e))&&v_(o,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=r.getColDef(),g=a.data;if(p.tooltipField&&ht(g))return sp(g,p.tooltipField,r.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(It(s,{location:"cell",colDef:r.getColDef(),column:r,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},u=r_(s);n||(u&&!e.isCellRenderer()?n=()=>{const h=!!(i!=null&&i.isEditing(e));if(!h&&v_(o,e,this.getLocaleTextFunc()))return!0;if(!r.isTooltipEnabled())return!1;const g=_v(()=>{const v=e.eGui;return v.children.length===0?v:v.querySelector(".ag-cell-value")});return!h&&g()}:n=()=>!(i!=null&&i.isEditing(e)));const d={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:c,shouldDisplayTooltip:n,getAdditionalParams:()=>({column:r,colDef:r.getColDef(),rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(d,o)}setupFullWidthRowTooltip(e,t,n,o){const s={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>n,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:o},i=this.beans,r=i.context;e&&t.destroyBean(e,r);const a=this.createTooltipFeature(s,i);if(a)return t.createBean(a,r)}setupCellEditorTooltip(e,t){var a,l;const{beans:n}=this,{context:o}=n,s=((a=t.getValidationElement)==null?void 0:a.call(t,!0))||!((l=t.isPopup)!=null&&l.call(t))&&e.eGui;if(!s)return;const i={getGui:()=>s,getTooltipValue:()=>v_(n,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{var p,g;const{editModelSvc:c}=n,u=(p=c==null?void 0:c.getRowValidationModel())==null?void 0:p.getRowValidationMap(),d=(g=c==null?void 0:c.getCellValidationModel())==null?void 0:g.getCellValidationMap(),h=!!u&&u.size>0,f=!!d&&d.size>0;return h||f}},r=this.createTooltipFeature(i,n);if(r)return e.createBean(r,o)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=ht(t.tooltipField)||ht(t.tooltipValueGetter)||ht(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},fme=class extends Lre{createTooltipComp(e,t){const n=Fie(this.beans.userCompFactory,e);n==null||n.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){var e;(e=this.onColumnMovedEventCallback)==null||e.call(this),this.onColumnMovedEventCallback=void 0}},W2={moduleName:"Tooltip",version:ut,beans:[hme],dynamicBeans:{tooltipFeature:IL,highlightTooltipFeature:Vre,tooltipStateManager:fme},userComponents:{agTooltipComponent:Hre},dependsOn:[vy],css:[dme]},bd=class{constructor(e){this.cellValueChanges=e}},y_=class extends bd{constructor(e,t,n,o){super(e),this.initialRange=t,this.finalRange=n,this.ranges=o}},pme=10,z2=class{constructor(e){this.actionStack=[],this.maxStackSize=e||pme,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}},gme=class extends He{constructor(){super(...arguments),this.beanName="undoRedo",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.batchEditing=!1,this.bulkEditing=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},n=this.activeCellEdit!==null&&TV(this.activeCellEdit,t),o=this.activeRowEdit!==null&&Vce(this.activeRowEdit,t);if(!(n||o||this.isPasting||this.isRangeInAction))return;const{rowPinned:i,rowIndex:r,column:a,oldValue:l,value:c}=e,u={rowPinned:i,rowIndex:r,columnId:a.getColId(),newValue:c,oldValue:l};this.cellValueChanges.push(u)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const n=e.get("undoRedoCellEditingLimit");if(n<=0)return;this.undoStack=new z2(n),this.redoStack=new z2(n),this.addListeners();const o=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:s=>{s.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:o,newColumnsLoaded:o,columnGroupOpened:o,columnRowGroupChanged:o,columnMoved:o,columnPinned:o,columnVisible:o,rowDragEnd:o}),t.whenReady(this,s=>{this.gridBodyCtrl=s.gridBodyCtrl})}getCurrentUndoStackSize(){var e;return((e=this.undoStack)==null?void 0:e.getCurrentStackSize())??0}getCurrentRedoStackSize(){var e;return((e=this.redoStack)==null?void 0:e.getCurrentStackSize())??0}undo(e){const{eventSvc:t,undoStack:n,redoStack:o}=this;t.dispatchEvent({type:"undoStarted",source:e});const s=this.undoRedo(n,o,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:s})}redo(e){const{eventSvc:t,undoStack:n,redoStack:o}=this;t.dispatchEvent({type:"redoStarted",source:e});const s=this.undoRedo(o,n,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:s})}undoRedo(e,t,n,o,s){if(!e)return!1;const i=e.pop();return i!=null&&i.cellValueChanges?(this.processAction(i,r=>r[o],s),i instanceof y_?this.processRange(i.ranges||[i[n]]):this.processCell(i.cellValueChanges),t.push(i),!0):!1}processAction(e,t,n){for(const o of e.cellValueChanges){const{rowIndex:s,rowPinned:i,columnId:r}=o,a={rowIndex:s,rowPinned:i},l=pa(this.beans,a);l.displayed&&l.setDataValue(r,t(o),n)}}processRange(e){let t;const n=this.beans.rangeSvc;n.removeAllCellRanges(!0),e.forEach((o,s)=>{if(!o)return;const i=o.startRow,r=o.endRow;s===e.length-1&&(t={rowPinned:i.rowPinned,rowIndex:i.rowIndex,columnId:o.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:o.startColumn,columns:o.columns};n.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:n,rowPinned:o}=t,s={rowIndex:n,rowPinned:o},i=pa(this.beans,s),r={rowPinned:t.rowPinned,rowIndex:i.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r)}setLastFocusedCell(e){const{rowIndex:t,columnId:n,rowPinned:o}=e,{colModel:s,focusSvc:i,rangeSvc:r}=this.beans,a=s.getCol(n);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:o};i.setFocusedCell({...c,forceBrowserFocus:!0}),r==null||r.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new bd(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const n=new bd(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new bd(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new y_(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;const{rangeSvc:t,gos:n}=this.beans;t&&ra(n)?e=new y_(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new bd(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1},batchEditingStarted:()=>this.startBigChange("batchEditing"),batchEditingStopped:({changes:e})=>this.stopBigChange("batchEditing",e),bulkEditingStarted:()=>this.startBigChange("bulkEditing"),bulkEditingStopped:({changes:e})=>this.stopBigChange("bulkEditing",e)})}startBigChange(e){this.updateBigChange(e,!0)}updateBigChange(e,t){e==="bulkEditing"?this.bulkEditing=t:this.batchEditing=t}stopBigChange(e,t){if(e==="bulkEditing"&&!this.bulkEditing||e==="batchEditing"&&!this.batchEditing||(this.updateBigChange(e,!1),(t==null?void 0:t.length)===0))return;const n=new bd(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},mme=".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) textarea{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}",vme={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},yme=class extends ry{constructor(){super(vme,[oE]),this.eEditor=dt}initialiseEditor(e){const t=e.value??void 0,n=this.eEditor;n.setValue(t),n.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(n,{fieldValueChanged:s=>this.setAriaLabel(s.selected)})}getValue(){return this.eEditor.getValue()}focusIn(){this.eEditor.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.getLocaleTextFunc(),n=Cv(t,e),o=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${o} (${n})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,n=this.getValue();return t?t({value:n,internalErrors:null,cellEditorParams:e}):null}},Cy=class extends ry{constructor(e){super(),this.cellEditorInput=e,this.eEditor=dt}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:n}=this,{cellStartedEdit:o,eventKey:s,suppressPreventDefault:i}=e;n.getInputElement().setAttribute("title",""),t.init(n,e);let r,a=!0;o?(this.focusAfterAttached=!0,s===Ae.BACKSPACE||s===Ae.DELETE?r="":s&&s.length===1?i?a=!1:r=s:(r=t.getStartValue(),s!==Ae.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,r=t.getStartValue()),a&&r!=null&&n.setStartValue(r),this.addGuiEventListener("keydown",l=>{const{key:c}=l;(c===Ae.PAGE_UP||c===Ae.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){var o,s;const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;nl()||t.getFocusableElement().focus();const n=t.getInputElement();this.highlightAllOnFocus?n.select():(s=(o=this.cellEditorInput).setCaret)==null||s.call(o)}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),n=e.getInputElement();t.focus(),n.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},wme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},Cme=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return wme}getAgComponents(){return[yL]}init(e,t){var r,a;this.eEditor=e,this.params=t;const{min:n,max:o,step:s,colDef:i}=t;n!=null&&e.setMin(n),o!=null&&e.setMax(o),s!=null&&e.setStep(s),this.includeTime=t.includeTime??((a=(r=this.getDataTypeService())==null?void 0:r.getDateIncludesTimeFlag)==null?void 0:a.call(r,i.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:n}=this,{min:o,max:s,getValidationErrors:i}=n;let r=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(o){const l=o instanceof Date?o:new Date(o);if(t<l){const c=l.toLocaleDateString();r.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(s){const l=s instanceof Date?s:new Date(s);if(t>l){const c=l.toLocaleDateString();r.push(a("maxDateValidation",`Date must be before ${c}`,[c]))}}}return r.length||(r=null),i?i({value:t,cellEditorParams:n,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,n=e.getDate();return!ht(n)&&!ht(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Ls(e,this.includeTime??!1)}},bme=class extends Cy{constructor(){super(new Cme(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Sme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},Eme=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Sme}getAgComponents(){return[yL]}init(e,t){var r,a;this.eEditor=e,this.params=t;const{min:n,max:o,step:s,colDef:i}=t;n!=null&&e.setMin(n),o!=null&&e.setMax(o),s!=null&&e.setStep(s),this.includeTime=t.includeTime??((a=(r=this.getDataTypeService())==null?void 0:r.getDateIncludesTimeFlag)==null?void 0:a.call(r,i.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,n=e.getInputElement().value,o=this.formatDate(this.parseDate(n??void 0)),{min:s,max:i,getValidationErrors:r}=t;let a=[];if(o){const l=new Date(o),c=this.getLocaleTextFunc();if(s){const u=new Date(s);if(l<u){const d=u.toLocaleDateString();a.push(c("minDateValidation",`Date must be after ${d}`,[d]))}}if(i){const u=new Date(i);if(l>u){const d=u.toLocaleDateString();a.push(c("maxDateValidation",`Date must be before ${d}`,[d]))}}}return a.length||(a=null),r?r({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,n=this.formatDate(t.getDate());return!ht(n)&&!ht(e.value)?e.value:e.parseValue(n??"")}getStartValue(){return Ls(this.parseDate(this.params.value??void 0)??null,this.includeTime??!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):gs(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Ls(e??null,this.includeTime??!1)??void 0}},_me=class extends Cy{constructor(){super(new Eme(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Rme={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},Dme=class extends ry{constructor(){super(Rme,[Kie]),this.eEditor=dt}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:n,eventKey:o,maxLength:s,cols:i,rows:r}=e;this.focusAfterAttached=n,t.getInputElement().setAttribute("title",""),t.setMaxLength(s||200).setCols(i||60).setRows(r||10);let a;n?(this.focusAfterAttached=!0,o===Ae.BACKSPACE||o===Ae.DELETE?a="":o&&o.length===1?a=o:(a=this.getStartValue(e),o!==Ae.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,a=this.getStartValue(e)),a!=null&&t.setValue(a,!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}getStartValue(e){const{value:t}=e;return(t==null?void 0:t.toString())??t}onKeyDown(e){const t=e.key;(t===Ae.LEFT||t===Ae.UP||t===Ae.RIGHT||t===Ae.DOWN||e.shiftKey&&t===Ae.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:n}=this,o=this.getLocaleTextFunc();e.setInputAriaLabel(o("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),n&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:n}=t,o=e.getValue();return!ht(o)&&!ht(n)?n:t.parseValue(o)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,o=this.getLocaleTextFunc(),s=this.getValue();let i=[];return typeof s=="string"&&t!=null&&s.length>t&&i.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),i.length||(i=null),n?n({value:s,internalErrors:i,cellEditorParams:e}):i}},Tme={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},xme=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Tme}getAgComponents(){return[qie]}init(e,t){this.eEditor=e,this.params=t;const{max:n,min:o,precision:s,step:i}=t;n!=null&&e.setMax(n),o!=null&&e.setMin(o),s!=null&&e.setPrecision(s),i!=null&&e.setStep(i);const r=e.getInputElement();t.preventStepping?e.addManagedElementListeners(r,{keydown:this.preventStepping}):t.showStepperButtons&&r.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:n,getValidationErrors:o}=e,i=this.eEditor.getInputElement().valueAsNumber,r=this.getLocaleTextFunc();let a=[];return typeof i=="number"&&(t!=null&&i<t&&a.push(r("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),n!=null&&i>n&&a.push(r("maxValueValidation",`Must be less than or equal to ${n}.`,[String(n)]))),a.length||(a=null),o?o({value:i,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===Ae.UP||e.key===Ae.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!ht(n)&&!ht(t.value))return t.value;let o=t.parseValue(n);if(o==null)return o;if(typeof o=="string"){if(o==="")return null;o=Number(o)}return isNaN(o)?null:o}getStartValue(){return this.params.value}setCaret(){nl()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},Fme=class extends Cy{constructor(){super(new xme(()=>this.getLocaleTextFunc()))}},Ime={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},Pme=class extends ry{constructor(){super(Ime,[ire]),this.eEditor=dt,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:n,gos:o}=this,{values:s,value:i,eventKey:r}=e;if(Nn(s)){qe(58);return}this.startedByEnter=r!=null?r===Ae.ENTER:!1;let a=!1;s.forEach(d=>{const h={value:d},f=n.formatValue(e.column,null,d),p=f!=null;h.text=p?f:d,t.addOption(h),a=a||i===d}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:u}=e;l!=null&&t.setPickerGap(l),u!=null&&t.setPickerMaxHeight(u),c!=null&&t.setPickerMaxWidth(c),o.get("editType")!=="fullRow"&&this.addManagedListeners(this.eEditor,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eEditor.showPicker()})}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:n}=e,o=this.getValue();let s=[];if(t&&!t.includes(o)){const i=this.getLocaleTextFunc();s.push(i("invalidSelectionValidation","Invalid selection."))}else s=null;return n?n({value:o,internalErrors:s,cellEditorParams:e}):s}},Ame={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},kme=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Ame}getAgComponents(){return[Wv]}init(e,t){this.eEditor=e,this.params=t;const n=t.maxLength;n!=null&&e.setMaxLength(n)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,o=this.getValue(),s=this.getLocaleTextFunc();let i=[];return t!=null&&typeof o=="string"&&o.length>t&&i.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),i.length||(i=null),n?n({value:o,cellEditorParams:e,internalErrors:i}):i}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();return!ht(n)&&!ht(t.value)?t.value:t.parseValue(n)}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){nl()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),n=ht(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},j2=class extends Cy{constructor(){super(new kme(()=>this.getLocaleTextFunc()))}};function Ome(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function Mme(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function K2(e,t,n="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,n),"ensureVisible")}function q2(e,t,n){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,n),"ensureVisible")}function Nme(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function Lme(e){var t;(t=e.undoRedo)==null||t.undo("api")}function Vme(e){var t;(t=e.undoRedo)==null||t.redo("api")}function Bme(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function $me(e){var o;const t=(o=e.editModelSvc)==null?void 0:o.getEditMap(),n=[];return t==null||t.forEach((s,i)=>{const{rowIndex:r,rowPinned:a}=i;s.forEach((l,c)=>{const{editorValue:u,pendingValue:d,sourceValue:h,state:f}=l,p=ga(l);let g=u??d;g===di&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:c,colId:c.getColId(),colKey:c.getColId(),rowIndex:r,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function Hme(e,t=!1){var o;const{editSvc:n}=e;if(n!=null&&n.isBatchEditing()){if(t)for(const s of((o=e.editModelSvc)==null?void 0:o.getEditPositions())??[])s.state==="editing"&&n.revertSingleCellEdit(s);else _c(e,{persist:!0});yd(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function Gme(e,t){var o;const n=Gn(e,t);return((o=e.editSvc)==null?void 0:o.isEditing(n))??!1}function Ume(e,t){const{key:n,colKey:o,rowIndex:s,rowPinned:i}=t,{editSvc:r,colModel:a}=e,l=a.getCol(o);if(!l){qe(12,{colKey:o});return}const u=pa(e,{rowIndex:s,rowPinned:i||null});if(!u){qe(290,{rowIndex:s,rowPinned:i});return}if(!l.isCellEditable(u))return;i==null&&q2(e,s),K2(e,o),r==null||r.startEditing({rowNode:u,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function Wme(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function zme(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function jme(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var Kme={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},qme=class extends H0{constructor(e){super(Kme),this.params=e}postConstruct(){fc(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=o=>{SE(this.gos,o,t.node,t.column,!0)||t.onKeyDown(o)};this.addManagedElementListeners(e,{keydown:n})}};function Yme(e,{column:t},n,o,s="ui"){var c;if(n instanceof KeyboardEvent&&(n.key===Ae.TAB||n.key===Ae.ENTER||n.key===Ae.F2||n.key===Ae.BACKSPACE&&o))return!0;if((n==null?void 0:n.shiftKey)&&((c=e.rangeSvc)==null?void 0:c.getCellRanges().length)!=0)return!1;const r=t==null?void 0:t.getColDef(),a=Zme(e.gos,r),l=n==null?void 0:n.type;return l==="click"&&(n==null?void 0:n.detail)===1&&a===1||l==="dblclick"&&(n==null?void 0:n.detail)===2&&a===2?!0:s==="api"?o??!1:!1}function Zme(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function w_(e,{rowNode:t,column:n},o="ui"){const s=n.getColDef().editable,i=e.editModelSvc;return n.isColumnFunc(t,s)||!!i&&i.hasEdits({rowNode:t,column:n},{withOpenEditor:!0})}function Xme(e,t,n="ui"){const o=w_(e,t,n);return o===!0||n==="ui"?o:e.colModel.getCols().some(i=>w_(e,{rowNode:t.rowNode,column:i},n))}var by=(e,t=!1)=>{if(e!==void 0)return ga(e)||t&&e.state==="editing"};function Y2(e,t,n=!1){var o;return by((o=e.editModelSvc)==null?void 0:o.getEdit(t),n)}var Z2=(e,t,n)=>{if(e)for(let o=0,s=e.length;o<s;++o){const i=e[o];if(i.data&&(by(t==null?void 0:t.getEdit({rowNode:i,column:n}))||by(t==null?void 0:t.getEdit({rowNode:i.pinnedSibling,column:n})))||Z2(i.childrenAfterGroup,t,n))return!0}};function X2(e,t){const{column:n,rowNode:o}=t;return e.gos.get("groupTotalRow")&&!(o!=null&&o.footer)?!1:Z2(o==null?void 0:o.childrenAfterGroup,e.editModelSvc,n)}function J2(e,{rowNode:t,column:n}){var o;if(t=t.pinnedSibling,!!t)return by((o=e.editModelSvc)==null?void 0:o.getEdit({rowNode:t,column:n}))}var Jme=class extends He{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}setComp(e){this.cellComp=e,this.applyCellStyles()}applyCellStyles(){var s;const{cellCtrl:e,editSvc:t,beans:n}=this;if(t!=null&&t.isBatchEditing()&&t.isEditing()){const i=Y2(n,e)||X2(n,e)||J2(n,e);this.applyBatchingStyle(i)}else this.applyBatchingStyle(!1);const o=!!((s=this.editModelSvc)!=null&&s.getCellValidationModel().hasCellValidation(this.cellCtrl));this.cellComp.toggleCss("ag-cell-editing-error",o)}applyBatchingStyle(e){var t;this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&((t=this.editSvc)==null?void 0:t.isBatchEditing()))??!1)}},Qme=class extends He{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){var r;const{rowCtrl:e,editModelSvc:t,beans:n}=this;let o=e.rowNode,s=t==null?void 0:t.getEditRow(o);const i=(r=this.editModelSvc)==null?void 0:r.getRowValidationModel().hasRowValidation({rowNode:o});if(!s&&o.pinnedSibling&&(o=o.pinnedSibling,s=t==null?void 0:t.getEditRow(o)),s){const a=Array.from(s.keys()).some(l=>{const c={rowNode:o,column:l};return Y2(n,c,!0)||X2(n,c)||J2(n,c)});this.applyStyle(i,a);return}this.applyStyle(i)}applyStyle(e=!1,t=!1){var s,i;const n=((s=this.editSvc)==null?void 0:s.isBatchEditing())??!1,o=this.gos.get("editType")==="fullRow";(i=this.rowCtrl)==null||i.forEachGui(void 0,({rowComp:r})=>{r.toggleCss("ag-row-editing",o&&t),r.toggleCss("ag-row-batch-edit",o&&t&&n),r.toggleCss("ag-row-inline-editing",t),r.toggleCss("ag-row-not-inline-editing",!t),r.toggleCss("ag-row-editing-invalid",o&&t&&e)})}},eve=({rowModel:e,pinnedRowModel:t,editModelSvc:n},o)=>{const s=new Set;e.forEachNode(i=>o.has(i)&&s.add(i)),t==null||t.forEachPinnedRow("top",i=>o.has(i)&&s.add(i)),t==null||t.forEachPinnedRow("bottom",i=>o.has(i)&&s.add(i));for(const i of o)s.has(i)||n.removeEdits({rowNode:i});return s},tve=({editModelSvc:e},t,n)=>{var o;for(const s of t)(o=e==null?void 0:e.getEditRow(s))==null||o.forEach((i,r)=>!n.has(r)&&e.removeEdits({rowNode:s,column:r}))},nve=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),o=new Set(n.keys());tve(e,eve(e,o),t)},ove=new Set(["undo","redo","paste","bulk","rangeSvc"]),sve=new Set(["ui","api"]),Q2={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},ive=new Set(Object.keys(Q2)),rve=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Sy={cancel:!0,source:"api"},ave={cancel:!1,source:"api"},Sd={checkSiblings:!0},up={force:!0,suppressFlash:!0},lve=class extends He{constructor(){super(...arguments),this.beanName="editSvc",this.batch=!1,this.stopping=!1,this.committing=!1}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:o})=>{this.stopEditing(void 0,Sy),this.createStrategy(o)});const t=nve(e),n=()=>{const o=this.model.getCellValidationModel().getCellValidationMap().size>0,s=this.model.getRowValidationModel().getRowValidationMap().size>0;return o||s?this.stopEditing(void 0,Sy):this.isEditing()&&(this.isBatchEditing()?yd(e,this.model.getEditPositions()):this.stopEditing(void 0,ave)),!1};this.addManagedEventListeners({columnPinned:t,columnVisible:t,columnRowGroupChanged:t,rowExpansionStateChanged:t,pinnedRowsChanged:t,displayedRowsChanged:t,sortChanged:n,filterChanged:n,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}setBatchEditing(e){e?(this.batch=!0,this.stopEditing(void 0,Sy)):(this.stopEditing(void 0,Sy),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:o}=this,s=eB(n,e);if(o){if(o.beanName===s)return o;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(s,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,n,o="ui"){const s=Yme(this.beans,e,t,n,o);return s&&(this.strategy??(this.strategy=this.createStrategy())),s}shouldStopEditing(e,t,n="ui"){var o;return((o=this.strategy)==null?void 0:o.shouldStop(e,t,n))??null}shouldCancelEditing(e,t,n="ui"){var o;return((o=this.strategy)==null?void 0:o.shouldCancel(e,t,n))??null}validateEdit(){return Efe(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??Sd)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:n=!0,event:o=null,source:s="ui",ignoreEventKey:i=!1,silent:r}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=Gn(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,o,n,s);if(l===!1&&s!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,s)&&!t.continueEditing&&this.stopEditing(void 0,{source:s}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:o,source:s,ignoreEventKey:i,startedEdit:n,silent:r})}stopEditing(e,t){var v,y,b;const{event:n,cancel:o,source:s="ui",forceCancel:i,forceStop:r}=t||{},{beans:a,model:l}=this;if(ive.has(s)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const c=this.committing?Q2[s]:s;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,Sd))||!this.strategy||this.stopping)return!1;this.stopping=!0;const d=Gn(a,e);d&&(d.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),f=!1;const p=!o&&(!!this.shouldStopEditing(e,n,c)||this.committing&&!this.batch)||(r??!1),g=o&&!!this.shouldCancelEditing(e,n,c)||(i??!1);if(p||g){_c(a,{persist:!0,isCancelling:g||o,isStopping:p});const S=l.getEditMap(),C=this.processEdits(S,o,s);(v=this.strategy)==null||v.stop(o,n);for(const E of C)l.clearEditValue(E);this.bulkRefresh(void 0,h);for(const E of l.getEditPositions(S)){const _=Gn(a,E),x=ga(E);_==null||_.refreshCell({force:!0,suppressFlash:!x})}h=S,f||(f=p)}else if(n instanceof KeyboardEvent&&this.batch&&((y=this.strategy)!=null&&y.midBatchInputsAllowed(e))&&this.isEditing(e,{withOpenEditor:!0})){const{key:S}=n,C=S===Ae.ENTER,E=S===Ae.ESCAPE,_=S===Ae.TAB;(C||_||E)&&(C||_?_c(a,{persist:!0}):E&&this.revertSingleCellEdit(d),this.isBatchEditing()?(b=this.strategy)==null||b.cleanupEditors():yd(a,l.getEditPositions(),{event:n,cancel:E}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else _c(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),JE(a),this.model.hasEdits()||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()),this.bulkRefresh(),g&&this.beans.rowRenderer.refreshRows({rowNodes:Array.from(h.keys())}),this.isBatchEditing()&&(this.beans.rowRenderer.refreshRows({suppressFlash:!0,force:!0}),f&&p&&this.dispatchBatchEvent("batchEditingStopped",h)),this.stopping=!1,f}navigateAfterEdit(e,t){var c;if(!e||!t)return;const{event:n,suppressNavigateAfterEdit:o}=e;if(!(n instanceof KeyboardEvent)||o)return;const{key:i,shiftKey:r}=n,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(i!==Ae.ENTER||!a)return;const l=r?Ae.UP:Ae.DOWN;(c=this.beans.navigation)==null||c.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,n){const o=Array.from(e.keys()),s=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,i=[];for(const r of o){const a=e.get(r);for(const l of a.keys()){const c=a.get(l),u={rowNode:r,column:l},d=ga(c);!t&&d&&!s&&(this.setNodeDataValue(r,l,c.pendingValue,void 0,n)||i.push(u))}}return i}setNodeDataValue(e,t,n,o,s="edit"){const{beans:i}=this,r=Gn(i,{rowNode:e,column:t}),a=sve.has(s)?"edit":s;r&&(r.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,n,a);return r&&(r.suppressRefreshCell=!1),o&&(r==null||r.refreshCell(up)),l}setEditMap(e,t){var o;this.strategy??(this.strategy=this.createStrategy()),(o=this.strategy)==null||o.setEditMap(e,t),this.bulkRefresh();let n=up;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...cve(e),...up}),this.beans.rowRenderer.refreshCells(n)}dispatchEditValuesChanged({rowNode:e,column:t},n={}){if(!e||!t||!n)return;const{pendingValue:o,sourceValue:s}=n,{rowIndex:i,rowPinned:r,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:i,rowPinned:r,column:t,source:"api",data:a,newValue:o,oldValue:s,value:o,colDef:t.getColDef()})}bulkRefresh(e={},t,n={}){var a;const{beans:o,gos:s}=this,{editModelSvc:i,rowModel:r}=o;no(s)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),n):t&&((a=i==null?void 0:i.getEditMap(!1))==null||a.forEach((l,c)=>{for(const u of l.keys())this.refCell({rowNode:c,column:u},l.get(u),n)})))}refCell({rowNode:e,column:t},n,o={}){var d,h,f;const{beans:s,gos:i}=this,r=new Set([e]),a=new Set,l=e.pinnedSibling;l&&r.add(l);const c=e.sibling;c&&a.add(c);let u=e.parent;for(;u;)(d=u.sibling)!=null&&d.footer&&i.get("groupTotalRow")||!u.parent&&u.sibling&&i.get("grandTotalRow")?a.add(u.sibling):a.add(u),u=u.parent;for(const p of r)this.dispatchEditValuesChanged({rowNode:p,column:t},n);for(const p of r)(h=Gn(s,{rowNode:p,column:t}))==null||h.refreshCell(o);for(const p of a)(f=Gn(s,{rowNode:p,column:t}))==null||f.refreshCell(o)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:n}=e,{gos:o,beans:s}=this;if(n.group){if(o.get("treeData")){if(!n.data&&!o.get("enableGroupEdit"))return!1}else if(!o.get("enableGroupEdit"))return!1}const i=eB(o)==="fullRow"?Xme(s,e,t):w_(s,e,t);return i&&(this.strategy??(this.strategy=this.createStrategy())),i}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,n=!0){var o,s,i,r;if(this.hasValidationErrors(e)){const a=Gn(this.beans,e);return this.cellEditingInvalidCommitBlocks()?((o=t==null?void 0:t.preventDefault)==null||o.call(t),n&&(!(a!=null&&a.hasBrowserFocus())&&(a==null||a.focusCell()),(r=(i=(s=a==null?void 0:a.comp)==null?void 0:s.getCellEditor())==null?void 0:i.focusIn)==null||r.call(i)),"block-stop"):(a&&this.revertSingleCellEdit(a),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){var o,s,i,r;const n=Gn(this.beans,e);(o=n==null?void 0:n.comp)!=null&&o.getCellEditor()&&(yd(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),vd(this.beans,e,{silent:!0}),Rc(this.beans),n==null||n.refreshCell(up),t&&(n==null||n.focusCell(),(r=(i=(s=n==null?void 0:n.comp)==null?void 0:s.getCellEditor())==null?void 0:i.focusIn)==null||r.call(i)))}hasValidationErrors(e){var o;Rc(this.beans);const t=Gn(this.beans,e);t&&(t.refreshCell(up),(o=t.rowCtrl.rowEditStyleFeature)==null||o.applyRowStyles());let n=!1;return e!=null&&e.rowNode?(n||(n=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(n||(n=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(n||(n=this.model.getCellValidationModel().getCellValidationMap().size>0),n||(n=this.model.getRowValidationModel().getRowValidationMap().size>0)),n}moveToNextCell(e,t,n,o="ui"){var a;let s;const i=this.isEditing(),r=i&&this.checkNavWithValidation(void 0,n)==="block-stop";return e instanceof wd&&i&&(s=(a=this.strategy)==null?void 0:a.moveToNextEditingCell(e,t,n,o,r)),s===null||(s=s||!!this.beans.focusSvc.focusedHeader,s===!1&&!r&&this.stopEditing()),s}getCellDataValue({rowNode:e,column:t},n=!0){if(!e||!t)return;let o=this.model.getEdit({rowNode:e,column:t});const s=e.pinnedSibling;if(s){const r=this.model.getEdit({rowNode:s,column:t});r&&(o=r)}const i=n?(o==null?void 0:o.editorValue)??(o==null?void 0:o.pendingValue):o==null?void 0:o.pendingValue;return i===di||!o?(o==null?void 0:o.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):i}addStopEditingWhenGridLosesFocus(e){vfe(this,this.beans,e)}createPopupEditorWrapper(e){return new qme(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var o;try{if((!this.isEditing()||this.committing)&&!rve.has(n))return;const{beans:s}=this;this.strategy??(this.strategy=this.createStrategy());const i=this.isBatchEditing()?"ui":this.committing?n??"api":"api";if(!n||ove.has(n))return fy(s,e,t,n,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,n);const r=this.model.getEdit(e);if(r){if(r.pendingValue===t)return!1;if(r.sourceValue!==t)return fy(s,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0;if(r.sourceValue===t)return(o=s.editModelSvc)==null||o.removeEdits(e),this.dispatchEditValuesChanged(e,{...r,pendingValue:t}),!0}return fy(s,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){Cfe(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,Sd))return;const{rowNode:o,column:s}=e,{compDetails:i,valueToDisplay:r}=t;if(i){const{params:l}=i;return l.data=this.model.getEditRowDataValue(o,Sd),{compDetails:i}}const a=this.model.getEditRow(e.rowNode,Sd);if(r!==void 0&&(a!=null&&a.has(s)))return{valueToDisplay:this.valueSvc.getValue(s,o)}}cleanupEditors(){var e;(e=this.strategy)==null||e.cleanupEditors()}dispatchCellEvent(e,t,n,o){var s;(s=this.strategy)==null||s.dispatchCellEvent(e,t,n,o)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return It(this.gos,{type:e,...e==="batchEditingStopped"?{changes:this.toEventChangeList(t)}:{}})}toEventChangeList(e){return this.model.getEditPositions(e).map(t=>({rowIndex:t.rowNode.rowIndex,rowPinned:t.rowNode.rowPinned,columnId:t.column.getColId(),newValue:t.pendingValue,oldValue:t.sourceValue}))}applyBulkEdit({rowNode:e,column:t},n){var c,u;if(!n||n.length===0)return;const{beans:o,rangeSvc:s,valueSvc:i}=this;_c(o,{persist:!0});const r=this.model.getEditMap(!0),a=(u=(c=r.get(e))==null?void 0:c.get(t))==null?void 0:u.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(s==null||s.forEachRowInRange(d,h=>{const f=pa(o,h);if(f===void 0)return;const p=r.get(f)??new Map;for(const g of d.columns)if(g&&this.isCellEditable({rowNode:f,column:g},"api")){const v=i.getValue(g,f,!0,"api");let y=i.parseValue(g,f??null,a,v);Number.isNaN(y)&&(y=null),p.set(g,{editorValue:void 0,pendingValue:y,sourceValue:v,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}p.size>0&&r.set(f,p)}),this.setEditMap(r),this.batch){this.cleanupEditors(),JE(o),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(r)})}),this.bulkRefresh();const l=Gn(o,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new Jme(e,t)}createRowStyleFeature(e,t){return new Qme(e,t)}setEditingCells(e,t){const{beans:n}=this,{colModel:o,valueSvc:s}=n,i=new Map;for(let{colId:r,column:a,colKey:l,rowIndex:c,rowPinned:u,newValue:d,state:h}of e){const f=r?o.getCol(r):l?o.getCol(l):a;if(!f)continue;const p=pa(n,{rowIndex:c,rowPinned:u});if(!p)continue;const g=s.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!ga({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=i.get(p);v||(v=new Map,i.set(p,v)),d===void 0&&(d=di),v.set(f,{editorValue:void 0,pendingValue:d,sourceValue:g,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(i,t)}onCellFocused(e){var i;const t=Gn(this.beans,e);if(!t||!this.isEditing(t,Sd))return;const n=this.model.getEdit(t);if(!n||!ga(n))return;const s=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(i=this.beans.ariaAnnounce)==null||i.announceValue(s,"pendingChange")}allowedFocusTargetOnValidation(e){return Gn(this.beans,e)}};function cve(e){return{rowNodes:e?Array.from(e.keys()):void 0,columns:e?[...new Set(Array.from(e.values()).flatMap(t=>Array.from(t.keys())))]:void 0}}function eB(e,t){return t??e.get("editType")??"singleCell"}var tB=class extends He{postConstruct(){var e,t;this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:(e=this.onCellFocusChanged)==null?void 0:e.bind(this),cellFocusCleared:(t=this.onCellFocusChanged)==null?void 0:t.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const n=e.previousParams,{editSvc:o,beans:s}=this,i=e.type==="cellFocused"?e.sourceEvent:null;n&&(t=Gn(s,n));const{gos:r,editModelSvc:a}=s,l=e.type==="cellFocusCleared";if(o.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:u,rowPinned:d}=e,h={column:c,rowNode:pa(s,{rowIndex:u,rowPinned:d})},f=r.get("invalidEditValueMode")==="block";if(f)return;const p=!f,g=!!(a!=null&&a.getCellValidationModel().hasCellValidation(h)),v=p&&g;(n||l?o.stopEditing(void 0,{cancel:v,source:l&&p?"api":void 0,event:i}):!0)||(o.isBatchEditing()?o.cleanupEditors():o.stopEditing(void 0,{source:"api"}))}t==null||t.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){var s,i;const n=this.model.getEditPositions(),o={all:[],pass:[],fail:[]};for(const r of n){o.all.push(r);const a=this.model.getCellValidationModel().getCellValidation(r);if((((s=a==null?void 0:a.errorMessages)==null?void 0:s.length)??0)>0){o.fail.push(r);continue}o.pass.push(r)}if(e)for(const r of n)py(this.beans,r,{cancel:e}),this.model.stop(r);else{const r=this.processValidationResults(o);if(r.destroy.length>0)for(const a of r.destroy)py(this.beans,a,{event:t,cancel:e}),this.model.stop(a);if(r.keep.length>0)for(const a of r.keep){const l=Gn(this.beans,a);(i=this.editSvc)!=null&&i.cellEditingInvalidCommitBlocks()||l&&this.editSvc.revertSingleCellEdit(l)}}return!0}cleanupEditors({rowNode:e}={},t){_c(this.beans,{persist:!1});const n=this.model.getEditPositions(),o=[];if(e)for(const s of n)s.rowNode!==e&&o.push(s);else for(const s of n)o.push(s);yd(this.beans,o),JE(this.beans,t)}setFocusOutOnEditor(e){var t,n,o;(o=(n=(t=e.comp)==null?void 0:t.getCellEditor())==null?void 0:n.focusOut)==null||o.call(n)}setFocusInOnEditor(e){const t=e.comp,n=t==null?void 0:t.getCellEditor();if(n!=null&&n.focusIn)n.focusIn();else{const o=this.beans.gos.get("editType")==="fullRow";e.focusCell(o),e.onEditorAttachedFuncs.push(()=>{var s,i;return(i=(s=t==null?void 0:t.getCellEditor())==null?void 0:s.focusIn)==null?void 0:i.call(s)})}}setupEditors(e){const{event:t,ignoreEventKey:n=!1,startedEdit:o,position:s,cells:i=this.model.getEditPositions()}=e,r=t instanceof KeyboardEvent&&!n&&t.key||void 0;wfe(this.beans,i,s,r,t,o)}dispatchCellEvent(e,t,n,o){const s=Gn(this.beans,e);s&&this.eventSvc.dispatchEvent({...s.createEvent(t??null,n),...o})}dispatchRowEvent(e,t,n){if(n)return;const o=ZE(this.beans,e);o&&this.eventSvc.dispatchEvent(o.createRowEvent(t))}shouldStop(e,t,n="ui"){const o=this.editSvc.isBatchEditing();return o&&n==="api"?!0:o&&(n==="ui"||n==="edit")?!1:n==="api"?!0:t instanceof KeyboardEvent&&!o?t.key===Ae.ENTER:null}shouldCancel(e,t,n="ui"){const o=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!o&&t.key===Ae.ESCAPE||o&&n==="api"||n==="api")}setEditMap(e,t){var o;t!=null&&t.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const n=[];if(e.forEach((s,i)=>{s.forEach((r,a)=>{r.state==="editing"&&n.push({...r,rowNode:i,column:a})})}),t!=null&&t.update&&(e=new Map([...this.model.getEditMap(),...e])),(o=this.model)==null||o.setEditMap(e),n.length>0){const s=n.at(-1),i=s.pendingValue===di?void 0:s.pendingValue;this.start({position:s,event:new KeyboardEvent("keydown",{key:i}),source:"api"});const r=Gn(this.beans,s);r&&this.setFocusInOnEditor(r)}}destroy(){this.cleanupEditors(),super.destroy()}},uve=class extends tB{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:o}=e||{};if(!ZE(this.beans,{rowNode:this.rowNode}))return!0;const i=super.shouldStop({rowNode:this.rowNode},t,n);return i!==null?i:this.rowNode?o!==this.rowNode:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:n,startedEdit:o,event:s,ignoreEventKey:i}=e,{rowNode:r}=t;this.rowNode!==r&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],c=[];for(const u of a)u.isCellEditable(r)&&c.push(u);if(c.length!=0){this.dispatchRowEvent({rowNode:r},"rowEditingStarted",n),this.startedRows.push(r);for(const u of c){const d={rowNode:r,column:u};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=r,this.setupEditors({cells:l,position:t,startedEdit:o,event:s,ignoreEventKey:i})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){var s;const{rowNode:n}=this;if(n&&!this.model.hasRowEdits(n))return!1;const o=[];if(e||this.model.getEditMap().forEach((i,r)=>{if(!(!i||i.size===0)){for(const a of i.values())if(ga(a)){o.push(r);break}}}),Rc(this.beans),!e&&((s=this.editSvc)==null?void 0:s.checkNavWithValidation({rowNode:n}))==="block-stop")return!1;super.stop(e,t);for(const i of o)this.dispatchRowEvent({rowNode:i},"rowValueChanged");return this.cleanupEditors({rowNode:n},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,n=e.previousParams;if((n==null?void 0:n.rowIndex)===t||e.sourceEvent instanceof KeyboardEvent)return;const o=Gn(this.beans,n);this.gos.get("invalidEditValueMode")==="block"&&o&&(this.model.getCellValidationModel().getCellValidation(o)||this.model.getRowValidationModel().getRowValidation(o))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);for(const n of this.startedRows)this.dispatchRowEvent({rowNode:n},"rowEditingStopped");this.startedRows.length=0}moveToNextEditingCell(e,t,n,o="ui",s=!1){var h,f,p,g;const i=e.cellPosition;let r;this.model.suspend(!0);try{r=(h=this.beans.navigation)==null?void 0:h.findNextCellToFocusOn(i,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(r===!1)return null;if(r==null)return!1;const a=r.cellPosition,l=e.isCellEditable(),c=r.isCellEditable(),u=a&&i.rowIndex===a.rowIndex&&i.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return c&&!s?d?r.focusCell(!0,n):((f=r.comp)!=null&&f.getCellEditor()||vd(this.beans,r,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(r),r.focusCell(!1,n)):(c&&s&&this.setFocusInOnEditor(r),r.focusCell(!0,n)),!u&&!s&&((p=this.editSvc)==null||p.stopEditing({rowNode:e.rowNode},{event:n}),this.cleanupEditors(r,!0),d?r.focusCell(!0,n):this.editSvc.startEditing(r,{startedEdit:!0,event:n,source:o,ignoreEventKey:!0})),(g=e.rowCtrl)==null||g.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:n},o)=>{var i;if(n!=="editing")return;const s=Gn(this.beans,{rowNode:t,column:o});s&&!((i=s.comp)!=null&&i.getCellEditor())&&vd(this.beans,s,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},dve=class extends tB{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,n="ui"){const o=super.shouldStop(e,t,n);if(o!==null)return o;const{rowNode:s,column:i}=e||{};return(!this.rowNode||!this.column)&&s&&i?null:this.rowNode!==s||this.column!==i}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:n,event:o,ignoreEventKey:s}=e;(this.rowNode!==t.rowNode||this.column!==t.column)&&super.cleanupEditors(),this.rowNode=t.rowNode,this.column=t.column,this.model.start(t),this.setupEditors({cells:[t],position:t,startedEdit:n,event:o,ignoreEventKey:s})}dispatchRowEvent(e,t,n){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){return super.stop(e,t),this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:n}=this.beans,{rowIndex:o,column:s,rowPinned:i}=e,r=pa(this.beans,{rowIndex:o,rowPinned:i}),a=XE(s),l=t.getCol(a),c=e.previousParams;if(c){const u=XE(c.column);if((c==null?void 0:c.rowIndex)===o&&u===a&&(c==null?void 0:c.rowPinned)===i)return}n!=null&&n.isEditing({rowNode:r,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,n,o="ui",s=!1){var p,g,v,y,b,S;const i=this.beans.focusSvc.getFocusedCell();i&&(e=gd(this.beans,i)??e);const r=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),s||(e.eGui.focus(),(g=this.editSvc)==null||g.stopEditing(e,{source:(p=this.editSvc)!=null&&p.isBatchEditing()?"ui":"api",event:n}));try{a=(v=this.beans.navigation)==null?void 0:v.findNextCellToFocusOn(r,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,u=e.isCellEditable(),d=a.isCellEditable(),h=c&&r.rowIndex===c.rowIndex&&r.rowPinned===c.rowPinned;u&&!s&&this.setFocusOutOnEditor(e);const f=this.gos.get("suppressStartEditOnTab");if(!h&&!s&&(super.cleanupEditors(a,!0),f?a.focusCell(!0,n):this.editSvc.startEditing(a,{startedEdit:!0,event:n,source:o,ignoreEventKey:!0})),d&&!s){if(a.focusCell(!1,n),f)a.focusCell(!0,n);else if(!((y=a.comp)!=null&&y.getCellEditor())){const C=(b=this.editSvc)==null?void 0:b.isEditing(a,{withOpenEditor:!0});vd(this.beans,a,{event:n,cellStartedEdit:!0,silent:C}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else d&&s&&this.setFocusInOnEditor(a),a.focusCell(!0,n);return(S=e.rowCtrl)==null||S.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},ul={moduleName:"EditCore",version:ut,beans:[mfe,lve],apiFunctions:{getEditingCells:$me,getEditRowValues:Bme,getCellEditorInstances:yfe,startEditingCell:Ume,stopEditing:Hme,isEditing:Gme,validateEdit:Wme},dynamicBeans:{singleCell:dve,fullRow:uve},dependsOn:[vy,W2],css:[mme]},hve={moduleName:"UndoRedoEdit",version:ut,beans:[gme],apiFunctions:{undoCellEditing:Lme,redoCellEditing:Vme,getCurrentUndoSize:zme,getCurrentRedoSize:jme},dependsOn:[ul]},fve={moduleName:"TextEditor",version:ut,userComponents:{agCellEditor:j2,agTextCellEditor:j2},dependsOn:[ul]},pve={moduleName:"NumberEditor",version:ut,userComponents:{agNumberCellEditor:{classImp:Fme}},dependsOn:[ul]},gve={moduleName:"DateEditor",version:ut,userComponents:{agDateCellEditor:bme,agDateStringCellEditor:_me},dependsOn:[ul]},mve={moduleName:"CheckboxEditor",version:ut,userComponents:{agCheckboxCellEditor:yme},dependsOn:[ul]},vve={moduleName:"SelectEditor",version:ut,userComponents:{agSelectCellEditor:Pme},dependsOn:[ul]},yve={moduleName:"LargeTextEditor",version:ut,userComponents:{agLargeTextCellEditor:Dme},dependsOn:[ul]},wve={moduleName:"CustomEditor",version:ut,dependsOn:[ul]},Cve=class extends He{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,rd(e.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(e){const t=this.columns;t!=null&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),Pse(e))}createColumns(e,t){var h,f;const n=()=>{var p;Lv(this.beans,(p=this.columns)==null?void 0:p.tree),this.columns=null},o=e.treeDepth,i=(((h=this.columns)==null?void 0:h.treeDepth)??-1)==o,r=this.generateSelectionCols();if(Ise(r,((f=this.columns)==null?void 0:f.list)??[])&&i)return;n();const{colGroupSvc:l}=this.beans,c=(l==null?void 0:l.findDepth(e.tree))??0,u=(l==null?void 0:l.balanceTreeForAutoCols(r,c))??[];this.columns={list:r,tree:u,treeDepth:c,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!la(v));return[...r,...g]})}updateColumns(e){var n;const t=rd(e.source);for(const o of((n=this.columns)==null?void 0:n.list)??[]){const s=this.createSelectionColDef(e.currentValue);o.setColDef(s,null,t),Bi(this.beans,{state:[{...s,colId:o.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>jf(n,e)))??null}getColumns(){var e;return((e=this.columns)==null?void 0:e.list)??null}isSelectionColumnEnabled(){var r,a;const{gos:e,beans:t}=this,n=e.get("rowSelection");if(typeof n!="object"||!dc(e))return!1;const o=(((a=(r=t.autoColSvc)==null?void 0:r.getColumns())==null?void 0:a.length)??0)>0;if(n.checkboxLocation==="autoGroupColumn"&&o)return!1;const s=!!id(n),i=Pv(n);return s||i}createSelectionColDef(e){const{gos:t}=this,n=e??t.get("selectionColumnDef"),o=t.get("enableRtl"),{rowSpan:s,spanRows:i,...r}=n??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:o?"right":"left",comparator(a,l,c,u){const d=c.isSelected(),h=u.isSelected();return d===h?0:d?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...r,colId:UN,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new pc(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const o=t&&typeof t!="string"?id(t):void 0,s=e&&typeof e!="string"?id(e):void 0,i=o!==s,r=t&&typeof t!="string"?Pv(t):void 0,a=e&&typeof e!="string"?Pv(e):void 0,l=r!==a,c=Av(e),u=Av(t);(i||l||c!==u)&&this.beans.colModel.refreshAll(n)}destroy(){var e;Lv(this.beans,(e=this.columns)==null?void 0:e.tree),super.destroy()}refreshVisibility(e,t,n){var l,c;if(!((l=this.columns)!=null&&l.list.length))return;const o=e.length+t.length+n.length;if(o===0)return;const s=this.columns.list[0];if(!s.isVisible())return;const i=()=>{let u;switch(s.pinned){case"left":case!0:u=e;break;case"right":u=n;break;default:u=t}u&&Vi(u,s)};(((c=this.beans.rowNumbersSvc)==null?void 0:c.getColumn(WN))?2:1)===o&&i()}};function bve(e,t){var r;if(!t.nodes.every(a=>a.rowPinned&&!tp(a)?(qe(59),!1):a.id===void 0?(qe(60),!1):!0))return;const{nodes:o,source:s,newValue:i}=t;(r=e.selectionSvc)==null||r.setNodesSelected({nodes:o,source:s??"api",newValue:i})}function Sve(e,t,n="apiSelectAll"){var o;(o=e.selectionSvc)==null||o.selectAllRowNodes({source:n,selectAll:t})}function Eve(e,t,n="apiSelectAll"){var o;(o=e.selectionSvc)==null||o.deselectAllRowNodes({source:n,selectAll:t})}function _ve(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function Rve(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function Dve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function Tve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function xve(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function Fve(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var Ive=class extends Ule{constructor(){super(...arguments),this.beanName="selectionSvc",this.selectedNodes=new Map,this.detailSelection=new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();const{gos:e}=this;this.mode=kv(e),this.groupSelectsDescendants=Wf(e),this.groupSelectsFiltered=Ov(e)==="filteredDescendants",this.masterSelectsDetail=VN(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=Wf(e),n=kv(e),o=Ov(e)==="filteredDescendants";this.masterSelectsDetail=VN(e)==="detail",(t!==this.groupSelectsDescendants||o!==this.groupSelectsFiltered||n!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=o,this.mode=n)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,n){if(this.isRowSelectionBlocked(t))return 0;const o=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,n);if(o==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in o)return o.reset?this.resetNodes():this.selectRange(o.deselect,!1,n),this.selectRange(o.select,!0,n);{const s=o.checkFilteredNodes?oB(o.node):o.newValue;return this.setNodesSelected({nodes:[o.node],newValue:s,clearSelection:o.clearSelection,keepDescendants:o.keepDescendants,event:e,source:n})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:n,nodes:o,event:s,source:i,keepDescendants:r=!1}){var c;if(o.length===0)return 0;const{gos:a}=this;if(!dc(a)&&e)return qe(132),0;if(o.length>1&&!this.isMultiSelect())return qe(130),0;let l=0;for(let u=0;u<o.length;u++){const d=o[u],h=Ed(d);if(h.rowPinned&&!tp(h)){qe(59);continue}if(h.id===void 0){qe(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,s,i)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((c=h.childrenAfterGroup)!=null&&c.length)&&(l+=this.selectChildren(h,e,i))}return n||(o.length===1&&i==="api"&&this.selectionCtx.setRoot(Ed(o[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(Ed(o[0]),r,i)),l>0&&(this.updateGroupsFromChildrenSelections(i),this.dispatchSelectionChanged(i))),l}selectRange(e,t,n){let o=0;return e.forEach(s=>{const i=Ed(s);if(i.group&&this.groupSelectsDescendants)return;this.selectRowNode(i,t,void 0,n)&&o++}),o>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n)),o}selectChildren(e,t,n){const o=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return o?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:n,nodes:o}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((n,o)=>{e(n)&&t.set(o,n)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:n,rowModel:o}=this.beans;if(!no(n))return!1;const s=o.rootNode;if(!s)return!1;t||(t=new op(!0,s),t.active=!1);let i=!1;return t.forEachChangedNodeDepthFirst(r=>{if(r!==s){const a=this.calculateSelectedFromChildren(r);i=this.selectRowNode(r,a===null?!1:a,void 0,e)||i}}),i}clearOtherNodes(e,t,n){const o=new Map;let s=0;return this.selectedNodes.forEach(i=>{const r=i.id==e.id;if((t?!Ave(e,i):!0)&&!r){const l=this.selectedNodes.get(i.id);s+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:n}),this.groupSelectsDescendants&&i.parent&&o.set(i.parent.id,i.parent)}}),o.forEach(i=>{const r=this.calculateSelectedFromChildren(i);this.selectRowNode(i,r===null?!1:r,void 0,n)}),s}onRowSelected(e){const t=e.node;this.groupSelectsDescendants&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}createDaemonNode(e){if(!e.id)return;const t=new sl(this.beans);return t.id=e.id,t.data=e.data,t.__selected=e.__selected,t.level=e.level,t}syncInOldRowNode(e,t){t&&e.id!==t.id&&this.selectedNodes.get(t.id)==e&&this.selectedNodes.set(t.id,t)}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.__selected=!0,this.selectedNodes.set(e.id,e)):e.__selected=!1}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes.forEach(e=>{this.selectRowNode(e,!1)}),this.selectedNodes.clear()}getBestCostNodeSelection(){const{gos:e,rowModel:t}=this.beans;if(!no(e))return;const n=t.getTopLevelNodes();if(n===null)return;const o=[];function s(i){for(let r=0,a=i.length;r<a;r++){const l=i[r];l.isSelected()?o.push(l):l.group&&l.childrenAfterGroup&&s(l.childrenAfterGroup)}}return s(n),o}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const n=no(this.gos);let o=!1;const s=i=>{const r=this.selectRowNode(Ed(i),!1,void 0,e);o||(o=r)};if(t==="currentPage"||t==="filtered"){if(!n){Sn(102);return}this.getNodesToSelect(t).forEach(s)}else this.selectedNodes.forEach(s),this.reset(e);if(this.selectionCtx.selectAll=!1,n&&this.groupSelectsDescendants){const i=this.updateGroupsFromChildrenSelections(e);o||(o=i)}o&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,n=0;return this.getNodesToSelect(e).forEach(o=>{this.groupSelectsDescendants&&o.group||(o.isSelected()?t++:o.selectable&&n++)}),{selectedCount:t,notSelectedCount:n}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:n}=this.getSelectedCounts(e);return nB(t,n)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],n=s=>t.push(s);if(e==="currentPage")return this.forEachNodeOnPage(s=>{if(!s.group){n(s);return}if(!s.expanded&&!s.footer){const i=r=>{var a;n(r),(a=r.childrenAfterFilter)==null||a.forEach(i)};i(s);return}this.groupSelectsDescendants||n(s)}),t;const o=this.beans.rowModel;return e==="filtered"?(o.forEachNodeAfterFilter(n),t):(o.forEachNode(n),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:n}=this.beans,o=t.getFirstRow(),s=t.getLastRow();for(let i=o;i<=s;i++){const r=n.getRow(i);r&&e(r)}}selectAllRowNodes(e){const{gos:t,selectionCtx:n}=this;if(!dc(t)){qe(132);return}if(vse(t)&&!Uf(t)){qe(130);return}if(!this.canSelectAll())return;const{source:o,selectAll:s}=e;let i=!1;if(this.getNodesToSelect(s).forEach(r=>{const a=this.selectRowNode(Ed(r),!0,void 0,o);i||(i=a)}),n.selectAll=!0,no(t)&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(o);i||(i=r)}i&&this.dispatchSelectionChanged(o)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,n){if(e||(e=[]),!Array.isArray(e)){Sn(103);return}const o=new Set(e),s=[];this.beans.rowModel.forEachNode(i=>{o.has(i.id)&&s.push(i)}),n&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:s,source:t})}canSelectAll(){return no(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!dc(t))return;const o="selectableChanged",s=e!==void 0,i=no(t)&&this.groupSelectsDescendants,r=[],a=c=>{var d;if(s&&!c.group)return;if(i&&c.group){const h=((d=c.childrenAfterGroup)==null?void 0:d.some(f=>f.selectable))??!1;this.setRowSelectable(c,h,!0);return}!this.updateRowSelectable(c,!0)&&c.isSelected()&&r.push(c)};if(i){if(e===void 0){const c=n.rootNode;e=c?new op(!1,c):void 0}e==null||e.forEachChangedNodeDepthFirst(a,!s,!s)}else n.forEachNode(a);r.length&&this.setNodesSelected({nodes:r,newValue:!1,source:o}),!s&&i&&((l=this.updateGroupsFromChildrenSelections)==null||l.call(this,o))}updateSelectableAfterGrouping(e){var t;this.updateSelectable(e),this.groupSelectsDescendants&&((t=this.updateGroupsFromChildrenSelections)!=null&&t.call(this,"rowGroupChanged",e))&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){var i,r;if(!this.masterSelectsDetail)return;const n=(r=(i=e.detailNode)==null?void 0:i.detailGridInfo)==null?void 0:r.api;if(!n)return;const o=Pve(n);if(e.isSelected()!==o&&this.selectRowNode(e,o,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!o){const a=this.detailSelection.get(e.id)??new Set;for(const l of n.getSelectedNodes())a.add(l.id);this.detailSelection.set(e.id,a)}}setDetailSelectionState(e,t,n){if(this.masterSelectsDetail){if(!Uf(t)){qe(269);return}switch(e.isSelected()){case!0:{n.selectAll();break}case!1:{n.deselectAll();break}case void 0:{const o=this.detailSelection.get(e.id);if(o){const s=[];for(const i of o){const r=n.getRowNode(i);r&&s.push(r)}n.setNodesSelected({nodes:s,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function Ed(e){return tp(e)?e.pinnedSibling:e.footer?e.sibling:e}function Pve(e){let t=0,n=0;return e.forEachNode(o=>{o.isSelected()?t++:o.selectable&&n++}),nB(t,n)}function nB(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function Ave(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function oB(e){var o;const t=e.isSelected()===!1,n=((o=e.childrenAfterFilter)==null?void 0:o.some(oB))??!1;return t||n}var kve={moduleName:"SharedRowSelection",version:ut,beans:[Cve],apiFunctions:{setNodesSelected:bve,selectAll:Sve,deselectAll:Eve,selectAllFiltered:_ve,deselectAllFiltered:Rve,selectAllOnCurrentPage:Dve,deselectAllOnCurrentPage:Tve,getSelectedNodes:xve,getSelectedRows:Fve}},Ove={moduleName:"RowSelection",version:ut,rowModels:["clientSide","infinite","viewport"],beans:[Ive],dependsOn:[kve]};function Mve(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function Nve(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function sB(e){var t;(t=e.rowModel)==null||t.onRowHeightChanged()}function iB(e){var t,n;if((t=e.rowAutoHeight)!=null&&t.active){qe(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function Lve(e,t,n){var s,i;const o=Vpe(e);if(o){if(((s=e.rowGroupColsSvc)==null?void 0:s.columns.length)===0){if(t<0){Sn(238);return}o.setRowCount(t,n);return}Sn(28);return}(i=my(e))==null||i.setRowCount(t,n)}function Vve(e){var t;return nd(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function Bve(e){return e.rowModel.isLastRowIndexKnown()}var $ve={moduleName:"CsrmSsrmSharedApi",version:ut,apiFunctions:{expandAll:Mve,collapseAll:Nve}},Hve={moduleName:"RowModelSharedApi",version:ut,apiFunctions:{onRowHeightChanged:sB,resetRowHeights:iB}},Gve={moduleName:"SsrmInfiniteSharedApi",version:ut,apiFunctions:{setRowCount:Lve,getCacheBlockState:Vve,isLastRowIndexKnown:Bve}},Uve=class extends He{constructor(){super(...arguments),this.beanName="alignedGridsSvc",this.consuming=!1}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";return typeof e=="function"&&(e=e()),e.map(o=>{var i;if(!o){Sn(18),t||Sn(20);return}if(this.isGridApi(o))return o;const s=o;return"current"in s?(i=s.current)==null?void 0:i.api:(s.api||Sn(19),s.api)}).filter(o=>!!o&&!o.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){if(!this.consuming)for(const t of this.getAlignedGridApis())t.isDestroyed()||t.dispatchEvent(e)}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const n=[];return e.columns?e.columns.forEach(o=>{n.push(t(o))}):e.column&&n.push(t(e.column)),n}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":qe(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const n of e.columnGroups){let o=null;n&&(o=t.getProvidedColGroup(n.getGroupId())),!(n&&!o)&&t.setColumnGroupOpened(o,n.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let n=null;const o=this.beans,{colResize:s,ctrlsSvc:i,colModel:r}=o;if(t&&(n=r.getColDefCol(t.getColId())),t&&!n)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const d=e.api.getColumnState().map(h=>({colId:h.colId}));Bi(o,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));Bi(o,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));Bi(o,{state:d},"alignedGridChanged")}break;case"columnResized":{const u=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of u.flexColumns??[])d[h.getId()]&&delete d[h.getId()];s==null||s.setColumnWidths(Object.values(d),!1,u.finished,"alignedGridChanged");break}}const c=i.getGridBodyCtrl().isVerticalScrollShowing();for(const u of this.getAlignedGridApis())u.setGridOption("alwaysShowVerticalScroll",c)}},Wve={moduleName:"AlignedGrids",version:ut,beans:[Uve],dependsOn:[UV]},zve=class extends He{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},rB(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:n,groupStage:o}=this.beans;t==null||t.reset("rowDataChanged"),n!=null&&n.isManual()&&n.reset(),this.dispatchRowDataUpdateStarted(e),this.allNodesMap=Object.create(null),this.nextId=0;const s=rB(this.rootNode),i=new Array(e.length);s._leafs=i;let r=0;const a=o==null?void 0:o.getNestedDataGetter(),l=a?new Set:null,c=(u,d)=>{const h=u.level+1;for(let f=0,p=d.length;f<p;++f){const g=d[f];if(!g)continue;const v=this.createRowNode(g,h);if(v.sourceRowIndex=r,i[r++]=v,l&&!l.has(g)){l.add(g),v.treeParent=u;const y=a(g);y&&c(v,y)}}};c(s,e),i.length=r}setImmutableRowData(e,t){var y;const{rootNode:n,gos:o}=this;this.dispatchRowDataUpdateStarted(t);const s=sd(o),i=e.changedRowNodes,{adds:r,updates:a}=i,l=new Set,c=[],u=(y=this.beans.groupStage)==null?void 0:y.getNestedDataGetter();let d=o.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,f=!1;const p=(b,S)=>{if(!d&&d!==void 0){const C=b.sourceRowIndex;d=C<=h,h=C}b.data!==S&&(b.updateData(S),r.has(b)||a.add(b),!b.selectable&&b.isSelected()&&c.push(b))},g=(b,S,C)=>{for(let E=0,_=S.length;E<_;++E){const x=S[E];if(!x)continue;let A=this.getRowNode(s({data:x,level:C}));if(A?(p(A,x),f||(f=!!u&&A.treeParent!==b)):(A=this.createRowNode(x,C),r.add(A)),!u||l.has(A)){l.add(A);continue}l.add(A),A.treeParent=b;const k=u(x);k&&g(A,k,C+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,i,c)||d||r.size>0;if(v){const b=n._leafs??(n._leafs=[]);d===void 0?Zve(b,l,i):Yve(b,l)&&(i.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},n){const o=this.rootNode._leafs;for(let s=0,i=o.length;s<i;s++){const r=o[s];e.has(r)||(t.add(r),r.isSelected()&&n.push(r),this.deleteNode(r))}return t.size>0}updateRowData(e,t){var a;if(this.dispatchRowDataUpdateStarted(e.add),(a=this.beans.groupStage)!=null&&a.getNestedDataGetter())return qe(268),{remove:[],update:[],add:[]};const n=[],o=sd(this.gos),s=this.executeRemove(o,e,t,n),i=this.executeUpdate(o,e,t,n),r=this.executeAdd(e,t);return this.deselect(n),{remove:s,update:i,add:r}}executeRemove(e,{remove:t},{adds:n,updates:o,removals:s},i){const r=this.rootNode._leafs,a=r==null?void 0:r.length,l=t==null?void 0:t.length;if(!l||!a)return[];let c=0,u=a,d=0,h;const f=new Array(l);for(let p=0;p<l;++p){const g=this.lookupNode(e,t[p]);if(!g)continue;const v=g.sourceRowIndex;v<u&&(u=v),v>d&&(d=v),g.isSelected()&&i.push(g),this.deleteNode(g),n.delete(g)?(h??(h=new Set),h.add(g)):(o.delete(g),s.add(g)),f[c++]=g}return f.length=c,c&&qve(r,u,d,s,h),f}executeUpdate(e,{update:t},{adds:n,updates:o},s){const i=t==null?void 0:t.length;if(!i)return[];const r=new Array(i);let a=0;for(let l=0;l<i;l++){const c=t[l],u=this.lookupNode(e,c);u&&(u.updateData(c),!u.selectable&&u.isSelected()&&s.push(u),r[a++]=u,n.has(u)||o.add(u))}return r.length=a,r}executeAdd(e,t){var n;const o=(n=this.rootNode)._leafs??(n._leafs=[]),s=o.length,i=e.add,r=i==null?void 0:i.length;if(!r)return[];const a=s+r;let l=this.sanitizeAddIndex(o,e.addIndex);if(l<s){for(let d=s-1,h=a-1;d>=l;--d){const f=o[d];f.sourceRowIndex=h,o[h--]=f}t.reordered=!0}o.length=a;const c=new Array(r),u=t.adds;for(let d=0;d<r;d++){const h=this.createRowNode(i[d],0);u.add(h),h.sourceRowIndex=l,o[l]=h,c[d]=h,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}deselect(e){var o;const t="rowDataChanged",n=this.beans.selectionSvc;e.length&&(n==null||n.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t})),(o=n==null?void 0:n.updateGroupsFromChildrenSelections)==null||o.call(n,t),e.length&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t,selectedNodes:(n==null?void 0:n.getSelectedNodes())??null,serverSideState:null})}createRowNode(e,t){const n=new sl(this.beans);n.parent=this.rootNode,n.level=t,n.group=!1,n.expanded=!1,n.setDataAndId(e,String(this.nextId++));const o=n.id,s=this.allNodesMap;return s[o]&&qe(2,{nodeId:o}),s[o]=n,n}deleteNode(e){var s;e.clearRowTopAndRowIndex();const t=e.id,n=this.allNodesMap;n[t]===e&&delete n[t];const o=e.pinnedSibling;o&&((s=this.beans.pinnedRowModel)==null||s.pinRow(o,null))}lookupNode(e,t){if(!e)return Kve(this.rootNode._leafs,t);const n=e({data:t,level:0}),o=this.allNodesMap[n];return o||(Sn(4,{id:n}),null)}sanitizeAddIndex(e,t){const n=e.length;if(typeof t!="number"||t<0||t>=n||Number.isNaN(t))return n;t=Math.ceil(t);const o=this.gos;return t>0&&o.get("treeData")&&o.get("getDataPath")&&(t=jve(e,t)),t}},jve=(e,t)=>{for(let n=0,o=e.length;n<o;n++){const s=e[n];if((s==null?void 0:s.rowIndex)==t-1)return n+1}return t},rB=e=>{var r;e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",((r=e._leafs)==null?void 0:r.length)!==0&&(e._leafs=[]);const t=[],n=[],o=[],s=[];e.childrenAfterGroup=t,e.childrenAfterSort=n,e.childrenAfterAggFilter=o,e.childrenAfterFilter=s;const i=e.sibling;return i&&(i.childrenAfterGroup=t,i.childrenAfterSort=n,i.childrenAfterAggFilter=o,i.childrenAfterFilter=s,i.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},Kve=(e,t)=>{if(e)for(let n=0,o=e.length;n<o;n++){const s=e[n];if(s.data===t)return s}return Sn(5,{data:t}),null},qve=(e,t,n,o,s)=>{t=Math.max(0,t);for(let i=t,r=e.length;i<r;++i){const a=e[i];i<=n&&(o.has(a)||s!=null&&s.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},Yve=(e,t)=>{const n=t.size;e.length=n;let o=0,s=!1,i=!1;for(const r of t){const a=r.sourceRowIndex;a===o?i||(i=s):(a>=0?i=!0:s=!0,r.sourceRowIndex=o,e[o]=r),++o}return i},Zve=(e,t,{removals:n,adds:o})=>{const s=e.length;e.length=t.size;let i=0;for(let r=0;r<s;++r){const a=e[r];n.has(a)||(i!==r&&(a.sourceRowIndex=i,e[i]=a),++i)}for(const r of o)r.sourceRowIndex<0&&(r.sourceRowIndex=i,e[i++]=r);e.length=i},aB=e=>{const t=e.childrenAfterSort,n=e.sibling;if(n&&(n.childrenAfterSort=t),!!t)for(let o=0,s=t.length-1;o<=s;o++){const i=t[o],r=o===0,a=o===s;i.firstChild!==r&&(i.firstChild=r,i.dispatchRowEvent("firstChildChanged")),i.lastChild!==a&&(i.lastChild=a,i.dispatchRowEvent("lastChildChanged")),i.childIndex!==o&&(i.childIndex=o,i.dispatchRowEvent("childIndexChanged"))}},Xve=class extends He{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e){const t=this.beans.sortSvc.getSortOptions(),n=t.length>0&&!!e.changedRowNodes&&this.gos.get("deltaSort");this.sort(t,n,e.changedRowNodes,e.changedPath)}sort(e,t,n,o){const{gos:s,colModel:i,rowGroupColsSvc:r,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,u=s.get("groupMaintainOrder"),d=i.getCols().some(b=>b.isRowGroupActive()),h=r==null?void 0:r.columns,f=i.isPivotMode(),p=s.getCallback("postSortRows");let g=!1,v;const y=b=>{var _,x;const S=f&&b.leafGroup;let C=u&&d&&!b.leafGroup;C&&(v??(v=this.shouldSortContainsGroupCols(e)),C&&(C=!v));let E=null;if(C){let A=!1;if(h){const k=b.level+1;k<h.length&&(A=h[k].getSort()===null)}A||(E=eye(b))}else!e.length||S||(t&&n?E=Jve(a,b,n,o,e):E=a.doFullSort(b.childrenAfterAggFilter,e));if(E||(E=((_=b.childrenAfterAggFilter)==null?void 0:_.slice(0))??[]),g||(g=((x=b.childrenAfterSort)==null?void 0:x[0])!==E[0]),b.childrenAfterSort=E,aB(b),p){const A={nodes:b.childrenAfterSort};p(A)}};if(o==null||o.forEachChangedNodeDepthFirst(y),g&&s.get("groupHideOpenParents")){const b=c==null?void 0:c.getShowRowGroupCols();b!=null&&b.length&&l.refreshCells({columns:b,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(Cr(this.gos)){for(let n=0;n<t;++n){const o=e[n].column;if(o.isPrimary()&&o.isRowGroupActive())return!0}return!1}for(let n=0;n<t;++n)if(e[n].column.getColDef().showRowGroup)return!0;return!1}},Jve=(e,t,n,o,s)=>{const i=t.childrenAfterAggFilter,r=t.childrenAfterSort;if(!r)return e.doFullSort(i,s);const a=new Set,l=[],{updates:c,adds:u}=n;for(let h=0,f=i.length;h<f;++h){const p=i[h];c.has(p)||u.has(p)||o&&!o.canSkip(p)?l.push({currentPos:l.length,rowNode:p}):a.add(p)}const d=r.filter(h=>a.has(h)).map((h,f)=>({currentPos:f,rowNode:h}));return l.sort((h,f)=>e.compareRowNodes(s,h,f)),Qve(e,s,l,d)},Qve=(e,t,n,o)=>{let s=0,i=0;const r=n.length,a=o.length,l=new Array(r+a);let c=0;for(;s<r&&i<a;){const u=n[s],d=o[i];e.compareRowNodes(t,u,d)<0?(l[c++]=u.rowNode,++s):(l[c++]=d.rowNode,++i)}for(;s<r;)l[c++]=n[s++].rowNode;for(;i<a;)l[c++]=o[i++].rowNode;return l},eye=e=>{const t=e.childrenAfterSort,n=e.childrenAfterAggFilter,o=t==null?void 0:t.length,s=n==null?void 0:n.length;if(!o||!s)return null;const i=new Array(s),r=new Set;for(let l=0;l<s;++l)r.add(n[l]);let a=0;for(let l=0;l<o;++l){const c=t[l];r.delete(c)&&(i[a++]=c)}if(r.size===0&&a===o)return t;for(const l of r)i[a++]=l;return i.length=a,i},tye=class extends He{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.rowCountReady=!1,this.nodeManager=void 0,this.rowsToDisplay=[],this.rowDataUpdatedPending=!1,this.asyncTransactions=null,this.asyncTransactionsTimer=0,this.started=!1,this.refreshingModel=!1,this.rowNodesCountReady=!1,this.stages=[],this.stagesRefreshProps=new Map,this.onRowHeightChanged_debounced=Po(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new sl(e);this.rootNode=t,this.nodeManager=this.createBean(new zve(t));const n=this.refreshModel.bind(this,{step:"group"}),o=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:o,columnRowGroupChanged:n,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:n,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,n=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(o=>!!o);this.stages=n;for(let o=n.length-1;o>=0;--o)for(const s of n[o].refreshProps)t.set(s,o);this.addManagedPropertyListeners([...t.keys()],o=>{var i;const s=(i=o.changeSet)==null?void 0:i.properties;s&&this.onPropChange(s)}),this.addManagedPropertyListener("rowData",()=>this.onPropChange(["rowData"])),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.started=!0,this.rowNodesCountReady?this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0}):this.setInitialData()}setInitialData(){this.gos.get("rowData")&&this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,n,o){let s,i=!1;do{s=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(r,n),c=Math.min(a,o);for(let u=l;u<=c;u++){const d=this.getRow(u);if(d.rowHeightEstimated){const h=Qa(this.beans,d);d.setRowHeight(h.height),s=!0,i=!0}}s&&this.setRowTopAndRowIndex()}while(s);return i}onPropChange(e){const{nodeManager:t,gos:n,beans:o}=this,s=o.groupStage;if(!t)return;const i=new Set(e),r=s==null?void 0:s.onPropChange(i);let a;i.has("rowData")?a=n.get("rowData"):r&&(a=s==null?void 0:s.extractData()),a&&!Array.isArray(a)&&(a=null,qe(1));const l={step:"nothing",changedProps:i};a&&(!r&&!this.isEmpty()&&a.length>0&&n.exists("getRowId")&&!n.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!n.get("suppressAnimationFrame"),l.changedRowNodes=new ly,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const c=l.rowDataUpdated?"group":this.getRefreshedStage(e);c&&(l.step=c,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:n}=this,o=t.length;let s=o;for(let i=0,r=e.length;i<r&&s;++i)s=Math.min(s,n.get(e[i])??s);return s<o?t[s].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:n}=this,o=t.environment.getDefaultRowHeight();let s=0;const i=Ao(this.gos,"normal");for(let r=0,a=n.length;r<a;++r){const l=n[r],c=l.id;if(c!=null&&(e==null||e.add(c)),l.rowHeight==null){const u=Qa(t,l,i,o);l.setRowHeight(u.height,u.estimated)}l.setRowTop(s),l.setRowIndex(r),s+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const n=e.active,o=r=>{(r==null?void 0:r.id)!=null&&!t.has(r.id)&&r.clearRowTopAndRowIndex()},s=r=>{o(r),o(r.detailNode),o(r.sibling);const a=r.childrenAfterGroup;if(!r.hasChildren()||!a)return;const l=r.level==-1;if(!(n&&!l&&!r.expanded))for(let u=0,d=a.length;u<d;++u)s(a[u])},i=this.rootNode;i&&s(i)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){var s,i;const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const o=(s=e.sibling)!=null&&s.displayed?1:0;return(((i=e.childrenAfterSort)==null?void 0:i.length)??0)+o}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:n,rowsToDisplay:o}=this;if(!n||!o.length||o[0]===n)return e;const i=n.childrenAfterSort,r=l=>{let c=i[l];if(this.gos.get("groupHideOpenParents"))for(;c.expanded&&c.childrenAfterSort&&c.childrenAfterSort.length>0;)c=c.childrenAfterSort[0];return c.rowIndex},a=t.footerSvc;return a?a==null?void 0:a.getTopDisplayIndex(o,e,i,r):r(e)}getTopLevelIndexFromDisplayedIndex(e){var a;const{rootNode:t,rowsToDisplay:n}=this;if(!t||!n.length||n[0]===t)return e;let s=this.getRow(e);s.footer&&(s=s.sibling);let i=s.parent;for(;i&&i!==t;)s=i,i=s.parent;const r=((a=t.childrenAfterSort)==null?void 0:a.indexOf(s))??-1;return r>=0?r:e}getRowBounds(e){const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:od(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const o=t.length===0||t.some(s=>s.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:o,keepRenderedRows:!0,animate:od(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:od(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new op(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:n,rowDataUpdated:o}=e;return!(!t||n||!o||t.removals.size||t.adds.size)}refreshModel(e){var c,u;const{nodeManager:t,beans:n,eventSvc:o,started:s,refreshingModel:i}=this;if(!t)return;const r=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&r));if(s&&r&&o.dispatchEvent({type:"rowDataUpdated"}),!s||i||n.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=r);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,(c=n.masterDetailSvc)==null||c.refreshModel(e),r&&e.step!=="group"&&((u=n.colFilter)==null||u.refreshModel()),e.step){case"group":this.doGrouping(e);case"filter":this.doFilter(a);case"pivot":this.doPivot(a);case"aggregate":this.doAggregate(a);case"filter_aggregates":this.doFilterAggregates(a);case"sort":this.doSort(e.changedRowNodes,a);case"map":this.doRowsToDisplay()}const l=new Set;this.setRowTopAndRowIndex(l),this.clearRowTopAndRowIndex(a,l),this.refreshingModel=!1,o.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}isEmpty(){var e,t,n;return!((t=(e=this.rootNode)==null?void 0:e._leafs)!=null&&t.length)||!((n=this.beans.colModel)!=null&&n.ready)}isRowsToRender(){return this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let n=!1,o=!1;const s=[],i=Wf(this.gos);return this.forEachNodeAfterFilterAndSort(r=>{if(o)return;if(n&&(r===t||r===e)&&(o=!0,i&&r.group)){lB(s,r);return}if(!n){if(r!==t&&r!==e)return;n=!0,t===e&&(o=!0)}(!r.group||!i)&&s.push(r)}),s}getTopLevelNodes(){var e;return((e=this.rootNode)==null?void 0:e.childrenAfterGroup)??null}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,n=t.length;if(this.isEmpty()||n===0)return-1;let o=0,s=n-1;if(e<=0)return 0;if(t[s].rowTop<=e)return s;let r=-1,a=-1;for(;;){const l=Math.floor((o+s)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTop<e?o=l+1:c.rowTop>e&&(s=l-1),r===o&&a===s))return l;r=o,a=s}}isRowInPixel(e,t){const n=e.rowTop,o=n+e.rowHeight;return n<=t&&o>t}forEachLeafNode(e){var n;const t=(n=this.rootNode)==null?void 0:n._leafs;if(t)for(let o=0,s=t.length;o<s;++o)e(t[o],o)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let n=0,o=t.length;n<o;++n)e(t[n],n)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterSort)}forEachPivotNode(e,t,n){const{colModel:o,rowGroupColsSvc:s}=this.beans;if(!o.isPivotMode())return;if(!(s!=null&&s.columns.length)){e(this.rootNode,0);return}const i=n?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,r=>r.leafGroup?null:r[i])}depthFirstSearchRowNodes(e,t=!1,n=i=>i.childrenAfterGroup,o=this.rootNode,s=0){let i=s;if(!o)return i;const r=o===this.rootNode;if(r||e(o,i++),o.hasChildren()&&!o.footer){const a=n(o);if(a){const l=this.beans.footerSvc;i=(l==null?void 0:l.addTotalRows(i,o,e,t,r,"top"))??i;for(const c of a)i=this.depthFirstSearchRowNodes(e,t,n,c,i);return(l==null?void 0:l.addTotalRows(i,o,e,t,r,"bottom"))??i}}return i}doAggregate(e){var n;const t=this.rootNode;t&&((n=this.beans.aggStage)==null||n.execute({rowNode:t,changedPath:e}))}doFilterAggregates(e){const t=this.rootNode,n=this.beans.filterAggStage;if(n){n.execute({rowNode:t,changedPath:e});return}t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const n=this.beans.sortStage;if(n){n.execute({rowNode:this.rootNode,changedRowNodes:e,changedPath:t});return}t.forEachChangedNodeDepthFirst(o=>{o.childrenAfterSort=o.childrenAfterAggFilter.slice(0),aB(o)})}doGrouping(e){var s;const t=this.rootNode,n=this.beans.groupStage,o=n==null?void 0:n.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(o===void 0){const i=t._leafs;t.childrenAfterGroup=i,t.updateHasChildren();const r=t.sibling;r&&(r.childrenAfterGroup=i)}(o||e.rowDataUpdated)&&((s=this.beans.colFilter)==null||s.refreshModel()),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;if(t){t.execute({rowNode:this.rootNode,changedPath:e});return}e.forEachChangedNodeDepthFirst(n=>{n.childrenAfterFilter=n.childrenAfterGroup,T2(n)},!0)}doPivot(e){var t;(t=this.beans.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getRowNode(e){var o,s;const t=(o=this.nodeManager)==null?void 0:o.getRowNode(e);return typeof t=="object"?t:typeof e=="string"&&e.indexOf(dE)===0?(s=this.beans.groupStage)==null?void 0:s.getNode(e):void 0}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const n=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),n)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var a;const{nodeManager:e,beans:t,eventSvc:n,asyncTransactions:o}=this;if(!e)return;(a=t.valueCache)==null||a.onDataChanged();const s=[],i=[],r=new ly;for(const{rowDataTransaction:l,callback:c}of o??[]){this.rowNodesCountReady=!0;const u=e.updateRowData(l,r);s.push(u),c&&i.push(c.bind(null,u))}this.commitTransactions(r),i.length>0&&setTimeout(()=>{for(let l=0,c=i.length;l<c;l++)i[l]()},0),s.length>0&&n.dispatchEvent({type:"asyncTransactionsFlushed",results:s}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){var s;const t=this.nodeManager;if(!t)return null;(s=this.beans.valueCache)==null||s.onDataChanged(),this.rowNodesCountReady=!0;const n=new ly,o=t.updateRowData(e,n);return this.commitTransactions(n),o}commitTransactions(e){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:e,changedPath:this.createChangePath(!0)})}doRowsToDisplay(){const{beans:e,rootNode:t}=this,n=e.flattenStage;if(n){this.rowsToDisplay=n.execute({rowNode:t});return}const o=this.rootNode.childrenAfterSort??[];for(const s of o)s.setUiLevel(0);this.rowsToDisplay=o}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){const e=this.rootNode;if(!e)return;const t=this.resetRowHeightsForAllRowNodes();e.setRowHeight(e.rowHeight,!0);const n=e.sibling;n==null||n.setRowHeight(n.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const n=t.detailNode;n==null||n.setRowHeight(n.rowHeight,!0);const o=t.sibling;o==null||o.setRowHeight(o.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){var t;e.rowHeightChanged&&!((t=this.beans.rowAutoHeight)!=null&&t.active)&&this.resetRowHeights()}onGridReady(){this.started||this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},lB=(e,t)=>{const n=t.childrenAfterGroup;if(n)for(let o=0,s=n.length;o<s;++o){const i=n[o];i.data&&e.push(i),i.group&&lB(e,i)}};function nye(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function oye(e,t){const n=cl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function sye(e){var t;return((t=cl(e))==null?void 0:t.isEmpty())??!0}function iye(e,t){var n;(n=cl(e))==null||n.forEachLeafNode(t)}function rye(e,t){var n;(n=cl(e))==null||n.forEachNodeAfterFilter(t)}function aye(e,t){var n;(n=cl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function lye(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=cl(e))==null?void 0:n.updateRowData(t)})}function cye(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var o;return(o=cl(e))==null?void 0:o.batchUpdateRowData(t,n)})}function uye(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=cl(e))==null?void 0:t.flushAsyncTransactions()})}function dye(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var cB={moduleName:"ClientSideRowModel",version:ut,rowModels:["clientSide"],beans:[tye,Xve],dependsOn:[y2]},hye={moduleName:"ClientSideRowModelApi",version:ut,apiFunctions:{onGroupExpandedOrCollapsed:nye,refreshClientSideRowModel:oye,isRowDataEmpty:sye,forEachLeafNode:iye,forEachNodeAfterFilter:rye,forEachNodeAfterFilterAndSort:aye,applyTransaction:lye,applyTransactionAsync:cye,flushAsyncTransactions:uye,getBestCostNodeSelection:dye,resetRowHeights:iB,onRowHeightChanged:sB},dependsOn:[$ve,Hve]},fye=class extends He{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel}serialize(e,t={}){const{allColumns:n,columnKeys:o,skipRowGroups:s,exportRowNumbers:i}=t,r=this.getColumnsToExport({allColumns:n,skipRowGroups:s,columnKeys:o,exportRowNumbers:i});return[this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,n,o){var p;const s=t.shouldRowBeSkipped||(()=>!1),r=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!r,l=this.colModel.isPivotMode()?o.leafGroup:!o.group,c=!!o.footer,u=o.allChildrenCount===1&&((p=o.childrenAfterGroup)==null?void 0:p.length)===1&&gse(this.gos,o);if(!l&&!c&&(t.skipRowGroups||u||a)||t.onlySelected&&!o.isSelected()||t.skipPinnedTop&&o.rowPinned==="top"||t.skipPinnedBottom&&o.rowPinned==="bottom"||o.stub||o.level===-1&&!l&&!c||s(It(this.gos,{node:o})))return;const f=e.onNewBodyRow(o);if(n.forEach((g,v)=>{f.onColumn(g,v,o)}),t.getCustomContentBelowRow){const g=t.getCustomContentBelowRow(It(this.gos,{node:o}));g&&e.addCustomContent(g)}}appendContent(e){return t=>{const n=e.appendContent;return n&&t.addCustomContent(n),t}}prependContent(e){return t=>{const n=e.prependContent;return n&&t.addCustomContent(n),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return n=>{if(!e.skipColumnGroupHeaders){const o=new tL,{colGroupSvc:s}=this.beans,i=s?s.createColumnGroups({columns:t,idCreator:o,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(i,n,e.processGroupHeaderCallback)}return n}}exportHeaders(e,t){return n=>{if(!e.skipColumnHeaders){const o=n.onNewHeaderRow();t.forEach((s,i)=>{o.onColumn(s,i,void 0)})}return n}}processPinnedTopRows(e,t){return n=>{var s,i;const o=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="top").sort((r,a)=>r.rowIndex-a.rowIndex).map(r=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedTopRow(r.rowIndex)}).forEach(o):(s=this.pinnedRowModel)!=null&&s.isManual()||(i=this.pinnedRowModel)==null||i.forEachPinnedRow("top",o),n}}processRows(e,t){return n=>{var c;const o=this.rowModel,s=no(this.gos),i=nd(this.gos),r=!s&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(u=>u.rowPinned==null).sort((u,d)=>u.rowIndex-d.rowIndex).map(u=>o.getRow(u.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())s?o.forEachPivotNode(a,!0,l==="filteredAndSorted"):i?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);else if(e.onlySelectedAllPages||r){const u=((c=this.beans.selectionSvc)==null?void 0:c.getSelectedNodes())??[];this.replicateSortedOrder(u),u.forEach(a)}else l==="all"?o.forEachNode(a):s||i?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);return n}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:n}=this.beans;if(!t||!n)return;const o=t.getSortOptions(),s=(i,r)=>{var a,l;return i.rowIndex!=null&&r.rowIndex!=null?i.rowIndex-r.rowIndex:i.level===r.level?((a=i.parent)==null?void 0:a.id)===((l=r.parent)==null?void 0:l.id)?n.compareRowNodes(o,{rowNode:i,currentPos:i.rowIndex??-1},{rowNode:r,currentPos:r.rowIndex??-1}):s(i.parent,r.parent):i.level>r.level?s(i.parent,r):s(i,r.parent)};e.sort(s)}processPinnedBottomRows(e,t){return n=>{var s,i;const o=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="bottom").sort((r,a)=>r.rowIndex-a.rowIndex).map(r=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedBottomRow(r.rowIndex)}).forEach(o):(s=this.pinnedRowModel)!=null&&s.isManual()||(i=this.pinnedRowModel)==null||i.forEachPinnedRow("bottom",o),n}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:n=!1,exportRowNumbers:o=!1,columnKeys:s}=e,{colModel:i,gos:r,visibleCols:a}=this,l=i.isPivotMode(),c=h=>la(h)?!1:!ca(h)||o;if(s!=null&&s.length)return i.getColsForKeys(s).filter(c);const u=r.get("treeData");let d=[];return t&&!l?d=i.getCols():d=a.allCols,d=d.filter(h=>c(h)&&(n&&!u?!L0(h):!0)),d}recursivelyAddHeaderGroups(e,t,n){const o=[];for(const s of e){const i=s;if(i.getChildren)for(const r of i.getChildren()??[])o.push(r)}e.length>0&&oo(e[0])&&this.doAddHeaderHeader(t,e,n),o&&o.length>0&&this.recursivelyAddHeaderGroups(o,t,n)}doAddHeaderHeader(e,t,n){const o=e.onNewHeaderGroupingRow();let s=0;for(const i of t){const r=i;let a;n?a=n(It(this.gos,{columnGroup:r})):a=this.beans.colNames.getDisplayNameForColumnGroup(r,"header");const c=(r.isExpandable()?r.getLeafColumns():[]).reduce((u,d,h,f)=>{let p=Rn(u);return d.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],u.push(p)):p&&p[1]==null&&(p[1]=h-1),h===f.length-1&&p&&p[1]==null&&(p[1]=h),u},[]);o.onColumn(r,a||"",s++,r.getLeafColumns().length-1,c)}}},pye={moduleName:"SharedExport",version:ut,beans:[fye]},uB=`\r
249
249
  `,gye=class extends Wpe{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:n}=e;this.suppressQuotes=t,this.columnSeparator=n}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,uB),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,o){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,n){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(o.valueFormatted??o.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(qe(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=uB),this.isFirstLine=!1}},mye=class extends Upe{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){qe(51);return}const t=this.getMergedParams(e),n=this.getData(t),o=new Blob(["\uFEFF",n],{type:"text/plain"}),s=typeof t.fileName=="function"?t.fileName(It(this.gos,{})):t.fileName;zpe(this.getFileName(s),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:o,valueSvc:s,gos:i}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new gye({colModel:t,colNames:n,valueSvc:s,gos:i,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function vye(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function yye(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var wye={moduleName:"CsvExport",version:ut,beans:[mye],apiFunctions:{getDataAsCsv:vye,exportDataAsCsv:yye},dependsOn:[pye]},Cye=class extends He{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:o,rowNodes:s}=this;for(let i=0;i<e;i++){const r=n+i,a=new sl(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),s.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:o}}}setDataAndId(e,t,n){ht(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Nn(this.params.datasource.getRows)){qe(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:o,filterModel:s},gos:i}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:o,filterModel:s,context:It(i,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((o,s)=>{this.startRow+s<n&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((s,i)=>{const r=e.rowData?e.rowData[i]:void 0;!s.id&&s.alreadyRendered&&r&&(t[i]=new sl(n),t[i].setRowIndex(s.rowIndex),t[i].setRowTop(s.rowTop),t[i].setRowHeight(s.rowHeight),s.clearRowTopAndRowIndex()),this.setDataAndId(t[i],r,this.startRow+i)});const o=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,o)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},bye=2,Sye=class extends He{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let o=this.blocks[n];if(!o){if(t)return;o=this.createBlock(n)}return o.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new Cye(e,this,t));return this.blocks[n.id]=n,this.blockCount++,this.purgeBlocksIfNeeded(n),t.rowNodeBlockLoader.addBlock(n),n}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(Ja(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),n=(r,a)=>a.lastAccessed-r.lastAccessed;t.sort(n);const o=this.params.maxBlocksInCache>0,s=o?this.params.maxBlocksInCache-1:null,i=bye-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=i,c=o?a>=s:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:o}=e;return t.rowIndex>=n&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:o}=this.params,i=(e.id+1)*n+o;this.rowCount<i&&(this.rowCount=i)}}setRowCount(e,t){this.rowCount=e,ht(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,o)=>n.id-o.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let o=-1,s=!1;const i={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(s&&o+1!==l.id){r=!0;continue}o=l.id,l.forEachNode(c=>{const u=c===e||c===t;(s||u)&&n.push(c),u&&(s=!s)},i,this.rowCount)}return r||s?[]:n}},Eye=class extends He{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new sl(e);this.rootNode=t,t.level=-1,this.rowHeight=hc(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=hc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Ff(this.cacheParams.sortModel,((t=this.beans.sortSvc)==null?void 0:t.getSortModel())??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){var n;return((n=this.infiniteCache)==null?void 0:n.getRowNodesInRange(e,t))??[]}reset(){var n;if(!this.datasource)return;sd(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:o,eventSvc:s,gos:i}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:o,initialRowCount:i.get("infiniteInitialRowCount"),maxBlocksInCache:i.get("maxBlocksInCache"),rowHeight:hc(e),overflowSize:i.get("cacheOverflowSize"),blockSize:i.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new Sye(this.cacheParams)),s.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function _ye(e){var t;(t=my(e))==null||t.refreshCache()}function Rye(e){var t;(t=my(e))==null||t.purgeCache()}function Dye(e){var t;return(t=my(e))==null?void 0:t.getRowCount()}var Tye=class extends He{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=mse(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Po(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Vi(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){Ja(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:o}=t.getBlockStateJson();e[n]=o}),e}printCacheStatus(){Ja(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},xye={moduleName:"InfiniteRowModelCore",version:ut,rowModels:["infinite"],beans:[Eye,Tye]},Fye={moduleName:"InfiniteRowModel",version:ut,apiFunctions:{refreshInfiniteCache:_ye,purgeInfiniteCache:Rye,getInfiniteRowCount:Dye},dependsOn:[xye,Gve]},Iye="↑",Pye="↓",Aye={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},kye=class extends yn{constructor(){super(Aye),this.eValue=dt,this.eDelta=dt,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),o=e.formatValue(n),s=ht(o)?o:n,i=t>=0,r=this.eDelta;i?r.textContent=Iye+s:r.textContent=Pye+s,r.classList.toggle("ag-value-change-delta-up",i),r.classList.toggle("ag-value-change-delta-down",!i)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Io(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:o}=e,{eValue:s,lastValue:i,beans:r}=this;if(n===i||(ht(o)?s.textContent=o:ht(n)?s.textContent=n:Io(s),(c=r.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=i&&typeof i=="object"&&"toNumber"in i?i.toNumber():i;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return i&&s.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},Oye=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",Mye={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},Nye=class extends yn{constructor(){super(Mye),this.eCurrent=dt,this.refreshCount=0,this.registerCSS(Oye)}init(e){this.refresh(e,!0)}addSlideAnimation(){var s;this.refreshCount++;const e=this.refreshCount;(s=this.ePrevious)==null||s.remove();const{beans:t,eCurrent:n}=this,o=so({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=n.textContent,this.getGui().insertBefore(o,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var i;e===this.refreshCount&&((i=this.ePrevious)==null||i.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let n=e.value;if(Nn(n)&&(n=""),n===this.lastValue||(s=this.beans.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const o=this.eCurrent;return ht(e.valueFormatted)?o.textContent=e.valueFormatted:ht(e.value)?o.textContent=n:Io(o),!0}},Lye=class extends He{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),o=this.beans.gos.get("cellFadeDuration")){const s=this.animations[t];s.delete(e);const i=Date.now(),r=i+n,a=i+n+o,l={phase:"flash",flashEndTime:r,fadeEndTime:a};s.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&r+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=r)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const o=this.animations[n],s=`ag-cell-${n}`,i=`${s}-animation`;for(const[r,a]of o){if(!r.isAlive()||!r.comp){o.delete(r);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=r;switch(l){case"flash":f.toggleCss(s,!1),f.toggleCss(i,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(s,!1),f.toggleCss(i,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),o.delete(r);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=Nce(e.cellPosition);t.cells[n]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t==null?void 0:t.flashDuration,t==null?void 0:t.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function Vye(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(o,t)})}var Bye={moduleName:"HighlightChanges",version:ut,beans:[Lye],userComponents:{agAnimateShowChangeCellRenderer:kye,agAnimateSlideCellRenderer:Nye},apiFunctions:{flashCells:Vye}};function $ye(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Hye(e,t,n){var o;return(o=e.stateSvc)==null?void 0:o.setState(t,n)}function dB(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=Gye(e)),e.version=ut,e}function Gye(e){return e.cellSelection=Uye(e,"rangeSelection"),e}function Uye(e,t){if(e&&typeof e=="object")return e[t]}var Wye=class extends He{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Po(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Po(this,()=>{this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(this.updateCachedState("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowGroupExpansion",void 0)):(this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("ssrmRowGroupExpansion",void 0))},0),this.onRowSelectedDebounced=Po(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:n}=this.beans;this.isClientSideRowModel=no(e);const o=dB(e.get("initialState")??{}),s=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const i=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>i(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&(n==null||n.hideColumns("columnState"));const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(r(),i(()=>{this.setupStateOnColumnsInitialised(o,!!s),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),i(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l==null||l(),i(()=>this.setupStateOnFirstDataRendered(o))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=dB(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const o="api",s=t?new Set(t):void 0;this.setGridReadyState(n,o,s),this.setColumnsInitialisedState(n,o,!!s,s),this.setRowCountState(n,o,s),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,o,s),this.stopSuppressEvents(o)})}setGridReadyState(e,t,n){var o,s;t==="api"&&!(n!=null&&n.has("sideBar"))&&((s=(o=this.beans.sideBar)==null?void 0:o.comp)==null||s.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,o){this.setColumnState(e,t,n,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:o,rowGroupExpansion:s,ssrmRowGroupExpansion:i,rowSelection:r,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",s)&&this.setRowGroupExpansionState(i,s,t),l("rowSelection",r)&&this.setRowSelectionState(r,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},o=()=>t("filter",this.getFilterState()),{gos:s,colFilter:i}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(s.get("groupDefaultExpanded")!==0||s.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&t("pagination",this.getPaginationState())}}),i&&this.addManagedListeners(i,{filterStateChanged:o})}setFirstDataRenderedState(e,t,n){const{scroll:o,cellSelection:s,focusedCell:i,columnOrder:r,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",i)&&this.setFocusedCellState(i),l("cellSelection",s)&&this.setCellSelectionState(s),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(r!=null&&r.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:o=>{if(o.finished){const s=this.getRangeSelectionState();t("rangeSelection",s),t("cellSelection",s)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return $pe(Bv(e),e.colModel.isPivotMode())}setColumnState(e,t,n,o){const{sort:s,rowGroup:i,aggregation:r,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(D,F)=>{const P=!(o!=null&&o.has(D))&&!!(F||t==="api");return h||(h=P),P},p={},g=D=>{let F=p[D];return F||(F={colId:D},p[D]=F,F)},v={},y=f("sort",s);y&&(s==null||s.sortModel.forEach(({colId:D,sort:F},P)=>{const $=g(D);$.sort=F,$.sortIndex=P})),(y||!n)&&(v.sort=null,v.sortIndex=null);const b=f("rowGroup",i);b&&(i==null||i.groupColIds.forEach((D,F)=>{const P=g(D);P.rowGroup=!0,P.rowGroupIndex=F})),(b||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const S=f("aggregation",r);S&&(r==null||r.aggregationModel.forEach(({colId:D,aggFunc:F})=>{g(D).aggFunc=F})),(S||!n)&&(v.aggFunc=null);const C=f("pivot",a);C&&(a==null||a.pivotColIds.forEach((D,F)=>{const P=g(D);P.pivot=!0,P.pivotIndex=F}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(C||!n)&&(v.pivot=null,v.pivotIndex=null);const E=f("columnPinning",l);if(E){for(const D of(l==null?void 0:l.leftColIds)??[])g(D).pinned="left";for(const D of(l==null?void 0:l.rightColIds)??[])g(D).pinned="right"}(E||!n)&&(v.pinned=null);const _=f("columnVisibility",c);if(_)for(const D of(c==null?void 0:c.hiddenColIds)??[])g(D).hide=!0;(_||!n)&&(v.hide=null);const x=f("columnSizing",u);if(x)for(const{colId:D,flex:F,width:P}of(u==null?void 0:u.columnSizingModel)??[]){const $=g(D);$.flex=F??null,$.width=P}(x||!n)&&(v.flex=null);const A=d==null?void 0:d.orderedColIds,k=!!(A!=null&&A.length)&&!(o!=null&&o.has("columnOrder")),T=k?A.map(D=>g(D)):Object.values(p);(T.length||h)&&(this.columnStates=T,Bi(this.beans,{state:T,applyOrder:k,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const s=this.beans,{pivotResultCols:i,colGroupSvc:r}=s;if(i!=null&&i.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)i.getPivotResultCol(l.colId)&&a.push(l);Bi(s,{state:a,applyOrder:e},t)}o&&(r==null||r.setColumnGroupState(o,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Hpe(t)}setColumnGroupState(e,t,n){var a;const o=this.beans.colGroupSvc;if(!o||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const s=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),r=o.getColumnGroupState().map(({groupId:l})=>{const c=s.has(l);return c&&s.delete(l),{groupId:l,open:c}});for(const l of s)r.push({groupId:l,open:!0});r.length&&(this.columnGroupStates=r),o.setColumnGroupState(r,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),o=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||o||n?{filterModel:t,columnFilterState:n,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:o,advancedFilterModel:s}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||o!==void 0)&&(t==null||t.setFilterState(n??null,o??null,"columnFilter")),s!==void 0&&(t==null||t.setAdvFilterModel(s??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:o,type:s,startRow:i,endRow:r,columns:a,startColumn:l}=n;return{id:o,type:s,startRow:i,endRow:r,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:o,visibleCols:s}=this.beans;if(!ra(t)||!n)return;const i=[];for(const r of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of r.colIds){const u=o.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=o.getCol(r.startColId);if(!l){const c=s.allCols,u=new Set(a);l=c.find(d=>u.has(d))}i.push({...r,columns:a,startColumn:l})}n.setCellRanges(i)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:s,animationFrameSvc:i,ctrlsSvc:r}=this.beans;o.wrapIncoming(()=>{var a;r.get("center").setCenterViewportScrollLeft(n),(a=r.getScrollFeature())==null||a.setVerticalScrollPosition(t),s.redraw({afterScroll:!0}),i==null||i.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:s,rowPinned:i}=e;t.setFocusedCell({column:n.getCol(o),rowIndex:s,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!o))return{page:n,pageSize:o}}setPaginationState(e,t){const{pagination:n,gos:o}=this.beans;if(!n)return;const{pageSize:s,page:i}=e??{page:0,pageSize:o.get("paginationPageSize")},r=t==="gridInitializing";s&&!o.get("paginationAutoPageSize")&&n.setPageSize(s,r?"initialState":"pageSizeSelector"),typeof i=="number"&&(r?n.setPage(i):n.goToPage(i))}getRowSelectionState(){var o;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((o=t==null?void 0:t.toggledNodes)!=null&&o.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const o=this.beans.expansionSvc;if(!o)return;const s=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(s,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const o=this.cachedState;for(const s of Object.keys(t)){const i=t[s];Ff(i,o[s])||(n=!0)}this.cachedState={...o,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Ff(t,n)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){var e;this.suppressEvents=!0,(e=this.beans.colAnimation)==null||e.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{var t;this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&((t=this.beans.colAnimation)==null||t.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},zye={moduleName:"GridState",version:ut,beans:[Wye],apiFunctions:{getState:$ye,setState:Hye}};function jye(e){return e.rowModel.isLastRowIndexKnown()}function Kye(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function qye(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function Yye(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function Zye(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function Xye(e){var t;(t=e.pagination)==null||t.goToNextPage()}function Jye(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function Qye(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function ewe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function twe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var nwe=class extends He{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const o=Math.max(hc(t),1),s=Math.floor(e/o);t.pagination.setPageSize(s,"autoCalculated")};this.isBodyRendered?Po(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},dp="paginationPageSizeSelector",owe={tag:"span",cls:"ag-paging-page-size"},swe=class extends yn{constructor(){super(owe),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(dp,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.pagination.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){Io(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(dp)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const s=this.gos.exists("paginationPageSize"),i=this.gos.get(dp)!==!0;qe(94,{pageSizeSet:s,pageSizesSet:i,pageSizeOptions:e,paginationPageSizeOption:t}),i||qe(95,{paginationPageSizeOption:t,paginationPageSizeSelector:dp}),e.unshift("")}const o=String(n?"":t);this.selectPageSizeComp?(tl(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),o=n("pageSizeSelectorLabel","Page Size:"),s=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new iE).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(s).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(dp);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,o)=>n-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},iwe={selector:"AG-PAGE-SIZE-SELECTOR",component:swe},rwe=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}",awe=class extends SV{constructor(){super(),this.btFirst=dt,this.btPrevious=dt,this.btNext=dt,this.btLast=dt,this.lbRecordCount=dt,this.lbFirstRowOnPage=dt,this.lbLastRowOnPage=dt,this.lbCurrent=dt,this.lbTotal=dt,this.pageSizeComp=dt,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(rwe)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[iwe]);const{btFirst:t,btPrevious:n,btNext:o,btLast:s}=this;this.activateTabIndex([t,n,o,s]),t.insertAdjacentElement("afterbegin",ci(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",ci(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",ci(e?"previous":"next",this.beans)),s.insertAdjacentElement("afterbegin",ci(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:i=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(i):nle(this.beans,i),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:o=>{(o.key===Ae.ENTER||o.key===Ae.SPACE)&&(o.preventDefault(),n())}})}tle(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):Gpe(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),s=e===n-1;this.nextButtonDisabled=s||o,this.lastButtonDisabled=!t||o||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){moe(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),o=e?n:null,s=this.pagination.getCurrentPage(),i=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=i*s+1,a=r+i-1,e&&a>o&&(a=o));const l=r+i-1,c=!e&&n<l,u=this.formatNumber(r);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?s+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,y;if(e)v=this.formatNumber(t),y=this.formatNumber(o);else{const b=h("more","more");v=b,y=b}this.lbTotal.textContent=v,this.lbRecordCount.textContent=y,this.announceAriaStatus(u,d,y,g,v)}announceAriaStatus(e,t,n,o,s){var d,h;const i=this.getLocaleTextFunc(),r=i("page","Page"),a=i("to","to"),l=i("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${r} ${o} ${l} ${s}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},lwe={selector:"AG-PAGINATION",component:awe},cwe=class extends He{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return lwe}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,o;if(!this.active)return;let t=e;this.paginateChildRows||(t=((o=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:o.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ht(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ht(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ht(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ht(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,o=t-1;this.totalPages=Math.floor(o/n)+1,this.adjustCurrentPageIfInvalid();const s=this.currentPage,i=n*s;let r=n*(s+1)-1;if(r>o&&(r=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(i),r===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(r+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>o&&(this.bottomDisplayedRowIndex=o)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:o,keepRenderedRows:t})}},uwe={moduleName:"Pagination",version:ut,beans:[cwe,nwe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:jye,paginationGetPageSize:Kye,paginationGetCurrentPage:qye,paginationGetTotalPages:Yye,paginationGetRowCount:Zye,paginationGoToNextPage:Xye,paginationGoToPreviousPage:Jye,paginationGoToFirstPage:Qye,paginationGoToLastPage:ewe,paginationGoToPage:twe},dependsOn:[vy]};function dwe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function hB(e,t,n,o,s){t&&(o&&t.parent&&t.parent.level!==-1&&hB(e,t.parent,n,o,s),t.setExpanded(n,void 0,s))}function hwe(e,t){return e.rowModel.getRowNode(t)}function fwe(e,t,n,o){e.rowRenderer.addRenderedRowListener(t,n,o)}function pwe(e){return e.rowRenderer.getRenderedNodes()}function gwe(e,t,n){e.rowModel.forEachNode(t,n)}function mwe(e){return e.rowRenderer.firstRenderedRow}function vwe(e){return e.rowRenderer.lastRenderedRow}function ywe(e,t){return e.rowModel.getRow(t)}function wwe(e){return e.rowModel.getRowCount()}var Cwe={moduleName:"RowApi",version:ut,apiFunctions:{redrawRows:dwe,setRowNodeExpanded:hB,getRowNode:hwe,addRenderedRowListener:fwe,getRenderedNodes:pwe,forEachNode:gwe,getFirstDisplayedRowIndex:mwe,getLastDisplayedRowIndex:vwe,getDisplayedRowAtIndex:ywe,getDisplayedRowCount:wwe}},bwe={moduleName:"ScrollApi",version:ut,apiFunctions:{getVerticalPixelRange:Ome,getHorizontalPixelRange:Mme,ensureColumnVisible:K2,ensureIndexVisible:q2,ensureNodeVisible:Nme}};function Swe(e,t,n){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,s=`aria-${t}`;n===null?o.removeAttribute(s):o.setAttribute(s,n)}function Ewe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function _we(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function Rwe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function Dwe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function Twe(e){return{rowHeight:hc(e),headerHeight:Jf(e)}}function xwe(e,t={}){var i;const n=[];for(const r of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=r.getCellRenderer();a!=null&&n.push(Yf(a))}if((i=t.columns)!=null&&i.length)return n;const o=[],s=n_(t.rowNodes);for(const r of e.rowRenderer.getAllRowCtrls()){if(s&&!o_(r.rowNode,s)||!r.isFullWidth())continue;const a=r.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&o.push(Yf(c))}}return[...o,...n]}var Fwe={moduleName:"RenderApi",version:ut,apiFunctions:{setGridAriaProperty:Swe,refreshCells:Ewe,refreshHeader:_we,isAnimationFrameQueueEmpty:Rwe,flushAllAnimationFrames:Dwe,getSizesForCurrentTheme:Twe,getCellRendererInstances:xwe}};function Iwe(e,t){var n,o;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(o=e.colAutosize)==null||o.sizeColumnsToFitGridBody(t)}function fB({colAutosize:e,visibleCols:t},n,o){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:o,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function Pwe(e,t){var n;t&&typeof t=="object"?fB(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var Awe=class extends He{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let o=!1;const s=t.type;if(s==="fitGridWidth"||s==="fitProvidedWidth")o=!0;else if(s==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const i=e.get("rowData");o=i!=null&&i.length>0&&no(e)}o&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(s))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(o=>{var c;const s=u=>ad(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return s(o);const i=pB(this.beans),r=u=>n.leftCols.some(d=>jf(d,u)),a=u=>n.rightCols.some(d=>jf(d,u)),l=e.colKeys.filter(u=>!la(u)&&!ca(u)&&!r(u)&&!a(u));this.sizeColumnsToFit(i,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),s(o)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:o,skipHeader:s,skipHeaderGroups:i,stopAtGroup:r,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let y=-1;const b=Object.fromEntries(c.map(({colId:E,..._})=>[E,_])),S=s??this.gos.get("skipHeaderOnAutoSize"),C=i??S;for(;y!==0;){y=0;const E=[];for(const _ of o){if(!_||Fse(_))continue;const x=f.getCol(_);if(!x||v.has(x))continue;const A=p.getPreferredWidthForColumn(x,S);if(A>0){const k=b[x.colId]??{};k.minWidth??(k.minWidth=l),k.maxWidth??(k.maxWidth=a);const T=kwe(x,A,k);x.setActualWidth(T,u),v.add(x),y++}E.push(x)}E.length&&g.refresh(u)}C||this.autoSizeColumnGroupsByColumns(o,u,r),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:o,ctrlsSvc:s}=this.beans,i=new Set,r=o.getColsForKeys(e);for(const l of r){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||i.add(c),c=c.getParent()}let a;for(const l of i){for(const c of s.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",o);const s=new Sc(e);return s.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),s.destroy()}}addColumnGroupResize(e,t,n){const o=this.gos.get("skipHeaderOnAutoSize"),s=()=>{const i=[],r=t.getDisplayedLeafColumns();for(const a of r)a.getColDef().suppressAutoSize||i.push(a.getColId());i.length>0&&this.autoSizeCols({colKeys:i,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",s),()=>e.removeEventListener("dblclick",s)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=pB(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):qe(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,o){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,o));return}const s={};for(const{key:v,...y}of(o==null?void 0:o.columnLimits)??[])s[typeof v=="string"?v:v.getColId()]=y;const i=this.beans.visibleCols.allCols;if(e<=0||!i.length)return;const r=aa(i);if(o!=null&&o.onlyScaleUp&&r>e||e===r&&i.every(y=>{if(y.colDef.suppressSizeToFit)return!0;const b=s==null?void 0:s[y.getId()],S=(b==null?void 0:b.minWidth)??(o==null?void 0:o.defaultMinWidth),C=(b==null?void 0:b.maxWidth)??(o==null?void 0:o.defaultMaxWidth),E=y.getActualWidth();return(S==null||E>=S)&&(C==null||E<=C)}))return;const l=[],c=[];for(const v of i){const y=((p=o==null?void 0:o.colKeys)==null?void 0:p.some(b=>jf(v,b)))??!0;v.getColDef().suppressSizeToFit||!y?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{Vi(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const y=s==null?void 0:s[v.getId()],b=(y==null?void 0:y.minWidth)??(o==null?void 0:o.defaultMinWidth),S=(y==null?void 0:y.maxWidth)??(o==null?void 0:o.defaultMaxWidth),C=v.getActualWidth();typeof b=="number"&&C<b?v.setActualWidth(b,t,!0):typeof S=="number"&&C>S&&v.setActualWidth(S,t,!0)}for(;!d;){d=!0;const v=e-aa(c);if(v<=0)for(const y of l){const b=((g=s==null?void 0:s[y.getId()])==null?void 0:g.minWidth)??(o==null?void 0:o.defaultMinWidth)??y.minWidth;y.setActualWidth(b,t,!0)}else{const y=v/aa(l);let b=v;for(let S=l.length-1;S>=0;S--){const C=l[S],E=s==null?void 0:s[C.getId()],_=(E==null?void 0:E.minWidth)??(o==null?void 0:o.defaultMinWidth),x=(E==null?void 0:E.maxWidth)??(o==null?void 0:o.defaultMaxWidth),A=C.getMinWidth(),k=C.getMaxWidth(),T=typeof _=="number"&&_>A?_:A,D=typeof x=="number"&&x<k?x:k;let F=Math.round(C.getActualWidth()*y);F<T?(F=T,h(C),d=!1):F>D?(F=D,h(C),d=!1):S===0&&(F=b),C.setActualWidth(F,t,!0),b-=F}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&ad(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=n.type;if(o==="fitGridWidth"){const{columnLimits:s,defaultMinWidth:i,defaultMaxWidth:r}=n,a=s==null?void 0:s.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:i,defaultMaxWidth:r,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var o;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(o=this.beans.colDelayRenderSvc)==null||o.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function kwe(e,t,n={}){const o=n.minWidth??e.getMinWidth();t<o&&(t=o);const s=n.maxWidth??e.getMaxWidth();return t>s&&(t=s),t}function pB({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),s=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return Of(n.eGridBody)-s}var Owe={moduleName:"ColumnAutoSize",version:ut,beans:[Awe],apiFunctions:{sizeColumnsToFit:Iwe,autoSizeColumns:fB,autoSizeAllColumns:Pwe},dependsOn:[BV]},Mwe=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function Nwe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function Lwe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function Vwe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function Bwe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function $we(e,t,n){var o;return(o=e.pinnedRowModel)==null?void 0:o.forEachPinnedRow(t,n)}var Hwe={moduleName:"PinnedRow",version:ut,beans:[Vle],css:[Mwe],apiFunctions:{getPinnedTopRowCount:Nwe,getPinnedBottomRowCount:Lwe,getPinnedTopRow:Vwe,getPinnedBottomRow:Bwe,forEachPinnedRow:$we},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},Gwe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const o of this.spannedNodes)o!==this.lastNode&&(t+=o.rowHeight);return e-t}},Uwe=class extends He{constructor(e){super(),this.column=e}buildCache(e){var S;const{column:t,beans:{gos:n,pinnedRowModel:o,rowModel:s,valueSvc:i,pagination:r}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const y=(C,E)=>{p=C,g=null,v=E},b=C=>{const E=!C.isExpandable()&&!C.group&&!C.detail&&(u?!u({rowNode:C}):!0);if(C.rowIndex==null||!E){y(null,null);return}if(p==null||C.level!==p.level||C.footer||g&&C.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){y(C,i.getValue(t,C));return}const _=i.getValue(t,C);if(f){const x=It(n,{valueA:v,nodeA:p,valueB:_,nodeB:C,column:t,colDef:a});if(!h(x)){y(C,_);return}}else if(d?!d(v,_):v!==_){y(C,_);return}if(!g){const x=l==null?void 0:l.get(p);(x==null?void 0:x.firstNode)===p?(x.reset(),g=x):g=new Gwe(t,p),c.set(p,g)}g.addSpannedNode(C),c.set(C,g)};switch(e){case"center":(S=s.forEachDisplayedNode)==null||S.call(s,C=>{(!r||r.isRowInPage(C.rowIndex))&&b(C)}),this.centerValueNodeMap=c;break;case"top":o==null||o.forEachPinnedRow("top",b),this.topValueNodeMap=c;break;case"bottom":o==null||o.forEachPinnedRow("bottom",b),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},Wwe=class extends He{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Po(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Po(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const n=this.createManagedBean(new Uwe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,o=e.column,s=e.rowIndex,i=this.spanningColumns.get(o);if(!i)return;let r;switch(e.rowPinned){case"top":r=t==null?void 0:t.getPinnedTopRow(s);break;case"bottom":r=t==null?void 0:t.getPinnedBottomRow(s);break;default:r=n.getRow(s)}if(r)return i.getCellSpan(r)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,o]of this.spanningColumns)if(o.isCellSpanning(e)){const s=o.getCellSpan(e);t(n,s)}}destroy(){super.destroy(),this.spanningColumns.clear()}},zwe=class extends wd{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,o,s,i,r){this.eWrapper=n,super.setComp(e,t,n,o,s,i,r),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||wv(e,t.rowIndex)}setAriaRowSpan(){boe(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(iy(t)){this.focusedCellPosition=void 0;return}const n=this.isCellFocused();n||(this.focusedCellPosition=void 0),e&&n&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},jwe=class extends gy{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new zwe(t,this,this.beans)}isCorrectCtrlForSpan(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},Kwe=class extends He{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),o=n.size,s=this.getAllRelevantRowControls(e),i=new Map;let r=!1;for(const l of s)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(i.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){i.set(u.firstNode,d),n.delete(u.firstNode);return}r=!0;const h=new jwe(u.firstNode,this.beans,!1,!1,!1);i.set(u.firstNode,h)}));this.setCtrlsMap(e,i);const a=i.size===o;if(!(!r&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const o=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(o)return o.getAllCellCtrls().find(s=>s.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},qwe={moduleName:"CellSpan",version:ut,beans:[Wwe,Kwe]},Ywe=class extends He{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,n=e.colDef,o=n.cellClassRules,s=this.getCellClassParams(e,n);e_(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,s,i=>t.toggleCss(i,!0),i=>t.toggleCss(i,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let o;if(typeof n=="function"){const s=this.getCellClassParams(e,t);o=n(s)}else o=n;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,o=this.getCellClassParams(e,n);for(const i of this.staticClasses)t.toggleCss(i,!1);const s=this.beans.cellStyles.getStaticCellClasses(n,o);this.staticClasses=s;for(const i of s)t.toggleCss(i,!0)}getCellClassParams(e,t){const{value:n,rowNode:o}=this.cellCtrl;return It(this.beans.gos,{value:n,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},Zwe=class extends He{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,o){e_(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,o),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let o;return typeof n=="function"?o=n(t):o=n,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new Ywe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(s=>{n(s)})}},Xwe={moduleName:"CellStyle",version:ut,beans:[Zwe]},Jwe={moduleName:"RowStyle",version:ut,beans:[Vfe]};function Qwe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var eCe=class extends He{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:o,gos:s,element:i,columns:r}=this,a=o.colHover;if(n??!!s.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(i,{mouseover:a.setMouseOver.bind(a,r),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},tCe="ag-column-hover",nCe=class extends He{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const o=()=>{const s=this.isHovered(n);t.toggleCss("ag-column-hover",s)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(tCe,n)}addHeaderFilterColumnHoverListener(e,t,n,o){this.createHoverFeature(e,[n],o);const s=()=>{const i=this.isHovered(n);t.toggleCss("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:s}),s()}createHoverFeature(e,t,n){e.createManagedBean(new eCe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},oCe={moduleName:"ColumnHover",version:ut,beans:[nCe],apiFunctions:{isColumnHovered:Qwe}},sCe=class extends He{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var i;const n=((i=this.wrapSvc)==null?void 0:i.wrap(e,t))??t,o=!hy.has(e),s=o?this.asyncListeners:this.syncListeners;s.has(e)||s.set(e,new Set),s.get(e).add(n),this.eventSvc.addListener(e,n,o)}removeListener(e,t){var i,r;const n=((i=this.wrapSvc)==null?void 0:i.unwrap(e,t))??t,o=this.asyncListeners.get(e),s=!!(o!=null&&o.delete(n));s||(r=this.syncListeners.get(e))==null||r.delete(n),this.eventSvc.removeListener(e,n,s)}addGlobalListener(e){var i;const t=((i=this.wrapSvc)==null?void 0:i.wrapGlobal(e))??e,n=(r,a)=>{hy.has(r)&&t(r,a)},o=(r,a)=>{hy.has(r)||t(r,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:o});const s=this.eventSvc;s.addGlobalListener(n,!1),s.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:o}=this,s=(n==null?void 0:n.unwrapGlobal(e))??e;if(o.has(s)){const{syncListener:r,asyncListener:a}=o.get(s);t.removeGlobalListener(r,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(s),t.removeGlobalListener(s,!1)}destroyEventListeners(e,t){e.forEach((n,o)=>{n.forEach(s=>this.eventSvc.removeListener(o,s,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:o})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function iCe(e,t,n){var o;(o=e.apiEventSvc)==null||o.addListener(t,n)}function rCe(e,t,n){var o;(o=e.apiEventSvc)==null||o.removeListener(t,n)}function aCe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function lCe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var cCe={moduleName:"EventApi",version:ut,apiFunctions:{addEventListener:iCe,addGlobalListener:aCe,removeEventListener:rCe,removeGlobalListener:lCe},beans:[sCe]},uCe={moduleName:"Locale",version:ut,beans:[Bpe]},dCe=class extends He{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Po(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:o}=this.beans,s=e.autoHeightCols;let i=!1;const r=d=>{var p;const h=d.__autoHeights;let f=Qa(this.beans,d).height;for(const g of s){let v=h==null?void 0:h[g.getColId()];const y=n==null?void 0:n.getCellSpan(g,d);if(y){if(y.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),i=!0)};(a=o==null?void 0:o.forEachPinnedRow)==null||a.call(o,"top",r),(l=o==null?void 0:o.forEachPinnedRow)==null||l.call(o,"bottom",r),(c=t.forEachDisplayedNode)==null||c.call(t,r),i&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const o=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:o,visibleCols:s}=this.beans;if(!n.colSpanActive)return!1;let i=[];switch(e.getPinned()){case"left":i=s.getLeftColsForRow(t);break;case"right":i=s.getRightColsForRow(t);break;case null:i=o.getColsWithinViewport(t);break}return!i.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:s,column:i}=e,r=this.beans,a=u=>{var b;if((b=this.beans.editSvc)!=null&&b.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=uc(o),g=d+h+f+p,y=t.offsetHeight+g;if(u<5){const S=_o(r),C=!(S!=null&&S.contains(t)),E=y==0;if(C||E){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(s,y,i)},l=()=>a(0);l();const c=Za(r,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(s,void 0,i)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(s=>s.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const o of t){const s=n.__autoHeights[o.getColId()];if(!s||n.rowHeight<s)return!1}}return!0}},hCe={moduleName:"RowAutoHeight",version:ut,beans:[dCe]},fCe={moduleName:"AllCommunity",version:ut,dependsOn:[cB,wye,Fye,oge,fve,pve,gve,mve,vve,yve,wve,hve,ime,rme,ame,sme,cme,ume,zye,Wve,uwe,UV,Cwe,bwe,Fwe,Owe,Jce,Hwe,Ove,Cpe,Xwe,oCe,Jwe,cCe,Epe,Bye,W2,uCe,hCe,Xce,hye,qwe]};let gB=!1;gB||(ise.registerModules([fCe,cB]),gB=!0);class pCe{constructor(t,n){Xn(this,"gridApi",null);Xn(this,"container");Xn(this,"config");Xn(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:o,onRowSelected:s,...i}=this.config,r={...i,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{o&&o(a)},onRowSelected:a=>{s&&s(a)}};return this.gridApi=Mpe(this.container,r),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const o={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const o={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(o=>{var s;(s=this.gridApi)==null||s.removeEventListener(n,o)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const gCe=YV.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),mCe=it({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=B(null);Xb(i,()=>{var v;console.log("Grid container lost focus, clearing focused cell");const g=(v=r.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const r=B(null),a=Z(()=>({width:"100%",height:o.height||"500px"})),l=Z(()=>({...o,theme:gCe}));function c(){if(!i.value){console.warn("Grid container element not found");return}const g={...l.value,height:o.height};r.value=new pCe(i.value,g),r.value.init(),u()}function u(){var v;const g=((v=r.value)==null?void 0:v.getApi())??null;s("onGridReady",g)}function d(g){var y,b;if(!g)return;(y=r.value)==null||y.updateColumnDefs(g);const v=g.map(S=>S.field&&S.width&&!S.hide?{colId:S.field,width:S.width}:null).filter(S=>S!==null);(b=r.value)==null||b.setColumnWidth(v)}function h(){var g;(g=r.value)==null||g.destroy(),r.value=null}function f(){var g;return((g=r.value)==null?void 0:g.getApi())||void 0}function p(){return r.value||null}return Je(()=>o.columnDefs,(g,v)=>{const y=g==null?void 0:g.filter(S=>!S.hide).map(S=>S.field).join(","),b=v==null?void 0:v.filter(S=>!S.hide).map(S=>S.field).join(",");y!==b&&d(g)},{deep:!0}),lo(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),Xt(()=>{c()}),lo(()=>{h()}),(g,v)=>(j(),ae("div",{ref_key:"gridContainerRef",ref:i,style:cn(a.value),class:J(["ag-theme-quartz",["ag-table-container",o.isSorting?"is-sorting":""]])},null,6))}});function _d(e){return qM(e)}const vCe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:_d(oc),suppressMovable:!0},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:_d(oc)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:_d(oc)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:_d(oc)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:_d(oc),cellRendererParams:n=>{var o,s,i;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated.value,tooltip:((i=(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated)==null?void 0:i.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:_d(oc),cellRendererParams:n=>{var o,s,i;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.completedOn.value,tooltip:((i=(s=n==null?void 0:n.data)==null?void 0:s.completedOn)==null?void 0:i.tooltip)||void 0,readOnly:!0}}}].map(n=>xf.fromType(n))],Ey={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},yCe={field:"blank",headerName:"",flex:1,editable:!1,sortable:!1,filter:!1,cellClass:"ag-cell-optimized",suppressMovable:!0,suppressNavigable:!0,suppressAutoSize:!1,suppressSizeToFit:!1},wCe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:Ey.WIDTH,minWidth:Ey.WIDTH,maxWidth:Ey.WIDTH,cellClass:"ag-checkbox-cell",headerClass:Ey.HEADER_CLASS,headerComponent:yv(jX),suppressMovable:!0}),CCe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},bCe=(e,t,n)=>{const{getCachedValue:o,setCachedValue:s}=wh({dbName:"item_table_column_configs",storeName:"column_configs"}),i=async()=>{const u=await o(t);if(u&&typeof u=="string")try{return JSON.parse(u)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},r=B([]),a=wCe(),l=async u=>{const d=await i(),h=new Map;d==null||d.forEach(F=>{F.width&&h.set(F.field,F.width)});const f=vCe(),p=xf.fromType(CCe),v=((u==null?void 0:u.map(F=>{var P;return{headerName:F.name,field:`metric_${F.id}`,editable:((P=F==null?void 0:F.auth_permission)==null?void 0:P.permission)==2,sortable:!0,filter:!1,flex:1,context:{...F},hide:!(F.is_primary||F.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:yv(oc),headerComponentParams:$=>({headerType:F.metric_type.code=="number"||F.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${F.id}`)}}))||[]).map(F=>xf.fromType(F)),y=[a,...f,...v,yCe,p],b=y.filter(F=>F.pinned==="left"),S=y.filter(F=>F.pinned==="right"||F.field==="blank"),C=y.filter(F=>!F.pinned&&F.field!=="blank");if(!d||d.length===0){r.value=y;return}const E=new Map(d.map(F=>[F.field,F])),_=new Map(C.map(F=>[F.field,F])),x=[];for(const F of d)if(F.field&&_.has(F.field)){const P=_.get(F.field);x.push({...P,hide:F.hide,width:F.width}),_.delete(F.field)}const A=Array.from(_.values()),k=[...x,...A],T=b.map(F=>{const P=E.get(F.field);return P!=null&&P.width?{...F,width:P.width}:F}),D=S.map(F=>{const P=E.get(F.field);return P!=null&&P.width?{...F,width:P.width}:F});r.value=[...T,...k,...D]};Je(e,u=>l(u),{immediate:!0});const c=Di((u,d)=>{var y,b;if(u.source!==void 0)if(["uiColumnResized","uiColumnMoved","api"].indexOf(u.source)===-1){console.warn("Skipping saveColumnConfig for source:",u.source);return}else console.warn("Executing saveColumnConfig for source:",u.source);else console.warn("Executing saveColumnConfig for source:",u);const h=(y=n==null?void 0:n.value)==null?void 0:y.getColumnDefs(),f=(b=n==null?void 0:n.value)==null?void 0:b.getColumnState().reduce((S,C)=>(S[C.colId]=Number(C.width),S),{}),p=new Map;Object.entries(f||{}).forEach(([S,C])=>{p.set(S,C)}),r.value=h||r.value;const g=h==null?void 0:h.filter(S=>!S.pinned&&S.field!=="blank"),v=(g==null?void 0:g.map(S=>({field:S.field,hide:S.hide,width:p.get(S.field)||S.width,pinned:S.pinned})))||[];d&&s(t,JSON.stringify(v))},sr);return{columnDefs:r,checkboxColumn:a,saveColumnConfig:c}},SCe=()=>{const e=Cn.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},ECe=e=>{var F,P,$;const{showMessage:t,showErrorNetMessage:n}=cf(),o=So(),s={domainApi:SCe(),wsCode:Cn.getInstance().getItem("ws.code"),entityId:e.value.entityId},i=($=(P=(F=o==null?void 0:o.appContext)==null?void 0:F.config)==null?void 0:P.globalProperties)==null?void 0:$.apiConfig;if(!i||s.domainApi===""||s.wsCode==="")throw new Error("API configuration is missing in useItems");const r=new Ak(i,s);r.on("call-api",ne=>{ne.success?t(ne.apiCode,"success"):n(ne)});const a=Cs({}),l=B([]),c=B(!1),u=B(null),d=B(null),h=B(1),f=B(20);let p=Promise.resolve();const{setCachedUsers:g}=D7(),v=ne=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:ne}),y=50,b=async(ne,U,q)=>{if(!ne.length)return[];const Q=N4(ne,U);return(await Promise.all(Q.map(q))).flat()},S=async ne=>{try{return(await r.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:ne})).data.map(q=>[q==null?void 0:q.id,q.permission])}catch(U){return console.error("Failed to fetch item permissions chunk:",U),[]}},C=async(ne,U)=>{try{const q=await r.getMetricValues({workspaceId:e.value.workspaceId,item_ids:ne,per_page:ne.length*U.length,metric_ids:U}),Q=q.data.map(he=>{const M=new Map(he.item_metrics.map(L=>[L.metric_id,{value:L.value,auth_permission:L==null?void 0:L.auth_permission}])),Y=Object.fromEntries(U.map(L=>[L,M.get(L)??null]));return[he==null?void 0:he.id,Y]}),X=new Set(q.data.map(he=>he==null?void 0:he.id));for(const he of ne)if(!X.has(he)){const M=Object.fromEntries(U.map(Y=>[Y,{value:null,auth_permission:void 0}]));Q.push([he,M])}return Q}catch(q){return console.error("Failed to fetch a chunk of metric values:",q),ne.map(X=>[X,Object.fromEntries(U.map(he=>[he,void 0]))])}},E=async ne=>{try{const U=await r.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:ne,per_page:ne.length}),q=U.data.flatMap(Q=>Q.assignees);return g(q),U.data.map(Q=>[Q==null?void 0:Q.id,Q==null?void 0:Q.assignees])}catch(U){return console.error("Failed to fetch a chunk of assigned users:",U),[]}},_=async ne=>{if(!ne.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const U=await b(ne,y,S);return Object.fromEntries(U)}catch(U){return console.error("Failed to fetch item permissions:",U),{}}},x=async(ne,U)=>!ne.length||!U.length?{}:(p=p.then(async()=>{try{const X=[];let he=0;for(let Y=0;Y<U.length;Y+=5){he++;const L=U.slice(Y,Y+5),se=[];for(let Le=0;Le<L.length;Le++){const Me=L[Le],Ke=await b(ne,y,z=>C(z,[Me]));se.push(Ke),await new Promise(z=>setTimeout(z,500))}X.push(...se);const fe=Y+5>=U.length}const M={};for(const Y of X.flat()){const[L,se]=Y;M[L]||(M[L]={}),Object.assign(M[L],se)}return M}catch(q){return console.error("Failed to fetch metric values:",q),{}}}),p),A=async ne=>{if(!ne.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const U=await b(ne,y,E);return Object.fromEntries(U)}catch(U){return console.error("Failed to fetch assigned users:",U),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async ne=>{const{cursor:U,offset:q,size:Q,searchQuery:X}=ne;let he=[];c.value=!0,u.value=null;try{const M=await r.getAllItem_cursor({...ne,cursor:U||void 0,offset:q||void 0,pageSize:Q||f.value,...v(X),sortBy:ne.sort_by});return l.value=M.data,d.value=M.meta,h.value=M.meta.current_page||0,he=M.data.map(Y=>Y==null?void 0:Y.id),M}catch(M){throw u.value=M,console.error("Failed to fetch items (cursor):",M),M}finally{const M=async()=>{try{const[Y,L]=await Promise.all([A(he),_(he)]);e.value.updateItemData({assignees:Y,permission:L},he);const se=await x(he,e.value.metricIds);e.value.setMetricValues(se,new Set(he),e.value.metricIds)}catch(Y){console.error("Post-fetch processing failed:",Y)}};c.value=!1,setTimeout(M)}},getAssignableStatus:async ne=>{try{return await r.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:ne})}catch(U){throw console.error("Failed to fetch assignable status:",U),U}},getMetricList:async ne=>{try{return await r.getMetricList({workspaceId:e.value.workspaceId,entityId:ne})}catch(U){throw console.error("Failed to fetch metric list:",U),U}},getMetricValues:x,getAssignedUsers:A}};function _Ce(e){return{updateRowData:(o,s)=>{if(!e.value)return;const i=[],r=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);s.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(i.push(u),o.assignees){const h=h7((o.assignees[c]||[]).map(RI));u.data.assignees=h,r.add("assignees")}o.permission&&(u.data.permissions=o.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),r.add("assignees"),r.add("status"),r.add("dateRange"),r.add("moreActions"),r.add("name"),e.value.refreshCells({rowNodes:i,columns:Array.from(r),force:!0})},setMetricValues:(o,s,i)=>{const r=e.value;if(!r)return;const a=new Map(Array.from(s).map(c=>[c,new Map(i.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(o).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=r.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&r.refreshCells({rowNodes:l,columns:Array.from(i).map(c=>`metric_${c}`),force:!0})}}}function RCe(e,t,n,o,s){let i=!0;return{async getRows(r){try{o(!0),i&&(s(!0),i=!1);const a=Math.floor(r.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:r.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=r.startRow+l.length),r.context={pageSize:t,text:n()},r.successCallback(l,u),o(!1),s(!1)}catch(a){console.error("Datasource fetch error:",a),r.failCallback(),o(!1),s(!1)}}}}function DCe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:o,gridApi:s,fetcher:i}=e,r=B(!0),a=B(!0),l=B(!1),c=()=>{n.value=!n.value},u=v=>{if(r.value=!1,s.value=v,!v)return null;const{addEventListener:y,setGridOption:b}=v;if(!i)return console.error("Fetcher function is undefined"),null;const S=RCe(i,e.perPage,()=>o.value,C=>{r.value=C},C=>{a.value=C});return b==null||b("datasource",S),y==null||y("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var y,b;if((y=s.value)==null||y.hideOverlay(),v!==void 0&&(o.value=v),(b=s.value)==null||b.deselectAll(),t.value=[],r.value=!0,!s.value||!i){console.error("Grid API or fetcher is not available"),r.value=!1;return}l.value=!0,a.value=!0,s.value.purgeInfiniteCache(),s.value.ensureIndexVisible(0,"top"),setTimeout(()=>{r.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=s.value)==null||v.deselectAll(),t.value=[]},f=Di(v=>{d(v)},sr),p=()=>{s.value},g=B(!1);return{isLoading:r,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const TCe={changelog:{"1.0.1":{date:"2024-06-20",changes:["Fixed styling issues for archived and deleted rows."]},"1.0.0":{date:"2024-06-15",changes:["Initial release of the Item Table package."]},"0.0.1-alpha.8":{date:"2024-06-10",changes:["Improved performance of row updates.","Added support for custom cell renderers.","Add row hover effect for better UX.","Add loading skeleton for filter","Beta release with core functionalities implemented."]},"0.0.1-alpha.9":{date:"2024-06-05",changes:["Add row selection feature.","Fix bug with column resizing.","Optimize rendering for large datasets.","Implement getLog function to retrieve changelog entries based on version.","Display app version and changelog in the Item Table component tooltip.","Clean up unused autocomplete and memoized config composables.","Update styles for better consistency and readability."]},"0.0.1-alpha.11":{date:"2024-06-18",changes:["Add bulk process status display: items now show an hourglass icon and tooltip when being processed.","Update data model: added isProcessing and bulk_process properties to track item status.","Improve row focus: focused rows now flash for better visibility.","Set 'Last Updated' and 'Completed On' columns as read-only.","Fix: resolve visual fetching issue in useRemoteFiles composable.","Fix: use correct upload icon in PopupCreateScenes component.","Enhance data conversion to include processing status in item rows."]},"0.0.1-alpha.12":{date:"2024-06-12",changes:["feat: enhance Snackbar component and notification handling","Refactor Snackbar.vue for improved readability and styling, including color adjustments for icons and text.","Add showMessage function in notifications store to display messages based on API keys, improving notification management.","Introduce notificationMessage constant to centralize notification messages for various API actions, enhancing maintainability.","Remove unnecessary console logs from useRemoteFiles and improve logging in notification store for better debugging."]},"0.0.1-alpha.16":{date:"2024-06-20",changes:["Add onboarding tour feature and enhance UI components with new dependencies","Refactor UI components for improved styling and functionality","Updated RatingComponent.vue to streamline class bindings and improve accessibility attributes.","Enhanced SearchBox.vue by adding a clear event handler and simplifying icon rendering.","Modified AssigneeGroupEditor.vue and AssigneeGroupRenderer.vue to remove unnecessary size attributes from icons.","Adjusted DateRangeRenderer.vue to remove size attributes from icons for consistency.","Updated HeaderCheckbox.vue to set dropdown placement to 'bottom-start'.","Refined HeaderSorting.vue to simplify sort option labels and improve sorting logic.","Enhanced HeaderWrapper.vue to utilize reactive properties for sorting state.","Improved HyperLinkEditor.vue and HyperLinkInlineEditor.vue by removing size attributes from icons.","Updated PopupLayout.vue to use a CSS variable for box-shadow styling.","Refined Snackbar.vue to standardize icon colors and improve styling consistency.","Adjusted useTippy.ts to set default placement and arrow visibility for tooltips.","Modified notificationMessage.ts to remove error messages for list fetching.","Cleaned up notifications.ts by removing console logs for a cleaner codebase.","Updated sortStore.ts to comment out unnecessary console logs for better performance.","Enhanced styles.scss by defining new icon size variables and standardizing box-shadow styles."]},"0.0.99":{date:"2024-06-24",changes:["Fix: resolve issue with incorrect version display in Item Table component.","Update changelog retrieval logic to ensure accurate version matching.","Enhance tooltip display for app version and changelog in Item Table component."]}}},xCe=e=>{var t;return(t=Object.entries(TCe.changelog).find(([n,o])=>n===e))==null?void 0:t[1].changes},FCe={key:1},ICe=St(it({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=B(null),s=e,i=()=>{o.value&&o.value.show()},r=B(""),a=B("idle"),l=B({file:null,format:null}),{apiServices:c}=Qn(!1,{}),u=B(!1),d=async()=>{u.value=!0;const x=s.workspaceId,A=s.entityId;if(!x||!A||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(x,A))throw new Error("No response from downloadTemplate API")}catch(k){console.error("Error downloading template:",k)}u.value=!1},h=n,f=()=>{h("import-success"),b()},p=async x=>{var T,D,F;const A=new FormData,k=((T=x.name.split(".").pop())==null?void 0:T.toString())||"";if(A.append("file",x),A.append("format",k),A.append("entity_id",s.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(s.workspaceId,s.entityId,A),g()}catch(P){throw console.error("Error uploading file:",P),v(((F=(D=P.response)==null?void 0:D.data)==null?void 0:F.message)||"An unknown error occurred during file upload."),P}},g=()=>{a.value="success"},v=x=>{r.value=x,a.value="error"},y=async()=>{!l.value||!l.value.file||await p(l.value.file)},b=()=>{var x;_(),(x=o.value)==null||x.hide()};t({close:b,open:i});const S=Z(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),C=Z(()=>l.value.file?!1:(console.error("No file selected"),!0)),E=B(null),_=()=>{var x;(x=E.value)==null||x.clear(),r.value="",l.value={file:null,format:null},a.value="idle"};return(x,A)=>(j(),ze(H($k),{"popup-name":S.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:o,onHidden:_},Yd({default:pe(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(j(),ze(UM,{key:0,state:a.value,"error-message":r.value,overwrite:!0},null,8,["state","error-message"])):(j(),ae("div",FCe,[ge("div",{class:J(x.$style["step-section"])},[ge("span",{class:J(x.$style["step-title"])},"Step 1: Download current data",2),ge("span",{class:J(x.$style["step-description"])},[...A[1]||(A[1]=[nt(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),ge("br",null,null,-1),ge("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),ce(H(ct),{class:J(x.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:pe(()=>[ce(H(rt),{src:"Download"})]),default:pe(()=>[A[2]||(A[2]=nt(" Download file ",-1))]),_:1},8,["class","disabled"])],2),ge("div",{class:J(x.$style["step-section"])},[ge("span",{class:J(x.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),ce(H(DO),{modelValue:l.value,"onUpdate:modelValue":A[0]||(A[0]=k=>l.value=k),ref_key:"filUploaderRef",ref:E},null,8,["modelValue"])],2),ge("div",{class:J(x.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ce(WM)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:pe(()=>[ce(H(ct),{style:{flex:"1"},variant:"secondary",onClick:b},{default:pe(()=>[...A[3]||(A[3]=[nt(" Cancel ",-1)])]),_:1}),ce(H(ct),{disabled:C.value,style:{flex:"1"},variant:"primary",onClick:y},{default:pe(()=>[...A[4]||(A[4]=[nt(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:pe(()=>[ce(H(ct),{style:{flex:"1"},variant:"primary",onClick:f},{default:pe(()=>[...A[5]||(A[5]=[nt(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:pe(()=>[ce(H(ct),{style:{flex:"1"},variant:"primary",onClick:_},{default:pe(()=>[...A[6]||(A[6]=[nt(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_lw86z_1","step-title":"_step-title_lw86z_11","step-title-2":"_step-title-2_lw86z_17","step-description":"_step-description_lw86z_23","date-format-guide":"_date-format-guide_lw86z_28","import-error":"_import-error_lw86z_39","drop-area":"_drop-area_lw86z_49","is-dragging":"_is-dragging_lw86z_49","drop-area-content":"_drop-area-content_lw86z_52",browse:"_browse_lw86z_61","download-sample-btn":"_download-sample-btn_lw86z_65"}}]]),PCe={key:0},ACe=St(it({__name:"OpenInTake",props:{entityId:{},workspaceId:{},loading:{type:Boolean}},setup(e,{expose:t}){const n=Yt,o=e,{triggerRef:s,popupRef:i,hide:r,isVisible:a}=eo({placement:"bottom-end",offset:[0,0]}),l=Cn.getInstance().getItem("BASE_REVIEW_URL"),c=Cn.getInstance().getItem("BASE_URL"),u=()=>{const S=Lo({type:"review_take",config:{reviewDomain:l,ws_code:o.workspaceId,take_id:o.entityId}});window.open(S.url,"_blank")},d=()=>{const S=Lo({type:"update",config:{baseDomain:c,ws_code:o.workspaceId,entity_id:o.entityId}});window.open(S.url,"_blank")},h=()=>{const S=Lo({type:"woohoo",config:{baseDomain:c,ws_code:o.workspaceId,woohoo_id:o.entityId}});window.open(S.url,"_blank")},f=Rm(),{userPermissions:p}=Ho(f),g=Z(()=>p.value.includes(Dm)),v=Z(()=>p.value.includes(MA)),y=Z(()=>p.value.includes(OA)),b=as;return t({triggerRef:s,popupRef:i,hide:r}),Je(a,S=>{S&&setTimeout(()=>{var C;(C=i.value)==null||C.focus()},0)}),(S,C)=>{const E=bs("focusable");return g.value||v.value||y.value?(j(),ae("div",PCe,[ge("div",{ref_key:"triggerRef",ref:s},[Ue((j(),ze(H(ct),{variant:["secondary","icon"],width:"32px",onEscape:H(r)},{default:pe(()=>[ce(H(rt),{src:"ArrowUpRightFromSquare"})]),_:1},8,["onEscape"])),[[H(b),{isLoading:e.loading,fullwidth:!0}],[H(n),"Open in"],[E,"6"]])],512),Ue((j(),ae("div",{ref_key:"popupRef",ref:i,style:{width:"200px",borderRadius:"7px",overflow:"hidden"},class:J(S.$style["dropdown-list"]),tabindex:"0"},[g.value?Ue((j(),ze(H(ei),{key:0,variant:"menu-item",style:{width:"200px",borderLeft:"0"},onClick:Tt(u,["stop"])},{prefix:pe(()=>[ge("div",{class:J(S.$style.icon)},[ce(H(rt),{src:"PenRuler",color:"#A6A6A6"})],2)]),label:pe(()=>[...C[0]||(C[0]=[nt("Review",-1)])]),_:1})),[[E,"6.1"]]):Ze("",!0),v.value?Ue((j(),ze(H(ei),{key:1,variant:"menu-item",style:{width:"200px",borderLeft:"0"},onClick:Tt(d,["stop"])},{prefix:pe(()=>[ge("div",{class:J(S.$style.icon)},[ce(H(rt),{src:"UserCheck",color:"#A6A6A6"})],2)]),label:pe(()=>[...C[1]||(C[1]=[nt("Update",-1)])]),_:1})),[[E,"6.2"]]):Ze("",!0),y.value?Ue((j(),ze(H(ei),{key:2,variant:"menu-item",style:{width:"200px",borderLeft:"0"},onClick:Tt(h,["stop"])},{prefix:pe(()=>[ge("div",{class:J(S.$style.icon)},[ce(H(rt),{src:"ChartPie",color:"#A6A6A6"})],2)]),label:pe(()=>[...C[2]||(C[2]=[nt("Woohoo Details",-1)])]),_:1})),[[E,"6.3"]]):Ze("",!0)],2)),[[E,"6.0"]])])):Ze("",!0)}}}),[["__cssModules",{$style:{icon:"_icon_1tz8l_1","dropdown-list":"_dropdown-list_1tz8l_9"}}]]),kCe={style:{cursor:"help"}},OCe=St(it({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=as,o=Rm(),{setUserPermissions:s,setEntityPermissions:i}=o,{entityPermissions:r}=Ho(o),a=Yt,l=B(null),c={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},u=B(""),d=Z(()=>{var je;const Ie=((je=r.value)==null?void 0:je.has_create_item_permission)==1||!1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!Ie},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!Ie,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!Ie,id:"overwrite_scenes_option"}]}),h=e;xf.initialize({wrapVueCellRenderer:yv,wrapVueCellEditor:qM});const f=Yh(),{switchInstanceFunc:p}=Ho(f);Xt(()=>{const Ie=So();p.value=Ie==null?void 0:Ie.appContext.config.globalProperties.switchInstance;const je=new BroadcastChannel("focusable_channel");_t(()=>{setTimeout(()=>{je.postMessage("Focusable elements updated")},7e3)})});const g=B(null),v=B([]),y=$m(),{rowCount:b}=Ho(y),S=B(!1),C=B(""),E=B(),_=$A(),{metricList:x}=Ho(_),A=B(""),k=B(!1),T=B(new Set),D=B(new Map),{apiServices:F}=Qn(!1,h),{columnDefs:P,checkboxColumn:$,saveColumnConfig:ne}=bCe(x,h.entityId,g),U=B();Je(()=>P,()=>{var Ie;(Ie=U.value)==null||Ie.updateColumnDefs(P.value)},{deep:!0});const q=(Ie,je)=>{ne(Ie,je)},{updateRowData:Q,setMetricValues:X}=_Ce(g),he=Z(()=>({isSearching:C.value.length>0,isFiltering:!(Object.keys(Ce.value||{}).length==1&&Object.keys(Ce.value)[0]=="preflight_status")&&Object.keys(Ce.value||{}).length>0})),M=Z(sm),Y=Z(()=>P.value.filter(Ie=>{var je;return((je=Ie.field)==null?void 0:je.startsWith("metric_"))&&!Ie.hide}).map(Ie=>{var je;return((je=Ie.field)==null?void 0:je.replace("metric_",""))||""}));qi("timezone",M);const L=Z(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:Y.value,updateItemData:Q,setMetricValues:X})),{fetchItems:se,getMetricList:fe,cusorMap:Le,getMetricValues:Me}=ECe(L),Ke=Z(()=>{if(!g.value)return!1;const Ie=g.value.getSelectedRows().length;return Ie>0&&Ie>=b.value.total}),z=Z(()=>{var Ie;return((Ie=l.value)==null?void 0:Ie.name)||"Items"}),ue=(Ie,je)=>{var Qt,Gt,ko;b.value.total=Ie.meta.total??0,(Qt=Ie.meta.next)!=null&&Qt.cursor&&(Le[je+1]=Ie.meta.next.cursor),A.value=Ie.meta["X-Tsr-signature"]||"",Ie.meta.total===0?(Gt=g.value)==null||Gt.showNoRowsOverlay():(ko=g.value)==null||ko.hideOverlay()},re=RO(),Fe=B(null),{sortingAPIConfiguration:G,isSortingRunning:ee}=Ho(re),Ce=B({preflight_status:"1"}),Pe=Z(()=>({...Ce.value,search:C.value}));qi("filterParams",Pe);const xe=B([]),O=async({page:Ie,pageSize:je,filterText:Qt})=>{var Vs;(Vs=g.value)==null||Vs.hideOverlay();const Gt=Le[Ie],ko=!Gt&&Ie>1?(Ie-1)*je:void 0,va=G.value;va.length>0&&(ee.value=!0);try{const ya={cursor:Gt,size:je,searchQuery:Qt,offset:ko,sort_by:va,...Ce.value},ns=await se(ya);if(!ns)return{rows:[],total:0};const hp=(jn=>{const Pr=jn.data.map(ys=>TI(ys,M.value));return Pr.forEach(ys=>{T.value.add(String(ys.id)),D.value.set(String(ys.id),{})}),Pr})(ns);return ue(ns,Ie),{rows:hp,total:b.value.total}}catch(ya){return console.error("Failed to fetch items:",ya),{rows:[],total:0}}finally{ee.value=!1}},{isLoading:V,toggleSidebar:te,onGridReady:we,handleUnSelect:ke,handleSelectAll:Ye,onSearch:me,firstLoad:le}=DCe({selectRowData:B([]),isSidebarOpen:S,quickFilterText:C,gridApi:g,perPage:c.ROWS_PER_PAGE,fetcher:O}),be=B([]),Qe=()=>{var Ie;be.value=((Ie=g.value)==null?void 0:Ie.getSelectedRows())||[]},at=Cs({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),Ft=Z(()=>({blockLoadDebounceMillis:1e3,columnDefs:P.value,rowModelType:"infinite",cacheBlockSize:c.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:c.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:c.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:nn,noRowsOverlayComponent:yv(IQ),noRowsOverlayComponentParams:()=>he.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Ie=>Ie.data.id,getRowClass:Ie=>{if(!Ie.data)return["row-empty"];const je=["row-highlight"];return Ie.data.id||je.push("row-inactive"),Ie.data.isDeleted&&je.push("row-deleted"),Ie.data.disabled&&je.push("row-deleted"),Ie.data.isArchived&&je.push("row-archived"),je},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:F.value,sorting:ee.value},onCellEditRequest:Ie=>{console.log("Cell edit requested:",Ie)},onCellKeyDown:Ie=>{var je,Qt,Gt;if(console.log("Cell key down:",Ie),Ie.data.isDeleted)return!1;if(((je=Ie==null?void 0:Ie.event)==null?void 0:je.key)==="Enter"){const{api:ko,node:va,column:Vs}=Ie,ya=ko.getCellRendererInstances({rowNodes:[va],columns:[Vs]});if(ya.length>0){const ns=ya[0];ns&&typeof((Qt=ns.componsenExposed)==null?void 0:Qt.focus)=="function"&&((Gt=ns.componsenExposed)==null||Gt.focus())}}},isRowSelectable:Ie=>!Ie.group,suppressKeyboardEvent:Ie=>{var Gt;if((Gt=Ie.data)!=null&&Gt.isDeleted)return!0;const je=Ie.event.key,Qt=Ie.editing;return Qt&&je==="Tab"?!0:Qt&&je==="Enter"?!1:je==="Enter"?(Ie.event.preventDefault(),Ie.event.stopPropagation(),!0):je==="ArrowUp"||je==="ArrowDown"||je==="ArrowLeft"||je==="ArrowRight"||je==="Tab"||je==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Ie=>{const je=Ie.api.getFirstDisplayedRowIndex(),Qt=Ie.api.getLastDisplayedRowIndex();at.rowsDisplay.fromIndex=je,at.rowsDisplay.toIndex=Qt,at.columnsDisplay=Ie.api.getAllDisplayedVirtualColumns().map(Gt=>Gt.getColId())},onViewportChanged:Ie=>{at.columnsDisplay=Ie.api.getAllDisplayedVirtualColumns().map(je=>je.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Ie){if(Ie.data.isDeleted&&Ie.api.stopEditing(),console.log("Cell editing started:",Ie),Ie.colDef.field=="options"){const je=Ie.api.getCellRendererInstances({rowNodes:[Ie.node],columns:[Ie.column]});je.length>0&&je[0].focusUi()}},tabToNextCell:Ie=>{let je=Ie.nextCellPosition;if(je&&je.column.getColId()==="ag-Grid-SelectionColumn"){const Qt=Ie.api.getAllDisplayedColumns(),Gt=Qt.indexOf(je.column),ko=Ie.backwards?-1:1,va=Qt[Gt+ko];if(va)return{rowIndex:je.rowIndex,column:va,rowPinned:je.rowPinned}}return je}}));function nn(){if(!g.value)return;let Ie=0;g.value.forEachNode(je=>{je.data&&Ie++}),b.value.loaded=Math.min(Ie,b.value.total)}Je(()=>G,()=>{g.value&&(A.value="",T.value.clear(),g.value.deselectAll(),Object.keys(Le).forEach(Ie=>delete Le[Number(Ie)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const Nt=B(),on=B(),ln=()=>{var Ie;(Ie=on.value)==null||Ie.open()},Ne=()=>{var Ie;(Ie=Nt.value)==null||Ie.open()},Ge=async()=>{le.value=!0,g.value&&(A.value="",T.value.clear(),Object.keys(Le).forEach(Ie=>delete Le[Number(Ie)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},bt=Z(()=>Cn.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),kt=B(),Ut=Z(()=>{var Ie;return(Ie=xCe(bt.value))==null?void 0:Ie.map(je=>`<div>• ${je}</div>`).join(`
250
- `)});function tt(Ie){var je;Ie==="new_scene"?(je=kt.value)==null||je.show():Ie==="import_scenes"?Ne():Ie==="overwrite_scenes"&&ln()}const Do=Ie=>{v.value=Ie.api.getSelectedRows().map(je=>je.id)},Hi=Ie=>{const je=we(Ie);return je&&(je.addEventListener("modelUpdated",nn),je.addEventListener("bodyScroll",()=>je.stopEditing()),je.addEventListener("selectionChanged",Qe),je.addEventListener("columnMoved",Gt=>q(Gt,!0)),je.addEventListener("columnResized",Gt=>q(Gt,!0)),je.addEventListener("firstDataRendered",()=>{le.value=!1}),!document.querySelector(".ag-body-viewport")),je},xr=()=>{var Ie;u.value=(((Ie=document.getElementById("item-table-layout-id"))==null?void 0:Ie.clientHeight)??0)-78+"px"};Xt(()=>{_t(()=>{xr()}),window.addEventListener("resize",xr);function Ie(){requestAnimationFrame(Ie)}Ie()}),lo(()=>{window.removeEventListener("resize",xr)});const hi=async({code:Ie,name:je})=>{await me(Ie),setTimeout(()=>{var Qt;(Qt=E.value)==null||Qt.setValue(je)},300)},ma=Ie=>{if(!g.value)return;const je=g.value.getRowNode(Ie);je?(g.value.ensureIndexVisible(Number(je.rowIndex),"middle"),g.value.flashCells({rowNodes:[je],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(b.value.total-1,"bottom")},dl=Ie=>Ie.metric_type.code==="number"?"number":"default",Fr=async()=>{if(h.entityId)try{const Ie=await fe(h.entityId);x.value=Ie.data.map(je=>({...je,sortType:dl(je)}))}catch(Ie){console.error("Failed to initialize metric list:",Ie),x.value=[]}},Ir=async()=>{if(F.value)try{const Ie=await F.value.getUserPermission(h.workspaceId);s(Ie)}catch(Ie){console.error("Failed to fetch user permissions:",Ie)}},fi=async()=>{if(F.value)try{const Ie=await F.value.getEntityDetail(h.workspaceId,h.entityId);i(Ie.permission),l.value=Ie}catch(Ie){console.error("Failed to fetch entity details:",Ie)}},Gi=lv(),{setUser:Rd}=Gi,An=async()=>{if(F.value)try{const Ie=await F.value.getMe();return Rd(Ie),Ie}catch(Ie){console.error("Failed to fetch user details:",Ie)}},po=async()=>{var Ie;if(F.value)try{const je=await F.value.getWorkspaces(h.workspaceId),Qt=(Ie=je.data[0])==null?void 0:Ie.ws_user_role_id;return Qt&&Gi.setUserRoleId(Qt),je}catch(je){console.error("Failed to fetch workspace details:",je)}};Je(()=>[h.entityId,h.workspaceId],async([Ie,je])=>{!Ie||!je||(An(),po(),Fr(),Ir(),fi())},{immediate:!0,deep:!0}),Je(Y,(Ie,je)=>{const Qt=Ie.filter(Gt=>!(je!=null&&je.includes(Gt)));Qt.length>0&&Me(Array.from(T.value),Qt).then(Gt=>{X(Gt,T.value,Qt)})},{immediate:!0,deep:!0}),Je(A,(Ie,je)=>{k.value=!!(je&&Ie&&je!==Ie)}),t({refreshTable:Ge});const b_=Ie=>{Ce.value=Ie,Ge()},Dd=Ie=>{xe.value=Ie,Ge()},Td=Ie=>{P.value=Ie||[],q({},!0)},xd=Z(()=>{var Gt;const Ie=Cn.getInstance().getItem("ws.terminology"),je=Ie?JSON.parse(Ie):null;return`New ${((Gt=je==null?void 0:je.find(ko=>ko.code==="scene"))==null?void 0:Gt.name)||"Scene"}`});return(Ie,je)=>{const Qt=bs("focusable");return j(),ze(H($X),{"is-sidebar-open":S.value,onCloseSidebar:H(te),onSidebarClear:H(te),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:H(te)},{"header-left":pe(()=>{var Gt;return[((Gt=H(r))==null?void 0:Gt.has_create_item_permission)==1?(j(),ze(H(dS),{key:0,variant:["primary"],options:d.value,onSelect:tt,onHandleClick:je[1]||(je[1]=ko=>tt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:pe(()=>[Ue(ce(H(ct),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:je[0]||(je[0]=ko=>tt("new_scene")),label:xd.value},null,8,["label"]),[[Qt,1]])]),_:1},8,["options"])):Ze("",!0),ge("div",{class:J(Ie.$style["beta-tag"])},"Beta",2),Ue((j(),ae("span",kCe,[nt(yt(bt.value),1)])),[[H(a),Ut.value||""]])]}),"header-actions":pe(()=>[ce(H(hee),{"onUpdate:assignees":Dd,onApplyFilter:b_,loading:H(le),entityId:h.entityId},null,8,["loading","entityId"]),Ue(ce(H(Qb),{focusIndex:"4",modelValue:C.value,"onUpdate:modelValue":je[2]||(je[2]=Gt=>C.value=Gt),onSearch:H(me),class:J(Ie.$style.itemSearchBox),onClear:je[3]||(je[3]=Gt=>H(me)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[H(n),{isLoading:H(le),fullwidth:!0}]]),Ue((j(),ze(H(NA),{status:H(V)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":k.value},{default:pe(()=>[Ue((j(),ze(H(ct),{variant:["secondary","icon"],disabled:H(V),onClick:Ge},{default:pe(()=>[ce(H(rt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[Qt,5],[H(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[H(n),{isLoading:H(le),fullwidth:!0}]]),ce(ACe,{loading:H(le),entityId:h.entityId,workspaceId:h.workspaceId},null,8,["loading","entityId","workspaceId"]),Ue(ce(H(hQ),{"model-value":H(P),onChange:je[4]||(je[4]=Gt=>Td(Gt)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:U,"checkbox-column":H($),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[H(n),{isLoading:H(le),fullwidth:!0}]])]),grid:pe(({availableHeight:Gt})=>[ce(H(mCe),qt({id:"item_table_main",ref_key:"agGrid",ref:Fe},Ft.value,{height:Gt+"px",isSorting:H(ee),onOnGridReady:Hi,onSelectionChanged:Do}),null,16,["height","isSorting"])]),footer:pe(()=>[ge("div",{class:J(Ie.$style.tableFooter),id:"table_footer"},[ge("span",null,[je[5]||(je[5]=nt(" Showing ",-1)),ge("b",null,yt(H(b).loaded)+" of "+yt(H(b).total),1)])],2)]),"new-row":pe(()=>[ce(H(UQ),{ref_key:"createNewSceneRef",ref:kt,onSearchForCode:hi,onFocusOnId:ma},null,512)]),"bulk-update-actions":pe(()=>[Ue(ce(H(AX),{selectRowData:be.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:H(ke),onSelectAll:H(Ye),"take-name":z.value,"selected-all":Ke.value,"total-rows":H(b).total,"visible-rows":H(b).loaded,onUpdated:Qe,loading:H(V)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"]),[[_i,!S.value&&v.value.length>0]])]),snackbar:pe(()=>[ce(H(SJ))]),popup:pe(()=>[ce(Yne,{ref_key:"popupCreateSceneRef",ref:Nt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ge},null,8,["workspace-id","entity-id"]),ce(ICe,{ref_key:"popupOverwriteScenesRef",ref:on,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ge},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"])}}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),mB="0.1.65",MCe={key:0},NCe=St(it({__name:"app",setup(e){const t=Z(()=>n.id.length===0||n.workspaceId.length===0),n=Cs({id:"",workspaceId:"",apiConfig:{}}),o=cf(),{showMessage:s,showErrorNetMessage:i}=o,r=["basicInfor"],a=h=>{h.success?s(h.apiCode,"success"):r.includes(h.apiCode)||i(h)},l=B(null),c=()=>{const h=Cn.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Zp(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",mB);try{if(l.value=So(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||Cn.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:Cn.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new Ak(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),lo(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=Z(()=>n.id),d=Z(()=>n.workspaceId);return qi("workspaceId",d),qi("entityId",u),(h,f)=>(j(),ae("div",{class:J(h.$style.dashboardPluginWrapper)},[t.value?(j(),ae("span",MCe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(j(),ze(H(OCe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ze("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),C_=async(e={},t={})=>{const n=E1(NCe),o=Xq();n.use(o);const s=["apiConfig","workspaceId","id"],i={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,i[a]=l,s.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=i,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${mB}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",Yt),n.directive("focusable",Ur);const r=await jne();return n.use(r),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=C_),kn.default=C_,kn.initDashboard=C_,Object.defineProperties(kn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
250
+ `)});function tt(Ie){var je;Ie==="new_scene"?(je=kt.value)==null||je.show():Ie==="import_scenes"?Ne():Ie==="overwrite_scenes"&&ln()}const Do=Ie=>{v.value=Ie.api.getSelectedRows().map(je=>je.id)},Hi=Ie=>{const je=we(Ie);return je&&(je.addEventListener("modelUpdated",nn),je.addEventListener("bodyScroll",()=>je.stopEditing()),je.addEventListener("selectionChanged",Qe),je.addEventListener("columnMoved",Gt=>q(Gt,!0)),je.addEventListener("columnResized",Gt=>q(Gt,!0)),je.addEventListener("firstDataRendered",()=>{le.value=!1}),!document.querySelector(".ag-body-viewport")),je},xr=()=>{var Ie;u.value=(((Ie=document.getElementById("item-table-layout-id"))==null?void 0:Ie.clientHeight)??0)-78+"px"};Xt(()=>{_t(()=>{xr()}),window.addEventListener("resize",xr);function Ie(){requestAnimationFrame(Ie)}Ie()}),lo(()=>{window.removeEventListener("resize",xr)});const hi=async({code:Ie,name:je})=>{await me(Ie),setTimeout(()=>{var Qt;(Qt=E.value)==null||Qt.setValue(je)},300)},ma=Ie=>{if(!g.value)return;const je=g.value.getRowNode(Ie);je?(g.value.ensureIndexVisible(Number(je.rowIndex),"middle"),g.value.flashCells({rowNodes:[je],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(b.value.total-1,"bottom")},dl=Ie=>Ie.metric_type.code==="number"?"number":"default",Fr=async()=>{if(h.entityId)try{const Ie=await fe(h.entityId);x.value=Ie.data.map(je=>({...je,sortType:dl(je)}))}catch(Ie){console.error("Failed to initialize metric list:",Ie),x.value=[]}},Ir=async()=>{if(F.value)try{const Ie=await F.value.getUserPermission(h.workspaceId);s(Ie)}catch(Ie){console.error("Failed to fetch user permissions:",Ie)}},fi=async()=>{if(F.value)try{const Ie=await F.value.getEntityDetail(h.workspaceId,h.entityId);i(Ie.permission),l.value=Ie}catch(Ie){console.error("Failed to fetch entity details:",Ie)}},Gi=lv(),{setUser:Rd}=Gi,An=async()=>{if(F.value)try{const Ie=await F.value.getMe();return Rd(Ie),Ie}catch(Ie){console.error("Failed to fetch user details:",Ie)}},po=async()=>{var Ie;if(F.value)try{const je=await F.value.getWorkspaces(h.workspaceId),Qt=(Ie=je.data[0])==null?void 0:Ie.ws_user_role_id;return Qt&&Gi.setUserRoleId(Qt),je}catch(je){console.error("Failed to fetch workspace details:",je)}};Je(()=>[h.entityId,h.workspaceId],async([Ie,je])=>{!Ie||!je||(An(),po(),Fr(),Ir(),fi())},{immediate:!0,deep:!0}),Je(Y,(Ie,je)=>{const Qt=Ie.filter(Gt=>!(je!=null&&je.includes(Gt)));Qt.length>0&&Me(Array.from(T.value),Qt).then(Gt=>{X(Gt,T.value,Qt)})},{immediate:!0,deep:!0}),Je(A,(Ie,je)=>{k.value=!!(je&&Ie&&je!==Ie)}),t({refreshTable:Ge});const b_=Ie=>{Ce.value=Ie,Ge()},Dd=Ie=>{xe.value=Ie,Ge()},Td=Ie=>{P.value=Ie||[],q({},!0)},xd=Z(()=>{var Gt;const Ie=Cn.getInstance().getItem("ws.terminology"),je=Ie?JSON.parse(Ie):null;return`New ${((Gt=je==null?void 0:je.find(ko=>ko.code==="scene"))==null?void 0:Gt.name)||"Scene"}`});return(Ie,je)=>{const Qt=bs("focusable");return j(),ze(H($X),{"is-sidebar-open":S.value,onCloseSidebar:H(te),onSidebarClear:H(te),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:H(te)},{"header-left":pe(()=>{var Gt;return[((Gt=H(r))==null?void 0:Gt.has_create_item_permission)==1?(j(),ze(H(dS),{key:0,variant:["primary"],options:d.value,onSelect:tt,onHandleClick:je[1]||(je[1]=ko=>tt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:pe(()=>[Ue(ce(H(ct),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:je[0]||(je[0]=ko=>tt("new_scene")),label:xd.value},null,8,["label"]),[[Qt,1]])]),_:1},8,["options"])):Ze("",!0),ge("div",{class:J(Ie.$style["beta-tag"])},"Beta",2),Ue((j(),ae("span",kCe,[nt(yt(bt.value),1)])),[[H(a),Ut.value||""]])]}),"header-actions":pe(()=>[ce(H(hee),{"onUpdate:assignees":Dd,onApplyFilter:b_,loading:H(le),entityId:h.entityId},null,8,["loading","entityId"]),Ue(ce(H(Qb),{focusIndex:"4",modelValue:C.value,"onUpdate:modelValue":je[2]||(je[2]=Gt=>C.value=Gt),onSearch:H(me),class:J(Ie.$style.itemSearchBox),onClear:je[3]||(je[3]=Gt=>H(me)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[H(n),{isLoading:H(le),fullwidth:!0}]]),Ue((j(),ze(H(NA),{status:H(V)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":k.value},{default:pe(()=>[Ue((j(),ze(H(ct),{variant:["secondary","icon"],disabled:H(V),onClick:Ge},{default:pe(()=>[ce(H(rt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[Qt,5],[H(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[H(n),{isLoading:H(le),fullwidth:!0}]]),ce(ACe,{loading:H(le),entityId:h.entityId,workspaceId:h.workspaceId},null,8,["loading","entityId","workspaceId"]),Ue(ce(H(hQ),{"model-value":H(P),onChange:je[4]||(je[4]=Gt=>Td(Gt)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:U,"checkbox-column":H($),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[H(n),{isLoading:H(le),fullwidth:!0}]])]),grid:pe(({availableHeight:Gt})=>[ce(H(mCe),qt({id:"item_table_main",ref_key:"agGrid",ref:Fe},Ft.value,{height:Gt+"px",isSorting:H(ee),onOnGridReady:Hi,onSelectionChanged:Do}),null,16,["height","isSorting"])]),footer:pe(()=>[ge("div",{class:J(Ie.$style.tableFooter),id:"table_footer"},[ge("span",null,[je[5]||(je[5]=nt(" Showing ",-1)),ge("b",null,yt(H(b).loaded)+" of "+yt(H(b).total),1)])],2)]),"new-row":pe(()=>[ce(H(UQ),{ref_key:"createNewSceneRef",ref:kt,onSearchForCode:hi,onFocusOnId:ma},null,512)]),"bulk-update-actions":pe(()=>[Ue(ce(H(AX),{selectRowData:be.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:H(ke),onSelectAll:H(Ye),"take-name":z.value,"selected-all":Ke.value,"total-rows":H(b).total,"visible-rows":H(b).loaded,onUpdated:Qe,loading:H(V)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"]),[[_i,!S.value&&v.value.length>0]])]),snackbar:pe(()=>[ce(H(SJ))]),popup:pe(()=>[ce(Yne,{ref_key:"popupCreateSceneRef",ref:Nt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ge},null,8,["workspace-id","entity-id"]),ce(ICe,{ref_key:"popupOverwriteScenesRef",ref:on,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ge},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"])}}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),mB="0.1.66",MCe={key:0},NCe=St(it({__name:"app",setup(e){const t=Z(()=>n.id.length===0||n.workspaceId.length===0),n=Cs({id:"",workspaceId:"",apiConfig:{}}),o=cf(),{showMessage:s,showErrorNetMessage:i}=o,r=["basicInfor"],a=h=>{h.success?s(h.apiCode,"success"):r.includes(h.apiCode)||i(h)},l=B(null),c=()=>{const h=Cn.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Zp(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",mB);try{if(l.value=So(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||Cn.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:Cn.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new Ak(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),lo(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=Z(()=>n.id),d=Z(()=>n.workspaceId);return qi("workspaceId",d),qi("entityId",u),(h,f)=>(j(),ae("div",{class:J(h.$style.dashboardPluginWrapper)},[t.value?(j(),ae("span",MCe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(j(),ze(H(OCe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ze("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),C_=async(e={},t={})=>{const n=E1(NCe),o=Xq();n.use(o);const s=["apiConfig","workspaceId","id"],i={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,i[a]=l,s.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=i,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${mB}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",Yt),n.directive("focusable",Ur);const r=await jne();return n.use(r),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=C_),kn.default=C_,kn.initDashboard=C_,Object.defineProperties(kn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});