@arbocollab/arbo-plugin-item-table 0.1.86 → 0.1.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/es/index.es.js +1527 -1526
- package/lib/style.css +1 -1
- package/lib/umd/index.umd.js +4 -4
- package/package.json +1 -1
package/lib/umd/index.umd.js
CHANGED
|
@@ -138,12 +138,12 @@ Only state can be modified.`);r[0]="$state",Su=!1,s.set(i,r,s.state.value),Su=!0
|
|
|
138
138
|
state: () => new MyClass()
|
|
139
139
|
Found in store "${T.$id}".`),p&&i&&n.hydrate&&n.hydrate(T.$state,p),c=!0,u=!0,T}/*! #__NO_SIDE_EFFECTS__ */function Yl(e,t,n){let s;const o=typeof t=="function";s=o?n:t;function i(r,a){const l=ww();if(r=(j.env.NODE_ENV==="test"&&jl&&jl._testing?null:r)||(l?Sn(wm,null):null),r&&Kh(r),j.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)"?
|
|
140
140
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
141
|
-
This will fail in production.`);r=jl,r._s.has(e)||(o?Ub(e,t,s,r):kA(e,s,r),j.env.NODE_ENV!=="production"&&(i._pinia=r));const c=r._s.get(e);if(j.env.NODE_ENV!=="production"&&a){const u="__hot:"+e,d=o?Ub(u,t,s,r,!0):kA(u,Qo({},s),r,!0);a._hotUpdate(d),delete r.state.value[u],r._s.delete(u)}if(j.env.NODE_ENV!=="production"&&Yr){const u=bs();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 Xs(e){const t=Mt(e),n={};for(const s in t){const o=t[s];o.effect?n[s]=Z({get:()=>e[s],set(i){e[s]=i}}):(pn(o)||Ho(o))&&(n[s]=wi(e,s))}return n}const Wb=Yl("permissionStore",()=>{const e=V([]),t=V(),n=V({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:r=>{e.value=r},setEntityPermissions:r=>{t.value=r},setItemPermission:(r,a)=>{n.value[r]=a}}}),Yq="woohoo_getWoohooUserInterface_read",zb="media_getReviewUserInterface_read",Zq="update_getUpdateUserInterface_read",Xq=(e,t,n,s,o,i)=>{const r=Wb(),{userPermissions:a}=Xs(r),l=Z(()=>{const A=En.getInstance().getItem("BASE_URL"),O=En.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:I,entity_id:D,scene_id:x}=e.value;return{baseDomain:A||"",ws_code:I||"",entity_id:D||"",scene_id:x||"",reviewDomain:O||"",take_id:D||"",woohoo_id:D||"",parent_id:D||""}}),c=Z(()=>{var O;const A=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:a.value.includes(zb),canCopyLink:!0,canRename:(A==null?void 0:A.has_edit_permission)??!1,canOpenTakeInReview:a.value.includes(zb),canOpenTakeInUpdate:a.value.includes(Zq),canOpenTakeInWoohoo:a.value.includes(Yq),canDeleteRendition:((O=A==null?void 0:A.media)==null?void 0:O.has_delete_rendition_permission)??!1,canDeleteThumbnail:(A==null?void 0:A.has_edit_thumbnail_permission)??!1,canArchiveScene:A==null?void 0:A.has_archive_permission,canUnarchiveScene:A==null?void 0:A.has_archive_permission,canDeleteScene:(A==null?void 0:A.has_delete_permission)??!1}}),u=Z(()=>({project:To({type:"project",config:l.value}).url,take_review:To({type:"review_take",config:l.value}).url,review:To({type:"review_scene",config:l.value}).url,review_scene:To({type:"review_scene",config:l.value}).url,woohoo:To({type:"woohoo",config:l.value}).url,update:To({type:"update",config:l.value}).url,scene_hub:To({type:"scene_hub",config:l.value}).url})),d=(A,O)=>{const I=A.metaKey||A.ctrlKey,D=u.value[O]||"";if(D){if(O==="scene_hub"){if(I){window.open(D,"_blank");return}if(!s){console.error("Switch instance not found.",{openSceneHub:s,windowFunc:globalThis.window.$switchInstance});return}s(l.value.scene_id||"");return}I?window.open(D,"_blank"):window.location.href=D}},h=async(A,O)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.deleteRendition({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""],deleteAll:!0}));(D==null?void 0:D.message)!="Done"&&console.error("Failed to delete rendition.")}catch(D){console.error("Error deleting rendition",D)}finally{o()}},f=async(A,O)=>{var I;try{await((I=e.value.axiosService.value)==null?void 0:I.deleteThumbnail({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""]}))}catch(D){console.error("Error deleting thumbnail",D)}finally{o()}},p=async(A,O)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.archiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(D==null?void 0:D.message)!="Done"&&console.error("Failed to archive scene."),O&&O("archived")}catch(D){console.error("Error archiving item",D)}finally{o()}},g=async(A,O)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.deleteScene(l.value.ws_code,l.value.entity_id,l.value.scene_id));(D==null?void 0:D.message)!="Done"&&console.error("Failed to delete scene."),O&&O("deleted")}catch(D){console.error("Error deleting item",D)}finally{o()}},v=A=>{const O=u.value.scene_hub||"";O&&(E.value="Copied",navigator.clipboard.writeText(O),setTimeout(()=>{E.value="Copy link"},5e3))},y=async(A,O)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.unarchiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(D==null?void 0:D.message)!="Done"&&console.error("Failed to unarchive scene."),O&&O("unarchived")}catch(D){console.error("Error unarchiving item",D)}finally{o()}},b=A=>p(A,t),S=A=>y(A,t),C=A=>g(A,t),E=V("Copy link"),R=A=>d(A,"review"),T=Z(()=>{let A=[];if(!l.value.scene_id&&e.value.optionBlock&&A.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length)return e.value.optionBlock;const O=()=>Math.random().toString(36).substring(2,9);return[{id:O(),type:"column",groupLabel:"Download Options",options:[{id:"open_review",label:"Open Review",icon:"PenRuler",action:R,hide:!c.value.canOpenReview,disabled:!c.value.canOpenReview,description:"",type:"icon"},{id:O(),label:E.value,icon:"Link",action:v,hide:!c.value.canCopyLink,disabled:!c.value.canCopyLink,description:"",type:"icon"}]},{id:O(),type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:b,hide:c.value.canArchiveScene==0,disabled:c.value.canArchiveScene!==1,description:c.value.canArchiveScene==-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:S,hide:c.value.canUnarchiveScene==0,disabled:c.value.canUnarchiveScene!==1,description:c.value.canUnarchiveScene===-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:C,hide:!c.value.canDeleteScene,type:"icon"}]}]});return{linkMap:u,handleOpen:d,copyLink:v,deleteRendition:h,deleteThumbnail:f,archiveItem:p,deleteItem:g,unArchiveItem:y,options:T}};function ms(e){const t=V(!1),n=V(!1),s=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}}),o=()=>{t.value=!0,Ct(()=>{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 Zt(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.addEventListener("focus",o),c.addEventListener("blur",i)),u&&(u.addEventListener("mouseenter",r),u.addEventListener("mouseleave",a))}),Qn(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.removeEventListener("focus",o),c.removeEventListener("blur",i)),u&&(u.removeEventListener("mouseenter",r),u.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:s,handleFocus:o}}const _u=e=>{const t=V(!1),n=Z(()=>t.value);return Zt(()=>{var a,l,c,u;const s=(a=e.params)==null?void 0:a.api,o=(l=e.params)==null?void 0:l.node,i=o==null?void 0:o.rowIndex,r=(u=(c=e.params)==null?void 0:c.colDef)==null?void 0:u.field;return s==null||s.addEventListener("cellEditingStarted",d=>{d.rowIndex===i&&d.colDef.field===r&&(t.value=!0)}),s==null||s.addEventListener("cellEditingStopped",d=>{d.rowIndex===i&&d.colDef.field===r&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}},OA=St(it({__name:"StatusBadge",props:{size:{default:16},color:{default:"#02C39A"},label:{default:""},status:{default:void 0},statusTooltip:{default:"Online"},showBadge:{type:Boolean,default:!0},loading:{type:Boolean}},setup(e){const t=So,{triggerRef:n,popupRef:s}=us({toggleOnClick:!0,trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),o=Z(()=>{switch(i.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"transparent"}}),i=e;return(r,a)=>(W(),ae("div",{class:ee(r.$style["status-badge-wrapper"]),style:ln({"--badge-size":`${i.size}px`,"--badge-color":o.value})},[Tt(r.$slots,"default"),We(be("div",{class:ee(r.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[Ei,i.showBadge],[U(t),{isLoading:i.loading,fullwidth:!0}]]),be("div",{ref_key:"popupRef",ref:s,class:ee(r.$style["badge-tooltip"])},mt(i.statusTooltip),3)],6))}}),[["__cssModules",{$style:{"status-badge-wrapper":"_status-badge-wrapper_30ykl_1","badge-indicator":"_badge-indicator_30ykl_6",active:"_active_30ykl_19",offline:"_offline_30ykl_22",busy:"_busy_30ykl_25",away:"_away_30ykl_28","badge-tooltip":"_badge-tooltip_30ykl_32"}}]]),qh=Yl("switchStore",()=>{const e=V(null),t=Sn("switchInstance");return{openSceneHub:(o,i)=>{if(o){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");t("scene_hub",{id:o,commentId:i},{showLoading:!1})}},openPeopleInsight:o=>{const i=t||e.value;if(!i)throw console.error("Switch instance not found"),new Error("Switch instance not found");o||console.trace("No people_id provided, defaulting to empty string"),i("people_insight",{tab:"home",id:o||""},{showLoading:!1})},switchInstanceFunc:e}}),Jq=it({__name:"MiniPeopleCard",props:{user:{},status:{default:void 0},timezone:{default:om()},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,s=So,o=e,i=t,r={active:"Active in the workspace in the last 10 minutes.",offline:"Logged out from account.",busy:"User is busy",away:"No activity in the workspace within the last 10 minutes"},a=V(o.status),l=V(o.timezone),c=V(!0),u=V(null),d=Z(()=>r[a.value]),h=Z(()=>{var x;return(x=o.user)==null?void 0:x.name}),f=V(!1),p=V(new Date);let g;Zt(async()=>{g=setInterval(()=>{p.value=new Date},6e4)}),_l(()=>{g&&clearInterval(g)});const v=Z(()=>{if(!l.value)return"";try{return p.value.toLocaleTimeString("en-US",{timeZone:l.value,hour:"numeric",minute:"2-digit",hour12:!0})}catch{return console.error("Invalid timezone:",l.value),""}}),y=async()=>{var x,P,M;if(o.apiUpdateFunction)try{const B=await o.apiUpdateFunction(o.user.id);if(!B){f.value=!0,console.error("No data returned from API");return}(x=B==null?void 0:B.private_info)!=null&&x.is_offline?a.value="offline":(P=B.private_info)!=null&&P.last_active?a.value="active":a.value="away",(M=B.private_info)!=null&&M.timezone&&(l.value=B.private_info.timezone),i("dataUpdated",B)}catch(B){f.value=!0,console.error("Failed to fetch user data:",B)}finally{c.value=!1}},b=()=>{!o.apiUpdateFunction||!o.enableAutoRefresh||(u.value!==null&&clearInterval(u.value),u.value=setInterval(y,o.refreshInterval))},S=()=>{u.value!==null&&(clearInterval(u.value),u.value=null)},C=Z(()=>{const x=globalThis.location.origin,P=En.getInstance().getItem("ws.code");return To({type:"people_insight",config:{ws_code:P,baseDomain:x,user_id:o.user.id}}).url}),{copyToClipboard:E,tooltip:R}=PF(C.value,()=>i("copyLink",o.user.id)),T=qh(),{openPeopleInsight:A}=T,O=x=>{if(x.ctrlKey||x.metaKey){window.open(C.value,"_blank");return}try{A(String(o.user.id))}catch{window.open(C.value,"_blank")}},I=x=>{O(x),i("insightClick",o.user.id)};Je([()=>o.enableAutoRefresh,()=>o.refreshInterval,()=>o.apiUpdateFunction],()=>{S(),o.enableAutoRefresh&&o.apiUpdateFunction&&b()}),Zt(async()=>{o.apiUpdateFunction&&(await y(),b())}),Qn(S);const D=Z(()=>({name:o.user.name,initial:o.user.initial,id:o.user.id,profile_image:o.user.profile_image,color:o.user.color,size:72,borderRadius:"20px"}));return(x,P)=>(W(),ae("div",{class:ee([x.$style["mini-people-card"],{[x.$style.loading]:c.value},"bg-skeleton"])},[be("div",{class:ee(x.$style["avatar-section"])},[!o.private&&!f.value?(W(),Ke(OA,{key:0,size:12,status:a.value,loading:c.value,"status-tooltip":d.value},{default:ye(()=>[fe(bh,Jt({readOnly:!0},D.value,{borderRadius:"8px"}),null,16)]),_:1},8,["status","loading","status-tooltip"])):(W(),Ke(bh,Jt({key:1,readOnly:!0},D.value,{borderRadius:"8px"}),null,16))],2),be("div",{class:ee(x.$style["user-info"])},[be("div",{class:ee(x.$style["info-column"])},[We((W(),ae("span",{class:ee(x.$style["user-name"])},[nt(mt(h.value),1)],2)),[[U(n),{content:h.value,delay:[1e3,0]}]]),l.value&&!f.value?(W(),ae("div",{key:0,class:ee([x.$style["info-row"],x.$style["time-row"]])},[We((W(),ae("div",{class:ee(x.$style["time-display"])},[fe(at,{source:"remote",src:"Globe",class:ee(x.$style["clock-icon"]),size:"10"},null,8,["class"]),be("span",{class:ee(x.$style["time-text"])},mt(v.value)+" ("+mt(e.timezone)+")",3)],2)),[[U(s),{isLoading:c.value,fullwidth:!0}]])],2)):Ye("",!0)],2),!e.readOnly&&!o.private&&!f.value?(W(),ae("div",{key:0,class:ee([x.$style["info-row"],x.$style.actions])},[e.showInsightButton?(W(),Ke(gt,{key:0,label:"Insights",variant:"secondary",size:"small",onClick:Pt(I,["prevent","stop"]),disabled:o.disabled},null,8,["disabled"])):Ye("",!0),e.showCopyLinkButton?We((W(),Ke(gt,{key:1,variant:["icon","secondary"],size:"small","aria-label":"Copy link",onClick:Pt(U(E),["prevent","stop"]),disabled:o.disabled},{default:ye(()=>[fe(at,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[U(n),{content:U(R),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Ye("",!0)],2)):Ye("",!0)],2)],2))}}),Qq=St(Jq,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_8t908_1",loading:"_loading_8t908_25","avatar-section":"_avatar-section_8t908_28","user-info":"_user-info_8t908_33","info-column":"_info-column_8t908_42","info-row":"_info-row_8t908_50","time-row":"_time-row_8t908_56","time-display":"_time-display_8t908_62","time-text":"_time-text_8t908_70",actions:"_actions_8t908_79","status-badge":"_status-badge_8t908_83",active:"_active_8t908_96",offline:"_offline_8t908_99",busy:"_busy_8t908_102",away:"_away_8t908_105","user-local-time":"_user-local-time_8t908_108","clock-icon":"_clock-icon_8t908_116",separator:"_separator_8t908_128",timezone:"_timezone_8t908_131","refresh-btn":"_refresh-btn_8t908_134",spinning:"_spinning_8t908_137",spin:"_spin_8t908_137","insight-btn":"_insight-btn_8t908_140","copy-link-btn":"_copy-link-btn_8t908_144","last-update":"_last-update_8t908_147","user-name":"_user-name_8t908_153","loading-overlay":"_loading-overlay_8t908_166","loading-spinner":"_loading-spinner_8t908_178"}}]]),eY=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=Gr,s=Yt,o=e,{isEditing:i}=_u(o),r=()=>{var h,f;const u=(h=o.params)==null?void 0:h.api,d={rowIndex:(f=u==null?void 0:u.getRowNode(String(o.id)))==null?void 0:f.rowIndex,colKey:"options"};u==null||u.startEditingCell(d)},a=Z(()=>{var d,h;const u=(h=(d=o.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(o.id));return((u==null?void 0:u.rowIndex)??0)+10}),l=()=>{var u,d;(d=(u=o.params)==null?void 0:u.api)==null||d.stopEditing()},c=V();return t({focus(){var u;(u=c.value)==null||u.focus()},blur(){var u;(u=c.value)==null||u.blur()}}),(u,d)=>We((W(),Ke(gt,{class:ee(u.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:U(i),onClick:Pt(r,["stop"]),onEscape:l,ref_key:"buttonRef",ref:c},{default:ye(()=>[fe(at,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[U(s),"More actions"],[U(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_w8s4g_1"}}]]),tY=["src","width","height","alt"],Rm=St(it({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=So,{getCachedValue:n,setCachedValue:s}=wh({dbName:"visual-cache-db",storeName:"visuals"}),o=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:o(i.minWidth),maxWidth:o(i.maxWidth),minHeight:o(i.minHeight),maxHeight:o(i.maxHeight),aspectRatio:i.ratio,width:o(i.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await s(h,f)},c=Z(()=>({name:i.src,size:Number(i.size||100),color:""})),{url:u,loading:d}=zT(c,"visual",l,a);return(h,f)=>We((W(),ae("div",{class:ee([h.$style.visualWrapper,{[h.$style.loading]:U(d)}]),style:ln(r.value)},[be("img",{src:U(u),width:e.size,height:e.size,alt:"visual-"+e.src,style:ln(r.value)},null,12,tY)],6)),[[U(t),{isLoading:U(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),nY=["tabindex"],vs=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 s=e,o=n;Xp();const i=dg(),r=V(null),a=V("default"),l=Z(()=>{if(typeof s.size=="number")return`${s.size}px`;switch(s.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]:s.disabled,[i.readOnly]:s.readOnly,[i.error]:s.error,[i.clickable]:s.clickable,[i.active]:s.actived,[i.hovered]:s.hovered,[i.focused]:!s.readOnly&&!s.disabled&&s.focused,[i.bordered]:s.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=V("100%"),f=()=>{h.value=d()};qd(()=>{f()}),Zt(()=>{f()});const p=g=>{a.value=g};return t({rootEl:r,updateState:p,componentState:a,focus:()=>{Ct(()=>{var g;(g=r.value)==null||g.focus()})},escape:()=>{o("escape")}}),(g,v)=>(W(),ae("div",{ref_key:"rootEl",ref:r,class:ee([U(i)["display-wrapper"],u.value]),tabindex:e.tabIndex,style:ln({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":c.value})},[Tt(g.$slots,"prefix",{hovered:s.hovered,focused:s.focused}),Tt(g.$slots,"default",{hovered:s.hovered,focused:s.focused,updateComponentState:p,disabled:s.disabled}),Tt(g.$slots,"suffix",{hovered:s.hovered,focused:s.focused})],14,nY))}}),[["__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"}}]]),sY=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const oY=Object.prototype.toString,iY=e=>oY.call(e)==="[object Object]",Ru=()=>{};function rY(e,t){function n(...s){return new Promise((o,i)=>{Promise.resolve(e(()=>t.apply(this,s),{fn:t,thisArg:this,args:s})).then(o).catch(i)})}return n}function aY(e,t={}){let n,s,o=Ru;const i=l=>{clearTimeout(l),o(),o=Ru};let r;return l=>{const c=Mr(e),u=Mr(t.maxWait);return n&&i(n),c<=0||u!==void 0&&u<=0?(s&&(i(s),s=void 0),Promise.resolve(l())):new Promise((d,h)=>{o=t.rejectOnCancel?h:d,r=l,u&&!s&&(s=setTimeout(()=>{n&&i(n),s=void 0,d(r())},u)),n=setTimeout(()=>{s&&i(s),s=void 0,d(l())},c)})}}function jb(e){return Array.isArray(e)?e:[e]}function lY(e,t=200,n={}){return rY(aY(t,n),e)}function cY(e,t,n){return Je(e,t,{...n,immediate:!0})}const MA=sY?window:void 0;function Yh(e){var t;const n=Mr(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function Kb(...e){const t=(s,o,i,r)=>(s.addEventListener(o,i,r),()=>s.removeEventListener(o,i,r)),n=Z(()=>{const s=jb(Mr(e[0])).filter(o=>o!=null);return s.every(o=>typeof o!="string")?s:void 0});return cY(()=>{var s,o;return[(s=(o=n.value)===null||o===void 0?void 0:o.map(i=>Yh(i)))!==null&&s!==void 0?s:[MA].filter(i=>i!=null),jb(Mr(n.value?e[1]:e[0])),jb(U(n.value?e[2]:e[1])),Mr(n.value?e[3]:e[2])]},([s,o,i,r],a,l)=>{if(!(s!=null&&s.length)||!(o!=null&&o.length)||!(i!=null&&i.length))return;const c=iY(r)?{...r}:r,u=s.flatMap(d=>o.flatMap(h=>i.map(f=>t(d,h,f,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function qb(e,t,n={}){const{window:s=MA,ignore:o=[],capture:i=!0,detectIframe:r=!1,controls:a=!1}=n;if(!s)return a?{stop:Ru,cancel:Ru,trigger:Ru}:Ru;let l=!0;const c=v=>Mr(o).some(y=>{if(typeof y=="string")return Array.from(s.document.querySelectorAll(y)).some(b=>b===v.target||v.composedPath().includes(b));{const b=Yh(y);return b&&(v.target===b||v.composedPath().includes(b))}});function u(v){const y=Mr(v);return y&&y.$.subTree.shapeFlag===16}function d(v,y){const b=Mr(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=Yh(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=[Kb(s,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:i}),Kb(s,"pointerdown",v=>{const y=Yh(e);l=!c(v)&&!!(y&&!v.composedPath().includes(y))},{passive:!0}),r&&Kb(s,"blur",v=>{setTimeout(()=>{var y;const b=Yh(e);((y=s.document.activeElement)===null||y===void 0?void 0:y.tagName)==="IFRAME"&&!(b!=null&&b.contains(s.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 uY=["value","placeholder","disabled","readonly","inputmode","maxlength"],Yb=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},maxDecimalChar:{},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 s=Gr,o=Yt,i=e,r=n,a=V(null),l=V(i.modelValue||"");Je(l,()=>{r("onValidation",l.value)});const c=V(!1),u=V(i.modelValue||"");Je(()=>i.modelValue,k=>{l.value=k||"",u.value=k||""});const d=Z(()=>{var k;return((k=l.value)==null?void 0:k.length)>0}),h={text:k=>k.slice(0,i.maxLength||255),number:k=>{let N=k.replace(/[^\d.-]/g,"");const Q=N.split(".");Q.length>2&&(N=Q[0]+"."+Q.slice(1).join("")),N=N.replace(/-/g,(X,De)=>De===0?X:"");const xe=N.startsWith("-")?"-":"",de=N.replace("-","").split(".");return de[0].length>17&&(de[0]=de[0].substring(0,17)),i.maxDecimalChar!==void 0&&de.length>1&&(de[1]=de[1].substring(0,i.maxDecimalChar)),N=xe+de.join("."),N},email:k=>k.replace(/\s/g,"").slice(0,i.maxLength||255),url:k=>k.replace(/\s/g,"").slice(0,i.maxLength||255),tel:k=>k.replace(/[^\d+\-() ]/g,"").slice(0,i.maxLength||20)},f=k=>{const N=h[i.type];return N?N(k):k},p=lY(k=>{i.autoEmit&&(r("update:modelValue",k),r("input",k))},i.debounceDelay),g=k=>{const N=k;if(i.disabled||i.readOnly){N.preventDefault();return}const Q=N.target,ce=Q.selectionStart||0,xe=l.value,ge=f(Q.value);xe!==ge&&(l.value=ge,r("input",ge),i.autoEmit&&p(ge),Q.value!==ge&&(Q.value=ge,Ct(()=>{let de=ce;if(ge.length<Q.value.length)de=ce;else{const X=ge.length-xe.length;de=ce+X}de=Math.max(0,Math.min(de,ge.length)),Q.setSelectionRange(de,de)})))},v=k=>{if(i.disabled||i.readOnly){k.preventDefault();return}c.value=!0;const N=l.value;l.value="",r("update:modelValue",""),r("clear"),N!==""&&r("change",""),k.preventDefault(),k.stopImmediatePropagation(),k.stopPropagation(),Ct(()=>{var Q;(Q=a.value)==null||Q.focus(),setTimeout(()=>{c.value=!1},100)})},y=k=>{i.disabled||i.readOnly||(r("focus",k),i.selectOnFocus&&Ct(()=>{k.target.select()}))},b=k=>{if(c.value)return;const Q=k.target.value;i.autoEmit||r("update:modelValue",Q),u.value!==Q&&(r("change",Q),u.value=Q),r("blur",Q,k)},S=k=>{setTimeout(()=>{Ct(()=>{const Q=k.target.value;r("enter",Q,k),r("enterValue",Q),i.submitOnEnter&&(k.preventDefault(),i.autoEmit||r("update:modelValue",Q),u.value!==Q&&(r("change",Q),u.value=Q))})},1e3)},C=k=>{const N=k.target,Q=N.value;if(r("escape",Q,k),k.preventDefault(),k.stopImmediatePropagation(),k.stopPropagation(),i.autoEmit){r("cancel"),i.blurOnEscape&&N.blur();return}l.value=i.modelValue||"",a.value&&(a.value.value=l.value),r("cancel"),i.blurOnEscape&&N.blur()},E=k=>{const Q=k.target.value;r("tab",Q,k),i.autoEmit||(r("update:modelValue",Q),u.value!==Q&&(r("change",Q),u.value=Q))},R=(k,N,Q)=>k===""?!0:k==="."?Q>0:new RegExp(`^\\d{0,${N}}(\\.\\d{0,${Q}})?$`).test(k),T=k=>{if(r("keydown",k),k.key===" "&&k.stopPropagation(),i.type==="number"){if(k.key==="e"||k.key==="E"){k.preventDefault();return}if(!(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"].includes(k.key)||k.ctrlKey||k.metaKey||k.altKey)){if(Number.isNaN(Number(k.key))&&k.key!=="."&&k.key!=="-"){k.preventDefault();return}const ce=l.value+k.key;if(!R(ce,17,i.maxDecimalChar||2)){k.preventDefault(),console.log("BLOCKED",ce);return}}}k.key==="Escape"?C(k):k.key==="Enter"?S(k):k.key==="Tab"?E(k):(k.key==="ArrowUp"||k.key==="ArrowDown")&&i.type==="number"&&k.preventDefault()},A=k=>{r("keyup",k)},O=k=>{if(i.disabled||i.readOnly){k.preventDefault();return}r("paste",k)},I=k=>{if(i.disabled||i.readOnly){k.preventDefault();return}r("cut",k)},D=k=>{r("select",k)},x=`input-text-${Math.random().toString(36).substr(2,9)}`,P=V(!1),M=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,k=>{i.validatorFnc?P.value=!!k&&!i.validatorFnc(k):P.value=!1});const B=V(null),Y=Z(()=>({disabled:i.disabled,readOnly:i.readOnly,error:P.value,inputRef:a,clickable:!i.disabled&&!i.readOnly,focused:i.focused,wrapperRef:B,bordered:!0})),{argsMain:ne,isHover:te,isFocus:z}=ms(Y);t({triggerFocus:()=>{Ct(()=>{var k;(k=a.value)==null||k.focus()})},focus:()=>{pe()},blur:()=>{Ct(()=>{var k;(k=a.value)==null||k.blur()})},select:()=>{Ct(()=>{var k;(k=a.value)==null||k.select()})},setSelectionRange:(k,N)=>{Ct(()=>{var Q;(Q=a.value)==null||Q.setSelectionRange(k,N)})},getValue:()=>l.value,setValue:k=>{l.value=f(k),a.value&&(a.value.value=l.value)},reset:()=>{l.value=i.modelValue||"",a.value&&(a.value.value=l.value)}});const pe=()=>{!i.disabled&&!i.readOnly&&Ct(()=>{var k;(k=a.value)==null||k.focus()})},q=Z(()=>z.value&&d.value);return(k,N)=>(W(),ae("div",{class:ee([k.$style["input-wrapper"],"input-editor"]),onClick:pe},[We((W(),Ke(vs,Jt(U(ne),{ref_key:"wrapperRef",ref:B,class:[k.$style["input-box"],{[k.$style["is-hovered"]]:U(te),[k.$style["is-focused"]]:U(z),[k.$style["has-input"]]:d.value,[k.$style["is-editting"]]:q.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:i.bordered}),{prefix:ye(()=>[Tt(k.$slots,"prefix")]),suffix:ye(()=>[d.value&&!i.disabled&&!i.readOnly?Tt(k.$slots,"clear",{key:0},()=>[We((W(),Ke(gt,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:Pt(v,["prevent","stop"]),size:18,rounded:!0,class:ee(["wrapper-suffix",k.$style["clear-button"]])},{default:ye(()=>[fe(at,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[U(o),{content:"Clear",contentClass:"extra-padding"}]])]):Tt(k.$slots,"suffix",{key:1})]),default:ye(()=>[be("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:"text",value:l.value,placeholder:e.placeholder,class:ee([k.$style["column-config__input"]]),id:x,disabled:e.disabled,readonly:e.readOnly,inputmode:M.value,maxlength:i.maxLength,onInput:g,onFocus:y,onBlur:b,onKeydown:T,onKeyup:A,onPaste:O,onCut:I,onSelect:D},null,42,uY)]),_:3},16,["class","bordered"])),[[U(s),i.focusIndex]]),P.value?Tt(k.$slots,"error",{key:0}):Ye("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_wqanj_1","is-disabled":"_is-disabled_wqanj_16","is-readonly":"_is-readonly_wqanj_16","is-hovered":"_is-hovered_wqanj_16","is-focused":"_is-focused_wqanj_20","column-config__input":"_column-config__input_wqanj_40","clear-button":"_clear-button_wqanj_55"}}]]),dY={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},Zb=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 s=e,o=n,i=V(null),r=Ri(c=>{o("update:modelValue",c),o("search",c)},sr),a=()=>{o("update:modelValue",""),o("clear"),Ct(()=>{var c;(c=i.value)==null||c.focus()})},l=V(s.modelValue);return t({focus:()=>{var c;(c=i.value)==null||c.focus()},setValue(c){l.value=c}}),(c,u)=>(W(),Ke(Yb,{focusIndex:s.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:U(r),onClear:a,onCancel:u[1]||(u[1]=d=>o("cancel")),"auto-emit":!0},{prefix:ye(()=>[be("div",dY,[fe(at,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),Zl=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 s=e,o=n,i=V(!1),r=V(!1);function a(C){if(!C||typeof C!="object")return!1;const E=C;return typeof E.name=="string"&&typeof E.id=="string"&&typeof E.initial=="string"}const l=Z(()=>s.type==="status"||s.type==="assignee"||s.type==="icon"||!!S.prefix),c=Z(()=>!!S.suffix||s.danger&&i.value),u=Z(()=>{var C;return s.type==="status"&&typeof((C=s.data)==null?void 0:C.color)=="string"?{backgroundColor:s.data.color,border:Pg(s.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),d=dg(),h=Z(()=>({[d.active]:s.selected??!1,[d.disabled]:s.disabled??!1,[d.hover]:s.hover??!1,[d.clickable]:(s.clickable??!0)&&!s.disabled,[d.danger]:s.danger??!1,[d["has-prefix"]]:l.value,[d["has-suffix"]]:c.value,[d.readOnly]:s.readOnly}));Z(()=>({content:"Cancel",...b})),Z(()=>({content:"Confirm",theme:"warning",...b}));function f(C){return{name:C.name,initial:C.initial,id:C.id,profile_image:C.profile_image??null,color:C.color,size:24}}function p(){i.value=!1}function g(C){C?o("click",C):(s.clickable??!0)&&(o("update:selected",!s.selected),o("select",!s.selected))}function v(C){if(!s.disabled){if(s.danger&&!i.value){i.value=!0;return}else s.danger||g(C);o("handleClick",C)}}const y=()=>{i.value?p():o("escape")},b=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),S=Xp();return Je(()=>s.show,C=>{C===!1&&(i.value=!1)}),t({select:()=>{v(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(C,E)=>{const R=wo("focusable"),T=wo("tooltip");return We((W(),Ke(gt,{variant:["menu-item",e.danger?"danger":"menu-item"],class:ee([C.$style["list-item"],h.value]),onHandleClick:v,onMouseenter:E[0]||(E[0]=A=>r.value=!0),onMouseleave:E[1]||(E[1]=A=>r.value=!1),onEscape:y},{default:ye(()=>[l.value?(W(),ae("div",{key:0,class:ee(C.$style["list-item__prefix"])},[Tt(C.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(W(),Ke(at,{key:0,src:e.icon,source:"remote",class:ee(C.$style["item-icon"])},null,8,["src","class"])):e.type==="status"?(W(),ae("div",{key:1,class:ee(C.$style["status-indicator"]),style:ln(u.value)},null,6)):e.type==="assignee"&&a(e.data)?(W(),Ke(bh,Jt({key:2},f(e.data),{class:C.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Ye("",!0)])],2)):Ye("",!0),be("div",{class:ee(C.$style["list-item__label"])},[Tt(C.$slots,"label",{selected:e.selected},()=>[nt(mt(e.label),1)])],2),c.value?(W(),ae("div",{key:1,class:ee(C.$style["list-item__suffix"])},[Tt(C.$slots,"suffix",{item:C.$props,hovered:r.value},()=>[e.danger&&i.value?(W(),ae("div",{key:0,class:ee(C.$style["confirm-action"])},[We((W(),Ke(gt,{variant:["tertiary","icon","danger"],size:"small",onClick:Pt(p,["stop","prevent"])},{default:ye(()=>[fe(at,{src:"Xmark",source:"remote"})]),_:1})),[[R,`${s.focusIndex}.0`],[T,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),We((W(),Ke(gt,{variant:["danger","primary","icon"],size:"small",onClick:Pt(g,["stop","prevent"])},{default:ye(()=>[fe(at,{src:"Check",source:"remote"})]),_:1})),[[R,`${s.focusIndex}.1`],[T,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ye("",!0)])],2)):Ye("",!0)]),_:3},8,["variant","class"])),[[R,s.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_y7vz1_1",disabled:"_disabled_y7vz1_16",danger:"_danger_y7vz1_23","has-prefix":"_has-prefix_y7vz1_26","has-suffix":"_has-suffix_y7vz1_26",clickable:"_clickable_y7vz1_40",readOnly:"_readOnly_y7vz1_43",hover:"_hover_y7vz1_47",active:"_active_y7vz1_53","list-item__prefix":"_list-item__prefix_y7vz1_78","list-item__label":"_list-item__label_y7vz1_86","list-item__suffix":"_list-item__suffix_y7vz1_100","status-indicator":"_status-indicator_y7vz1_107","item-icon":"_item-icon_y7vz1_113","arbo-icon-state":"_arbo-icon-state_y7vz1_118","item-avatar":"_item-avatar_y7vz1_121","confirm-action":"_confirm-action_y7vz1_130"}}]]),hY=["aria-activedescendant"],fY=["innerHTML"],pY=10,Xr=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:"218px"},width:{default:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const s=Yt,o={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},i=e,r=n,a=V(""),l=V(-1),c=V(null),u=V(null),d=V(new Map),h=Z(()=>db(a.value)),f=()=>{const q=h.value;if(!q||q.length<i.minQueryLength)return i.options;if(d.value.has(q))return d.value.get(q);const k=i.options.map(N=>({item:N,score:u7(` ${N.label} `,q)})).filter(({score:N})=>N>0).sort((N,Q)=>Q.score-N.score).map(({item:N})=>N);return d.value.set(q,k),k},p=V([]);Je(()=>i.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=Z(()=>i.hasMore&&!i.loading&&!i.loadingMore),v=Ri(q=>{a.value=q,l.value=-1,r("search",q)},sr),y=async q=>{z.value=0,await v(q||""),z.value=1},b=q=>a.value?d7(q,a.value):q,S=q=>{const N={[o.ARROW_DOWN]:()=>C(q),[o.ARROW_UP]:()=>E(q),[o.ENTER]:()=>A(q),[o.ESCAPE]:()=>O(q),[o.TAB]:()=>I(q)}[q.key];N&&N()},C=q=>{q.preventDefault(),R(1)},E=q=>{q.preventDefault(),R(-1)},R=q=>{const k=p.value.length;if(k===0)return;let N;q>0?N=(l.value+1)%k:l.value>0?N=l.value-1:N=k-1,l.value=N,T()},T=()=>{Ct(()=>{var k;const q=(k=u.value)==null?void 0:k.querySelectorAll('[role="menuitem"]')[l.value];q==null||q.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},A=q=>{if(q.preventDefault(),l.value>=0&&l.value<p.value.length){const N=p.value[l.value];D(N,q)}},O=q=>{q.preventDefault(),P()},I=q=>{r("tab",q)},D=(q,k)=>{!q||q.disabled||(r("select",q,k),l.value=-1,P())},x=q=>{q>=0&&q<p.value.length&&(l.value=q)},P=()=>{r("close")},M=()=>{if(!g.value||!u.value)return;const{scrollTop:q,clientHeight:k,scrollHeight:N}=u.value;N-(q+k)<=pY&&r("loadMore")},B=()=>{var q,k,N;(q=u.value)==null||q.addEventListener("scroll",M),(N=(k=te.value)==null?void 0:k.$el)==null||N.addEventListener("keydown",S)},Y=()=>{var q,k,N;(q=u.value)==null||q.removeEventListener("scroll",M),(N=(k=te.value)==null?void 0:k.$el)==null||N.removeEventListener("keydown",S)};Zt(()=>{B()}),Qn(()=>{Y()}),Je(()=>i.loading,q=>{!q&&p.value.length>0&&(l.value=-1)});const ne=q=>q?Array.isArray(i.selectedId)?i.selectedId.includes(String(q.id)):i.selectedId==q.id:!1,te=V(null);Je(l,()=>{T()}),t({focus:()=>{Ct(()=>{var q;(q=te.value)==null||q.focus()})},reset:()=>{var q;(q=te.value)==null||q.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:P,clearSearch:()=>{a.value=""},scrollTo:q=>{u.value&&(u.value.scrollTop=q)},selectIndex:q=>{q>=0&&q<p.value.length&&(l.value=q,T())}});const z=V(0);Je([()=>i.loading,()=>a.value,()=>i.options,()=>i.loadingMore],()=>{const q=i.options.length>0&&p.value.length>0,k=!q&&a.value.length>0,N=!q&&a.value.length===0;i.loading?z.value=0:q?z.value=1:k?z.value=2:N&&(z.value=3)},{immediate:!0,deep:!0});const pe=()=>{r("cancel")};return(q,k)=>(W(),ae("datalist",{ref_key:"searchListRef",ref:c,class:ee([q.$style["search-list"],z.value===3||z.value===2?q.$style.empty:"",p.value.length>8?q.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:ln({width:e.width})},[fe(Zb,{ref_key:"searchBoxRef",ref:te,modelValue:a.value,"onUpdate:modelValue":k[0]||(k[0]=N=>a.value=N),class:ee(q.$style["search-box"]),disabled:e.loading,onSearch:y,onClear:k[1]||(k[1]=N=>y("")),onCancel:pe},null,8,["modelValue","class","disabled"]),be("div",{ref_key:"popupRef",ref:u,class:ee(q.$style["list-container"]),style:ln({maxHeight:e.maxHeight})},[Tt(q.$slots,"extra-item",{query:a.value}),(W(!0),ae(xt,null,xn(p.value,(N,Q)=>We((W(),ae("div",{key:`${N.id}-${Q}`,role:"menuitem"},[Tt(q.$slots,"item",{item:N,index:Q,selectedIndex:l.value,isSelected:ne,handleSelect:D,handleItemHover:x,getHighlightedLabel:b,query:a.value,idx:Q},()=>[N.hide?Ye("",!0):(W(),Ke(Zl,Jt({key:0,ref_for:!0},N,{hover:Q===l.value,selected:ne(N),type:N.type,id:`item-${Q}`,"aria-selected":Q===l.value,onClick:ce=>D(N,ce),onMouseover:ce=>x(Q),onEscape:P}),{prefix:ye(()=>[Tt(q.$slots,"prefix-item",{item:N})]),label:ye(()=>[a.value?We((W(),ae("span",{key:0,class:ee(q.$style.match),innerHTML:b(N.label)},null,10,fY)),[[U(s),{content:N.label,delay:[1e3,0]}]]):We((W(),ae("span",{key:1,class:ee(q.$style["item-label"])},[nt(mt(N.label),1)],2)),[[U(s),{content:N.label,delay:[1e3,0]}]])]),suffix:ye(({hovered:ce})=>[Tt(q.$slots,"action",{item:N,isHovered:Q===l.value,hovered:ce,selected:l.value==Q})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover"]))])])),[[Ei,z.value===1]])),128)),z.value===0?Tt(q.$slots,"loading-more",{key:0},()=>[(W(),ae(xt,null,xn(8,N=>be("div",{class:ee(q.$style["loading-more"]),key:N},[be("div",{class:ee(q.$style["loading-skeleton"])},null,2),be("div",{class:ee(q.$style["loading-skeleton"])},null,2)],2)),64))]):Ye("",!0),z.value===2?(W(),ae("div",{key:1,class:ee(q.$style["no-results"])},[Tt(q.$slots,"empty",{query:a.value},()=>[be("div",{class:ee(q.$style["no-results-content"])},[...k[2]||(k[2]=[be("div",null,[nt(" No results. "),be("br"),nt(" Try another search. ")],-1)])],2)])],2)):Ye("",!0),z.value===3?(W(),ae("div",{key:2,class:ee(q.$style["no-results"])},[Tt(q.$slots,"empty-list",{},()=>[be("div",{class:ee(q.$style["no-results-content"])},[...k[3]||(k[3]=[be("div",null,"No items available.",-1)])],2)])],2)):Ye("",!0),Tt(q.$slots,"footer")],6)],14,hY))}}),[["__cssModules",{$style:{"search-list":"_search-list_q431s_1",empty:"_empty_q431s_9",scrollable:"_scrollable_q431s_15","list-container":"_list-container_q431s_22","item-label":"_item-label_q431s_41","loading-state":"_loading-state_q431s_49","loading-more":"_loading-more_q431s_50","loading-skeleton":"_loading-skeleton_q431s_61","is-loading":"_is-loading_q431s_68","no-results":"_no-results_q431s_123","no-results-content":"_no-results-content_q431s_130",title:"_title_q431s_133",tips:"_tips_q431s_139",match:"_match_q431s_153","skeleton-loading":"_skeleton-loading_q431s_1"}}]]),Du=it({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=XW,n=e,s=V(n.appendTo||void 0),o=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:s.value}),i=V(o());Je(()=>n,()=>{setTimeout(()=>{Ct(()=>{s.value=n.appendTo||void 0,i.value=o()})},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)=>We((W(),Ke(bh,Q_(xw(r.value)),null,16)),[[U(t),i.value]])}}),gY={class:"avatar-wrapper"},mY={class:"assignee-label"},NA=St(it({__name:"AssigneeItem",props:{user:{},hover:{type:Boolean},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},multipleSelect:{type:Boolean,default:!1},isMe:{type:Boolean},appendTo:{},apiUpdateFunction:{}},emits:["select","deselect","reselect"],setup(e,{emit:t}){const n=Yt,s=e,o=Z(()=>({name:s.user.name,id:s.user.id,profile_image:s.user.profile_image,color:{bgColor:s.user.color.bgColor,textColor:s.user.color.textColor},initial:s.user.initial})),i=Z(()=>s.isMe),r=Xp(),a=Z(()=>{if(!l.value||!r.actions)return 0;let c=0;const u=d=>{d.forEach(h=>{h.type===xt&&Array.isArray(h.children)?u(h.children):h.type!==Kn&&h.type!==_a&&c++})};return u(r.actions()),c}),l=V(!1);return(c,u)=>(W(),ae("div",{class:ee(["assignee-selector-item",{hovered:l.value||s.hover,disabled:s.disabled,selected:s.selected,single:a.value==0,focused:s.focused}]),style:ln({"--actions-count":a.value}),onMouseenter:u[0]||(u[0]=d=>l.value=!0),onMouseleave:u[1]||(u[1]=d=>l.value=!1)},[be("div",gY,[fe(Du,{user:o.value,"show-profile":!0,isMe:i.value,"append-to":s.appendTo,"api-update-function":s.apiUpdateFunction},null,8,["user","isMe","append-to","api-update-function"]),s.multipleSelect?(W(),ae("div",{key:0,class:ee(["avatar-indicator",[s.selected?"remove":"add"]])},[s.selected?(W(),Ke(at,{key:0,src:"CircleXMark"})):(W(),Ke(at,{key:1,src:"CirclePlus"}))],2)):Ye("",!0)]),We((W(),ae("div",mY,[Tt(c.$slots,"name",{},()=>[nt(mt(s.user.name),1)],!0)])),[[U(n),{content:s.user.name,delay:[1e3,0]}]]),l.value?Tt(c.$slots,"actions",{key:0},void 0,!0):Ye("",!0)],38))}}),[["__scopeId","data-v-6285207c"]]),vY={class:"unassign-icon"},Xb=St(it({__name:"UnassignBtn",props:{actived:{type:Boolean,default:!1},label:{default:"No assignee"},borderLeft:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t,s=()=>{n("click")};return(o,i)=>(W(),Ke(U(gt),{variant:"menu-item",onClick:s,actived:e.actived,style:ln({"border-top-width":0,"border-bottom-width":0,"border-left-width":e.borderLeft?"4px":"0"})},{prefix:ye(()=>[be("div",vY,[Tt(o.$slots,"icon",{},()=>[i[0]||(i[0]=be("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[be("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"#a6a6a6"})],-1))],!0)])]),default:ye(()=>[Tt(o.$slots,"label",{},()=>[nt(mt(e.label),1)],!0)]),_:3},8,["actived","style"]))}}),[["__scopeId","data-v-ec3b3a15"]]),yY=["innerHTML"],wY=20,LA=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 s=Yt,o=e,{id:i}=Np(o),r=n,a=N=>{var ce,xe;const Q=(xe=(ce=o.params)==null?void 0:ce.api)==null?void 0:xe.getRowNode(String(i.value));Q==null||Q.setDataValue("assignees",Mx(N.assignees)),k("updated"),k("update-completed")},l=V(!1),c=V(!1),u=V(null),d=V(1),h=V(!0),f=V(0),p=V(""),g=Sn("bulkUpdate",V(!1)),v=Sn("isSelectAll",V(!1)),{unAssignAll:y,replaceAssignees:b,handleSelect:S,assigneeList:C,mergedOptions:E,selectedUserIds:R}=um({...o,entityId:o.entityId,updateRowData:a,value:o.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{k("update-failed")}}),{apiServices:T}=es(!g.value,o),A=Sn("workspaceId"),O=async(N=1,Q="",ce=!1)=>{var xe,ge,de,X,De;if(!T.value||!o.id&&!o.ids)throw console.error("API service or item identifiers are undefined",T.value,o.id,o.ids),new Error("API service or item identifiers are undefined");if(ce?c.value=!0:l.value=!0,u.value=null,!((xe=T.value)!=null&&xe.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");try{const re=await((ge=T.value)==null?void 0:ge.multipleAssignableUser({workspaceId:String(A),itemIds:(o.ids??(o.id?[o.id]:[])).map(String),page:N,perPage:wY,q:Q.trim()})),Ae=((de=gu(re.data))==null?void 0:de.map(cm))??[];C.value=ce?tu(C.value,Ae,"id"):Ae,f.value=re.meta.total,h.value=(((X=re==null?void 0:re.meta)==null?void 0:X.current_page)||0)<(((De=re==null?void 0:re.meta)==null?void 0:De.last_page)||0),d.value=N}catch(re){console.error("Error fetching assignable users:",re),u.value="Failed to load assignable users"}finally{l.value=!1,c.value=!1}},I=()=>{!c.value&&h.value&&O(d.value+1,p.value,!0)},D=Ri(async N=>{p.value=N,await O(1,N,!1)},sr),x=()=>O(1,p.value,!1);Zt(()=>{var N;(N=M.value)==null||N.focus()}),t({getValue:()=>{var N;return(N=E.value.find(Q=>Q.selected))==null?void 0:N.value},refresh:x,clearInternal:()=>{R.value=[]},focus:()=>{var N;(N=M.value)==null||N.focus()}});const P=()=>{const N=En.getInstance().getItem("BASE_URL"),Q=To({type:"access_setting",config:{baseDomain:N,ws_code:o.workspaceId,entity_id:A}}).url;window.open(Q,"_blank")},M=V(null);Zt(()=>{Ct(()=>{var N;(N=M.value)==null||N.focus()})}),Je([()=>o.id,()=>o.workspaceId,()=>o.ids],()=>{O()},{deep:!0,immediate:!0});const B=N=>{var ce;const Q=En.getInstance().getItem("ws.code");return((ce=T.value)==null?void 0:ce.getUserInformation(Q,N))||Promise.resolve(null)},Y=async(N,Q,ce)=>{Q.preventDefault(),Q.stopPropagation(),Q.stopImmediatePropagation(),k("start-update");try{const xe=await S(N)}catch(xe){k("update-failed"),console.error("Error updating assignees:",xe)}finally{k("update-completed")}},ne=async()=>{try{k("start-update");const N=await y()}catch(N){k("update-failed"),console.error("Error unassigning all assignees:",N)}finally{k("update-completed")}},te=async N=>{try{k("start-update");const Q=await b(N)}catch(Q){k("update-failed"),console.error("Error replacing assignees:",Q)}finally{k("update-completed")}},z=()=>{var N,Q;r("cancel"),(Q=(N=o.params)==null?void 0:N.api)==null||Q.stopEditing()};Ki("popupAttachRef",M);const pe=V(),q=V(!1),k=(N,Q)=>{setTimeout(()=>{Ct(()=>{switch(N){case"start-update":r("start-update");break;case"update-failed":r("update-failed");break;case"update-completed":r("update-completed");break}})},500)};return Zt(()=>{Ct(()=>{setTimeout(()=>{q.value=!0},50)})}),(N,Q)=>(W(),ae("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:pe},[fe(Xr,Jt({"selected-id":U(R)},{...o},{options:U(E),loading:l.value,ref_key:"popupRef",ref:M,"loading-more":c.value,"has-more":h.value,onSelect:Q[0]||(Q[0]=(ce,xe)=>{Y(ce,xe)}),"data-wrapper":"true",onSearch:U(D),onLoadMore:I,onCancel:z,onClose:z}),Yd({"extra-item":ye(()=>[fe(Xb,{onClick:ne,actived:!1,label:"Unassign"},{icon:ye(()=>[fe(at,{src:"UserXMark",source:"remote"})]),_:1})]),item:ye(({item:ce,selectedIndex:xe,isSelected:ge,handleItemHover:de,getHighlightedLabel:X,query:De,idx:re})=>[fe(NA,{user:ce.data,"multiple-select":!0,"append-to":pe.value,isMe:!1,hover:re===xe,selected:ge(ce),onClick:Pt(Ae=>Y(ce,Ae,"click"),["stop","prevent"]),onMouseover:Ae=>de(re),"api-update-function":B},{name:ye(()=>[De?We((W(),ae("span",{key:0,class:ee([N.$style["item-label"],N.$style.match]),style:{flex:"1"},innerHTML:X(ce.label)},null,10,yY)),[[U(s),{content:ce.label}]]):We((W(),ae("span",{key:1,class:ee(N.$style["item-label"]),style:{flex:"1"}},[nt(mt(ce.label),1)],2)),[[U(s),{content:ce.label}]])]),actions:ye(()=>[We((W(),Ke(gt,{variant:"secondary",size:"small",label:"",onClick:Pt(Ae=>{var H;return te((H=ce.data)==null?void 0:H.id)},["stop"])},{default:ye(()=>[fe(at,{src:"PeopleArrows"})]),_:1},8,["onClick"])),[[U(s),"Unassign others and reassign"]])]),_:2},1032,["user","append-to","hover","selected","onClick","onMouseover"])]),"empty-list":ye(()=>[be("div",{class:ee(N.$style["empty-state"])},[Q[3]||(Q[3]=nt(" No assignee available. ",-1)),Q[4]||(Q[4]=be("br",null,null,-1)),fe(gt,{onClick:P,variant:["tertiary"],size:"small"},{default:ye(()=>[...Q[2]||(Q[2]=[nt(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[u.value?{name:"error",fn:ye(()=>[be("div",{class:ee(N.$style["error-message"])},[nt(mt(u.value)+" ",1),fe(gt,{onClick:x,size:"small"},{default:ye(()=>[...Q[1]||(Q[1]=[nt(" Retry ",-1)])]),_:1})],2)]),key:"0"}:void 0]),1040,["selected-id","options","loading","loading-more","has-more","onSearch"])],512))}}),[["__cssModules",{$style:{action:"_action_nv6on_1","item-assignee":"_item-assignee_nv6on_6","item-action":"_item-action_nv6on_6","item-label":"_item-label_nv6on_16","error-message":"_error-message_nv6on_25","empty-state":"_empty-state_nv6on_35","skeleton-avatar":"_skeleton-avatar_nv6on_48"}}]]),CY=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;Ki("bulkUpdate",!0);const s=V(!1),o=t,i=V(null),r=()=>{s.value=!0},a=()=>{Ct(()=>{setTimeout(()=>{s.value=!1},500)})},l=g=>{var v;o("update",g),(v=i.value)==null||v.clearInternal()},{triggerRef:c,popupRef:u,hide:d,isVisible:h}=us({toggleOnClick:!0,zIndex:2}),f=V(null),p=g=>{g.key==="Escape"&&u.value&&d()};return Zt(()=>{var v;const g=f.value instanceof HTMLElement?f.value:(v=f.value)==null?void 0:v.$el;g&&g.addEventListener("keydown",p)}),Qn(()=>{var v;const g=f.value instanceof HTMLElement?f.value:(v=f.value)==null?void 0:v.$el;g&&g.removeEventListener("keydown",p)}),Je(h,g=>{var v,y;g?(v=i.value)==null||v.focus():(y=i.value)==null||y.clearInternal()}),(g,v)=>(W(),ae("div",{ref_key:"mainRef",ref:f},[be("div",{ref_key:"triggerRef",ref:c},[fe(gt,{class:"action-button",variant:n.variant,loading:s.value},{default:ye(()=>[fe(at,{src:"UserPlus",class:"icon"}),v[0]||(v[0]=nt(" Assignee ",-1))]),_:1},8,["variant","loading"])],512),be("div",{ref_key:"popupRef",ref:u,style:{display:"none"}},[U(h)?(W(),Ke(LA,Jt({key:0,ref_key:"assigneeGroupEditorRef",ref:i},n,{ids:e.ids,onUpdated:l,onStartUpdate:r,onUpdateFailed:a,onUpdateCompleted:a}),null,16,["ids"])):Ye("",!0)],512)],512))}}),Zh=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],bY=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),Ha=(e,t)=>{const n=s=>{var o,i;if(s.key==="Tab"){const r=s.shiftKey||s.metaKey;s.preventDefault(),s.stopImmediatePropagation(),s.stopPropagation();const a=document.activeElement,l=(o=a==null?void 0:a.dataset)==null?void 0:o.index;if(l){let c=Zh.indexOf(l);const u=r?-1:1;for(const d of Zh){c=(c+u+Zh.length)%Zh.length;const h=Zh[c],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(s.key==="Enter")(i=s.target)==null||i.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(s.key==="Escape"){s.stopPropagation(),s.stopImmediatePropagation();const r=document.querySelector('[data-index="calendar-wrapper"]');r==null||r.focus()}};if(bY.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},SY=["aria-label"],EY=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],_Y={style:{flex:"1"}},RY=St(it({__name:"MainCalendar",props:tD({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:tD(["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 s=Yt,o=V(null),i=e,r=Z(()=>i.startDate&&i.endDate),a=LH(e,"tracingCase"),l=n,c=V(i.year),u=V(i.month);Je(()=>[i.year,i.month],([k,N])=>{c.value=k,u.value=N});const d=Z(()=>vt.fromObject({year:c.value,month:u.value,day:1},{zone:i.timezone}).setLocale(i.locale||"en-US").toFormat("LLLL yyyy")),h=Z(()=>vt.now().setZone(i.timezone)),f=Z(()=>i.startDate?vt.fromJSDate(i.startDate,{zone:i.timezone}):null),p=Z(()=>i.endDate?vt.fromJSDate(i.endDate,{zone:i.timezone}):null),g=V(f.value),v=V(p.value),y=V(f.value),b=V(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,k=>{const N=k==="start"?S.value:C.value;N&&(c.value=N.year,u.value=N.month)}),Je(()=>{var k,N;return[(k=S.value)==null?void 0:k.toISODate(),(N=C.value)==null?void 0:N.toISODate(),i.activeField]},()=>{const k=i.activeField==="start"?S.value:C.value;k&&(k.year!==c.value||k.month!==u.value)&&(c.value=k.year,u.value=k.month)});function E(k){return k.setZone("utc")}const R=V("");function T(k){R.value=k.toISODate()||"",Ct(()=>{const N=document.querySelector(`.arbo-calendar-day[data-date="${R.value}"]`);N==null||N.focus()})}Je(()=>{var k,N;return[c.value,u.value,i.activeField,(k=S.value)==null?void 0:k.toISODate(),(N=C.value)==null?void 0:N.toISODate()]},()=>{const k=i.activeField==="start"?S.value:C.value;let N;k&&k.year===c.value&&k.month===u.value?N=k:S.value&&S.value.year===c.value&&S.value.month===u.value?N=S.value:N=h.value,T(N)});function A(k){return k.toFormat("d")}const O=Z(()=>{const k=vt.fromObject({year:c.value,month:u.value,day:1},{zone:i.timezone}),N=k.weekday,Q=i.weekStart===1?(N+6)%7:N%7;let ce=k.minus({days:Q});const xe=[],ge=fu.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"}),de=dg();for(let De=0;De<42;De++){const re=[];ce.month!==u.value&&re.push(de["is-outside"]),ce.hasSame(h.value,"day")&&re.push(de["is-today"]),S.value&&ce.hasSame(S.value,"day")&&re.push(de["is-selected-start"]),C.value&&ce.hasSame(C.value,"day")&&re.push(de["is-selected-end"]),S.value&&C.value&&ce>S.value&&ce<C.value&&re.push(de["is-in-range"]);const Ae=A(ce),H=ge[ce.weekday-1]||"";xe.push({dt:ce,iso:ce.toISODate()||"",label:ce.toFormat("d"),displayLabel:Ae,weekdayLabel:H,aria:ce.setLocale(i.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:re}),ce=ce.plus({days:1})}const X=[];for(let De=0;De<6;De++)X.push(xe.slice(De*7,De*7+7));return X}),I=Z(()=>{const k=fu.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"});return i.weekStart===1?k:[k[6],...k.slice(0,6)]});function D(k,N,Q){const ce=k==="start"?N.startOf("day"):N.endOf("day"),xe=E(ce),ge={year:ce.year,month:ce.month,day:ce.day,utc:xe.toISO()||""};k==="start"?(l("select-start",ge,Q??!0),l("select-start-utc",ge.utc)):(l("select-end",ge),l("select-end-utc",ge.utc))}function x(k){let N=c.value,Q=u.value+k;for(;Q<1;)Q+=12,N-=1;for(;Q>12;)Q-=12,N+=1;c.value=N,u.value=Q,l("update:year",N),l("update:month",Q)}function P(k){const Q=(R.value?vt.fromISO(R.value,{zone:i.timezone}):h.value).plus({days:k});Q.month===u.value&&Q.year===c.value&&T(Q)}function M(k=!1){const Q=(R.value?vt.fromISO(R.value,{zone:i.timezone}):h.value).weekday%7,ce=k?6-Q:-Q;P(ce)}const B=k=>{Y(k)};function Y(k){switch(k.preventDefault(),k.stopPropagation(),k.key){case"ArrowLeft":k.preventDefault(),P(-1);break;case"ArrowRight":k.preventDefault(),P(1);break;case"ArrowUp":k.preventDefault(),P(-7);break;case"ArrowDown":k.preventDefault(),P(7);break;case"Home":k.preventDefault(),M(!1);break;case"End":k.preventDefault(),M(!0);break;case"PageUp":k.preventDefault(),x(k.shiftKey?-12:-1);break;case"PageDown":k.preventDefault(),x(k.shiftKey?12:1);break;case"Enter":case" ":{k.preventDefault();const N=R.value?vt.fromISO(R.value,{zone:i.timezone}):h.value,Q=O.value.flat().find(ce=>ce.iso===N.toISODate());Q&&te(Q);break}}}const ne=k=>{const N=vt.now().setZone(i.timezone);c.value=N.year,u.value=N.month,l("update:year",N.year),l("update:month",N.month),T(N),l("gotoToday")};function te(k){var ve,Ne;const N=!!f.value,Q=!!p.value,ce=i.activeField,xe=((ve=f.value)==null?void 0:ve.toISODate())||"null",ge=((Ne=p.value)==null?void 0:Ne.toISODate())||"null",de=k.dt.toISODate()||"",X=(Pe,K)=>{a.value={case:Pe,behavior:K}},De=()=>`Selected start ${de} > existing end ${ge} -> reset both to ${de}`,re=()=>`Selected end ${de} < existing start ${xe} -> reset both to ${de}`,Ae=()=>{D("start",k.dt,!0),D("end",k.dt),l("update:activeField","end")},H=(Pe=!1)=>{D("start",k.dt,Pe),Pe&&l("update:activeField","end")},oe=(Pe=!1)=>{D("end",k.dt),Pe&&l("close")};if(N&&Q){ce==="start"?p.value&&k.dt>p.value?(Ae(),X("INVERT_RANGE_FROM_START",De())):(H(!1),X("UPDATE_START_IN_RANGE",`Updated start from ${xe} to ${de}; end remains ${ge}`)):f.value&&k.dt<f.value?(Ae(),X("INVERT_RANGE_FROM_END",re())):(oe(!1),X("UPDATE_END_IN_RANGE",`Updated end from ${ge} to ${de}; start remains ${xe}`));return}if(!N&&Q&&ce==="start"&&p.value&&k.dt>p.value){Ae(),X("CREATE_RANGE_FROM_LATE_START",De());return}if(N&&!Q&&ce==="end"&&f.value&&k.dt<f.value){Ae(),X("CREATE_RANGE_FROM_EARLY_END",re());return}if(!N&&!Q){if(ce==="start"){H(!0),X("INIT_START",`Picked start ${de}; awaiting end selection`);return}oe(i.immediatelyUpdate),X("INIT_END",`Picked end ${de}; awaiting start selection`);return}if(!N&&Q){if(ce==="start"){H(!0),X("FILL_MISSING_START",`Inserted start ${de}; existing end ${ge}`);return}oe(!1),X("STRICT_UPDATE_END_ONLY",`Updated end to ${de}; start still null`);return}if(N&&!Q){if(ce==="start"){H(!0),X("RESELECT_START_BEFORE_END",`Replaced start with ${de}; end still null, switching to end`);return}oe(i.immediatelyUpdate),X("FILL_MISSING_END",`Picked end ${de}; start ${xe}`);return}}function z(){y.value=g.value,b.value=v.value,l("confirm")}function pe(){g.value=y.value,v.value=b.value,l("cancel")}function q(){Ct(()=>{var k;(k=o.value)==null||k.focus()})}return Zt(()=>{q()}),t({focus:q}),(k,N)=>(W(),ae("div",{ref_key:"calendarRef",ref:o,class:ee([k.$style["arbo-calendar"],{[k.$style["arbo-date-range-picker"]]:r.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[be("div",{class:ee([k.$style["arbo-calendar-header"],k.$style["arbo-calendar-week"]]),role:"row"},[(W(!0),ae(xt,null,xn(I.value,Q=>(W(),ae("div",{key:Q,class:ee(k.$style["arbo-calendar-weekday"]),role:"columnheader"},mt(Q),3))),128))],2),be("div",{class:ee(k.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:N[0]||(N[0]=Pt(Q=>U(Ha)(Q,B),["prevent","stop"]))},[(W(!0),ae(xt,null,xn(O.value,(Q,ce)=>(W(),ae("div",{key:ce,class:ee(k.$style["arbo-calendar-week"])},[(W(!0),ae(xt,null,xn(Q,xe=>(W(),ae("div",{key:xe.iso,class:ee([k.$style["arbo-calendar-day"],xe.classes,{[k.$style["is-focused"]]:xe.iso===R.value}]),disabled:i.disabled,readOnly:i.readOnly,"aria-label":xe.aria,"data-date":xe.iso,"data-weekday":xe.weekdayLabel,tabindex:xe.iso===R.value?0:-1,onClick:ge=>te(xe)},mt(xe.displayLabel),11,EY))),128))],2))),128))],34),i.readOnly?Ye("",!0):(W(),ae("div",{key:0,class:ee(k.$style["arbo-calendar-actions"])},[be("div",_Y,[We((W(),Ke(gt,{variant:"secondary",size:"medium",onClick:N[1]||(N[1]=Q=>ne()),onKeydown:U(Ha),"data-index":"today-btn"},{prefix:ye(()=>[fe(at,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[U(s),"Today"]])]),fe(gt,{disabled:i.disabled,readOnly:i.readOnly,onKeydown:U(Ha),variant:"secondary",size:"medium",onClick:pe,"data-index":"cancel-btn"},{default:ye(()=>[nt(mt(i.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),fe(gt,{disabled:i.disabled||i.disableConfirm,readOnly:i.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:U(Ha),onClick:z},{default:ye(()=>[nt(mt(i.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,SY))}}),[["__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"}}]]),DY=["onClick"],TY=["variant","onClick"],xY=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 s=e,o=Z(()=>{if(s.monthLabels&&s.monthLabels.length===12)return s.monthLabels;const P=s.locale||"en-US",M=s.monthLabelStyle||"short",B=new Intl.DateTimeFormat(P,{month:M,timeZone:"UTC"});return Array.from({length:12},(ne,te)=>B.format(new Date(Date.UTC(2020,te,1))))}),i=n,r=V(s.year),a=V(s.month),l=V(s.year);Je(()=>s.year,P=>{P!==r.value&&(r.value=P,l.value=P)}),Je(()=>s.month,P=>{P!==a.value&&(a.value=P)});const c=V("days");function u(P){c.value!==P&&(c.value=P,i("mode-change",P))}const d=Z(()=>s.minYear),h=Z(()=>s.maxYear),f=Z(()=>{const P=s.yearSpan;return l.value-l.value%P}),p=Z(()=>f.value+s.yearSpan-1);function g(){const P=s.yearSpan,M=f.value-P;M>=d.value&&(l.value=M)}function v(){const P=s.yearSpan,M=f.value+P;M<=h.value&&(l.value=M)}const y=Z(()=>f.value-s.yearSpan<d.value),b=Z(()=>p.value+s.yearSpan>h.value),S=Z(()=>{const P=s.yearSpan;return Math.ceil(P/3)});function C(P){const B=f.value+(P-1)*3;return Array.from({length:3},(Y,ne)=>B+ne).filter(Y=>Y<=p.value)}function E(){c.value==="months"?u("days"):u("months")}function R(){c.value==="years"?u("days"):u("years")}function T(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 O(){if(c.value==="days"){let P=r.value,M=a.value-1;if(M<1&&(M=12,P--),P<d.value)return;r.value=P,a.value=M,i("update:year",P),i("update:month",M)}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 I(){if(c.value==="days"){let P=r.value,M=a.value+1;if(M>12&&(M=1,P++),P>h.value)return;r.value=P,a.value=M,i("update:year",P),i("update:month",M)}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),x=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,M)=>{r.value=P,a.value=M}}),(P,M)=>(W(),ae("div",{class:ee([P.$style["cal-nav-wrapper"]])},[Tt(P.$slots,"selection"),c.value==="days"?(W(),ae("div",{key:0,class:ee(P.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[fe(gt,{variant:"tertiary",class:ee([P.$style["cal-nav-btn"],P.$style.prev]),"aria-label":"Previous",disabled:D.value,label:"",onClick:O,"data-index":"prev-btn",onKeydownCapture:Un(Pt(O,["prevent","stop"]),["enter"]),onKeydown:U(Ha)},{default:ye(({hovered:B})=>[fe(at,{src:"AnglesRight",source:"remote",color:B?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),be("div",{class:ee(P.$style["cal-nav-center"])},[fe(gt,{"data-index":"month-btn",variant:"secondary",onClick:E,onKeydown:U(Ha)},{default:ye(()=>[nt(mt(o.value[a.value-1]),1)]),_:1},8,["onKeydown"]),fe(gt,{variant:"secondary",onClick:R,"data-index":"year-btn",onKeydown:U(Ha)},{default:ye(()=>[nt(mt(r.value),1)]),_:1},8,["onKeydown"])],2),fe(gt,{"data-index":"next-btn",variant:"tertiary",class:ee([P.$style["cal-nav-btn"],P.$style.next]),"aria-label":"Next",disabled:x.value,label:"",onClick:I,onKeydownCapture:Un(Pt(I,["prevent","stop"]),["enter"]),onKeydown:U(Ha)},{default:ye(({hovered:B})=>[fe(at,{src:"AnglesRight",source:"remote",color:B?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Ye("",!0),c.value==="years"?(W(),ae("div",{key:1,class:ee(P.$style["year-grid"])},[be("div",{class:ee(P.$style["year-grid-header"])},[fe(gt,{variant:"tertiary",class:ee([P.$style["cal-nav-btn"],P.$style.prev]),"aria-label":"Next",disabled:y.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:ye(({hovered:B})=>[fe(at,{src:"AnglesRight",source:"remote",color:B?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),be("div",{class:ee(P.$style["range-label"])},mt(f.value)+" - "+mt(p.value),3),fe(gt,{variant:"tertiary",class:ee([P.$style["cal-nav-btn"],P.$style.next]),"aria-label":"Next",disabled:b.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:ye(({hovered:B})=>[fe(at,{src:"AnglesRight",source:"remote",color:B?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),be("div",{class:ee(P.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(W(!0),ae(xt,null,xn(S.value,B=>(W(),ae("div",{key:"yr-row-"+B,class:ee(P.$style["year-grid-row"])},[(W(!0),ae(xt,null,xn(C(B),Y=>(W(),ae("a",{key:Y,tabindex:"0",class:ee([P.$style["year-cell"],{[P.$style.selected]:Y===r.value}]),onClick:ne=>T(Y)},mt(Y),11,DY))),128))],2))),128))],2)],2)):c.value==="months"?(W(),ae("div",{key:2,class:ee(P.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[be("div",{class:ee(P.$style.months)},[(W(!0),ae(xt,null,xn(o.value,(B,Y)=>(W(),ae("a",{tabindex:"0",key:B,variant:Y+1===a.value?"primary":"text",class:ee([P.$style["month-cell"],{[P.$style.selected]:Y+1===a.value}]),onClick:ne=>A(Y+1)},mt(B),11,TY))),128))],2)],2)):(W(),ae("div",{key:3,class:ee(P.$style["days-slot"])},[Tt(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:s,maxDate:o}=e,i=V(""),r=Z(()=>{const g=vt.fromFormat(i.value,t,{zone:n});return g.isValid?g:null}),a=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}),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(!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}),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=vt.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?i.value=v.toFormat(t):i.value=""},getDate:()=>u.value?r.value:null}}const FY={key:0,style:{marginLeft:"8px"}},PY=["disabled","readonly","placeholder"],VA=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 s=Yt,o=e,i=n,r=V(null),a=V(null),{isValid:l,isComplete:c,inputValue:u,clear:d,setDate:h,getDate:f}=IY({format:o.format,allowPastDates:o.allowPastDates,allowFutureDates:o.allowFutureDates,timezone:o.timezone,minDate:o.minDate,maxDate:o.maxDate}),p=Z(()=>o.active),g=Z(()=>({disabled:o.disabled,error:!l.value&&u.value.length>0,readOnly:o.readOnly,isEmpty:u.value.length===0,inputRef:r,wrapperRef:a,active:p})),{argsMain:v,isHover:y,isFocus:b}=ms(g),S=A=>{var I;const O=(I=A.clipboardData)==null?void 0:I.getData("text/plain");O&&(u.value=O.trim())},C=A=>{if(A.key==="Escape"){i("blur"),A.target.blur(),A.preventDefault(),A.stopPropagation(),A.stopImmediatePropagation();return}else A.key==="Tab"&&T(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(()=>o.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&&!o.readOnly&&!o.disabled&&c.value){const A=f();(A||u.value.length===0)&&i("complete",A)}}),Je(()=>l.value,A=>{A||i("invalid","")});const R=Z(()=>!!o.isMultipleDate),T=A=>{A.preventDefault(),A.stopImmediatePropagation(),A.stopPropagation(),i("tab",A)};return(A,O)=>(W(),Ke(vs,Jt(U(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:ye(()=>[be("div",{class:ee([A.$style["date-input-wrapper"]])},[R.value?(W(),ae("span",FY," Multiple ")):We((W(),ae("input",{key:1,disabled:o.disabled,readonly:o.readOnly,ref_key:"inputRef",ref:r,type:"text","onUpdate:modelValue":O[0]||(O[0]=I=>pn(u)?u.value=I:null),onPaste:Pt(S,["prevent"]),placeholder:o.placeholder,class:ee([A.$style["date-input"]]),onKeydown:C},null,42,PY)),[[v1,U(u)]]),Tt(A.$slots,"clear",{handleClear:E},()=>[(U(u).length>0||R.value)&&!o.readOnly&&!o.disabled&&(U(y)||U(b))?We((W(),Ke(gt,{key:0,variant:["icon","primary"],onClick:Pt(E,["stop"]),size:16,rounded:!0},{default:ye(()=>[fe(at,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[U(s),"Clear"]]):(W(),Ke(at,{key:1,src:"Calendar",source:"remote",class:ee(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"}}]]),AY=it({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:pb()},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 s=V({case:"",behavior:""}),o=e,i=V(null),r=n,a=async(X,De)=>{r("start-update"),await X(),r("finish-update"),Ct(()=>{var re,Ae;De(),(Ae=(re=o.params)==null?void 0:re.api)==null||Ae.stopEditing()})},l=(X,De)=>{X(),Ct(()=>{var re,Ae;De(),(Ae=(re=o.params)==null?void 0:re.api)==null||Ae.stopEditing()})},c=()=>{var De;const X=vt.now().setZone(o.timezone);N.value=X.year,Q.value=X.month,(De=k.value)==null||De.setNavigation(X.year,X.month)},u=yo({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:y,beginInteraction:b,clearStart:S,clearDue:C}=m7(o,r),E=Z(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});Je(()=>o.multipleStartDates,X=>{h.value=!!X},{immediate:!0}),Je(()=>o.multipleDueDates,X=>{f.value=!!X},{immediate:!0});const R=V(null),T=V(null),A=X=>{X.preventDefault(),X.stopImmediatePropagation(),X.stopPropagation(),z()},O=()=>{var X;(X=T.value)==null||X.focus()},I=X=>{if(!X){u.start=!1,S();return}const De=d.endDate?vt.fromJSDate(d.endDate,{zone:o.timezone}):null;if(De&&D(X,De)>0){const Ae={year:X.year,month:X.month,day:X.day};u.start=!1,y(Ae,!1),p(Ae),Ct(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const re={year:X.year,month:X.month,day:X.day};u.start=!1,y(re,!0)},D=(X,De)=>{const re=X.startOf("day"),Ae=De.startOf("day");return re<Ae?-1:re>Ae?1:0},x=X=>{var De;X.preventDefault(),X.stopImmediatePropagation(),X.stopPropagation(),(De=document.querySelector('[data-index="prev-btn"]'))==null||De.focus()},P=X=>{if(!X){u.end=!1,C();return}const De=d.startDate?vt.fromJSDate(d.startDate,{zone:o.timezone}):null;if(De&&D(X,De)<0){const Ae={year:X.year,month:X.month,day:X.day};u.end=!1,y(Ae),p(Ae),Ct(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const re={year:X.year,month:X.month,day:X.day};u.end=!1,p(re)},M=()=>{h.value=!1,S()},B=()=>{f.value=!1,C()},Y=()=>{pe()},ne=Z(()=>d.isSelectingStart||d.isSelectingEnd);function te(){o.disabled||o.readOnly||(b(),d.isSelectingStart=!0,d.isSelectingEnd=!1,Ct(()=>{var X;(X=i.value)==null||X.focus()}))}function z(){o.disabled||o.readOnly||(b(),d.isSelectingEnd=!0,d.isSelectingStart=!1,Ct(()=>{var X;(X=R.value)==null||X.focus()}))}function pe(){d.isSelectingStart=!1,d.isSelectingEnd=!1,r("closed")}function q(X){X.key==="Escape"?(X.stopPropagation(),pe()):X.key=="Tab"&&r("tab",X)}const k=V(null),N=V(new Date().getFullYear()),Q=V(new Date().getMonth()+1);Je(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(N.value=d.startDate.getFullYear(),Q.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(N.value=d.endDate.getFullYear(),Q.value=d.endDate.getMonth()+1)},{immediate:!0});const ce=V(null);function xe(){if(Array.isArray(o.value)){const[De,re]=o.value;d.startDate=De||null,d.endDate=re||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const X=d.startDate||d.endDate||new Date;N.value=X.getFullYear(),Q.value=X.getMonth()+1}Je(()=>{var X,De,re,Ae,H,oe,ve,Ne;return[((re=(De=(X=o.value)==null?void 0:X[0])==null?void 0:De.getTime)==null?void 0:re.call(De))||((Ae=o.value)==null?void 0:Ae[0]),((ve=(oe=(H=o.value)==null?void 0:H[1])==null?void 0:oe.getTime)==null?void 0:ve.call(oe))||((Ne=o.value)==null?void 0:Ne[1]),o.timezone,o.format,o.placeholder,o.enableRangeFeedback]},()=>{xe()},{immediate:!0,deep:!0}),t({resetCalendarLogic:xe,openStart:te,openEnd:z,closePicker:pe,clearAll:Y,isOpen:ne,drpRef:ce,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?te():z():te()}});const de=V(null);return Je(()=>ne.value,X=>{if(o.disabled||o.readOnly)return;const De=de.value;De&&(X?De.show():De.hide())},{immediate:!0}),(X,De)=>(W(),ae("div",{class:ee(X.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:T,onKeydown:q,tabindex:"1","data-index":"calendar-wrapper"},[fe(xY,{year:N.value,"onUpdate:year":De[6]||(De[6]=re=>N.value=re),month:Q.value,"onUpdate:month":De[7]||(De[7]=re=>Q.value=re),locale:o.locale,disabled:o.disabled,readOnly:o.readOnly,ref_key:"navigationRef",ref:k},{selection:ye(()=>[be("div",{class:ee(X.$style["calendar-input-section"])},[fe(VA,{ref_key:"starDateRef",ref:i,"model-value":U(d).startDate,placeholder:o.startPlaceholder,timezone:o.timezone,active:U(d).isSelectingStart,onClick:te,onClear:M,onComplete:I,onInvalid:De[0]||(De[0]=re=>u.start=!0),disabled:o.disabled,readOnly:o.readOnly,onBlur:O,onTab:A},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),fe(VA,{ref_key:"endDateRef",ref:R,"model-value":U(d).endDate,placeholder:o.duePlaceholder,timezone:o.timezone,active:U(d).isSelectingEnd,onClick:z,onClear:B,disabled:o.disabled,onComplete:P,onInvalid:De[1]||(De[1]=re=>u.end=!0),readOnly:o.readOnly,isMultipleDate:U(f),onTab:x},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:ye(({year:re,month:Ae})=>[fe(RY,{disabled:o.disabled,disableConfirm:u.end||u.start,readOnly:o.readOnly,ref_key:"drpRef",ref:ce,"tracing-case":s.value,"onUpdate:tracingCase":De[2]||(De[2]=H=>s.value=H),year:re,month:Ae,"start-date":U(d).startDate,"end-date":U(d).endDate,"active-field":E.value,timezone:o.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:U(y),onSelectEnd:U(p),onGotoToday:c,onConfirm:De[3]||(De[3]=()=>{a(U(v),pe)}),onCancel:De[4]||(De[4]=H=>l(U(g),pe)),onClose:De[5]||(De[5]=H=>a(U(v),pe))},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))}}),Dm=St(AY,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_1wull_1","calendar-input-section":"_calendar-input-section_1wull_11","display-wrapper":"_display-wrapper_1wull_19","calendar-actions":"_calendar-actions_1wull_23","clear-all-btn":"_clear-all-btn_1wull_29"}}]]),kY={ref:"mainRef"},OY=it({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{}},emits:["updated","start-update","finish-update"],setup(e,{emit:t}){const n=t,s=e,o=Sn("isSelectAll",V(!1)),i=Sn("bulkUpdate",V(!1)),r=Z(()=>!!s.entityId&&i.value&&o.value),{apiServices:a}=es(!i.value,s),l=Sn("filterParams",null),c=async I=>{var x,P,M;T.value=!0,n("start-update");let D={workspaceId:s.workspaceId,entityId:s.entityId,itemIds:s.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in I&&(D.startDate=I.start?lm(I.start):null),"end"in I&&(D.dueDate=I.end?lm(I.end):null),r.value?(D.itemIds=void 0,D.entityId=s.entityId):D.entityId=void 0,await((P=(x=a.value)==null?void 0:x.changeDate)==null?void 0:P.call(x,D)),n("updated",{workspaceId:s.workspaceId,itemIds:s.ids,data:D}),(M=y.value)==null||M.resetCalendarLogic()},u=()=>{if(!s.rowSelected||s.rowSelected.length===0){d();return}s.rowSelected.length===1?h():f()},d=()=>{v.value=!1,g.value=!1,R.value=[null,null]},h=()=>{const D=s.rowSelected[0].dateRange;R.value=[(D==null?void 0:D[0])??null,(D==null?void 0:D[1])??null],v.value=!1,g.value=!1},f=()=>{var D,x;if(s.rowSelected.some(P=>P.dateRange&&(P.dateRange[0]!==null||P.dateRange[1]!==null))){const P=p(0),M=p(1);if(g.value=P,v.value=M,P)R.value[0]=null;else{const B=((D=s.rowSelected[0].dateRange)==null?void 0:D[0])??null;R.value[0]=B}if(M)R.value[1]=null;else{const B=((x=s.rowSelected[0].dateRange)==null?void 0:x[1])??null;R.value[1]=B}}else g.value=!1,v.value=!1,R.value=[null,null]},p=I=>{const D=s.rowSelected.map(P=>{var M;return(M=P.dateRange)==null?void 0:M[I]});return D.length===0?!1:new Set(D.map(P=>{var M;return(M=P==null?void 0:P.getTime)==null?void 0:M.call(P)})).size>1},g=V(!1),v=V(!1),y=V(null),{triggerRef:b,popupRef:S,hide:C,isVisible:E}=us({toggleOnClick:!0}),R=V([null,null]);Je([()=>s.ids,()=>s.rowSelected,E],I=>{u(),Ct(()=>{var D;(D=y.value)==null||D.focus()})},{immediate:!0,deep:!0});const T=V(!1),A=()=>{T.value=!0},O=()=>{Ct(()=>{setTimeout(()=>{T.value=!1},500)})};return(I,D)=>(W(),ae("div",kY,[be("div",{ref_key:"triggerRef",ref:b},[fe(gt,{variant:s.variant,loading:T.value},{default:ye(()=>[fe(at,{src:"Calendar"}),D[0]||(D[0]=nt(" Date ",-1))]),_:1},8,["variant","loading"])],512),be("div",{ref_key:"popupRef",ref:S,style:{display:"none"}},[U(E)?(W(),Ke(Dm,{key:0,immediatelyUpdate:!1,value:R.value,onConfirmed:c,ref_key:"calendarRef",ref:y,onClosed:U(C),onStartUpdate:A,onFinishUpdate:O,multipleDueDates:v.value,multipleStartDates:g.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):Ye("",!0)],512)],512))}}),MY=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"},BA=Yl("metricStore",()=>{const e=V();return{metricList:e,setMetricList:s=>{e.value=s},checkEditType:s=>{var o;if(((o=s==null?void 0:s.auth_permission)==null?void 0:o.permission)==2)return MY(s)}}}),NY=["onKeydown"],LY=["width","height","viewBox"],VY=["d"],BY="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",$A=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 s=e,o=n,i=V(s.modelValue??0),r=V(null),a=Z(()=>{var D;return((D=s.params)==null?void 0:D.size)??24}),l=Z(()=>{var D;return((D=s.params)==null?void 0:D.iconViewBox)??"0 0 24 24"}),c=Z(()=>{var D;return((D=s.params)==null?void 0:D.iconPath)??BY}),u=Z(()=>{var D;return((D=s.params)==null?void 0:D.wrapperTag)??"span"}),d=Z(()=>{var D;return s.disabled||((D=s.params)==null?void 0:D.disabled)||!1}),h=Z(()=>{var D;return s.readOnly||((D=s.params)==null?void 0:D.readOnly)||!1}),f=Z(()=>!d.value&&!h.value),p=Z(()=>d.value?"not-allowed":h.value?"default":"pointer");Je(()=>s.modelValue,D=>{typeof D=="number"&&D!==i.value&&(i.value=D)});const g=D=>{var x;return((x=s.params)==null?void 0:x.maxRating)-D+1<=i.value&&!v.value},v=V(!1),y=()=>{v.value=!0},b=()=>{v.value=!1},S=D=>{f.value&&C(D)},C=D=>{var P,M;if(!f.value)return;let x=((P=s.params)==null?void 0:P.maxRating)-D+1;x===i.value&&(x=0),i.value=x,o("update:modelValue",x),o("update",x),o("change",x),(M=s.params)!=null&&M.onUpdate&&s.params.onUpdate(x)},E=D=>{var x;D!==i.value&&(i.value=D,o("update:modelValue",D),o("update",D),o("change",D),(x=s.params)!=null&&x.onUpdate&&s.params.onUpdate(D),R.value=D)},R=V(i.value),T=D=>{D.preventDefault(),D.stopPropagation(),D.stopImmediatePropagation(),i.value=R.value,o("cancel")},A=D=>{D.preventDefault(),E(i.value),o("handleEnter",i.value)},O=()=>{f.value&&(i.value=Math.min(i.value+1%(s.params.maxRating+1),s.params.maxRating),E(i.value))},I=()=>{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,x)=>(W(),ae("div",{class:ee(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:ln({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:r,tabindex:"1",onKeydown:[Un(Pt(I,["prevent"]),["left"]),Un(Pt(O,["prevent"]),["right"]),Un(Pt(I,["prevent"]),["down"]),Un(Pt(O,["prevent"]),["up"]),Un(Pt(A,["prevent"]),["enter"]),Un(Pt(A,["prevent"]),["tab"]),Un(Pt(T,["prevent"]),["escape"])]},[(W(!0),ae(xt,null,xn(e.params.maxRating,P=>(W(),Ke(XR(u.value),{key:P,class:ee(["rating-item",{filled:g(P),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:ln({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:Pt(M=>S(P),["prevent","stop"]),onMouseenter:y,onMouseleave:b},{default:ye(()=>[Tt(D.$slots,"icon",{index:P,filled:g(P),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value,value:P},()=>[(W(),ae("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[be("path",{d:c.value},null,8,VY)],8,LY))]),Tt(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,NY))}}),$Y={style:{maxWidth:"180px",lineHeight:"15px"}},HY=["innerHTML"],HA=it({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const s=Yt,o=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(o.config)),u=V(o.modelValue),d=v=>{u.value=v,i("update:modelValue",v),i("change",v||null)},h=V(c.value),f=V(!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=V(null);return Zt(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,y)=>(W(),Ke(Xr,{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:ye(({item:b,getHighlightedLabel:S,selectedIndex:C,index:E})=>[fe(Zl,{hover:C==E,selected:b.value===e.modelValue,label:b.label,onSelect:R=>d(b.value||null),onClick:R=>d(b.value||null)},{label:ye(()=>[be("div",$Y,[We(be("span",{innerHTML:S(b.label)},null,8,HY),[[U(s),{content:b.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":ye(()=>[...y[1]||(y[1]=[nt("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),GY={class:"metric-input-wrapper"},UY={key:0,class:"error-text input-2"},GA=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 s=Yt,o=e,i=V(o.modelValue),r=V(o.modelValue),a=V(!1),l=V(!0),c=V(""),u=Z(()=>{var B;const M=Number.parseInt(String((B=o.config)==null?void 0:B.format_value)||"2",10);return Number.isFinite(M)&&M>=0?M:2}),d=M=>{if(!M)return M;const B=String(M).split(".");return B.length>1&&B[1].length>u.value?u.value===0?B[0]:`${B[0]}.${B[1].slice(0,u.value)}`:String(M)},h=M=>{const B=d(M);B!==M&&S.value?i.value=B:i.value=M},f=M=>{const B=M.target;if(!B)return;const Y=B.value||"",ne=Y.indexOf(".");if(M.key==="."&&u.value===0){M.preventDefault();return}ne!==-1&&/[0-9]/.test(M.key)&&Y.slice(ne+1).length>=u.value&&M.preventDefault()},p=Z(()=>l.value||o.showInlineError?{content:""}:{content:c.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),g=()=>{var q;const M=o.config.restricted_type.trim(),B=((q=o.config.restricted_value)==null?void 0:q.split(",").map(Number))||[],[Y,ne]=B,z={range:`Enter a value between ${Y} and ${ne}`,not:`These values are not allowed: ${B.join(", ")}`,exact:"Value is not allowed"}[M];return l.value?"":z},v=Z(()=>{var B;let M="";return Number((B=o.config)==null?void 0:B.format_value)&&(M+="."+Array.from({length:Number(o.config.format_value)}).map(()=>"0").join("")),`0${M}`});Je(()=>o.modelValue,M=>{i.value=M,r.value=M});const y=M=>im(o.config,M),b=n,S=V(null),C=M=>{const B=M===""?null:M,Y=r.value===""?null:r.value;return B!==Y},E=M=>{const B=d(M);if(!C(B))return!1;const Y=B===""?null:B;return i.value=Y,r.value=Y,b("update:modelValue",Y),b("handleChange",Y),!0},R=()=>{i.value=r.value,b("update:modelValue",r.value)},T=(M,B)=>{E(M),b("enter")},A=(M,B)=>{if(a.value){a.value=!1;return}o.saveOnBlur?E(M):R()},O=M=>{if(M===null||M===""){l.value=!0;return}l.value=im(o.config,Number(M)),c.value=l.value?"":g()},I=(M,B)=>{a.value=!0,o.saveOnEscape?E(M):R(),b("cancel"),setTimeout(()=>{a.value=!1},100)},D=M=>{O(M),b("onValidation",M)},x=()=>{a.value=!0,R(),b("cancel"),setTimeout(()=>{a.value=!1},100)},P=()=>{var M;i.value=null,r.value=null,b("update:modelValue",null),b("handleChange",null),(M=S.value)==null||M.focus()};return t({focus:()=>{var M;return(M=S.value)==null?void 0:M.focus()},blur:()=>{var M;return(M=S.value)==null?void 0:M.blur()},getValue:()=>i.value,getCachedValue:()=>r.value,save:()=>E(i.value),revert:R}),Zt(()=>{var M;(M=S.value)==null||M.focus()}),(M,B)=>We((W(),ae("div",GY,[fe(Yb,{maxDecimalChar:u.value,modelValue:i.value,"onUpdate:modelValue":B[0]||(B[0]=Y=>i.value=Y),placeholder:v.value,validatorFnc:y,style:{"--bg-input":"#FAFAFA"},onInput:h,onKeydown:f,onEnter:T,onBlur:A,onClear:P,onEscape:I,onCancel:x,onOnValidation:D,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:S},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(W(),ae("span",UY,mt(c.value),1)):Ye("",!0)])),[[U(s),p.value]])}}),WY={key:2},zY={class:"wrapper-suffix"},jY={key:3},KY=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 s=Yt,o=e,i=V(null),r=V(0),a=V(null),l=V(null),c=Z(()=>IF(o.config)),u=V(!1),d=Z(()=>!!ce.value),h=n,f=()=>{u.value=!1,Q(),h("cancel")},p=V(!0),g=de=>{if(de===null||de===""){p.value=!0;return}if(c.value!=="number"){p.value=!0;return}p.value=im(o.config,Number(de)),y.value=b()},v=()=>{u.value=!0,ne()},y=V(""),b=()=>{var ve;const de=o.config.restricted_type.trim(),X=((ve=o.config.restricted_value)==null?void 0:ve.split(",").map(Number))||[],[De,re]=X,H={range:`Enter a value between ${De} and ${re}`,not:`These values are not allowed: ${X.join(", ")}`,exact:"Value is not allowed"}[de];return p.value?"":H},S=Z(()=>{var X;const de=Number.parseInt(String((X=o.config)==null?void 0:X.format_value)||"2",10);return Number.isFinite(de)&&de>=0?de:2}),C=de=>{u.value=!0,i.value=de},E=()=>{u.value=!0,Q(),ne()},R=de=>{r.value=de,u.value=!0,ne()},T=()=>(o.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(X=>X.charAt(0).toUpperCase()+X.slice(1)).join("").replace(/Outline|Solid/g,""),A=V(null),O=V(!0),I=Z(()=>{var de;return{disabled:o.disabled,error:!1,readOnly:!1,isEmpty:((de=i.value)==null?void 0:de.length)===0,wrapperRef:k,active:d,focus:o.focus,bordered:!0}}),D=V(null),x=Z(()=>O.value),P=Z(()=>({disabled:o.disabled,error:!1,readOnly:!1,isEmpty:r.value===0,wrapperRef:D,active:x,focus:O.value,bordered:!0})),{argsMain:M}=ms(P),{argsMain:B}=ms(I),Y=V(null),ne=()=>{Ct(()=>{var de;(de=Y.value)==null||de.focus()})},te=de=>{var X;if(de.format_type==="dropdown"&&de.format_value)try{const De=JSON.parse(de.format_value);if(Array.isArray(De))return De.map(re=>({label:re.name,value:re.name,id:re.name}))}catch(De){console.error("Failed to parse dropdown options",De)}return de.format_type=="number"&&de.restricted_type=="exact"?((X=de.restricted_value)==null?void 0:X.split(",").map(re=>({label:de.mapping[`!${re}`]||re,value:re,id:re})))||[]:[]},z=Z(()=>te(o.config)),pe=Z(()=>{var de;return((de=z.value.find(X=>X.value===i.value))==null?void 0:de.label)||i.value||"-"}),q=()=>{var de;if(c.value=="rating")h("updateMetric",r.value==0?null:r.value);else if(c.value=="number"){const X=(de=l.value)==null?void 0:de.getValue();h("updateMetric",X||null)}else h("updateMetric",i.value||null);u.value=!1,Q()},{triggerRef:k,popupRef:N,hide:Q,isVisible:ce,show:xe}=us({toggleOnClick:!0,appendTo:()=>o.attachTo||"parent",zIndex:1e4,offset:[0,0]}),ge=()=>{switch(c.value){case"number":Ct(()=>{var de;(de=l.value)==null||de.focus()});break;case"dropdown":xe(),Ct(()=>{var de;(de=A.value)==null||de.focus()});break;case"rating":O.value=!0,Ct(()=>{var de;(de=a.value)==null||de.focus()});break}};return t({resetState:()=>{i.value=null,r.value=0,u.value=!1},focus:ge,hasChanges:()=>u.value}),Zt(()=>{Ct(()=>{setTimeout(()=>{ge()},300)})}),(de,X)=>(W(),ae("div",{class:ee(de.$style["metric-editor"])},[c.value=="number"?(W(),Ke(GA,{key:0,config:o.config,modelValue:i.value,"onUpdate:modelValue":X[0]||(X[0]=De=>i.value=De),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:C,maxDecimalChar:S.value,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue","maxDecimalChar"])):c.value=="rating"?(W(),Ke(vs,Jt({key:1,"tab-index":1},U(M),{ref_key:"triggerRef2",ref:D,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:ye(()=>[fe($A,{params:{maxRating:o.config.range},modelValue:r.value,"onUpdate:modelValue":X[1]||(X[1]=De=>r.value=De),onHandleEnter:R,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:ye(()=>[fe(at,{source:"rating",src:T()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):c.value=="dropdown"?(W(),ae("div",WY,[fe(vs,Jt(U(B),{ref_key:"triggerRef",ref:k,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:ye(({})=>[be("div",zY,[fe(at,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:ye(()=>[We((W(),ae("span",null,[nt(mt(pe.value||""),1)])),[[U(s),{content:pe.value}]])]),_:1},16),be("div",{ref_key:"popupRef",ref:N},[U(ce)?(W(),Ke(HA,{key:0,ref_key:"metricEditorDropdownRef",ref:A,config:o.config,modelValue:i.value,"onUpdate:modelValue":X[2]||(X[2]=De=>i.value=De),onChange:E,onCancel:f},null,8,["config","modelValue"])):Ye("",!0)],512)])):(W(),ae("span",jY,"Formular")),We((W(),Ke(gt,{ref_key:"confirmButtonRef",ref:Y,onHandleClick:q,"tab-index":"1",onKeypress:[Un(Pt(ge,["shift","prevent"]),["tab"]),Un(Pt(f,["prevent"]),["escape"])],disabled:!p.value},{default:ye(()=>[fe(at,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[U(s),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),qY=St(it({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const s=Yt,o=e,i=n,r=V(!1),a=V(null),l=V(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 Ct(),(g=l.value)==null||g.focus()},h=g=>{i("handleUpdate",{id:o.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)=>(W(),ae("div",{class:ee([g.$style["metric-item"],r.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[be("div",{class:ee(g.$style["metric-label"]),onClick:Pt(c,["stop"])},[Tt(g.$slots,"default",{open:r.value},()=>[We((W(),ae("span",{class:ee(g.$style["metric-name"])},[nt(mt(e.label),1)],2)),[[U(s),{content:e.label}]]),e.morpheme&&r.value?(W(),ae("small",{key:0,class:ee(g.$style["metric-morpheme"])}," ("+mt(e.morpheme)+") ",3)):Ye("",!0)])],2),fe(jD,{mode:"out-in",name:"slide"},{default:ye(()=>[r.value?(W(),Ke(KY,{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"])):Ye("",!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 UA(e,t){return function(){return e.apply(t,arguments)}}const{toString:YY}=Object.prototype,{getPrototypeOf:Jb}=Object,{iterator:Tm,toStringTag:WA}=Symbol,xm=(e=>t=>{const n=YY.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Pi=e=>(e=e.toLowerCase(),t=>xm(t)===e),Im=e=>t=>typeof t===e,{isArray:xu}=Array,Iu=Im("undefined");function Xh(e){return e!==null&&!Iu(e)&&e.constructor!==null&&!Iu(e.constructor)&&ao(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const zA=Pi("ArrayBuffer");function ZY(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&zA(e.buffer),t}const XY=Im("string"),ao=Im("function"),jA=Im("number"),Jh=e=>e!==null&&typeof e=="object",JY=e=>e===!0||e===!1,Fm=e=>{if(xm(e)!=="object")return!1;const t=Jb(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(WA in e)&&!(Tm in e)},QY=e=>{if(!Jh(e)||Xh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},eZ=Pi("Date"),tZ=Pi("File"),nZ=Pi("Blob"),sZ=Pi("FileList"),oZ=e=>Jh(e)&&ao(e.pipe),iZ=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ao(e.append)&&((t=xm(e))==="formdata"||t==="object"&&ao(e.toString)&&e.toString()==="[object FormData]"))},rZ=Pi("URLSearchParams"),[aZ,lZ,cZ,uZ]=["ReadableStream","Request","Response","Headers"].map(Pi),dZ=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Qh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,o;if(typeof e!="object"&&(e=[e]),xu(e))for(s=0,o=e.length;s<o;s++)t.call(null,e[s],s,e);else{if(Xh(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),r=i.length;let a;for(s=0;s<r;s++)a=i[s],t.call(null,e[a],a,e)}}function KA(e,t){if(Xh(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s=n.length,o;for(;s-- >0;)if(o=n[s],t===o.toLowerCase())return o;return null}const Xl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,qA=e=>!Iu(e)&&e!==Xl;function Qb(){const{caseless:e,skipUndefined:t}=qA(this)&&this||{},n={},s=(o,i)=>{const r=e&&KA(n,i)||i;Fm(n[r])&&Fm(o)?n[r]=Qb(n[r],o):Fm(o)?n[r]=Qb({},o):xu(o)?n[r]=o.slice():(!t||!Iu(o))&&(n[r]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&Qh(arguments[o],s);return n}const hZ=(e,t,n,{allOwnKeys:s}={})=>(Qh(t,(o,i)=>{n&&ao(o)?e[i]=UA(o,n):e[i]=o},{allOwnKeys:s}),e),fZ=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),pZ=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},gZ=(e,t,n,s)=>{let o,i,r;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)r=o[i],(!s||s(r,e,t))&&!a[r]&&(t[r]=e[r],a[r]=!0);e=n!==!1&&Jb(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},mZ=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},vZ=e=>{if(!e)return null;if(xu(e))return e;let t=e.length;if(!jA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},yZ=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Jb(Uint8Array)),wZ=(e,t)=>{const s=(e&&e[Tm]).call(e);let o;for(;(o=s.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},CZ=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},bZ=Pi("HTMLFormElement"),SZ=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,o){return s.toUpperCase()+o}),YA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),EZ=Pi("RegExp"),ZA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};Qh(n,(o,i)=>{let r;(r=t(o,i,e))!==!1&&(s[i]=r||o)}),Object.defineProperties(e,s)},_Z=e=>{ZA(e,(t,n)=>{if(ao(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(ao(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},RZ=(e,t)=>{const n={},s=o=>{o.forEach(i=>{n[i]=!0})};return xu(e)?s(e):s(String(e).split(t)),n},DZ=()=>{},TZ=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function xZ(e){return!!(e&&ao(e.append)&&e[WA]==="FormData"&&e[Tm])}const IZ=e=>{const t=new Array(10),n=(s,o)=>{if(Jh(s)){if(t.indexOf(s)>=0)return;if(Xh(s))return s;if(!("toJSON"in s)){t[o]=s;const i=xu(s)?[]:{};return Qh(s,(r,a)=>{const l=n(r,o+1);!Iu(l)&&(i[a]=l)}),t[o]=void 0,i}}return s};return n(e,0)},FZ=Pi("AsyncFunction"),PZ=e=>e&&(Jh(e)||ao(e))&&ao(e.then)&&ao(e.catch),XA=((e,t)=>e?setImmediate:t?((n,s)=>(Xl.addEventListener("message",({source:o,data:i})=>{o===Xl&&i===n&&s.length&&s.shift()()},!1),o=>{s.push(o),Xl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ao(Xl.postMessage)),AZ=typeof queueMicrotask<"u"?queueMicrotask.bind(Xl):typeof j<"u"&&j.nextTick||XA,Be={isArray:xu,isArrayBuffer:zA,isBuffer:Xh,isFormData:iZ,isArrayBufferView:ZY,isString:XY,isNumber:jA,isBoolean:JY,isObject:Jh,isPlainObject:Fm,isEmptyObject:QY,isReadableStream:aZ,isRequest:lZ,isResponse:cZ,isHeaders:uZ,isUndefined:Iu,isDate:eZ,isFile:tZ,isBlob:nZ,isRegExp:EZ,isFunction:ao,isStream:oZ,isURLSearchParams:rZ,isTypedArray:yZ,isFileList:sZ,forEach:Qh,merge:Qb,extend:hZ,trim:dZ,stripBOM:fZ,inherits:pZ,toFlatObject:gZ,kindOf:xm,kindOfTest:Pi,endsWith:mZ,toArray:vZ,forEachEntry:wZ,matchAll:CZ,isHTMLForm:bZ,hasOwnProperty:YA,hasOwnProp:YA,reduceDescriptors:ZA,freezeMethods:_Z,toObjectSet:RZ,toCamelCase:SZ,noop:DZ,toFiniteNumber:TZ,findKey:KA,global:Xl,isContextDefined:qA,isSpecCompliantForm:xZ,toJSONObject:IZ,isAsyncFn:FZ,isThenable:PZ,setImmediate:XA,asap:AZ,isIterable:e=>e!=null&&ao(e[Tm])};function zt(e,t,n,s,o){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),s&&(this.request=s),o&&(this.response=o,this.status=o.status?o.status:null)}Be.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:Be.toJSONObject(this.config),code:this.code,status:this.status}}});const JA=zt.prototype,QA={};["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=>{QA[e]={value:e}}),Object.defineProperties(zt,QA),Object.defineProperty(JA,"isAxiosError",{value:!0}),zt.from=(e,t,n,s,o,i)=>{const r=Object.create(JA);Be.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,s,o),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 kZ=null;function eS(e){return Be.isPlainObject(e)||Be.isArray(e)}function ek(e){return Be.endsWith(e,"[]")?e.slice(0,-2):e}function tk(e,t,n){return e?e.concat(t).map(function(o,i){return o=ek(o),!n&&i?"["+o+"]":o}).join(n?".":""):t}function OZ(e){return Be.isArray(e)&&!e.some(eS)}const MZ=Be.toFlatObject(Be,{},null,function(t){return/^is[A-Z]/.test(t)});function Pm(e,t,n){if(!Be.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Be.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,v){return!Be.isUndefined(v[g])});const s=n.metaTokens,o=n.visitor||u,i=n.dots,r=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Be.isSpecCompliantForm(t);if(!Be.isFunction(o))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(Be.isDate(p))return p.toISOString();if(Be.isBoolean(p))return p.toString();if(!l&&Be.isBlob(p))throw new zt("Blob is not supported. Use a Buffer instead.");return Be.isArrayBuffer(p)||Be.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(Be.endsWith(g,"{}"))g=s?g:g.slice(0,-2),p=JSON.stringify(p);else if(Be.isArray(p)&&OZ(p)||(Be.isFileList(p)||Be.endsWith(g,"[]"))&&(y=Be.toArray(p)))return g=ek(g),y.forEach(function(S,C){!(Be.isUndefined(S)||S===null)&&t.append(r===!0?tk([g],C,i):r===null?g:g+"[]",c(S))}),!1}return eS(p)?!0:(t.append(tk(v,g,i),c(p)),!1)}const d=[],h=Object.assign(MZ,{defaultVisitor:u,convertValue:c,isVisitable:eS});function f(p,g){if(!Be.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),Be.forEach(p,function(y,b){(!(Be.isUndefined(y)||y===null)&&o.call(t,y,Be.isString(b)?b.trim():b,g,h))===!0&&f(y,g?g.concat(b):[b])}),d.pop()}}if(!Be.isObject(e))throw new TypeError("data must be an object");return f(e),t}function nk(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function tS(e,t){this._pairs=[],e&&Pm(e,this,t)}const sk=tS.prototype;sk.append=function(t,n){this._pairs.push([t,n])},sk.toString=function(t){const n=t?function(s){return t.call(this,s,nk)}:nk;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function NZ(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ok(e,t,n){if(!t)return e;const s=n&&n.encode||NZ;Be.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(o?i=o(t,n):i=Be.isURLSearchParams(t)?t.toString():new tS(t,n).toString(s),i){const r=e.indexOf("#");r!==-1&&(e=e.slice(0,r)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class ik{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Be.forEach(this.handlers,function(s){s!==null&&t(s)})}}const rk={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},LZ={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:tS,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},nS=typeof window<"u"&&typeof document<"u",sS=typeof navigator=="object"&&navigator||void 0,VZ=nS&&(!sS||["ReactNative","NativeScript","NS"].indexOf(sS.product)<0),BZ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",$Z=nS&&window.location.href||"http://localhost",Bs={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:nS,hasStandardBrowserEnv:VZ,hasStandardBrowserWebWorkerEnv:BZ,navigator:sS,origin:$Z},Symbol.toStringTag,{value:"Module"})),...LZ};function HZ(e,t){return Pm(e,new Bs.classes.URLSearchParams,{visitor:function(n,s,o,i){return Bs.isNode&&Be.isBuffer(n)?(this.append(s,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function GZ(e){return Be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function UZ(e){const t={},n=Object.keys(e);let s;const o=n.length;let i;for(s=0;s<o;s++)i=n[s],t[i]=e[i];return t}function ak(e){function t(n,s,o,i){let r=n[i++];if(r==="__proto__")return!0;const a=Number.isFinite(+r),l=i>=n.length;return r=!r&&Be.isArray(o)?o.length:r,l?(Be.hasOwnProp(o,r)?o[r]=[o[r],s]:o[r]=s,!a):((!o[r]||!Be.isObject(o[r]))&&(o[r]=[]),t(n,s,o[r],i)&&Be.isArray(o[r])&&(o[r]=UZ(o[r])),!a)}if(Be.isFormData(e)&&Be.isFunction(e.entries)){const n={};return Be.forEachEntry(e,(s,o)=>{t(GZ(s),o,n,0)}),n}return null}function WZ(e,t,n){if(Be.isString(e))try{return(t||JSON.parse)(e),Be.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const ef={transitional:rk,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",o=s.indexOf("application/json")>-1,i=Be.isObject(t);if(i&&Be.isHTMLForm(t)&&(t=new FormData(t)),Be.isFormData(t))return o?JSON.stringify(ak(t)):t;if(Be.isArrayBuffer(t)||Be.isBuffer(t)||Be.isStream(t)||Be.isFile(t)||Be.isBlob(t)||Be.isReadableStream(t))return t;if(Be.isArrayBufferView(t))return t.buffer;if(Be.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return HZ(t,this.formSerializer).toString();if((a=Be.isFileList(t))||s.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Pm(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),WZ(t)):t}],transformResponse:[function(t){const n=this.transitional||ef.transitional,s=n&&n.forcedJSONParsing,o=this.responseType==="json";if(Be.isResponse(t)||Be.isReadableStream(t))return t;if(t&&Be.isString(t)&&(s&&!this.responseType||o)){const r=!(n&&n.silentJSONParsing)&&o;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:Bs.classes.FormData,Blob:Bs.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Be.forEach(["delete","get","head","post","put","patch"],e=>{ef.headers[e]={}});const zZ=Be.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"]),jZ=e=>{const t={};let n,s,o;return e&&e.split(`
|
|
141
|
+
This will fail in production.`);r=jl,r._s.has(e)||(o?Ub(e,t,s,r):kA(e,s,r),j.env.NODE_ENV!=="production"&&(i._pinia=r));const c=r._s.get(e);if(j.env.NODE_ENV!=="production"&&a){const u="__hot:"+e,d=o?Ub(u,t,s,r,!0):kA(u,Qo({},s),r,!0);a._hotUpdate(d),delete r.state.value[u],r._s.delete(u)}if(j.env.NODE_ENV!=="production"&&Yr){const u=bs();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 Xs(e){const t=Mt(e),n={};for(const s in t){const o=t[s];o.effect?n[s]=Z({get:()=>e[s],set(i){e[s]=i}}):(pn(o)||Ho(o))&&(n[s]=wi(e,s))}return n}const Wb=Yl("permissionStore",()=>{const e=V([]),t=V(),n=V({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:r=>{e.value=r},setEntityPermissions:r=>{t.value=r},setItemPermission:(r,a)=>{n.value[r]=a}}}),Yq="woohoo_getWoohooUserInterface_read",zb="media_getReviewUserInterface_read",Zq="update_getUpdateUserInterface_read",Xq=(e,t,n,s,o,i)=>{const r=Wb(),{userPermissions:a}=Xs(r),l=Z(()=>{const A=En.getInstance().getItem("BASE_URL"),O=En.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:I,entity_id:D,scene_id:x}=e.value;return{baseDomain:A||"",ws_code:I||"",entity_id:D||"",scene_id:x||"",reviewDomain:O||"",take_id:D||"",woohoo_id:D||"",parent_id:D||""}}),c=Z(()=>{var O;const A=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:a.value.includes(zb),canCopyLink:!0,canRename:(A==null?void 0:A.has_edit_permission)??!1,canOpenTakeInReview:a.value.includes(zb),canOpenTakeInUpdate:a.value.includes(Zq),canOpenTakeInWoohoo:a.value.includes(Yq),canDeleteRendition:((O=A==null?void 0:A.media)==null?void 0:O.has_delete_rendition_permission)??!1,canDeleteThumbnail:(A==null?void 0:A.has_edit_thumbnail_permission)??!1,canArchiveScene:A==null?void 0:A.has_archive_permission,canUnarchiveScene:A==null?void 0:A.has_archive_permission,canDeleteScene:(A==null?void 0:A.has_delete_permission)??!1}}),u=Z(()=>({project:To({type:"project",config:l.value}).url,take_review:To({type:"review_take",config:l.value}).url,review:To({type:"review_scene",config:l.value}).url,review_scene:To({type:"review_scene",config:l.value}).url,woohoo:To({type:"woohoo",config:l.value}).url,update:To({type:"update",config:l.value}).url,scene_hub:To({type:"scene_hub",config:l.value}).url})),d=(A,O)=>{const I=A.metaKey||A.ctrlKey,D=u.value[O]||"";if(D){if(O==="scene_hub"){if(I){window.open(D,"_blank");return}if(!s){console.error("Switch instance not found.",{openSceneHub:s,windowFunc:globalThis.window.$switchInstance});return}s(l.value.scene_id||"");return}I?window.open(D,"_blank"):window.location.href=D}},h=async(A,O)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.deleteRendition({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""],deleteAll:!0}));(D==null?void 0:D.message)!="Done"&&console.error("Failed to delete rendition.")}catch(D){console.error("Error deleting rendition",D)}finally{o()}},f=async(A,O)=>{var I;try{await((I=e.value.axiosService.value)==null?void 0:I.deleteThumbnail({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""]}))}catch(D){console.error("Error deleting thumbnail",D)}finally{o()}},p=async(A,O)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.archiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(D==null?void 0:D.message)!="Done"&&console.error("Failed to archive scene."),O&&O("archived")}catch(D){console.error("Error archiving item",D)}finally{o()}},g=async(A,O)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.deleteScene(l.value.ws_code,l.value.entity_id,l.value.scene_id));(D==null?void 0:D.message)!="Done"&&console.error("Failed to delete scene."),O&&O("deleted")}catch(D){console.error("Error deleting item",D)}finally{o()}},v=A=>{const O=u.value.scene_hub||"";O&&(E.value="Copied",navigator.clipboard.writeText(O),setTimeout(()=>{E.value="Copy link"},5e3))},y=async(A,O)=>{var I;try{const D=await((I=e.value.axiosService.value)==null?void 0:I.unarchiveScene(l.value.ws_code,l.value.entity_id,[l.value.scene_id]));(D==null?void 0:D.message)!="Done"&&console.error("Failed to unarchive scene."),O&&O("unarchived")}catch(D){console.error("Error unarchiving item",D)}finally{o()}},b=A=>p(A,t),S=A=>y(A,t),C=A=>g(A,t),E=V("Copy link"),R=A=>d(A,"review"),T=Z(()=>{let A=[];if(!l.value.scene_id&&e.value.optionBlock&&A.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length)return e.value.optionBlock;const O=()=>Math.random().toString(36).substring(2,9);return[{id:O(),type:"column",groupLabel:"Download Options",options:[{id:"open_review",label:"Open Review",icon:"PenRuler",action:R,hide:!c.value.canOpenReview,disabled:!c.value.canOpenReview,description:"",type:"icon"},{id:O(),label:E.value,icon:"Link",action:v,hide:!c.value.canCopyLink,disabled:!c.value.canCopyLink,description:"",type:"icon"}]},{id:O(),type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:b,hide:c.value.canArchiveScene==0,disabled:c.value.canArchiveScene!==1,description:c.value.canArchiveScene==-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:S,hide:c.value.canUnarchiveScene==0,disabled:c.value.canUnarchiveScene!==1,description:c.value.canUnarchiveScene===-1?"Parent folder is archived. Unarchive to continue.":"",type:"icon"},{id:"delete",label:"Delete",icon:"TrashCan",isDanger:!0,description:"Delete permanently",action:C,hide:!c.value.canDeleteScene,type:"icon"}]}]});return{linkMap:u,handleOpen:d,copyLink:v,deleteRendition:h,deleteThumbnail:f,archiveItem:p,deleteItem:g,unArchiveItem:y,options:T}};function ms(e){const t=V(!1),n=V(!1),s=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}}),o=()=>{t.value=!0,Ct(()=>{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 Zt(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.addEventListener("focus",o),c.addEventListener("blur",i)),u&&(u.addEventListener("mouseenter",r),u.addEventListener("mouseleave",a))}),Qn(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.removeEventListener("focus",o),c.removeEventListener("blur",i)),u&&(u.removeEventListener("mouseenter",r),u.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:s,handleFocus:o}}const _u=e=>{const t=V(!1),n=Z(()=>t.value);return Zt(()=>{var a,l,c,u;const s=(a=e.params)==null?void 0:a.api,o=(l=e.params)==null?void 0:l.node,i=o==null?void 0:o.rowIndex,r=(u=(c=e.params)==null?void 0:c.colDef)==null?void 0:u.field;return s==null||s.addEventListener("cellEditingStarted",d=>{d.rowIndex===i&&d.colDef.field===r&&(t.value=!0)}),s==null||s.addEventListener("cellEditingStopped",d=>{d.rowIndex===i&&d.colDef.field===r&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}},OA=St(it({__name:"StatusBadge",props:{size:{default:16},color:{default:"#02C39A"},label:{default:""},status:{default:void 0},statusTooltip:{default:"Online"},showBadge:{type:Boolean,default:!0},loading:{type:Boolean}},setup(e){const t=So,{triggerRef:n,popupRef:s}=us({toggleOnClick:!0,trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),o=Z(()=>{switch(i.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"transparent"}}),i=e;return(r,a)=>(W(),ae("div",{class:ee(r.$style["status-badge-wrapper"]),style:ln({"--badge-size":`${i.size}px`,"--badge-color":o.value})},[Tt(r.$slots,"default"),We(be("div",{class:ee(r.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[Ei,i.showBadge],[U(t),{isLoading:i.loading,fullwidth:!0}]]),be("div",{ref_key:"popupRef",ref:s,class:ee(r.$style["badge-tooltip"])},mt(i.statusTooltip),3)],6))}}),[["__cssModules",{$style:{"status-badge-wrapper":"_status-badge-wrapper_30ykl_1","badge-indicator":"_badge-indicator_30ykl_6",active:"_active_30ykl_19",offline:"_offline_30ykl_22",busy:"_busy_30ykl_25",away:"_away_30ykl_28","badge-tooltip":"_badge-tooltip_30ykl_32"}}]]),qh=Yl("switchStore",()=>{const e=V(null),t=Sn("switchInstance");return{openSceneHub:(o,i)=>{if(o){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");t("scene_hub",{id:o,commentId:i},{showLoading:!1})}},openPeopleInsight:o=>{const i=t||e.value;if(!i)throw console.error("Switch instance not found"),new Error("Switch instance not found");o||console.trace("No people_id provided, defaulting to empty string"),i("people_insight",{tab:"home",id:o||""},{showLoading:!1})},switchInstanceFunc:e}}),Jq=it({__name:"MiniPeopleCard",props:{user:{},status:{default:void 0},timezone:{default:om()},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,s=So,o=e,i=t,r={active:"Active in the workspace in the last 10 minutes.",offline:"Logged out from account.",busy:"User is busy",away:"No activity in the workspace within the last 10 minutes"},a=V(o.status),l=V(o.timezone),c=V(!0),u=V(null),d=Z(()=>r[a.value]),h=Z(()=>{var x;return(x=o.user)==null?void 0:x.name}),f=V(!1),p=V(new Date);let g;Zt(async()=>{g=setInterval(()=>{p.value=new Date},6e4)}),_l(()=>{g&&clearInterval(g)});const v=Z(()=>{if(!l.value)return"";try{return p.value.toLocaleTimeString("en-US",{timeZone:l.value,hour:"numeric",minute:"2-digit",hour12:!0})}catch{return console.error("Invalid timezone:",l.value),""}}),y=async()=>{var x,P,M;if(o.apiUpdateFunction)try{const B=await o.apiUpdateFunction(o.user.id);if(!B){f.value=!0,console.error("No data returned from API");return}(x=B==null?void 0:B.private_info)!=null&&x.is_offline?a.value="offline":(P=B.private_info)!=null&&P.last_active?a.value="active":a.value="away",(M=B.private_info)!=null&&M.timezone&&(l.value=B.private_info.timezone),i("dataUpdated",B)}catch(B){f.value=!0,console.error("Failed to fetch user data:",B)}finally{c.value=!1}},b=()=>{!o.apiUpdateFunction||!o.enableAutoRefresh||(u.value!==null&&clearInterval(u.value),u.value=setInterval(y,o.refreshInterval))},S=()=>{u.value!==null&&(clearInterval(u.value),u.value=null)},C=Z(()=>{const x=globalThis.location.origin,P=En.getInstance().getItem("ws.code");return To({type:"people_insight",config:{ws_code:P,baseDomain:x,user_id:o.user.id}}).url}),{copyToClipboard:E,tooltip:R}=PF(C.value,()=>i("copyLink",o.user.id)),T=qh(),{openPeopleInsight:A}=T,O=x=>{if(x.ctrlKey||x.metaKey){window.open(C.value,"_blank");return}try{A(String(o.user.id))}catch{window.open(C.value,"_blank")}},I=x=>{O(x),i("insightClick",o.user.id)};Je([()=>o.enableAutoRefresh,()=>o.refreshInterval,()=>o.apiUpdateFunction],()=>{S(),o.enableAutoRefresh&&o.apiUpdateFunction&&b()}),Zt(async()=>{o.apiUpdateFunction&&(await y(),b())}),Qn(S);const D=Z(()=>({name:o.user.name,initial:o.user.initial,id:o.user.id,profile_image:o.user.profile_image,color:o.user.color,size:72,borderRadius:"20px"}));return(x,P)=>(W(),ae("div",{class:ee([x.$style["mini-people-card"],{[x.$style.loading]:c.value},"bg-skeleton"])},[be("div",{class:ee(x.$style["avatar-section"])},[!o.private&&!f.value?(W(),Ke(OA,{key:0,size:12,status:a.value,loading:c.value,"status-tooltip":d.value},{default:ye(()=>[fe(bh,Jt({readOnly:!0},D.value,{borderRadius:"8px"}),null,16)]),_:1},8,["status","loading","status-tooltip"])):(W(),Ke(bh,Jt({key:1,readOnly:!0},D.value,{borderRadius:"8px"}),null,16))],2),be("div",{class:ee(x.$style["user-info"])},[be("div",{class:ee(x.$style["info-column"])},[We((W(),ae("span",{class:ee(x.$style["user-name"])},[nt(mt(h.value),1)],2)),[[U(n),{content:h.value,delay:[1e3,0]}]]),l.value&&!f.value?(W(),ae("div",{key:0,class:ee([x.$style["info-row"],x.$style["time-row"]])},[We((W(),ae("div",{class:ee(x.$style["time-display"])},[fe(at,{source:"remote",src:"Globe",class:ee(x.$style["clock-icon"]),size:"10"},null,8,["class"]),be("span",{class:ee(x.$style["time-text"])},mt(v.value)+" ("+mt(e.timezone)+")",3)],2)),[[U(s),{isLoading:c.value,fullwidth:!0}]])],2)):Ye("",!0)],2),!e.readOnly&&!o.private&&!f.value?(W(),ae("div",{key:0,class:ee([x.$style["info-row"],x.$style.actions])},[e.showInsightButton?(W(),Ke(gt,{key:0,label:"Insights",variant:"secondary",size:"small",onClick:Pt(I,["prevent","stop"]),disabled:o.disabled},null,8,["disabled"])):Ye("",!0),e.showCopyLinkButton?We((W(),Ke(gt,{key:1,variant:["icon","secondary"],size:"small","aria-label":"Copy link",onClick:Pt(U(E),["prevent","stop"]),disabled:o.disabled},{default:ye(()=>[fe(at,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[U(n),{content:U(R),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Ye("",!0)],2)):Ye("",!0)],2)],2))}}),Qq=St(Jq,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_8t908_1",loading:"_loading_8t908_25","avatar-section":"_avatar-section_8t908_28","user-info":"_user-info_8t908_33","info-column":"_info-column_8t908_42","info-row":"_info-row_8t908_50","time-row":"_time-row_8t908_56","time-display":"_time-display_8t908_62","time-text":"_time-text_8t908_70",actions:"_actions_8t908_79","status-badge":"_status-badge_8t908_83",active:"_active_8t908_96",offline:"_offline_8t908_99",busy:"_busy_8t908_102",away:"_away_8t908_105","user-local-time":"_user-local-time_8t908_108","clock-icon":"_clock-icon_8t908_116",separator:"_separator_8t908_128",timezone:"_timezone_8t908_131","refresh-btn":"_refresh-btn_8t908_134",spinning:"_spinning_8t908_137",spin:"_spin_8t908_137","insight-btn":"_insight-btn_8t908_140","copy-link-btn":"_copy-link-btn_8t908_144","last-update":"_last-update_8t908_147","user-name":"_user-name_8t908_153","loading-overlay":"_loading-overlay_8t908_166","loading-spinner":"_loading-spinner_8t908_178"}}]]),eY=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=Gr,s=Yt,o=e,{isEditing:i}=_u(o),r=()=>{var h,f;const u=(h=o.params)==null?void 0:h.api,d={rowIndex:(f=u==null?void 0:u.getRowNode(String(o.id)))==null?void 0:f.rowIndex,colKey:"options"};u==null||u.startEditingCell(d)},a=Z(()=>{var d,h;const u=(h=(d=o.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(o.id));return((u==null?void 0:u.rowIndex)??0)+10}),l=()=>{var u,d;(d=(u=o.params)==null?void 0:u.api)==null||d.stopEditing()},c=V();return t({focus(){var u;(u=c.value)==null||u.focus()},blur(){var u;(u=c.value)==null||u.blur()}}),(u,d)=>We((W(),Ke(gt,{class:ee(u.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:U(i),onClick:Pt(r,["stop"]),onEscape:l,ref_key:"buttonRef",ref:c},{default:ye(()=>[fe(at,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[U(s),"More actions"],[U(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_w8s4g_1"}}]]),tY=["src","width","height","alt"],Rm=St(it({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=So,{getCachedValue:n,setCachedValue:s}=wh({dbName:"visual-cache-db",storeName:"visuals"}),o=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:o(i.minWidth),maxWidth:o(i.maxWidth),minHeight:o(i.minHeight),maxHeight:o(i.maxHeight),aspectRatio:i.ratio,width:o(i.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await s(h,f)},c=Z(()=>({name:i.src,size:Number(i.size||100),color:""})),{url:u,loading:d}=zT(c,"visual",l,a);return(h,f)=>We((W(),ae("div",{class:ee([h.$style.visualWrapper,{[h.$style.loading]:U(d)}]),style:ln(r.value)},[be("img",{src:U(u),width:e.size,height:e.size,alt:"visual-"+e.src,style:ln(r.value)},null,12,tY)],6)),[[U(t),{isLoading:U(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),nY=["tabindex"],vs=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 s=e,o=n;Xp();const i=dg(),r=V(null),a=V("default"),l=Z(()=>{if(typeof s.size=="number")return`${s.size}px`;switch(s.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]:s.disabled,[i.readOnly]:s.readOnly,[i.error]:s.error,[i.clickable]:s.clickable,[i.active]:s.actived,[i.hovered]:s.hovered,[i.focused]:!s.readOnly&&!s.disabled&&s.focused,[i.bordered]:s.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=V("100%"),f=()=>{h.value=d()};qd(()=>{f()}),Zt(()=>{f()});const p=g=>{a.value=g};return t({rootEl:r,updateState:p,componentState:a,focus:()=>{Ct(()=>{var g;(g=r.value)==null||g.focus()})},escape:()=>{o("escape")}}),(g,v)=>(W(),ae("div",{ref_key:"rootEl",ref:r,class:ee([U(i)["display-wrapper"],u.value]),tabindex:e.tabIndex,style:ln({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":c.value})},[Tt(g.$slots,"prefix",{hovered:s.hovered,focused:s.focused}),Tt(g.$slots,"default",{hovered:s.hovered,focused:s.focused,updateComponentState:p,disabled:s.disabled}),Tt(g.$slots,"suffix",{hovered:s.hovered,focused:s.focused})],14,nY))}}),[["__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"}}]]),sY=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const oY=Object.prototype.toString,iY=e=>oY.call(e)==="[object Object]",Ru=()=>{};function rY(e,t){function n(...s){return new Promise((o,i)=>{Promise.resolve(e(()=>t.apply(this,s),{fn:t,thisArg:this,args:s})).then(o).catch(i)})}return n}function aY(e,t={}){let n,s,o=Ru;const i=l=>{clearTimeout(l),o(),o=Ru};let r;return l=>{const c=Mr(e),u=Mr(t.maxWait);return n&&i(n),c<=0||u!==void 0&&u<=0?(s&&(i(s),s=void 0),Promise.resolve(l())):new Promise((d,h)=>{o=t.rejectOnCancel?h:d,r=l,u&&!s&&(s=setTimeout(()=>{n&&i(n),s=void 0,d(r())},u)),n=setTimeout(()=>{s&&i(s),s=void 0,d(l())},c)})}}function jb(e){return Array.isArray(e)?e:[e]}function lY(e,t=200,n={}){return rY(aY(t,n),e)}function cY(e,t,n){return Je(e,t,{...n,immediate:!0})}const MA=sY?window:void 0;function Yh(e){var t;const n=Mr(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function Kb(...e){const t=(s,o,i,r)=>(s.addEventListener(o,i,r),()=>s.removeEventListener(o,i,r)),n=Z(()=>{const s=jb(Mr(e[0])).filter(o=>o!=null);return s.every(o=>typeof o!="string")?s:void 0});return cY(()=>{var s,o;return[(s=(o=n.value)===null||o===void 0?void 0:o.map(i=>Yh(i)))!==null&&s!==void 0?s:[MA].filter(i=>i!=null),jb(Mr(n.value?e[1]:e[0])),jb(U(n.value?e[2]:e[1])),Mr(n.value?e[3]:e[2])]},([s,o,i,r],a,l)=>{if(!(s!=null&&s.length)||!(o!=null&&o.length)||!(i!=null&&i.length))return;const c=iY(r)?{...r}:r,u=s.flatMap(d=>o.flatMap(h=>i.map(f=>t(d,h,f,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function qb(e,t,n={}){const{window:s=MA,ignore:o=[],capture:i=!0,detectIframe:r=!1,controls:a=!1}=n;if(!s)return a?{stop:Ru,cancel:Ru,trigger:Ru}:Ru;let l=!0;const c=v=>Mr(o).some(y=>{if(typeof y=="string")return Array.from(s.document.querySelectorAll(y)).some(b=>b===v.target||v.composedPath().includes(b));{const b=Yh(y);return b&&(v.target===b||v.composedPath().includes(b))}});function u(v){const y=Mr(v);return y&&y.$.subTree.shapeFlag===16}function d(v,y){const b=Mr(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=Yh(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=[Kb(s,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:i}),Kb(s,"pointerdown",v=>{const y=Yh(e);l=!c(v)&&!!(y&&!v.composedPath().includes(y))},{passive:!0}),r&&Kb(s,"blur",v=>{setTimeout(()=>{var y;const b=Yh(e);((y=s.document.activeElement)===null||y===void 0?void 0:y.tagName)==="IFRAME"&&!(b!=null&&b.contains(s.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 uY=["value","placeholder","disabled","readonly","inputmode","maxlength"],Yb=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},maxDecimalChar:{},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 s=Gr,o=Yt,i=e,r=n,a=V(null),l=V(i.modelValue||"");Je(l,()=>{r("onValidation",l.value)});const c=V(!1),u=V(i.modelValue||"");Je(()=>i.modelValue,k=>{l.value=k||"",u.value=k||""});const d=Z(()=>{var k;return((k=l.value)==null?void 0:k.length)>0}),h={text:k=>k.slice(0,i.maxLength||255),number:k=>{let N=k.replace(/[^\d.-]/g,"");const Q=N.split(".");Q.length>2&&(N=Q[0]+"."+Q.slice(1).join("")),N=N.replace(/-/g,(X,De)=>De===0?X:"");const xe=N.startsWith("-")?"-":"",de=N.replace("-","").split(".");return de[0].length>17&&(de[0]=de[0].substring(0,17)),i.maxDecimalChar!==void 0&&de.length>1&&(de[1]=de[1].substring(0,i.maxDecimalChar)),N=xe+de.join("."),N},email:k=>k.replace(/\s/g,"").slice(0,i.maxLength||255),url:k=>k.replace(/\s/g,"").slice(0,i.maxLength||255),tel:k=>k.replace(/[^\d+\-() ]/g,"").slice(0,i.maxLength||20)},f=k=>{const N=h[i.type];return N?N(k):k},p=lY(k=>{i.autoEmit&&(r("update:modelValue",k),r("input",k))},i.debounceDelay),g=k=>{const N=k;if(i.disabled||i.readOnly){N.preventDefault();return}const Q=N.target,ce=Q.selectionStart||0,xe=l.value,ge=f(Q.value);xe!==ge&&(l.value=ge,r("input",ge),i.autoEmit&&p(ge),Q.value!==ge&&(Q.value=ge,Ct(()=>{let de=ce;if(ge.length<Q.value.length)de=ce;else{const X=ge.length-xe.length;de=ce+X}de=Math.max(0,Math.min(de,ge.length)),Q.setSelectionRange(de,de)})))},v=k=>{if(i.disabled||i.readOnly){k.preventDefault();return}c.value=!0;const N=l.value;l.value="",r("update:modelValue",""),r("clear"),N!==""&&r("change",""),k.preventDefault(),k.stopImmediatePropagation(),k.stopPropagation(),Ct(()=>{var Q;(Q=a.value)==null||Q.focus(),setTimeout(()=>{c.value=!1},100)})},y=k=>{i.disabled||i.readOnly||(r("focus",k),i.selectOnFocus&&Ct(()=>{k.target.select()}))},b=k=>{if(c.value)return;const Q=k.target.value;i.autoEmit||r("update:modelValue",Q),u.value!==Q&&(r("change",Q),u.value=Q),r("blur",Q,k)},S=k=>{setTimeout(()=>{Ct(()=>{const Q=k.target.value;r("enter",Q,k),r("enterValue",Q),i.submitOnEnter&&(k.preventDefault(),i.autoEmit||r("update:modelValue",Q),u.value!==Q&&(r("change",Q),u.value=Q))})},1e3)},C=k=>{const N=k.target,Q=N.value;if(r("escape",Q,k),k.preventDefault(),k.stopImmediatePropagation(),k.stopPropagation(),i.autoEmit){r("cancel"),i.blurOnEscape&&N.blur();return}l.value=i.modelValue||"",a.value&&(a.value.value=l.value),r("cancel"),i.blurOnEscape&&N.blur()},E=k=>{const Q=k.target.value;r("tab",Q,k),i.autoEmit||(r("update:modelValue",Q),u.value!==Q&&(r("change",Q),u.value=Q))},R=(k,N,Q)=>k===""?!0:k==="."?Q>0:new RegExp(`^\\d{0,${N}}(\\.\\d{0,${Q}})?$`).test(k),T=k=>{if(r("keydown",k),k.key===" "&&k.stopPropagation(),i.type==="number"){if(k.key==="e"||k.key==="E"){k.preventDefault();return}if(!(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"].includes(k.key)||k.ctrlKey||k.metaKey||k.altKey)){if(Number.isNaN(Number(k.key))&&k.key!=="."&&k.key!=="-"){k.preventDefault();return}const ce=l.value+k.key;if(!R(ce,17,i.maxDecimalChar||2)){k.preventDefault(),console.log("BLOCKED",ce);return}}}k.key==="Escape"?C(k):k.key==="Enter"?S(k):k.key==="Tab"?E(k):(k.key==="ArrowUp"||k.key==="ArrowDown")&&i.type==="number"&&k.preventDefault()},A=k=>{r("keyup",k)},O=k=>{if(i.disabled||i.readOnly){k.preventDefault();return}r("paste",k)},I=k=>{if(i.disabled||i.readOnly){k.preventDefault();return}r("cut",k)},D=k=>{r("select",k)},x=`input-text-${Math.random().toString(36).substr(2,9)}`,P=V(!1),M=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,k=>{i.validatorFnc?P.value=!!k&&!i.validatorFnc(k):P.value=!1});const B=V(null),Y=Z(()=>({disabled:i.disabled,readOnly:i.readOnly,error:P.value,inputRef:a,clickable:!i.disabled&&!i.readOnly,focused:i.focused,wrapperRef:B,bordered:!0})),{argsMain:ne,isHover:te,isFocus:z}=ms(Y);t({triggerFocus:()=>{Ct(()=>{var k;(k=a.value)==null||k.focus()})},focus:()=>{pe()},blur:()=>{Ct(()=>{var k;(k=a.value)==null||k.blur()})},select:()=>{Ct(()=>{var k;(k=a.value)==null||k.select()})},setSelectionRange:(k,N)=>{Ct(()=>{var Q;(Q=a.value)==null||Q.setSelectionRange(k,N)})},getValue:()=>l.value,setValue:k=>{l.value=f(k),a.value&&(a.value.value=l.value)},reset:()=>{l.value=i.modelValue||"",a.value&&(a.value.value=l.value)}});const pe=()=>{!i.disabled&&!i.readOnly&&Ct(()=>{var k;(k=a.value)==null||k.focus()})},q=Z(()=>z.value&&d.value);return(k,N)=>(W(),ae("div",{class:ee([k.$style["input-wrapper"],"input-editor"]),onClick:pe},[We((W(),Ke(vs,Jt(U(ne),{ref_key:"wrapperRef",ref:B,class:[k.$style["input-box"],{[k.$style["is-hovered"]]:U(te),[k.$style["is-focused"]]:U(z),[k.$style["has-input"]]:d.value,[k.$style["is-editting"]]:q.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:i.bordered}),{prefix:ye(()=>[Tt(k.$slots,"prefix")]),suffix:ye(()=>[d.value&&!i.disabled&&!i.readOnly?Tt(k.$slots,"clear",{key:0},()=>[We((W(),Ke(gt,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:Pt(v,["prevent","stop"]),size:18,rounded:!0,class:ee(["wrapper-suffix",k.$style["clear-button"]])},{default:ye(()=>[fe(at,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[U(o),{content:"Clear",contentClass:"extra-padding"}]])]):Tt(k.$slots,"suffix",{key:1})]),default:ye(()=>[be("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:"text",value:l.value,placeholder:e.placeholder,class:ee([k.$style["column-config__input"]]),id:x,disabled:e.disabled,readonly:e.readOnly,inputmode:M.value,maxlength:i.maxLength,onInput:g,onFocus:y,onBlur:b,onKeydown:T,onKeyup:A,onPaste:O,onCut:I,onSelect:D},null,42,uY)]),_:3},16,["class","bordered"])),[[U(s),i.focusIndex]]),P.value?Tt(k.$slots,"error",{key:0}):Ye("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_wqanj_1","is-disabled":"_is-disabled_wqanj_16","is-readonly":"_is-readonly_wqanj_16","is-hovered":"_is-hovered_wqanj_16","is-focused":"_is-focused_wqanj_20","column-config__input":"_column-config__input_wqanj_40","clear-button":"_clear-button_wqanj_55"}}]]),dY={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},Zb=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 s=e,o=n,i=V(null),r=Ri(c=>{o("update:modelValue",c),o("search",c)},sr),a=()=>{o("update:modelValue",""),o("clear"),Ct(()=>{var c;(c=i.value)==null||c.focus()})},l=V(s.modelValue);return t({focus:()=>{var c;(c=i.value)==null||c.focus()},setValue(c){l.value=c}}),(c,u)=>(W(),Ke(Yb,{focusIndex:s.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:U(r),onClear:a,onCancel:u[1]||(u[1]=d=>o("cancel")),"auto-emit":!0},{prefix:ye(()=>[be("div",dY,[fe(at,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),Zl=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 s=e,o=n,i=V(!1),r=V(!1);function a(C){if(!C||typeof C!="object")return!1;const E=C;return typeof E.name=="string"&&typeof E.id=="string"&&typeof E.initial=="string"}const l=Z(()=>s.type==="status"||s.type==="assignee"||s.type==="icon"||!!S.prefix),c=Z(()=>!!S.suffix||s.danger&&i.value),u=Z(()=>{var C;return s.type==="status"&&typeof((C=s.data)==null?void 0:C.color)=="string"?{backgroundColor:s.data.color,border:Pg(s.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),d=dg(),h=Z(()=>({[d.active]:s.selected??!1,[d.disabled]:s.disabled??!1,[d.hover]:s.hover??!1,[d.clickable]:(s.clickable??!0)&&!s.disabled,[d.danger]:s.danger??!1,[d["has-prefix"]]:l.value,[d["has-suffix"]]:c.value,[d.readOnly]:s.readOnly}));Z(()=>({content:"Cancel",...b})),Z(()=>({content:"Confirm",theme:"warning",...b}));function f(C){return{name:C.name,initial:C.initial,id:C.id,profile_image:C.profile_image??null,color:C.color,size:24}}function p(){i.value=!1}function g(C){C?o("click",C):(s.clickable??!0)&&(o("update:selected",!s.selected),o("select",!s.selected))}function v(C){if(!s.disabled){if(s.danger&&!i.value){i.value=!0;return}else s.danger||g(C);o("handleClick",C)}}const y=()=>{i.value?p():o("escape")},b=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),S=Xp();return Je(()=>s.show,C=>{C===!1&&(i.value=!1)}),t({select:()=>{v(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(C,E)=>{const R=wo("focusable"),T=wo("tooltip");return We((W(),Ke(gt,{variant:["menu-item",e.danger?"danger":"menu-item"],class:ee([C.$style["list-item"],h.value]),onHandleClick:v,onMouseenter:E[0]||(E[0]=A=>r.value=!0),onMouseleave:E[1]||(E[1]=A=>r.value=!1),onEscape:y},{default:ye(()=>[l.value?(W(),ae("div",{key:0,class:ee(C.$style["list-item__prefix"])},[Tt(C.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(W(),Ke(at,{key:0,src:e.icon,source:"remote",class:ee(C.$style["item-icon"])},null,8,["src","class"])):e.type==="status"?(W(),ae("div",{key:1,class:ee(C.$style["status-indicator"]),style:ln(u.value)},null,6)):e.type==="assignee"&&a(e.data)?(W(),Ke(bh,Jt({key:2},f(e.data),{class:C.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Ye("",!0)])],2)):Ye("",!0),be("div",{class:ee(C.$style["list-item__label"])},[Tt(C.$slots,"label",{selected:e.selected},()=>[nt(mt(e.label),1)])],2),c.value?(W(),ae("div",{key:1,class:ee(C.$style["list-item__suffix"])},[Tt(C.$slots,"suffix",{item:C.$props,hovered:r.value},()=>[e.danger&&i.value?(W(),ae("div",{key:0,class:ee(C.$style["confirm-action"])},[We((W(),Ke(gt,{variant:["tertiary","icon","danger"],size:"small",onClick:Pt(p,["stop","prevent"])},{default:ye(()=>[fe(at,{src:"Xmark",source:"remote"})]),_:1})),[[R,`${s.focusIndex}.0`],[T,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),We((W(),Ke(gt,{variant:["danger","primary","icon"],size:"small",onClick:Pt(g,["stop","prevent"])},{default:ye(()=>[fe(at,{src:"Check",source:"remote"})]),_:1})),[[R,`${s.focusIndex}.1`],[T,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ye("",!0)])],2)):Ye("",!0)]),_:3},8,["variant","class"])),[[R,s.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_y7vz1_1",disabled:"_disabled_y7vz1_16",danger:"_danger_y7vz1_23","has-prefix":"_has-prefix_y7vz1_26","has-suffix":"_has-suffix_y7vz1_26",clickable:"_clickable_y7vz1_40",readOnly:"_readOnly_y7vz1_43",hover:"_hover_y7vz1_47",active:"_active_y7vz1_53","list-item__prefix":"_list-item__prefix_y7vz1_78","list-item__label":"_list-item__label_y7vz1_86","list-item__suffix":"_list-item__suffix_y7vz1_100","status-indicator":"_status-indicator_y7vz1_107","item-icon":"_item-icon_y7vz1_113","arbo-icon-state":"_arbo-icon-state_y7vz1_118","item-avatar":"_item-avatar_y7vz1_121","confirm-action":"_confirm-action_y7vz1_130"}}]]),hY=["aria-activedescendant"],fY=["innerHTML"],pY=10,Xr=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:"218px"},width:{default:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const s=Yt,o={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},i=e,r=n,a=V(""),l=V(-1),c=V(null),u=V(null),d=V(new Map),h=Z(()=>db(a.value)),f=()=>{const q=h.value;if(!q||q.length<i.minQueryLength)return i.options;if(d.value.has(q))return d.value.get(q);const k=i.options.map(N=>({item:N,score:u7(` ${N.label} `,q)})).filter(({score:N})=>N>0).sort((N,Q)=>Q.score-N.score).map(({item:N})=>N);return d.value.set(q,k),k},p=V([]);Je(()=>i.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=Z(()=>i.hasMore&&!i.loading&&!i.loadingMore),v=Ri(q=>{a.value=q,l.value=-1,r("search",q)},sr),y=async q=>{z.value=0,await v(q||""),z.value=1},b=q=>a.value?d7(q,a.value):q,S=q=>{const N={[o.ARROW_DOWN]:()=>C(q),[o.ARROW_UP]:()=>E(q),[o.ENTER]:()=>A(q),[o.ESCAPE]:()=>O(q),[o.TAB]:()=>I(q)}[q.key];N&&N()},C=q=>{q.preventDefault(),R(1)},E=q=>{q.preventDefault(),R(-1)},R=q=>{const k=p.value.length;if(k===0)return;let N;q>0?N=(l.value+1)%k:l.value>0?N=l.value-1:N=k-1,l.value=N,T()},T=()=>{Ct(()=>{var k;const q=(k=u.value)==null?void 0:k.querySelectorAll('[role="menuitem"]')[l.value];q==null||q.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},A=q=>{if(q.preventDefault(),l.value>=0&&l.value<p.value.length){const N=p.value[l.value];D(N,q)}},O=q=>{q.preventDefault(),P()},I=q=>{r("tab",q)},D=(q,k)=>{!q||q.disabled||(r("select",q,k),l.value=-1,P())},x=q=>{q>=0&&q<p.value.length&&(l.value=q)},P=()=>{r("close")},M=()=>{if(!g.value||!u.value)return;const{scrollTop:q,clientHeight:k,scrollHeight:N}=u.value;N-(q+k)<=pY&&r("loadMore")},B=()=>{var q,k,N;(q=u.value)==null||q.addEventListener("scroll",M),(N=(k=te.value)==null?void 0:k.$el)==null||N.addEventListener("keydown",S)},Y=()=>{var q,k,N;(q=u.value)==null||q.removeEventListener("scroll",M),(N=(k=te.value)==null?void 0:k.$el)==null||N.removeEventListener("keydown",S)};Zt(()=>{B()}),Qn(()=>{Y()}),Je(()=>i.loading,q=>{!q&&p.value.length>0&&(l.value=-1)});const ne=q=>q?Array.isArray(i.selectedId)?i.selectedId.includes(String(q.id)):i.selectedId==q.id:!1,te=V(null);Je(l,()=>{T()}),t({focus:()=>{Ct(()=>{var q;(q=te.value)==null||q.focus()})},reset:()=>{var q;(q=te.value)==null||q.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:P,clearSearch:()=>{a.value=""},scrollTo:q=>{u.value&&(u.value.scrollTop=q)},selectIndex:q=>{q>=0&&q<p.value.length&&(l.value=q,T())}});const z=V(0);Je([()=>i.loading,()=>a.value,()=>i.options,()=>i.loadingMore],()=>{const q=i.options.length>0&&p.value.length>0,k=!q&&a.value.length>0,N=!q&&a.value.length===0;i.loading?z.value=0:q?z.value=1:k?z.value=2:N&&(z.value=3)},{immediate:!0,deep:!0});const pe=()=>{r("cancel")};return(q,k)=>(W(),ae("datalist",{ref_key:"searchListRef",ref:c,class:ee([q.$style["search-list"],z.value===3||z.value===2?q.$style.empty:"",p.value.length>8?q.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:ln({width:e.width})},[fe(Zb,{ref_key:"searchBoxRef",ref:te,modelValue:a.value,"onUpdate:modelValue":k[0]||(k[0]=N=>a.value=N),class:ee(q.$style["search-box"]),disabled:e.loading,onSearch:y,onClear:k[1]||(k[1]=N=>y("")),onCancel:pe},null,8,["modelValue","class","disabled"]),be("div",{ref_key:"popupRef",ref:u,class:ee(q.$style["list-container"]),style:ln({maxHeight:e.maxHeight})},[Tt(q.$slots,"extra-item",{query:a.value}),(W(!0),ae(xt,null,xn(p.value,(N,Q)=>We((W(),ae("div",{key:`${N.id}-${Q}`,role:"menuitem"},[Tt(q.$slots,"item",{item:N,index:Q,selectedIndex:l.value,isSelected:ne,handleSelect:D,handleItemHover:x,getHighlightedLabel:b,query:a.value,idx:Q},()=>[N.hide?Ye("",!0):(W(),Ke(Zl,Jt({key:0,ref_for:!0},N,{hover:Q===l.value,selected:ne(N),type:N.type,id:`item-${Q}`,"aria-selected":Q===l.value,onClick:ce=>D(N,ce),onMouseover:ce=>x(Q),onEscape:P}),{prefix:ye(()=>[Tt(q.$slots,"prefix-item",{item:N})]),label:ye(()=>[a.value?We((W(),ae("span",{key:0,class:ee(q.$style.match),innerHTML:b(N.label)},null,10,fY)),[[U(s),{content:N.label,delay:[1e3,0]}]]):We((W(),ae("span",{key:1,class:ee(q.$style["item-label"])},[nt(mt(N.label),1)],2)),[[U(s),{content:N.label,delay:[1e3,0]}]])]),suffix:ye(({hovered:ce})=>[Tt(q.$slots,"action",{item:N,isHovered:Q===l.value,hovered:ce,selected:l.value==Q})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover"]))])])),[[Ei,z.value===1]])),128)),z.value===0?Tt(q.$slots,"loading-more",{key:0},()=>[(W(),ae(xt,null,xn(8,N=>be("div",{class:ee(q.$style["loading-more"]),key:N},[be("div",{class:ee(q.$style["loading-skeleton"])},null,2),be("div",{class:ee(q.$style["loading-skeleton"])},null,2)],2)),64))]):Ye("",!0),z.value===2?(W(),ae("div",{key:1,class:ee(q.$style["no-results"])},[Tt(q.$slots,"empty",{query:a.value},()=>[be("div",{class:ee(q.$style["no-results-content"])},[...k[2]||(k[2]=[be("div",null,[nt(" No results. "),be("br"),nt(" Try another search. ")],-1)])],2)])],2)):Ye("",!0),z.value===3?(W(),ae("div",{key:2,class:ee(q.$style["no-results"])},[Tt(q.$slots,"empty-list",{},()=>[be("div",{class:ee(q.$style["no-results-content"])},[...k[3]||(k[3]=[be("div",null,"No items available.",-1)])],2)])],2)):Ye("",!0),Tt(q.$slots,"footer")],6)],14,hY))}}),[["__cssModules",{$style:{"search-list":"_search-list_q431s_1",empty:"_empty_q431s_9",scrollable:"_scrollable_q431s_15","list-container":"_list-container_q431s_22","item-label":"_item-label_q431s_41","loading-state":"_loading-state_q431s_49","loading-more":"_loading-more_q431s_50","loading-skeleton":"_loading-skeleton_q431s_61","is-loading":"_is-loading_q431s_68","no-results":"_no-results_q431s_123","no-results-content":"_no-results-content_q431s_130",title:"_title_q431s_133",tips:"_tips_q431s_139",match:"_match_q431s_153","skeleton-loading":"_skeleton-loading_q431s_1"}}]]),Du=it({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=XW,n=e,s=V(n.appendTo||void 0),o=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:s.value}),i=V(o());Je(()=>n,()=>{setTimeout(()=>{Ct(()=>{s.value=n.appendTo||void 0,i.value=o()})},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)=>We((W(),Ke(bh,Q_(xw(r.value)),null,16)),[[U(t),i.value]])}}),gY={class:"avatar-wrapper"},mY={class:"assignee-label"},NA=St(it({__name:"AssigneeItem",props:{user:{},hover:{type:Boolean},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},multipleSelect:{type:Boolean,default:!1},isMe:{type:Boolean},appendTo:{},apiUpdateFunction:{}},emits:["select","deselect","reselect"],setup(e,{emit:t}){const n=Yt,s=e,o=Z(()=>({name:s.user.name,id:s.user.id,profile_image:s.user.profile_image,color:{bgColor:s.user.color.bgColor,textColor:s.user.color.textColor},initial:s.user.initial})),i=Z(()=>s.isMe),r=Xp(),a=Z(()=>{if(!l.value||!r.actions)return 0;let c=0;const u=d=>{d.forEach(h=>{h.type===xt&&Array.isArray(h.children)?u(h.children):h.type!==Kn&&h.type!==_a&&c++})};return u(r.actions()),c}),l=V(!1);return(c,u)=>(W(),ae("div",{class:ee(["assignee-selector-item",{hovered:l.value||s.hover,disabled:s.disabled,selected:s.selected,single:a.value==0,focused:s.focused}]),style:ln({"--actions-count":a.value}),onMouseenter:u[0]||(u[0]=d=>l.value=!0),onMouseleave:u[1]||(u[1]=d=>l.value=!1)},[be("div",gY,[fe(Du,{user:o.value,"show-profile":!0,isMe:i.value,"append-to":s.appendTo,"api-update-function":s.apiUpdateFunction},null,8,["user","isMe","append-to","api-update-function"]),s.multipleSelect?(W(),ae("div",{key:0,class:ee(["avatar-indicator",[s.selected?"remove":"add"]])},[s.selected?(W(),Ke(at,{key:0,src:"CircleXMark"})):(W(),Ke(at,{key:1,src:"CirclePlus"}))],2)):Ye("",!0)]),We((W(),ae("div",mY,[Tt(c.$slots,"name",{},()=>[nt(mt(s.user.name),1)],!0)])),[[U(n),{content:s.user.name,delay:[1e3,0]}]]),l.value?Tt(c.$slots,"actions",{key:0},void 0,!0):Ye("",!0)],38))}}),[["__scopeId","data-v-6285207c"]]),vY={class:"unassign-icon"},Xb=St(it({__name:"UnassignBtn",props:{actived:{type:Boolean,default:!1},label:{default:"No assignee"},borderLeft:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t,s=()=>{n("click")};return(o,i)=>(W(),Ke(U(gt),{variant:"menu-item",onClick:s,actived:e.actived,style:ln({"border-top-width":0,"border-bottom-width":0,"border-left-width":e.borderLeft?"4px":"0"})},{prefix:ye(()=>[be("div",vY,[Tt(o.$slots,"icon",{},()=>[i[0]||(i[0]=be("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[be("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"#a6a6a6"})],-1))],!0)])]),default:ye(()=>[Tt(o.$slots,"label",{},()=>[nt(mt(e.label),1)],!0)]),_:3},8,["actived","style"]))}}),[["__scopeId","data-v-ec3b3a15"]]),yY=["innerHTML"],wY=20,LA=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 s=Yt,o=e,{id:i}=Np(o),r=n,a=N=>{var ce,xe;const Q=(xe=(ce=o.params)==null?void 0:ce.api)==null?void 0:xe.getRowNode(String(i.value));Q==null||Q.setDataValue("assignees",Mx(N.assignees)),k("updated"),k("update-completed")},l=V(!1),c=V(!1),u=V(null),d=V(1),h=V(!0),f=V(0),p=V(""),g=Sn("bulkUpdate",V(!1)),v=Sn("isSelectAll",V(!1)),{unAssignAll:y,replaceAssignees:b,handleSelect:S,assigneeList:C,mergedOptions:E,selectedUserIds:R}=um({...o,entityId:o.entityId,updateRowData:a,value:o.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{k("update-failed")}}),{apiServices:T}=es(!g.value,o),A=Sn("workspaceId"),O=async(N=1,Q="",ce=!1)=>{var xe,ge,de,X,De;if(!T.value||!o.id&&!o.ids)throw console.error("API service or item identifiers are undefined",T.value,o.id,o.ids),new Error("API service or item identifiers are undefined");if(ce?c.value=!0:l.value=!0,u.value=null,!((xe=T.value)!=null&&xe.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");try{const re=await((ge=T.value)==null?void 0:ge.multipleAssignableUser({workspaceId:String(A),itemIds:(o.ids??(o.id?[o.id]:[])).map(String),page:N,perPage:wY,q:Q.trim()})),Ae=((de=gu(re.data))==null?void 0:de.map(cm))??[];C.value=ce?tu(C.value,Ae,"id"):Ae,f.value=re.meta.total,h.value=(((X=re==null?void 0:re.meta)==null?void 0:X.current_page)||0)<(((De=re==null?void 0:re.meta)==null?void 0:De.last_page)||0),d.value=N}catch(re){console.error("Error fetching assignable users:",re),u.value="Failed to load assignable users"}finally{l.value=!1,c.value=!1}},I=()=>{!c.value&&h.value&&O(d.value+1,p.value,!0)},D=Ri(async N=>{p.value=N,await O(1,N,!1)},sr),x=()=>O(1,p.value,!1);Zt(()=>{var N;(N=M.value)==null||N.focus()}),t({getValue:()=>{var N;return(N=E.value.find(Q=>Q.selected))==null?void 0:N.value},refresh:x,clearInternal:()=>{R.value=[]},focus:()=>{var N;(N=M.value)==null||N.focus()}});const P=()=>{const N=En.getInstance().getItem("BASE_URL"),Q=To({type:"access_setting",config:{baseDomain:N,ws_code:o.workspaceId,entity_id:A}}).url;window.open(Q,"_blank")},M=V(null);Zt(()=>{Ct(()=>{var N;(N=M.value)==null||N.focus()})}),Je([()=>o.id,()=>o.workspaceId,()=>o.ids],()=>{O()},{deep:!0,immediate:!0});const B=N=>{var ce;const Q=En.getInstance().getItem("ws.code");return((ce=T.value)==null?void 0:ce.getUserInformation(Q,N))||Promise.resolve(null)},Y=async(N,Q,ce)=>{Q.preventDefault(),Q.stopPropagation(),Q.stopImmediatePropagation(),k("start-update");try{const xe=await S(N)}catch(xe){k("update-failed"),console.error("Error updating assignees:",xe)}finally{k("update-completed")}},ne=async()=>{try{k("start-update");const N=await y()}catch(N){k("update-failed"),console.error("Error unassigning all assignees:",N)}finally{k("update-completed")}},te=async N=>{try{k("start-update");const Q=await b(N)}catch(Q){k("update-failed"),console.error("Error replacing assignees:",Q)}finally{k("update-completed")}},z=()=>{var N,Q;r("cancel"),(Q=(N=o.params)==null?void 0:N.api)==null||Q.stopEditing()};Ki("popupAttachRef",M);const pe=V(),q=V(!1),k=(N,Q)=>{setTimeout(()=>{Ct(()=>{switch(N){case"start-update":r("start-update");break;case"update-failed":r("update-failed");break;case"update-completed":r("update-completed");break}})},500)};return Zt(()=>{Ct(()=>{setTimeout(()=>{q.value=!0},50)})}),(N,Q)=>(W(),ae("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:pe},[fe(Xr,Jt({"selected-id":U(R)},{...o},{options:U(E),loading:l.value,ref_key:"popupRef",ref:M,"loading-more":c.value,"has-more":h.value,onSelect:Q[0]||(Q[0]=(ce,xe)=>{Y(ce,xe)}),"data-wrapper":"true",onSearch:U(D),onLoadMore:I,onCancel:z,onClose:z}),Yd({"extra-item":ye(()=>[fe(Xb,{onClick:ne,actived:!1,label:"Unassign"},{icon:ye(()=>[fe(at,{src:"UserXMark",source:"remote"})]),_:1})]),item:ye(({item:ce,selectedIndex:xe,isSelected:ge,handleItemHover:de,getHighlightedLabel:X,query:De,idx:re})=>[fe(NA,{user:ce.data,"multiple-select":!0,"append-to":pe.value,isMe:!1,hover:re===xe,selected:ge(ce),onClick:Pt(Ae=>Y(ce,Ae,"click"),["stop","prevent"]),onMouseover:Ae=>de(re),"api-update-function":B},{name:ye(()=>[De?We((W(),ae("span",{key:0,class:ee([N.$style["item-label"],N.$style.match]),style:{flex:"1"},innerHTML:X(ce.label)},null,10,yY)),[[U(s),{content:ce.label}]]):We((W(),ae("span",{key:1,class:ee(N.$style["item-label"]),style:{flex:"1"}},[nt(mt(ce.label),1)],2)),[[U(s),{content:ce.label}]])]),actions:ye(()=>[We((W(),Ke(gt,{variant:["secondary","icon"],size:"small",label:"",onClick:Pt(Ae=>{var H;return te((H=ce.data)==null?void 0:H.id)},["stop"])},{default:ye(()=>[fe(at,{src:"PeopleArrows"})]),_:1},8,["onClick"])),[[U(s),"Unassign others and reassign"]])]),_:2},1032,["user","append-to","hover","selected","onClick","onMouseover"])]),"empty-list":ye(()=>[be("div",{class:ee(N.$style["empty-state"])},[Q[3]||(Q[3]=nt(" No assignee available. ",-1)),Q[4]||(Q[4]=be("br",null,null,-1)),fe(gt,{onClick:P,variant:["tertiary"],size:"small"},{default:ye(()=>[...Q[2]||(Q[2]=[nt(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[u.value?{name:"error",fn:ye(()=>[be("div",{class:ee(N.$style["error-message"])},[nt(mt(u.value)+" ",1),fe(gt,{onClick:x,size:"small"},{default:ye(()=>[...Q[1]||(Q[1]=[nt(" Retry ",-1)])]),_:1})],2)]),key:"0"}:void 0]),1040,["selected-id","options","loading","loading-more","has-more","onSearch"])],512))}}),[["__cssModules",{$style:{action:"_action_nv6on_1","item-assignee":"_item-assignee_nv6on_6","item-action":"_item-action_nv6on_6","item-label":"_item-label_nv6on_16","error-message":"_error-message_nv6on_25","empty-state":"_empty-state_nv6on_35","skeleton-avatar":"_skeleton-avatar_nv6on_48"}}]]),CY=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;Ki("bulkUpdate",!0);const s=V(!1),o=t,i=V(null),r=()=>{s.value=!0},a=()=>{Ct(()=>{setTimeout(()=>{s.value=!1},500)})},l=g=>{var v;o("update",g),(v=i.value)==null||v.clearInternal()},{triggerRef:c,popupRef:u,hide:d,isVisible:h}=us({toggleOnClick:!0,zIndex:2}),f=V(null),p=g=>{g.key==="Escape"&&u.value&&d()};return Zt(()=>{var v;const g=f.value instanceof HTMLElement?f.value:(v=f.value)==null?void 0:v.$el;g&&g.addEventListener("keydown",p)}),Qn(()=>{var v;const g=f.value instanceof HTMLElement?f.value:(v=f.value)==null?void 0:v.$el;g&&g.removeEventListener("keydown",p)}),Je(h,g=>{var v,y;g?(v=i.value)==null||v.focus():(y=i.value)==null||y.clearInternal()}),(g,v)=>(W(),ae("div",{ref_key:"mainRef",ref:f},[be("div",{ref_key:"triggerRef",ref:c},[fe(gt,{class:"action-button",variant:n.variant,loading:s.value},{default:ye(()=>[fe(at,{src:"UserPlus",class:"icon"}),v[0]||(v[0]=nt(" Assignee ",-1))]),_:1},8,["variant","loading"])],512),be("div",{ref_key:"popupRef",ref:u,style:{display:"none"}},[U(h)?(W(),Ke(LA,Jt({key:0,ref_key:"assigneeGroupEditorRef",ref:i},n,{ids:e.ids,onUpdated:l,onStartUpdate:r,onUpdateFailed:a,onUpdateCompleted:a}),null,16,["ids"])):Ye("",!0)],512)],512))}}),Zh=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],bY=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),Ha=(e,t)=>{const n=s=>{var o,i;if(s.key==="Tab"){const r=s.shiftKey||s.metaKey;s.preventDefault(),s.stopImmediatePropagation(),s.stopPropagation();const a=document.activeElement,l=(o=a==null?void 0:a.dataset)==null?void 0:o.index;if(l){let c=Zh.indexOf(l);const u=r?-1:1;for(const d of Zh){c=(c+u+Zh.length)%Zh.length;const h=Zh[c],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(s.key==="Enter")(i=s.target)==null||i.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(s.key==="Escape"){s.stopPropagation(),s.stopImmediatePropagation();const r=document.querySelector('[data-index="calendar-wrapper"]');r==null||r.focus()}};if(bY.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},SY=["aria-label"],EY=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],_Y={style:{flex:"1"}},RY=St(it({__name:"MainCalendar",props:tD({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:tD(["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 s=Yt,o=V(null),i=e,r=Z(()=>i.startDate&&i.endDate),a=LH(e,"tracingCase"),l=n,c=V(i.year),u=V(i.month);Je(()=>[i.year,i.month],([k,N])=>{c.value=k,u.value=N});const d=Z(()=>vt.fromObject({year:c.value,month:u.value,day:1},{zone:i.timezone}).setLocale(i.locale||"en-US").toFormat("LLLL yyyy")),h=Z(()=>vt.now().setZone(i.timezone)),f=Z(()=>i.startDate?vt.fromJSDate(i.startDate,{zone:i.timezone}):null),p=Z(()=>i.endDate?vt.fromJSDate(i.endDate,{zone:i.timezone}):null),g=V(f.value),v=V(p.value),y=V(f.value),b=V(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,k=>{const N=k==="start"?S.value:C.value;N&&(c.value=N.year,u.value=N.month)}),Je(()=>{var k,N;return[(k=S.value)==null?void 0:k.toISODate(),(N=C.value)==null?void 0:N.toISODate(),i.activeField]},()=>{const k=i.activeField==="start"?S.value:C.value;k&&(k.year!==c.value||k.month!==u.value)&&(c.value=k.year,u.value=k.month)});function E(k){return k.setZone("utc")}const R=V("");function T(k){R.value=k.toISODate()||"",Ct(()=>{const N=document.querySelector(`.arbo-calendar-day[data-date="${R.value}"]`);N==null||N.focus()})}Je(()=>{var k,N;return[c.value,u.value,i.activeField,(k=S.value)==null?void 0:k.toISODate(),(N=C.value)==null?void 0:N.toISODate()]},()=>{const k=i.activeField==="start"?S.value:C.value;let N;k&&k.year===c.value&&k.month===u.value?N=k:S.value&&S.value.year===c.value&&S.value.month===u.value?N=S.value:N=h.value,T(N)});function A(k){return k.toFormat("d")}const O=Z(()=>{const k=vt.fromObject({year:c.value,month:u.value,day:1},{zone:i.timezone}),N=k.weekday,Q=i.weekStart===1?(N+6)%7:N%7;let ce=k.minus({days:Q});const xe=[],ge=fu.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"}),de=dg();for(let De=0;De<42;De++){const re=[];ce.month!==u.value&&re.push(de["is-outside"]),ce.hasSame(h.value,"day")&&re.push(de["is-today"]),S.value&&ce.hasSame(S.value,"day")&&re.push(de["is-selected-start"]),C.value&&ce.hasSame(C.value,"day")&&re.push(de["is-selected-end"]),S.value&&C.value&&ce>S.value&&ce<C.value&&re.push(de["is-in-range"]);const Ae=A(ce),H=ge[ce.weekday-1]||"";xe.push({dt:ce,iso:ce.toISODate()||"",label:ce.toFormat("d"),displayLabel:Ae,weekdayLabel:H,aria:ce.setLocale(i.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:re}),ce=ce.plus({days:1})}const X=[];for(let De=0;De<6;De++)X.push(xe.slice(De*7,De*7+7));return X}),I=Z(()=>{const k=fu.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"});return i.weekStart===1?k:[k[6],...k.slice(0,6)]});function D(k,N,Q){const ce=k==="start"?N.startOf("day"):N.endOf("day"),xe=E(ce),ge={year:ce.year,month:ce.month,day:ce.day,utc:xe.toISO()||""};k==="start"?(l("select-start",ge,Q??!0),l("select-start-utc",ge.utc)):(l("select-end",ge),l("select-end-utc",ge.utc))}function x(k){let N=c.value,Q=u.value+k;for(;Q<1;)Q+=12,N-=1;for(;Q>12;)Q-=12,N+=1;c.value=N,u.value=Q,l("update:year",N),l("update:month",Q)}function P(k){const Q=(R.value?vt.fromISO(R.value,{zone:i.timezone}):h.value).plus({days:k});Q.month===u.value&&Q.year===c.value&&T(Q)}function M(k=!1){const Q=(R.value?vt.fromISO(R.value,{zone:i.timezone}):h.value).weekday%7,ce=k?6-Q:-Q;P(ce)}const B=k=>{Y(k)};function Y(k){switch(k.preventDefault(),k.stopPropagation(),k.key){case"ArrowLeft":k.preventDefault(),P(-1);break;case"ArrowRight":k.preventDefault(),P(1);break;case"ArrowUp":k.preventDefault(),P(-7);break;case"ArrowDown":k.preventDefault(),P(7);break;case"Home":k.preventDefault(),M(!1);break;case"End":k.preventDefault(),M(!0);break;case"PageUp":k.preventDefault(),x(k.shiftKey?-12:-1);break;case"PageDown":k.preventDefault(),x(k.shiftKey?12:1);break;case"Enter":case" ":{k.preventDefault();const N=R.value?vt.fromISO(R.value,{zone:i.timezone}):h.value,Q=O.value.flat().find(ce=>ce.iso===N.toISODate());Q&&te(Q);break}}}const ne=k=>{const N=vt.now().setZone(i.timezone);c.value=N.year,u.value=N.month,l("update:year",N.year),l("update:month",N.month),T(N),l("gotoToday")};function te(k){var ve,Ne;const N=!!f.value,Q=!!p.value,ce=i.activeField,xe=((ve=f.value)==null?void 0:ve.toISODate())||"null",ge=((Ne=p.value)==null?void 0:Ne.toISODate())||"null",de=k.dt.toISODate()||"",X=(Pe,K)=>{a.value={case:Pe,behavior:K}},De=()=>`Selected start ${de} > existing end ${ge} -> reset both to ${de}`,re=()=>`Selected end ${de} < existing start ${xe} -> reset both to ${de}`,Ae=()=>{D("start",k.dt,!0),D("end",k.dt),l("update:activeField","end")},H=(Pe=!1)=>{D("start",k.dt,Pe),Pe&&l("update:activeField","end")},oe=(Pe=!1)=>{D("end",k.dt),Pe&&l("close")};if(N&&Q){ce==="start"?p.value&&k.dt>p.value?(Ae(),X("INVERT_RANGE_FROM_START",De())):(H(!1),X("UPDATE_START_IN_RANGE",`Updated start from ${xe} to ${de}; end remains ${ge}`)):f.value&&k.dt<f.value?(Ae(),X("INVERT_RANGE_FROM_END",re())):(oe(!1),X("UPDATE_END_IN_RANGE",`Updated end from ${ge} to ${de}; start remains ${xe}`));return}if(!N&&Q&&ce==="start"&&p.value&&k.dt>p.value){Ae(),X("CREATE_RANGE_FROM_LATE_START",De());return}if(N&&!Q&&ce==="end"&&f.value&&k.dt<f.value){Ae(),X("CREATE_RANGE_FROM_EARLY_END",re());return}if(!N&&!Q){if(ce==="start"){H(!0),X("INIT_START",`Picked start ${de}; awaiting end selection`);return}oe(i.immediatelyUpdate),X("INIT_END",`Picked end ${de}; awaiting start selection`);return}if(!N&&Q){if(ce==="start"){H(!0),X("FILL_MISSING_START",`Inserted start ${de}; existing end ${ge}`);return}oe(!1),X("STRICT_UPDATE_END_ONLY",`Updated end to ${de}; start still null`);return}if(N&&!Q){if(ce==="start"){H(!0),X("RESELECT_START_BEFORE_END",`Replaced start with ${de}; end still null, switching to end`);return}oe(i.immediatelyUpdate),X("FILL_MISSING_END",`Picked end ${de}; start ${xe}`);return}}function z(){y.value=g.value,b.value=v.value,l("confirm")}function pe(){g.value=y.value,v.value=b.value,l("cancel")}function q(){Ct(()=>{var k;(k=o.value)==null||k.focus()})}return Zt(()=>{q()}),t({focus:q}),(k,N)=>(W(),ae("div",{ref_key:"calendarRef",ref:o,class:ee([k.$style["arbo-calendar"],{[k.$style["arbo-date-range-picker"]]:r.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[be("div",{class:ee([k.$style["arbo-calendar-header"],k.$style["arbo-calendar-week"]]),role:"row"},[(W(!0),ae(xt,null,xn(I.value,Q=>(W(),ae("div",{key:Q,class:ee(k.$style["arbo-calendar-weekday"]),role:"columnheader"},mt(Q),3))),128))],2),be("div",{class:ee(k.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:N[0]||(N[0]=Pt(Q=>U(Ha)(Q,B),["prevent","stop"]))},[(W(!0),ae(xt,null,xn(O.value,(Q,ce)=>(W(),ae("div",{key:ce,class:ee(k.$style["arbo-calendar-week"])},[(W(!0),ae(xt,null,xn(Q,xe=>(W(),ae("div",{key:xe.iso,class:ee([k.$style["arbo-calendar-day"],xe.classes,{[k.$style["is-focused"]]:xe.iso===R.value}]),disabled:i.disabled,readOnly:i.readOnly,"aria-label":xe.aria,"data-date":xe.iso,"data-weekday":xe.weekdayLabel,tabindex:xe.iso===R.value?0:-1,onClick:ge=>te(xe)},mt(xe.displayLabel),11,EY))),128))],2))),128))],34),i.readOnly?Ye("",!0):(W(),ae("div",{key:0,class:ee(k.$style["arbo-calendar-actions"])},[be("div",_Y,[We((W(),Ke(gt,{variant:"secondary",size:"medium",onClick:N[1]||(N[1]=Q=>ne()),onKeydown:U(Ha),"data-index":"today-btn"},{prefix:ye(()=>[fe(at,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[U(s),"Today"]])]),fe(gt,{disabled:i.disabled,readOnly:i.readOnly,onKeydown:U(Ha),variant:"secondary",size:"medium",onClick:pe,"data-index":"cancel-btn"},{default:ye(()=>[nt(mt(i.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),fe(gt,{disabled:i.disabled||i.disableConfirm,readOnly:i.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:U(Ha),onClick:z},{default:ye(()=>[nt(mt(i.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,SY))}}),[["__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"}}]]),DY=["onClick"],TY=["variant","onClick"],xY=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 s=e,o=Z(()=>{if(s.monthLabels&&s.monthLabels.length===12)return s.monthLabels;const P=s.locale||"en-US",M=s.monthLabelStyle||"short",B=new Intl.DateTimeFormat(P,{month:M,timeZone:"UTC"});return Array.from({length:12},(ne,te)=>B.format(new Date(Date.UTC(2020,te,1))))}),i=n,r=V(s.year),a=V(s.month),l=V(s.year);Je(()=>s.year,P=>{P!==r.value&&(r.value=P,l.value=P)}),Je(()=>s.month,P=>{P!==a.value&&(a.value=P)});const c=V("days");function u(P){c.value!==P&&(c.value=P,i("mode-change",P))}const d=Z(()=>s.minYear),h=Z(()=>s.maxYear),f=Z(()=>{const P=s.yearSpan;return l.value-l.value%P}),p=Z(()=>f.value+s.yearSpan-1);function g(){const P=s.yearSpan,M=f.value-P;M>=d.value&&(l.value=M)}function v(){const P=s.yearSpan,M=f.value+P;M<=h.value&&(l.value=M)}const y=Z(()=>f.value-s.yearSpan<d.value),b=Z(()=>p.value+s.yearSpan>h.value),S=Z(()=>{const P=s.yearSpan;return Math.ceil(P/3)});function C(P){const B=f.value+(P-1)*3;return Array.from({length:3},(Y,ne)=>B+ne).filter(Y=>Y<=p.value)}function E(){c.value==="months"?u("days"):u("months")}function R(){c.value==="years"?u("days"):u("years")}function T(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 O(){if(c.value==="days"){let P=r.value,M=a.value-1;if(M<1&&(M=12,P--),P<d.value)return;r.value=P,a.value=M,i("update:year",P),i("update:month",M)}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 I(){if(c.value==="days"){let P=r.value,M=a.value+1;if(M>12&&(M=1,P++),P>h.value)return;r.value=P,a.value=M,i("update:year",P),i("update:month",M)}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),x=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,M)=>{r.value=P,a.value=M}}),(P,M)=>(W(),ae("div",{class:ee([P.$style["cal-nav-wrapper"]])},[Tt(P.$slots,"selection"),c.value==="days"?(W(),ae("div",{key:0,class:ee(P.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[fe(gt,{variant:"tertiary",class:ee([P.$style["cal-nav-btn"],P.$style.prev]),"aria-label":"Previous",disabled:D.value,label:"",onClick:O,"data-index":"prev-btn",onKeydownCapture:Un(Pt(O,["prevent","stop"]),["enter"]),onKeydown:U(Ha)},{default:ye(({hovered:B})=>[fe(at,{src:"AnglesRight",source:"remote",color:B?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),be("div",{class:ee(P.$style["cal-nav-center"])},[fe(gt,{"data-index":"month-btn",variant:"secondary",onClick:E,onKeydown:U(Ha)},{default:ye(()=>[nt(mt(o.value[a.value-1]),1)]),_:1},8,["onKeydown"]),fe(gt,{variant:"secondary",onClick:R,"data-index":"year-btn",onKeydown:U(Ha)},{default:ye(()=>[nt(mt(r.value),1)]),_:1},8,["onKeydown"])],2),fe(gt,{"data-index":"next-btn",variant:"tertiary",class:ee([P.$style["cal-nav-btn"],P.$style.next]),"aria-label":"Next",disabled:x.value,label:"",onClick:I,onKeydownCapture:Un(Pt(I,["prevent","stop"]),["enter"]),onKeydown:U(Ha)},{default:ye(({hovered:B})=>[fe(at,{src:"AnglesRight",source:"remote",color:B?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Ye("",!0),c.value==="years"?(W(),ae("div",{key:1,class:ee(P.$style["year-grid"])},[be("div",{class:ee(P.$style["year-grid-header"])},[fe(gt,{variant:"tertiary",class:ee([P.$style["cal-nav-btn"],P.$style.prev]),"aria-label":"Next",disabled:y.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:ye(({hovered:B})=>[fe(at,{src:"AnglesRight",source:"remote",color:B?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),be("div",{class:ee(P.$style["range-label"])},mt(f.value)+" - "+mt(p.value),3),fe(gt,{variant:"tertiary",class:ee([P.$style["cal-nav-btn"],P.$style.next]),"aria-label":"Next",disabled:b.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:ye(({hovered:B})=>[fe(at,{src:"AnglesRight",source:"remote",color:B?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),be("div",{class:ee(P.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(W(!0),ae(xt,null,xn(S.value,B=>(W(),ae("div",{key:"yr-row-"+B,class:ee(P.$style["year-grid-row"])},[(W(!0),ae(xt,null,xn(C(B),Y=>(W(),ae("a",{key:Y,tabindex:"0",class:ee([P.$style["year-cell"],{[P.$style.selected]:Y===r.value}]),onClick:ne=>T(Y)},mt(Y),11,DY))),128))],2))),128))],2)],2)):c.value==="months"?(W(),ae("div",{key:2,class:ee(P.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[be("div",{class:ee(P.$style.months)},[(W(!0),ae(xt,null,xn(o.value,(B,Y)=>(W(),ae("a",{tabindex:"0",key:B,variant:Y+1===a.value?"primary":"text",class:ee([P.$style["month-cell"],{[P.$style.selected]:Y+1===a.value}]),onClick:ne=>A(Y+1)},mt(B),11,TY))),128))],2)],2)):(W(),ae("div",{key:3,class:ee(P.$style["days-slot"])},[Tt(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:s,maxDate:o}=e,i=V(""),r=Z(()=>{const g=vt.fromFormat(i.value,t,{zone:n});return g.isValid?g:null}),a=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}),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(!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}),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=vt.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?i.value=v.toFormat(t):i.value=""},getDate:()=>u.value?r.value:null}}const FY={key:0,style:{marginLeft:"8px"}},PY=["disabled","readonly","placeholder"],VA=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 s=Yt,o=e,i=n,r=V(null),a=V(null),{isValid:l,isComplete:c,inputValue:u,clear:d,setDate:h,getDate:f}=IY({format:o.format,allowPastDates:o.allowPastDates,allowFutureDates:o.allowFutureDates,timezone:o.timezone,minDate:o.minDate,maxDate:o.maxDate}),p=Z(()=>o.active),g=Z(()=>({disabled:o.disabled,error:!l.value&&u.value.length>0,readOnly:o.readOnly,isEmpty:u.value.length===0,inputRef:r,wrapperRef:a,active:p})),{argsMain:v,isHover:y,isFocus:b}=ms(g),S=A=>{var I;const O=(I=A.clipboardData)==null?void 0:I.getData("text/plain");O&&(u.value=O.trim())},C=A=>{if(A.key==="Escape"){i("blur"),A.target.blur(),A.preventDefault(),A.stopPropagation(),A.stopImmediatePropagation();return}else A.key==="Tab"&&T(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(()=>o.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&&!o.readOnly&&!o.disabled&&c.value){const A=f();(A||u.value.length===0)&&i("complete",A)}}),Je(()=>l.value,A=>{A||i("invalid","")});const R=Z(()=>!!o.isMultipleDate),T=A=>{A.preventDefault(),A.stopImmediatePropagation(),A.stopPropagation(),i("tab",A)};return(A,O)=>(W(),Ke(vs,Jt(U(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:ye(()=>[be("div",{class:ee([A.$style["date-input-wrapper"]])},[R.value?(W(),ae("span",FY," Multiple ")):We((W(),ae("input",{key:1,disabled:o.disabled,readonly:o.readOnly,ref_key:"inputRef",ref:r,type:"text","onUpdate:modelValue":O[0]||(O[0]=I=>pn(u)?u.value=I:null),onPaste:Pt(S,["prevent"]),placeholder:o.placeholder,class:ee([A.$style["date-input"]]),onKeydown:C},null,42,PY)),[[v1,U(u)]]),Tt(A.$slots,"clear",{handleClear:E},()=>[(U(u).length>0||R.value)&&!o.readOnly&&!o.disabled&&(U(y)||U(b))?We((W(),Ke(gt,{key:0,variant:["icon","primary"],onClick:Pt(E,["stop"]),size:16,rounded:!0},{default:ye(()=>[fe(at,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[U(s),"Clear"]]):(W(),Ke(at,{key:1,src:"Calendar",source:"remote",class:ee(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"}}]]),AY=it({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:pb()},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 s=V({case:"",behavior:""}),o=e,i=V(null),r=n,a=async(X,De)=>{r("start-update"),await X(),r("finish-update"),Ct(()=>{var re,Ae;De(),(Ae=(re=o.params)==null?void 0:re.api)==null||Ae.stopEditing()})},l=(X,De)=>{X(),Ct(()=>{var re,Ae;De(),(Ae=(re=o.params)==null?void 0:re.api)==null||Ae.stopEditing()})},c=()=>{var De;const X=vt.now().setZone(o.timezone);N.value=X.year,Q.value=X.month,(De=k.value)==null||De.setNavigation(X.year,X.month)},u=yo({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:y,beginInteraction:b,clearStart:S,clearDue:C}=m7(o,r),E=Z(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});Je(()=>o.multipleStartDates,X=>{h.value=!!X},{immediate:!0}),Je(()=>o.multipleDueDates,X=>{f.value=!!X},{immediate:!0});const R=V(null),T=V(null),A=X=>{X.preventDefault(),X.stopImmediatePropagation(),X.stopPropagation(),z()},O=()=>{var X;(X=T.value)==null||X.focus()},I=X=>{if(!X){u.start=!1,S();return}const De=d.endDate?vt.fromJSDate(d.endDate,{zone:o.timezone}):null;if(De&&D(X,De)>0){const Ae={year:X.year,month:X.month,day:X.day};u.start=!1,y(Ae,!1),p(Ae),Ct(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const re={year:X.year,month:X.month,day:X.day};u.start=!1,y(re,!0)},D=(X,De)=>{const re=X.startOf("day"),Ae=De.startOf("day");return re<Ae?-1:re>Ae?1:0},x=X=>{var De;X.preventDefault(),X.stopImmediatePropagation(),X.stopPropagation(),(De=document.querySelector('[data-index="prev-btn"]'))==null||De.focus()},P=X=>{if(!X){u.end=!1,C();return}const De=d.startDate?vt.fromJSDate(d.startDate,{zone:o.timezone}):null;if(De&&D(X,De)<0){const Ae={year:X.year,month:X.month,day:X.day};u.end=!1,y(Ae),p(Ae),Ct(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const re={year:X.year,month:X.month,day:X.day};u.end=!1,p(re)},M=()=>{h.value=!1,S()},B=()=>{f.value=!1,C()},Y=()=>{pe()},ne=Z(()=>d.isSelectingStart||d.isSelectingEnd);function te(){o.disabled||o.readOnly||(b(),d.isSelectingStart=!0,d.isSelectingEnd=!1,Ct(()=>{var X;(X=i.value)==null||X.focus()}))}function z(){o.disabled||o.readOnly||(b(),d.isSelectingEnd=!0,d.isSelectingStart=!1,Ct(()=>{var X;(X=R.value)==null||X.focus()}))}function pe(){d.isSelectingStart=!1,d.isSelectingEnd=!1,r("closed")}function q(X){X.key==="Escape"?(X.stopPropagation(),pe()):X.key=="Tab"&&r("tab",X)}const k=V(null),N=V(new Date().getFullYear()),Q=V(new Date().getMonth()+1);Je(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(N.value=d.startDate.getFullYear(),Q.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(N.value=d.endDate.getFullYear(),Q.value=d.endDate.getMonth()+1)},{immediate:!0});const ce=V(null);function xe(){if(Array.isArray(o.value)){const[De,re]=o.value;d.startDate=De||null,d.endDate=re||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const X=d.startDate||d.endDate||new Date;N.value=X.getFullYear(),Q.value=X.getMonth()+1}Je(()=>{var X,De,re,Ae,H,oe,ve,Ne;return[((re=(De=(X=o.value)==null?void 0:X[0])==null?void 0:De.getTime)==null?void 0:re.call(De))||((Ae=o.value)==null?void 0:Ae[0]),((ve=(oe=(H=o.value)==null?void 0:H[1])==null?void 0:oe.getTime)==null?void 0:ve.call(oe))||((Ne=o.value)==null?void 0:Ne[1]),o.timezone,o.format,o.placeholder,o.enableRangeFeedback]},()=>{xe()},{immediate:!0,deep:!0}),t({resetCalendarLogic:xe,openStart:te,openEnd:z,closePicker:pe,clearAll:Y,isOpen:ne,drpRef:ce,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?te():z():te()}});const de=V(null);return Je(()=>ne.value,X=>{if(o.disabled||o.readOnly)return;const De=de.value;De&&(X?De.show():De.hide())},{immediate:!0}),(X,De)=>(W(),ae("div",{class:ee(X.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:T,onKeydown:q,tabindex:"1","data-index":"calendar-wrapper"},[fe(xY,{year:N.value,"onUpdate:year":De[6]||(De[6]=re=>N.value=re),month:Q.value,"onUpdate:month":De[7]||(De[7]=re=>Q.value=re),locale:o.locale,disabled:o.disabled,readOnly:o.readOnly,ref_key:"navigationRef",ref:k},{selection:ye(()=>[be("div",{class:ee(X.$style["calendar-input-section"])},[fe(VA,{ref_key:"starDateRef",ref:i,"model-value":U(d).startDate,placeholder:o.startPlaceholder,timezone:o.timezone,active:U(d).isSelectingStart,onClick:te,onClear:M,onComplete:I,onInvalid:De[0]||(De[0]=re=>u.start=!0),disabled:o.disabled,readOnly:o.readOnly,onBlur:O,onTab:A},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),fe(VA,{ref_key:"endDateRef",ref:R,"model-value":U(d).endDate,placeholder:o.duePlaceholder,timezone:o.timezone,active:U(d).isSelectingEnd,onClick:z,onClear:B,disabled:o.disabled,onComplete:P,onInvalid:De[1]||(De[1]=re=>u.end=!0),readOnly:o.readOnly,isMultipleDate:U(f),onTab:x},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:ye(({year:re,month:Ae})=>[fe(RY,{disabled:o.disabled,disableConfirm:u.end||u.start,readOnly:o.readOnly,ref_key:"drpRef",ref:ce,"tracing-case":s.value,"onUpdate:tracingCase":De[2]||(De[2]=H=>s.value=H),year:re,month:Ae,"start-date":U(d).startDate,"end-date":U(d).endDate,"active-field":E.value,timezone:o.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:U(y),onSelectEnd:U(p),onGotoToday:c,onConfirm:De[3]||(De[3]=()=>{a(U(v),pe)}),onCancel:De[4]||(De[4]=H=>l(U(g),pe)),onClose:De[5]||(De[5]=H=>a(U(v),pe))},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))}}),Dm=St(AY,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_1wull_1","calendar-input-section":"_calendar-input-section_1wull_11","display-wrapper":"_display-wrapper_1wull_19","calendar-actions":"_calendar-actions_1wull_23","clear-all-btn":"_clear-all-btn_1wull_29"}}]]),kY={ref:"mainRef"},OY=it({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{}},emits:["updated","start-update","finish-update"],setup(e,{emit:t}){const n=t,s=e,o=Sn("isSelectAll",V(!1)),i=Sn("bulkUpdate",V(!1)),r=Z(()=>!!s.entityId&&i.value&&o.value),{apiServices:a}=es(!i.value,s),l=Sn("filterParams",null),c=async I=>{var x,P,M;T.value=!0,n("start-update");let D={workspaceId:s.workspaceId,entityId:s.entityId,itemIds:s.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in I&&(D.startDate=I.start?lm(I.start):null),"end"in I&&(D.dueDate=I.end?lm(I.end):null),r.value?(D.itemIds=void 0,D.entityId=s.entityId):D.entityId=void 0,await((P=(x=a.value)==null?void 0:x.changeDate)==null?void 0:P.call(x,D)),n("updated",{workspaceId:s.workspaceId,itemIds:s.ids,data:D}),(M=y.value)==null||M.resetCalendarLogic()},u=()=>{if(!s.rowSelected||s.rowSelected.length===0){d();return}s.rowSelected.length===1?h():f()},d=()=>{v.value=!1,g.value=!1,R.value=[null,null]},h=()=>{const D=s.rowSelected[0].dateRange;R.value=[(D==null?void 0:D[0])??null,(D==null?void 0:D[1])??null],v.value=!1,g.value=!1},f=()=>{var D,x;if(s.rowSelected.some(P=>P.dateRange&&(P.dateRange[0]!==null||P.dateRange[1]!==null))){const P=p(0),M=p(1);if(g.value=P,v.value=M,P)R.value[0]=null;else{const B=((D=s.rowSelected[0].dateRange)==null?void 0:D[0])??null;R.value[0]=B}if(M)R.value[1]=null;else{const B=((x=s.rowSelected[0].dateRange)==null?void 0:x[1])??null;R.value[1]=B}}else g.value=!1,v.value=!1,R.value=[null,null]},p=I=>{const D=s.rowSelected.map(P=>{var M;return(M=P.dateRange)==null?void 0:M[I]});return D.length===0?!1:new Set(D.map(P=>{var M;return(M=P==null?void 0:P.getTime)==null?void 0:M.call(P)})).size>1},g=V(!1),v=V(!1),y=V(null),{triggerRef:b,popupRef:S,hide:C,isVisible:E}=us({toggleOnClick:!0}),R=V([null,null]);Je([()=>s.ids,()=>s.rowSelected,E],I=>{u(),Ct(()=>{var D;(D=y.value)==null||D.focus()})},{immediate:!0,deep:!0});const T=V(!1),A=()=>{T.value=!0},O=()=>{Ct(()=>{setTimeout(()=>{T.value=!1},500)})};return(I,D)=>(W(),ae("div",kY,[be("div",{ref_key:"triggerRef",ref:b},[fe(gt,{variant:s.variant,loading:T.value},{default:ye(()=>[fe(at,{src:"Calendar"}),D[0]||(D[0]=nt(" Date ",-1))]),_:1},8,["variant","loading"])],512),be("div",{ref_key:"popupRef",ref:S,style:{display:"none"}},[U(E)?(W(),Ke(Dm,{key:0,immediatelyUpdate:!1,value:R.value,onConfirmed:c,ref_key:"calendarRef",ref:y,onClosed:U(C),onStartUpdate:A,onFinishUpdate:O,multipleDueDates:v.value,multipleStartDates:g.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):Ye("",!0)],512)],512))}}),MY=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"},BA=Yl("metricStore",()=>{const e=V();return{metricList:e,setMetricList:s=>{e.value=s},checkEditType:s=>{var o;if(((o=s==null?void 0:s.auth_permission)==null?void 0:o.permission)==2)return MY(s)}}}),NY=["onKeydown"],LY=["width","height","viewBox"],VY=["d"],BY="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",$A=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 s=e,o=n,i=V(s.modelValue??0),r=V(null),a=Z(()=>{var D;return((D=s.params)==null?void 0:D.size)??24}),l=Z(()=>{var D;return((D=s.params)==null?void 0:D.iconViewBox)??"0 0 24 24"}),c=Z(()=>{var D;return((D=s.params)==null?void 0:D.iconPath)??BY}),u=Z(()=>{var D;return((D=s.params)==null?void 0:D.wrapperTag)??"span"}),d=Z(()=>{var D;return s.disabled||((D=s.params)==null?void 0:D.disabled)||!1}),h=Z(()=>{var D;return s.readOnly||((D=s.params)==null?void 0:D.readOnly)||!1}),f=Z(()=>!d.value&&!h.value),p=Z(()=>d.value?"not-allowed":h.value?"default":"pointer");Je(()=>s.modelValue,D=>{typeof D=="number"&&D!==i.value&&(i.value=D)});const g=D=>{var x;return((x=s.params)==null?void 0:x.maxRating)-D+1<=i.value&&!v.value},v=V(!1),y=()=>{v.value=!0},b=()=>{v.value=!1},S=D=>{f.value&&C(D)},C=D=>{var P,M;if(!f.value)return;let x=((P=s.params)==null?void 0:P.maxRating)-D+1;x===i.value&&(x=0),i.value=x,o("update:modelValue",x),o("update",x),o("change",x),(M=s.params)!=null&&M.onUpdate&&s.params.onUpdate(x)},E=D=>{var x;D!==i.value&&(i.value=D,o("update:modelValue",D),o("update",D),o("change",D),(x=s.params)!=null&&x.onUpdate&&s.params.onUpdate(D),R.value=D)},R=V(i.value),T=D=>{D.preventDefault(),D.stopPropagation(),D.stopImmediatePropagation(),i.value=R.value,o("cancel")},A=D=>{D.preventDefault(),E(i.value),o("handleEnter",i.value)},O=()=>{f.value&&(i.value=Math.min(i.value+1%(s.params.maxRating+1),s.params.maxRating),E(i.value))},I=()=>{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,x)=>(W(),ae("div",{class:ee(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:ln({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:r,tabindex:"1",onKeydown:[Un(Pt(I,["prevent"]),["left"]),Un(Pt(O,["prevent"]),["right"]),Un(Pt(I,["prevent"]),["down"]),Un(Pt(O,["prevent"]),["up"]),Un(Pt(A,["prevent"]),["enter"]),Un(Pt(A,["prevent"]),["tab"]),Un(Pt(T,["prevent"]),["escape"])]},[(W(!0),ae(xt,null,xn(e.params.maxRating,P=>(W(),Ke(XR(u.value),{key:P,class:ee(["rating-item",{filled:g(P),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:ln({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:Pt(M=>S(P),["prevent","stop"]),onMouseenter:y,onMouseleave:b},{default:ye(()=>[Tt(D.$slots,"icon",{index:P,filled:g(P),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value,value:P},()=>[(W(),ae("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[be("path",{d:c.value},null,8,VY)],8,LY))]),Tt(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,NY))}}),$Y={style:{maxWidth:"180px",lineHeight:"15px"}},HY=["innerHTML"],HA=it({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const s=Yt,o=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(o.config)),u=V(o.modelValue),d=v=>{u.value=v,i("update:modelValue",v),i("change",v||null)},h=V(c.value),f=V(!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=V(null);return Zt(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,y)=>(W(),Ke(Xr,{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:ye(({item:b,getHighlightedLabel:S,selectedIndex:C,index:E})=>[fe(Zl,{hover:C==E,selected:b.value===e.modelValue,label:b.label,onSelect:R=>d(b.value||null),onClick:R=>d(b.value||null)},{label:ye(()=>[be("div",$Y,[We(be("span",{innerHTML:S(b.label)},null,8,HY),[[U(s),{content:b.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":ye(()=>[...y[1]||(y[1]=[nt("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),GY={class:"metric-input-wrapper"},UY={key:0,class:"error-text input-2"},GA=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 s=Yt,o=e,i=V(o.modelValue),r=V(o.modelValue),a=V(!1),l=V(!0),c=V(""),u=Z(()=>{var B;const M=Number.parseInt(String((B=o.config)==null?void 0:B.format_value)||"2",10);return Number.isFinite(M)&&M>=0?M:2}),d=M=>{if(!M)return M;const B=String(M).split(".");return B.length>1&&B[1].length>u.value?u.value===0?B[0]:`${B[0]}.${B[1].slice(0,u.value)}`:String(M)},h=M=>{const B=d(M);B!==M&&S.value?i.value=B:i.value=M},f=M=>{const B=M.target;if(!B)return;const Y=B.value||"",ne=Y.indexOf(".");if(M.key==="."&&u.value===0){M.preventDefault();return}ne!==-1&&/[0-9]/.test(M.key)&&Y.slice(ne+1).length>=u.value&&M.preventDefault()},p=Z(()=>l.value||o.showInlineError?{content:""}:{content:c.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),g=()=>{var q;const M=o.config.restricted_type.trim(),B=((q=o.config.restricted_value)==null?void 0:q.split(",").map(Number))||[],[Y,ne]=B,z={range:`Enter a value between ${Y} and ${ne}`,not:`These values are not allowed: ${B.join(", ")}`,exact:"Value is not allowed"}[M];return l.value?"":z},v=Z(()=>{var B;let M="";return Number((B=o.config)==null?void 0:B.format_value)&&(M+="."+Array.from({length:Number(o.config.format_value)}).map(()=>"0").join("")),`0${M}`});Je(()=>o.modelValue,M=>{i.value=M,r.value=M});const y=M=>im(o.config,M),b=n,S=V(null),C=M=>{const B=M===""?null:M,Y=r.value===""?null:r.value;return B!==Y},E=M=>{const B=d(M);if(!C(B))return!1;const Y=B===""?null:B;return i.value=Y,r.value=Y,b("update:modelValue",Y),b("handleChange",Y),!0},R=()=>{i.value=r.value,b("update:modelValue",r.value)},T=(M,B)=>{E(M),b("enter")},A=(M,B)=>{if(a.value){a.value=!1;return}o.saveOnBlur?E(M):R()},O=M=>{if(M===null||M===""){l.value=!0;return}l.value=im(o.config,Number(M)),c.value=l.value?"":g()},I=(M,B)=>{a.value=!0,o.saveOnEscape?E(M):R(),b("cancel"),setTimeout(()=>{a.value=!1},100)},D=M=>{O(M),b("onValidation",M)},x=()=>{a.value=!0,R(),b("cancel"),setTimeout(()=>{a.value=!1},100)},P=()=>{var M;i.value=null,r.value=null,b("update:modelValue",null),b("handleChange",null),(M=S.value)==null||M.focus()};return t({focus:()=>{var M;return(M=S.value)==null?void 0:M.focus()},blur:()=>{var M;return(M=S.value)==null?void 0:M.blur()},getValue:()=>i.value,getCachedValue:()=>r.value,save:()=>E(i.value),revert:R}),Zt(()=>{var M;(M=S.value)==null||M.focus()}),(M,B)=>We((W(),ae("div",GY,[fe(Yb,{maxDecimalChar:u.value,modelValue:i.value,"onUpdate:modelValue":B[0]||(B[0]=Y=>i.value=Y),placeholder:v.value,validatorFnc:y,style:{"--bg-input":"#FAFAFA"},onInput:h,onKeydown:f,onEnter:T,onBlur:A,onClear:P,onEscape:I,onCancel:x,onOnValidation:D,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:S},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(W(),ae("span",UY,mt(c.value),1)):Ye("",!0)])),[[U(s),p.value]])}}),WY={key:2},zY={class:"wrapper-suffix"},jY={key:3},KY=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 s=Yt,o=e,i=V(null),r=V(0),a=V(null),l=V(null),c=Z(()=>IF(o.config)),u=V(!1),d=Z(()=>!!ce.value),h=n,f=()=>{u.value=!1,Q(),h("cancel")},p=V(!0),g=de=>{if(de===null||de===""){p.value=!0;return}if(c.value!=="number"){p.value=!0;return}p.value=im(o.config,Number(de)),y.value=b()},v=()=>{u.value=!0,ne()},y=V(""),b=()=>{var ve;const de=o.config.restricted_type.trim(),X=((ve=o.config.restricted_value)==null?void 0:ve.split(",").map(Number))||[],[De,re]=X,H={range:`Enter a value between ${De} and ${re}`,not:`These values are not allowed: ${X.join(", ")}`,exact:"Value is not allowed"}[de];return p.value?"":H},S=Z(()=>{var X;const de=Number.parseInt(String((X=o.config)==null?void 0:X.format_value)||"2",10);return Number.isFinite(de)&&de>=0?de:2}),C=de=>{u.value=!0,i.value=de},E=()=>{u.value=!0,Q(),ne()},R=de=>{r.value=de,u.value=!0,ne()},T=()=>(o.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(X=>X.charAt(0).toUpperCase()+X.slice(1)).join("").replace(/Outline|Solid/g,""),A=V(null),O=V(!0),I=Z(()=>{var de;return{disabled:o.disabled,error:!1,readOnly:!1,isEmpty:((de=i.value)==null?void 0:de.length)===0,wrapperRef:k,active:d,focus:o.focus,bordered:!0}}),D=V(null),x=Z(()=>O.value),P=Z(()=>({disabled:o.disabled,error:!1,readOnly:!1,isEmpty:r.value===0,wrapperRef:D,active:x,focus:O.value,bordered:!0})),{argsMain:M}=ms(P),{argsMain:B}=ms(I),Y=V(null),ne=()=>{Ct(()=>{var de;(de=Y.value)==null||de.focus()})},te=de=>{var X;if(de.format_type==="dropdown"&&de.format_value)try{const De=JSON.parse(de.format_value);if(Array.isArray(De))return De.map(re=>({label:re.name,value:re.name,id:re.name}))}catch(De){console.error("Failed to parse dropdown options",De)}return de.format_type=="number"&&de.restricted_type=="exact"?((X=de.restricted_value)==null?void 0:X.split(",").map(re=>({label:de.mapping[`!${re}`]||re,value:re,id:re})))||[]:[]},z=Z(()=>te(o.config)),pe=Z(()=>{var de;return((de=z.value.find(X=>X.value===i.value))==null?void 0:de.label)||i.value||"-"}),q=()=>{var de;if(c.value=="rating")h("updateMetric",r.value==0?null:r.value);else if(c.value=="number"){const X=(de=l.value)==null?void 0:de.getValue();h("updateMetric",X||null)}else h("updateMetric",i.value||null);u.value=!1,Q()},{triggerRef:k,popupRef:N,hide:Q,isVisible:ce,show:xe}=us({toggleOnClick:!0,appendTo:()=>o.attachTo||"parent",zIndex:1e4,offset:[0,0]}),ge=()=>{switch(c.value){case"number":Ct(()=>{var de;(de=l.value)==null||de.focus()});break;case"dropdown":xe(),Ct(()=>{var de;(de=A.value)==null||de.focus()});break;case"rating":O.value=!0,Ct(()=>{var de;(de=a.value)==null||de.focus()});break}};return t({resetState:()=>{i.value=null,r.value=0,u.value=!1},focus:ge,hasChanges:()=>u.value}),Zt(()=>{Ct(()=>{setTimeout(()=>{ge()},300)})}),(de,X)=>(W(),ae("div",{class:ee(de.$style["metric-editor"])},[c.value=="number"?(W(),Ke(GA,{key:0,config:o.config,modelValue:i.value,"onUpdate:modelValue":X[0]||(X[0]=De=>i.value=De),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:C,maxDecimalChar:S.value,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue","maxDecimalChar"])):c.value=="rating"?(W(),Ke(vs,Jt({key:1,"tab-index":1},U(M),{ref_key:"triggerRef2",ref:D,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:ye(()=>[fe($A,{params:{maxRating:o.config.range},modelValue:r.value,"onUpdate:modelValue":X[1]||(X[1]=De=>r.value=De),onHandleEnter:R,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:ye(()=>[fe(at,{source:"rating",src:T()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):c.value=="dropdown"?(W(),ae("div",WY,[fe(vs,Jt(U(B),{ref_key:"triggerRef",ref:k,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:ye(({})=>[be("div",zY,[fe(at,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:ye(()=>[We((W(),ae("span",null,[nt(mt(pe.value||""),1)])),[[U(s),{content:pe.value}]])]),_:1},16),be("div",{ref_key:"popupRef",ref:N},[U(ce)?(W(),Ke(HA,{key:0,ref_key:"metricEditorDropdownRef",ref:A,config:o.config,modelValue:i.value,"onUpdate:modelValue":X[2]||(X[2]=De=>i.value=De),onChange:E,onCancel:f},null,8,["config","modelValue"])):Ye("",!0)],512)])):(W(),ae("span",jY,"Formular")),We((W(),Ke(gt,{ref_key:"confirmButtonRef",ref:Y,onHandleClick:q,"tab-index":"1",onKeypress:[Un(Pt(ge,["shift","prevent"]),["tab"]),Un(Pt(f,["prevent"]),["escape"])],disabled:!p.value},{default:ye(()=>[fe(at,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[U(s),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),qY=St(it({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const s=Yt,o=e,i=n,r=V(!1),a=V(null),l=V(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 Ct(),(g=l.value)==null||g.focus()},h=g=>{i("handleUpdate",{id:o.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)=>(W(),ae("div",{class:ee([g.$style["metric-item"],r.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[be("div",{class:ee(g.$style["metric-label"]),onClick:Pt(c,["stop"])},[Tt(g.$slots,"default",{open:r.value},()=>[We((W(),ae("span",{class:ee(g.$style["metric-name"])},[nt(mt(e.label),1)],2)),[[U(s),{content:e.label}]]),e.morpheme&&r.value?(W(),ae("small",{key:0,class:ee(g.$style["metric-morpheme"])}," ("+mt(e.morpheme)+") ",3)):Ye("",!0)])],2),fe(jD,{mode:"out-in",name:"slide"},{default:ye(()=>[r.value?(W(),Ke(KY,{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"])):Ye("",!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 UA(e,t){return function(){return e.apply(t,arguments)}}const{toString:YY}=Object.prototype,{getPrototypeOf:Jb}=Object,{iterator:Tm,toStringTag:WA}=Symbol,xm=(e=>t=>{const n=YY.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Pi=e=>(e=e.toLowerCase(),t=>xm(t)===e),Im=e=>t=>typeof t===e,{isArray:xu}=Array,Iu=Im("undefined");function Xh(e){return e!==null&&!Iu(e)&&e.constructor!==null&&!Iu(e.constructor)&&ao(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const zA=Pi("ArrayBuffer");function ZY(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&zA(e.buffer),t}const XY=Im("string"),ao=Im("function"),jA=Im("number"),Jh=e=>e!==null&&typeof e=="object",JY=e=>e===!0||e===!1,Fm=e=>{if(xm(e)!=="object")return!1;const t=Jb(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(WA in e)&&!(Tm in e)},QY=e=>{if(!Jh(e)||Xh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},eZ=Pi("Date"),tZ=Pi("File"),nZ=Pi("Blob"),sZ=Pi("FileList"),oZ=e=>Jh(e)&&ao(e.pipe),iZ=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ao(e.append)&&((t=xm(e))==="formdata"||t==="object"&&ao(e.toString)&&e.toString()==="[object FormData]"))},rZ=Pi("URLSearchParams"),[aZ,lZ,cZ,uZ]=["ReadableStream","Request","Response","Headers"].map(Pi),dZ=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Qh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,o;if(typeof e!="object"&&(e=[e]),xu(e))for(s=0,o=e.length;s<o;s++)t.call(null,e[s],s,e);else{if(Xh(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),r=i.length;let a;for(s=0;s<r;s++)a=i[s],t.call(null,e[a],a,e)}}function KA(e,t){if(Xh(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s=n.length,o;for(;s-- >0;)if(o=n[s],t===o.toLowerCase())return o;return null}const Xl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,qA=e=>!Iu(e)&&e!==Xl;function Qb(){const{caseless:e,skipUndefined:t}=qA(this)&&this||{},n={},s=(o,i)=>{const r=e&&KA(n,i)||i;Fm(n[r])&&Fm(o)?n[r]=Qb(n[r],o):Fm(o)?n[r]=Qb({},o):xu(o)?n[r]=o.slice():(!t||!Iu(o))&&(n[r]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&Qh(arguments[o],s);return n}const hZ=(e,t,n,{allOwnKeys:s}={})=>(Qh(t,(o,i)=>{n&&ao(o)?e[i]=UA(o,n):e[i]=o},{allOwnKeys:s}),e),fZ=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),pZ=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},gZ=(e,t,n,s)=>{let o,i,r;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)r=o[i],(!s||s(r,e,t))&&!a[r]&&(t[r]=e[r],a[r]=!0);e=n!==!1&&Jb(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},mZ=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},vZ=e=>{if(!e)return null;if(xu(e))return e;let t=e.length;if(!jA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},yZ=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Jb(Uint8Array)),wZ=(e,t)=>{const s=(e&&e[Tm]).call(e);let o;for(;(o=s.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},CZ=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},bZ=Pi("HTMLFormElement"),SZ=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,o){return s.toUpperCase()+o}),YA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),EZ=Pi("RegExp"),ZA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};Qh(n,(o,i)=>{let r;(r=t(o,i,e))!==!1&&(s[i]=r||o)}),Object.defineProperties(e,s)},_Z=e=>{ZA(e,(t,n)=>{if(ao(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(ao(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},RZ=(e,t)=>{const n={},s=o=>{o.forEach(i=>{n[i]=!0})};return xu(e)?s(e):s(String(e).split(t)),n},DZ=()=>{},TZ=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function xZ(e){return!!(e&&ao(e.append)&&e[WA]==="FormData"&&e[Tm])}const IZ=e=>{const t=new Array(10),n=(s,o)=>{if(Jh(s)){if(t.indexOf(s)>=0)return;if(Xh(s))return s;if(!("toJSON"in s)){t[o]=s;const i=xu(s)?[]:{};return Qh(s,(r,a)=>{const l=n(r,o+1);!Iu(l)&&(i[a]=l)}),t[o]=void 0,i}}return s};return n(e,0)},FZ=Pi("AsyncFunction"),PZ=e=>e&&(Jh(e)||ao(e))&&ao(e.then)&&ao(e.catch),XA=((e,t)=>e?setImmediate:t?((n,s)=>(Xl.addEventListener("message",({source:o,data:i})=>{o===Xl&&i===n&&s.length&&s.shift()()},!1),o=>{s.push(o),Xl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ao(Xl.postMessage)),AZ=typeof queueMicrotask<"u"?queueMicrotask.bind(Xl):typeof j<"u"&&j.nextTick||XA,Be={isArray:xu,isArrayBuffer:zA,isBuffer:Xh,isFormData:iZ,isArrayBufferView:ZY,isString:XY,isNumber:jA,isBoolean:JY,isObject:Jh,isPlainObject:Fm,isEmptyObject:QY,isReadableStream:aZ,isRequest:lZ,isResponse:cZ,isHeaders:uZ,isUndefined:Iu,isDate:eZ,isFile:tZ,isBlob:nZ,isRegExp:EZ,isFunction:ao,isStream:oZ,isURLSearchParams:rZ,isTypedArray:yZ,isFileList:sZ,forEach:Qh,merge:Qb,extend:hZ,trim:dZ,stripBOM:fZ,inherits:pZ,toFlatObject:gZ,kindOf:xm,kindOfTest:Pi,endsWith:mZ,toArray:vZ,forEachEntry:wZ,matchAll:CZ,isHTMLForm:bZ,hasOwnProperty:YA,hasOwnProp:YA,reduceDescriptors:ZA,freezeMethods:_Z,toObjectSet:RZ,toCamelCase:SZ,noop:DZ,toFiniteNumber:TZ,findKey:KA,global:Xl,isContextDefined:qA,isSpecCompliantForm:xZ,toJSONObject:IZ,isAsyncFn:FZ,isThenable:PZ,setImmediate:XA,asap:AZ,isIterable:e=>e!=null&&ao(e[Tm])};function zt(e,t,n,s,o){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),s&&(this.request=s),o&&(this.response=o,this.status=o.status?o.status:null)}Be.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:Be.toJSONObject(this.config),code:this.code,status:this.status}}});const JA=zt.prototype,QA={};["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=>{QA[e]={value:e}}),Object.defineProperties(zt,QA),Object.defineProperty(JA,"isAxiosError",{value:!0}),zt.from=(e,t,n,s,o,i)=>{const r=Object.create(JA);Be.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,s,o),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 kZ=null;function eS(e){return Be.isPlainObject(e)||Be.isArray(e)}function ek(e){return Be.endsWith(e,"[]")?e.slice(0,-2):e}function tk(e,t,n){return e?e.concat(t).map(function(o,i){return o=ek(o),!n&&i?"["+o+"]":o}).join(n?".":""):t}function OZ(e){return Be.isArray(e)&&!e.some(eS)}const MZ=Be.toFlatObject(Be,{},null,function(t){return/^is[A-Z]/.test(t)});function Pm(e,t,n){if(!Be.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Be.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,v){return!Be.isUndefined(v[g])});const s=n.metaTokens,o=n.visitor||u,i=n.dots,r=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Be.isSpecCompliantForm(t);if(!Be.isFunction(o))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(Be.isDate(p))return p.toISOString();if(Be.isBoolean(p))return p.toString();if(!l&&Be.isBlob(p))throw new zt("Blob is not supported. Use a Buffer instead.");return Be.isArrayBuffer(p)||Be.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(Be.endsWith(g,"{}"))g=s?g:g.slice(0,-2),p=JSON.stringify(p);else if(Be.isArray(p)&&OZ(p)||(Be.isFileList(p)||Be.endsWith(g,"[]"))&&(y=Be.toArray(p)))return g=ek(g),y.forEach(function(S,C){!(Be.isUndefined(S)||S===null)&&t.append(r===!0?tk([g],C,i):r===null?g:g+"[]",c(S))}),!1}return eS(p)?!0:(t.append(tk(v,g,i),c(p)),!1)}const d=[],h=Object.assign(MZ,{defaultVisitor:u,convertValue:c,isVisitable:eS});function f(p,g){if(!Be.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),Be.forEach(p,function(y,b){(!(Be.isUndefined(y)||y===null)&&o.call(t,y,Be.isString(b)?b.trim():b,g,h))===!0&&f(y,g?g.concat(b):[b])}),d.pop()}}if(!Be.isObject(e))throw new TypeError("data must be an object");return f(e),t}function nk(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function tS(e,t){this._pairs=[],e&&Pm(e,this,t)}const sk=tS.prototype;sk.append=function(t,n){this._pairs.push([t,n])},sk.toString=function(t){const n=t?function(s){return t.call(this,s,nk)}:nk;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function NZ(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ok(e,t,n){if(!t)return e;const s=n&&n.encode||NZ;Be.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(o?i=o(t,n):i=Be.isURLSearchParams(t)?t.toString():new tS(t,n).toString(s),i){const r=e.indexOf("#");r!==-1&&(e=e.slice(0,r)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class ik{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Be.forEach(this.handlers,function(s){s!==null&&t(s)})}}const rk={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},LZ={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:tS,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},nS=typeof window<"u"&&typeof document<"u",sS=typeof navigator=="object"&&navigator||void 0,VZ=nS&&(!sS||["ReactNative","NativeScript","NS"].indexOf(sS.product)<0),BZ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",$Z=nS&&window.location.href||"http://localhost",Bs={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:nS,hasStandardBrowserEnv:VZ,hasStandardBrowserWebWorkerEnv:BZ,navigator:sS,origin:$Z},Symbol.toStringTag,{value:"Module"})),...LZ};function HZ(e,t){return Pm(e,new Bs.classes.URLSearchParams,{visitor:function(n,s,o,i){return Bs.isNode&&Be.isBuffer(n)?(this.append(s,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function GZ(e){return Be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function UZ(e){const t={},n=Object.keys(e);let s;const o=n.length;let i;for(s=0;s<o;s++)i=n[s],t[i]=e[i];return t}function ak(e){function t(n,s,o,i){let r=n[i++];if(r==="__proto__")return!0;const a=Number.isFinite(+r),l=i>=n.length;return r=!r&&Be.isArray(o)?o.length:r,l?(Be.hasOwnProp(o,r)?o[r]=[o[r],s]:o[r]=s,!a):((!o[r]||!Be.isObject(o[r]))&&(o[r]=[]),t(n,s,o[r],i)&&Be.isArray(o[r])&&(o[r]=UZ(o[r])),!a)}if(Be.isFormData(e)&&Be.isFunction(e.entries)){const n={};return Be.forEachEntry(e,(s,o)=>{t(GZ(s),o,n,0)}),n}return null}function WZ(e,t,n){if(Be.isString(e))try{return(t||JSON.parse)(e),Be.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const ef={transitional:rk,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",o=s.indexOf("application/json")>-1,i=Be.isObject(t);if(i&&Be.isHTMLForm(t)&&(t=new FormData(t)),Be.isFormData(t))return o?JSON.stringify(ak(t)):t;if(Be.isArrayBuffer(t)||Be.isBuffer(t)||Be.isStream(t)||Be.isFile(t)||Be.isBlob(t)||Be.isReadableStream(t))return t;if(Be.isArrayBufferView(t))return t.buffer;if(Be.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return HZ(t,this.formSerializer).toString();if((a=Be.isFileList(t))||s.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Pm(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),WZ(t)):t}],transformResponse:[function(t){const n=this.transitional||ef.transitional,s=n&&n.forcedJSONParsing,o=this.responseType==="json";if(Be.isResponse(t)||Be.isReadableStream(t))return t;if(t&&Be.isString(t)&&(s&&!this.responseType||o)){const r=!(n&&n.silentJSONParsing)&&o;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:Bs.classes.FormData,Blob:Bs.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Be.forEach(["delete","get","head","post","put","patch"],e=>{ef.headers[e]={}});const zZ=Be.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"]),jZ=e=>{const t={};let n,s,o;return e&&e.split(`
|
|
142
142
|
`).forEach(function(r){o=r.indexOf(":"),n=r.substring(0,o).trim().toLowerCase(),s=r.substring(o+1).trim(),!(!n||t[n]&&zZ[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},lk=Symbol("internals");function tf(e){return e&&String(e).trim().toLowerCase()}function Am(e){return e===!1||e==null?e:Be.isArray(e)?e.map(Am):String(e)}function KZ(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const qZ=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function oS(e,t,n,s,o){if(Be.isFunction(s))return s.call(this,t,n);if(o&&(t=n),!!Be.isString(t)){if(Be.isString(s))return t.indexOf(s)!==-1;if(Be.isRegExp(s))return s.test(t)}}function YZ(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function ZZ(e,t){const n=Be.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(o,i,r){return this[s].call(this,t,o,i,r)},configurable:!0})})}let lo=class{constructor(t){t&&this.set(t)}set(t,n,s){const o=this;function i(a,l,c){const u=tf(l);if(!u)throw new Error("header name must be a non-empty string");const d=Be.findKey(o,u);(!d||o[d]===void 0||c===!0||c===void 0&&o[d]!==!1)&&(o[d||l]=Am(a))}const r=(a,l)=>Be.forEach(a,(c,u)=>i(c,u,l));if(Be.isPlainObject(t)||t instanceof this.constructor)r(t,n);else if(Be.isString(t)&&(t=t.trim())&&!qZ(t))r(jZ(t),n);else if(Be.isObject(t)&&Be.isIterable(t)){let a={},l,c;for(const u of t){if(!Be.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?Be.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}r(a,n)}else t!=null&&i(n,t,s);return this}get(t,n){if(t=tf(t),t){const s=Be.findKey(this,t);if(s){const o=this[s];if(!n)return o;if(n===!0)return KZ(o);if(Be.isFunction(n))return n.call(this,o,s);if(Be.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=tf(t),t){const s=Be.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||oS(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let o=!1;function i(r){if(r=tf(r),r){const a=Be.findKey(s,r);a&&(!n||oS(s,s[a],a,n))&&(delete s[a],o=!0)}}return Be.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let s=n.length,o=!1;for(;s--;){const i=n[s];(!t||oS(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,s={};return Be.forEach(this,(o,i)=>{const r=Be.findKey(s,i);if(r){n[r]=Am(o),delete n[i];return}const a=t?YZ(i):String(i).trim();a!==i&&delete n[i],n[a]=Am(o),s[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Be.forEach(this,(s,o)=>{s!=null&&s!==!1&&(n[o]=t&&Be.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
143
143
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(o=>s.set(o)),s}static accessor(t){const s=(this[lk]=this[lk]={accessors:{}}).accessors,o=this.prototype;function i(r){const a=tf(r);s[a]||(ZZ(o,r),s[a]=!0)}return Be.isArray(t)?t.forEach(i):i(t),this}};lo.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Be.reduceDescriptors(lo.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}}),Be.freezeMethods(lo);function iS(e,t){const n=this||ef,s=t||n,o=lo.from(s.headers);let i=s.data;return Be.forEach(e,function(a){i=a.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function ck(e){return!!(e&&e.__CANCEL__)}function Fu(e,t,n){zt.call(this,e??"canceled",zt.ERR_CANCELED,t,n),this.name="CanceledError"}Be.inherits(Fu,zt,{__CANCEL__:!0});function uk(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(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 XZ(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function JZ(e,t){e=e||10;const n=new Array(e),s=new Array(e);let o=0,i=0,r;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=s[i];r||(r=c),n[o]=l,s[o]=c;let d=i,h=0;for(;d!==o;)h+=n[d++],d=d%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-r<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function QZ(e,t){let n=0,s=1e3/t,o,i;const r=(c,u=Date.now())=>{n=u,o=null,i&&(clearTimeout(i),i=null),e(...c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=s?r(c,u):(o=c,i||(i=setTimeout(()=>{i=null,r(o)},s-d)))},()=>o&&r(o)]}const km=(e,t,n=3)=>{let s=0;const o=JZ(50,250);return QZ(i=>{const r=i.loaded,a=i.lengthComputable?i.total:void 0,l=r-s,c=o(l),u=r<=a;s=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)},dk=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},hk=e=>(...t)=>Be.asap(()=>e(...t)),eX=Bs.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Bs.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Bs.origin),Bs.navigator&&/(msie|trident)/i.test(Bs.navigator.userAgent)):()=>!0,tX=Bs.hasStandardBrowserEnv?{write(e,t,n,s,o,i,r){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];Be.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Be.isString(s)&&a.push(`path=${s}`),Be.isString(o)&&a.push(`domain=${o}`),i===!0&&a.push("secure"),Be.isString(r)&&a.push(`SameSite=${r}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function nX(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function sX(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function fk(e,t,n){let s=!nX(t);return e&&(s||n==!1)?sX(e,t):t}const pk=e=>e instanceof lo?{...e}:e;function Jl(e,t){t=t||{};const n={};function s(c,u,d,h){return Be.isPlainObject(c)&&Be.isPlainObject(u)?Be.merge.call({caseless:h},c,u):Be.isPlainObject(u)?Be.merge({},u):Be.isArray(u)?u.slice():u}function o(c,u,d,h){if(Be.isUndefined(u)){if(!Be.isUndefined(c))return s(void 0,c,d,h)}else return s(c,u,d,h)}function i(c,u){if(!Be.isUndefined(u))return s(void 0,u)}function r(c,u){if(Be.isUndefined(u)){if(!Be.isUndefined(c))return s(void 0,c)}else return s(void 0,u)}function a(c,u,d){if(d in t)return s(c,u);if(d in e)return s(void 0,c)}const l={url: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)=>o(pk(c),pk(u),d,!0)};return Be.forEach(Object.keys({...e,...t}),function(u){const d=l[u]||o,h=d(e[u],t[u],u);Be.isUndefined(h)&&d!==a||(n[u]=h)}),n}const gk=e=>{const t=Jl({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:o,xsrfCookieName:i,headers:r,auth:a}=t;if(t.headers=r=lo.from(r),t.url=ok(fk(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&r.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Be.isFormData(n)){if(Bs.hasStandardBrowserEnv||Bs.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(Be.isFunction(n.getHeaders)){const l=n.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([u,d])=>{c.includes(u.toLowerCase())&&r.set(u,d)})}}if(Bs.hasStandardBrowserEnv&&(s&&Be.isFunction(s)&&(s=s(t)),s||s!==!1&&eX(t.url))){const l=o&&i&&tX.read(i);l&&r.set(o,l)}return t},oX=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,s){const o=gk(e);let i=o.data;const r=lo.from(o.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=o,u,d,h,f,p;function g(){f&&f(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(o.method.toUpperCase(),o.url,!0),v.timeout=o.timeout;function y(){if(!v)return;const S=lo.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};uk(function(T){n(T),g()},function(T){s(T),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&&(s(new zt("Request aborted",zt.ECONNABORTED,e,v)),v=null)},v.onerror=function(C){const E=C&&C.message?C.message:"Network Error",R=new zt(E,zt.ERR_NETWORK,e,v);R.event=C||null,s(R),v=null},v.ontimeout=function(){let C=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const E=o.transitional||rk;o.timeoutErrorMessage&&(C=o.timeoutErrorMessage),s(new zt(C,E.clarifyTimeoutError?zt.ETIMEDOUT:zt.ECONNABORTED,e,v)),v=null},i===void 0&&r.setContentType(null),"setRequestHeader"in v&&Be.forEach(r.toJSON(),function(C,E){v.setRequestHeader(E,C)}),Be.isUndefined(o.withCredentials)||(v.withCredentials=!!o.withCredentials),a&&a!=="json"&&(v.responseType=o.responseType),c&&([h,p]=km(c,!0),v.addEventListener("progress",h)),l&&v.upload&&([d,f]=km(l),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",f)),(o.cancelToken||o.signal)&&(u=S=>{v&&(s(!S||S.type?new Fu(null,e,v):S),v.abort(),v=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const b=XZ(o.url);if(b&&Bs.protocols.indexOf(b)===-1){s(new zt("Unsupported protocol "+b+":",zt.ERR_BAD_REQUEST,e));return}v.send(i||null)})},iX=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,o;const i=function(c){if(!o){o=!0,a();const u=c instanceof Error?c:this.reason;s.abort(u instanceof zt?u:new Fu(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}=s;return l.unsubscribe=()=>Be.asap(a),l}},rX=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let s=0,o;for(;s<n;)o=s+t,yield e.slice(s,o),s=o},aX=async function*(e,t){for await(const n of lX(e))yield*rX(n,t)},lX=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:s}=await t.read();if(n)break;yield s}}finally{await t.cancel()}},mk=(e,t,n,s)=>{const o=aX(e,t);let i=0,r,a=l=>{r||(r=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await o.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let h=i+=d;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),o.return()}},{highWaterMark:2})},vk=64*1024,{isFunction:Om}=Be,cX=(({Request:e,Response:t})=>({Request:e,Response:t}))(Be.global),{ReadableStream:yk,TextEncoder:wk}=Be.global,Ck=(e,...t)=>{try{return!!e(...t)}catch{return!1}},uX=e=>{e=Be.merge.call({skipUndefined:!0},cX,e);const{fetch:t,Request:n,Response:s}=e,o=t?Om(t):typeof fetch=="function",i=Om(n),r=Om(s);if(!o)return!1;const a=o&&Om(yk),l=o&&(typeof wk=="function"?(p=>g=>p.encode(g))(new wk):async p=>new Uint8Array(await new n(p).arrayBuffer())),c=i&&a&&Ck(()=>{let p=!1;const g=new n(Bs.origin,{body:new yk,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),u=r&&a&&Ck(()=>Be.isReadableStream(new s("").body)),d={stream:u&&(p=>p.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(g,v)=>{let 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(Be.isBlob(p))return p.size;if(Be.isSpecCompliantForm(p))return(await new n(Bs.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(Be.isArrayBufferView(p)||Be.isArrayBuffer(p))return p.byteLength;if(Be.isURLSearchParams(p)&&(p=p+""),Be.isString(p))return(await l(p)).byteLength},f=async(p,g)=>{const v=Be.toFiniteNumber(p.getContentLength());return v??h(g)};return async p=>{let{url:g,method:v,data:y,signal:b,cancelToken:S,timeout:C,onDownloadProgress:E,onUploadProgress:R,responseType:T,headers:A,withCredentials:O="same-origin",fetchOptions:I}=gk(p),D=t||fetch;T=T?(T+"").toLowerCase():"text";let x=iX([b,S&&S.toAbortSignal()],C),P=null;const M=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let B;try{if(R&&c&&v!=="get"&&v!=="head"&&(B=await f(A,y))!==0){let q=new n(g,{method:"POST",body:y,duplex:"half"}),k;if(Be.isFormData(y)&&(k=q.headers.get("content-type"))&&A.setContentType(k),q.body){const[N,Q]=dk(B,km(hk(R)));y=mk(q.body,vk,N,Q)}}Be.isString(O)||(O=O?"include":"omit");const Y=i&&"credentials"in n.prototype,ne={...I,signal:x,method:v.toUpperCase(),headers:A.normalize().toJSON(),body:y,duplex:"half",credentials:Y?O:void 0};P=i&&new n(g,ne);let te=await(i?D(P,I):D(g,ne));const z=u&&(T==="stream"||T==="response");if(u&&(E||z&&M)){const q={};["status","statusText","headers"].forEach(ce=>{q[ce]=te[ce]});const k=Be.toFiniteNumber(te.headers.get("content-length")),[N,Q]=E&&dk(k,km(hk(E),!0))||[];te=new s(mk(te.body,vk,N,()=>{Q&&Q(),M&&M()}),q)}T=T||"text";let pe=await d[Be.findKey(d,T)||"text"](te,p);return!z&&M&&M(),await new Promise((q,k)=>{uk(q,k,{data:pe,headers:lo.from(te.headers),status:te.status,statusText:te.statusText,config:p,request:P})})}catch(Y){throw M&&M(),Y&&Y.name==="TypeError"&&/Load failed|fetch/i.test(Y.message)?Object.assign(new zt("Network Error",zt.ERR_NETWORK,p,P),{cause:Y.cause||Y}):zt.from(Y,Y&&Y.code,p,P)}}},dX=new Map,bk=e=>{let t=e&&e.env||{};const{fetch:n,Request:s,Response:o}=t,i=[s,o,n];let r=i.length,a=r,l,c,u=dX;for(;a--;)l=i[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:uX(t)),u=c;return c};bk();const rS={http:kZ,xhr:oX,fetch:{get:bk}};Be.forEach(rS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Sk=e=>`- ${e}`,hX=e=>Be.isFunction(e)||e===null||e===!1;function fX(e,t){e=Be.isArray(e)?e:[e];const{length:n}=e;let s,o;const i={};for(let r=0;r<n;r++){s=e[r];let a;if(o=s,!hX(s)&&(o=rS[(a=String(s)).toLowerCase()],o===void 0))throw new zt(`Unknown adapter '${a}'`);if(o&&(Be.isFunction(o)||(o=o.get(t))))break;i[a||"#"+r]=o}if(!o){const r=Object.entries(i).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=n?r.length>1?`since :
|
|
144
144
|
`+r.map(Sk).join(`
|
|
145
145
|
`):" "+Sk(r[0]):"as no adapter specified";throw new zt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const Ek={getAdapter:fX,adapters:rS};function aS(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Fu(null,e)}function _k(e){return aS(e),e.headers=lo.from(e.headers),e.data=iS.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ek.getAdapter(e.adapter||ef.adapter,e)(e).then(function(s){return aS(e),s.data=iS.call(e,e.transformResponse,s),s.headers=lo.from(s.headers),s},function(s){return ck(s)||(aS(e),s&&s.response&&(s.response.data=iS.call(e,e.transformResponse,s.response),s.response.headers=lo.from(s.response.headers))),Promise.reject(s)})}const Rk="1.13.2",Mm={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Mm[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Dk={};Mm.transitional=function(t,n,s){function o(i,r){return"[Axios v"+Rk+"] Transitional option '"+i+"'"+r+(s?". "+s:"")}return(i,r,a)=>{if(t===!1)throw new zt(o(r," has been removed"+(n?" in "+n:"")),zt.ERR_DEPRECATED);return n&&!Dk[r]&&(Dk[r]=!0,console.warn(o(r," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,r,a):!0}},Mm.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function pX(e,t,n){if(typeof e!="object")throw new zt("options must be an object",zt.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let o=s.length;for(;o-- >0;){const i=s[o],r=t[i];if(r){const a=e[i],l=a===void 0||r(a,i,e);if(l!==!0)throw new zt("option "+i+" must be "+l,zt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new zt("Unknown option "+i,zt.ERR_BAD_OPTION)}}const Nm={assertOptions:pX,validators:Mm},rr=Nm.validators;let Ql=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ik,response:new ik}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
146
|
-
`+i):s.stack=i}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Jl(this.defaults,n);const{transitional:s,paramsSerializer:o,headers:i}=n;s!==void 0&&Nm.assertOptions(s,{silentJSONParsing:rr.transitional(rr.boolean),forcedJSONParsing:rr.transitional(rr.boolean),clarifyTimeoutError:rr.transitional(rr.boolean)},!1),o!=null&&(Be.isFunction(o)?n.paramsSerializer={serialize:o}:Nm.assertOptions(o,{encode:rr.function,serialize:rr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Nm.assertOptions(n,{baseUrl:rr.spelling("baseURL"),withXsrfToken:rr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=i&&Be.merge(i.common,i[n.method]);i&&Be.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=lo.concat(r,i);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,d=0,h;if(!l){const p=[_k.bind(this),void 0];for(p.unshift(...a),p.push(...c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(;d<h;){const p=a[d++],g=a[d++];try{f=p(f)}catch(v){g.call(this,v);break}}try{u=_k.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=Jl(this.defaults,t);const n=fk(t.baseURL,t.url,t.allowAbsoluteUrls);return ok(n,t.params,t.paramsSerializer)}};Be.forEach(["delete","get","head","options"],function(t){Ql.prototype[t]=function(n,s){return this.request(Jl(s||{},{method:t,url:n,data:(s||{}).data}))}}),Be.forEach(["post","put","patch"],function(t){function n(s){return function(i,r,a){return this.request(Jl(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}Ql.prototype[t]=n(),Ql.prototype[t+"Form"]=n(!0)});let gX=class jB{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(o=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](o);s._listeners=null}),this.promise.then=o=>{let i;const r=new Promise(a=>{s.subscribe(a),i=a}).then(o);return r.cancel=function(){s.unsubscribe(i)},r},t(function(i,r,a){s.reason||(s.reason=new Fu(i,r,a),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new jB(function(o){t=o}),cancel:t}}};function mX(e){return function(n){return e.apply(null,n)}}function vX(e){return Be.isObject(e)&&e.isAxiosError===!0}const lS={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(lS).forEach(([e,t])=>{lS[t]=e});function Tk(e){const t=new Ql(e),n=UA(Ql.prototype.request,t);return Be.extend(n,Ql.prototype,t,{allOwnKeys:!0}),Be.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Tk(Jl(e,o))},n}const ts=Tk(ef);ts.Axios=Ql,ts.CanceledError=Fu,ts.CancelToken=gX,ts.isCancel=ck,ts.VERSION=Rk,ts.toFormData=Pm,ts.AxiosError=zt,ts.Cancel=ts.CanceledError,ts.all=function(t){return Promise.all(t)},ts.spread=mX,ts.isAxiosError=vX,ts.mergeConfig=Jl,ts.AxiosHeaders=lo,ts.formToJSON=e=>ak(Be.isHTMLForm(e)?new FormData(e):e),ts.getAdapter=Ek.getAdapter,ts.HttpStatusCode=lS,ts.default=ts;const{Axios:V0e,AxiosError:B0e,CanceledError:$0e,isCancel:H0e,CancelToken:G0e,VERSION:U0e,all:W0e,Cancel:z0e,isAxiosError:yX,spread:j0e,toFormData:K0e,AxiosHeaders:q0e,HttpStatusCode:Y0e,formToJSON:Z0e,getAdapter:X0e,mergeConfig:J0e}=ts,wX=e=>{const n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2){const s=n.pop();return(s==null?void 0:s.split(";").shift())??null}return null},CX=6e4,xk=e=>({[`/api/v1/workspace/${e}/item/2`]:1,[`/api/v1/workspace/${e}/item/2/metrics`]:5,default:5}),Lm=new Map,Ik=e=>{const t=e.match(/\/api\/v1\/workspace\/([^/]+)/);return t?t[1]:null},bX=e=>{const t=Ik(e),n=xk(t||"none"),o=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&o===a)||"default";Lm.has(i)||Lm.set(i,{ongoing:0,queue:[]});const r=Lm.get(i);return new Promise(a=>{r?r.ongoing<n[i]?(r.ongoing++,a()):r.queue.push(()=>{r.ongoing++,a()}):a()})},Fk=e=>{const t=Ik(e),n=xk(t||"none"),o=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&o===a)||"default",r=Lm.get(i);if(r&&(r.ongoing--,r.queue.length>0)){const a=r.queue.shift();setTimeout(()=>{a==null||a()},1e3)}},SX=(()=>{const e=ts.create({timeout:CX,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(async t=>{const n=t.url||"";await bX(n);const s=wX("account.token");return s&&t.headers&&(t.headers.Authorization=`Bearer ${s}`),t.headers&&(t.headers["Access-Control-Allow-Origin"]="*",t.headers["Access-Control-Allow-Headers"]="*",t.headers["Accept-Language"]="*"),t},t=>Promise.reject(t)),e.interceptors.response.use(t=>(Fk(t.config.url||""),t),async t=>{var s,o,i;if(((s=t.response)==null?void 0:s.status)===401){const r=sessionStorage.getItem("BASE_URL")||"";(()=>{const l=`${r}/start`;window.postMessage({type:"TOKEN_EXPIRED",message:"Authentication token has expired"},"*"),window.location.replace(l)})()}if(t.config&&Fk(t.config.url||""),t.code==="ERR_NETWORK"||!navigator.onLine)return Promise.reject(t);const n=t.config;if(((o=t.response)==null?void 0:o.status)===429&&(!n._retryCount||n._retryCount<3)){n._retryCount=(n._retryCount||0)+1;const r=t.response.headers["retry-after"],a=r?parseInt(r)*1e3:Math.pow(2,n._retryCount)*1e3;return await new Promise(l=>setTimeout(l,a)),e(n)}return((i=t.response)==null?void 0:i.status)===401&&!n._retry&&(n._retry=!0),Promise.reject(t)}),e})();class nf extends Error{constructor(t,n,s,o,i){super(t),this.name="ApiError",this.statusCode=n,this.code=s,this.details=o,this.type=i,Object.setPrototypeOf(this,nf.prototype)}}const sf=e=>{var t,n;if(yX(e)){const s=(t=e.response)==null?void 0:t.status,o=(n=e.response)==null?void 0:n.data,i=(o==null?void 0:o.message)||e.message||"An unexpected error occurred",r=(o==null?void 0:o.code)||e.code,a=(o==null?void 0:o.details)||o;let l="UNKNOWN";return!s||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":s>=500?l="SERVER":s===Tu.UNAUTHORIZED||s===Tu.FORBIDDEN?l="AUTH":s===Tu.UNPROCESSABLE_ENTITY||s===Tu.BAD_REQUEST?l="VALIDATION":s>=Tu.BAD_REQUEST&&(l="CLIENT"),new nf(i,s,r,a,l)}return e instanceof Error?new nf(e.message,void 0,void 0,void 0,"UNKNOWN"):new nf("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class EX{constructor(){this.axios=SX}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n??""}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([o,i])=>{i!=null&&i!==""&&(Array.isArray(i)?i.forEach(r=>n.append(o,String(r))):typeof i=="object"?n.append(o,JSON.stringify(i)):n.append(o,String(i)))});const s=n.toString();return s?`?${s}`:""}async get(t="",n,s){try{const o=this.buildUrl(t),i=n?this.buildQueryParams(n):"";return(await this.axios.get(`${o}${i}`,s)).data}catch(o){throw sf(o)}}async post(t="",n,s,o){try{const i=this.buildUrl(t),r=n?this.buildQueryParams(n):"";return(await this.axios.post(`${i}${r}`,s,o)).data}catch(i){throw sf(i)}}async put(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.put(o,n,s)).data}catch(o){throw sf(o)}}async patch(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.patch(o,n,s)).data}catch(o){throw sf(o)}}async delete(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.delete(o,{data:n,...s})).data}catch(o){throw sf(o)}}}const _X=({domainApi:e,wsCode:t,entityId:n})=>({list_cursor:{url:`${e}/v1/workspace/${t}/item/2`,method:"post",code:"list_cursor"},assignedUser:{url:`${e}/v1/workspace/${t}/item/2/assigned-users`,method:"post",code:"assignedUser"},metricValues:{url:`${e}/v1/workspace/${t}/item/2/metrics`,method:"post",code:"metricValues"},multipleAssignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"multipleAssignableUser"},assignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"assignableUser"},assignableStatus:{url:`${e}/v1/workspace/${t}/item/2/assignable-statuses`,method:"post",code:"assignableStatus"},delete_rendition:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-rendition`,method:"delete",code:"delete_rendition"},delete_thumbnail:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-thumbnail`,method:"delete",code:"delete_thumbnail"},archive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"archive_item"},unarchive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"unarchive_item"},removeAssignee:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-assignee`,method:"delete",code:"removeAssignee"},basicInfor:{url:`${e}/v1/workspace/${t}/tile/people/ws-user-roles/{userId}/basic-info`,method:"get",code:"basicInfor"},bulkDelete:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete`,method:"delete",code:"bulkDelete"},bulkArchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkArchive"},bulkDateUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-date-update`,method:"put",code:"bulkDateUpdate"},bulkAssignUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-assignee-update`,method:"put",code:"bulkAssignUpdate"},bulkStatusUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-status-update`,method:"put",code:"bulkStatusUpdate"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"},getPermission:{url:`${e}/v1/workspace/${t}/item/2/permissions`,method:"post",code:"getPermission"},getUserPermission:{url:`${e}/v1/workspace/${t}/permissions`,method:"get",code:"getUserPermission"},bulkUnarchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkUnarchive"},downloadTemplate:{url:`${e}/v1/workspace/${t}/item/2/download-sample`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/v1/workspace/${t}/item/2/import-from-file`,method:"post",code:"importItems"},exportItems:{url:`${e}/v1/workspace/${t}/item/2/export`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/v1/workspace/${t}/item/2/update-from-file`,method:"post",code:"updateFromFile"},metricList:{url:`${e}/v1/workspace/${t}/entity/2/metrics`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/v1/workspace/${t}/item/2/update`,method:"put",code:"item"},me:{url:`${e}/v1/me`,method:"get",code:"me"},workspaces:{url:`${e}/v1/workspaces`,method:"get",code:"workspaces"},entityUserRoles:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"entityUserRoles"},templateFlowStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"templateFlowStatuses"},createNewItem:{url:`${e}/v1/workspace/${t}/item/2/new?entity_id=${n}`,method:"post",code:"createNewItem"},getAssignableStatuses:{url:`${e}/v1/workspace/${t}/entity/2/assignable-statuses`,method:"get",code:"getAssignableStatuses"},getAssignableAssignees:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"getAssignableAssignees"},getFilterStatuses:{url:`${e}/v1/workspace/${t}/entity/2/statuses`,method:"get",code:"getFilterStatuses"}}),RX=(e,t)=>{const n=new Blob([e]),s=globalThis.URL.createObjectURL(n),o=document.createElement("a");o.href=s,o.download=t,document.body.appendChild(o),o.click(),o.remove(),globalThis.URL.revokeObjectURL(s)};class Pk extends EX{constructor(t,n){const s=n==null?void 0:n.domainApi,o=n==null?void 0:n.wsCode,i=(n==null?void 0:n.entityId)||"";super(),this.events=Object.create(null);const r=_X({domainApi:s,wsCode:o,entityId:i}),a={};Object.entries(r).forEach(([l,c])=>{const u=l;t[u]?a[u]=t[u]:(console.warn(`API config for ${u} is missing, using base config.`),a[u]=c)}),this.apiConfig=a}on(t,n){var s;((s=this.events)[t]??(s[t]=[])).push(n)}off(t,n){const s=this.events[t];s&&(this.events[t]=s.filter(o=>o!==n))}emit(t,...n){const s=this.events[t];s!=null&&s.length&&s.forEach(o=>{try{o(...n)}catch(i){console.error(`Error in event listener for ${t}:`,i)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:s,payload:o,code:i,responseType:r}){var c,u;const a=this.buildHeaders(o);let l;try{if(l=await this.axios.request({method:t,url:n,params:s,data:o,headers:a,responseType:r}),(((c=l.headers)==null?void 0:c["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const h=((u=l.headers)==null?void 0:u["content-disposition"])||"",f=h.includes("filename=")?h.split("filename=")[1]:"exported_items.xlsx";RX(l.data,f)}if(l.status>=400&&l.status<=500)throw new Error(`Client error (${l.status}): ${l.statusText}`);return this.emit("call-api",{apiCode:i,path:n,params:s,payload:o,res:l,success:!0}),l.data}catch(d){throw console.error("API Request Error:",d),d.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:s,payload:o,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:s,payload:o,error:d,success:!1,apiCode:i,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let s=t;return Object.entries(n).forEach(([o,i])=>{s=s.replace(`{${o}}`,String(i))}),s}async request(t,n,s={}){const{url:o,code:i,method:r}=this.apiConfig[t],a=this.generateUrl(o,n);return this._requestHandler({method:r,path:a,params:s.params,payload:s.payload,code:i,responseType:s.responseType})}async getAllItem_cursor(t){var i;const n=t.workspaceId,s={entity_ids:((i=t.entityIds)==null?void 0:i.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,search:t.search||t.q||void 0,include_signature:1,include:"last_updated_by,property,last_completed_by",include_permission:"{include_permission}",assignee_any_ina:(t==null?void 0:t.assignee_any_ina)||"",assignee_all_ina:(t==null?void 0:t.assignee_all_ina)||void 0,with_not_assigned:t.with_not_assigned||void 0,status_ina:t.status_ina||void 0,status_eq:t.status_eq||void 0,start_date_gte:t.start_date_gte||void 0,start_date_lte:t.start_date_lte||void 0,start_date_btw:t.start_date_btw||void 0,due_date_gte:t.due_date_gte||void 0,due_date_lte:t.due_date_lte||void 0,due_date_btw:t.due_date_btw||void 0,condition_combine_type:t.condition_combine_type||"or",preflight_status:t.preflight_status||void 0},o=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:s,payload:{sort_by:o}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},s={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:s,payload:n})}async getMetricList({workspaceId:t,entityId:n,page:s,query:o,per_page:i}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:i||100,page:s||1,name_like:o||void 0}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:s,metric_ids:o}){const i={item_ids:n,metric_ids:o};return this.request("metricValues",{workspaceId:t},{params:{per_page:s,include_permission:1},payload:i})}async multipleAssignableUser(t){const n=t.workspaceId,s=t.itemIds,o={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:s||[]};return this.request("multipleAssignableUser",{workspaceId:n},{payload:o})}async getAssignableStatus(t){const n=t.workspaceId,s={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return this.request("assignableStatus",{workspaceId:n||""},{payload:s})}async updateSceneName({workspaceId:t,entityId:n,itemId:s,name:o}){const i={item_id:s,entity_id:n,name:o,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:s},{payload:i})}async deleteScene(t,n,s){const o={item_ids:[s]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:o})}async deleteThumbnail({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("delete_thumbnail",{workspaceId:t},{payload:o})}async deleteRendition({workspaceId:t,itemIds:n,deleteAll:s=!1,entityId:o}){const i={item_ids:n,delete_all:s?1:void 0,entity_id:o};return!n||n.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:i})}async archiveScene(t,n,s){const o={item_ids:s,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:o})}async changeDate({workspaceId:t,itemIds:n,startDate:s,dueDate:o,entityId:i,filterParams:r}){const a={item_ids:n,start_date:s,due_date:o,entity_id:i};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:r})}async updateAssignee(t){const{workspaceId:n,itemIds:s,userIds:o,entityId:i}=t,r={item_ids:s,ws_user_role_ids:o,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:s,entityId:o}=t,i={item_ids:n,ws_user_role_ids:s,entity_id:o};return!n||n.length===0?(i.item_ids=void 0,i.entity_id=o):(i.item_ids=n,i.entity_id=void 0),i}async removeAssignee(t){const n=this.createUpdateEntityPayload(t);return this.request("removeAssignee",{workspaceId:t.workspaceId},{payload:n,params:t.filterParams})}async replaceAssignee(t){const{workspaceId:n,itemIds:s,userIds:o,entityId:i}=t,r={item_ids:s,ws_user_role_ids:o,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:r})}async addAssignee({workspaceId:t,itemIds:n,userIds:s,entityId:o,filterParams:i}){const r={item_ids:n,ws_user_role_ids:s,entity_id:o};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:r,params:i})}async unAssignAll(t){const{workspaceId:n,entityId:s,itemIds:o,filterParams:i}=t,r={item_ids:o,entity_id:s,ws_user_role_ids:[]};return!o||o.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(s)},{payload:r,params:i})}async updateItemStatus(t){const{workspaceId:n,itemIds:s=[],statusId:o,entityId:i}=t,r={item_ids:s,template_flow_status_id:o};return s.length||(r.item_ids=void 0,r.entity_id=i),this.request("bulkStatusUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkDelete",{workspaceId:t},{payload:o})}async bulkUnarchiveItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,status:1,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkUnarchive",{workspaceId:t},{payload:o})}async bulkArchiveItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,status:0,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkArchive",{workspaceId:t},{payload:o})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:s,metricId:o,value:i,clear:r}=t,a={item_ids:s,metric_id:o,metric_value:i,clear:r??(i==null?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete a.item_ids,a.entity_id=String(t.entityId)):(a.item_ids=s,a.entity_id=void 0),this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams})}async getPermissionForItems({workspaceId:t,itemIds:n}){const s={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:s,params:{per_page:50}})}async unarchiveScene(t,n,s){const o={item_ids:s,status:1};return this.request("unarchive_item",{workspaceId:t,entityId:n},{payload:o})}async getUserPermission(t){return this.request("getUserPermission",{workspaceId:t})}async getEntityDetail(t,n){return this.request("getEntityDetail",{workspaceId:t,entityId:n})}async downloadTemplate(t,n){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async downloadExportedItemsFile(t,n){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async addNewSceneViaImportFile(t,n,s){return this.request("importItems",{workspaceId:t,entityId:n},{payload:s})}async overwriteScenesViaImportFile(t,n,s){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:s})}async getMe(){return this.request("me",{})}async getWorkspaces(t){const n={page:1,per_page:1,"ws_user_role>status_eq":1,include:"owner",include_ws:t};return this.request("workspaces",{},{params:n})}async getEntityUserRoles(t){const{workspaceId:n,page:s,per_page:o,display_name_like:i,entity_ids:r}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:s,per_page:o,display_name_like:i,entity_ids:r}})}async getTemplateFlowStatuses(t){const{workspaceId:n,entityId:s}=t;return this.request("templateFlowStatuses",{workspaceId:n,entityId:s},{params:{per_page:100,page:t.page??1,all:1,name_like:t.name_like}})}async addNewItem(t,n,s){return this.request("createNewItem",{workspaceId:t,entityId:n},{payload:s})}async getFilterStatuses(t,n,s){return this.request("getFilterStatuses",{workspaceId:t,entityId:n},{params:s})}async getAssignableStatuses(t,n){return this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return this.request("getAssignableAssignees",{workspaceId:t},{params:n})}}const DX=(e,t,n,s,o,i,r)=>{const{apiServices:a}=es(n,s),l=V(!1),c=()=>{l.value=!0},u=()=>{Ct(()=>{setTimeout(()=>{l.value=!1},500)})},d=Z(()=>!!(o!=null&&o.value&&(i!=null&&i.value))),h=Sn("filterParams",null);return{isUpdating:l,handleUpdate:async p=>{var v;const g=p.value;c();try{const y={itemIds:e.value.itemIds,metricId:p.id,workspaceId:String(e.value.workspaceId),filterParams:h!=null&&h.value?h.value:void 0};p.value==null?y.clear=1:y.value=g,d.value?(delete y.itemIds,y.entityId=String(s.entityId)):y.itemIds=e.value.itemIds;const b=await((v=a.value)==null?void 0:v.bulkUpdateMetric(y));(b==null?void 0:b.message)=="Done"&&t(p)}catch(y){console.error("Error during bulk metric update:",y)}u()}}},TX=St(it({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{}},emits:["update"],setup(e,{emit:t}){const n=BA(),s=V([]),o=e,i=t,r=V([]),a=V(null),l=te=>{var q,k,N;const z=s.value.findIndex(Q=>Q.id===te.id);a.value=z;const pe=(q=r.value[z])==null?void 0:q.$el;(k=T.value)==null||k.scrollTo(z*30),pe&&pe.scrollIntoView({behavior:"smooth",block:"center"}),c(z),(N=r.value[z])==null||N.show()},c=te=>{a.value=te,r.value.forEach((z,pe)=>{pe!==te&&z&&z.hide()})},u=V(""),d=V(null),{popupRef:h,triggerRef:f,isVisible:p}=us({toggleOnClick:!0,appendTo:d.value||void 0}),g=()=>{u.value="",r.value.forEach(te=>{te==null||te.hide()}),a.value=null},v=Z(()=>o.selectedIds||[]),y=Z(()=>({itemIds:v.value,workspaceId:String(o.workspaceId)})),b=Sn("isSelectAll",V(!1)),S=Sn("bulkUpdate",V(!1)),{handleUpdate:C,isUpdating:E}=DX(y,te=>{i("update",te),g()},!1,o,S,b),R=te=>{g(),Ct(()=>{var z;(z=T.value)==null||z.focus()})},T=V(null);Je(()=>p.value,te=>{var z;te?(z=T.value)==null||z.focus():g()});const A=V(!0),O=V(!0),{apiServices:I}=es(!1,o),D=async(te,z,pe)=>{var q;try{return pe?O.value=!0:A.value=!0,await((q=I.value)==null?void 0:q.getMetricList({workspaceId:o.workspaceId||"",entityId:o.entityId||"",page:te,query:z,per_page:10}))}catch(k){throw console.error("Failed to fetch metric list:",k),k}finally{A.value=!1,O.value=!1}},x=V(0),P=V(!0),M=te=>({id:String(te.id),label:String(te.name),value:String(te.id),description:te.morpheme_value?`${String(te.morpheme_value)}`:"",type:n.checkEditType(te),metricConfig:te}),B=te=>te.filter(z=>!z.formula).filter(z=>{var pe;return((pe=z==null?void 0:z.auth_permission)==null?void 0:pe.permission)==2}).map(M),Y=async()=>{x.value+=1;const te=await D(x.value,u.value,!0);if(te&&te.data){const z=B(te.data);s.value=[...s.value,...z],P.value=te.meta.last_page!=te.meta.current_page}else P.value=!1},ne=async te=>{u.value=te,x.value=1;try{const z=await D(x.value,u.value);z&&z.data?(s.value=B(z.data),P.value=z.meta.last_page!=z.meta.current_page):s.value=[]}catch{s.value=[]}};return Je(()=>p.value,(te,z)=>{te&&z!==te&&ne("")},{immediate:!0,deep:!0}),(te,z)=>(W(),ae("div",{ref_key:"wrapperRef",ref:d},[fe(gt,{class:"action-button",variant:o.variant,ref_key:"triggerRef",ref:f,loading:U(E)},{default:ye(()=>[fe(at,{src:"SquareRootVariable",class:"icon"}),z[1]||(z[1]=nt(" Metric ",-1))]),_:1},8,["variant","loading"]),be("div",{ref_key:"popupRef",ref:h,style:{display:"none","border-radius":"4px"}},[fe(Xr,{ref_key:"searchListRef",ref:T,style:{width:"320px"},options:s.value,loading:A.value,"loading-more":O.value,"selected-id":void 0,"has-more":P.value,onSearch:ne,onSelect:l,onLoadMore:z[0]||(z[0]=()=>Y())},{item:ye(({item:pe,index:q,selectedIndex:k})=>[fe(qY,{ref:N=>r.value[q]=N,label:pe.label,type:pe.type,morpheme:pe.description||"",onFocusOnSearch:R,onOpen:N=>c(q),attachTo:U(h),config:pe.metricConfig,onHandleUpdate:U(C),class:ee(["metric-update-item",{selected:a.value===q||k===q}])},null,8,["label","type","morpheme","onOpen","attachTo","config","onHandleUpdate","class"])]),"extra-item":ye(()=>[...z[2]||(z[2]=[be("div",{style:{width:"250px"}},null,-1)])]),"empty-list":ye(()=>[...z[3]||(z[3]=[nt("No options available.",-1)])]),_:1},8,["options","loading","loading-more","has-more"])],512)],512))}}),[["__scopeId","data-v-635cce1b"]]),Ak=St(it({__name:"DropdownWrapper",props:{placement:{default:"bottom-start"},show:{type:Boolean,default:!1},maxWidth:{default:400}},emits:["open","close"],setup(e,{expose:t,emit:n}){const s=e,o=n,{hide:i,triggerRef:r,popupRef:a,isVisible:l,toggle:c}=us({toggleOnClick:!0,placement:s.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:s.show,maxWidth:s.maxWidth}),u=Z(()=>l.value);Je(l,f=>{o(f?"open":"close")});const d=()=>{i()};t({closeDropdown:d,isOpen:u});const h=f=>{f.key==="Escape"&&a.value&&i()};return Zt(()=>{var p;const f=r.value instanceof HTMLElement?r.value:(p=r.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",h)}),Qn(()=>{var p;const f=r.value instanceof HTMLElement?r.value:(p=r.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",h)}),(f,p)=>(W(),ae("div",{ref_key:"triggerRef",ref:r,class:ee(f.$style["dropdown-wrapper"])},[Tt(f.$slots,"trigger",{open:U(l),toggle:U(c),closeDropdown:d},()=>[be("button",{class:ee(f.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),be("div",{ref_key:"popupRef",ref:a,tabindex:"0",class:ee(f.$style["dropdown-content"]),style:ln({display:U(l)?"block":"none",maxWidth:s.maxWidth?s.maxWidth+"px":"unset"})},[Tt(f.$slots,"content",{closeDropdown:d,visible:U(l)},()=>[be("div",{class:ee(f.$style["dropdown-list"])},null,2)])],6)],2))}}),[["__cssModules",{$style:{"dropdown-wrapper":"_dropdown-wrapper_lghkw_1","dropdown-content":"_dropdown-content_lghkw_5","dropdown-list":"_dropdown-list_lghkw_11"}}]]),Vm=Yl("bulkUpdate",()=>{const e=V($t.UNCHECK),t=yo({loaded:0,total:0}),n=u=>{t.total=u},s=u=>{t.loaded=u},o=yo({isBulkUpdating:!1});function i(u){o.isBulkUpdating=u}const r=V({}),a=u=>{r.value=u},l=(u,d)=>{r.value[u]=d},c=u=>{e.value=u};return{bulkUpdateState:o,setIsBulkUpdating:i,selectionIds:r,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:c,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:s,handelSelectAll:()=>{c($t.CHECKED)}}}),xX={class:"status-label"},kk=St(it({__name:"StatusItem",props:{status:{},selected:{type:Boolean},focused:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=Yt,s=e,o=t,i=a=>{o("select",a)},r=a=>new Mn(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(W(),ae("div",{class:ee(["status-option",{selected:s.selected,focused:s.focused}]),onClick:l[0]||(l[0]=c=>i(e.status.id))},[be("div",{class:"status-color",style:ln({backgroundColor:e.status.color,borderColor:r(e.status.color)})},null,4),We((W(),ae("div",xX,[Tt(a.$slots,"label",{},()=>[nt(mt(e.status.name),1)],!0)])),[[U(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-b41fe4c4"]]),IX=["innerHTML"],Ok=St(it({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},callback:{type:Function}},emits:["updated","error","cancel","start-update","finish-update"],setup(e,{expose:t,emit:n}){const s={PER_PAGE:50,INITIAL_PAGE:1},o=e,i=n,r=V([]),a=V(!1),l=V(!1),c=V(null),u=V(s.INITIAL_PAGE),d=V(!0),h=V(0),f=V(""),p=Z(()=>{var M;return(M=o.value)==null?void 0:M.id}),g=Z(()=>!!(o.id||o.ids&&o.ids.length>0)),v=M=>({label:M.name,value:M.id,selected:p.value===M.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:M,id:M.id,color:M.color}),y=Z(()=>{const M=new Set;return o.id&&M.add(String(o.id)),o.ids&&o.ids.forEach(B=>{B&&M.add(String(B))}),Array.from(M)}),b=Sn("bulkUpdate",!1),{apiServices:S}=es(!b,o),C=Vm(),{selectionStatus:E}=Xs(C),R=Sn("filterParams",null),T=async(M=s.INITIAL_PAGE,B="",Y=!1)=>{var ne,te,z,pe;if(!g.value){console.error("Missing required props",o);return}Y?l.value=!0:a.value=!0,c.value=null;try{const q={workspaceId:String(o.workspaceId),itemIds:y.value,page:M,perPage:s.PER_PAGE,name_like:B.trim(),...R||{}};if(((ne=S.value)==null?void 0:ne.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const k=await((te=S.value)==null?void 0:te.getAssignableStatus(q));if(!(k!=null&&k.data)){Y||(r.value=[]),d.value=!1;return}const N=k.data.map(v);r.value=Y?[...r.value,...N]:N,h.value=((z=k.meta)==null?void 0:z.total)??k.data.length,d.value=!((pe=k.meta)!=null&&pe.on_last_page),u.value=M}catch(q){console.error("Error fetching statuses:",q),c.value="Failed to load statuses",Y||(r.value=[]),d.value=!1,i("error",c.value)}finally{a.value=!1,l.value=!1}},A=Ri(async M=>{f.value=M,u.value=s.INITIAL_PAGE,await T(s.INITIAL_PAGE,M,!1)},sr),O=async()=>{!d.value||l.value||await T(u.value+1,f.value,!0)},I=()=>{var M;i("cancel"),(M=o.params)==null||M.api.stopEditing()},D=async M=>{var B,Y,ne;if(!g.value){console.error("Missing required props for updating status",o);return}try{const te={workspaceId:String(o.workspaceId),itemIds:y.value,statusId:String(M.value),entityId:String(o.entityId),filterParams:R!=null&&R.value?R==null?void 0:R.value:void 0};if(E.value==$t.CHECKED&&b&&(te.itemIds=void 0,te.entityId=String(o.entityId)),i("start-update"),!await S.value.updateItemStatus(te))throw new Error("Status update failed: empty response");const pe={workspaceId:String(o.workspaceId),itemIds:y.value,data:{id:M.id,name:M.label,color:M.color}};i("updated",pe),o.params&&((Y=o.params)==null||Y.node.setData({...(B=o.params)==null?void 0:B.node.data,status:{id:M.id,name:M.label,color:M.color}}),(ne=o.params)==null||ne.api.stopEditing())}catch(te){console.error("Error updating status:",te),c.value="Failed to update status",i("error",c.value)}finally{i("finish-update")}},x=Z(()=>r.value.map(M=>({...M})));Je([()=>o.id,()=>o.workspaceId,()=>o.ids],()=>{T()},{deep:!0,immediate:!0});const P=V(null);return Zt(()=>{Ct(()=>{var M;(M=P.value)==null||M.focus()})}),t({refresh:()=>T(s.INITIAL_PAGE,f.value,!1),loadMore:O,focus:()=>{var M;return(M=P.value)==null?void 0:M.focus()}}),(M,B)=>{var Y;return W(),Ke(Xr,Jt({ref_key:"popupRef",ref:P},o,{"selected-id":(Y=o.value)==null?void 0:Y.id,options:x.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:c.value,onSearch:U(A),onSelect:D,onLoadMore:O,onCancel:I,onClose:I}),{item:ye(({item:ne,selectedIndex:te,isSelected:z,handleItemHover:pe,getHighlightedLabel:q,query:k,idx:N})=>[(W(),Ke(kk,{key:ne.value,status:ne.data,selected:z(ne),onMouseover:Q=>pe(N),onSelect:Q=>D(ne),hover:N===te},{label:ye(()=>[k?(W(),ae("span",{key:0,class:ee([M.$style["item-label"],M.$style.match]),style:{flex:"1"},innerHTML:q(ne.label)},null,10,IX)):(W(),ae("span",{key:1,class:ee(M.$style["item-label"]),style:{flex:"1"}},mt(ne.label),3))]),_:2},1032,["status","selected","onMouseover","onSelect","hover"]))]),_:1},16,["selected-id","options","loading","loading-more","has-more","error","onSearch"])}}}),[["__cssModules",{$style:{"item-label":"_item-label_7ir12_1"}}]]),FX=it({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{}},emits:["updated"],setup(e,{emit:t}){const n=e,s=Z(()=>{const v=bs();return v==null?void 0:v.appContext.config.globalProperties.apiServices}),{popupRef:o,triggerRef:i,isVisible:r,hide:a}=us({toggleOnClick:!0}),l=t,c=V(!1),u=v=>{c.value=!1,l("updated",v),setTimeout(()=>{a()},700)},d=Z(()=>({apiServices:s.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId})),h=V(null),f=v=>{v.key==="Escape"&&o.value&&a()};Zt(()=>{var y;const v=h.value instanceof HTMLElement?h.value:(y=h.value)==null?void 0:y.$el;v&&v.addEventListener("keydown",f)}),Qn(()=>{var y;const v=h.value instanceof HTMLElement?h.value:(y=h.value)==null?void 0:y.$el;v&&v.removeEventListener("keydown",f)}),Ki("bulkUpdate",!0);const p=v=>{c.value=v},g=V(null);return Je(r,v=>{var y;v&&((y=g.value)==null||y.focus())}),(v,y)=>(W(),ae("div",{ref_key:"mainRef",ref:h},[fe(gt,{ref_key:"triggerRef",ref:i,variant:e.variant,loading:c.value},{default:ye(()=>[fe(at,{src:"Square",class:"icon"}),y[3]||(y[3]=nt(" Status ",-1))]),_:1},8,["variant","loading"]),be("div",{ref_key:"popupRef",ref:o},[We(fe(Ok,Jt({ref_key:"statusRef",ref:g},d.value,{onUpdated:u,onCancel:U(a),onStartUpdate:y[0]||(y[0]=b=>p(!0)),onFinishUpdate:y[1]||(y[1]=b=>p(!1)),onError:y[2]||(y[2]=b=>p(!1)),callback:()=>p(!1)}),null,16,["onCancel","callback"]),[[Ei,U(r)]])],512)],512))}}),Mk=St(it({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0},focusableIndex:{}},emits:["actionExecuted"],setup(e,{expose:t,emit:n}){const s=Gr,o=e,i=Z(()=>(o==null?void 0:o.workspaceId)||""),r=Z(()=>(o==null?void 0:o.entityId)||""),a=()=>{var M,B,Y;return(Y=(M=o.params)==null?void 0:M.api)==null?void 0:Y.getCellRendererInstances({columns:["options"],rowNodes:(B=o.params)!=null&&B.node?[o.params.node]:[]})[0]},l=()=>{var B,Y,ne,te;const M=a();(Y=(B=M==null?void 0:M.componsenExposed)==null?void 0:B.blur)==null||Y.call(B),(te=(ne=M==null?void 0:M.container)==null?void 0:ne.parentElement)==null||te.classList.remove("ag-cell-focus")},c=()=>{var Y,ne,te;(ne=(Y=o.params)==null?void 0:Y.api)==null||ne.stopEditing(),l();const M=`scene-name-${o.id}`,B=document.getElementById(M);(te=B==null?void 0:B.__sceneNameEditor)==null||te.startEdit()},{apiServices:u}=es(!0,o),d=Z(()=>{var M;return{ws_code:i.value,entity_id:r.value,scene_id:o.id,axiosService:u,optionBlock:o.optionBlock,permissions:(M=o.data)==null?void 0:M.permissions}}),h=M=>{var Y,ne,te,z,pe,q;let B=(ne=(Y=o.params)==null?void 0:Y.api)==null?void 0:ne.getRowNode(String(o.id));if(B){const k={...B.data,isDeleted:M==="deleted",isArchived:M==="archived"?!0:B.data.isArchived,isLocked:M==="locked"?!0:B.data.isLocked,disabled:!1};M=="deleted"&&(k.isLocked=!1,k.disabled=!0),M=="unarchived"&&(k.isArchived=!1),(z=(te=o.params)==null?void 0:te.api)==null||z.redrawRows({rowNodes:[B]}),B.setData(k),(q=(pe=o.params)==null?void 0:pe.api)==null||q.redrawRows({rowNodes:[B]})}},f=qh(),{openSceneHub:p}=f,g=()=>{Ct(()=>{var Y,ne,te,z,pe,q;const M=((ne=(Y=o.params)==null?void 0:Y.node)==null?void 0:ne.rowIndex)||0,B=((z=(te=o.params)==null?void 0:te.column)==null?void 0:z.getColId())||"";(q=(pe=o.params)==null?void 0:pe.api)==null||q.setFocusedCell(M,B)})};Z(()=>{var B,Y;const M=(Y=(B=o.params)==null?void 0:B.api)==null?void 0:Y.getRowNode(String(o.id));return M==null?void 0:M.data});const{options:v}=Xq(d,h,c,p,g),y=n,b=()=>{var M,B,Y,ne,te,z;console.trace("Focusing current cell for row:",o.id),(z=(M=o.params)==null?void 0:M.api)==null||z.setFocusedCell(((Y=(B=o.params)==null?void 0:B.node)==null?void 0:Y.rowIndex)||0,((te=(ne=o.params)==null?void 0:ne.column)==null?void 0:te.getColId())||"")},S=Z(()=>{var M;return(M=o.params)==null?void 0:M.api}),C=(M,B)=>{var Y,ne,te,z,pe,q,k,N;if(y("actionExecuted",M),M.id=="copy-link"){(pe=S.value)==null||pe.startEditingCell({rowIndex:(ne=(Y=o.params)==null?void 0:Y.node)==null?void 0:ne.rowIndex,colKey:(z=(te=o.params)==null?void 0:te.column)==null?void 0:z.getColId()});return}else{if(M.id!=="copy-link"&&((q=S.value)==null||q.stopEditing()),M.id==="rename")(k=S.value)==null||k.stopEditing(),(N=S.value)==null||N.clearFocusedCell(),l();else if(M.id==="copy-link"){const Q=document.getElementById(B);setTimeout(()=>{var ce,xe,ge;(ge=(xe=(ce=Q==null?void 0:Q.__vueParentComponent)==null?void 0:ce.exposed)==null?void 0:xe.focus)==null||ge.call(xe)},300)}else if(["delete-rendition","delete-thumbnail"].includes(M.id)){setTimeout(()=>{b()},300);return}setTimeout(()=>{var Q,ce;(ce=(Q=o.params)==null?void 0:Q.api)==null||ce.clearFocusedCell()},300)}},E=()=>{var M,B;(B=(M=o.params)==null?void 0:M.api)==null||B.stopEditing()},R=M=>{var B,Y,ne,te;return M==="archive"?!((Y=(B=o.params)==null?void 0:B.data)!=null&&Y.isArchived):M==="unarchive"?(te=(ne=o.params)==null?void 0:ne.data)==null?void 0:te.isArchived:!0},T=Z(()=>v.value.map(M=>({...M,options:M.options.filter(B=>!B.hide&&R(B.id))})).filter(M=>M.options.length>0)),A=V({}),O=V(null),I=Z(()=>{var B,Y;if(o.focusableIndex)return o.focusableIndex;const M=(Y=(B=o.params)==null?void 0:B.api)==null?void 0:Y.getRowNode(String(o.id));return`${((M==null?void 0:M.rowIndex)??0)+10}`}),D=(M,B)=>`${I.value}.${M*10+B}`,x=(M,B)=>{if(B&&"focus"in B){A.value[M]=B;return}delete A.value[M]},P=M=>{M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation()};return Zt(()=>{var M;(M=O.value)==null||M.focus()}),t({focus(){var Y;const M=`${I.value}.0`,B=A.value[M];B&&B.focus?B.focus():(Y=O.value)==null||Y.focus()}}),(M,B)=>We((W(),ae("div",{onKeydown:P,class:ee([M.$style["more-option-section"],{[M.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:O,tabindex:"0",role:"menu"},[(W(!0),ae(xt,null,xn(T.value,(Y,ne)=>(W(),ae("div",{key:Y.id,style:ln({"--g-number":Math.min(Y.options.length,4),"--g-size":Y.type==="column"?"36px":"auto"}),class:ee([M.$style["option-block"],M.$style[Y.type]])},[(W(!0),ae(xt,null,xn(Y.options,(te,z)=>(W(),ae("div",{key:te.id,class:ee(M.$style["option-item"])},[fe(AX,{layer:o.layer,"scene-id":String(o.id),option:te,type:Y.type,onActionExecuted:pe=>C(pe,`more-action-${pe.id}-${o.id}`),focusableIndex:D(ne,z),ref_for:!0,ref:pe=>x(D(ne,z),pe),onHandleHide:E,id:`more-action-${te.id}-${o.id}`,label:te.label},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id","label"])],2))),128))],6))),128))],34)),[[U(s),I.value]])}}),[["__cssModules",{$style:{"more-option-section":"_more-option-section_1jg4p_1","option-block":"_option-block_1jg4p_8","option-item":"_option-item_1jg4p_15",row:"_row_1jg4p_19",column:"_column_1jg4p_25",block:"_block_1jg4p_29"}}]]),PX={key:0,style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center"}},AX=St(it({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const s=Gr,o=Yt,i=e,r=V(!1),a=V(!1),l=(A,O)=>{if(!O){p();return}const I=O.target;I.closest(".tippy-content")||I.closest(".tippy-box")||I.closest("[data-tippy-root]")||I.closest(".option-item")||p()},c=V(null),{triggerRef:u,popupRef:d,show:h,isVisible:f,hide:p}=us({toggleOnClick:!0,interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:l,appendTo:c.value||void 0}),g=n,v=async A=>{var O,I;if(!a.value){a.value=!0;try{await((I=(O=i.option).action)==null?void 0:I.call(O,A)),g("actionExecuted",i.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1,r.value=!1}}},y=async A=>{var O,I;if(A.preventDefault(),A.stopPropagation(),!a.value){if(i.option.isDanger){r.value=!r.value;return}if(i.option.subMenu)h();else{a.value=!0;try{await((I=(O=i.option).action)==null?void 0:I.call(O,A)),g("actionExecuted",i.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1}return}}},b=A=>{g("actionExecuted",A),p()},S=A=>{A.key==="Escape"&&p()},C=A=>({row:"small",column:"medium",block:"small"})[A]||"medium",E=A=>{const O=i.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...O],column:["menu-item",...O],block:["secondary",...O]}[A]||[]},R=()=>{r.value?r.value=!1:f.value?p():g("handleHide")};t({focus:()=>{Ct(()=>{u.value instanceof HTMLElement?u.value.focus():u.value&&"$el"in u.value?u.value.$el.focus():console.warn("Trigger ref is not an HTMLElement:",u.value)})},escape:()=>{p()},select:()=>{y(new MouseEvent("click"))}});const T=A=>{var O;A.stopPropagation(),A.preventDefault(),r.value=!1,(O=u.value)==null||O.focus()};return(A,O)=>{var I;return We((W(),ae("div",{ref_key:"wrapperRef",ref:c,class:ee(A.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:Pt(y,["stop","prevent"])},[We((W(),Ke(gt,{ref_key:"triggerRef",ref:u,class:ee(A.$style["option-item"]),disabled:e.option.disabled||a.value,actived:U(f)||r.value,size:C(e.type),variant:E(e.type),onClick:Pt(y,["stop","prevent"]),onKeydown:S,onEscape:R,label:e.option.label},{prefix:ye(()=>[e.option.icon?(W(),ae("div",PX,[fe(at,{size:"14",src:e.option.icon,color:e.option.isDanger?void 0:"#a6a6a6",source:"remote"},null,8,["src","color"])])):Ye("",!0)]),suffix:ye(()=>[e.option.subMenu?(W(),Ke(at,{key:0,src:"Play",source:"remote"})):Ye("",!0),e.option.isDanger&&r.value?(W(),ae("div",{key:1,class:ee(A.$style["confirm-action"])},[We((W(),Ke(gt,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:T},{default:ye(()=>[fe(at,{src:"XMarkSolid",source:"remote"})]),_:1})),[[U(s),`${i.focusableIndex}.0`],[U(o),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),We((W(),Ke(gt,{variant:["danger","primary","icon"],size:"small",onClick:Pt(v,["stop","prevent"]),onEscape:O[0]||(O[0]=D=>r.value=!1)},{default:ye(()=>[fe(at,{src:"Check",source:"remote"})]),_:1})),[[U(s),`${i.focusableIndex}.1`],[U(o),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ye("",!0)]),_:1},8,["class","disabled","actived","size","variant","label"])),[[U(s),i.focusableIndex]]),e.option.subMenu?(W(),ae("div",{key:0,ref_key:"popupRef",ref:d,class:ee(A.$style["submenu-container"])},[fe(Mk,{focusableIndex:i.focusableIndex,layer:i.layer+1,ref:"submenuRef","option-block":[((I=e.option)==null?void 0:I.subMenu)||[]],"is-submenu":!1,onActionExecuted:b},null,8,["focusableIndex","layer","option-block"])],2)):Ye("",!0)],2)),[[U(o),{content:e.option.description,contentClass:["extra-padding"],theme:e.option.isDanger?"warning":"arbo",hideOnClick:!1,delay:[300,0]}]])}}}),[["__cssModules",{$style:{"option-item":"_option-item_8a5qn_1","icon-wrapper":"_icon-wrapper_8a5qn_11","confirm-action":"_confirm-action_8a5qn_19"}}]]),kX={style:{"max-width":"225px","line-height":"14px"}},OX={style:{"max-width":"100px","line-height":"14px"}},MX=St(it({__name:"BulkUpdate",props:{selectRowData:{},workspaceId:{},entityId:{},gridApi:{},selectedAll:{type:Boolean},takeName:{},totalRows:{},visibleRows:{},loading:{type:Boolean}},emits:["close","assignStatus","assignAssignee","assignDate","assignMetric","moreActions","deleteSelected","unselect","updated","selectAll"],setup(e,{emit:t}){const n=Yt,s=Gr,o=e,i=t,r=Vm(),{handelSelectAll:a}=r,{selectionStatus:l}=Xs(r),c=Z(()=>l.value===$t.CHECKED),u=Z(()=>o.selectRowData.map(q=>q.id)),d=Z(()=>o.selectRowData.length>0);Ki("bulkUpdate",d),Ki("isSelectAll",c);const h=({itemIds:q,data:k})=>{const N=o.gridApi;q.forEach(Q=>{if(!N){console.error("Grid API is undefined");return}const ce=N.getRowNode(Q);if(ce){const xe={...ce.data,status:k};ce.setData(xe)}})},f=Z(()=>o.selectRowData),p=({itemIds:q,data:k})=>{const N=o.gridApi;if(!N){console.error("Grid API is undefined");return}q.forEach(Q=>{const ce=N.getRowNode(Q);if(ce){const xe=ce.data.dateRange||[null,null];"startDate"in k&&k.startDate!==void 0&&(xe[0]=k.startDate?new Date(k.startDate):null),"dueDate"in k&&k.dueDate!==void 0&&(xe[1]=k.dueDate?new Date(k.dueDate):null);const ge={...ce.data,dateRange:xe};ce.setData(ge)}}),i("updated")},g=Z(()=>o.selectRowData.map(q=>q.id)),v=q=>{const k=o.gridApi,{id:N,value:Q}=q;if(!k){console.error("Grid API is undefined");return}g.value.forEach(ce=>{const xe=k.getRowNode(ce);if(xe){const ge={...xe.data,[`metric_${N}`]:Q};xe.setData(ge)}}),i("updated")},y=["primary"],b=[{label:"Delete Thumbnail",icon:"Image",id:"delete-thumbnail",type:"icon",value:"delete-thumbnail"},{label:"Delete Rendition",icon:"Film",id:"delete-rendition",type:"icon",value:"delete-rendition"},{label:"Unarchive",value:"UnBoxArchive",type:"icon",icon:"BoxArchive",id:"unarchive",clickable:!0},{label:"Archive",value:"BoxArchive",type:"icon",icon:"BoxArchive",id:"archive",clickable:!0},{label:"Delete",value:"delete",type:"icon",icon:"TrashCan",id:"delete",danger:!0,clickable:!0}],S=()=>{i("unselect")},C=Wb(),{userPermissions:E}=Xs(C),R=Z(()=>E.value.includes(zb)),T=()=>{const q=o.selectRowData.map(N=>N.id).join(","),k=To({type:"review_multiple_scenes",config:{reviewDomain:En.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,scene_ids:q}}).url;window.open(k,"_blank")},A=q=>{const{assignees:k,type:N}=q,Q=o.gridApi;if(!Q){console.error("Grid API is not available for bulk update.");return}o.selectRowData.map(xe=>{const ge=Q.getRowNode(xe.id);if(!ge)return null;const de=ge.data.assignees||[];let X=[];switch(N){case"add":{const De=new Set(de.map(Ae=>Ae.id)),re=k.filter(Ae=>!De.has(Ae.id));X=[...de,...re];break}case"overwrite":{X=k;break}case"remove":{const De=new Set(k.map(re=>re.id));X=de.filter(re=>!De.has(re.id));break}case"removeAll":{X=[];break}}return{...ge.data,assignees:X}}).filter(xe=>xe!==null).forEach(xe=>{const ge=Q.getRowNode(xe.id);ge&&ge.setData(xe)})},{apiServices:O}=es(!1,o),I=async()=>{var Q;const q=o.selectRowData.map(ce=>ce.id),k=o.gridApi;if(!k){console.error("Grid API is not available for bulk delete.");return}const N=await((Q=O.value)==null?void 0:Q.bulkDeleteItems(P.value));(N==null?void 0:N.message)=="Done"&&(q.forEach(ce=>{const xe=k.getRowNode(ce);if(xe){const ge={...xe.data,isDeleted:!0,disabled:!0};xe.setData(ge)}}),k.deselectAll())},D=async()=>{var Q;const q=o.selectRowData.map(ce=>ce.id);if(!o.gridApi){console.error("Grid API is not available for bulk unarchive.");return}const N=await((Q=O.value)==null?void 0:Q.bulkUnarchiveItems(P.value));if((N==null?void 0:N.message)!="Done"){console.error("Failed to unarchive items.");return}B(q,"isArchived",!1)},x=Sn("filterParams",void 0),P=Z(()=>({workspaceId:String(o.workspaceId),itemIds:d.value&&c.value?[]:o.selectRowData.map(q=>q.id),entityId:o.entityId,filterParams:x!=null&&x.value?x.value:void 0})),M=async()=>{var Q;const q=o.selectRowData.map(ce=>ce.id);if(!o.gridApi){console.error("Grid API is not available for bulk archive.");return}const N=await((Q=O.value)==null?void 0:Q.bulkArchiveItems(P.value));if((N==null?void 0:N.message)!="Done"){console.error("Failed to archive items.");return}B(q,"isArchived",!0)},B=(q,k,N)=>{const Q=o.gridApi;if(!Q){console.error("Grid API is not available for bulk update.");return}const ce=q.map(xe=>{const ge=Q.getRowNode(xe);if(ge){const de={...ge.data,[k]:N};ge.setData(de)}return ge}).filter(xe=>xe!=null);Q.redrawRows({rowNodes:ce})},Y=async()=>{var Q;const q=o.selectRowData.map(ce=>ce.id),k=o.gridApi;if(!k){console.error("Grid API is not available for bulk thumbnail deletion.");return}const N=await((Q=O.value)==null?void 0:Q.deleteThumbnail(P.value));if((N==null?void 0:N.message)!="Done"){console.error("Failed to delete thumbnails.");return}q.forEach(ce=>{const xe=k.getRowNode(ce);if(xe){const ge={...xe.data,thumbnail:null};xe.setData(ge)}})},ne=async()=>{var Q;const q=o.selectRowData.map(ce=>ce.id),k=o.gridApi;if(!k){console.error("Grid API is not available for bulk rendition deletion.");return}const N=await((Q=O.value)==null?void 0:Q.deleteRendition(P.value));if((N==null?void 0:N.message)!="Done"){console.error("Failed to delete renditions.");return}q.forEach(ce=>{const xe=k.getRowNode(ce);if(xe){const ge={...xe.data,rendition:null};xe.setData(ge)}})},te=V(!1),z=V(null),pe=async q=>{var k;try{switch(te.value=!0,q.id){case"unarchive":await D();break;case"delete":await I();break;case"archive":await M();break;case"delete-thumbnail":await Y();break;case"delete-rendition":await ne();break;default:console.error("Unknown action:",q.id),te.value=!1;break}Ct(()=>{te.value=!1})}catch{te.value=!1}finally{(k=z.value)==null||k.focus()}};return(q,k)=>We((W(),ae("div",{class:ee(q.$style["bulk-update-action"])},[be("div",{class:ee(q.$style["left-actions"])},[be("div",{class:ee(q.$style["selection-track"])},[fe(gt,{variant:["icon","tertiary"],onClick:S},{default:ye(()=>[fe(at,{src:"XMarkSolid",source:"remote"})]),_:1}),U(l)==U($t).INDETERMINATE?(W(),ae("span",{key:0,class:ee(q.$style["selected-count"])},mt(e.selectRowData.length)+" selected ",3)):Ye("",!0),U(l)==U($t).CHECKED?(W(),ae("span",{key:1,class:ee(q.$style["selected-count"]),style:{"line-height":"14px"}},[k[0]||(k[0]=nt(' All in " ',-1)),We((W(),ae("span",kX,[nt(mt(e.takeName),1)])),[[U(n),{content:e.takeName}]]),k[1]||(k[1]=nt(' " ',-1))],2)):Ye("",!0),!e.loading&&U(l)==U($t).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(W(),Ke(gt,{key:2,variant:"secondary",onHandleClick:U(a)},{default:ye(()=>[be("span",{class:ee(q.$style["selected-count"]),style:{"line-height":"14px"}},[k[2]||(k[2]=nt(' Select all in " ',-1)),We((W(),ae("span",OX,[nt(mt(e.takeName),1)])),[[U(n),{content:e.takeName}]]),k[3]||(k[3]=nt(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Ye("",!0),be("span",{class:ee(q.$style.divider)},null,2)],2),fe(FX,{ids:u.value,"workspace-id":e.workspaceId,"entity-id":e.entityId,variant:y,onUpdated:h},null,8,["ids","workspace-id","entity-id"]),fe(CY,{onUpdate:A,ids:u.value,"workspace-id":e.workspaceId,variant:y,"entity-id":e.entityId},null,8,["ids","workspace-id","entity-id"]),fe(OY,{ids:u.value,"workspace-id":e.workspaceId,"entity-id":e.entityId,variant:y,"row-selected":f.value,onUpdated:p},null,8,["ids","workspace-id","entity-id","row-selected"]),fe(TX,{onUpdate:v,selectedIds:u.value,"workspace-id":e.workspaceId,variant:y,"entity-id":e.entityId},null,8,["selectedIds","workspace-id","entity-id"]),be("span",{class:ee(q.$style.divider)},null,2),We((W(),ae("div",null,[R.value?(W(),Ke(gt,{key:0,class:ee(q.$style["action-button"]),variant:[...y,"icon"],onClick:T,disabled:o.selectRowData.length>40},{default:ye(()=>[fe(at,{src:"PenRuler",class:ee(q.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","disabled"])):Ye("",!0)])),[[U(n),o.selectRowData.length<=40?"Open in Review":"Select fewer than 40 items to open in Review"]]),be("span",{class:ee(q.$style.divider)},null,2),fe(Ak,{placement:"top-end"},{trigger:ye(({open:N,toggle:Q,closeDropdown:ce})=>[We((W(),Ke(gt,{onEscape:ce,actived:N,ref_key:"moreActionRef",ref:z,class:ee(q.$style["action-button"]),variant:[...y,"icon"],loading:te.value,onClick:Pt(Q,["stop"])},{default:ye(()=>[fe(at,{src:"EllipsisVertical",class:ee(q.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","variant","loading","onClick"])),[[U(s),"99999"],[U(n),{content:"More actions"}]])]),content:ye(({visible:N,closeDropdown:Q})=>[(W(),ae(xt,null,xn(b,(ce,xe)=>fe(Zl,Jt({clickable:!0,key:ce.id},{ref_for:!0},ce,{show:N,style:{borderLeft:0},"focus-index":"99999."+xe,onClick:()=>{pe(ce),Q()},onEscape:Q}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1})],2)],2)),[[Ei,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_16qqo_1","left-actions":"_left-actions_16qqo_19","right-actions":"_right-actions_16qqo_20","selection-track":"_selection-track_16qqo_25","close-icon":"_close-icon_16qqo_31","selected-count":"_selected-count_16qqo_35",divider:"_divider_16qqo_41","more-button":"_more-button_16qqo_46",dropdown:"_dropdown_16qqo_50","dropdown-content":"_dropdown-content_16qqo_53",delete:"_delete_16qqo_76","icon-btn":"_icon-btn_16qqo_83","selected-list":"_selected-list_16qqo_87"}}]]),Ga=St(it({name:"LabelRenderer",__name:"LabelRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=So,n=Yt,s=e,o=Z(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:s.value===void 0||s.value===null||s.value==="",clickable:!0})),{argsMain:i}=ms(o),r=Z(()=>{var c,u,d;return!!((c=s.params)!=null&&c.api||(u=s.params)!=null&&u.node||(d=s.params)!=null&&d.context)}),a=Z(()=>{if(s.tooltip){if(typeof s.tooltip=="string")return{content:s.tooltip};if(typeof s.tooltip=="object"&&"display_name"in s.tooltip){const c=s.tooltip,u=document.createElement("div");u.classList.add("tooltip-user-info"),u.style.display="flex",u.style.alignItems="center",u.style.gap="4px";const d=document.createElement("div"),h=fe(bh,{id:c.id,name:c.display_name,profile_image:c.profile_image,size:20,initial:c.initial,color:c.color});$w(h,d);const f=document.createElement("span");f.innerText=c.display_name,f.classList.add("tooltip-user-name");const p=document.createElement("span");p.style.whiteSpace="nowrap",p.innerText="By",u.appendChild(p),u.appendChild(d),u.appendChild(f);const g=document.getElementById("item-table-layout-id");return{content:u,allowHtml:!0,appendTo:g||document.body}}}return{content:void 0}}),l=Z(()=>s.value===void 0);return(c,u)=>We((W(),Ke(vs,Q_(xw(U(i))),{default:ye(()=>[be("span",{class:ee(c.$style["item-table-label-renderer"])},mt(s.value||"-"),3)]),_:1},16)),[[U(t),{isLoading:l.value||!r.value}],[U(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),NX=["placeholder","maxlength"],LX={key:0,class:"wrapper-suffix"},VX=St(it({name:"LabelEditor",__name:"LabelEditor",props:{value:{},placeholder:{default:"Enter name"},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},saveOnBlur:{type:Boolean,default:!0},bordered:{type:Boolean},keyboardFocusing:{type:Boolean}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const s=So,o=Yt,i=e,r=n,a=V(i.value),l=V(null),c=V(null),u=V(i.value||""),d=V(!1),h=V(!1),f=Z(()=>{var x;return{disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((x=i.value)==null?void 0:x.length)===0,inputRef:l,wrapperRef:c,clickable:!0,focused:d.value||i.keyboardFocusing}}),{argsMain:p,isHover:g}=ms(f),v=x=>{const P=document.createElement("div");return P.textContent=x,P.innerHTML},y=()=>u.value!==a.value,b=()=>{h.value=!0,d.value=!1,u.value=a.value,r("update:value",a.value),setTimeout(()=>{h.value=!1},100)},S=()=>{if(!d.value||!l.value)return;const x=v(l.value.value);if(!y()){d.value=!1;return}a.value=x,r("update:value",x),r("enter",x),d.value=!1},C=()=>{h.value||(i.saveOnBlur?S():b(),r("blur",u.value))},E=x=>{var P;if(x.key==="ArrowLeft"||x.key==="ArrowRight"){x.stopPropagation();return}x.ctrlKey&&x.key=="a"||x.key=="A"?(x.stopPropagation(),(P=l.value)==null||P.select()):x.key==="Enter"?(x.preventDefault(),x.stopPropagation(),S()):x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),b())},R=()=>{a.value=i.value,u.value=i.value,d.value=!0,Ct(()=>{var x,P;(x=l.value)==null||x.click(),(P=l.value)==null||P.focus()})},T=()=>{var x;d.value?b():(x=l.value)==null||x.blur(),r("blur",u.value)},A={focus:()=>{R()}};Zt(()=>{var P;const x=(P=c.value)==null?void 0:P.$el;x&&(x.__sceneNameEditor=A)}),Qn(()=>{const x=c.value;x&&delete x.__sceneNameEditor});const O=V(null),I=V(null);t({focus:R,blur:()=>{var x;return(x=l.value)==null?void 0:x.blur()},save:S,cancel:b,focusEditButton:()=>{Ct(()=>{var x;(x=O.value)==null||x.focus()})},focusCancelButton:()=>{Ct(()=>{var x;(x=I.value)==null||x.focus()})},startEdit:R});const D=Z(()=>i.value===void 0);return qb(c,()=>{d.value&&C()}),(x,P)=>We((W(),Ke(U(vs),Jt(U(p),{ref_key:"wrapperRef",ref:c,bordered:i.bordered}),Yd({default:ye(()=>[d.value?Ye("",!0):Tt(x.$slots,"default",{key:0,isEditting:d.value,isHover:U(g)},()=>[We((W(),ae("span",{class:ee(x.$style["label-renderer"])},[nt(mt(u.value),1)],2)),[[U(o),{content:u.value||void 0}]])]),We(be("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":P[0]||(P[0]=M=>u.value=M),class:ee(x.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:E,onBlur:C},null,42,NX),[[Ei,d.value],[v1,u.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:ye(({hovered:M,focused:B})=>[M?(W(),ae("div",LX,[M&&!B?We((W(),Ke(gt,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(R,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:O,onKeydown:[Un(Pt(R,["prevent","stop"]),["enter"]),Un(Pt(T,["prevent","stop"]),["escape"])]},{default:ye(()=>[fe(U(at),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[U(o),"Edit"]]):Ye("",!0)])):Ye("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[U(s),{isLoading:D.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),BX=["tabindex"],Nk=St(it({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const s=Yt,o=So,i=e,r=n,a=V(i.value),l=V(i.value),c=V(null),u=V(null),d=Sn("bulkUpdate",!1),{apiServices:h}=es(!d,i),f=Z(()=>{var z;return{componentType:void 0,disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((z=a==null?void 0:a.value)==null?void 0:z.length)===0,inputRef:c,wrapperRef:u,clickable:!0}}),{isFocus:p}=ms(f),g=Z(()=>{const z=En.getInstance().getItem("ws.code"),pe=En.getInstance().getItem("BASE_URL"),q=z||i.workspaceId;return To({type:"scene_hub",config:{baseDomain:pe,ws_code:q,scene_id:String(i.id)}}).url}),v=Z(()=>{var z,pe,q;return((pe=(z=i.data)==null?void 0:z.isProcessing)==null?void 0:pe.state)==0||((q=i.data)==null?void 0:q.isDeleted)==!0}),y=Z(()=>i.readOnly||R.value),b=Z(()=>{var z,pe,q,k,N;return((z=i.data)==null?void 0:z.isDeleted)==!0||((q=(pe=i.data)==null?void 0:pe.isProcessing)==null?void 0:q.state)==0||((N=(k=i.data)==null?void 0:k.isProcessing)==null?void 0:N.state)==1}),S=Z(()=>{var z,pe;return(pe=(z=i.data)==null?void 0:z.isProcessing)==null?void 0:pe.message}),C=Z(()=>{var z;return((z=i.data)==null?void 0:z.isArchived)==1}),E=Z(()=>{var z;return((z=i.data)==null?void 0:z.isLocked)==1}),R=Z(()=>i.value===void 0),T=async z=>{var pe,q,k,N,Q,ce,xe,ge,de,X;a.value=z,p.value=!1;try{const De=await((q=(pe=h.value)==null?void 0:pe.updateSceneName)==null?void 0:q.call(pe,{workspaceId:i.workspaceId,entityId:i.entityId,itemId:i.id,name:a.value})),re=FF.get(SF)||"UTC";if(De){const Ae=DF(De,re),H={...i.data,...Ae};(k=i.params)==null||k.api.clearFocusedCell();const oe=((Q=(N=i.params)==null?void 0:N.column)==null?void 0:Q.getColId())||"",ve=((xe=(ce=i.params)==null?void 0:ce.node)==null?void 0:xe.rowIndex)||0;(ge=i.params)==null||ge.api.setFocusedCell(ve,oe),(X=(de=i.params)==null?void 0:de.node)==null||X.setData(H),l.value=a.value,r("enter")}else a.value=l.value}catch(De){console.error("Failed to update scene name:",De),a.value=l.value}},A={focus:()=>{p.value=!0,Ct(()=>{var z;return(z=u.value)==null?void 0:z.focus()})},startEdit:()=>{var z;(z=u.value)==null||z.startEdit()}},O=()=>u.value?"$el"in u.value?u.value.$el:u.value:null;Je(()=>i.value,z=>{a.value=z,l.value=z}),Zt(()=>{const z=O();z&&(z.__sceneNameEditor=A)}),Qn(()=>{const z=u.value,pe=z&&"$el"in z?z.$el:z;pe&&delete pe.__sceneNameEditor});const I=qh(),{openSceneHub:D}=I,x=z=>{try{if(z.ctrlKey||z.metaKey){window.open(g.value,"_blank");return}D(String(i.id))}catch{window.open(g.value,"_blank")}finally{ne()}},P=()=>{setTimeout(()=>{te.value=!0,M.value=0,Ct(()=>{var z;(z=B.value)==null||z.focus()})},300)},M=V(-1),B=V(null);t({focus:P,trigerFocus:P,startEdit:()=>{var z;(z=u.value)==null||z.startEdit()}});const Y=z=>{if(z.key==="Enter"){z.preventDefault(),x(z);return}if(z.key==="Escape"){z.preventDefault(),ne();return}z.key==="Tab"&&(z.preventDefault(),z.stopPropagation(),z.stopImmediatePropagation(),Ct(()=>{var pe;(pe=u.value)==null||pe.focusEditButton()}))},ne=()=>{var q,k,N,Q,ce,xe;te.value=!1,M.value=-1,(q=i.params)==null||q.api.clearFocusedCell();const z=((N=(k=i.params)==null?void 0:k.column)==null?void 0:N.getColId())||"",pe=((ce=(Q=i.params)==null?void 0:Q.node)==null?void 0:ce.rowIndex)||0;(xe=i.params)==null||xe.api.setFocusedCell(pe,z)},te=V(!1);return(z,pe)=>We((W(),Ke(VX,{"save-on-blur":!0,ref_key:"wrapperRef",ref:u,disabled:i.disabled,"read-only":y.value,placeholder:i.placeholder,value:a.value,"onUpdate:value":pe[0]||(pe[0]=q=>a.value=q),id:`scene-name-${i.id}`,onEnter:T,"max-length":255,bordered:!0,keyboardFocusing:te.value,onBlur:ne},{default:ye(({isHover:q,isEditting:k})=>[We(be("div",{class:ee(z.$style["scene-name-display"])},[We((W(),ae("a",{tabindex:M.value,ref_key:"nameRef",ref:B,onClick:Pt(x,["prevent"]),onKeydown:Y,target:"_blank",class:ee(z.$style["scene-name-text"])},[nt(mt(a.value),1)],42,BX)),[[U(s),{content:a.value,delay:[1e3,0]}]]),y.value||!q&&!k&&!y.value?(W(),ae(xt,{key:0},[E.value?We((W(),ae("div",{key:0,class:ee([z.$style["icon-processing"],z.$style.isLocked])},[fe(at,{src:"Lock"})],2)),[[U(s),{content:"Locked",delay:[1e3,0]}]]):Ye("",!0),C.value?We((W(),ae("div",{key:1,class:ee([z.$style["icon-processing"],z.$style.archived])},[fe(at,{src:"BoxArchive"})],2)),[[U(s),{content:"Archived",delay:[1e3,0]}]]):Ye("",!0),b.value?We((W(),ae("div",{key:2,class:ee([z.$style["icon-processing"],z.$style.processing,v.value&&z.$style["icon-red"]])},[fe(at,{src:"AnimatedHourglass",color:"inherit"})],2)),[[U(s),S.value]]):Ye("",!0)],64)):Ye("",!0)],2),[[Ei,!U(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[U(o),{isLoading:R.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_16nch_1","scene-name-display":"_scene-name-display_16nch_11","icon-processing":"_icon-processing_16nch_18",archived:"_archived_16nch_28",locked:"_locked_16nch_31",processing:"_processing_16nch_34","icon-red":"_icon-red_16nch_38","scene-name-text":"_scene-name-text_16nch_43"}}]]),cS=St(it({__name:"ButtonDropdown",props:{label:{},value:{},variant:{},options:{default:()=>[]},size:{},placement:{default:"bottom"},disabled:{type:Boolean},readOnly:{type:Boolean},tabIndex:{}},emits:["select","handleClick"],setup(e,{expose:t,emit:n}){const s=Gr,o=V([]),i=e,r=V(null),a=Z(()=>typeof i.size=="number"?`${i.size}px`:{small:"24px",medium:"32px",large:"48px"}[i.size]??"32px"),l=Z(()=>{let y=[];return typeof i.variant=="string"?y.push(i.variant):Array.isArray(i.variant)&&(y=[...i.variant]),[...y,"icon"]}),c=n,{hide:u,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=us({toggleOnClick:!0,offset:[0,0]});function v(y){c("select",y),u()}return qd(()=>{g.value&&g.value.setProps({placement:i.placement})}),t({show:h,hide:u,hideDropdown:()=>{u()},popupRef:p}),Je(d,y=>{var b;y&&((b=p.value)==null||b.focus())}),(y,b)=>(W(),ae("div",{class:ee(y.$style["button-dropdown-wrapper"]),style:ln({"--button-size":a.value})},[be("div",{class:ee(y.$style["button-group"])},[Tt(y.$slots,"prefix"),be("div",{ref_key:"triggerRef",ref:f,class:ee(U(d)?y.$style.open:"")},[Tt(y.$slots,"triggerDropdown",{open:U(d)},()=>[i.readOnly?Ye("",!0):We((W(),Ke(gt,{key:0,onEscape:U(u),ref_key:"mainButton",ref:r,actived:U(d),class:ee(y.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:i.disabled},{default:ye(()=>[Tt(y.$slots,"iconDropdown",{},()=>[fe(at,{class:ee(y.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[U(s),e.tabIndex]])])],2)],2),be("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:ee(y.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(W(!0),ae(xt,null,xn(e.options,(S,C)=>We((W(),Ke(Zl,Jt({ref_for:!0,ref:E=>o.value[C]=E,key:S.value},{ref_for:!0},{...S},{"icon-name":S.icon,onClick:Pt(E=>v(S.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:ye(()=>[nt(mt(S.label),1)]),_:2},1040,["icon-name","onClick"])),[[U(s),`${e.tabIndex}.${C}`]])),128))],2)],6))}}),[["__cssModules",{$style:{"button-dropdown-wrapper":"_button-dropdown-wrapper_1g99p_1","button-group":"_button-group_1g99p_7","overflow-elipsis":"_overflow-elipsis_1g99p_26","button-dropdown-list":"_button-dropdown-list_1g99p_33",show:"_show_1g99p_38","button-dropdown-item":"_button-dropdown-item_1g99p_41","icon-dropdown":"_icon-dropdown_1g99p_48",open:"_open_1g99p_51"}}]]),of=St(it({__name:"CloseBadgeWrapper",props:{disableRemove:{type:Boolean,default:!0},tooltip:{default:"Unassign"}},emits:["clear"],setup(e,{emit:t}){const n=Yt,s=e,o=t,i=a=>{a.preventDefault(),a.stopImmediatePropagation(),a.stopPropagation(),o("clear")},r=Z(()=>({content:s.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(W(),ae("div",{class:ee(a.$style["close-wrapper"])},[e.disableRemove?Ye("",!0):(W(),ae("div",{key:0,class:ee(a.$style["close-button"])},[We((W(),Ke(gt,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:i,size:16,rounded:!0},{default:ye(()=>[fe(at,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[U(n),r.value]])],2)),Tt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_bvkx4_1","close-button":"_close-button_bvkx4_5"}}]]),$X=St(it({name:"AssigneeGroupRenderer",__name:"AssigneeGroupRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},maxVisible:{default:4}},setup(e){const t=Yt,n=So,s=e,{isEditing:o}=_u(s),i=V(s.value),r=V(null),a=V(null),{apiServices:l}=es(!0,s),c=V(!0),u=()=>{c.value=s.value===void 0};Yp(()=>{u()}),Zt(()=>{u()}),Je(()=>s.value,A=>{u()});const d=Z(()=>({disabled:s.disabled,readOnly:s.readOnly,error:s.error,inputRef:r,wrapperRef:a,clickable:!(s.readOnly||c.value),active:o})),{argsMain:h,isHover:f}=ms(d),p=Z(()=>{var A;return((A=i.value)==null?void 0:A.slice(0,s.maxVisible))||[]}),g=Z(()=>{var A;return Math.max(0,(((A=i.value)==null?void 0:A.length)||0)-s.maxVisible)}),v=Z(()=>{var A;return g.value<=0?"":((A=i.value)==null?void 0:A.slice(s.maxVisible).map(O=>O.name).join(", "))||""}),y=Z(()=>p.value.map(A=>({id:A.id,name:A.name,initial:A.initial,avatarId:A.id,profile_image:A.profile_image,color:A.color,size:24,user:A}))),b=Z(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));Je(()=>s.value,A=>{i.value=A},{immediate:!0,deep:!0});const S=async A=>{var I,D,x;await T(A)&&(i.value=(I=i.value)==null?void 0:I.filter(P=>P.id!==A),(x=s.params)==null||x.node.setData({...(D=s.params)==null?void 0:D.node.data,assignees:i.value}))},C=A=>{var I;const O=En.getInstance().getItem("ws.code");return((I=l.value)==null?void 0:I.getUserInformation(O,A))||Promise.resolve(null)},{id:E}=Np(s),R=A=>{var I,D;const O=(D=(I=s.params)==null?void 0:I.api)==null?void 0:D.getRowNode(String(E.value));O==null||O.setDataValue("assignees",Mx(A.assignees))},{removeAssignee:T}=um({...s,entityId:s.entityId,updateRowData:R,value:s.value,errorCallback:()=>{}});return(A,O)=>We((W(),Ke(vs,Jt(U(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:ye(()=>{var I;return[be("div",{class:ee(A.$style.assigneeGroupRenderer)},[((I=i.value)==null?void 0:I.length)===0?(W(),Ke(at,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:ln(b.value)},null,8,["style"])):Ye("",!0),(W(!0),ae(xt,null,xn(y.value,D=>(W(),Ke(of,{key:D.id,"disable-remove":s.readOnly||s.disabled,onClear:x=>S(D.id),style:{marginLeft:"0"}},{default:ye(()=>[fe(Du,{user:D.user,"show-profile":!0,apiUpdateFunction:C,class:ee(A.$style["ib-assignee-avatar"])},null,8,["user","class"])]),_:2},1032,["disable-remove","onClear"]))),128)),g.value>0?We((W(),ae("div",{key:1,class:ee(A.$style["extra-avatars"])},[nt(" +"+mt(g.value),1)],2)),[[U(t),v.value]]):Ye("",!0)],2)]}),_:1},16)),[[U(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{assigneeGroupRenderer:"_assigneeGroupRenderer_14fiu_1","ib-assignee-group-renderer":"_ib-assignee-group-renderer_14fiu_7","ib-assignee-avatar":"_ib-assignee-avatar_14fiu_16","assignee-wrapper":"_assignee-wrapper_14fiu_20","extra-avatars":"_extra-avatars_14fiu_27"}}]]),HX=St(it({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!1},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var R,T;const t=Yt,n=So,s=pb(),o=e,i=V(null),r=V(null),{isEditing:a}=_u(o),l=A=>{if(A){if(typeof A=="string")return A;if(A instanceof Date)return A.toISOString()}},c=Z(()=>o.value===void 0),u=Z(()=>{var A;return(A=o.data)==null?void 0:A.isStarted}),d=Z(()=>{var A;return(A=o.data)==null?void 0:A.isCompleted}),h=Z(()=>!!(o.value&&(o.value[0]||o.value[1]))),f=Z(()=>h.value?o.disabled&&!o.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=Z(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,inputRef:i,wrapperRef:r,clickable:!0,active:a})),{argsMain:g}=ms(p),{startDate:v,endDate:y,startClasses:b,endClasses:S,fullStartDate:C,fullEndDate:E}=v7({start:l((R=o.value)==null?void 0:R[0]),end:l((T=o.value)==null?void 0:T[1]),isStarted:u.value,isEnded:d.value,timezone:o.timezone||s});return(A,O)=>We((W(),Ke(vs,Jt(U(g),{ref_key:"wrapperRef",ref:r,bordered:!0}),{default:ye(()=>[c.value?Ye("",!0):(W(),ae("div",{key:0,class:ee(A.$style.dateRangeRenderer)},[h.value?Ye("",!0):(W(),Ke(at,{key:0,src:"Calendar",class:ee(A.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(W(),ae(xt,{key:1},[We((W(),ae("span",{class:ee([A.$style.dateLabelDisplay,...U(b).map(I=>A.$style[I])])},[nt(mt(U(v)),1)],2)),[[U(t),U(C)]]),O[0]||(O[0]=be("span",null,"→",-1)),We((W(),ae("span",{class:ee([A.$style.dateLabelDisplay,...U(S).map(I=>A.$style[I])])},[nt(mt(U(y)),1)],2)),[[U(t),U(E)]])],64)):Ye("",!0)],2))]),_:1},16)),[[U(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_1hon8_1",calendarIcon:"_calendarIcon_1hon8_7",dateSection:"_dateSection_1hon8_11",dateLabelDisplay:"_dateLabelDisplay_1hon8_18",empty:"_empty_1hon8_28","end-today":"_end-today_1hon8_34",actual:"_actual_1hon8_37","end-tomorrow":"_end-tomorrow_1hon8_40","end-yesterday":"_end-yesterday_1hon8_46","end-past":"_end-past_1hon8_52","end-future":"_end-future_1hon8_58","start-today":"_start-today_1hon8_61","start-tomorrow":"_start-tomorrow_1hon8_67","start-yesterday":"_start-yesterday_1hon8_73","start-past":"_start-past_1hon8_79","start-future":"_start-future_1hon8_85"}}]]),GX=it({__name:"DateRangeEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{default:void 0},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{default:pb()}},emits:["closed"],setup(e,{expose:t,emit:n}){const s=V(null);Zt(()=>{Ct(()=>{s.value&&s.value.focus()})});const o=e,i=n,r=()=>{var y;(y=o.params)==null||y.api.stopEditing(),i("closed")},a=y=>`${vt.fromJSDate(y,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,l=async y=>{await v({startDate:y[0]?a(y[0]):null,dueDate:y[1]?a(y[1]):null})},c=async()=>{await v({startDate:null})},u=async()=>{await v({dueDate:null})},d=async y=>{await v({startDate:y?a(y):null})},h=async y=>{await v({dueDate:y?a(y):null})},f=async()=>{await v({startDate:null,dueDate:null})},p=Sn("bulkUpdate",!1),{apiServices:g}=es(!p,o),v=async y=>{var b,S,C,E,R;try{const T=(b=s.value)==null?void 0:b.getValues(),A=await((C=(S=g.value)==null?void 0:S.changeDate)==null?void 0:C.call(S,{workspaceId:o.workspaceId,itemIds:[o.id],startDate:y.startDate,dueDate:y.dueDate}));A!=null&&A.message&&((R=o.params)==null||R.node.setData({...(E=o.params)==null?void 0:E.node.data,dateRange:T==null?void 0:T.dateRange}))}catch(T){console.error("Failed to update scene name:",T)}};return t({focus:()=>{Ct(()=>{var y;(y=s.value)==null||y.focus()})}}),(y,b)=>(W(),Ke(Dm,Jt(o,{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:u,onClearStart:c,onClosed:r,ref_key:"calendarRef",ref:s}),null,16))}}),UX=St(it({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=V(null),s=V(0);let o=null;Zt(()=>{n.value&&(o=new ResizeObserver(r=>{for(const a of r)s.value=a.contentRect.height}),o.observe(n.value))}),_l(()=>{o&&n.value&&o.unobserve(n.value)});const i=Z(()=>{const r=s.value;return r>120?r-42-36:0});return(r,a)=>(W(),ae("div",{class:ee(r.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[be("div",{class:ee(r.$style["item-header"])},[be("div",{class:ee(r.$style["item-header__left"])},[Tt(r.$slots,"header-left",{},()=>[be("h1",{class:ee(r.$style["item-header__title"])},[Tt(r.$slots,"title",{},()=>[a[0]||(a[0]=nt("Items",-1))])],2)])],2),be("div",{class:ee(r.$style["item-header__spacer"])},null,2),be("div",{class:ee(r.$style["item-header__actions"])},[Tt(r.$slots,"header-actions")],2)],2),Tt(r.$slots,"grid",{availableHeight:i.value}),be("div",{class:ee(r.$style.footer)},[Tt(r.$slots,"footer")],2),Tt(r.$slots,"new-row"),Tt(r.$slots,"bulk-update-actions"),Tt(r.$slots,"snackbar"),Tt(r.$slots,"popup")],2))}}),[["__cssModules",{$style:{"item-table-wrapper":"_item-table-wrapper_1uqb9_1","item-header":"_item-header_1uqb9_14","item-header__left":"_item-header__left_1uqb9_22","item-header__title":"_item-header__title_1uqb9_27","item-header__spacer":"_item-header__spacer_1uqb9_32","item-header__actions":"_item-header__actions_1uqb9_35","main-content":"_main-content_1uqb9_41",sidebar:"_sidebar_1uqb9_48","is-open":"_is-open_1uqb9_64","sidebar-header":"_sidebar-header_1uqb9_68","sidebar-footer":"_sidebar-footer_1uqb9_69","sidebar-content":"_sidebar-content_1uqb9_89",footer:"_footer_1uqb9_94"}}]]),Lk=(e,t)=>{const n=V(Number(e.value.value)),s=Z(()=>e.value.metricConfig),o=Z(()=>{var g,v;const l=s.value,c=t.value,u=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,d=!!e.value.error,h=(l==null?void 0:l.format_type)==="icon",{disabled:f}=e.value;return{pendingCalculation:e.value.value=="N/A"||u&&((g=l==null?void 0:l.metric_type)==null?void 0:g.code)==="formula",isEmpty:u,isError:d,hasPrefix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="prefix",hasSuffix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="suffix",isDropdown:(l==null?void 0:l.format_type)==="dropdown",isFormula:((v=l==null?void 0:l.metric_type)==null?void 0:v.code)==="formula",isLoading:e.value.value===void 0,isRating:h,showActions:c&&!u&&!f}}),i=17,r=Z(()=>{var l;return{maxRating:((l=s.value)==null?void 0:l.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:i}});return{componentState:o,metricConfig:s,ICON_SIZE:i,ratingParams:r,standardNameforIcon:()=>{var c;return(((c=s.value)==null?void 0:c.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},WX=["aria-label"],Vk=St(it({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=So,s=Yt,o=e,i=tw(!1),r=V(null),a=V(null),{isEditing:l}=_u(o),c=Z(()=>{var B,Y;return{value:o.value,metricConfig:((Y=(B=o.params)==null?void 0:B.colDef)==null?void 0:Y.context)||o.config,error:o.error,hovered:i.value,readOnly:o.readOnly,disabled:o.disabled,active:l}}),{componentState:u,metricConfig:d,internalValue:h}=Lk(c,i),f=Z(()=>{var Y,ne;let B=!1;if(["number","formula"].includes(d.value.metric_type.code)){const te=Number(o.value),z=Number((Y=d.value)==null?void 0:Y.format_value);Number.isFinite(z)&&z>=0&&(B=(((ne=te.toString().split(".")[1])==null?void 0:ne.length)||0)>z)}return B}),p=Z(()=>{var B;return!!((B=d.value)!=null&&B.morpheme_value)||u.value.isEmpty||f.value}),g=Z(()=>{var ne,te,z;if(u.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(u.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(u.value.isEmpty)return;const B=O.value,Y=(ne=d.value)==null?void 0:ne.morpheme_type;return Y==="prefix"?`${((te=d.value)==null?void 0:te.morpheme_value)||""} ${B}`.trim():Y==="suffix"?`${B} ${((z=d.value)==null?void 0:z.morpheme_value)||""}`.trim():B}),v=Z(()=>{const{format_type:B,format_value:Y}=d.value;if(B==="dropdown"&&typeof Y=="string"&&Y.startsWith("["))try{return JSON.parse(Y)}catch{return[]}return[]}),y=Z(()=>({disabled:o.disabled,error:u.value.isError,inputRef:r,wrapperRef:a,clickable:!A.value,readOnly:o.readOnly||A.value,isEmpty:u.value.isEmpty})),{argsMain:b,isHover:S}=ms(y),C=(B,Y,ne="en-US")=>new Intl.NumberFormat(ne,{minimumFractionDigits:Y,maximumFractionDigits:Y}).format(B),E=Z(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const B=o.value,{format_type:Y,format_value:ne,mapping:te}=d.value;if(te&&typeof te=="object"&&!Array.isArray(te)){const z=te[`!${B}`];if(z)return z}if(Y==="dropdown"){const z=v.value.find(pe=>String(pe.name)===String(B));if(z)return z.name}if(typeof B=="string"){const z=Number(B);return Number.isNaN(z)?B:B.replace(/[.-]/g,"").length>16?R(B,ne):R(z,ne)}return typeof B=="number"?R(B,ne):String(B)}),R=(B,Y)=>{const ne=Number.parseInt(String(Y)||"2",10),te=Number.isFinite(ne)&&ne>=0?ne:2;try{if(typeof B=="string"){const z=B.split("."),pe=z[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),q=z[1]?z[1].substring(0,te).padEnd(te,"0"):"0".repeat(te);return te>0?`${pe}.${q}`:pe}return C(B,te)}catch(z){return console.error("Error formatting metric value:",z,{num:B,decimals:te}),String(B)}},T=(B,Y)=>{const ne=Number.parseInt(String(Y)||"2",10),te=Number.isFinite(ne)&&ne>=0?ne:2;try{if(typeof B=="string"){const z=B.split("."),pe=z[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),q=z[1]?z[1].length:0,k=Math.max(te,q),N=z[1]?z[1].padEnd(k,"0"):"0".repeat(k);return k>0?`${pe}.${N}`:pe}return new Intl.NumberFormat("en-US",{minimumFractionDigits:te,maximumFractionDigits:20}).format(B)}catch(z){return console.error("Error formatting exact metric value:",z,{num:B,decimals:te}),String(B)}},A=Z(()=>{var B;return((B=d.value)==null?void 0:B.metric_type.code)==="formula"}),O=Z(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const B=o.value,{format_type:Y,format_value:ne,mapping:te}=d.value;if(te&&typeof te=="object"&&!Array.isArray(te)){const z=te[`!${B}`];if(z)return z}if(Y==="dropdown"){const z=v.value.find(pe=>String(pe.name)===String(B));if(z)return z.name}if(typeof B=="string"){const z=Number(B);return Number.isNaN(z)?B:B.replace(/[.-]/g,"").length>16?T(B,ne):T(z,ne)}return typeof B=="number"?T(B,ne):String(B)}),{tooltip:I}=PF(""),D=async B=>{B.stopPropagation(),B.preventDefault(),B.stopImmediatePropagation();try{await navigator.clipboard.writeText(O.value),I.value="Copied",setTimeout(()=>{I.value="Copy"},3e3)}catch(Y){console.error("Failed to copy text:",Y),I.value="Copy failed",setTimeout(()=>{I.value="Copy"},3e3)}};Je(()=>o.value,(B,Y)=>{const ne=Number(B);Number.isFinite(ne)&&ne!==h.value?h.value=ne:B==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const P=()=>{i.value=!0},M=()=>{i.value=!1};return(B,Y)=>We((W(),Ke(vs,Jt(U(b),{onMouseenter:P,style:{"--icon-size":"24px"},onMouseleave:M,ref_key:"wrapperRef",ref:a,actived:U(l),bordered:!0}),{suffix:ye(()=>[o.disabled?Ye("",!0):(W(),ae("div",{key:0,class:ee([B.$style.suffix,"wrapper-suffix"])},[i.value&&!U(u).isEmpty&&!U(u).isError?We((W(),Ke(gt,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(D,["prevent","stop"])},{default:ye(()=>[fe(at,{src:"Copy",source:"remote",size:12})]),_:1})),[[U(s),{content:U(I),hideOnClick:!1,contentClass:"extra-padding"}]]):Ye("",!0)],2))]),default:ye(()=>[be("div",{class:ee(B.$style["metric-wrapper"]),"aria-label":U(d).format_value||void 0},[be("div",{class:ee([B.$style["metric-content"],o.disabled?B.$style.disabled:""])},[!U(u).isError&&U(u).isEmpty?(W(),ae(xt,{key:0},[U(u).pendingCalculation?We((W(),ae("span",{key:0,class:ee(B.$style["metric-empty"])},[...Y[0]||(Y[0]=[nt(" - ",-1)])],2)),[[U(s),"Can’t calculate yet. Complete required fields."]]):U(u).isEmpty?(W(),ae("span",{key:1,class:ee(B.$style["metric-empty"])}," - ",2)):Ye("",!0)],64)):Ye("",!0),U(u).isError?We((W(),ae("div",{key:1,class:ee(B.$style["metric-error"])},[...Y[1]||(Y[1]=[nt(" Error ",-1)])],2)),[[U(s),"Something went wrong. Review formula, inputs and retry."]]):Ye("",!0),!U(u).isEmpty&&!U(u).isError?We((W(),ae("span",{key:2,class:ee([B.$style["metric-value"],U(S)?B.$style.hovered:"",{[B.$style.disabled]:o.disabled}])},[nt(mt(E.value),1)],2)),[[U(s),{content:g.value,bypassOverflowCheck:p.value}]]):Ye("",!0)],2)],10,WX)]),_:1},16,["actived"])),[[U(n),{isLoading:U(u).isLoading}]])}}),[["__cssModules",{$style:{"metric-wrapper":"_metric-wrapper_7otc0_1","metric-content":"_metric-content_7otc0_5",disabled:"_disabled_7otc0_15","metric-value":"_metric-value_7otc0_19",hovered:"_hovered_7otc0_19","metric-error":"_metric-error_7otc0_23","with-morpheme":"_with-morpheme_7otc0_38","with-formula-icon":"_with-formula-icon_7otc0_41","metric-value--number":"_metric-value--number_7otc0_47","metric-value--currency":"_metric-value--currency_7otc0_47","metric-value--percentage":"_metric-value--percentage_7otc0_47","metric-morpheme":"_metric-morpheme_7otc0_51","metric-empty":"_metric-empty_7otc0_64","metric-icon":"_metric-icon_7otc0_71"}}]]),zX={key:0,style:{color:"#6b6b6b"}},jX=St(it({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue"],setup(e,{emit:t}){const n=Yt,s={START_ASC:{value:"start_asc",label:"Soonest to furthest start",id:"start_asc"},START_DESC:{value:"start_desc",label:"Furthest to soonest start",id:"start_desc"},DUE_ASC:{value:"due_asc",label:"Soonest to furthest due",id:"due_asc"},DUE_DESC:{value:"due_desc",label:"Furthest to soonest due",id:"due_desc"}},o={desc:{value:"desc",label:"Newest to oldest",id:"desc"},asc:{value:"asc",label:"Oldest to newest",id:"asc"}},i={asc:{value:"asc",label:"Smallest to largest",id:"asc"},desc:{value:"desc",label:"Largest to smallest",id:"desc"}},r={asc:{value:"asc",label:"Ascending",id:"asc"},desc:{value:"desc",label:"Descending",id:"desc"}},a=e,l={assignees:"default",completedOn:"date",dateRange:"dateRange",id:"number",isArchived:"default",isCompleted:"default",isDeleted:"default",isProcessing:"default",isStarted:"default",lastUpdated:"date",name:"default",status:"default",permissions:"default",options:"default",disabled:"number"},c=Z(()=>{var x,P;if(a.headerType)return a.headerType;if(((P=(x=a.params)==null?void 0:x.column)==null?void 0:P.getColId()).includes("metric"))return"default";const D=a.headerType??a.params.column.getColId();return l[D]||"default"}),u=V(),d=()=>{var D,x,P;const I=(x=(D=a.params)==null?void 0:D.column)==null?void 0:x.getColDef();if((P=I.colId)!=null&&P.includes("metric")){if(I.context.is_primary==1)return"primary";if(I.context.is_point_metric==1)return"secondary"}};qd(()=>{u.value=d()}),Zt(()=>{u.value=d()});const h=Z(()=>{var I,D;return((D=(I=a.params)==null?void 0:I.column.getColDef().context)==null?void 0:D.morpheme_value)||void 0}),f=Z(()=>{var I;return(I=a.params)==null?void 0:I.displayName}),p=Z(()=>{let I=[];switch(c.value){case"dateRange":I=Object.values(s).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;case"date":I=Object.values(o).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;case"number":I=Object.values(i).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;default:I=Object.values(r).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break}return v.value!=="none"&&I.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:T.value=="none"}),I}),g=Z(()=>String(v.value).endsWith("asc")?"SortUp":String(v.value).endsWith("desc")?"SortDown":"Sort"),v=V(a.modelValue??"none"),y=I=>{E("update:modelValue",I),E("sort-changed",I)},b=I=>{v.value=I},S=Ri(()=>{if(c.value==="date"||c.value==="default"||c.value==="number"){let I;v.value==="none"?I="asc":v.value==="asc"?I="desc":I="none",v.value=I}else{const I=[s.START_ASC.value,s.START_DESC.value,s.DUE_ASC.value,s.DUE_DESC.value,"none"],x=(I.indexOf(v.value)+1)%I.length;v.value=I[x]}},sr),C=Z(()=>{if(v.value==="none")return"No sorting applied";const I=p.value.find(D=>D.value===v.value);return(I==null?void 0:I.label)||""}),E=t,R=Z(()=>{if(a.disabled&&!a.readOnly)return"var(--disabled-color)";if(v.value!=="none")return"var(--primary-color-hover)"});Je(()=>a.modelValue,I=>{I!=v.value&&(v.value=I)}),Je(v,I=>{I!==a.modelValue&&y(I)});const T=V(v.value);Je(()=>v.value,I=>{T.value=I});const A=I=>{var M,B;if(a.readOnly||a.disabled)return;let D=0;I.key==="ArrowDown"?D=1:I.key==="ArrowUp"&&(D=-1);const x=p.value.findIndex(Y=>Y.value===T.value),P=p.value.length;if(I.key==="Enter"||I.key===" ")I.preventDefault(),v.value=T.value,(M=O.value)==null||M.hide();else if(D!==0){I.preventDefault();let Y=(x+D+P)%P;T.value=p.value[Y].value}else I.key==="Escape"&&((B=O.value)==null||B.hide())},O=V(null);return Zt(()=>{var I,D;(D=(I=O.value)==null?void 0:I.$el)==null||D.addEventListener("keydown",A)}),_l(()=>{var I,D;(D=(I=O.value)==null?void 0:I.$el)==null||D.removeEventListener("keydown",A)}),(I,D)=>(W(),Ke(cS,{ref_key:"dropdownRef",ref:O,options:p.value,label:f.value,readOnly:a.readOnly,disabled:a.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:U(S),onSelect:D[0]||(D[0]=x=>b(x))},{prefix:ye(()=>[fe(gt,{variant:["text"],onClick:U(S),size:"small"},{default:ye(()=>[We((W(),ae("b",null,[nt(mt(f.value),1)])),[[U(n),{content:f.value}]]),h.value?(W(),ae("small",zX," ("+mt(h.value)+") ",1)):Ye("",!0),u.value=="primary"?We((W(),ae("div",{key:1,class:ee(I.$style["icon-metric"])},[fe(at,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[U(n),"Woohoo metric"]]):Ye("",!0),u.value=="secondary"?We((W(),ae("div",{key:2,class:ee(I.$style["icon-metric"])},[fe(at,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[U(n),"Point Metric"]]):Ye("",!0)]),_:1},8,["onClick"])]),iconDropdown:ye(()=>[We(fe(at,{src:g.value,source:"remote",color:R.value},null,8,["src","color"]),[[U(n),C.value]])]),_:1},8,["options","label","readOnly","disabled","onHandleClick"]))}}),[["__cssModules",{$style:{"icon-metric":"_icon-metric_nh30n_1",iconSorting:"_iconSorting_nh30n_9","button-group":"_button-group_nh30n_15","ab-table-button":"_ab-table-button_nh30n_26","button-main":"_button-main_nh30n_32","button-dropdown-trigger":"_button-dropdown-trigger_nh30n_37",headerSorting:"_headerSorting_nh30n_47"}}]]),KX=["disabled","readonly","checked","indeterminate"],Bk=St(it({__name:"Checkbox",props:{modelValue:{},disabled:{type:Boolean},readOnly:{type:Boolean},focusIndex:{},tooltipText:{},allowIndeterminate:{type:Boolean},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=Yt,s=Gr,o=e,i=t,r=Z(()=>{if(typeof o.size=="string"){if(["small","medium","large"].includes(o.size))switch(o.size){case"small":return"14px";case"large":return"24px";case"medium":default:return"20px"}if(o.size.endsWith("px"))return o.size}return typeof o.size=="number"?`${o.size}px`:"20px"}),a=Z(()=>o.allowIndeterminate?[$t.UNCHECK,$t.INDETERMINATE,$t.CHECKED]:[$t.UNCHECK,$t.CHECKED]),l=Z(()=>{if(typeof o.tooltipText=="string"||!o.tooltipText)return o.tooltipText||"";switch(u.value){case $t.UNCHECK:return o.tooltipText.unchecked;case $t.INDETERMINATE:return o.tooltipText.indeterminate;case $t.CHECKED:return o.tooltipText.checked;default:return""}}),c=()=>{if(h.value)return;const p=(a.value.indexOf(u.value)+1)%a.value.length;u.value=a.value[p]},u=V(typeof o.modelValue=="boolean"?o.modelValue?$t.CHECKED:$t.UNCHECK:o.modelValue),d=Z(()=>({checked:u.value===$t.CHECKED,indeterminate:u.value===$t.INDETERMINATE,none:u.value===$t.UNCHECK})),h=Z(()=>o.disabled||o.readOnly);return Je(()=>u.value,f=>{i("update:modelValue",f===$t.CHECKED)}),(f,p)=>We((W(),ae("input",{disabled:o.disabled,key:u.value,readonly:o.readOnly,type:"checkbox",class:ee([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:c,"aria-label":"Select All Items",style:ln({"--input-size":r.value})},null,46,KX)),[[U(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[U(s),o.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_npdz3_84",large:"_large_npdz3_87",medium:"_medium_npdz3_90"}}]]),qX=St(it({name:"HeaderCheckbox",__name:"HeaderCheckbox",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=e,n=Yt,s=Vm(),{setSelectionStatus:o}=s,{rowCount:i,selectionStatus:r}=Xs(s),a=V(new Set);Je(r,C=>{o(C)},{immediate:!0});const l=Z(()=>r.value!==$t.UNCHECK),c=Z(()=>({checked:r.value===$t.CHECKED,indeterminate:r.value===$t.INDETERMINATE,UNCHECK:r.value===$t.UNCHECK})),u=Z(()=>({[$t.UNCHECK]:"Click to select all",[$t.INDETERMINATE]:"Click to clear selection",[$t.CHECKED]:"Click to clear selection"})[r.value]||"Select items"),d=Z(()=>{const C=[{label:"Select all",value:"INDETERMINATE",type:"text",clickable:!0,id:"indeterminate"}];return l.value&&C.push({label:"None",value:"UNCHECK",type:"text",clickable:!0,id:"uncheck"}),C}),h=C=>({selected:C.getSelectedRows().length,total:i.value.total,loaded:i.value.loaded}),f=({api:C,state:E})=>{if(C)if(E===$t.UNCHECK)C.deselectAll(),a.value.clear(),r.value=E;else if(E===$t.CHECKED){const R=new Set;C.forEachNode(T=>{T.isSelected()&&R.add(T.id||"")}),a.value=R,C.forEachNode(T=>T.setSelected(!0)),r.value=E}else C.forEachNode(R=>R.setSelected(!0)),r.value=E},p=()=>{var R;const C=(R=t.params)==null?void 0:R.api;if(!C){console.error("[HeaderCheckbox] There is no API available");return}const E={[$t.UNCHECK]:$t.INDETERMINATE,[$t.INDETERMINATE]:$t.UNCHECK,[$t.CHECKED]:$t.UNCHECK};f({api:C,state:E[r.value]})},g=C=>{var T;const E=(T=t.params)==null?void 0:T.api;if(!E){console.error("no api");return}const R={INDETERMINATE:$t.INDETERMINATE,GLOBAL:$t.CHECKED,UNCHECK:$t.UNCHECK};f({api:E,state:R[C]})},v=Ri(C=>{const{selected:E,total:R}=h(C);if(R==0){r.value=$t.UNCHECK;return}E===R?r.value=$t.CHECKED:E===0?r.value=$t.UNCHECK:r.value=$t.INDETERMINATE},300);let y=[];const b=C=>{v(C)};Zt(()=>{var A;const C=(A=t.params)==null?void 0:A.api;if(!C)return;const E=O=>v(O.api),R=()=>b(C),T=()=>b(C);C.addEventListener("selectionChanged",E),C.addEventListener("rowDataUpdated",R),C.addEventListener("modelUpdated",R),y=[()=>C.removeEventListener("selectionChanged",E),()=>C.removeEventListener("rowDataUpdated",R),()=>C.removeEventListener("modelUpdated",T)]}),Qn(()=>{y.forEach(C=>C())});const S=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(C,E)=>(W(),Ke(cS,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:ye(()=>[We((W(),Ke(Bk,{"tab-index":"8",id:S,disabled:t.disabled,key:U(r),readonly:t.readOnly,type:"checkbox",checked:c.value.checked,indeterminate:c.value.indeterminate,modelValue:U(r),"onUpdate:modelValue":E[0]||(E[0]=R=>pn(r)?r.value=R:null),onChange:p,"aria-label":U(r)===U($t).CHECKED?"All items selected":"Select visible items",class:ee(C.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[U(n),{content:u.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_uj7ro_1","button-group":"_button-group_uj7ro_62","button-main":"_button-main_uj7ro_62",headerCheckbox:"_headerCheckbox_uj7ro_66"}}]]),YX={key:1},ZX=St(it({name:"StatusRenderer",__name:"StatusRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=So,n=Yt,s=e,{isEditing:o}=_u(s),i=V(null),r=V(null),a=Z(()=>s.value),l=Z(()=>a.value===void 0),c=Z(()=>{var g;return((g=a.value)==null?void 0:g.name)||"No status"}),u=Z(()=>{var g;return{disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:sj((g=a.value)==null?void 0:g.label),inputRef:i,wrapperRef:r,clickable:!s.disabled&&!s.readOnly,active:o}}),{argsMain:d,isHover:h}=ms(u),f=Z(()=>{var g;return((g=a.value)==null?void 0:g.color)||"red"}),p=Z(()=>new Mn(f.value).isLight()?"#000":"#fff");return(g,v)=>We((W(),Ke(U(vs),Jt(U(d),{ref_key:"wrapperRef",ref:r,bordered:!0,style:{background:`${f.value} !important`,color:p.value,"--border-color":!U(o)&&!U(h)?"#f3f5f8":void 0}}),{default:ye(()=>[l.value?Ye("",!0):(W(),ae("div",{key:0,class:ee(g.$style["status-renderer"])},[a.value?We((W(),ae("div",{key:0,class:ee(g.$style["status-renderer__status-name"])},[nt(mt(c.value),1)],2)),[[U(n),{content:c.value,delay:[1e3,0]}]]):l.value?Ye("",!0):(W(),ae("div",YX,"No status"))],2))]),_:1},16,["style"])),[[U(t),{isLoading:l.value}]])}}),[["__cssModules",{$style:{"status-renderer":"_status-renderer_108pu_1","status-renderer__color-code":"_status-renderer__color-code_108pu_10","status-renderer__status-name":"_status-renderer__status-name_108pu_20"}}]]),$k=St(it({__name:"PopupLayout",props:{popupName:{},showOverlay:{type:Boolean,default:!0},overlayOpacity:{default:.5},closeOnOverlayClick:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0}},emits:["shown","hidden"],setup(e,{expose:t,emit:n}){const s=e,{popupRef:o,show:i,hide:r,isVisible:a}=E7({useTrigger:!1,arrow:!1,centered:!0,showOverlay:s.showOverlay,overlayOpacity:s.overlayOpacity,closeOnOverlayClick:s.closeOnOverlayClick,appendTo(u){return document.body}}),l=u=>{s.closeOnEscape&&u.key==="Escape"&&a.value&&r()};Zt(()=>{document.addEventListener("keydown",l)}),Qn(()=>{document.removeEventListener("keydown",l)}),t({show:i,hide:r,isVisible:a});const c=n;return Je(()=>a.value,u=>{c(u?"shown":"hidden")}),(u,d)=>{const h=wo("tooltip");return W(),ae("div",{ref_key:"popupRef",ref:o,class:ee(u.$style.popupContainer)},[be("div",{class:ee(u.$style.popupWrapper)},[be("div",{class:ee(u.$style.header)},[be("span",{class:ee(u.$style["header-title"])},mt(e.popupName),3),We((W(),Ke(gt,{style:{position:"absolute",top:"0",right:"0"},variant:"text",onClick:U(r),"aria-label":"Close popup"},{default:ye(()=>[fe(at,{src:"Xmark"})]),_:1},8,["onClick"])),[[h,"Close"]])],2),be("div",{class:ee(u.$style.body)},[Tt(u.$slots,"default")],2),be("div",{class:ee(u.$style.footer)},[Tt(u.$slots,"footer")],2)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_73gw5_1",popupWrapper:"_popupWrapper_73gw5_5",popupFadeIn:"_popupFadeIn_73gw5_1",header:"_header_73gw5_19","header-title":"_header-title_73gw5_28",body:"_body_73gw5_38",footer:"_footer_73gw5_43"}}]]),XX={...{list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch basic information."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{success:"Deletion successful.",error:"Deletion failed. Please try again."},delete_thumbnail:{success:"Deletion successful.",error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{success:"Deletion successful.",error:"Deletion failed. Please try again."},bulkArchive:{success:"Archive successful.",error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."},createNewItem:{},getAssignableAssignees:{},getAssignableStatuses:{},getFilterStatuses:{}},offline:{error:"You are currently offline. Please check your network connection."}};class JX extends Error{}class Ua extends JX{constructor(){super("Zone is an abstract class")}}class Hk{get type(){throw new Ua}get name(){throw new Ua}get ianaName(){return this.name}get isUniversal(){throw new Ua}offsetName(t,n){throw new Ua}formatOffset(t,n){throw new Ua}offset(t){throw new Ua}equals(t){throw new Ua}get isValid(){throw new Ua}}const uS=new Map;function QX(e){let t=uS.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),uS.set(e,t)),t}const eJ={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function tJ(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,r,a,l,c,u]=s;return[r,o,i,a,l,c,u]}function nJ(e,t){const n=e.formatToParts(t),s=[];for(let o=0;o<n.length;o++){const{type:i,value:r}=n[o],a=eJ[i];i==="era"?s[a]=r:$m(a)||(s[a]=parseInt(r,10))}return s}const dS=new Map;class Bm extends Hk{static create(t){let n=dS.get(t);return n===void 0&&dS.set(t,n=new Bm(t)),n}static resetCache(){dS.clear(),uS.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Bm.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return iJ(t,n,s,this.name)}formatOffset(t,n){return Gm(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const s=QX(this.name);let[o,i,r,a,l,c,u]=s.formatToParts?nJ(s,n):tJ(s,n);a==="BC"&&(o=-Math.abs(o)+1);const h=oJ({year:o,month:i,day:r,hour:l===24?0:l,minute:c,second:u,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let hS=null;class Pu extends Hk{static get utcInstance(){return hS===null&&(hS=new Pu(0)),hS}static instance(t){return t===0?Pu.utcInstance:new Pu(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Pu(Uk(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Gm(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Gm(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Gm(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function $m(e){return typeof e>"u"}function Hm(e,t=2){const n=e<0;let s;return n?s="-"+(""+-e).padStart(t,"0"):s=(""+e).padStart(t,"0"),s}function Gk(e){if(!($m(e)||e===null||e===""))return parseInt(e,10)}function sJ(e){if(!($m(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function oJ(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function iJ(e,t,n,s=null){const o=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const r={timeZoneName:t,...i},a=new Intl.DateTimeFormat(n,r).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Uk(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const s=parseInt(t,10)||0,o=n<0||Object.is(n,-0)?-s:s;return n*60+o}function Gm(e,t){const n=Math.trunc(Math.abs(e/60)),s=Math.trunc(Math.abs(e%60)),o=e>=0?"+":"-";switch(t){case"short":return`${o}${Hm(n,2)}:${Hm(s,2)}`;case"narrow":return`${o}${n}${s>0?`:${s}`:""}`;case"techie":return`${o}${Hm(n,2)}${Hm(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const Wk=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Au(...e){const t=e.reduce((n,s)=>n+s.source,"");return RegExp(`^${t}$`)}function ku(...e){return t=>e.reduce(([n,s,o],i)=>{const[r,a,l]=i(t,o);return[{...n,...r},a||s,l]},[{},null,1]).slice(0,2)}function zk(...e){return(t,n)=>{const s={};let o;for(o=0;o<e.length;o++)s[e[o]]=Gk(t[n+o]);return[s,null,n+o]}}const jk=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,rJ=`(?:${jk.source}?(?:\\[(${Wk.source})\\])?)?`,Kk=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,qk=RegExp(`${Kk.source}${rJ}`),fS=RegExp(`(?:[Tt]${qk.source})?`),aJ=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,lJ=/(\d{4})-?W(\d\d)(?:-?(\d))?/,cJ=/(\d{4})-?(\d{3})/,uJ=zk("weekYear","weekNumber","weekDay"),dJ=zk("year","ordinal"),hJ=/(\d{4})-(\d\d)-(\d\d)/,Yk=RegExp(`${Kk.source} ?(?:${jk.source}|(${Wk.source}))?`),fJ=RegExp(`(?: ${Yk.source})?`);function Ou(e,t,n){const s=e[t];return $m(s)?n:Gk(s)}function pJ(e,t){return[{year:Ou(e,t),month:Ou(e,t+1,1),day:Ou(e,t+2,1)},null,t+3]}function Mu(e,t){return[{hours:Ou(e,t,0),minutes:Ou(e,t+1,0),seconds:Ou(e,t+2,0),milliseconds:sJ(e[t+3])},null,t+4]}function rf(e,t){const n=!e[t]&&!e[t+1],s=Uk(e[t+1],e[t+2]),o=n?null:Pu.instance(s);return[{},o,t+3]}function af(e,t){const n=e[t]?Bm.create(e[t]):null;return[{},n,t+1]}Au(aJ,fS),Au(lJ,fS),Au(cJ,fS),Au(qk),ku(pJ,Mu,rf,af),ku(uJ,Mu,rf,af),ku(dJ,Mu,rf,af),ku(Mu,rf,af),ku(Mu),Au(hJ,fJ),Au(Yk),ku(Mu,rf,af);function Nu(e){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(e)}var ys;(function(e){e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}"})(ys||(ys={})),ys.review,ys.review_take,ys.review_scene,ys.review_rendition,ys.review_frame,ys.review_rendition_comment,ys.review_comment,ys.scene_hub,ys.hub_rendition,ys.hub_comment,ys.people_insight,ys.people_detail,ys.project,ys.woohoo,ys.update,ys.core,ys.project_focusMode;var pS=null;function gJ(e){pS=e}function Um(){if(!pS)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return pS}function Zk(){try{var e=Um();return e.t("errorMessages.fallback.unknownError")}catch{return"An error occurred. Please try again or contact support."}}function mJ(e,t,n,s){var o=e.replace(/{field}/g,t);if(s&&Nu(s)==="object")Object.keys(s).forEach(function(r){var a="{".concat(r,"}"),l=s[r];Array.isArray(l)?l=l.join(", "):r==="value"&&(s.min||s.max)&&(l="".concat(s.min||s.value," and ").concat(s.max||s.value)),o=o.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var i=n[0]||"";n.length>1?i="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(i=n[0].join(", ")),o=o.replace(/{value}/g,i)}return o}function vJ(e,t){for(var n=Object.keys(t),s=0,o=n;s<o.length;s++){var i=o[s],r=Array.isArray(t[i])?t[i].join(", "):String(t[i]);e=e.replace(new RegExp("\\{".concat(i,"\\}"),"g"),r)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function Xk(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function Jk(e,t){if(!e||Nu(e)!=="object")return null;try{var n=Um();if(e.validation&&e.validation.fields)for(var s=e.validation.fields,o=Object.keys(s),i=0,r=o;i<r.length;i++){var a=r[i],l=s[a];if(l&&l.rule){var c=l.rule,u=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var y,b=t.toUpperCase();v=(y=p[g])===null||y===void 0||(y=y.errorMessages)===null||y===void 0||(y=y[b])===null||y===void 0||(y=y.validation_rules)===null||y===void 0?void 0:y[c]}if(!v){var S;v=(S=p[g])===null||S===void 0||(S=S.errorMessages)===null||S===void 0||(S=S.GEN)===null||S===void 0||(S=S.validation_rules)===null||S===void 0?void 0:S[c]}if(v&&typeof v=="string")return mJ(v,a,u,d)}catch(C){console.error("Error in validation rules",C)}}}}catch(C){return console.error("Error in getValidationErrorMessage:",C),null}return null}function yJ(e){if(!e)return Zk();var t=e.code,n=e.error,s=e.details,o=e.message;if(Xk(s)&&s){var i=Jk(s,n==null?void 0:n.type);if(console.log("[Error Utils Debug]",i),i)return t!==""?"[".concat(t,"] ").concat(i):i;try{var r=Um();return r.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(n&&Nu(n)==="object"&&n.type&&n.key){var a=n.type.toUpperCase();try{var l,c,u,d="errorMessages.".concat(a,".").concat(n.key),h=Um(),f=((l=h.messages)===null||l===void 0?void 0:l.value)||h.messages,p=((c=h.locale)===null||c===void 0?void 0:c.value)||h.locale,g=(u=f[p])===null||u===void 0||(u=u.errorMessages)===null||u===void 0||(u=u[a])===null||u===void 0?void 0:u[n.key];if(g&&typeof g=="string"){var v=g;return s!=null&&s.context&&(v=vJ(v,s.context),console.log("[Error Utils Debug]",v)),t!==""?"[".concat(t,"] ").concat(v):v}}catch(b){console.error("[Error Utils Debug]",b)}}if(n&&Nu(n)!=="object"&&Xk(s)){var y=Jk(s);if(y)return t!==""?"[".concat(t,"] ").concat(y):y}return o||Zk()}var wJ={GEN:{general_error:"General Error",validation_error:"Validation error occurred.",data_locked:"Update failed. Record(s) are locked or currently being updated. You may try again later.",unauthenticated:"Authentication required. Please log in to continue.",unauthorized:"Access denied. You don’t have permission to view this.",not_found:"Resource not found. Check link or try again.",server_error:"Something went wrong on our end. Please try again later.",validation_rules:{required:"The {field} field is required",unique:"The {field} field must be unique",email:"{field} must be a valid email address",emails:"Invalid email(s) pattern",email_exists:"{field} already exists in workspace {value}",regex:"The {field} format is invalid",min:"{field} must be at least {value} characters",max:"{field} cannot exceed {value} characters",between:"{field} must be between {value} characters",numeric:"The {field} must be a number",integer:"The {field} must be an integer",date:"The {field} must be a valid date",after:"The {field} must be after {value}",before:"The {field} must be before {value}",image:"The {field} must be an image",mimes:"The {field} must be a file of type: {value}",max_file_size:"The {field} size cannot exceed {value}MB",confirmed:"The {field} confirmation does not match",same:"The {field} must match {value}",exists:"The Selected {field} is invalid",password_requirements:"The {field} does not meet security requirements",decimal:"Update failed. Maximum allowed decimal places is {value}.",before_or_equal:"{field} must be a date before or equal {value}.",after_or_equal:"{field} must be a date after or equal {value}."}},MRC:{validation_rules:{not_in:"Update failed. These values are not allowed: {value}.",in:"Update failed. Only these values are allowed: {value}.",between:"Update failed. Enter a value between {value}."},excess_decimal_places:"Update failed. Maximum allowed decimal places is {value}."},PPL:{invite_deleted_user:"Invitation failed. Users deleted from the workspace can't be re-invited. Please contact support.",insufficient_seats:"Invitation failed. No seats remaining. Purchase seat(s) to continue."},TM:{NO_ENTITY_TO_UNDEPLOY:"Undeploy failed. No entity specified.",NO_TEAM_EDITOR_ROLE:"No team editor role."},DIR:{has_project_admin_access:"Update failed. User has project access by default.",NO_EDIT_ENTITY_TEAM_ACCESS:"No permission to edit entity team."},AS:{"invalid_field (TBD)":"Something went wrong with account creation. Please contact support."},custom_default_msg:{general:{invalid_data:"Invalid data provided",retry:"Try again later."},network:{offline:"You are currently offline. Please check your network connection.",request_timeout:"Your request has timed out. Please ensure your internet connection is stable.",network_problem:"Network problem. Request timed out. Please try again later.",network_connection_lost:"Network connection lost",gateway_timeout:"Gateway Timeout"},auth:{token_expired:"Token refresh failed"},storage:{storage_limit:"Storage limit exceeded.",thumbnail_size_limit:"Thumbnail picture size can not exceed 2MB!",thumbnail_picture_format:"Thumbnail picture must be image format!",upload_limit:"Your upload exceeds the maximum allowed size"}},fallback:{unknownError:"An error occurred. Please try again or contact support."}};const lf=Yl("toast",()=>{const e=l=>{var c;if((l==null?void 0:l.apiCode)==="offline")o({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const u=yJ((c=l==null?void 0:l.res)==null?void 0:c.data);o({id:l==null?void 0:l.apiCode,type:"error",message:u})}},t=V([]),n=(l,c)=>{const u=XX[l];if(u){const d=u[c];if(d){o({id:l,type:c,message:d});return}}else o({id:l,type:c,message:l})},s=new Map,o=(l,c=5e3)=>{const u={...l,id:l.id??Date.now()+Math.random()};if(t.value.push(u),c>0){const d=Date.now(),h=setTimeout(()=>{i(u.id),s.delete(u.id)},c);s.set(u.id,{timeoutId:h,remainingTime:c,startTime:d})}};function i(l){t.value=t.value.filter(u=>u.id!==l);const c=s.get(l);c&&(clearTimeout(c.timeoutId),s.delete(l))}function r(l){const c=s.get(l);if(c){clearTimeout(c.timeoutId);const u=Date.now()-c.startTime;c.remainingTime=Math.max(0,c.remainingTime-u)}}function a(l){const c=s.get(l);if(c&&c.remainingTime>0){const u=setTimeout(()=>{i(l),s.delete(l)},c.remainingTime);c.timeoutId=u,c.startTime=Date.now()}}return{notifications:t,addNotification:o,removeNotification:i,showMessage:n,showErrorNetMessage:e,pauseAutoDismiss:r,resumeAutoDismiss:a}}),CJ=["onMouseenter","onMouseleave"],bJ=["innerHTML"],SJ=["innerHTML"],EJ=["data-tooltip"],_J={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},RJ=St(it({__name:"Snackbar",setup(e){const t=Yt,n=iU,s=lf(),{removeNotification:o}=s,{notifications:i}=Xs(s),r=f=>f.trim().startsWith("<svg"),a=V("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},c=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},u=V(new Set),d=f=>{var p;u.value.add(f),(p=s.pauseAutoDismiss)==null||p.call(s,f)},h=f=>{var p;u.value.delete(f),(p=s.resumeAutoDismiss)==null||p.call(s,f)};return(f,p)=>(W(),Ke(GG,{name:"list",tag:"div",class:ee(["notification-center",f.$style["notification-wrapper"]])},{default:ye(()=>[(W(!0),ae(xt,null,xn(U(i),g=>{var v;return We((W(),ae("div",{key:g.id,class:ee([f.$style["notification-item"],f.$style[`notification--${g.type||"info"}`],!(g!=null&&g.actions)||((v=g==null?void 0:g.actions)==null?void 0:v.length)==0?f.$style["snackbar-type"]:""]),onMouseenter:y=>d(g.id),onMouseleave:y=>h(g.id)},[be("p",{class:ee(f.$style.snackbar__message)},[be("span",{class:ee(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(W(),Ke(at,{key:0,src:"CircleCheck",source:"remote"})):Ye("",!0),!g.icon&&g.type=="interactive"?(W(),Ke(at,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(W(),Ke(at,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&r(g.icon)?(W(),ae("i",{key:3,class:ee(f.$style["icon-draw"]),innerHTML:g.icon},null,10,bJ)):g.icon&&!r(g.icon)?(W(),Ke(at,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ye("",!0)],2),be("span",{class:ee(f.$style["error-message"])},[be("span",{class:ee(f.$style.message),innerHTML:g.message},null,10,SJ)],2)],2),g.actions?(W(),ae("div",{key:0,class:ee(f.$style["actions-notification"]),"data-notification":"true"},[(W(!0),ae(xt,null,xn(g.actions,y=>(W(),Ke(gt,Jt({key:y.label},{ref_for:!0},y,{onClick:Pt(y.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:ye(()=>[y.btnIcon?(W(),Ke(at,{key:0,src:y.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ye("",!0)]),_:2},1040,["onClick"]))),128))],2)):Ye("",!0),g.type!=="interactive"?We((W(),ae("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[fe(gt,{variant:"secondary",onClick:y=>c(g.message),class:ee(f.$style["copy-btn"])},{prefix:ye(()=>[fe(at,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,EJ)),[[U(t),a.value]]):Ye("",!0),g.type=="interactive"?We((W(),ae("div",_J,[fe(gt,{variant:"tertiary",onClick:y=>U(o)(g.id),class:ee(f.$style["close-btn"]),size:18},{default:ye(()=>[fe(at,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[U(t),"Close"]]):Ye("",!0)],42,CJ)),[[U(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_egqq4_1","notification-item":"_notification-item_egqq4_15","notification--success":"_notification--success_egqq4_30","notification--error":"_notification--error_egqq4_36","close-btn":"_close-btn_egqq4_42","notification--info":"_notification--info_egqq4_45","notification--warning":"_notification--warning_egqq4_52","notification--interactive":"_notification--interactive_egqq4_59","snackbar-type":"_snackbar-type_egqq4_67",snackbar__message:"_snackbar__message_egqq4_76",message:"_message_egqq4_89","error-message":"_error-message_egqq4_97",snackbar__icon:"_snackbar__icon_egqq4_103","actions-notification":"_actions-notification_egqq4_112","icon-draw":"_icon-draw_egqq4_120","copy-btn":"_copy-btn_egqq4_128"}}]]);/*!
|
|
146
|
+
`+i):s.stack=i}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Jl(this.defaults,n);const{transitional:s,paramsSerializer:o,headers:i}=n;s!==void 0&&Nm.assertOptions(s,{silentJSONParsing:rr.transitional(rr.boolean),forcedJSONParsing:rr.transitional(rr.boolean),clarifyTimeoutError:rr.transitional(rr.boolean)},!1),o!=null&&(Be.isFunction(o)?n.paramsSerializer={serialize:o}:Nm.assertOptions(o,{encode:rr.function,serialize:rr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Nm.assertOptions(n,{baseUrl:rr.spelling("baseURL"),withXsrfToken:rr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=i&&Be.merge(i.common,i[n.method]);i&&Be.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=lo.concat(r,i);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,d=0,h;if(!l){const p=[_k.bind(this),void 0];for(p.unshift(...a),p.push(...c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(;d<h;){const p=a[d++],g=a[d++];try{f=p(f)}catch(v){g.call(this,v);break}}try{u=_k.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=Jl(this.defaults,t);const n=fk(t.baseURL,t.url,t.allowAbsoluteUrls);return ok(n,t.params,t.paramsSerializer)}};Be.forEach(["delete","get","head","options"],function(t){Ql.prototype[t]=function(n,s){return this.request(Jl(s||{},{method:t,url:n,data:(s||{}).data}))}}),Be.forEach(["post","put","patch"],function(t){function n(s){return function(i,r,a){return this.request(Jl(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}Ql.prototype[t]=n(),Ql.prototype[t+"Form"]=n(!0)});let gX=class jB{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(o=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](o);s._listeners=null}),this.promise.then=o=>{let i;const r=new Promise(a=>{s.subscribe(a),i=a}).then(o);return r.cancel=function(){s.unsubscribe(i)},r},t(function(i,r,a){s.reason||(s.reason=new Fu(i,r,a),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new jB(function(o){t=o}),cancel:t}}};function mX(e){return function(n){return e.apply(null,n)}}function vX(e){return Be.isObject(e)&&e.isAxiosError===!0}const lS={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(lS).forEach(([e,t])=>{lS[t]=e});function Tk(e){const t=new Ql(e),n=UA(Ql.prototype.request,t);return Be.extend(n,Ql.prototype,t,{allOwnKeys:!0}),Be.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Tk(Jl(e,o))},n}const ts=Tk(ef);ts.Axios=Ql,ts.CanceledError=Fu,ts.CancelToken=gX,ts.isCancel=ck,ts.VERSION=Rk,ts.toFormData=Pm,ts.AxiosError=zt,ts.Cancel=ts.CanceledError,ts.all=function(t){return Promise.all(t)},ts.spread=mX,ts.isAxiosError=vX,ts.mergeConfig=Jl,ts.AxiosHeaders=lo,ts.formToJSON=e=>ak(Be.isHTMLForm(e)?new FormData(e):e),ts.getAdapter=Ek.getAdapter,ts.HttpStatusCode=lS,ts.default=ts;const{Axios:V0e,AxiosError:B0e,CanceledError:$0e,isCancel:H0e,CancelToken:G0e,VERSION:U0e,all:W0e,Cancel:z0e,isAxiosError:yX,spread:j0e,toFormData:K0e,AxiosHeaders:q0e,HttpStatusCode:Y0e,formToJSON:Z0e,getAdapter:X0e,mergeConfig:J0e}=ts,wX=e=>{const n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2){const s=n.pop();return(s==null?void 0:s.split(";").shift())??null}return null},CX=6e4,xk=e=>({[`/api/v1/workspace/${e}/item/2`]:1,[`/api/v1/workspace/${e}/item/2/metrics`]:5,default:5}),Lm=new Map,Ik=e=>{const t=e.match(/\/api\/v1\/workspace\/([^/]+)/);return t?t[1]:null},bX=e=>{const t=Ik(e),n=xk(t||"none"),o=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&o===a)||"default";Lm.has(i)||Lm.set(i,{ongoing:0,queue:[]});const r=Lm.get(i);return new Promise(a=>{r?r.ongoing<n[i]?(r.ongoing++,a()):r.queue.push(()=>{r.ongoing++,a()}):a()})},Fk=e=>{const t=Ik(e),n=xk(t||"none"),o=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&o===a)||"default",r=Lm.get(i);if(r&&(r.ongoing--,r.queue.length>0)){const a=r.queue.shift();setTimeout(()=>{a==null||a()},1e3)}},SX=(()=>{const e=ts.create({timeout:CX,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(async t=>{const n=t.url||"";await bX(n);const s=wX("account.token");return s&&t.headers&&(t.headers.Authorization=`Bearer ${s}`),t.headers&&(t.headers["Access-Control-Allow-Origin"]="*",t.headers["Access-Control-Allow-Headers"]="*",t.headers["Accept-Language"]="*"),t},t=>Promise.reject(t)),e.interceptors.response.use(t=>(Fk(t.config.url||""),t),async t=>{var s,o,i;if(((s=t.response)==null?void 0:s.status)===401){const r=sessionStorage.getItem("BASE_URL")||"";(()=>{const l=`${r}/start`;window.postMessage({type:"TOKEN_EXPIRED",message:"Authentication token has expired"},"*"),window.location.replace(l)})()}if(t.config&&Fk(t.config.url||""),t.code==="ERR_NETWORK"||!navigator.onLine)return Promise.reject(t);const n=t.config;if(((o=t.response)==null?void 0:o.status)===429&&(!n._retryCount||n._retryCount<3)){n._retryCount=(n._retryCount||0)+1;const r=t.response.headers["retry-after"],a=r?parseInt(r)*1e3:Math.pow(2,n._retryCount)*1e3;return await new Promise(l=>setTimeout(l,a)),e(n)}return((i=t.response)==null?void 0:i.status)===401&&!n._retry&&(n._retry=!0),Promise.reject(t)}),e})();class nf extends Error{constructor(t,n,s,o,i){super(t),this.name="ApiError",this.statusCode=n,this.code=s,this.details=o,this.type=i,Object.setPrototypeOf(this,nf.prototype)}}const sf=e=>{var t,n;if(yX(e)){const s=(t=e.response)==null?void 0:t.status,o=(n=e.response)==null?void 0:n.data,i=(o==null?void 0:o.message)||e.message||"An unexpected error occurred",r=(o==null?void 0:o.code)||e.code,a=(o==null?void 0:o.details)||o;let l="UNKNOWN";return!s||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":s>=500?l="SERVER":s===Tu.UNAUTHORIZED||s===Tu.FORBIDDEN?l="AUTH":s===Tu.UNPROCESSABLE_ENTITY||s===Tu.BAD_REQUEST?l="VALIDATION":s>=Tu.BAD_REQUEST&&(l="CLIENT"),new nf(i,s,r,a,l)}return e instanceof Error?new nf(e.message,void 0,void 0,void 0,"UNKNOWN"):new nf("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class EX{constructor(){this.axios=SX}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n??""}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([o,i])=>{i!=null&&i!==""&&(Array.isArray(i)?i.forEach(r=>n.append(o,String(r))):typeof i=="object"?n.append(o,JSON.stringify(i)):n.append(o,String(i)))});const s=n.toString();return s?`?${s}`:""}async get(t="",n,s){try{const o=this.buildUrl(t),i=n?this.buildQueryParams(n):"";return(await this.axios.get(`${o}${i}`,s)).data}catch(o){throw sf(o)}}async post(t="",n,s,o){try{const i=this.buildUrl(t),r=n?this.buildQueryParams(n):"";return(await this.axios.post(`${i}${r}`,s,o)).data}catch(i){throw sf(i)}}async put(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.put(o,n,s)).data}catch(o){throw sf(o)}}async patch(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.patch(o,n,s)).data}catch(o){throw sf(o)}}async delete(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.delete(o,{data:n,...s})).data}catch(o){throw sf(o)}}}const _X=({domainApi:e,wsCode:t,entityId:n})=>({list_cursor:{url:`${e}/v1/workspace/${t}/item/2`,method:"post",code:"list_cursor"},assignedUser:{url:`${e}/v1/workspace/${t}/item/2/assigned-users`,method:"post",code:"assignedUser"},metricValues:{url:`${e}/v1/workspace/${t}/item/2/metrics`,method:"post",code:"metricValues"},multipleAssignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"multipleAssignableUser"},assignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"assignableUser"},assignableStatus:{url:`${e}/v1/workspace/${t}/item/2/assignable-statuses`,method:"post",code:"assignableStatus"},delete_rendition:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-rendition`,method:"delete",code:"delete_rendition"},delete_thumbnail:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-thumbnail`,method:"delete",code:"delete_thumbnail"},archive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"archive_item"},unarchive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"unarchive_item"},removeAssignee:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-assignee`,method:"delete",code:"removeAssignee"},basicInfor:{url:`${e}/v1/workspace/${t}/tile/people/ws-user-roles/{userId}/basic-info`,method:"get",code:"basicInfor"},bulkDelete:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete`,method:"delete",code:"bulkDelete"},bulkArchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkArchive"},bulkDateUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-date-update`,method:"put",code:"bulkDateUpdate"},bulkAssignUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-assignee-update`,method:"put",code:"bulkAssignUpdate"},bulkStatusUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-status-update`,method:"put",code:"bulkStatusUpdate"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"},getPermission:{url:`${e}/v1/workspace/${t}/item/2/permissions`,method:"post",code:"getPermission"},getUserPermission:{url:`${e}/v1/workspace/${t}/permissions`,method:"get",code:"getUserPermission"},bulkUnarchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkUnarchive"},downloadTemplate:{url:`${e}/v1/workspace/${t}/item/2/download-sample`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/v1/workspace/${t}/item/2/import-from-file`,method:"post",code:"importItems"},exportItems:{url:`${e}/v1/workspace/${t}/item/2/export`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/v1/workspace/${t}/item/2/update-from-file`,method:"post",code:"updateFromFile"},metricList:{url:`${e}/workspace/${t}/entities/${n}/metric`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/v1/workspace/${t}/item/2/update`,method:"put",code:"item"},me:{url:`${e}/v1/me`,method:"get",code:"me"},workspaces:{url:`${e}/v1/workspaces`,method:"get",code:"workspaces"},entityUserRoles:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"entityUserRoles"},templateFlowStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"templateFlowStatuses"},createNewItem:{url:`${e}/v1/workspace/${t}/item/2/new?entity_id=${n}`,method:"post",code:"createNewItem"},getAssignableStatuses:{url:`${e}/v1/workspace/${t}/entity/2/assignable-statuses`,method:"get",code:"getAssignableStatuses"},getAssignableAssignees:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"getAssignableAssignees"},getFilterStatuses:{url:`${e}/v1/workspace/${t}/entity/2/statuses`,method:"get",code:"getFilterStatuses"}}),RX=(e,t)=>{const n=new Blob([e]),s=globalThis.URL.createObjectURL(n),o=document.createElement("a");o.href=s,o.download=t,document.body.appendChild(o),o.click(),o.remove(),globalThis.URL.revokeObjectURL(s)};class Pk extends EX{constructor(t,n){const s=n==null?void 0:n.domainApi,o=n==null?void 0:n.wsCode,i=(n==null?void 0:n.entityId)||"";super(),this.events=Object.create(null);const r=_X({domainApi:s,wsCode:o,entityId:i}),a={};Object.entries(r).forEach(([l,c])=>{const u=l;t[u]?a[u]=t[u]:(console.warn(`API config for ${u} is missing, using base config.`),a[u]=c)}),this.apiConfig=a}on(t,n){var s;((s=this.events)[t]??(s[t]=[])).push(n)}off(t,n){const s=this.events[t];s&&(this.events[t]=s.filter(o=>o!==n))}emit(t,...n){const s=this.events[t];s!=null&&s.length&&s.forEach(o=>{try{o(...n)}catch(i){console.error(`Error in event listener for ${t}:`,i)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:s,payload:o,code:i,responseType:r}){var c,u;const a=this.buildHeaders(o);let l;try{if(l=await this.axios.request({method:t,url:n,params:s,data:o,headers:a,responseType:r}),(((c=l.headers)==null?void 0:c["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const h=((u=l.headers)==null?void 0:u["content-disposition"])||"",f=h.includes("filename=")?h.split("filename=")[1]:"exported_items.xlsx";RX(l.data,f)}if(l.status>=400&&l.status<=500)throw new Error(`Client error (${l.status}): ${l.statusText}`);return this.emit("call-api",{apiCode:i,path:n,params:s,payload:o,res:l,success:!0}),l.data}catch(d){throw console.error("API Request Error:",d),d.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:s,payload:o,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:s,payload:o,error:d,success:!1,apiCode:i,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let s=t;return Object.entries(n).forEach(([o,i])=>{s=s.replace(`{${o}}`,String(i))}),s}async request(t,n,s={}){const{url:o,code:i,method:r}=this.apiConfig[t],a=this.generateUrl(o,n);return this._requestHandler({method:r,path:a,params:s.params,payload:s.payload,code:i,responseType:s.responseType})}async getAllItem_cursor(t){var i;const n=t.workspaceId,s={entity_ids:((i=t.entityIds)==null?void 0:i.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,search:t.search||t.q||void 0,include_signature:1,include:"last_updated_by,property,last_completed_by",include_permission:"{include_permission}",assignee_any_ina:(t==null?void 0:t.assignee_any_ina)||"",assignee_all_ina:(t==null?void 0:t.assignee_all_ina)||void 0,with_not_assigned:t.with_not_assigned||void 0,status_ina:t.status_ina||void 0,status_eq:t.status_eq||void 0,start_date_gte:t.start_date_gte||void 0,start_date_lte:t.start_date_lte||void 0,start_date_btw:t.start_date_btw||void 0,due_date_gte:t.due_date_gte||void 0,due_date_lte:t.due_date_lte||void 0,due_date_btw:t.due_date_btw||void 0,condition_combine_type:t.condition_combine_type||"or",preflight_status:t.preflight_status||void 0},o=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:s,payload:{sort_by:o}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},s={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:s,payload:n})}async getMetricList({workspaceId:t,entityId:n,page:s,query:o,per_page:i}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:i||100,page:s||1,name_like:o||void 0}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:s,metric_ids:o}){const i={item_ids:n,metric_ids:o};return this.request("metricValues",{workspaceId:t},{params:{per_page:s,include_permission:1},payload:i})}async multipleAssignableUser(t){const n=t.workspaceId,s=t.itemIds,o={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:s||[]};return this.request("multipleAssignableUser",{workspaceId:n},{payload:o})}async getAssignableStatus(t){const n=t.workspaceId,s={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return this.request("assignableStatus",{workspaceId:n||""},{payload:s})}async updateSceneName({workspaceId:t,entityId:n,itemId:s,name:o}){const i={item_id:s,entity_id:n,name:o,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:s},{payload:i})}async deleteScene(t,n,s){const o={item_ids:[s]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:o})}async deleteThumbnail({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("delete_thumbnail",{workspaceId:t},{payload:o})}async deleteRendition({workspaceId:t,itemIds:n,deleteAll:s=!1,entityId:o}){const i={item_ids:n,delete_all:s?1:void 0,entity_id:o};return!n||n.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:i})}async archiveScene(t,n,s){const o={item_ids:s,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:o})}async changeDate({workspaceId:t,itemIds:n,startDate:s,dueDate:o,entityId:i,filterParams:r}){const a={item_ids:n,start_date:s,due_date:o,entity_id:i};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:r})}async updateAssignee(t){const{workspaceId:n,itemIds:s,userIds:o,entityId:i}=t,r={item_ids:s,ws_user_role_ids:o,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:s,entityId:o}=t,i={item_ids:n,ws_user_role_ids:s,entity_id:o};return!n||n.length===0?(i.item_ids=void 0,i.entity_id=o):(i.item_ids=n,i.entity_id=void 0),i}async removeAssignee(t){const n=this.createUpdateEntityPayload(t);return this.request("removeAssignee",{workspaceId:t.workspaceId},{payload:n,params:t.filterParams})}async replaceAssignee(t){const{workspaceId:n,itemIds:s,userIds:o,entityId:i}=t,r={item_ids:s,ws_user_role_ids:o,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:r})}async addAssignee({workspaceId:t,itemIds:n,userIds:s,entityId:o,filterParams:i}){const r={item_ids:n,ws_user_role_ids:s,entity_id:o};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:r,params:i})}async unAssignAll(t){const{workspaceId:n,entityId:s,itemIds:o,filterParams:i}=t,r={item_ids:o,entity_id:s,ws_user_role_ids:[]};return!o||o.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(s)},{payload:r,params:i})}async updateItemStatus(t){const{workspaceId:n,itemIds:s=[],statusId:o,entityId:i}=t,r={item_ids:s,template_flow_status_id:o};return s.length||(r.item_ids=void 0,r.entity_id=i),this.request("bulkStatusUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkDelete",{workspaceId:t},{payload:o})}async bulkUnarchiveItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,status:1,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkUnarchive",{workspaceId:t},{payload:o})}async bulkArchiveItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,status:0,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkArchive",{workspaceId:t},{payload:o})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:s,metricId:o,value:i,clear:r}=t,a={item_ids:s,metric_id:o,metric_value:i,clear:r??(i==null?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete a.item_ids,a.entity_id=String(t.entityId)):(a.item_ids=s,a.entity_id=void 0),this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams})}async getPermissionForItems({workspaceId:t,itemIds:n}){const s={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:s,params:{per_page:50}})}async unarchiveScene(t,n,s){const o={item_ids:s,status:1};return this.request("unarchive_item",{workspaceId:t,entityId:n},{payload:o})}async getUserPermission(t){return this.request("getUserPermission",{workspaceId:t})}async getEntityDetail(t,n){return this.request("getEntityDetail",{workspaceId:t,entityId:n})}async downloadTemplate(t,n){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async downloadExportedItemsFile(t,n){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async addNewSceneViaImportFile(t,n,s){return this.request("importItems",{workspaceId:t,entityId:n},{payload:s})}async overwriteScenesViaImportFile(t,n,s){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:s})}async getMe(){return this.request("me",{})}async getWorkspaces(t){const n={page:1,per_page:1,"ws_user_role>status_eq":1,include:"owner",include_ws:t};return this.request("workspaces",{},{params:n})}async getEntityUserRoles(t){const{workspaceId:n,page:s,per_page:o,display_name_like:i,entity_ids:r}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:s,per_page:o,display_name_like:i,entity_ids:r}})}async getTemplateFlowStatuses(t){const{workspaceId:n,entityId:s}=t;return this.request("templateFlowStatuses",{workspaceId:n,entityId:s},{params:{per_page:100,page:t.page??1,all:1,name_like:t.name_like}})}async addNewItem(t,n,s){return this.request("createNewItem",{workspaceId:t,entityId:n},{payload:s})}async getFilterStatuses(t,n,s){return this.request("getFilterStatuses",{workspaceId:t,entityId:n},{params:s})}async getAssignableStatuses(t,n){return this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return this.request("getAssignableAssignees",{workspaceId:t},{params:n})}}const DX=(e,t,n,s,o,i,r)=>{const{apiServices:a}=es(n,s),l=V(!1),c=()=>{l.value=!0},u=()=>{Ct(()=>{setTimeout(()=>{l.value=!1},500)})},d=Z(()=>!!(o!=null&&o.value&&(i!=null&&i.value))),h=Sn("filterParams",null);return{isUpdating:l,handleUpdate:async p=>{var v;const g=p.value;c();try{const y={itemIds:e.value.itemIds,metricId:p.id,workspaceId:String(e.value.workspaceId),filterParams:h!=null&&h.value?h.value:void 0};p.value==null?y.clear=1:y.value=g,d.value?(delete y.itemIds,y.entityId=String(s.entityId)):y.itemIds=e.value.itemIds;const b=await((v=a.value)==null?void 0:v.bulkUpdateMetric(y));(b==null?void 0:b.message)=="Done"&&t(p)}catch(y){console.error("Error during bulk metric update:",y)}u()}}},TX=St(it({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{}},emits:["update"],setup(e,{emit:t}){const n=BA(),s=V([]),o=e,i=t,r=V([]),a=V(null),l=te=>{var q,k,N;const z=s.value.findIndex(Q=>Q.id===te.id);a.value=z;const pe=(q=r.value[z])==null?void 0:q.$el;(k=T.value)==null||k.scrollTo(z*30),pe&&pe.scrollIntoView({behavior:"smooth",block:"center"}),c(z),(N=r.value[z])==null||N.show()},c=te=>{a.value=te,r.value.forEach((z,pe)=>{pe!==te&&z&&z.hide()})},u=V(""),d=V(null),{popupRef:h,triggerRef:f,isVisible:p}=us({toggleOnClick:!0,appendTo:d.value||void 0}),g=()=>{u.value="",r.value.forEach(te=>{te==null||te.hide()}),a.value=null},v=Z(()=>o.selectedIds||[]),y=Z(()=>({itemIds:v.value,workspaceId:String(o.workspaceId)})),b=Sn("isSelectAll",V(!1)),S=Sn("bulkUpdate",V(!1)),{handleUpdate:C,isUpdating:E}=DX(y,te=>{i("update",te),g()},!1,o,S,b),R=te=>{g(),Ct(()=>{var z;(z=T.value)==null||z.focus()})},T=V(null);Je(()=>p.value,te=>{var z;te?(z=T.value)==null||z.focus():g()});const A=V(!0),O=V(!0),{apiServices:I}=es(!1,o),D=async(te,z,pe)=>{var q;try{return pe?O.value=!0:A.value=!0,await((q=I.value)==null?void 0:q.getMetricList({workspaceId:o.workspaceId||"",entityId:o.entityId||"",page:te,query:z,per_page:10}))}catch(k){throw console.error("Failed to fetch metric list:",k),k}finally{A.value=!1,O.value=!1}},x=V(0),P=V(!0),M=te=>({id:String(te.id),label:String(te.name),value:String(te.id),description:te.morpheme_value?`${String(te.morpheme_value)}`:"",type:n.checkEditType(te),metricConfig:te}),B=te=>te.filter(z=>!z.formula).filter(z=>{var pe;return((pe=z==null?void 0:z.auth_permission)==null?void 0:pe.permission)==2}).map(M),Y=async()=>{x.value+=1;const te=await D(x.value,u.value,!0);if(te&&te.data){const z=B(te.data);s.value=[...s.value,...z],P.value=te.meta.last_page!=te.meta.current_page}else P.value=!1},ne=async te=>{u.value=te,x.value=1;try{const z=await D(x.value,u.value);z&&z.data?(s.value=B(z.data),P.value=z.meta.last_page!=z.meta.current_page):s.value=[]}catch{s.value=[]}};return Je(()=>p.value,(te,z)=>{te&&z!==te&&ne("")},{immediate:!0,deep:!0}),(te,z)=>(W(),ae("div",{ref_key:"wrapperRef",ref:d},[fe(gt,{class:"action-button",variant:o.variant,ref_key:"triggerRef",ref:f,loading:U(E)},{default:ye(()=>[fe(at,{src:"SquareRootVariable",class:"icon"}),z[1]||(z[1]=nt(" Metric ",-1))]),_:1},8,["variant","loading"]),be("div",{ref_key:"popupRef",ref:h,style:{display:"none","border-radius":"4px"}},[fe(Xr,{ref_key:"searchListRef",ref:T,style:{width:"320px"},options:s.value,loading:A.value,"loading-more":O.value,"selected-id":void 0,"has-more":P.value,onSearch:ne,onSelect:l,onLoadMore:z[0]||(z[0]=()=>Y())},{item:ye(({item:pe,index:q,selectedIndex:k})=>[fe(qY,{ref:N=>r.value[q]=N,label:pe.label,type:pe.type,morpheme:pe.description||"",onFocusOnSearch:R,onOpen:N=>c(q),attachTo:U(h),config:pe.metricConfig,onHandleUpdate:U(C),class:ee(["metric-update-item",{selected:a.value===q||k===q}])},null,8,["label","type","morpheme","onOpen","attachTo","config","onHandleUpdate","class"])]),"extra-item":ye(()=>[...z[2]||(z[2]=[be("div",{style:{width:"250px"}},null,-1)])]),"empty-list":ye(()=>[...z[3]||(z[3]=[nt("No options available.",-1)])]),_:1},8,["options","loading","loading-more","has-more"])],512)],512))}}),[["__scopeId","data-v-635cce1b"]]),Ak=St(it({__name:"DropdownWrapper",props:{placement:{default:"bottom-start"},show:{type:Boolean,default:!1},maxWidth:{default:400}},emits:["open","close"],setup(e,{expose:t,emit:n}){const s=e,o=n,{hide:i,triggerRef:r,popupRef:a,isVisible:l,toggle:c}=us({toggleOnClick:!0,placement:s.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:s.show,maxWidth:s.maxWidth}),u=Z(()=>l.value);Je(l,f=>{o(f?"open":"close")});const d=()=>{i()};t({closeDropdown:d,isOpen:u});const h=f=>{f.key==="Escape"&&a.value&&i()};return Zt(()=>{var p;const f=r.value instanceof HTMLElement?r.value:(p=r.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",h)}),Qn(()=>{var p;const f=r.value instanceof HTMLElement?r.value:(p=r.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",h)}),(f,p)=>(W(),ae("div",{ref_key:"triggerRef",ref:r,class:ee(f.$style["dropdown-wrapper"])},[Tt(f.$slots,"trigger",{open:U(l),toggle:U(c),closeDropdown:d},()=>[be("button",{class:ee(f.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),be("div",{ref_key:"popupRef",ref:a,tabindex:"0",class:ee(f.$style["dropdown-content"]),style:ln({display:U(l)?"block":"none",maxWidth:s.maxWidth?s.maxWidth+"px":"unset"})},[Tt(f.$slots,"content",{closeDropdown:d,visible:U(l)},()=>[be("div",{class:ee(f.$style["dropdown-list"])},null,2)])],6)],2))}}),[["__cssModules",{$style:{"dropdown-wrapper":"_dropdown-wrapper_lghkw_1","dropdown-content":"_dropdown-content_lghkw_5","dropdown-list":"_dropdown-list_lghkw_11"}}]]),Vm=Yl("bulkUpdate",()=>{const e=V($t.UNCHECK),t=yo({loaded:0,total:0}),n=u=>{t.total=u},s=u=>{t.loaded=u},o=yo({isBulkUpdating:!1});function i(u){o.isBulkUpdating=u}const r=V({}),a=u=>{r.value=u},l=(u,d)=>{r.value[u]=d},c=u=>{e.value=u};return{bulkUpdateState:o,setIsBulkUpdating:i,selectionIds:r,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:c,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:s,handelSelectAll:()=>{c($t.CHECKED)}}}),xX={class:"status-label"},kk=St(it({__name:"StatusItem",props:{status:{},selected:{type:Boolean},focused:{type:Boolean},hovered:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=Yt,s=e,o=t,i=a=>{o("select",a)},r=a=>new Mn(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(W(),ae("div",{class:ee(["status-option",{selected:s.selected,focused:s.focused,hovered:s.hovered}]),onClick:l[0]||(l[0]=c=>i(e.status.id))},[be("div",{class:"status-color",style:ln({backgroundColor:e.status.color,borderColor:r(e.status.color)})},null,4),We((W(),ae("div",xX,[Tt(a.$slots,"label",{},()=>[nt(mt(e.status.name),1)],!0)])),[[U(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-aeaa75a4"]]),IX=["innerHTML"],Ok=St(it({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},callback:{type:Function}},emits:["updated","error","cancel","start-update","finish-update"],setup(e,{expose:t,emit:n}){const s={PER_PAGE:50,INITIAL_PAGE:1},o=e,i=n,r=V([]),a=V(!1),l=V(!1),c=V(null),u=V(s.INITIAL_PAGE),d=V(!0),h=V(0),f=V(""),p=Z(()=>{var M;return(M=o.value)==null?void 0:M.id}),g=Z(()=>!!(o.id||o.ids&&o.ids.length>0)),v=M=>({label:M.name,value:M.id,selected:p.value===M.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:M,id:M.id,color:M.color}),y=Z(()=>{const M=new Set;return o.id&&M.add(String(o.id)),o.ids&&o.ids.forEach(B=>{B&&M.add(String(B))}),Array.from(M)}),b=Sn("bulkUpdate",!1),{apiServices:S}=es(!b,o),C=Vm(),{selectionStatus:E}=Xs(C),R=Sn("filterParams",null),T=async(M=s.INITIAL_PAGE,B="",Y=!1)=>{var ne,te,z,pe;if(!g.value){console.error("Missing required props",o);return}Y?l.value=!0:a.value=!0,c.value=null;try{const q={workspaceId:String(o.workspaceId),itemIds:y.value,page:M,perPage:s.PER_PAGE,name_like:B.trim(),...R||{}};if(((ne=S.value)==null?void 0:ne.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const k=await((te=S.value)==null?void 0:te.getAssignableStatus(q));if(!(k!=null&&k.data)){Y||(r.value=[]),d.value=!1;return}const N=k.data.map(v);r.value=Y?[...r.value,...N]:N,h.value=((z=k.meta)==null?void 0:z.total)??k.data.length,d.value=!((pe=k.meta)!=null&&pe.on_last_page),u.value=M}catch(q){console.error("Error fetching statuses:",q),c.value="Failed to load statuses",Y||(r.value=[]),d.value=!1,i("error",c.value)}finally{a.value=!1,l.value=!1}},A=Ri(async M=>{f.value=M,u.value=s.INITIAL_PAGE,await T(s.INITIAL_PAGE,M,!1)},sr),O=async()=>{!d.value||l.value||await T(u.value+1,f.value,!0)},I=()=>{var M;i("cancel"),(M=o.params)==null||M.api.stopEditing()},D=async M=>{var B,Y,ne;if(!g.value){console.error("Missing required props for updating status",o);return}try{const te={workspaceId:String(o.workspaceId),itemIds:y.value,statusId:String(M.value),entityId:String(o.entityId),filterParams:R!=null&&R.value?R==null?void 0:R.value:void 0};if(E.value==$t.CHECKED&&b&&(te.itemIds=void 0,te.entityId=String(o.entityId)),i("start-update"),!await S.value.updateItemStatus(te))throw new Error("Status update failed: empty response");const pe={workspaceId:String(o.workspaceId),itemIds:y.value,data:{id:M.id,name:M.label,color:M.color}};i("updated",pe),o.params&&((Y=o.params)==null||Y.node.setData({...(B=o.params)==null?void 0:B.node.data,status:{id:M.id,name:M.label,color:M.color}}),(ne=o.params)==null||ne.api.stopEditing())}catch(te){console.error("Error updating status:",te),c.value="Failed to update status",i("error",c.value)}finally{i("finish-update")}},x=Z(()=>r.value.map(M=>({...M})));Je([()=>o.id,()=>o.workspaceId,()=>o.ids],()=>{T()},{deep:!0,immediate:!0});const P=V(null);return Zt(()=>{Ct(()=>{var M;(M=P.value)==null||M.focus()})}),t({refresh:()=>T(s.INITIAL_PAGE,f.value,!1),loadMore:O,focus:()=>{var M;return(M=P.value)==null?void 0:M.focus()}}),(M,B)=>{var Y;return W(),Ke(Xr,Jt({ref_key:"popupRef",ref:P},o,{"selected-id":(Y=o.value)==null?void 0:Y.id,options:x.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:c.value,onSearch:U(A),onSelect:D,onLoadMore:O,onCancel:I,onClose:I}),{item:ye(({item:ne,selectedIndex:te,isSelected:z,handleItemHover:pe,getHighlightedLabel:q,query:k,idx:N})=>[(W(),Ke(kk,{key:ne.value,status:ne.data,selected:z(ne),onMouseover:Q=>pe(N),onSelect:Q=>D(ne),hovered:N===te},{label:ye(()=>[k?(W(),ae("span",{key:0,class:ee([M.$style["item-label"],M.$style.match]),style:{flex:"1"},innerHTML:q(ne.label)},null,10,IX)):(W(),ae("span",{key:1,class:ee(M.$style["item-label"]),style:{flex:"1"}},mt(ne.label),3))]),_:2},1032,["status","selected","onMouseover","onSelect","hovered"]))]),_:1},16,["selected-id","options","loading","loading-more","has-more","error","onSearch"])}}}),[["__cssModules",{$style:{"item-label":"_item-label_7ir12_1"}}]]),FX=it({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{}},emits:["updated"],setup(e,{emit:t}){const n=e,s=Z(()=>{const v=bs();return v==null?void 0:v.appContext.config.globalProperties.apiServices}),{popupRef:o,triggerRef:i,isVisible:r,hide:a}=us({toggleOnClick:!0}),l=t,c=V(!1),u=v=>{c.value=!1,l("updated",v),setTimeout(()=>{a()},700)},d=Z(()=>({apiServices:s.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId})),h=V(null),f=v=>{v.key==="Escape"&&o.value&&a()};Zt(()=>{var y;const v=h.value instanceof HTMLElement?h.value:(y=h.value)==null?void 0:y.$el;v&&v.addEventListener("keydown",f)}),Qn(()=>{var y;const v=h.value instanceof HTMLElement?h.value:(y=h.value)==null?void 0:y.$el;v&&v.removeEventListener("keydown",f)}),Ki("bulkUpdate",!0);const p=v=>{c.value=v},g=V(null);return Je(r,v=>{var y;v&&((y=g.value)==null||y.focus())}),(v,y)=>(W(),ae("div",{ref_key:"mainRef",ref:h},[fe(gt,{ref_key:"triggerRef",ref:i,variant:e.variant,loading:c.value},{default:ye(()=>[fe(at,{src:"Square",class:"icon"}),y[3]||(y[3]=nt(" Status ",-1))]),_:1},8,["variant","loading"]),be("div",{ref_key:"popupRef",ref:o},[We(fe(Ok,Jt({ref_key:"statusRef",ref:g},d.value,{onUpdated:u,onCancel:U(a),onStartUpdate:y[0]||(y[0]=b=>p(!0)),onFinishUpdate:y[1]||(y[1]=b=>p(!1)),onError:y[2]||(y[2]=b=>p(!1)),callback:()=>p(!1)}),null,16,["onCancel","callback"]),[[Ei,U(r)]])],512)],512))}}),Mk=St(it({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0},focusableIndex:{}},emits:["actionExecuted"],setup(e,{expose:t,emit:n}){const s=Gr,o=e,i=Z(()=>(o==null?void 0:o.workspaceId)||""),r=Z(()=>(o==null?void 0:o.entityId)||""),a=()=>{var M,B,Y;return(Y=(M=o.params)==null?void 0:M.api)==null?void 0:Y.getCellRendererInstances({columns:["options"],rowNodes:(B=o.params)!=null&&B.node?[o.params.node]:[]})[0]},l=()=>{var B,Y,ne,te;const M=a();(Y=(B=M==null?void 0:M.componsenExposed)==null?void 0:B.blur)==null||Y.call(B),(te=(ne=M==null?void 0:M.container)==null?void 0:ne.parentElement)==null||te.classList.remove("ag-cell-focus")},c=()=>{var Y,ne,te;(ne=(Y=o.params)==null?void 0:Y.api)==null||ne.stopEditing(),l();const M=`scene-name-${o.id}`,B=document.getElementById(M);(te=B==null?void 0:B.__sceneNameEditor)==null||te.startEdit()},{apiServices:u}=es(!0,o),d=Z(()=>{var M;return{ws_code:i.value,entity_id:r.value,scene_id:o.id,axiosService:u,optionBlock:o.optionBlock,permissions:(M=o.data)==null?void 0:M.permissions}}),h=M=>{var Y,ne,te,z,pe,q;let B=(ne=(Y=o.params)==null?void 0:Y.api)==null?void 0:ne.getRowNode(String(o.id));if(B){const k={...B.data,isDeleted:M==="deleted",isArchived:M==="archived"?!0:B.data.isArchived,isLocked:M==="locked"?!0:B.data.isLocked,disabled:!1};M=="deleted"&&(k.isLocked=!1,k.disabled=!0),M=="unarchived"&&(k.isArchived=!1),(z=(te=o.params)==null?void 0:te.api)==null||z.redrawRows({rowNodes:[B]}),B.setData(k),(q=(pe=o.params)==null?void 0:pe.api)==null||q.redrawRows({rowNodes:[B]})}},f=qh(),{openSceneHub:p}=f,g=()=>{Ct(()=>{var Y,ne,te,z,pe,q;const M=((ne=(Y=o.params)==null?void 0:Y.node)==null?void 0:ne.rowIndex)||0,B=((z=(te=o.params)==null?void 0:te.column)==null?void 0:z.getColId())||"";(q=(pe=o.params)==null?void 0:pe.api)==null||q.setFocusedCell(M,B)})};Z(()=>{var B,Y;const M=(Y=(B=o.params)==null?void 0:B.api)==null?void 0:Y.getRowNode(String(o.id));return M==null?void 0:M.data});const{options:v}=Xq(d,h,c,p,g),y=n,b=()=>{var M,B,Y,ne,te,z;console.trace("Focusing current cell for row:",o.id),(z=(M=o.params)==null?void 0:M.api)==null||z.setFocusedCell(((Y=(B=o.params)==null?void 0:B.node)==null?void 0:Y.rowIndex)||0,((te=(ne=o.params)==null?void 0:ne.column)==null?void 0:te.getColId())||"")},S=Z(()=>{var M;return(M=o.params)==null?void 0:M.api}),C=(M,B)=>{var Y,ne,te,z,pe,q,k,N;if(y("actionExecuted",M),M.id=="copy-link"){(pe=S.value)==null||pe.startEditingCell({rowIndex:(ne=(Y=o.params)==null?void 0:Y.node)==null?void 0:ne.rowIndex,colKey:(z=(te=o.params)==null?void 0:te.column)==null?void 0:z.getColId()});return}else{if(M.id!=="copy-link"&&((q=S.value)==null||q.stopEditing()),M.id==="rename")(k=S.value)==null||k.stopEditing(),(N=S.value)==null||N.clearFocusedCell(),l();else if(M.id==="copy-link"){const Q=document.getElementById(B);setTimeout(()=>{var ce,xe,ge;(ge=(xe=(ce=Q==null?void 0:Q.__vueParentComponent)==null?void 0:ce.exposed)==null?void 0:xe.focus)==null||ge.call(xe)},300)}else if(["delete-rendition","delete-thumbnail"].includes(M.id)){setTimeout(()=>{b()},300);return}setTimeout(()=>{var Q,ce;(ce=(Q=o.params)==null?void 0:Q.api)==null||ce.clearFocusedCell()},300)}},E=()=>{var M,B;(B=(M=o.params)==null?void 0:M.api)==null||B.stopEditing()},R=M=>{var B,Y,ne,te;return M==="archive"?!((Y=(B=o.params)==null?void 0:B.data)!=null&&Y.isArchived):M==="unarchive"?(te=(ne=o.params)==null?void 0:ne.data)==null?void 0:te.isArchived:!0},T=Z(()=>v.value.map(M=>({...M,options:M.options.filter(B=>!B.hide&&R(B.id))})).filter(M=>M.options.length>0)),A=V({}),O=V(null),I=Z(()=>{var B,Y;if(o.focusableIndex)return o.focusableIndex;const M=(Y=(B=o.params)==null?void 0:B.api)==null?void 0:Y.getRowNode(String(o.id));return`${((M==null?void 0:M.rowIndex)??0)+10}`}),D=(M,B)=>`${I.value}.${M*10+B}`,x=(M,B)=>{if(B&&"focus"in B){A.value[M]=B;return}delete A.value[M]},P=M=>{M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation()};return Zt(()=>{var M;(M=O.value)==null||M.focus()}),t({focus(){var Y;const M=`${I.value}.0`,B=A.value[M];B&&B.focus?B.focus():(Y=O.value)==null||Y.focus()}}),(M,B)=>We((W(),ae("div",{onKeydown:P,class:ee([M.$style["more-option-section"],{[M.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:O,tabindex:"0",role:"menu"},[(W(!0),ae(xt,null,xn(T.value,(Y,ne)=>(W(),ae("div",{key:Y.id,style:ln({"--g-number":Math.min(Y.options.length,4),"--g-size":Y.type==="column"?"36px":"auto"}),class:ee([M.$style["option-block"],M.$style[Y.type]])},[(W(!0),ae(xt,null,xn(Y.options,(te,z)=>(W(),ae("div",{key:te.id,class:ee(M.$style["option-item"])},[fe(AX,{layer:o.layer,"scene-id":String(o.id),option:te,type:Y.type,onActionExecuted:pe=>C(pe,`more-action-${pe.id}-${o.id}`),focusableIndex:D(ne,z),ref_for:!0,ref:pe=>x(D(ne,z),pe),onHandleHide:E,id:`more-action-${te.id}-${o.id}`,label:te.label},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id","label"])],2))),128))],6))),128))],34)),[[U(s),I.value]])}}),[["__cssModules",{$style:{"more-option-section":"_more-option-section_1jg4p_1","option-block":"_option-block_1jg4p_8","option-item":"_option-item_1jg4p_15",row:"_row_1jg4p_19",column:"_column_1jg4p_25",block:"_block_1jg4p_29"}}]]),PX={key:0,style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center"}},AX=St(it({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const s=Gr,o=Yt,i=e,r=V(!1),a=V(!1),l=(A,O)=>{if(!O){p();return}const I=O.target;I.closest(".tippy-content")||I.closest(".tippy-box")||I.closest("[data-tippy-root]")||I.closest(".option-item")||p()},c=V(null),{triggerRef:u,popupRef:d,show:h,isVisible:f,hide:p}=us({toggleOnClick:!0,interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:l,appendTo:c.value||void 0}),g=n,v=async A=>{var O,I;if(!a.value){a.value=!0;try{await((I=(O=i.option).action)==null?void 0:I.call(O,A)),g("actionExecuted",i.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1,r.value=!1}}},y=async A=>{var O,I;if(A.preventDefault(),A.stopPropagation(),!a.value){if(i.option.isDanger){r.value=!r.value;return}if(i.option.subMenu)h();else{a.value=!0;try{await((I=(O=i.option).action)==null?void 0:I.call(O,A)),g("actionExecuted",i.option)}catch(D){console.error("Action execution failed:",D)}finally{a.value=!1}return}}},b=A=>{g("actionExecuted",A),p()},S=A=>{A.key==="Escape"&&p()},C=A=>({row:"small",column:"medium",block:"small"})[A]||"medium",E=A=>{const O=i.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...O],column:["menu-item",...O],block:["secondary",...O]}[A]||[]},R=()=>{r.value?r.value=!1:f.value?p():g("handleHide")};t({focus:()=>{Ct(()=>{u.value instanceof HTMLElement?u.value.focus():u.value&&"$el"in u.value?u.value.$el.focus():console.warn("Trigger ref is not an HTMLElement:",u.value)})},escape:()=>{p()},select:()=>{y(new MouseEvent("click"))}});const T=A=>{var O;A.stopPropagation(),A.preventDefault(),r.value=!1,(O=u.value)==null||O.focus()};return(A,O)=>{var I;return We((W(),ae("div",{ref_key:"wrapperRef",ref:c,class:ee(A.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:Pt(y,["stop","prevent"])},[We((W(),Ke(gt,{ref_key:"triggerRef",ref:u,class:ee(A.$style["option-item"]),disabled:e.option.disabled||a.value,actived:U(f)||r.value,size:C(e.type),variant:E(e.type),onClick:Pt(y,["stop","prevent"]),onKeydown:S,onEscape:R,label:e.option.label},{prefix:ye(()=>[e.option.icon?(W(),ae("div",PX,[fe(at,{size:"14",src:e.option.icon,color:e.option.isDanger?void 0:"#a6a6a6",source:"remote"},null,8,["src","color"])])):Ye("",!0)]),suffix:ye(()=>[e.option.subMenu?(W(),Ke(at,{key:0,src:"Play",source:"remote"})):Ye("",!0),e.option.isDanger&&r.value?(W(),ae("div",{key:1,class:ee(A.$style["confirm-action"])},[We((W(),Ke(gt,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:T},{default:ye(()=>[fe(at,{src:"XMarkSolid",source:"remote"})]),_:1})),[[U(s),`${i.focusableIndex}.0`],[U(o),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),We((W(),Ke(gt,{variant:["danger","primary","icon"],size:"small",onClick:Pt(v,["stop","prevent"]),onEscape:O[0]||(O[0]=D=>r.value=!1)},{default:ye(()=>[fe(at,{src:"Check",source:"remote"})]),_:1})),[[U(s),`${i.focusableIndex}.1`],[U(o),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ye("",!0)]),_:1},8,["class","disabled","actived","size","variant","label"])),[[U(s),i.focusableIndex]]),e.option.subMenu?(W(),ae("div",{key:0,ref_key:"popupRef",ref:d,class:ee(A.$style["submenu-container"])},[fe(Mk,{focusableIndex:i.focusableIndex,layer:i.layer+1,ref:"submenuRef","option-block":[((I=e.option)==null?void 0:I.subMenu)||[]],"is-submenu":!1,onActionExecuted:b},null,8,["focusableIndex","layer","option-block"])],2)):Ye("",!0)],2)),[[U(o),{content:e.option.description,contentClass:["extra-padding"],theme:e.option.isDanger?"warning":"arbo",hideOnClick:!1,delay:[300,0]}]])}}}),[["__cssModules",{$style:{"option-item":"_option-item_8a5qn_1","icon-wrapper":"_icon-wrapper_8a5qn_11","confirm-action":"_confirm-action_8a5qn_19"}}]]),kX={style:{"max-width":"225px","line-height":"14px"}},OX={style:{"max-width":"100px","line-height":"14px"}},MX=St(it({__name:"BulkUpdate",props:{selectRowData:{},workspaceId:{},entityId:{},gridApi:{},selectedAll:{type:Boolean},takeName:{},totalRows:{},visibleRows:{},loading:{type:Boolean}},emits:["close","assignStatus","assignAssignee","assignDate","assignMetric","moreActions","deleteSelected","unselect","updated","selectAll"],setup(e,{emit:t}){const n=Yt,s=Gr,o=e,i=t,r=Vm(),{handelSelectAll:a}=r,{selectionStatus:l}=Xs(r),c=Z(()=>l.value===$t.CHECKED),u=Z(()=>o.selectRowData.map(q=>q.id)),d=Z(()=>o.selectRowData.length>0);Ki("bulkUpdate",d),Ki("isSelectAll",c);const h=({itemIds:q,data:k})=>{const N=o.gridApi;q.forEach(Q=>{if(!N){console.error("Grid API is undefined");return}const ce=N.getRowNode(Q);if(ce){const xe={...ce.data,status:k};ce.setData(xe)}})},f=Z(()=>o.selectRowData),p=({itemIds:q,data:k})=>{const N=o.gridApi;if(!N){console.error("Grid API is undefined");return}q.forEach(Q=>{const ce=N.getRowNode(Q);if(ce){const xe=ce.data.dateRange||[null,null];"startDate"in k&&k.startDate!==void 0&&(xe[0]=k.startDate?new Date(k.startDate):null),"dueDate"in k&&k.dueDate!==void 0&&(xe[1]=k.dueDate?new Date(k.dueDate):null);const ge={...ce.data,dateRange:xe};ce.setData(ge)}}),i("updated")},g=Z(()=>o.selectRowData.map(q=>q.id)),v=q=>{const k=o.gridApi,{id:N,value:Q}=q;if(!k){console.error("Grid API is undefined");return}g.value.forEach(ce=>{const xe=k.getRowNode(ce);if(xe){const ge={...xe.data,[`metric_${N}`]:Q};xe.setData(ge)}}),i("updated")},y=["primary"],b=[{label:"Delete Thumbnail",icon:"Image",id:"delete-thumbnail",type:"icon",value:"delete-thumbnail"},{label:"Delete Rendition",icon:"Film",id:"delete-rendition",type:"icon",value:"delete-rendition"},{label:"Unarchive",value:"UnBoxArchive",type:"icon",icon:"BoxArchive",id:"unarchive",clickable:!0},{label:"Archive",value:"BoxArchive",type:"icon",icon:"BoxArchive",id:"archive",clickable:!0},{label:"Delete",value:"delete",type:"icon",icon:"TrashCan",id:"delete",danger:!0,clickable:!0}],S=()=>{i("unselect")},C=Wb(),{userPermissions:E}=Xs(C),R=Z(()=>E.value.includes(zb)),T=()=>{const q=o.selectRowData.map(N=>N.id).join(","),k=To({type:"review_multiple_scenes",config:{reviewDomain:En.getInstance().getItem("BASE_REVIEW_URL"),ws_code:o.workspaceId,scene_ids:q}}).url;window.open(k,"_blank")},A=q=>{const{assignees:k,type:N}=q,Q=o.gridApi;if(!Q){console.error("Grid API is not available for bulk update.");return}o.selectRowData.map(xe=>{const ge=Q.getRowNode(xe.id);if(!ge)return null;const de=ge.data.assignees||[];let X=[];switch(N){case"add":{const De=new Set(de.map(Ae=>Ae.id)),re=k.filter(Ae=>!De.has(Ae.id));X=[...de,...re];break}case"overwrite":{X=k;break}case"remove":{const De=new Set(k.map(re=>re.id));X=de.filter(re=>!De.has(re.id));break}case"removeAll":{X=[];break}}return{...ge.data,assignees:X}}).filter(xe=>xe!==null).forEach(xe=>{const ge=Q.getRowNode(xe.id);ge&&ge.setData(xe)})},{apiServices:O}=es(!1,o),I=async()=>{var Q;const q=o.selectRowData.map(ce=>ce.id),k=o.gridApi;if(!k){console.error("Grid API is not available for bulk delete.");return}const N=await((Q=O.value)==null?void 0:Q.bulkDeleteItems(P.value));(N==null?void 0:N.message)=="Done"&&(q.forEach(ce=>{const xe=k.getRowNode(ce);if(xe){const ge={...xe.data,isDeleted:!0,disabled:!0};xe.setData(ge)}}),k.deselectAll())},D=async()=>{var Q;const q=o.selectRowData.map(ce=>ce.id);if(!o.gridApi){console.error("Grid API is not available for bulk unarchive.");return}const N=await((Q=O.value)==null?void 0:Q.bulkUnarchiveItems(P.value));if((N==null?void 0:N.message)!="Done"){console.error("Failed to unarchive items.");return}B(q,"isArchived",!1)},x=Sn("filterParams",void 0),P=Z(()=>({workspaceId:String(o.workspaceId),itemIds:d.value&&c.value?[]:o.selectRowData.map(q=>q.id),entityId:o.entityId,filterParams:x!=null&&x.value?x.value:void 0})),M=async()=>{var Q;const q=o.selectRowData.map(ce=>ce.id);if(!o.gridApi){console.error("Grid API is not available for bulk archive.");return}const N=await((Q=O.value)==null?void 0:Q.bulkArchiveItems(P.value));if((N==null?void 0:N.message)!="Done"){console.error("Failed to archive items.");return}B(q,"isArchived",!0)},B=(q,k,N)=>{const Q=o.gridApi;if(!Q){console.error("Grid API is not available for bulk update.");return}const ce=q.map(xe=>{const ge=Q.getRowNode(xe);if(ge){const de={...ge.data,[k]:N};ge.setData(de)}return ge}).filter(xe=>xe!=null);Q.redrawRows({rowNodes:ce})},Y=async()=>{var Q;const q=o.selectRowData.map(ce=>ce.id),k=o.gridApi;if(!k){console.error("Grid API is not available for bulk thumbnail deletion.");return}const N=await((Q=O.value)==null?void 0:Q.deleteThumbnail(P.value));if((N==null?void 0:N.message)!="Done"){console.error("Failed to delete thumbnails.");return}q.forEach(ce=>{const xe=k.getRowNode(ce);if(xe){const ge={...xe.data,thumbnail:null};xe.setData(ge)}})},ne=async()=>{var Q;const q=o.selectRowData.map(ce=>ce.id),k=o.gridApi;if(!k){console.error("Grid API is not available for bulk rendition deletion.");return}const N=await((Q=O.value)==null?void 0:Q.deleteRendition(P.value));if((N==null?void 0:N.message)!="Done"){console.error("Failed to delete renditions.");return}q.forEach(ce=>{const xe=k.getRowNode(ce);if(xe){const ge={...xe.data,rendition:null};xe.setData(ge)}})},te=V(!1),z=V(null),pe=async q=>{var k;try{switch(te.value=!0,q.id){case"unarchive":await D();break;case"delete":await I();break;case"archive":await M();break;case"delete-thumbnail":await Y();break;case"delete-rendition":await ne();break;default:console.error("Unknown action:",q.id),te.value=!1;break}Ct(()=>{te.value=!1})}catch{te.value=!1}finally{(k=z.value)==null||k.focus()}};return(q,k)=>We((W(),ae("div",{class:ee(q.$style["bulk-update-action"])},[be("div",{class:ee(q.$style["left-actions"])},[be("div",{class:ee(q.$style["selection-track"])},[fe(gt,{variant:["icon","tertiary"],onClick:S},{default:ye(()=>[fe(at,{src:"XMarkSolid",source:"remote"})]),_:1}),U(l)==U($t).INDETERMINATE?(W(),ae("span",{key:0,class:ee(q.$style["selected-count"])},mt(e.selectRowData.length)+" selected ",3)):Ye("",!0),U(l)==U($t).CHECKED?(W(),ae("span",{key:1,class:ee(q.$style["selected-count"]),style:{"line-height":"14px"}},[k[0]||(k[0]=nt(' All in " ',-1)),We((W(),ae("span",kX,[nt(mt(e.takeName),1)])),[[U(n),{content:e.takeName}]]),k[1]||(k[1]=nt(' " ',-1))],2)):Ye("",!0),!e.loading&&U(l)==U($t).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(W(),Ke(gt,{key:2,variant:"secondary",onHandleClick:U(a)},{default:ye(()=>[be("span",{class:ee(q.$style["selected-count"]),style:{"line-height":"14px"}},[k[2]||(k[2]=nt(' Select all in " ',-1)),We((W(),ae("span",OX,[nt(mt(e.takeName),1)])),[[U(n),{content:e.takeName}]]),k[3]||(k[3]=nt(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Ye("",!0),be("span",{class:ee(q.$style.divider)},null,2)],2),fe(FX,{ids:u.value,"workspace-id":e.workspaceId,"entity-id":e.entityId,variant:y,onUpdated:h},null,8,["ids","workspace-id","entity-id"]),fe(CY,{onUpdate:A,ids:u.value,"workspace-id":e.workspaceId,variant:y,"entity-id":e.entityId},null,8,["ids","workspace-id","entity-id"]),fe(OY,{ids:u.value,"workspace-id":e.workspaceId,"entity-id":e.entityId,variant:y,"row-selected":f.value,onUpdated:p},null,8,["ids","workspace-id","entity-id","row-selected"]),fe(TX,{onUpdate:v,selectedIds:u.value,"workspace-id":e.workspaceId,variant:y,"entity-id":e.entityId},null,8,["selectedIds","workspace-id","entity-id"]),be("span",{class:ee(q.$style.divider)},null,2),We((W(),ae("div",null,[R.value?(W(),Ke(gt,{key:0,class:ee(q.$style["action-button"]),variant:[...y,"icon"],onClick:T,disabled:o.selectRowData.length>40},{default:ye(()=>[fe(at,{src:"PenRuler",class:ee(q.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","disabled"])):Ye("",!0)])),[[U(n),o.selectRowData.length<=40?"Open in Review":"Select fewer than 40 items to open in Review"]]),be("span",{class:ee(q.$style.divider)},null,2),fe(Ak,{placement:"top-end"},{trigger:ye(({open:N,toggle:Q,closeDropdown:ce})=>[We((W(),Ke(gt,{onEscape:ce,actived:N,ref_key:"moreActionRef",ref:z,class:ee(q.$style["action-button"]),variant:[...y,"icon"],loading:te.value,onClick:Pt(Q,["stop"])},{default:ye(()=>[fe(at,{src:"EllipsisVertical",class:ee(q.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","variant","loading","onClick"])),[[U(s),"99999"],[U(n),{content:"More actions"}]])]),content:ye(({visible:N,closeDropdown:Q})=>[(W(),ae(xt,null,xn(b,(ce,xe)=>fe(Zl,Jt({clickable:!0,key:ce.id},{ref_for:!0},ce,{show:N,style:{borderLeft:0},"focus-index":"99999."+xe,onClick:()=>{pe(ce),Q()},onEscape:Q}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1})],2)],2)),[[Ei,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_16qqo_1","left-actions":"_left-actions_16qqo_19","right-actions":"_right-actions_16qqo_20","selection-track":"_selection-track_16qqo_25","close-icon":"_close-icon_16qqo_31","selected-count":"_selected-count_16qqo_35",divider:"_divider_16qqo_41","more-button":"_more-button_16qqo_46",dropdown:"_dropdown_16qqo_50","dropdown-content":"_dropdown-content_16qqo_53",delete:"_delete_16qqo_76","icon-btn":"_icon-btn_16qqo_83","selected-list":"_selected-list_16qqo_87"}}]]),Ga=St(it({name:"LabelRenderer",__name:"LabelRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=So,n=Yt,s=e,o=Z(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:s.value===void 0||s.value===null||s.value==="",clickable:!0})),{argsMain:i}=ms(o),r=Z(()=>{var c,u,d;return!!((c=s.params)!=null&&c.api||(u=s.params)!=null&&u.node||(d=s.params)!=null&&d.context)}),a=Z(()=>{if(s.tooltip){if(typeof s.tooltip=="string")return{content:s.tooltip};if(typeof s.tooltip=="object"&&"display_name"in s.tooltip){const c=s.tooltip,u=document.createElement("div");u.classList.add("tooltip-user-info"),u.style.display="flex",u.style.alignItems="center",u.style.gap="4px";const d=document.createElement("div"),h=fe(bh,{id:c.id,name:c.display_name,profile_image:c.profile_image,size:20,initial:c.initial,color:c.color});$w(h,d);const f=document.createElement("span");f.innerText=c.display_name,f.classList.add("tooltip-user-name");const p=document.createElement("span");p.style.whiteSpace="nowrap",p.innerText="By",u.appendChild(p),u.appendChild(d),u.appendChild(f);const g=document.getElementById("item-table-layout-id");return{content:u,allowHtml:!0,appendTo:g||document.body}}}return{content:void 0}}),l=Z(()=>s.value===void 0);return(c,u)=>We((W(),Ke(vs,Q_(xw(U(i))),{default:ye(()=>[be("span",{class:ee(c.$style["item-table-label-renderer"])},mt(s.value||"-"),3)]),_:1},16)),[[U(t),{isLoading:l.value||!r.value}],[U(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),NX=["placeholder","maxlength"],LX={key:0,class:"wrapper-suffix"},VX=St(it({name:"LabelEditor",__name:"LabelEditor",props:{value:{},placeholder:{default:"Enter name"},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},saveOnBlur:{type:Boolean,default:!0},bordered:{type:Boolean},keyboardFocusing:{type:Boolean}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const s=So,o=Yt,i=e,r=n,a=V(i.value),l=V(null),c=V(null),u=V(i.value||""),d=V(!1),h=V(!1),f=Z(()=>{var x;return{disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((x=i.value)==null?void 0:x.length)===0,inputRef:l,wrapperRef:c,clickable:!0,focused:d.value||i.keyboardFocusing}}),{argsMain:p,isHover:g}=ms(f),v=x=>{const P=document.createElement("div");return P.textContent=x,P.innerHTML},y=()=>u.value!==a.value,b=()=>{h.value=!0,d.value=!1,u.value=a.value,r("update:value",a.value),setTimeout(()=>{h.value=!1},100)},S=()=>{if(!d.value||!l.value)return;const x=v(l.value.value);if(!y()){d.value=!1;return}a.value=x,r("update:value",x),r("enter",x),d.value=!1},C=()=>{h.value||(i.saveOnBlur?S():b(),r("blur",u.value))},E=x=>{var P;if(x.key==="ArrowLeft"||x.key==="ArrowRight"){x.stopPropagation();return}x.ctrlKey&&x.key=="a"||x.key=="A"?(x.stopPropagation(),(P=l.value)==null||P.select()):x.key==="Enter"?(x.preventDefault(),x.stopPropagation(),S()):x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),b())},R=()=>{a.value=i.value,u.value=i.value,d.value=!0,Ct(()=>{var x,P;(x=l.value)==null||x.click(),(P=l.value)==null||P.focus()})},T=()=>{var x;d.value?b():(x=l.value)==null||x.blur(),r("blur",u.value)},A={focus:()=>{R()}};Zt(()=>{var P;const x=(P=c.value)==null?void 0:P.$el;x&&(x.__sceneNameEditor=A)}),Qn(()=>{const x=c.value;x&&delete x.__sceneNameEditor});const O=V(null),I=V(null);t({focus:R,blur:()=>{var x;return(x=l.value)==null?void 0:x.blur()},save:S,cancel:b,focusEditButton:()=>{Ct(()=>{var x;(x=O.value)==null||x.focus()})},focusCancelButton:()=>{Ct(()=>{var x;(x=I.value)==null||x.focus()})},startEdit:R});const D=Z(()=>i.value===void 0);return qb(c,()=>{d.value&&C()}),(x,P)=>We((W(),Ke(U(vs),Jt(U(p),{ref_key:"wrapperRef",ref:c,bordered:i.bordered}),Yd({default:ye(()=>[d.value?Ye("",!0):Tt(x.$slots,"default",{key:0,isEditting:d.value,isHover:U(g)},()=>[We((W(),ae("span",{class:ee(x.$style["label-renderer"])},[nt(mt(u.value),1)],2)),[[U(o),{content:u.value||void 0}]])]),We(be("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":P[0]||(P[0]=M=>u.value=M),class:ee(x.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:E,onBlur:C},null,42,NX),[[Ei,d.value],[v1,u.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:ye(({hovered:M,focused:B})=>[M?(W(),ae("div",LX,[M&&!B?We((W(),Ke(gt,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(R,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:O,onKeydown:[Un(Pt(R,["prevent","stop"]),["enter"]),Un(Pt(T,["prevent","stop"]),["escape"])]},{default:ye(()=>[fe(U(at),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[U(o),"Edit"]]):Ye("",!0)])):Ye("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[U(s),{isLoading:D.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),BX=["tabindex"],Nk=St(it({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const s=Yt,o=So,i=e,r=n,a=V(i.value),l=V(i.value),c=V(null),u=V(null),d=Sn("bulkUpdate",!1),{apiServices:h}=es(!d,i),f=Z(()=>{var z;return{componentType:void 0,disabled:i.disabled,error:!1,readOnly:i.readOnly,isEmpty:((z=a==null?void 0:a.value)==null?void 0:z.length)===0,inputRef:c,wrapperRef:u,clickable:!0}}),{isFocus:p}=ms(f),g=Z(()=>{const z=En.getInstance().getItem("ws.code"),pe=En.getInstance().getItem("BASE_URL"),q=z||i.workspaceId;return To({type:"scene_hub",config:{baseDomain:pe,ws_code:q,scene_id:String(i.id)}}).url}),v=Z(()=>{var z,pe,q;return((pe=(z=i.data)==null?void 0:z.isProcessing)==null?void 0:pe.state)==0||((q=i.data)==null?void 0:q.isDeleted)==!0}),y=Z(()=>i.readOnly||R.value),b=Z(()=>{var z,pe,q,k,N;return((z=i.data)==null?void 0:z.isDeleted)==!0||((q=(pe=i.data)==null?void 0:pe.isProcessing)==null?void 0:q.state)==0||((N=(k=i.data)==null?void 0:k.isProcessing)==null?void 0:N.state)==1}),S=Z(()=>{var z,pe;return(pe=(z=i.data)==null?void 0:z.isProcessing)==null?void 0:pe.message}),C=Z(()=>{var z;return((z=i.data)==null?void 0:z.isArchived)==1}),E=Z(()=>{var z;return((z=i.data)==null?void 0:z.isLocked)==1}),R=Z(()=>i.value===void 0),T=async z=>{var pe,q,k,N,Q,ce,xe,ge,de,X;a.value=z,p.value=!1;try{const De=await((q=(pe=h.value)==null?void 0:pe.updateSceneName)==null?void 0:q.call(pe,{workspaceId:i.workspaceId,entityId:i.entityId,itemId:i.id,name:a.value})),re=FF.get(SF)||"UTC";if(De){const Ae=DF(De,re),H={...i.data,...Ae};(k=i.params)==null||k.api.clearFocusedCell();const oe=((Q=(N=i.params)==null?void 0:N.column)==null?void 0:Q.getColId())||"",ve=((xe=(ce=i.params)==null?void 0:ce.node)==null?void 0:xe.rowIndex)||0;(ge=i.params)==null||ge.api.setFocusedCell(ve,oe),(X=(de=i.params)==null?void 0:de.node)==null||X.setData(H),l.value=a.value,r("enter")}else a.value=l.value}catch(De){console.error("Failed to update scene name:",De),a.value=l.value}},A={focus:()=>{p.value=!0,Ct(()=>{var z;return(z=u.value)==null?void 0:z.focus()})},startEdit:()=>{var z;(z=u.value)==null||z.startEdit()}},O=()=>u.value?"$el"in u.value?u.value.$el:u.value:null;Je(()=>i.value,z=>{a.value=z,l.value=z}),Zt(()=>{const z=O();z&&(z.__sceneNameEditor=A)}),Qn(()=>{const z=u.value,pe=z&&"$el"in z?z.$el:z;pe&&delete pe.__sceneNameEditor});const I=qh(),{openSceneHub:D}=I,x=z=>{try{if(z.ctrlKey||z.metaKey){window.open(g.value,"_blank");return}D(String(i.id))}catch{window.open(g.value,"_blank")}finally{ne()}},P=()=>{setTimeout(()=>{te.value=!0,M.value=0,Ct(()=>{var z;(z=B.value)==null||z.focus()})},300)},M=V(-1),B=V(null);t({focus:P,trigerFocus:P,startEdit:()=>{var z;(z=u.value)==null||z.startEdit()}});const Y=z=>{if(z.key==="Enter"){z.preventDefault(),x(z);return}if(z.key==="Escape"){z.preventDefault(),ne();return}z.key==="Tab"&&(z.preventDefault(),z.stopPropagation(),z.stopImmediatePropagation(),Ct(()=>{var pe;(pe=u.value)==null||pe.focusEditButton()}))},ne=()=>{var q,k,N,Q,ce,xe;te.value=!1,M.value=-1,(q=i.params)==null||q.api.clearFocusedCell();const z=((N=(k=i.params)==null?void 0:k.column)==null?void 0:N.getColId())||"",pe=((ce=(Q=i.params)==null?void 0:Q.node)==null?void 0:ce.rowIndex)||0;(xe=i.params)==null||xe.api.setFocusedCell(pe,z)},te=V(!1);return(z,pe)=>We((W(),Ke(VX,{"save-on-blur":!0,ref_key:"wrapperRef",ref:u,disabled:i.disabled,"read-only":y.value,placeholder:i.placeholder,value:a.value,"onUpdate:value":pe[0]||(pe[0]=q=>a.value=q),id:`scene-name-${i.id}`,onEnter:T,"max-length":255,bordered:!0,keyboardFocusing:te.value,onBlur:ne},{default:ye(({isHover:q,isEditting:k})=>[We(be("div",{class:ee(z.$style["scene-name-display"])},[We((W(),ae("a",{tabindex:M.value,ref_key:"nameRef",ref:B,onClick:Pt(x,["prevent"]),onKeydown:Y,target:"_blank",class:ee(z.$style["scene-name-text"])},[nt(mt(a.value),1)],42,BX)),[[U(s),{content:a.value,delay:[1e3,0]}]]),y.value||!q&&!k&&!y.value?(W(),ae(xt,{key:0},[E.value?We((W(),ae("div",{key:0,class:ee([z.$style["icon-processing"],z.$style.isLocked])},[fe(at,{src:"Lock"})],2)),[[U(s),{content:"Locked",delay:[1e3,0]}]]):Ye("",!0),C.value?We((W(),ae("div",{key:1,class:ee([z.$style["icon-processing"],z.$style.archived])},[fe(at,{src:"BoxArchive"})],2)),[[U(s),{content:"Archived",delay:[1e3,0]}]]):Ye("",!0),b.value?We((W(),ae("div",{key:2,class:ee([z.$style["icon-processing"],z.$style.processing,v.value&&z.$style["icon-red"]])},[fe(at,{src:"AnimatedHourglass",color:"inherit"})],2)),[[U(s),S.value]]):Ye("",!0)],64)):Ye("",!0)],2),[[Ei,!U(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[U(o),{isLoading:R.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_16nch_1","scene-name-display":"_scene-name-display_16nch_11","icon-processing":"_icon-processing_16nch_18",archived:"_archived_16nch_28",locked:"_locked_16nch_31",processing:"_processing_16nch_34","icon-red":"_icon-red_16nch_38","scene-name-text":"_scene-name-text_16nch_43"}}]]),cS=St(it({__name:"ButtonDropdown",props:{label:{},value:{},variant:{},options:{default:()=>[]},size:{},placement:{default:"bottom"},disabled:{type:Boolean},readOnly:{type:Boolean},tabIndex:{}},emits:["select","handleClick"],setup(e,{expose:t,emit:n}){const s=Gr,o=V([]),i=e,r=V(null),a=Z(()=>typeof i.size=="number"?`${i.size}px`:{small:"24px",medium:"32px",large:"48px"}[i.size]??"32px"),l=Z(()=>{let y=[];return typeof i.variant=="string"?y.push(i.variant):Array.isArray(i.variant)&&(y=[...i.variant]),[...y,"icon"]}),c=n,{hide:u,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=us({toggleOnClick:!0,offset:[0,0]});function v(y){c("select",y),u()}return qd(()=>{g.value&&g.value.setProps({placement:i.placement})}),t({show:h,hide:u,hideDropdown:()=>{u()},popupRef:p}),Je(d,y=>{var b;y&&((b=p.value)==null||b.focus())}),(y,b)=>(W(),ae("div",{class:ee(y.$style["button-dropdown-wrapper"]),style:ln({"--button-size":a.value})},[be("div",{class:ee(y.$style["button-group"])},[Tt(y.$slots,"prefix"),be("div",{ref_key:"triggerRef",ref:f,class:ee(U(d)?y.$style.open:"")},[Tt(y.$slots,"triggerDropdown",{open:U(d)},()=>[i.readOnly?Ye("",!0):We((W(),Ke(gt,{key:0,onEscape:U(u),ref_key:"mainButton",ref:r,actived:U(d),class:ee(y.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:i.disabled},{default:ye(()=>[Tt(y.$slots,"iconDropdown",{},()=>[fe(at,{class:ee(y.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[U(s),e.tabIndex]])])],2)],2),be("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:ee(y.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(W(!0),ae(xt,null,xn(e.options,(S,C)=>We((W(),Ke(Zl,Jt({ref_for:!0,ref:E=>o.value[C]=E,key:S.value},{ref_for:!0},{...S},{"icon-name":S.icon,onClick:Pt(E=>v(S.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:ye(()=>[nt(mt(S.label),1)]),_:2},1040,["icon-name","onClick"])),[[U(s),`${e.tabIndex}.${C}`]])),128))],2)],6))}}),[["__cssModules",{$style:{"button-dropdown-wrapper":"_button-dropdown-wrapper_1g99p_1","button-group":"_button-group_1g99p_7","overflow-elipsis":"_overflow-elipsis_1g99p_26","button-dropdown-list":"_button-dropdown-list_1g99p_33",show:"_show_1g99p_38","button-dropdown-item":"_button-dropdown-item_1g99p_41","icon-dropdown":"_icon-dropdown_1g99p_48",open:"_open_1g99p_51"}}]]),of=St(it({__name:"CloseBadgeWrapper",props:{disableRemove:{type:Boolean,default:!0},tooltip:{default:"Unassign"}},emits:["clear"],setup(e,{emit:t}){const n=Yt,s=e,o=t,i=a=>{a.preventDefault(),a.stopImmediatePropagation(),a.stopPropagation(),o("clear")},r=Z(()=>({content:s.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(W(),ae("div",{class:ee(a.$style["close-wrapper"])},[e.disableRemove?Ye("",!0):(W(),ae("div",{key:0,class:ee(a.$style["close-button"])},[We((W(),Ke(gt,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:i,size:16,rounded:!0},{default:ye(()=>[fe(at,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[U(n),r.value]])],2)),Tt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_bvkx4_1","close-button":"_close-button_bvkx4_5"}}]]),$X=St(it({name:"AssigneeGroupRenderer",__name:"AssigneeGroupRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},maxVisible:{default:4}},setup(e){const t=Yt,n=So,s=e,{isEditing:o}=_u(s),i=V(s.value),r=V(null),a=V(null),{apiServices:l}=es(!0,s),c=V(!0),u=()=>{c.value=s.value===void 0};Yp(()=>{u()}),Zt(()=>{u()}),Je(()=>s.value,A=>{u()});const d=Z(()=>({disabled:s.disabled,readOnly:s.readOnly,error:s.error,inputRef:r,wrapperRef:a,clickable:!(s.readOnly||c.value),active:o})),{argsMain:h,isHover:f}=ms(d),p=Z(()=>{var A;return((A=i.value)==null?void 0:A.slice(0,s.maxVisible))||[]}),g=Z(()=>{var A;return Math.max(0,(((A=i.value)==null?void 0:A.length)||0)-s.maxVisible)}),v=Z(()=>{var A;return g.value<=0?"":((A=i.value)==null?void 0:A.slice(s.maxVisible).map(O=>O.name).join(", "))||""}),y=Z(()=>p.value.map(A=>({id:A.id,name:A.name,initial:A.initial,avatarId:A.id,profile_image:A.profile_image,color:A.color,size:24,user:A}))),b=Z(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));Je(()=>s.value,A=>{i.value=A},{immediate:!0,deep:!0});const S=async A=>{var I,D,x;await T(A)&&(i.value=(I=i.value)==null?void 0:I.filter(P=>P.id!==A),(x=s.params)==null||x.node.setData({...(D=s.params)==null?void 0:D.node.data,assignees:i.value}))},C=A=>{var I;const O=En.getInstance().getItem("ws.code");return((I=l.value)==null?void 0:I.getUserInformation(O,A))||Promise.resolve(null)},{id:E}=Np(s),R=A=>{var I,D;const O=(D=(I=s.params)==null?void 0:I.api)==null?void 0:D.getRowNode(String(E.value));O==null||O.setDataValue("assignees",Mx(A.assignees))},{removeAssignee:T}=um({...s,entityId:s.entityId,updateRowData:R,value:s.value,errorCallback:()=>{}});return(A,O)=>We((W(),Ke(vs,Jt(U(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:ye(()=>{var I;return[be("div",{class:ee(A.$style.assigneeGroupRenderer)},[((I=i.value)==null?void 0:I.length)===0?(W(),Ke(at,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:ln(b.value)},null,8,["style"])):Ye("",!0),(W(!0),ae(xt,null,xn(y.value,D=>(W(),Ke(of,{key:D.id,"disable-remove":s.readOnly||s.disabled,onClear:x=>S(D.id),style:{marginLeft:"0"}},{default:ye(()=>[fe(Du,{user:D.user,"show-profile":!0,apiUpdateFunction:C,class:ee(A.$style["ib-assignee-avatar"])},null,8,["user","class"])]),_:2},1032,["disable-remove","onClear"]))),128)),g.value>0?We((W(),ae("div",{key:1,class:ee(A.$style["extra-avatars"])},[nt(" +"+mt(g.value),1)],2)),[[U(t),v.value]]):Ye("",!0)],2)]}),_:1},16)),[[U(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{assigneeGroupRenderer:"_assigneeGroupRenderer_14fiu_1","ib-assignee-group-renderer":"_ib-assignee-group-renderer_14fiu_7","ib-assignee-avatar":"_ib-assignee-avatar_14fiu_16","assignee-wrapper":"_assignee-wrapper_14fiu_20","extra-avatars":"_extra-avatars_14fiu_27"}}]]),HX=St(it({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!1},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var R,T;const t=Yt,n=So,s=pb(),o=e,i=V(null),r=V(null),{isEditing:a}=_u(o),l=A=>{if(A){if(typeof A=="string")return A;if(A instanceof Date)return A.toISOString()}},c=Z(()=>o.value===void 0),u=Z(()=>{var A;return(A=o.data)==null?void 0:A.isStarted}),d=Z(()=>{var A;return(A=o.data)==null?void 0:A.isCompleted}),h=Z(()=>!!(o.value&&(o.value[0]||o.value[1]))),f=Z(()=>h.value?o.disabled&&!o.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=Z(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,inputRef:i,wrapperRef:r,clickable:!0,active:a})),{argsMain:g}=ms(p),{startDate:v,endDate:y,startClasses:b,endClasses:S,fullStartDate:C,fullEndDate:E}=v7({start:l((R=o.value)==null?void 0:R[0]),end:l((T=o.value)==null?void 0:T[1]),isStarted:u.value,isEnded:d.value,timezone:o.timezone||s});return(A,O)=>We((W(),Ke(vs,Jt(U(g),{ref_key:"wrapperRef",ref:r,bordered:!0}),{default:ye(()=>[c.value?Ye("",!0):(W(),ae("div",{key:0,class:ee(A.$style.dateRangeRenderer)},[h.value?Ye("",!0):(W(),Ke(at,{key:0,src:"Calendar",class:ee(A.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(W(),ae(xt,{key:1},[We((W(),ae("span",{class:ee([A.$style.dateLabelDisplay,...U(b).map(I=>A.$style[I])])},[nt(mt(U(v)),1)],2)),[[U(t),U(C)]]),O[0]||(O[0]=be("span",null,"→",-1)),We((W(),ae("span",{class:ee([A.$style.dateLabelDisplay,...U(S).map(I=>A.$style[I])])},[nt(mt(U(y)),1)],2)),[[U(t),U(E)]])],64)):Ye("",!0)],2))]),_:1},16)),[[U(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_1hon8_1",calendarIcon:"_calendarIcon_1hon8_7",dateSection:"_dateSection_1hon8_11",dateLabelDisplay:"_dateLabelDisplay_1hon8_18",empty:"_empty_1hon8_28","end-today":"_end-today_1hon8_34",actual:"_actual_1hon8_37","end-tomorrow":"_end-tomorrow_1hon8_40","end-yesterday":"_end-yesterday_1hon8_46","end-past":"_end-past_1hon8_52","end-future":"_end-future_1hon8_58","start-today":"_start-today_1hon8_61","start-tomorrow":"_start-tomorrow_1hon8_67","start-yesterday":"_start-yesterday_1hon8_73","start-past":"_start-past_1hon8_79","start-future":"_start-future_1hon8_85"}}]]),GX=it({__name:"DateRangeEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{default:void 0},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{default:pb()}},emits:["closed"],setup(e,{expose:t,emit:n}){const s=V(null);Zt(()=>{Ct(()=>{s.value&&s.value.focus()})});const o=e,i=n,r=()=>{var y;(y=o.params)==null||y.api.stopEditing(),i("closed")},a=y=>`${vt.fromJSDate(y,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,l=async y=>{await v({startDate:y[0]?a(y[0]):null,dueDate:y[1]?a(y[1]):null})},c=async()=>{await v({startDate:null})},u=async()=>{await v({dueDate:null})},d=async y=>{await v({startDate:y?a(y):null})},h=async y=>{await v({dueDate:y?a(y):null})},f=async()=>{await v({startDate:null,dueDate:null})},p=Sn("bulkUpdate",!1),{apiServices:g}=es(!p,o),v=async y=>{var b,S,C,E,R;try{const T=(b=s.value)==null?void 0:b.getValues(),A=await((C=(S=g.value)==null?void 0:S.changeDate)==null?void 0:C.call(S,{workspaceId:o.workspaceId,itemIds:[o.id],startDate:y.startDate,dueDate:y.dueDate}));A!=null&&A.message&&((R=o.params)==null||R.node.setData({...(E=o.params)==null?void 0:E.node.data,dateRange:T==null?void 0:T.dateRange}))}catch(T){console.error("Failed to update scene name:",T)}};return t({focus:()=>{Ct(()=>{var y;(y=s.value)==null||y.focus()})}}),(y,b)=>(W(),Ke(Dm,Jt(o,{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:u,onClearStart:c,onClosed:r,ref_key:"calendarRef",ref:s}),null,16))}}),UX=St(it({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=V(null),s=V(0);let o=null;Zt(()=>{n.value&&(o=new ResizeObserver(r=>{for(const a of r)s.value=a.contentRect.height}),o.observe(n.value))}),_l(()=>{o&&n.value&&o.unobserve(n.value)});const i=Z(()=>{const r=s.value;return r>120?r-42-36:0});return(r,a)=>(W(),ae("div",{class:ee(r.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[be("div",{class:ee(r.$style["item-header"])},[be("div",{class:ee(r.$style["item-header__left"])},[Tt(r.$slots,"header-left",{},()=>[be("h1",{class:ee(r.$style["item-header__title"])},[Tt(r.$slots,"title",{},()=>[a[0]||(a[0]=nt("Items",-1))])],2)])],2),be("div",{class:ee(r.$style["item-header__spacer"])},null,2),be("div",{class:ee(r.$style["item-header__actions"])},[Tt(r.$slots,"header-actions")],2)],2),Tt(r.$slots,"grid",{availableHeight:i.value}),be("div",{class:ee(r.$style.footer)},[Tt(r.$slots,"footer")],2),Tt(r.$slots,"new-row"),Tt(r.$slots,"bulk-update-actions"),Tt(r.$slots,"snackbar"),Tt(r.$slots,"popup")],2))}}),[["__cssModules",{$style:{"item-table-wrapper":"_item-table-wrapper_1uqb9_1","item-header":"_item-header_1uqb9_14","item-header__left":"_item-header__left_1uqb9_22","item-header__title":"_item-header__title_1uqb9_27","item-header__spacer":"_item-header__spacer_1uqb9_32","item-header__actions":"_item-header__actions_1uqb9_35","main-content":"_main-content_1uqb9_41",sidebar:"_sidebar_1uqb9_48","is-open":"_is-open_1uqb9_64","sidebar-header":"_sidebar-header_1uqb9_68","sidebar-footer":"_sidebar-footer_1uqb9_69","sidebar-content":"_sidebar-content_1uqb9_89",footer:"_footer_1uqb9_94"}}]]),Lk=(e,t)=>{const n=V(Number(e.value.value)),s=Z(()=>e.value.metricConfig),o=Z(()=>{var g,v;const l=s.value,c=t.value,u=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,d=!!e.value.error,h=(l==null?void 0:l.format_type)==="icon",{disabled:f}=e.value;return{pendingCalculation:e.value.value=="N/A"||u&&((g=l==null?void 0:l.metric_type)==null?void 0:g.code)==="formula",isEmpty:u,isError:d,hasPrefix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="prefix",hasSuffix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="suffix",isDropdown:(l==null?void 0:l.format_type)==="dropdown",isFormula:((v=l==null?void 0:l.metric_type)==null?void 0:v.code)==="formula",isLoading:e.value.value===void 0,isRating:h,showActions:c&&!u&&!f}}),i=17,r=Z(()=>{var l;return{maxRating:((l=s.value)==null?void 0:l.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:i}});return{componentState:o,metricConfig:s,ICON_SIZE:i,ratingParams:r,standardNameforIcon:()=>{var c;return(((c=s.value)==null?void 0:c.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},WX=["aria-label"],Vk=St(it({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=So,s=Yt,o=e,i=tw(!1),r=V(null),a=V(null),{isEditing:l}=_u(o),c=Z(()=>{var B,Y;return{value:o.value,metricConfig:((Y=(B=o.params)==null?void 0:B.colDef)==null?void 0:Y.context)||o.config,error:o.error,hovered:i.value,readOnly:o.readOnly,disabled:o.disabled,active:l}}),{componentState:u,metricConfig:d,internalValue:h}=Lk(c,i),f=Z(()=>{var Y,ne;let B=!1;if(["number","formula"].includes(d.value.metric_type.code)){const te=Number(o.value),z=Number((Y=d.value)==null?void 0:Y.format_value);Number.isFinite(z)&&z>=0&&(B=(((ne=te.toString().split(".")[1])==null?void 0:ne.length)||0)>z)}return B}),p=Z(()=>{var B;return!!((B=d.value)!=null&&B.morpheme_value)||u.value.isEmpty||f.value}),g=Z(()=>{var ne,te,z;if(u.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(u.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(u.value.isEmpty)return;const B=O.value,Y=(ne=d.value)==null?void 0:ne.morpheme_type;return Y==="prefix"?`${((te=d.value)==null?void 0:te.morpheme_value)||""} ${B}`.trim():Y==="suffix"?`${B} ${((z=d.value)==null?void 0:z.morpheme_value)||""}`.trim():B}),v=Z(()=>{const{format_type:B,format_value:Y}=d.value;if(B==="dropdown"&&typeof Y=="string"&&Y.startsWith("["))try{return JSON.parse(Y)}catch{return[]}return[]}),y=Z(()=>({disabled:o.disabled,error:u.value.isError,inputRef:r,wrapperRef:a,clickable:!A.value,readOnly:o.readOnly||A.value,isEmpty:u.value.isEmpty})),{argsMain:b,isHover:S}=ms(y),C=(B,Y,ne="en-US")=>new Intl.NumberFormat(ne,{minimumFractionDigits:Y,maximumFractionDigits:Y}).format(B),E=Z(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const B=o.value,{format_type:Y,format_value:ne,mapping:te}=d.value;if(te&&typeof te=="object"&&!Array.isArray(te)){const z=te[`!${B}`];if(z)return z}if(Y==="dropdown"){const z=v.value.find(pe=>String(pe.name)===String(B));if(z)return z.name}if(typeof B=="string"){const z=Number(B);return Number.isNaN(z)?B:B.replace(/[.-]/g,"").length>16?R(B,ne):R(z,ne)}return typeof B=="number"?R(B,ne):String(B)}),R=(B,Y)=>{const ne=Number.parseInt(String(Y)||"2",10),te=Number.isFinite(ne)&&ne>=0?ne:2;try{if(typeof B=="string"){const z=B.split("."),pe=z[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),q=z[1]?z[1].substring(0,te).padEnd(te,"0"):"0".repeat(te);return te>0?`${pe}.${q}`:pe}return C(B,te)}catch(z){return console.error("Error formatting metric value:",z,{num:B,decimals:te}),String(B)}},T=(B,Y)=>{const ne=Number.parseInt(String(Y)||"2",10),te=Number.isFinite(ne)&&ne>=0?ne:2;try{if(typeof B=="string"){const z=B.split("."),pe=z[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),q=z[1]?z[1].length:0,k=Math.max(te,q),N=z[1]?z[1].padEnd(k,"0"):"0".repeat(k);return k>0?`${pe}.${N}`:pe}return new Intl.NumberFormat("en-US",{minimumFractionDigits:te,maximumFractionDigits:20}).format(B)}catch(z){return console.error("Error formatting exact metric value:",z,{num:B,decimals:te}),String(B)}},A=Z(()=>{var B;return((B=d.value)==null?void 0:B.metric_type.code)==="formula"}),O=Z(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const B=o.value,{format_type:Y,format_value:ne,mapping:te}=d.value;if(te&&typeof te=="object"&&!Array.isArray(te)){const z=te[`!${B}`];if(z)return z}if(Y==="dropdown"){const z=v.value.find(pe=>String(pe.name)===String(B));if(z)return z.name}if(typeof B=="string"){const z=Number(B);return Number.isNaN(z)?B:B.replace(/[.-]/g,"").length>16?T(B,ne):T(z,ne)}return typeof B=="number"?T(B,ne):String(B)}),{tooltip:I}=PF(""),D=async B=>{B.stopPropagation(),B.preventDefault(),B.stopImmediatePropagation();try{await navigator.clipboard.writeText(O.value),I.value="Copied",setTimeout(()=>{I.value="Copy"},3e3)}catch(Y){console.error("Failed to copy text:",Y),I.value="Copy failed",setTimeout(()=>{I.value="Copy"},3e3)}};Je(()=>o.value,(B,Y)=>{const ne=Number(B);Number.isFinite(ne)&&ne!==h.value?h.value=ne:B==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const P=()=>{i.value=!0},M=()=>{i.value=!1};return(B,Y)=>We((W(),Ke(vs,Jt(U(b),{onMouseenter:P,style:{"--icon-size":"24px"},onMouseleave:M,ref_key:"wrapperRef",ref:a,actived:U(l),bordered:!0}),{suffix:ye(()=>[o.disabled?Ye("",!0):(W(),ae("div",{key:0,class:ee([B.$style.suffix,"wrapper-suffix"])},[i.value&&!U(u).isEmpty&&!U(u).isError?We((W(),Ke(gt,{key:0,variant:["icon","secondary"],size:24,onClick:Pt(D,["prevent","stop"])},{default:ye(()=>[fe(at,{src:"Copy",source:"remote",size:12})]),_:1})),[[U(s),{content:U(I),hideOnClick:!1,contentClass:"extra-padding"}]]):Ye("",!0)],2))]),default:ye(()=>[be("div",{class:ee(B.$style["metric-wrapper"]),"aria-label":U(d).format_value||void 0},[be("div",{class:ee([B.$style["metric-content"],o.disabled?B.$style.disabled:""])},[!U(u).isError&&U(u).isEmpty?(W(),ae(xt,{key:0},[U(u).pendingCalculation?We((W(),ae("span",{key:0,class:ee(B.$style["metric-empty"])},[...Y[0]||(Y[0]=[nt(" - ",-1)])],2)),[[U(s),"Can’t calculate yet. Complete required fields."]]):U(u).isEmpty?(W(),ae("span",{key:1,class:ee(B.$style["metric-empty"])}," - ",2)):Ye("",!0)],64)):Ye("",!0),U(u).isError?We((W(),ae("div",{key:1,class:ee(B.$style["metric-error"])},[...Y[1]||(Y[1]=[nt(" Error ",-1)])],2)),[[U(s),"Something went wrong. Review formula, inputs and retry."]]):Ye("",!0),!U(u).isEmpty&&!U(u).isError?We((W(),ae("span",{key:2,class:ee([B.$style["metric-value"],U(S)?B.$style.hovered:"",{[B.$style.disabled]:o.disabled}])},[nt(mt(E.value),1)],2)),[[U(s),{content:g.value,bypassOverflowCheck:p.value}]]):Ye("",!0)],2)],10,WX)]),_:1},16,["actived"])),[[U(n),{isLoading:U(u).isLoading}]])}}),[["__cssModules",{$style:{"metric-wrapper":"_metric-wrapper_7otc0_1","metric-content":"_metric-content_7otc0_5",disabled:"_disabled_7otc0_15","metric-value":"_metric-value_7otc0_19",hovered:"_hovered_7otc0_19","metric-error":"_metric-error_7otc0_23","with-morpheme":"_with-morpheme_7otc0_38","with-formula-icon":"_with-formula-icon_7otc0_41","metric-value--number":"_metric-value--number_7otc0_47","metric-value--currency":"_metric-value--currency_7otc0_47","metric-value--percentage":"_metric-value--percentage_7otc0_47","metric-morpheme":"_metric-morpheme_7otc0_51","metric-empty":"_metric-empty_7otc0_64","metric-icon":"_metric-icon_7otc0_71"}}]]),zX={key:0,style:{color:"#6b6b6b"}},jX=St(it({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue"],setup(e,{emit:t}){const n=Yt,s={START_ASC:{value:"start_asc",label:"Soonest to furthest start",id:"start_asc"},START_DESC:{value:"start_desc",label:"Furthest to soonest start",id:"start_desc"},DUE_ASC:{value:"due_asc",label:"Soonest to furthest due",id:"due_asc"},DUE_DESC:{value:"due_desc",label:"Furthest to soonest due",id:"due_desc"}},o={desc:{value:"desc",label:"Newest to oldest",id:"desc"},asc:{value:"asc",label:"Oldest to newest",id:"asc"}},i={asc:{value:"asc",label:"Smallest to largest",id:"asc"},desc:{value:"desc",label:"Largest to smallest",id:"desc"}},r={asc:{value:"asc",label:"Ascending",id:"asc"},desc:{value:"desc",label:"Descending",id:"desc"}},a=e,l={assignees:"default",completedOn:"date",dateRange:"dateRange",id:"number",isArchived:"default",isCompleted:"default",isDeleted:"default",isProcessing:"default",isStarted:"default",lastUpdated:"date",name:"default",status:"default",permissions:"default",options:"default",disabled:"number"},c=Z(()=>{var x,P;if(a.headerType)return a.headerType;if(((P=(x=a.params)==null?void 0:x.column)==null?void 0:P.getColId()).includes("metric"))return"default";const D=a.headerType??a.params.column.getColId();return l[D]||"default"}),u=V(),d=()=>{var D,x,P;const I=(x=(D=a.params)==null?void 0:D.column)==null?void 0:x.getColDef();if((P=I.colId)!=null&&P.includes("metric")){if(I.context.is_primary==1)return"primary";if(I.context.is_point_metric==1)return"secondary"}};qd(()=>{u.value=d()}),Zt(()=>{u.value=d()});const h=Z(()=>{var I,D;return((D=(I=a.params)==null?void 0:I.column.getColDef().context)==null?void 0:D.morpheme_value)||void 0}),f=Z(()=>{var I;return(I=a.params)==null?void 0:I.displayName}),p=Z(()=>{let I=[];switch(c.value){case"dateRange":I=Object.values(s).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;case"date":I=Object.values(o).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;case"number":I=Object.values(i).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break;default:I=Object.values(r).map(D=>({...D,selected:v.value===D.value,type:"text",hover:T.value===D.value}));break}return v.value!=="none"&&I.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:T.value=="none"}),I}),g=Z(()=>String(v.value).endsWith("asc")?"SortUp":String(v.value).endsWith("desc")?"SortDown":"Sort"),v=V(a.modelValue??"none"),y=I=>{E("update:modelValue",I),E("sort-changed",I)},b=I=>{v.value=I},S=Ri(()=>{if(c.value==="date"||c.value==="default"||c.value==="number"){let I;v.value==="none"?I="asc":v.value==="asc"?I="desc":I="none",v.value=I}else{const I=[s.START_ASC.value,s.START_DESC.value,s.DUE_ASC.value,s.DUE_DESC.value,"none"],x=(I.indexOf(v.value)+1)%I.length;v.value=I[x]}},sr),C=Z(()=>{if(v.value==="none")return"No sorting applied";const I=p.value.find(D=>D.value===v.value);return(I==null?void 0:I.label)||""}),E=t,R=Z(()=>{if(a.disabled&&!a.readOnly)return"var(--disabled-color)";if(v.value!=="none")return"var(--primary-color-hover)"});Je(()=>a.modelValue,I=>{I!=v.value&&(v.value=I)}),Je(v,I=>{I!==a.modelValue&&y(I)});const T=V(v.value);Je(()=>v.value,I=>{T.value=I});const A=I=>{var M,B;if(a.readOnly||a.disabled)return;let D=0;I.key==="ArrowDown"?D=1:I.key==="ArrowUp"&&(D=-1);const x=p.value.findIndex(Y=>Y.value===T.value),P=p.value.length;if(I.key==="Enter"||I.key===" ")I.preventDefault(),v.value=T.value,(M=O.value)==null||M.hide();else if(D!==0){I.preventDefault();let Y=(x+D+P)%P;T.value=p.value[Y].value}else I.key==="Escape"&&((B=O.value)==null||B.hide())},O=V(null);return Zt(()=>{var I,D;(D=(I=O.value)==null?void 0:I.$el)==null||D.addEventListener("keydown",A)}),_l(()=>{var I,D;(D=(I=O.value)==null?void 0:I.$el)==null||D.removeEventListener("keydown",A)}),(I,D)=>(W(),Ke(cS,{ref_key:"dropdownRef",ref:O,options:p.value,label:f.value,readOnly:a.readOnly,disabled:a.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:U(S),onSelect:D[0]||(D[0]=x=>b(x))},{prefix:ye(()=>[fe(gt,{variant:["text"],onClick:U(S),size:"small"},{default:ye(()=>[We((W(),ae("b",null,[nt(mt(f.value),1)])),[[U(n),{content:f.value}]]),h.value?(W(),ae("small",zX," ("+mt(h.value)+") ",1)):Ye("",!0),u.value=="primary"?We((W(),ae("div",{key:1,class:ee(I.$style["icon-metric"])},[fe(at,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[U(n),"Woohoo metric"]]):Ye("",!0),u.value=="secondary"?We((W(),ae("div",{key:2,class:ee(I.$style["icon-metric"])},[fe(at,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[U(n),"Point Metric"]]):Ye("",!0)]),_:1},8,["onClick"])]),iconDropdown:ye(()=>[We(fe(at,{src:g.value,source:"remote",color:R.value},null,8,["src","color"]),[[U(n),C.value]])]),_:1},8,["options","label","readOnly","disabled","onHandleClick"]))}}),[["__cssModules",{$style:{"icon-metric":"_icon-metric_nh30n_1",iconSorting:"_iconSorting_nh30n_9","button-group":"_button-group_nh30n_15","ab-table-button":"_ab-table-button_nh30n_26","button-main":"_button-main_nh30n_32","button-dropdown-trigger":"_button-dropdown-trigger_nh30n_37",headerSorting:"_headerSorting_nh30n_47"}}]]),KX=["disabled","readonly","checked","indeterminate"],Bk=St(it({__name:"Checkbox",props:{modelValue:{},disabled:{type:Boolean},readOnly:{type:Boolean},focusIndex:{},tooltipText:{},allowIndeterminate:{type:Boolean},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=Yt,s=Gr,o=e,i=t,r=Z(()=>{if(typeof o.size=="string"){if(["small","medium","large"].includes(o.size))switch(o.size){case"small":return"14px";case"large":return"24px";case"medium":default:return"20px"}if(o.size.endsWith("px"))return o.size}return typeof o.size=="number"?`${o.size}px`:"20px"}),a=Z(()=>o.allowIndeterminate?[$t.UNCHECK,$t.INDETERMINATE,$t.CHECKED]:[$t.UNCHECK,$t.CHECKED]),l=Z(()=>{if(typeof o.tooltipText=="string"||!o.tooltipText)return o.tooltipText||"";switch(u.value){case $t.UNCHECK:return o.tooltipText.unchecked;case $t.INDETERMINATE:return o.tooltipText.indeterminate;case $t.CHECKED:return o.tooltipText.checked;default:return""}}),c=()=>{if(h.value)return;const p=(a.value.indexOf(u.value)+1)%a.value.length;u.value=a.value[p]},u=V(typeof o.modelValue=="boolean"?o.modelValue?$t.CHECKED:$t.UNCHECK:o.modelValue),d=Z(()=>({checked:u.value===$t.CHECKED,indeterminate:u.value===$t.INDETERMINATE,none:u.value===$t.UNCHECK})),h=Z(()=>o.disabled||o.readOnly);return Je(()=>u.value,f=>{i("update:modelValue",f===$t.CHECKED)}),(f,p)=>We((W(),ae("input",{disabled:o.disabled,key:u.value,readonly:o.readOnly,type:"checkbox",class:ee([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:c,"aria-label":"Select All Items",style:ln({"--input-size":r.value})},null,46,KX)),[[U(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[U(s),o.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_npdz3_84",large:"_large_npdz3_87",medium:"_medium_npdz3_90"}}]]),qX=St(it({name:"HeaderCheckbox",__name:"HeaderCheckbox",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=e,n=Yt,s=Vm(),{setSelectionStatus:o}=s,{rowCount:i,selectionStatus:r}=Xs(s),a=V(new Set);Je(r,C=>{o(C)},{immediate:!0});const l=Z(()=>r.value!==$t.UNCHECK),c=Z(()=>({checked:r.value===$t.CHECKED,indeterminate:r.value===$t.INDETERMINATE,UNCHECK:r.value===$t.UNCHECK})),u=Z(()=>({[$t.UNCHECK]:"Click to select all",[$t.INDETERMINATE]:"Click to clear selection",[$t.CHECKED]:"Click to clear selection"})[r.value]||"Select items"),d=Z(()=>{const C=[{label:"Select all",value:"INDETERMINATE",type:"text",clickable:!0,id:"indeterminate"}];return l.value&&C.push({label:"None",value:"UNCHECK",type:"text",clickable:!0,id:"uncheck"}),C}),h=C=>({selected:C.getSelectedRows().length,total:i.value.total,loaded:i.value.loaded}),f=({api:C,state:E})=>{if(C)if(E===$t.UNCHECK)C.deselectAll(),a.value.clear(),r.value=E;else if(E===$t.CHECKED){const R=new Set;C.forEachNode(T=>{T.isSelected()&&R.add(T.id||"")}),a.value=R,C.forEachNode(T=>T.setSelected(!0)),r.value=E}else C.forEachNode(R=>R.setSelected(!0)),r.value=E},p=()=>{var R;const C=(R=t.params)==null?void 0:R.api;if(!C){console.error("[HeaderCheckbox] There is no API available");return}const E={[$t.UNCHECK]:$t.INDETERMINATE,[$t.INDETERMINATE]:$t.UNCHECK,[$t.CHECKED]:$t.UNCHECK};f({api:C,state:E[r.value]})},g=C=>{var T;const E=(T=t.params)==null?void 0:T.api;if(!E){console.error("no api");return}const R={INDETERMINATE:$t.INDETERMINATE,GLOBAL:$t.CHECKED,UNCHECK:$t.UNCHECK};f({api:E,state:R[C]})},v=Ri(C=>{const{selected:E,total:R}=h(C);if(R==0){r.value=$t.UNCHECK;return}E===R?r.value=$t.CHECKED:E===0?r.value=$t.UNCHECK:r.value=$t.INDETERMINATE},300);let y=[];const b=C=>{v(C)};Zt(()=>{var A;const C=(A=t.params)==null?void 0:A.api;if(!C)return;const E=O=>v(O.api),R=()=>b(C),T=()=>b(C);C.addEventListener("selectionChanged",E),C.addEventListener("rowDataUpdated",R),C.addEventListener("modelUpdated",R),y=[()=>C.removeEventListener("selectionChanged",E),()=>C.removeEventListener("rowDataUpdated",R),()=>C.removeEventListener("modelUpdated",T)]}),Qn(()=>{y.forEach(C=>C())});const S=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(C,E)=>(W(),Ke(cS,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:ye(()=>[We((W(),Ke(Bk,{"tab-index":"8",id:S,disabled:t.disabled,key:U(r),readonly:t.readOnly,type:"checkbox",checked:c.value.checked,indeterminate:c.value.indeterminate,modelValue:U(r),"onUpdate:modelValue":E[0]||(E[0]=R=>pn(r)?r.value=R:null),onChange:p,"aria-label":U(r)===U($t).CHECKED?"All items selected":"Select visible items",class:ee(C.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[U(n),{content:u.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_uj7ro_1","button-group":"_button-group_uj7ro_62","button-main":"_button-main_uj7ro_62",headerCheckbox:"_headerCheckbox_uj7ro_66"}}]]),YX={key:1},ZX=St(it({name:"StatusRenderer",__name:"StatusRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=So,n=Yt,s=e,{isEditing:o}=_u(s),i=V(null),r=V(null),a=Z(()=>s.value),l=Z(()=>a.value===void 0),c=Z(()=>{var g;return((g=a.value)==null?void 0:g.name)||"No status"}),u=Z(()=>{var g;return{disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:sj((g=a.value)==null?void 0:g.label),inputRef:i,wrapperRef:r,clickable:!s.disabled&&!s.readOnly,active:o}}),{argsMain:d,isHover:h}=ms(u),f=Z(()=>{var g;return((g=a.value)==null?void 0:g.color)||"red"}),p=Z(()=>new Mn(f.value).isLight()?"#000":"#fff");return(g,v)=>We((W(),Ke(U(vs),Jt(U(d),{ref_key:"wrapperRef",ref:r,bordered:!0,style:{background:`${f.value} !important`,color:p.value,"--border-color":!U(o)&&!U(h)?"#f3f5f8":void 0}}),{default:ye(()=>[l.value?Ye("",!0):(W(),ae("div",{key:0,class:ee(g.$style["status-renderer"])},[a.value?We((W(),ae("div",{key:0,class:ee(g.$style["status-renderer__status-name"])},[nt(mt(c.value),1)],2)),[[U(n),{content:c.value,delay:[1e3,0]}]]):l.value?Ye("",!0):(W(),ae("div",YX,"No status"))],2))]),_:1},16,["style"])),[[U(t),{isLoading:l.value}]])}}),[["__cssModules",{$style:{"status-renderer":"_status-renderer_108pu_1","status-renderer__color-code":"_status-renderer__color-code_108pu_10","status-renderer__status-name":"_status-renderer__status-name_108pu_20"}}]]),$k=St(it({__name:"PopupLayout",props:{popupName:{},showOverlay:{type:Boolean,default:!0},overlayOpacity:{default:.5},closeOnOverlayClick:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0}},emits:["shown","hidden"],setup(e,{expose:t,emit:n}){const s=e,{popupRef:o,show:i,hide:r,isVisible:a}=E7({useTrigger:!1,arrow:!1,centered:!0,showOverlay:s.showOverlay,overlayOpacity:s.overlayOpacity,closeOnOverlayClick:s.closeOnOverlayClick,appendTo(u){return document.body}}),l=u=>{s.closeOnEscape&&u.key==="Escape"&&a.value&&r()};Zt(()=>{document.addEventListener("keydown",l)}),Qn(()=>{document.removeEventListener("keydown",l)}),t({show:i,hide:r,isVisible:a});const c=n;return Je(()=>a.value,u=>{c(u?"shown":"hidden")}),(u,d)=>{const h=wo("tooltip");return W(),ae("div",{ref_key:"popupRef",ref:o,class:ee(u.$style.popupContainer)},[be("div",{class:ee(u.$style.popupWrapper)},[be("div",{class:ee(u.$style.header)},[be("span",{class:ee(u.$style["header-title"])},mt(e.popupName),3),We((W(),Ke(gt,{style:{position:"absolute",top:"0",right:"0"},variant:"text",onClick:U(r),"aria-label":"Close popup"},{default:ye(()=>[fe(at,{src:"Xmark"})]),_:1},8,["onClick"])),[[h,"Close"]])],2),be("div",{class:ee(u.$style.body)},[Tt(u.$slots,"default")],2),be("div",{class:ee(u.$style.footer)},[Tt(u.$slots,"footer")],2)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_73gw5_1",popupWrapper:"_popupWrapper_73gw5_5",popupFadeIn:"_popupFadeIn_73gw5_1",header:"_header_73gw5_19","header-title":"_header-title_73gw5_28",body:"_body_73gw5_38",footer:"_footer_73gw5_43"}}]]),XX={...{list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch basic information."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{success:"Deletion successful.",error:"Deletion failed. Please try again."},delete_thumbnail:{success:"Deletion successful.",error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{success:"Deletion successful.",error:"Deletion failed. Please try again."},bulkArchive:{success:"Archive successful.",error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."},createNewItem:{},getAssignableAssignees:{},getAssignableStatuses:{},getFilterStatuses:{}},offline:{error:"You are currently offline. Please check your network connection."}};class JX extends Error{}class Ua extends JX{constructor(){super("Zone is an abstract class")}}class Hk{get type(){throw new Ua}get name(){throw new Ua}get ianaName(){return this.name}get isUniversal(){throw new Ua}offsetName(t,n){throw new Ua}formatOffset(t,n){throw new Ua}offset(t){throw new Ua}equals(t){throw new Ua}get isValid(){throw new Ua}}const uS=new Map;function QX(e){let t=uS.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),uS.set(e,t)),t}const eJ={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function tJ(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,r,a,l,c,u]=s;return[r,o,i,a,l,c,u]}function nJ(e,t){const n=e.formatToParts(t),s=[];for(let o=0;o<n.length;o++){const{type:i,value:r}=n[o],a=eJ[i];i==="era"?s[a]=r:$m(a)||(s[a]=parseInt(r,10))}return s}const dS=new Map;class Bm extends Hk{static create(t){let n=dS.get(t);return n===void 0&&dS.set(t,n=new Bm(t)),n}static resetCache(){dS.clear(),uS.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Bm.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return iJ(t,n,s,this.name)}formatOffset(t,n){return Gm(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const s=QX(this.name);let[o,i,r,a,l,c,u]=s.formatToParts?nJ(s,n):tJ(s,n);a==="BC"&&(o=-Math.abs(o)+1);const h=oJ({year:o,month:i,day:r,hour:l===24?0:l,minute:c,second:u,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let hS=null;class Pu extends Hk{static get utcInstance(){return hS===null&&(hS=new Pu(0)),hS}static instance(t){return t===0?Pu.utcInstance:new Pu(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Pu(Uk(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Gm(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Gm(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Gm(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function $m(e){return typeof e>"u"}function Hm(e,t=2){const n=e<0;let s;return n?s="-"+(""+-e).padStart(t,"0"):s=(""+e).padStart(t,"0"),s}function Gk(e){if(!($m(e)||e===null||e===""))return parseInt(e,10)}function sJ(e){if(!($m(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function oJ(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function iJ(e,t,n,s=null){const o=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const r={timeZoneName:t,...i},a=new Intl.DateTimeFormat(n,r).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Uk(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const s=parseInt(t,10)||0,o=n<0||Object.is(n,-0)?-s:s;return n*60+o}function Gm(e,t){const n=Math.trunc(Math.abs(e/60)),s=Math.trunc(Math.abs(e%60)),o=e>=0?"+":"-";switch(t){case"short":return`${o}${Hm(n,2)}:${Hm(s,2)}`;case"narrow":return`${o}${n}${s>0?`:${s}`:""}`;case"techie":return`${o}${Hm(n,2)}${Hm(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const Wk=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Au(...e){const t=e.reduce((n,s)=>n+s.source,"");return RegExp(`^${t}$`)}function ku(...e){return t=>e.reduce(([n,s,o],i)=>{const[r,a,l]=i(t,o);return[{...n,...r},a||s,l]},[{},null,1]).slice(0,2)}function zk(...e){return(t,n)=>{const s={};let o;for(o=0;o<e.length;o++)s[e[o]]=Gk(t[n+o]);return[s,null,n+o]}}const jk=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,rJ=`(?:${jk.source}?(?:\\[(${Wk.source})\\])?)?`,Kk=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,qk=RegExp(`${Kk.source}${rJ}`),fS=RegExp(`(?:[Tt]${qk.source})?`),aJ=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,lJ=/(\d{4})-?W(\d\d)(?:-?(\d))?/,cJ=/(\d{4})-?(\d{3})/,uJ=zk("weekYear","weekNumber","weekDay"),dJ=zk("year","ordinal"),hJ=/(\d{4})-(\d\d)-(\d\d)/,Yk=RegExp(`${Kk.source} ?(?:${jk.source}|(${Wk.source}))?`),fJ=RegExp(`(?: ${Yk.source})?`);function Ou(e,t,n){const s=e[t];return $m(s)?n:Gk(s)}function pJ(e,t){return[{year:Ou(e,t),month:Ou(e,t+1,1),day:Ou(e,t+2,1)},null,t+3]}function Mu(e,t){return[{hours:Ou(e,t,0),minutes:Ou(e,t+1,0),seconds:Ou(e,t+2,0),milliseconds:sJ(e[t+3])},null,t+4]}function rf(e,t){const n=!e[t]&&!e[t+1],s=Uk(e[t+1],e[t+2]),o=n?null:Pu.instance(s);return[{},o,t+3]}function af(e,t){const n=e[t]?Bm.create(e[t]):null;return[{},n,t+1]}Au(aJ,fS),Au(lJ,fS),Au(cJ,fS),Au(qk),ku(pJ,Mu,rf,af),ku(uJ,Mu,rf,af),ku(dJ,Mu,rf,af),ku(Mu,rf,af),ku(Mu),Au(hJ,fJ),Au(Yk),ku(Mu,rf,af);function Nu(e){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(e)}var ys;(function(e){e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}"})(ys||(ys={})),ys.review,ys.review_take,ys.review_scene,ys.review_rendition,ys.review_frame,ys.review_rendition_comment,ys.review_comment,ys.scene_hub,ys.hub_rendition,ys.hub_comment,ys.people_insight,ys.people_detail,ys.project,ys.woohoo,ys.update,ys.core,ys.project_focusMode;var pS=null;function gJ(e){pS=e}function Um(){if(!pS)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return pS}function Zk(){try{var e=Um();return e.t("errorMessages.fallback.unknownError")}catch{return"An error occurred. Please try again or contact support."}}function mJ(e,t,n,s){var o=e.replace(/{field}/g,t);if(s&&Nu(s)==="object")Object.keys(s).forEach(function(r){var a="{".concat(r,"}"),l=s[r];Array.isArray(l)?l=l.join(", "):r==="value"&&(s.min||s.max)&&(l="".concat(s.min||s.value," and ").concat(s.max||s.value)),o=o.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var i=n[0]||"";n.length>1?i="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(i=n[0].join(", ")),o=o.replace(/{value}/g,i)}return o}function vJ(e,t){for(var n=Object.keys(t),s=0,o=n;s<o.length;s++){var i=o[s],r=Array.isArray(t[i])?t[i].join(", "):String(t[i]);e=e.replace(new RegExp("\\{".concat(i,"\\}"),"g"),r)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function Xk(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function Jk(e,t){if(!e||Nu(e)!=="object")return null;try{var n=Um();if(e.validation&&e.validation.fields)for(var s=e.validation.fields,o=Object.keys(s),i=0,r=o;i<r.length;i++){var a=r[i],l=s[a];if(l&&l.rule){var c=l.rule,u=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var y,b=t.toUpperCase();v=(y=p[g])===null||y===void 0||(y=y.errorMessages)===null||y===void 0||(y=y[b])===null||y===void 0||(y=y.validation_rules)===null||y===void 0?void 0:y[c]}if(!v){var S;v=(S=p[g])===null||S===void 0||(S=S.errorMessages)===null||S===void 0||(S=S.GEN)===null||S===void 0||(S=S.validation_rules)===null||S===void 0?void 0:S[c]}if(v&&typeof v=="string")return mJ(v,a,u,d)}catch(C){console.error("Error in validation rules",C)}}}}catch(C){return console.error("Error in getValidationErrorMessage:",C),null}return null}function yJ(e){if(!e)return Zk();var t=e.code,n=e.error,s=e.details,o=e.message;if(Xk(s)&&s){var i=Jk(s,n==null?void 0:n.type);if(console.log("[Error Utils Debug]",i),i)return t!==""?"[".concat(t,"] ").concat(i):i;try{var r=Um();return r.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(n&&Nu(n)==="object"&&n.type&&n.key){var a=n.type.toUpperCase();try{var l,c,u,d="errorMessages.".concat(a,".").concat(n.key),h=Um(),f=((l=h.messages)===null||l===void 0?void 0:l.value)||h.messages,p=((c=h.locale)===null||c===void 0?void 0:c.value)||h.locale,g=(u=f[p])===null||u===void 0||(u=u.errorMessages)===null||u===void 0||(u=u[a])===null||u===void 0?void 0:u[n.key];if(g&&typeof g=="string"){var v=g;return s!=null&&s.context&&(v=vJ(v,s.context),console.log("[Error Utils Debug]",v)),t!==""?"[".concat(t,"] ").concat(v):v}}catch(b){console.error("[Error Utils Debug]",b)}}if(n&&Nu(n)!=="object"&&Xk(s)){var y=Jk(s);if(y)return t!==""?"[".concat(t,"] ").concat(y):y}return o||Zk()}var wJ={GEN:{general_error:"General Error",validation_error:"Validation error occurred.",data_locked:"Update failed. Record(s) are locked or currently being updated. You may try again later.",unauthenticated:"Authentication required. Please log in to continue.",unauthorized:"Access denied. You don’t have permission to view this.",not_found:"Resource not found. Check link or try again.",server_error:"Something went wrong on our end. Please try again later.",validation_rules:{required:"The {field} field is required",unique:"The {field} field must be unique",email:"{field} must be a valid email address",emails:"Invalid email(s) pattern",email_exists:"{field} already exists in workspace {value}",regex:"The {field} format is invalid",min:"{field} must be at least {value} characters",max:"{field} cannot exceed {value} characters",between:"{field} must be between {value} characters",numeric:"The {field} must be a number",integer:"The {field} must be an integer",date:"The {field} must be a valid date",after:"The {field} must be after {value}",before:"The {field} must be before {value}",image:"The {field} must be an image",mimes:"The {field} must be a file of type: {value}",max_file_size:"The {field} size cannot exceed {value}MB",confirmed:"The {field} confirmation does not match",same:"The {field} must match {value}",exists:"The Selected {field} is invalid",password_requirements:"The {field} does not meet security requirements",decimal:"Update failed. Maximum allowed decimal places is {value}.",before_or_equal:"{field} must be a date before or equal {value}.",after_or_equal:"{field} must be a date after or equal {value}."}},MRC:{validation_rules:{not_in:"Update failed. These values are not allowed: {value}.",in:"Update failed. Only these values are allowed: {value}.",between:"Update failed. Enter a value between {value}."},excess_decimal_places:"Update failed. Maximum allowed decimal places is {value}."},PPL:{invite_deleted_user:"Invitation failed. Users deleted from the workspace can't be re-invited. Please contact support.",insufficient_seats:"Invitation failed. No seats remaining. Purchase seat(s) to continue."},TM:{NO_ENTITY_TO_UNDEPLOY:"Undeploy failed. No entity specified.",NO_TEAM_EDITOR_ROLE:"No team editor role."},DIR:{has_project_admin_access:"Update failed. User has project access by default.",NO_EDIT_ENTITY_TEAM_ACCESS:"No permission to edit entity team."},AS:{"invalid_field (TBD)":"Something went wrong with account creation. Please contact support."},custom_default_msg:{general:{invalid_data:"Invalid data provided",retry:"Try again later."},network:{offline:"You are currently offline. Please check your network connection.",request_timeout:"Your request has timed out. Please ensure your internet connection is stable.",network_problem:"Network problem. Request timed out. Please try again later.",network_connection_lost:"Network connection lost",gateway_timeout:"Gateway Timeout"},auth:{token_expired:"Token refresh failed"},storage:{storage_limit:"Storage limit exceeded.",thumbnail_size_limit:"Thumbnail picture size can not exceed 2MB!",thumbnail_picture_format:"Thumbnail picture must be image format!",upload_limit:"Your upload exceeds the maximum allowed size"}},fallback:{unknownError:"An error occurred. Please try again or contact support."}};const lf=Yl("toast",()=>{const e=l=>{var c;if((l==null?void 0:l.apiCode)==="offline")o({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const u=yJ((c=l==null?void 0:l.res)==null?void 0:c.data);o({id:l==null?void 0:l.apiCode,type:"error",message:u})}},t=V([]),n=(l,c)=>{const u=XX[l];if(u){const d=u[c];if(d){o({id:l,type:c,message:d});return}}else o({id:l,type:c,message:l})},s=new Map,o=(l,c=5e3)=>{const u={...l,id:l.id??Date.now()+Math.random()};if(t.value.push(u),c>0){const d=Date.now(),h=setTimeout(()=>{i(u.id),s.delete(u.id)},c);s.set(u.id,{timeoutId:h,remainingTime:c,startTime:d})}};function i(l){t.value=t.value.filter(u=>u.id!==l);const c=s.get(l);c&&(clearTimeout(c.timeoutId),s.delete(l))}function r(l){const c=s.get(l);if(c){clearTimeout(c.timeoutId);const u=Date.now()-c.startTime;c.remainingTime=Math.max(0,c.remainingTime-u)}}function a(l){const c=s.get(l);if(c&&c.remainingTime>0){const u=setTimeout(()=>{i(l),s.delete(l)},c.remainingTime);c.timeoutId=u,c.startTime=Date.now()}}return{notifications:t,addNotification:o,removeNotification:i,showMessage:n,showErrorNetMessage:e,pauseAutoDismiss:r,resumeAutoDismiss:a}}),CJ=["onMouseenter","onMouseleave"],bJ=["innerHTML"],SJ=["innerHTML"],EJ=["data-tooltip"],_J={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},RJ=St(it({__name:"Snackbar",setup(e){const t=Yt,n=iU,s=lf(),{removeNotification:o}=s,{notifications:i}=Xs(s),r=f=>f.trim().startsWith("<svg"),a=V("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},c=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},u=V(new Set),d=f=>{var p;u.value.add(f),(p=s.pauseAutoDismiss)==null||p.call(s,f)},h=f=>{var p;u.value.delete(f),(p=s.resumeAutoDismiss)==null||p.call(s,f)};return(f,p)=>(W(),Ke(GG,{name:"list",tag:"div",class:ee(["notification-center",f.$style["notification-wrapper"]])},{default:ye(()=>[(W(!0),ae(xt,null,xn(U(i),g=>{var v;return We((W(),ae("div",{key:g.id,class:ee([f.$style["notification-item"],f.$style[`notification--${g.type||"info"}`],!(g!=null&&g.actions)||((v=g==null?void 0:g.actions)==null?void 0:v.length)==0?f.$style["snackbar-type"]:""]),onMouseenter:y=>d(g.id),onMouseleave:y=>h(g.id)},[be("p",{class:ee(f.$style.snackbar__message)},[be("span",{class:ee(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(W(),Ke(at,{key:0,src:"CircleCheck",source:"remote"})):Ye("",!0),!g.icon&&g.type=="interactive"?(W(),Ke(at,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(W(),Ke(at,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&r(g.icon)?(W(),ae("i",{key:3,class:ee(f.$style["icon-draw"]),innerHTML:g.icon},null,10,bJ)):g.icon&&!r(g.icon)?(W(),Ke(at,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ye("",!0)],2),be("span",{class:ee(f.$style["error-message"])},[be("span",{class:ee(f.$style.message),innerHTML:g.message},null,10,SJ)],2)],2),g.actions?(W(),ae("div",{key:0,class:ee(f.$style["actions-notification"]),"data-notification":"true"},[(W(!0),ae(xt,null,xn(g.actions,y=>(W(),Ke(gt,Jt({key:y.label},{ref_for:!0},y,{onClick:Pt(y.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:ye(()=>[y.btnIcon?(W(),Ke(at,{key:0,src:y.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ye("",!0)]),_:2},1040,["onClick"]))),128))],2)):Ye("",!0),g.type!=="interactive"?We((W(),ae("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[fe(gt,{variant:"secondary",onClick:y=>c(g.message),class:ee(f.$style["copy-btn"])},{prefix:ye(()=>[fe(at,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,EJ)),[[U(t),a.value]]):Ye("",!0),g.type=="interactive"?We((W(),ae("div",_J,[fe(gt,{variant:"tertiary",onClick:y=>U(o)(g.id),class:ee(f.$style["close-btn"]),size:18},{default:ye(()=>[fe(at,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[U(t),"Close"]]):Ye("",!0)],42,CJ)),[[U(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_egqq4_1","notification-item":"_notification-item_egqq4_15","notification--success":"_notification--success_egqq4_30","notification--error":"_notification--error_egqq4_36","close-btn":"_close-btn_egqq4_42","notification--info":"_notification--info_egqq4_45","notification--warning":"_notification--warning_egqq4_52","notification--interactive":"_notification--interactive_egqq4_59","snackbar-type":"_snackbar-type_egqq4_67",snackbar__message:"_snackbar__message_egqq4_76",message:"_message_egqq4_89","error-message":"_error-message_egqq4_97",snackbar__icon:"_snackbar__icon_egqq4_103","actions-notification":"_actions-notification_egqq4_112","icon-draw":"_icon-draw_egqq4_120","copy-btn":"_copy-btn_egqq4_128"}}]]);/*!
|
|
147
147
|
* vue-draggable-next v2.3.0
|
|
148
148
|
* (c) 2025 Anish George
|
|
149
149
|
* @license MIT
|
|
@@ -165,7 +165,7 @@ This will fail in production.`);r=jl,r._s.has(e)||(o?Ub(e,t,s,r):kA(e,s,r),j.env
|
|
|
165
165
|
<rect width="48" height="48" fill="white" transform="translate(0.617188 0.566406)"/>
|
|
166
166
|
</clipPath>
|
|
167
167
|
</defs>
|
|
168
|
-
</svg>`,i=lf(),{showMessage:r,showErrorNetMessage:a}=i,l=V(!1),c=V(!1),u=e,d=V({file:null,format:null,isValid:void 0}),h=Z(()=>{var O;return((O=u.acceptTypes)==null?void 0:O.map(I=>`.${I}`).join(","))||".xlsx,.xls,.csv"}),f=Z(()=>d.value.format?o(d.value.format):""),p=Z(()=>{var O;if(!d.value.isValid)return`Invalid file type. Please upload a ${(O=u.acceptTypes)==null?void 0:O.join(", ")} file.`}),g=Z(()=>!!d.value.file),v=()=>{var O;(O=s.value)==null||O.click()},y=Z(()=>d.value.file?d.value.file.name:""),b=O=>{var x;const I=u.acceptTypes||["xlsx","xls","csv"],D=(x=O.name.split(".").pop())==null?void 0:x.toLowerCase();return D?I.includes(D):!1},S=O=>{var D,x;const I=b(O);O&&I?(d.value.isValid=I,l.value=!1,d.value.file=O,d.value.format=((D=O.name.split(".").pop())==null?void 0:D.toLowerCase())||null):r(`Invalid file type. Please upload a ${(x=u.acceptTypes)==null?void 0:x.join(", ")} file.`,"error")},C=O=>{const I=O.target;if(I.files&&I.files[0]){const D=I.files[0];S(D)}},E=()=>{c.value=!0},R=()=>{c.value=!1},T=O=>{if(c.value=!1,O.dataTransfer&&O.dataTransfer.files&&O.dataTransfer.files[0]){const I=O.dataTransfer.files[0];S(I)}},A=n;return Je(d,O=>{A("update:modelValue",O)},{deep:!0}),t({internalValue:d,clear:()=>{s.value&&(s.value.value=""),d.value={file:null,format:null},l.value=!1}}),(O,I)=>{const D=wo("tooltip");return W(),ae("div",{class:ee([O.$style["drop-area"],{[O.$style["is-dragging"]]:c.value,[O.$style.error]:l.value}]),onDragenter:Pt(E,["prevent"]),onDragover:Pt(E,["prevent"]),onDragleave:Pt(R,["prevent"]),onDrop:Pt(T,["prevent"]),onClick:v},[g.value?Ye("",!0):(W(),ae("div",{key:0,class:ee(O.$style["drop-area-content"])},[fe(at,{src:"Upload",size:"24",color:"#3C9BFA"}),be("span",null,[fe(gt,{variant:["tertiary","text"],class:ee(O.$style["upload-btn"])},{default:ye(()=>[...I[0]||(I[0]=[nt(" Click to upload ",-1)])]),_:1},8,["class"]),I[1]||(I[1]=nt(" or drag and drop files here ",-1))])],2)),g.value?We((W(),ae("div",{key:1,class:ee(O.$style["drop-area-file"])},[be("div",{innerHTML:f.value},null,8,KQ),We((W(),ae("span",{class:ee(O.$style["file-name"])},[nt(mt(y.value),1)],2)),[[D,{content:y.value}]])],2)),[[D,p.value]]):Ye("",!0),be("input",{ref_key:"fileInput",ref:s,type:"file",style:{display:"none"},accept:h.value,onChange:C},null,40,qQ)],34)}}}),[["__cssModules",{$style:{"upload-btn":"_upload-btn_19ysm_1","drop-area":"_drop-area_19ysm_8","is-dragging":"_is-dragging_19ysm_18",error:"_error_19ysm_22","drop-area-content":"_drop-area-content_19ysm_26","drop-area-file":"_drop-area-file_19ysm_34","file-name":"_file-name_19ysm_42","clear-button":"_clear-button_19ysm_51"}}]]),YQ={style:{"text-align":"left",width:"100%"}},ZQ={style:{display:"flex","align-items":"center",gap:"2px",flex:"1","min-width":"0"}},XQ={key:0},JQ=["innerHTML"],QQ=20,eee=St(it({__name:"FilterAssignee",props:{maxVisible:{default:3},entityId:{},actived:{type:Boolean}},emits:["updated","cancel","start-update","escape"],setup(e,{expose:t,emit:n}){const s=Gr,o=e,{triggerRef:i}=us({appendTo:()=>document.querySelector(".filter-assignee"),toggleOnClick:!0,offset:[0,0]}),{triggerRef:r,popupRef:a,isVisible:l,hide:c}=us({toggleOnClick:!0,appendTo:()=>document.querySelector("#filter-assignee"),offset:[0,2]}),u=()=>{v()},d=me=>{c()},{triggerRef:h,popupRef:f,isVisible:p,hide:g,show:v}=us({toggleOnClick:!0,appendTo:()=>document.querySelector("#filter-assignee"),offset:[0,2]}),y=V(null),b=()=>{te.value=[],Pe.value=!1,Ne.value=!1,X.value="any"},S=Z(()=>l.value||p.value||o.actived),C=Z(()=>{var me;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((me=te.value)==null?void 0:me.length)===0,wrapperRef:i,active:S,bordered:!0}}),{argsMain:E,isFocus:R}=ms(C),T=Yt,A=n,O=Z(()=>{var me;return Math.max(0,(((me=te.value)==null?void 0:me.length)||0)-o.maxVisible)}),I=Z(()=>{var me;return O.value<=0?"":((me=te.value)==null?void 0:me.slice(o.maxVisible).map(ue=>ue.name).join(", "))||""}),D=V(!1),x=V(!1),P=V(null),M=V(1),B=V(!0),Y=V(0),ne=V(""),te=V([]),z=Z(()=>{var me;return((me=te.value)==null?void 0:me.map(ue=>ue.id))||[]}),{assigneeList:pe,mergedOptions:q}=um({...o,value:[]}),{apiServices:k}=es(!1,o),N=async(me=1,ue="",Ee=!1)=>{var ft,Ft,sn,Kt,Gt;if(!k.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(Ee?x.value=!0:D.value=!0,P.value=null,!((ft=k.value)!=null&&ft.getEntityUserRoles))throw new Error("API service getEntityUserRoles is undefined");const et=En.getInstance().getItem("ws.code");try{const on=await((Ft=k.value)==null?void 0:Ft.getEntityUserRoles({workspaceId:String(et),page:me,per_page:QQ,display_name_like:ue,entity_ids:String(o.entityId)})),Ve=((sn=gu(on.data))==null?void 0:sn.map(cm))??[];pe.value=Ee?tu(pe.value,Ve,"id"):Ve,Y.value=on.meta.total,B.value=(((Kt=on==null?void 0:on.meta)==null?void 0:Kt.current_page)||0)<(((Gt=on==null?void 0:on.meta)==null?void 0:Gt.last_page)||0),M.value=me}catch(on){console.error("Error fetching assignable users:",on),P.value="Failed to load assignable users"}finally{D.value=!1,x.value=!1}},Q=me=>{var ue,Ee;if((ue=te.value)!=null&&ue.some(et=>et.id===me.data.id)){te.value=(Ee=te.value)==null?void 0:Ee.filter(et=>et.id!==me.data.id);return}te.value=[...te.value||[],me.data]},ce=()=>{!x.value&&B.value&&N(M.value+1,ne.value,!0)},xe=Ri(async me=>{ne.value=me,await N(1,me,!1)},sr);Je(()=>p.value,me=>{var ue;me&&(N(1,ne.value,!1),(ue=y.value)==null||ue.focus())});const ge=Z(()=>{var me;return((me=te.value)==null?void 0:me.slice(0,3))||[]}),de=Z(()=>ge.value.map(me=>({id:me.id,name:me.name,initial:me.initial,avatarId:me.id,profile_image:me.profile_image,color:me.color,size:24,user:me}))),X=V("any"),De=me=>{X.value=me.id},re=Z(()=>[{label:"Any",value:"any",id:"any",selected:X.value==="any"},{label:"All",value:"all",id:"all",selected:X.value==="all"}]),Ae=Z(()=>X.value==="any"?"Any":X.value==="all"?"All":""),H=rv(),{user:oe}=Xs(H),ve=Z(()=>{if(!oe.value)return{id:"",name:"Unknown",initial:"U",profile_image:null,color:{bgColor:"#CCCCCC",textColor:"var(--background-color)"}};const me=oe.value;return{id:me.id,name:me.first_name,initial:"Me",profile_image:me.avatar,color:{bgColor:"#CCCCCC",textColor:"var(--background-color)"}}}),Ne=V(!1),Pe=V(!1);t({getData:()=>({assignees:te.value,showNoAssignee:Ne.value,showMe:Pe.value,selectedTypeId:X.value}),clear:b,setData:me=>{te.value=me.assignees||[],Ne.value=me.showNoAssignee||!1,Pe.value=me.showMe||!1,X.value=me.selectedTypeId||"any"},focus:()=>{var me;(me=r.value)==null||me.focus()},triggerFocus:()=>{var me;(me=r.value)==null||me.focus()}}),Je([te,Ne,Pe,X],()=>{A("updated",{assignees:te.value,showNoAssignee:Ne.value,showMe:Pe.value,selectedTypeId:X.value})},{deep:!0});const K=()=>{Ne.value=!1},$=()=>{var me;Pe.value=!1,te.value=(me=te.value)==null?void 0:me.filter(ue=>ue.id!==ve.value.id)},J=me=>{var ue;te.value=(ue=te.value)==null?void 0:ue.filter(Ee=>Ee.id!==me)},ie=me=>{var Ee;const ue=En.getInstance().getItem("ws.code");return((Ee=k.value)==null?void 0:Ee.getUserInformation(ue,me))||Promise.resolve(null)},ke=V(),Xe=()=>{A("escape")};return(me,ue)=>(W(),ae(xt,null,[be("div",{id:"filter-assignee",ref_key:"wrapperRef",ref:ke},[fe(vs,Jt(U(E),{ref_key:"triggerRef",ref:i,style:{"--box-padding":"0 0 0 0","--icon-size":"18px","--border-color":U(R)?"var(--primary-color)":null},onEscape:Xe}),{default:ye(({hovered:Ee,focused:et})=>[be("div",{class:ee([me.$style["assignee-row"],me.$style["assignee-selector"]])},[We((W(),ae("div",null,[We((W(),Ke(gt,{variant:"text",ref_key:"triggerRef1",ref:r,size:30,disabled:Ne.value,style:ln({background:Ne.value?"#D7D7D7":"transparent",borderRadius:Ne.value?"4px 0 0 4px":"",border:"none",width:"calc(100% - 2px)",height:"30px"}),onEscape:d},{suffix:ye(()=>[fe(at,{class:ee(["wrapper-suffix2",{"icon-up":U(l)}]),src:"ChevronDown",color:"#A6A6A6",size:"12"},null,8,["class"])]),default:ye(()=>[be("span",YQ,mt(Ae.value),1)]),_:1},8,["disabled","style"])),[[U(s),"3.0"]])])),[[U(T),{content:Ne.value?"Only ‘Any’ is allowed with ‘No assignee’":""}]]),be("span",{class:ee([me.$style.seperator])},null,2),We((W(),Ke(gt,{variant:"text",ref_key:"triggerRef2",ref:h,style:{flex:1,padding:0,width:"100%",justifyContent:"space-between",height:"30px",paddingRight:"2px","--button-size":"30px"},onEscape:U(g)},{default:ye(()=>[be("div",ZQ,[fe(of,{onClear:K,"disable-remove":!1},{default:ye(()=>[Ne.value&&X.value=="any"?(W(),ae("div",XQ,[be("div",{class:ee(me.$style["unassign-icon"])},[...ue[2]||(ue[2]=[be("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[be("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"white"})],-1)])],2)])):Ye("",!0)]),_:1}),fe(of,{tooltip:"Remove",onClear:$,"disable-remove":!1},{default:ye(()=>[Pe.value?(W(),Ke(Du,{key:0,user:ve.value,"show-profile":!1,"append-to":"parent"},null,8,["user"])):Ye("",!0)]),_:1}),(W(!0),ae(xt,null,xn(de.value,ft=>(W(),Ke(of,{tooltip:"Remove",key:ft.user.id,onClear:Ft=>J(ft.user.id),"disable-remove":!1},{default:ye(()=>[fe(Du,{user:ft.user,apiUpdateFunction:ie,appendTo:ke.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),O.value>0?We((W(),ae("div",{key:0,class:ee(me.$style["extra-avatars"])},[nt(" +"+mt(O.value),1)],2)),[[U(T),I.value]]):Ye("",!0)])]),suffix:ye(()=>{var ft;return[(te.value&&((ft=te.value)==null?void 0:ft.length)>0||Ne.value||Pe.value)&&(Ee||et||U(p))?(W(),ae("div",{key:0,class:"wrapper-suffix",onClick:Pt(b,["stop","prevent"])},[fe(gt,{variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[fe(at,{src:"XMarkSolid",size:"8"})]),_:1})])):Ye("",!0),be("div",{class:ee(["wrapper-suffix",{"icon-up":U(p)}]),onClick:u,style:{width:"24px",height:"24px",display:"flex","align-items":"center","justify-content":"center"}},[fe(at,{src:"ChevronDown",color:"#A6A6A6",size:"12"})],2)]}),_:2},1032,["onEscape"])),[[U(s),"3.1"]])],2)]),_:1},16,["style"])],512),be("div",{ref_key:"popupRef1",ref:a,class:ee([me.$style.list])},[(W(!0),ae(xt,null,xn(re.value,(Ee,et)=>(W(),Ke(Zl,Jt({focusIndex:`3.0.${et}`,class:me.$style["list-item"],style:{width:"100px",minWidth:"100px"}},{ref_for:!0},Ee,{key:Ee.id,onClick:ft=>De(Ee),onEscape:U(c)}),null,16,["focusIndex","class","onClick","onEscape"]))),128))],2),be("div",{ref_key:"popupRef2",ref:f},[fe(Xr,Jt({"selected-id":z.value},{...o},{options:U(q),loading:D.value,"loading-more":x.value,"has-more":B.value,ref_key:"searchListRef",ref:y,onSelect:ue[1]||(ue[1]=Ee=>{Q(Ee),A("start-update")}),onSearch:U(xe),onLoadMore:ce,onCancel:U(g)}),{"extra-item":ye(({query:Ee})=>[X.value=="any"&&Ee.trim()===""?(W(),Ke(Xb,{key:0,onClick:ue[0]||(ue[0]=()=>{Ne.value=!Ne.value}),actived:Ne.value},null,8,["actived"])):Ye("",!0)]),item:ye(({item:Ee,selectedIndex:et,isSelected:ft,handleSelect:Ft,handleItemHover:sn,getHighlightedLabel:Kt,query:Gt,idx:on})=>[fe(NA,{user:Ee.data,"multiple-select":!0,"append-to":ke.value,isMe:!1,hover:on===et,selected:ft(Ee),onClick:Pt(Ve=>Ft(Ee,Ve),["stop","prevent"]),onMouseover:Ve=>sn(on),"api-update-function":ie},{name:ye(()=>[Gt?We((W(),ae("span",{key:0,class:ee([me.$style["item-label"],me.$style.match]),style:{flex:"1"},innerHTML:Kt(Ee.label)},null,10,JQ)),[[U(T),{content:Ee.label}]]):We((W(),ae("span",{key:1,class:ee(me.$style["item-label"]),style:{flex:"1"}},[nt(mt(Ee.label),1)],2)),[[U(T),{content:Ee.label}]])]),_:2},1032,["user","append-to","hover","selected","onClick","onMouseover"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch","onCancel"])],512)],64))}}),[["__cssModules",{$style:{action:"_action_193he_1","item-assignee":"_item-assignee_193he_6","item-action":"_item-action_193he_6","item-label":"_item-label_193he_16","unassign-icon":"_unassign-icon_193he_25","error-message":"_error-message_193he_37","empty-state":"_empty-state_193he_47","assignee-row":"_assignee-row_193he_60","assignee-selector":"_assignee-selector_193he_72",seperator:"_seperator_193he_78","extra-avatars":"_extra-avatars_193he_87",list:"_list_193he_99"}}]]),tee={key:0,class:"wrapper-suffix"},nee=St(it({__name:"FilterArchiveStatus",props:{actived:{type:Boolean},focusIndex:{}},emits:["updated"],setup(e,{expose:t,emit:n}){const{triggerRef:s,popupRef:o,isVisible:i,hide:r}=us({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),a=V([]),l=Z(()=>[{label:"Archived",value:"archived",id:"archived",selected:a.value.includes("archived")},{label:"Not archived (Active)",value:"active",id:"active",selected:a.value.includes("active")}]),c=V("");Je(a,S=>{S.length===0?c.value="":S.length===2?c.value="All":S.length===1&&(c.value=S[0]==="archived"?"Archived":"Not archived (Active)")},{immediate:!0,deep:!0});const u=S=>{a.value.includes(S.value)?a.value=a.value.filter(C=>C!==S.value):a.value.push(S.value)},d=()=>{a.value=[]},h=e,f=()=>{a.value=[]},p=Z(()=>i.value||h.actived),g=Z(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:a.value.length===0,wrapperRef:s,active:p,bordered:!0})),{argsMain:v}=ms(g);t({getData:()=>a.value,clear:d,setData:S=>{a.value=S},reset:f,focus:()=>{var S;(S=b.value)==null||S.focus()},triggerFocus:()=>{var S;(S=b.value)==null||S.focus()}});const y=n;Je(()=>a.value,S=>{y("updated",S)},{deep:!0});const b=V(null);return(S,C)=>{const E=wo("focusable");return W(),ae(xt,null,[We((W(),Ke(vs,Jt({ref_key:"triggerRef",ref:s},U(v),{style:{"--icon-size":"18px"},class:"border-f3f5f8",onEscape:U(r)}),{suffix:ye(({hovered:R,focused:T})=>[a.value.length>0&&(R||T||U(i))?(W(),ae("div",tee,[fe(gt,{onClick:Pt(d,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[fe(at,{src:"XMarkSolid",size:"8"})]),_:1})])):Ye("",!0),be("div",{class:ee(["wrapper-suffix",{"icon-up":U(i)}])},[fe(at,{src:"ChevronDown",size:"12",color:"#A6A6A6"})],2)]),default:ye(()=>[(W(),ae("span",{key:c.value,style:{cursor:"pointer"}},mt(c.value),1))]),_:1},16,["onEscape"])),[[E,h.focusIndex]]),be("div",{ref_key:"popupRef",ref:o,class:ee(S.$style.list)},[(W(!0),ae(xt,null,xn(l.value,(R,T)=>(W(),Ke(Zl,Jt({class:S.$style["list-item"],focusIndex:`${h.focusIndex}.${T}`},{ref_for:!0},R,{key:R.id,onHandleClick:()=>u(R),onEscape:U(r)}),null,16,["class","focusIndex","onHandleClick","onEscape"]))),128))],2)],64)}}}),[["__cssModules",{$style:{list:"_list_10jzh_2","list-item":"_list-item_10jzh_9"}}]]),see={key:0,class:"wrapper-suffix"},oee=["innerHTML"],iee=St(it({__name:"FilterStatus",props:{entityId:{},actived:{type:Boolean}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const s=e,o={INITIAL_PAGE:1},{triggerRef:i,popupRef:r,isVisible:a,hide:l}=us({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),c=V([]),u=V([]),d=V(!1),h=V(!1),f=V(null),p=V(o.INITIAL_PAGE),g=V(!0),v=V(0),y=V(""),b=n,S=Z(()=>a.value||s.actived),C=Z(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value.length===0,wrapperRef:i,active:S,bordered:!0})),E=V(null),{argsMain:R}=ms(C),T=Z(()=>u.value.filter(z=>c.value.includes(z.id))),A=Z(()=>{const z=T.value.length;return z===0?"":z===1?T.value[0].label:`${z} statuses `}),O=Z(()=>c.value),I=Z(()=>{if(c.value.length===0)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const z=T.value[0],pe=String((z==null?void 0:z.color)||"white");return{backgroundColor:pe,border:Pg(pe,"white")?"1px solid #ccc":"1px solid #fff"}}),D=z=>({label:z.name,value:z.id,selected:c.value.includes(z.id),hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:z,id:z.id,color:z.color}),{apiServices:x}=es(!1,s),P=async(z=o.INITIAL_PAGE,pe="",q=!1)=>{var k,N;q?h.value=!0:d.value=!0,f.value=null;try{const Q=En.getInstance().getItem("ws.code"),ce=await((k=x.value)==null?void 0:k.getFilterStatuses(Q,s.entityId||"",{name_like:pe,page:z,entity_ids:s.entityId}));if(!ce){q||(u.value=[]),g.value=!1;return}const xe=ce.data.map(D);u.value=q?[...u.value,...xe]:xe,v.value=((N=ce.meta)==null?void 0:N.total)??ce.data.length,g.value=u.value.length<v.value,p.value=z}catch(Q){console.error("Error fetching statuses:",Q),f.value="Failed to load statuses",q||(u.value=[]),g.value=!1,b("error",f.value)}finally{d.value=!1,h.value=!1}},M=z=>{const pe=z.id;c.value.includes(pe)?c.value=c.value.filter(k=>k!==pe):c.value=[...c.value,pe],b("update:modelValue",c.value)},B=async()=>{!g.value||h.value||await P(p.value+1,y.value,!0)},Y=async z=>{y.value=z,p.value=o.INITIAL_PAGE,await P(o.INITIAL_PAGE,z,!1)},ne=()=>{c.value=[],b("update:modelValue",[])},te=()=>{var z;(z=r.value)==null||z.focus()};return Je(()=>a.value,z=>{var pe;z&&(P(1,y.value,!1),(pe=E.value)==null||pe.focus())}),Je(()=>c.value,z=>{b("updated",z)},{deep:!0}),t({focus:te,clear:ne,getData:()=>c.value,setData:z=>{c.value=z},triggerFocus:()=>{te()}}),(z,pe)=>{const q=wo("tooltip"),k=wo("focusable");return W(),ae(xt,null,[We((W(),Ke(vs,Jt({ref_key:"triggerRef",ref:i},U(R),{style:{"--icon-size":"18px"},class:"border-f3f5f8",actived:s.actived||U(a)}),{suffix:ye(({hovered:N,focused:Q})=>[T.value.length>0&&(N||Q||U(a))?(W(),ae("div",see,[fe(gt,{onClick:Pt(ne,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[fe(at,{src:"XMarkSolid",size:"8"})]),_:1})])):Ye("",!0),be("div",{class:ee(["wrapper-suffix",{"icon-up":U(a)}])},[fe(at,{src:"ChevronDown",size:"12",color:"#A6A6A6"})],2)]),default:ye(()=>[be("div",{class:ee(z.$style.status)},[T.value.length==1?(W(),ae("div",{key:0,class:ee(z.$style["color-indicator"]),style:ln(I.value)},null,6)):Ye("",!0),We((W(),ae("span",{class:ee({[z.$style.empty]:T.value.length===0,[z.$style["status-text"]]:!0})},[nt(mt(A.value),1)],2)),[[q,{content:A.value}]])],2)]),_:1},16,["actived"])),[[k,"3.2"]]),be("div",{ref_key:"popupRef",ref:r},[fe(Xr,{style:{width:"250px"},ref_key:"searchListRef",ref:E,"selected-id":O.value,options:u.value,loading:d.value,"loading-more":h.value,"has-more":g.value,error:f.value,onSearch:Y,onSelect:M,onLoadMore:B,onCancel:U(l)},{item:ye(({item:N,selectedIndex:Q,isSelected:ce,handleItemHover:xe,getHighlightedLabel:ge,query:de,idx:X})=>[(W(),Ke(kk,{key:N.value,status:N.data,selected:ce(N),onMouseover:De=>xe(X),onSelect:De=>M(N),hover:X===Q},{label:ye(()=>[de?We((W(),ae("span",{key:0,class:ee([z.$style["item-label"],z.$style.match]),style:{flex:"1"},innerHTML:ge(N.label)},null,10,oee)),[[q,{content:N.label}]]):We((W(),ae("span",{key:1,class:ee(z.$style["item-label"]),style:{flex:"1"}},[nt(mt(N.label),1)],2)),[[q,{content:N.label}]])]),_:2},1032,["status","selected","onMouseover","onSelect","hover"]))]),_:1},8,["selected-id","options","loading","loading-more","has-more","error","onCancel"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_pfzkz_2",status:"_status_pfzkz_6","color-indicator":"_color-indicator_pfzkz_12","count-badge":"_count-badge_pfzkz_26","status-text":"_status-text_pfzkz_33",empty:"_empty_pfzkz_42"}}],["__scopeId","data-v-799f5f99"]]),ree={key:0},aee={key:1},lee={key:0},cee={key:1},uee={key:0,class:"wrapper-suffix"},dee={key:1,class:"wrapper-suffix"},DO=St(it({__name:"FilterDateRange",props:{actived:{type:Boolean},focusIndex:{}},emits:["updated"],setup(e,{expose:t,emit:n}){const{triggerRef:s,popupRef:o,isVisible:i,hide:r}=us({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),a=e,l=()=>{c.value=[null,null]},c=V([null,null]),u=b=>{const S=om();return b?vt.fromJSDate(b,{zone:S}).toFormat("dd/MM/yyyy"):""},d=Z(()=>i.value||a.actived),h=Z(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value[0]===null&&c.value[1]===null,wrapperRef:s,active:d,bordered:!0})),{argsMain:f}=ms(h),p=V(!1),g=b=>{"start"in b&&b.start!==void 0&&(c.value[0]=b.start),"end"in b&&b.end!==void 0&&(c.value[1]=b.end)};t({getData:()=>c.value,clear:l,setData:b=>{c.value=b},focus:()=>{var b;(b=y.value)==null||b.focus()},triggerFocus:()=>{var b;(b=y.value)==null||b.focus()}});const v=n;Je(()=>c.value,b=>{v("updated",b)},{deep:!0});const y=V(null);return Je(()=>i.value,b=>{b&&setTimeout(()=>{var S;(S=y.value)==null||S.focus()},0)}),(b,S)=>{const C=wo("focusable");return W(),ae(xt,null,[We((W(),Ke(vs,Jt({ref_key:"triggerRef",ref:s},U(f),{actived:a.actived||U(i),style:{"--icon-size":"18px",cursor:"pointer"}}),{default:ye(({focused:E})=>[be("div",{class:ee(b.$style["date-time"])},[be("div",{class:ee(b.$style.date)},[c.value[0]==null&&(E||U(i))?(W(),ae("span",ree,"DD/MM/YYYY")):(W(),ae("span",aee,mt(u(c.value[0])),1))],2),c.value[0]!==null||c.value[1]!==null||E||U(i)?(W(),ae("div",{key:0,class:ee(b.$style.separator)}," → ",2)):Ye("",!0),be("div",{class:ee(b.$style.date)},[c.value[1]==null&&(E||U(i))?(W(),ae("span",lee,"DD/MM/YYYY")):(W(),ae("span",cee,mt(u(c.value[1])),1))],2)],2)]),suffix:ye(({hovered:E,focused:R})=>[(c.value[0]!==null||c.value[1]!==null)&&(E||R||U(i))?(W(),ae("div",uee,[fe(gt,{onClick:Pt(l,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[fe(at,{src:"XMarkSolid",size:"8"})]),_:1})])):(W(),ae("div",dee,[fe(at,{src:"Calendar",size:"12",color:"#A6A6A6"})]))]),_:1},16,["actived"])),[[C,a.focusIndex]]),be("div",{ref_key:"popupRef",ref:o},[U(i)?(W(),Ke(Dm,{key:0,immediatelyUpdate:!1,value:c.value,onConfirmed:g,ref_key:"calendarRef",ref:y,onClosed:U(r),onStartUpdate:S[0]||(S[0]=E=>p.value=!0),onFinishUpdate:S[1]||(S[1]=E=>p.value=!1)},null,8,["value","onClosed"])):Ye("",!0)],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_1695v_2","date-time":"_date-time_1695v_5",date:"_date_1695v_5",separator:"_separator_1695v_16"}}]]),hee=St(it({__name:"Switch",props:{modelValue:{type:String,required:!0,validator:e=>["AND","OR"].includes(e)},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,s=t,o=u=>{n.disabled||n.modelValue===u||s("update:modelValue",u)},i=Z(()=>n.modelValue==="AND"?"left":"right"),r=Z(()=>n.modelValue==="AND"&&l.value?l.value.offsetWidth+"px":n.modelValue==="OR"&&c.value?c.value.offsetWidth+"px":"calc(50% - 2px)"),a=Z(()=>n.modelValue==="AND"?"translateX(0)":n.modelValue==="OR"&&l.value?`translateX(${l.value.offsetWidth+2}px)`:"translateX(0)"),l=V(null),c=V(null);return(u,d)=>(W(),ae("div",{class:ee(["switch-container",{disabled:e.disabled}])},[be("div",{class:ee(["slider",i.value]),style:ln({width:r.value,transform:a.value})},null,6),be("div",{class:ee(["option",{active:e.modelValue==="AND"}]),onClick:d[0]||(d[0]=h=>o("AND")),ref_key:"andRef",ref:l}," AND ",2),be("div",{class:ee(["option",{active:e.modelValue==="OR"}]),onClick:d[1]||(d[1]=h=>o("OR")),ref_key:"orRef",ref:c}," OR ",2)],2))}}),[["__scopeId","data-v-0d89a13b"]]),wf=St(it({__name:"FilterRow",props:{logic:{},label:{},dataTabIndex:{},openDropdown:{type:Function}},setup(e,{expose:t}){const n=e;return t({triggerFocus:()=>{var s;(s=n.openDropdown)==null||s.call(n)}}),(s,o)=>(W(),ae("div",{class:ee(s.$style["filter-line"])},[be("div",{class:ee(s.$style["filter-logic"])},[be("span",{class:ee(s.$style["filter-tag"])},[Tt(s.$slots,"logic",{},()=>[nt(mt(e.logic),1)],!0)],2)],2),be("span",null,mt(e.label),1),be("span",null,[Tt(s.$slots,"is",{},()=>[o[0]||(o[0]=nt("is",-1))],!0)]),be("div",{class:ee(s.$style.selector)},[Tt(s.$slots,"default",{},void 0,!0)],2)],2))}}),[["__cssModules",{$style:{"filter-line":"_filter-line_1jv6h_1","filter-tag":"_filter-tag_1jv6h_8",selector:"_selector_1jv6h_27"}}],["__scopeId","data-v-1fe9c01d"]]),fee={style:{height:"18px","min-width":"18px",width:"18px",display:"flex","align-items":"center","justify-content":"center"}},pee=["fill"],gee=["fill"],mee=St(it({__name:"FilterBox",props:{loading:{type:Boolean},entityId:{}},emits:["update:assignees","apply-filter"],setup(e,{expose:t,emit:n}){const s=So,o=Yt,i=e,r={ACTIVE:"#000",DEFAULT:"#3C9BFA"},{hide:a,isVisible:l,triggerRef:c,popupRef:u}=us({toggleOnClick:!0,offset:[0,0],maxWidth:650,zIndex:2}),d=rv(),{workspaceUserRoleId:h}=Xs(d),f=n,p=V(null),g=V(null),v=V(null),y=V(null),b=V(null),S=V(null),C=V(null),E=(ge,de)=>{S.value={...S.value,[ge]:de}},R=Z(()=>h.value||""),T=V("AND"),A=Z(()=>I.value?r.ACTIVE:r.DEFAULT),O=Z(()=>({border:I.value?"1px solid var(--primary-color)":"",backgroundColor:I.value?"#F0F7FF":"",padding:I.value?"2px 8px 2px 8px":"2px 8px",gap:"0"})),I=Z(()=>M(C.value)>0),D=Z(()=>M(S.value)),x=Z(()=>D.value===0),P=Z(()=>D.value<=1),M=ge=>{var De,re,Ae;let de=0;return ge&&((((De=ge.assignees)==null?void 0:De.assignees)&&ge.assignees.assignees.length>0||((re=ge.assignees)==null?void 0:re.showMe)||((Ae=ge.assignees)==null?void 0:Ae.showNoAssignee))&&de++,ge.statuses&&ge.statuses.length>0&&de++,ge.archiveStatuses&&ge.archiveStatuses.length>0&&de++,ge.startDateRange&&(ge.startDateRange[0]||ge.startDateRange[1])&&de++,ge.dueDateRange&&(ge.dueDateRange[0]||ge.dueDateRange[1])&&de++),de},B=ge=>ge?ge.toISOString():null,Y=ge=>{var oe;const de={};if(!ge)return de;const X=((oe=ge.assignees)==null?void 0:oe.map(ve=>ve.id))||[],De=ge.showMe,re=ge.showNoAssignee,Ae=ge.selectedTypeId,H=De&&R.value?[...X,R.value]:X;if(H.length>0){const ve=H.join(",");Ae==="any"?de.assignee_any_ina=ve||"":Ae==="all"&&(de.assignee_all_ina=ve)}return re&&Ae==="any"&&(de.with_not_assigned="1"),de},ne=(ge,de)=>{const X={},[De,re]=ge;if(De&&re){const Ae=B(De),H=B(re);Ae&&H&&(X[`${de}_btw`]=`${Ae},${H}`)}else if(De){const Ae=B(De);Ae&&(X[`${de}_gte`]=Ae)}else if(re){const Ae=B(re);Ae&&(X[`${de}_lte`]=Ae)}return X},te=ge=>{const de={};Object.assign(de,Y(ge.assignees));const{statuses:X,archiveStatuses:De,startDateRange:re,dueDateRange:Ae}=ge;return X&&X.length>0&&(de.status_ina=X.join(",")),T.value=="AND"?de.condition_combine_type="and":de.condition_combine_type="or",re&&Object.assign(de,ne(re,"start_date")),Ae&&Object.assign(de,ne(Ae,"due_date")),!De||De.length===0?de.preflight_status="1":De&&De.length===1?de.status_eq=De[0]==="archived"?"0":"1":De&&De.length===2?de.status_eq="0,1":Object.keys(de).length===0&&(de.status_eq="1"),de},z=ge=>{if(ge===null||typeof ge!="object")return ge;if(ge instanceof Date)return new Date(ge.getTime());if(Array.isArray(ge))return ge.map(X=>z(X));const de={};for(const X in ge)Object.prototype.hasOwnProperty.call(ge,X)&&(de[X]=z(ge[X]));return de},pe=()=>{var ge,de,X,De,re;return{assignees:((ge=p.value)==null?void 0:ge.getData())||{},statuses:((de=g.value)==null?void 0:de.getData())||[],startDateRange:((X=v.value)==null?void 0:X.getData())||[null,null],dueDateRange:((De=y.value)==null?void 0:De.getData())||[null,null],archiveStatuses:((re=b.value)==null?void 0:re.getData())||[]}},q=ge=>{var de,X,De,re,Ae,H,oe,ve,Ne,Pe,K,$,J,ie,ke,Xe,me,ue,Ee,et;if(!ge){(X=(de=p.value)==null?void 0:de.clear)==null||X.call(de),(re=(De=g.value)==null?void 0:De.clear)==null||re.call(De),(H=(Ae=v.value)==null?void 0:Ae.clear)==null||H.call(Ae),(ve=(oe=y.value)==null?void 0:oe.clear)==null||ve.call(oe),(Pe=(Ne=b.value)==null?void 0:Ne.clear)==null||Pe.call(Ne);return}ge.assignees&&(($=(K=p.value)==null?void 0:K.setData)==null||$.call(K,ge.assignees)),ge.statuses&&((ie=(J=g.value)==null?void 0:J.setData)==null||ie.call(J,ge.statuses)),ge.startDateRange&&((Xe=(ke=v.value)==null?void 0:ke.setData)==null||Xe.call(ke,ge.startDateRange)),ge.dueDateRange&&((ue=(me=y.value)==null?void 0:me.setData)==null||ue.call(me,ge.dueDateRange)),ge.archiveStatuses&&((et=(Ee=b.value)==null?void 0:Ee.setData)==null||et.call(Ee,ge.archiveStatuses))},k=()=>{const ge=pe(),de=te(ge);C.value=z(ge),S.value=z(ge),f("apply-filter",de),a()},N=()=>{var ge,de,X,De,re,Ae,H,oe,ve,Ne;(de=(ge=p.value)==null?void 0:ge.clear)==null||de.call(ge),(De=(X=g.value)==null?void 0:X.clear)==null||De.call(X),(Ae=(re=v.value)==null?void 0:re.clear)==null||Ae.call(re),(oe=(H=y.value)==null?void 0:H.clear)==null||oe.call(H),(Ne=(ve=b.value)==null?void 0:ve.clear)==null||Ne.call(ve),T.value="AND",S.value=null},Q=()=>{N(),C.value=null,S.value=null,f("apply-filter",{preflight_status:"1"})};Je(D,ge=>{ge==0&&(T.value="AND")});const ce=()=>{C.value?(q(z(C.value)),S.value=z(C.value)):(q(null),S.value=null)};Je(l,(ge,de)=>{var X;ge&&((X=u.value)==null||X.focus()),ge&&!de?C.value&&(q(z(C.value)),S.value=z(C.value)):!ge&&de&&ce()}),t({getData:pe,getParams:()=>te(pe()),clear:Q,revertToCache:ce});const xe=V(null);return Je(()=>l.value,(ge,de)=>{ge&&!de&&Ct(()=>{setTimeout(()=>{var X;(X=xe.value)==null||X.click()},1e3)})}),(ge,de)=>{var De,re,Ae,H,oe,ve,Ne;const X=wo("focusable");return W(),ae(xt,null,[be("div",{ref_key:"triggerRef",ref:c},[We((W(),Ke(gt,{variant:["secondary"],actived:U(l)||I.value,style:ln({...O.value}),onEscape:U(a)},Yd({prefix:ye(()=>[We((W(),ae("div",fee,[(W(),ae("svg",{width:"14",height:"12",viewBox:"0 0 14 12",fill:A.value,xmlns:"http://www.w3.org/2000/svg"},[be("path",{d:"M0.0998533 0.587105C0.269063 0.228176 0.627991 0 1.02538 0H12.1009C12.4983 0 12.8572 0.228176 13.0264 0.587105C13.1956 0.946034 13.1443 1.36906 12.8931 1.67671L8.20395 7.40675V10.6653C8.20395 10.9755 8.02961 11.2601 7.75016 11.3986C7.47071 11.537 7.13998 11.5088 6.8913 11.3216L5.25048 10.091C5.04281 9.9372 4.92232 9.69364 4.92232 9.4347V7.40675L0.230606 1.67415C-0.0180804 1.36906 -0.0719197 0.94347 0.0998533 0.587105Z",fill:A.value},null,8,gee)],8,pee))])),[[U(o),"Filter"]])]),_:2},[I.value?{name:"suffix",fn:ye(()=>[We((W(),ae("div",{onClick:Pt(Q,["stop","prevent"]),style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center","margin-left":"4px"},class:"rotate-icon"},[fe(at,{src:"XMarkSolid",size:9})])),[[U(o),"Clear filter"]])]),key:"0"}:void 0]),1032,["actived","style","onEscape"])),[[U(s),{isLoading:e.loading,fullwidth:!0}],[X,"3"]])],512),be("div",{ref_key:"popupRef",ref:u,class:ee(ge.$style["basic-filter"]),tabindex:"0"},[be("div",{class:ee(ge.$style.row)},[be("span",{class:ee(ge.$style["filter-header"])},[de[6]||(de[6]=nt(" Filters ",-1)),We(fe(hee,{modelValue:T.value,"onUpdate:modelValue":de[0]||(de[0]=Pe=>T.value=Pe),disabled:P.value},null,8,["modelValue","disabled"]),[[U(o),{content:P.value?"Available only when more than one filter is selected.":"",bypassOverflowCheck:!0}]])],2),D.value>0||((re=(De=S.value)==null?void 0:De.assignees)==null?void 0:re.selectedTypeId)=="all"?(W(),ae("div",{key:0,class:ee(ge.$style.row)},[We((W(),Ke(gt,{size:"small",variant:"secondary",onClick:N,onEscape:U(a)},{default:ye(()=>[...de[7]||(de[7]=[nt(" Clear all ",-1)])]),_:1},8,["onEscape"])),[[X,"3.7"]])],2)):Ye("",!0)],2),fe(wf,{logic:T.value,label:"Assignee",openDropdown:(Ae=p.value)==null?void 0:Ae.triggerFocus},{logic:ye(()=>[...de[8]||(de[8]=[nt("Where",-1)])]),default:ye(()=>[fe(eee,{entityId:i.entityId,ref_key:"FilterAssigneeRef",ref:p,onUpdated:de[1]||(de[1]=Pe=>E("assignees",Pe)),onEscape:U(a)},null,8,["entityId","onEscape"])]),_:1},8,["logic","openDropdown"]),fe(wf,{logic:T.value,label:"Status",openDropdown:(H=g.value)==null?void 0:H.triggerFocus},{default:ye(()=>[fe(iee,{ref_key:"FilterStatusRef",ref:g,entityId:i.entityId,onUpdated:de[2]||(de[2]=Pe=>E("statuses",Pe))},null,8,["entityId"])]),_:1},8,["logic","openDropdown"]),fe(wf,{logic:T.value,openDropdown:(oe=v.value)==null?void 0:oe.triggerFocus,label:"Start Date"},{default:ye(()=>[fe(DO,{focusIndex:"3.3",ref_key:"FilterStartDateRangeRef",ref:v,onUpdated:de[3]||(de[3]=Pe=>E("startDateRange",Pe))},null,512)]),_:1},8,["logic","openDropdown"]),fe(wf,{logic:T.value,label:"Due Date",openDropdown:(ve=y.value)==null?void 0:ve.triggerFocus},{default:ye(()=>[fe(DO,{focusIndex:"3.4",ref_key:"FilterDueDateRangeRef",ref:y,onUpdated:de[4]||(de[4]=Pe=>E("dueDateRange",Pe))},null,512)]),_:1},8,["logic","openDropdown"]),fe(wf,{logic:T.value,label:"Archive Status",openDropdown:(Ne=b.value)==null?void 0:Ne.triggerFocus},{default:ye(()=>[fe(nee,{focusIndex:"3.5",ref_key:"FilterArchiveStatusRef",ref:b,onUpdated:de[5]||(de[5]=Pe=>E("archiveStatuses",Pe))},null,512)]),_:1},8,["logic","openDropdown"]),be("div",{class:ee([ge.$style.row,ge.$style["justify-end"]])},[We((W(),Ke(gt,{size:"small",onClick:k,disabled:x.value,onEscape:U(a)},{default:ye(()=>[...de[9]||(de[9]=[nt(" Apply filter ",-1)])]),_:1},8,["disabled","onEscape"])),[[X,"3.6"]])],2)],2)],64)}}}),[["__cssModules",{$style:{row:"_row_1mu3v_1","justify-end":"_justify-end_1mu3v_7","basic-filter":"_basic-filter_1mu3v_11","filter-grid":"_filter-grid_1mu3v_29","filter-line":"_filter-line_1mu3v_34","filter-tag":"_filter-tag_1mu3v_41",selector:"_selector_1mu3v_56","filter-header":"_filter-header_1mu3v_66"}}]]),vee=it({__name:"RatingRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{},sceneId:{}},setup(e,{expose:t}){var A;const n=So,s=e,{isEditing:o}=_u(s),{apiServices:i}=es(!0,s),r=Z(()=>{var O,I;return{value:a.value,metricConfig:((I=(O=s.params)==null?void 0:O.colDef)==null?void 0:I.context)||s.config,error:s.error,hovered:!1,readOnly:s.disabled,disabled:s.readOnly,apiServices:i.value}}),a=V(Number(s.value)),l=V(!1),{componentState:c,metricConfig:u,ICON_SIZE:d,ratingParams:h,standardNameforIcon:f}=Lk(r,l),{updateCellData:p}=EO((A=s.params)==null?void 0:A.api),g=O=>{a.value=O,b(O)},v=O=>{var I,D,x;p({rowId:String((D=(I=s.params)==null?void 0:I.data)==null?void 0:D.id),field:`metric_${((x=u.value)==null?void 0:x.id)||""}`,value:O})},y=Z(()=>{var O,I;return(s==null?void 0:s.sceneId)||((I=(O=s.params)==null?void 0:O.data)==null?void 0:I.id)}),b=async O=>{var I,D;v(void 0);try{const x=await((D=i.value)==null?void 0:D.bulkUpdateMetric({workspaceId:s.workspaceId||"",itemIds:[y.value||""],value:O==0||O===null?null:O.toString(),metricId:((I=u.value)==null?void 0:I.id)||""}));if((x==null?void 0:x.message)=="Done")v(O),S.value=O;else throw console.error("Rating update: failed, reverting to cached value"),v(S.value),new Error("Update failed")}catch(x){console.error("Rating update: error updating value, reverting to cached value",x),v(S.value)}},S=V(a.value),C=async()=>{Ct(()=>{setTimeout(async()=>{await b(a.value)},100)})},E=Z(()=>({disabled:s.disabled,error:c.value.isError,clickable:!0,readOnly:s.readOnly,isEmpty:c.value.isEmpty})),{argsMain:R}=ms(E),T=V(null);return t({focus:()=>{var O,I;(I=(O=T.value)==null?void 0:O.focus)==null||I.call(O)}}),(O,I)=>(W(),Ke(vs,Jt({style:{"--icon-size":"24px","--box-padding":"0 0 0 0"}},U(R),{ref:"wrapperRef",actived:U(o),size:32,tabindex:"0",bordered:!0}),{default:ye(()=>[U(c).isRating&&U(h).maxRating?We((W(),Ke($A,{key:0,ref_key:"ratingComponentRef",ref:T,modelValue:a.value,"onUpdate:modelValue":I[0]||(I[0]=D=>a.value=D),params:U(h),readOnly:s.readOnly,disabled:s.disabled,onHandleEnter:g},{icon:ye(()=>[fe(at,{onClick:C,source:"rating",src:U(f)()||"Star",size:U(d)},null,8,["src","size"])]),_:1},8,["modelValue","params","readOnly","disabled"])),[[U(n),{isLoading:U(c).isLoading,fullwidth:!0}]]):Ye("",!0)]),_:1},16,["actived"]))}});/*!
|
|
168
|
+
</svg>`,i=lf(),{showMessage:r,showErrorNetMessage:a}=i,l=V(!1),c=V(!1),u=e,d=V({file:null,format:null,isValid:void 0}),h=Z(()=>{var O;return((O=u.acceptTypes)==null?void 0:O.map(I=>`.${I}`).join(","))||".xlsx,.xls,.csv"}),f=Z(()=>d.value.format?o(d.value.format):""),p=Z(()=>{var O;if(!d.value.isValid)return`Invalid file type. Please upload a ${(O=u.acceptTypes)==null?void 0:O.join(", ")} file.`}),g=Z(()=>!!d.value.file),v=()=>{var O;(O=s.value)==null||O.click()},y=Z(()=>d.value.file?d.value.file.name:""),b=O=>{var x;const I=u.acceptTypes||["xlsx","xls","csv"],D=(x=O.name.split(".").pop())==null?void 0:x.toLowerCase();return D?I.includes(D):!1},S=O=>{var D,x;const I=b(O);O&&I?(d.value.isValid=I,l.value=!1,d.value.file=O,d.value.format=((D=O.name.split(".").pop())==null?void 0:D.toLowerCase())||null):r(`Invalid file type. Please upload a ${(x=u.acceptTypes)==null?void 0:x.join(", ")} file.`,"error")},C=O=>{const I=O.target;if(I.files&&I.files[0]){const D=I.files[0];S(D)}},E=()=>{c.value=!0},R=()=>{c.value=!1},T=O=>{if(c.value=!1,O.dataTransfer&&O.dataTransfer.files&&O.dataTransfer.files[0]){const I=O.dataTransfer.files[0];S(I)}},A=n;return Je(d,O=>{A("update:modelValue",O)},{deep:!0}),t({internalValue:d,clear:()=>{s.value&&(s.value.value=""),d.value={file:null,format:null},l.value=!1}}),(O,I)=>{const D=wo("tooltip");return W(),ae("div",{class:ee([O.$style["drop-area"],{[O.$style["is-dragging"]]:c.value,[O.$style.error]:l.value}]),onDragenter:Pt(E,["prevent"]),onDragover:Pt(E,["prevent"]),onDragleave:Pt(R,["prevent"]),onDrop:Pt(T,["prevent"]),onClick:v},[g.value?Ye("",!0):(W(),ae("div",{key:0,class:ee(O.$style["drop-area-content"])},[fe(at,{src:"Upload",size:"24",color:"#3C9BFA"}),be("span",null,[fe(gt,{variant:["tertiary","text"],class:ee(O.$style["upload-btn"])},{default:ye(()=>[...I[0]||(I[0]=[nt(" Click to upload ",-1)])]),_:1},8,["class"]),I[1]||(I[1]=nt(" or drag and drop files here ",-1))])],2)),g.value?We((W(),ae("div",{key:1,class:ee(O.$style["drop-area-file"])},[be("div",{innerHTML:f.value},null,8,KQ),We((W(),ae("span",{class:ee(O.$style["file-name"])},[nt(mt(y.value),1)],2)),[[D,{content:y.value}]])],2)),[[D,p.value]]):Ye("",!0),be("input",{ref_key:"fileInput",ref:s,type:"file",style:{display:"none"},accept:h.value,onChange:C},null,40,qQ)],34)}}}),[["__cssModules",{$style:{"upload-btn":"_upload-btn_19ysm_1","drop-area":"_drop-area_19ysm_8","is-dragging":"_is-dragging_19ysm_18",error:"_error_19ysm_22","drop-area-content":"_drop-area-content_19ysm_26","drop-area-file":"_drop-area-file_19ysm_34","file-name":"_file-name_19ysm_42","clear-button":"_clear-button_19ysm_51"}}]]),YQ={style:{"text-align":"left",width:"100%"}},ZQ={style:{display:"flex","align-items":"center",gap:"2px",flex:"1","min-width":"0"}},XQ={key:0},JQ=["innerHTML"],QQ=20,eee=St(it({__name:"FilterAssignee",props:{maxVisible:{default:3},entityId:{},actived:{type:Boolean}},emits:["updated","cancel","start-update","escape"],setup(e,{expose:t,emit:n}){const s=Gr,o=e,{triggerRef:i}=us({appendTo:()=>document.querySelector(".filter-assignee"),toggleOnClick:!0,offset:[0,0]}),{triggerRef:r,popupRef:a,isVisible:l,hide:c}=us({toggleOnClick:!0,appendTo:()=>document.querySelector("#filter-assignee"),offset:[0,2]}),u=()=>{v()},d=me=>{c()},{triggerRef:h,popupRef:f,isVisible:p,hide:g,show:v}=us({toggleOnClick:!0,appendTo:()=>document.querySelector("#filter-assignee"),offset:[0,2]}),y=V(null),b=()=>{te.value=[],Pe.value=!1,Ne.value=!1,X.value="any"},S=Z(()=>l.value||p.value||o.actived),C=Z(()=>{var me;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((me=te.value)==null?void 0:me.length)===0,wrapperRef:i,active:S,bordered:!0}}),{argsMain:E,isFocus:R}=ms(C),T=Yt,A=n,O=Z(()=>{var me;return Math.max(0,(((me=te.value)==null?void 0:me.length)||0)-o.maxVisible)}),I=Z(()=>{var me;return O.value<=0?"":((me=te.value)==null?void 0:me.slice(o.maxVisible).map(ue=>ue.name).join(", "))||""}),D=V(!1),x=V(!1),P=V(null),M=V(1),B=V(!0),Y=V(0),ne=V(""),te=V([]),z=Z(()=>{var me;return((me=te.value)==null?void 0:me.map(ue=>ue.id))||[]}),{assigneeList:pe,mergedOptions:q}=um({...o,value:[]}),{apiServices:k}=es(!1,o),N=async(me=1,ue="",Ee=!1)=>{var ft,Ft,sn,Kt,Gt;if(!k.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(Ee?x.value=!0:D.value=!0,P.value=null,!((ft=k.value)!=null&&ft.getEntityUserRoles))throw new Error("API service getEntityUserRoles is undefined");const et=En.getInstance().getItem("ws.code");try{const on=await((Ft=k.value)==null?void 0:Ft.getEntityUserRoles({workspaceId:String(et),page:me,per_page:QQ,display_name_like:ue,entity_ids:String(o.entityId)})),Ve=((sn=gu(on.data))==null?void 0:sn.map(cm))??[];pe.value=Ee?tu(pe.value,Ve,"id"):Ve,Y.value=on.meta.total,B.value=(((Kt=on==null?void 0:on.meta)==null?void 0:Kt.current_page)||0)<(((Gt=on==null?void 0:on.meta)==null?void 0:Gt.last_page)||0),M.value=me}catch(on){console.error("Error fetching assignable users:",on),P.value="Failed to load assignable users"}finally{D.value=!1,x.value=!1}},Q=me=>{var ue,Ee;if((ue=te.value)!=null&&ue.some(et=>et.id===me.data.id)){te.value=(Ee=te.value)==null?void 0:Ee.filter(et=>et.id!==me.data.id);return}te.value=[...te.value||[],me.data]},ce=()=>{!x.value&&B.value&&N(M.value+1,ne.value,!0)},xe=Ri(async me=>{ne.value=me,await N(1,me,!1)},sr);Je(()=>p.value,me=>{var ue;me&&(N(1,ne.value,!1),(ue=y.value)==null||ue.focus())});const ge=Z(()=>{var me;return((me=te.value)==null?void 0:me.slice(0,3))||[]}),de=Z(()=>ge.value.map(me=>({id:me.id,name:me.name,initial:me.initial,avatarId:me.id,profile_image:me.profile_image,color:me.color,size:24,user:me}))),X=V("any"),De=me=>{X.value=me.id},re=Z(()=>[{label:"Any",value:"any",id:"any",selected:X.value==="any"},{label:"All",value:"all",id:"all",selected:X.value==="all"}]),Ae=Z(()=>X.value==="any"?"Any":X.value==="all"?"All":""),H=rv(),{user:oe}=Xs(H),ve=Z(()=>{if(!oe.value)return{id:"",name:"Unknown",initial:"U",profile_image:null,color:{bgColor:"#CCCCCC",textColor:"var(--background-color)"}};const me=oe.value;return{id:me.id,name:me.first_name,initial:"Me",profile_image:me.avatar,color:{bgColor:"#CCCCCC",textColor:"var(--background-color)"}}}),Ne=V(!1),Pe=V(!1);t({getData:()=>({assignees:te.value,showNoAssignee:Ne.value,showMe:Pe.value,selectedTypeId:X.value}),clear:b,setData:me=>{te.value=me.assignees||[],Ne.value=me.showNoAssignee||!1,Pe.value=me.showMe||!1,X.value=me.selectedTypeId||"any"},focus:()=>{var me;(me=r.value)==null||me.focus()},triggerFocus:()=>{var me;(me=r.value)==null||me.focus()}}),Je([te,Ne,Pe,X],()=>{A("updated",{assignees:te.value,showNoAssignee:Ne.value,showMe:Pe.value,selectedTypeId:X.value})},{deep:!0});const K=()=>{Ne.value=!1},$=()=>{var me;Pe.value=!1,te.value=(me=te.value)==null?void 0:me.filter(ue=>ue.id!==ve.value.id)},J=me=>{var ue;te.value=(ue=te.value)==null?void 0:ue.filter(Ee=>Ee.id!==me)},ie=me=>{var Ee;const ue=En.getInstance().getItem("ws.code");return((Ee=k.value)==null?void 0:Ee.getUserInformation(ue,me))||Promise.resolve(null)},ke=V(),Xe=()=>{A("escape")};return(me,ue)=>(W(),ae(xt,null,[be("div",{id:"filter-assignee",ref_key:"wrapperRef",ref:ke},[fe(vs,Jt(U(E),{ref_key:"triggerRef",ref:i,style:{"--box-padding":"0 0 0 0","--icon-size":"18px","--border-color":U(R)?"var(--primary-color)":null},onEscape:Xe}),{default:ye(({hovered:Ee,focused:et})=>[be("div",{class:ee([me.$style["assignee-row"],me.$style["assignee-selector"]])},[We((W(),ae("div",null,[We((W(),Ke(gt,{variant:"text",ref_key:"triggerRef1",ref:r,size:30,disabled:Ne.value,style:ln({background:Ne.value?"#D7D7D7":"transparent",borderRadius:Ne.value?"4px 0 0 4px":"",border:"none",width:"calc(100% - 2px)",height:"30px"}),onEscape:d},{suffix:ye(()=>[fe(at,{class:ee(["wrapper-suffix2",{"icon-up":U(l)}]),src:"ChevronDown",color:"#A6A6A6",size:"12"},null,8,["class"])]),default:ye(()=>[be("span",YQ,mt(Ae.value),1)]),_:1},8,["disabled","style"])),[[U(s),"3.0"]])])),[[U(T),{content:Ne.value?"Only ‘Any’ is allowed with ‘No assignee’":""}]]),be("span",{class:ee([me.$style.seperator])},null,2),We((W(),Ke(gt,{variant:"text",ref_key:"triggerRef2",ref:h,style:{flex:1,padding:0,width:"100%",justifyContent:"space-between",height:"30px",paddingRight:"2px","--button-size":"30px"},onEscape:U(g)},{default:ye(()=>[be("div",ZQ,[fe(of,{onClear:K,"disable-remove":!1},{default:ye(()=>[Ne.value&&X.value=="any"?(W(),ae("div",XQ,[be("div",{class:ee(me.$style["unassign-icon"])},[...ue[2]||(ue[2]=[be("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[be("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"white"})],-1)])],2)])):Ye("",!0)]),_:1}),fe(of,{tooltip:"Remove",onClear:$,"disable-remove":!1},{default:ye(()=>[Pe.value?(W(),Ke(Du,{key:0,user:ve.value,"show-profile":!1,"append-to":"parent"},null,8,["user"])):Ye("",!0)]),_:1}),(W(!0),ae(xt,null,xn(de.value,ft=>(W(),Ke(of,{tooltip:"Remove",key:ft.user.id,onClear:Ft=>J(ft.user.id),"disable-remove":!1},{default:ye(()=>[fe(Du,{user:ft.user,apiUpdateFunction:ie,appendTo:ke.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),O.value>0?We((W(),ae("div",{key:0,class:ee(me.$style["extra-avatars"])},[nt(" +"+mt(O.value),1)],2)),[[U(T),I.value]]):Ye("",!0)])]),suffix:ye(()=>{var ft;return[(te.value&&((ft=te.value)==null?void 0:ft.length)>0||Ne.value||Pe.value)&&(Ee||et||U(p))?(W(),ae("div",{key:0,class:"wrapper-suffix",onClick:Pt(b,["stop","prevent"])},[fe(gt,{variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[fe(at,{src:"XMarkSolid",size:"8"})]),_:1})])):Ye("",!0),be("div",{class:ee(["wrapper-suffix",{"icon-up":U(p)}]),onClick:u,style:{width:"24px",height:"24px",display:"flex","align-items":"center","justify-content":"center"}},[fe(at,{src:"ChevronDown",color:"#A6A6A6",size:"12"})],2)]}),_:2},1032,["onEscape"])),[[U(s),"3.1"]])],2)]),_:1},16,["style"])],512),be("div",{ref_key:"popupRef1",ref:a,class:ee([me.$style.list])},[(W(!0),ae(xt,null,xn(re.value,(Ee,et)=>(W(),Ke(Zl,Jt({focusIndex:`3.0.${et}`,class:me.$style["list-item"],style:{width:"100px",minWidth:"100px"}},{ref_for:!0},Ee,{key:Ee.id,onClick:ft=>De(Ee),onEscape:U(c)}),null,16,["focusIndex","class","onClick","onEscape"]))),128))],2),be("div",{ref_key:"popupRef2",ref:f},[fe(Xr,Jt({"selected-id":z.value},{...o},{options:U(q),loading:D.value,"loading-more":x.value,"has-more":B.value,ref_key:"searchListRef",ref:y,onSelect:ue[1]||(ue[1]=Ee=>{Q(Ee),A("start-update")}),onSearch:U(xe),onLoadMore:ce,onCancel:U(g)}),{"extra-item":ye(({query:Ee})=>[X.value=="any"&&Ee.trim()===""?(W(),Ke(Xb,{key:0,onClick:ue[0]||(ue[0]=()=>{Ne.value=!Ne.value}),actived:Ne.value},null,8,["actived"])):Ye("",!0)]),item:ye(({item:Ee,selectedIndex:et,isSelected:ft,handleSelect:Ft,handleItemHover:sn,getHighlightedLabel:Kt,query:Gt,idx:on})=>[fe(NA,{user:Ee.data,"multiple-select":!0,"append-to":ke.value,isMe:!1,hover:on===et,selected:ft(Ee),onClick:Pt(Ve=>Ft(Ee,Ve),["stop","prevent"]),onMouseover:Ve=>sn(on),"api-update-function":ie},{name:ye(()=>[Gt?We((W(),ae("span",{key:0,class:ee([me.$style["item-label"],me.$style.match]),style:{flex:"1"},innerHTML:Kt(Ee.label)},null,10,JQ)),[[U(T),{content:Ee.label}]]):We((W(),ae("span",{key:1,class:ee(me.$style["item-label"]),style:{flex:"1"}},[nt(mt(Ee.label),1)],2)),[[U(T),{content:Ee.label}]])]),_:2},1032,["user","append-to","hover","selected","onClick","onMouseover"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch","onCancel"])],512)],64))}}),[["__cssModules",{$style:{action:"_action_193he_1","item-assignee":"_item-assignee_193he_6","item-action":"_item-action_193he_6","item-label":"_item-label_193he_16","unassign-icon":"_unassign-icon_193he_25","error-message":"_error-message_193he_37","empty-state":"_empty-state_193he_47","assignee-row":"_assignee-row_193he_60","assignee-selector":"_assignee-selector_193he_72",seperator:"_seperator_193he_78","extra-avatars":"_extra-avatars_193he_87",list:"_list_193he_99"}}]]),tee={key:0,class:"wrapper-suffix"},nee=St(it({__name:"FilterArchiveStatus",props:{actived:{type:Boolean},focusIndex:{}},emits:["updated"],setup(e,{expose:t,emit:n}){const{triggerRef:s,popupRef:o,isVisible:i,hide:r}=us({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),a=V([]),l=Z(()=>[{label:"Archived",value:"archived",id:"archived",selected:a.value.includes("archived")},{label:"Not archived (Active)",value:"active",id:"active",selected:a.value.includes("active")}]),c=V("");Je(a,S=>{S.length===0?c.value="":S.length===2?c.value="All":S.length===1&&(c.value=S[0]==="archived"?"Archived":"Not archived (Active)")},{immediate:!0,deep:!0});const u=S=>{a.value.includes(S.value)?a.value=a.value.filter(C=>C!==S.value):a.value.push(S.value)},d=()=>{a.value=[]},h=e,f=()=>{a.value=[]},p=Z(()=>i.value||h.actived),g=Z(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:a.value.length===0,wrapperRef:s,active:p,bordered:!0})),{argsMain:v}=ms(g);t({getData:()=>a.value,clear:d,setData:S=>{a.value=S},reset:f,focus:()=>{var S;(S=b.value)==null||S.focus()},triggerFocus:()=>{var S;(S=b.value)==null||S.focus()}});const y=n;Je(()=>a.value,S=>{y("updated",S)},{deep:!0});const b=V(null);return(S,C)=>{const E=wo("focusable");return W(),ae(xt,null,[We((W(),Ke(vs,Jt({ref_key:"triggerRef",ref:s},U(v),{style:{"--icon-size":"18px"},class:"border-f3f5f8",onEscape:U(r)}),{suffix:ye(({hovered:R,focused:T})=>[a.value.length>0&&(R||T||U(i))?(W(),ae("div",tee,[fe(gt,{onClick:Pt(d,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[fe(at,{src:"XMarkSolid",size:"8"})]),_:1})])):Ye("",!0),be("div",{class:ee(["wrapper-suffix",{"icon-up":U(i)}])},[fe(at,{src:"ChevronDown",size:"12",color:"#A6A6A6"})],2)]),default:ye(()=>[(W(),ae("span",{key:c.value,style:{cursor:"pointer"}},mt(c.value),1))]),_:1},16,["onEscape"])),[[E,h.focusIndex]]),be("div",{ref_key:"popupRef",ref:o,class:ee(S.$style.list)},[(W(!0),ae(xt,null,xn(l.value,(R,T)=>(W(),Ke(Zl,Jt({class:S.$style["list-item"],focusIndex:`${h.focusIndex}.${T}`},{ref_for:!0},R,{key:R.id,onHandleClick:()=>u(R),onEscape:U(r)}),null,16,["class","focusIndex","onHandleClick","onEscape"]))),128))],2)],64)}}}),[["__cssModules",{$style:{list:"_list_10jzh_2","list-item":"_list-item_10jzh_9"}}]]),see={key:0,class:"wrapper-suffix"},oee=["innerHTML"],iee=St(it({__name:"FilterStatus",props:{entityId:{},actived:{type:Boolean}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const s=e,o={INITIAL_PAGE:1},{triggerRef:i,popupRef:r,isVisible:a,hide:l}=us({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),c=V([]),u=V([]),d=V(!1),h=V(!1),f=V(null),p=V(o.INITIAL_PAGE),g=V(!0),v=V(0),y=V(""),b=n,S=Z(()=>a.value||s.actived),C=Z(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value.length===0,wrapperRef:i,active:S,bordered:!0})),E=V(null),{argsMain:R}=ms(C),T=Z(()=>u.value.filter(z=>c.value.includes(z.id))),A=Z(()=>{const z=T.value.length;return z===0?"":z===1?T.value[0].label:`${z} statuses `}),O=Z(()=>c.value),I=Z(()=>{if(c.value.length===0)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const z=T.value[0],pe=String((z==null?void 0:z.color)||"white");return{backgroundColor:pe,border:Pg(pe,"white")?"1px solid #ccc":"1px solid #fff"}}),D=z=>({label:z.name,value:z.id,selected:c.value.includes(z.id),hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:z,id:z.id,color:z.color}),{apiServices:x}=es(!1,s),P=async(z=o.INITIAL_PAGE,pe="",q=!1)=>{var k,N;q?h.value=!0:d.value=!0,f.value=null;try{const Q=En.getInstance().getItem("ws.code"),ce=await((k=x.value)==null?void 0:k.getFilterStatuses(Q,s.entityId||"",{name_like:pe,page:z,entity_ids:s.entityId}));if(!ce){q||(u.value=[]),g.value=!1;return}const xe=ce.data.map(D);u.value=q?[...u.value,...xe]:xe,v.value=((N=ce.meta)==null?void 0:N.total)??ce.data.length,g.value=u.value.length<v.value,p.value=z}catch(Q){console.error("Error fetching statuses:",Q),f.value="Failed to load statuses",q||(u.value=[]),g.value=!1,b("error",f.value)}finally{d.value=!1,h.value=!1}},M=z=>{const pe=z.id;c.value.includes(pe)?c.value=c.value.filter(k=>k!==pe):c.value=[...c.value,pe],b("update:modelValue",c.value)},B=async()=>{!g.value||h.value||await P(p.value+1,y.value,!0)},Y=async z=>{y.value=z,p.value=o.INITIAL_PAGE,await P(o.INITIAL_PAGE,z,!1)},ne=()=>{c.value=[],b("update:modelValue",[])},te=()=>{var z;(z=r.value)==null||z.focus()};return Je(()=>a.value,z=>{var pe;z&&(P(1,y.value,!1),(pe=E.value)==null||pe.focus())}),Je(()=>c.value,z=>{b("updated",z)},{deep:!0}),t({focus:te,clear:ne,getData:()=>c.value,setData:z=>{c.value=z},triggerFocus:()=>{te()}}),(z,pe)=>{const q=wo("tooltip"),k=wo("focusable");return W(),ae(xt,null,[We((W(),Ke(vs,Jt({ref_key:"triggerRef",ref:i},U(R),{style:{"--icon-size":"18px"},class:"border-f3f5f8",actived:s.actived||U(a)}),{suffix:ye(({hovered:N,focused:Q})=>[T.value.length>0&&(N||Q||U(a))?(W(),ae("div",see,[fe(gt,{onClick:Pt(ne,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[fe(at,{src:"XMarkSolid",size:"8"})]),_:1})])):Ye("",!0),be("div",{class:ee(["wrapper-suffix",{"icon-up":U(a)}])},[fe(at,{src:"ChevronDown",size:"12",color:"#A6A6A6"})],2)]),default:ye(()=>[be("div",{class:ee(z.$style.status)},[T.value.length==1?(W(),ae("div",{key:0,class:ee(z.$style["color-indicator"]),style:ln(I.value)},null,6)):Ye("",!0),We((W(),ae("span",{class:ee({[z.$style.empty]:T.value.length===0,[z.$style["status-text"]]:!0})},[nt(mt(A.value),1)],2)),[[q,{content:A.value}]])],2)]),_:1},16,["actived"])),[[k,"3.2"]]),be("div",{ref_key:"popupRef",ref:r},[fe(Xr,{style:{width:"250px"},ref_key:"searchListRef",ref:E,"selected-id":O.value,options:u.value,loading:d.value,"loading-more":h.value,"has-more":g.value,error:f.value,onSearch:Y,onSelect:M,onLoadMore:B,onCancel:U(l)},{item:ye(({item:N,selectedIndex:Q,isSelected:ce,handleItemHover:xe,getHighlightedLabel:ge,query:de,idx:X})=>[(W(),Ke(kk,{key:N.value,status:N.data,selected:ce(N),onMouseover:De=>xe(X),onSelect:De=>M(N),hovered:X===Q},{label:ye(()=>[de?We((W(),ae("span",{key:0,class:ee([z.$style["item-label"],z.$style.match]),style:{flex:"1"},innerHTML:ge(N.label)},null,10,oee)),[[q,{content:N.label}]]):We((W(),ae("span",{key:1,class:ee(z.$style["item-label"]),style:{flex:"1"}},[nt(mt(N.label),1)],2)),[[q,{content:N.label}]])]),_:2},1032,["status","selected","onMouseover","onSelect","hovered"]))]),_:1},8,["selected-id","options","loading","loading-more","has-more","error","onCancel"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_pfzkz_2",status:"_status_pfzkz_6","color-indicator":"_color-indicator_pfzkz_12","count-badge":"_count-badge_pfzkz_26","status-text":"_status-text_pfzkz_33",empty:"_empty_pfzkz_42"}}],["__scopeId","data-v-7b7476c5"]]),ree={key:0},aee={key:1},lee={key:0},cee={key:1},uee={key:0,class:"wrapper-suffix"},dee={key:1,class:"wrapper-suffix"},DO=St(it({__name:"FilterDateRange",props:{actived:{type:Boolean},focusIndex:{}},emits:["updated"],setup(e,{expose:t,emit:n}){const{triggerRef:s,popupRef:o,isVisible:i,hide:r}=us({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),a=e,l=()=>{c.value=[null,null]},c=V([null,null]),u=b=>{const S=om();return b?vt.fromJSDate(b,{zone:S}).toFormat("dd/MM/yyyy"):""},d=Z(()=>i.value||a.actived),h=Z(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value[0]===null&&c.value[1]===null,wrapperRef:s,active:d,bordered:!0})),{argsMain:f}=ms(h),p=V(!1),g=b=>{"start"in b&&b.start!==void 0&&(c.value[0]=b.start),"end"in b&&b.end!==void 0&&(c.value[1]=b.end)};t({getData:()=>c.value,clear:l,setData:b=>{c.value=b},focus:()=>{var b;(b=y.value)==null||b.focus()},triggerFocus:()=>{var b;(b=y.value)==null||b.focus()}});const v=n;Je(()=>c.value,b=>{v("updated",b)},{deep:!0});const y=V(null);return Je(()=>i.value,b=>{b&&setTimeout(()=>{var S;(S=y.value)==null||S.focus()},0)}),(b,S)=>{const C=wo("focusable");return W(),ae(xt,null,[We((W(),Ke(vs,Jt({ref_key:"triggerRef",ref:s},U(f),{actived:a.actived||U(i),style:{"--icon-size":"18px",cursor:"pointer"}}),{default:ye(({focused:E})=>[be("div",{class:ee(b.$style["date-time"])},[be("div",{class:ee(b.$style.date)},[c.value[0]==null&&(E||U(i))?(W(),ae("span",ree,"DD/MM/YYYY")):(W(),ae("span",aee,mt(u(c.value[0])),1))],2),c.value[0]!==null||c.value[1]!==null||E||U(i)?(W(),ae("div",{key:0,class:ee(b.$style.separator)}," → ",2)):Ye("",!0),be("div",{class:ee(b.$style.date)},[c.value[1]==null&&(E||U(i))?(W(),ae("span",lee,"DD/MM/YYYY")):(W(),ae("span",cee,mt(u(c.value[1])),1))],2)],2)]),suffix:ye(({hovered:E,focused:R})=>[(c.value[0]!==null||c.value[1]!==null)&&(E||R||U(i))?(W(),ae("div",uee,[fe(gt,{onClick:Pt(l,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[fe(at,{src:"XMarkSolid",size:"8"})]),_:1})])):(W(),ae("div",dee,[fe(at,{src:"Calendar",size:"12",color:"#A6A6A6"})]))]),_:1},16,["actived"])),[[C,a.focusIndex]]),be("div",{ref_key:"popupRef",ref:o},[U(i)?(W(),Ke(Dm,{key:0,immediatelyUpdate:!1,value:c.value,onConfirmed:g,ref_key:"calendarRef",ref:y,onClosed:U(r),onStartUpdate:S[0]||(S[0]=E=>p.value=!0),onFinishUpdate:S[1]||(S[1]=E=>p.value=!1)},null,8,["value","onClosed"])):Ye("",!0)],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_1695v_2","date-time":"_date-time_1695v_5",date:"_date_1695v_5",separator:"_separator_1695v_16"}}]]),hee=St(it({__name:"Switch",props:{modelValue:{type:String,required:!0,validator:e=>["AND","OR"].includes(e)},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,s=t,o=u=>{n.disabled||n.modelValue===u||s("update:modelValue",u)},i=Z(()=>n.modelValue==="AND"?"left":"right"),r=Z(()=>n.modelValue==="AND"&&l.value?l.value.offsetWidth+"px":n.modelValue==="OR"&&c.value?c.value.offsetWidth+"px":"calc(50% - 2px)"),a=Z(()=>n.modelValue==="AND"?"translateX(0)":n.modelValue==="OR"&&l.value?`translateX(${l.value.offsetWidth+2}px)`:"translateX(0)"),l=V(null),c=V(null);return(u,d)=>(W(),ae("div",{class:ee(["switch-container",{disabled:e.disabled}])},[be("div",{class:ee(["slider",i.value]),style:ln({width:r.value,transform:a.value})},null,6),be("div",{class:ee(["option",{active:e.modelValue==="AND"}]),onClick:d[0]||(d[0]=h=>o("AND")),ref_key:"andRef",ref:l}," AND ",2),be("div",{class:ee(["option",{active:e.modelValue==="OR"}]),onClick:d[1]||(d[1]=h=>o("OR")),ref_key:"orRef",ref:c}," OR ",2)],2))}}),[["__scopeId","data-v-0d89a13b"]]),wf=St(it({__name:"FilterRow",props:{logic:{},label:{},dataTabIndex:{},openDropdown:{type:Function}},setup(e,{expose:t}){const n=e;return t({triggerFocus:()=>{var s;(s=n.openDropdown)==null||s.call(n)}}),(s,o)=>(W(),ae("div",{class:ee(s.$style["filter-line"])},[be("div",{class:ee(s.$style["filter-logic"])},[be("span",{class:ee(s.$style["filter-tag"])},[Tt(s.$slots,"logic",{},()=>[nt(mt(e.logic),1)],!0)],2)],2),be("span",null,mt(e.label),1),be("span",null,[Tt(s.$slots,"is",{},()=>[o[0]||(o[0]=nt("is",-1))],!0)]),be("div",{class:ee(s.$style.selector)},[Tt(s.$slots,"default",{},void 0,!0)],2)],2))}}),[["__cssModules",{$style:{"filter-line":"_filter-line_1jv6h_1","filter-tag":"_filter-tag_1jv6h_8",selector:"_selector_1jv6h_27"}}],["__scopeId","data-v-1fe9c01d"]]),fee={style:{height:"18px","min-width":"18px",width:"18px",display:"flex","align-items":"center","justify-content":"center"}},pee=["fill"],gee=["fill"],mee=St(it({__name:"FilterBox",props:{loading:{type:Boolean},entityId:{}},emits:["update:assignees","apply-filter"],setup(e,{expose:t,emit:n}){const s=So,o=Yt,i=e,r={ACTIVE:"#000",DEFAULT:"#3C9BFA"},{hide:a,isVisible:l,triggerRef:c,popupRef:u}=us({toggleOnClick:!0,offset:[0,0],maxWidth:650,zIndex:2}),d=rv(),{workspaceUserRoleId:h}=Xs(d),f=n,p=V(null),g=V(null),v=V(null),y=V(null),b=V(null),S=V(null),C=V(null),E=(ge,de)=>{S.value={...S.value,[ge]:de}},R=Z(()=>h.value||""),T=V("AND"),A=Z(()=>I.value?r.ACTIVE:r.DEFAULT),O=Z(()=>({border:I.value?"1px solid var(--primary-color)":"",backgroundColor:I.value?"#F0F7FF":"",padding:I.value?"2px 8px 2px 8px":"2px 8px",gap:"0"})),I=Z(()=>M(C.value)>0),D=Z(()=>M(S.value)),x=Z(()=>D.value===0),P=Z(()=>D.value<=1),M=ge=>{var De,re,Ae;let de=0;return ge&&((((De=ge.assignees)==null?void 0:De.assignees)&&ge.assignees.assignees.length>0||((re=ge.assignees)==null?void 0:re.showMe)||((Ae=ge.assignees)==null?void 0:Ae.showNoAssignee))&&de++,ge.statuses&&ge.statuses.length>0&&de++,ge.archiveStatuses&&ge.archiveStatuses.length>0&&de++,ge.startDateRange&&(ge.startDateRange[0]||ge.startDateRange[1])&&de++,ge.dueDateRange&&(ge.dueDateRange[0]||ge.dueDateRange[1])&&de++),de},B=ge=>ge?ge.toISOString():null,Y=ge=>{var oe;const de={};if(!ge)return de;const X=((oe=ge.assignees)==null?void 0:oe.map(ve=>ve.id))||[],De=ge.showMe,re=ge.showNoAssignee,Ae=ge.selectedTypeId,H=De&&R.value?[...X,R.value]:X;if(H.length>0){const ve=H.join(",");Ae==="any"?de.assignee_any_ina=ve||"":Ae==="all"&&(de.assignee_all_ina=ve)}return re&&Ae==="any"&&(de.with_not_assigned="1"),de},ne=(ge,de)=>{const X={},[De,re]=ge;if(De&&re){const Ae=B(De),H=B(re);Ae&&H&&(X[`${de}_btw`]=`${Ae},${H}`)}else if(De){const Ae=B(De);Ae&&(X[`${de}_gte`]=Ae)}else if(re){const Ae=B(re);Ae&&(X[`${de}_lte`]=Ae)}return X},te=ge=>{const de={};Object.assign(de,Y(ge.assignees));const{statuses:X,archiveStatuses:De,startDateRange:re,dueDateRange:Ae}=ge;return X&&X.length>0&&(de.status_ina=X.join(",")),T.value=="AND"?de.condition_combine_type="and":de.condition_combine_type="or",re&&Object.assign(de,ne(re,"start_date")),Ae&&Object.assign(de,ne(Ae,"due_date")),!De||De.length===0?de.preflight_status="1":De&&De.length===1?de.status_eq=De[0]==="archived"?"0":"1":De&&De.length===2?de.status_eq="0,1":Object.keys(de).length===0&&(de.status_eq="1"),de},z=ge=>{if(ge===null||typeof ge!="object")return ge;if(ge instanceof Date)return new Date(ge.getTime());if(Array.isArray(ge))return ge.map(X=>z(X));const de={};for(const X in ge)Object.prototype.hasOwnProperty.call(ge,X)&&(de[X]=z(ge[X]));return de},pe=()=>{var ge,de,X,De,re;return{assignees:((ge=p.value)==null?void 0:ge.getData())||{},statuses:((de=g.value)==null?void 0:de.getData())||[],startDateRange:((X=v.value)==null?void 0:X.getData())||[null,null],dueDateRange:((De=y.value)==null?void 0:De.getData())||[null,null],archiveStatuses:((re=b.value)==null?void 0:re.getData())||[]}},q=ge=>{var de,X,De,re,Ae,H,oe,ve,Ne,Pe,K,$,J,ie,ke,Xe,me,ue,Ee,et;if(!ge){(X=(de=p.value)==null?void 0:de.clear)==null||X.call(de),(re=(De=g.value)==null?void 0:De.clear)==null||re.call(De),(H=(Ae=v.value)==null?void 0:Ae.clear)==null||H.call(Ae),(ve=(oe=y.value)==null?void 0:oe.clear)==null||ve.call(oe),(Pe=(Ne=b.value)==null?void 0:Ne.clear)==null||Pe.call(Ne);return}ge.assignees&&(($=(K=p.value)==null?void 0:K.setData)==null||$.call(K,ge.assignees)),ge.statuses&&((ie=(J=g.value)==null?void 0:J.setData)==null||ie.call(J,ge.statuses)),ge.startDateRange&&((Xe=(ke=v.value)==null?void 0:ke.setData)==null||Xe.call(ke,ge.startDateRange)),ge.dueDateRange&&((ue=(me=y.value)==null?void 0:me.setData)==null||ue.call(me,ge.dueDateRange)),ge.archiveStatuses&&((et=(Ee=b.value)==null?void 0:Ee.setData)==null||et.call(Ee,ge.archiveStatuses))},k=()=>{const ge=pe(),de=te(ge);C.value=z(ge),S.value=z(ge),f("apply-filter",de),a()},N=()=>{var ge,de,X,De,re,Ae,H,oe,ve,Ne;(de=(ge=p.value)==null?void 0:ge.clear)==null||de.call(ge),(De=(X=g.value)==null?void 0:X.clear)==null||De.call(X),(Ae=(re=v.value)==null?void 0:re.clear)==null||Ae.call(re),(oe=(H=y.value)==null?void 0:H.clear)==null||oe.call(H),(Ne=(ve=b.value)==null?void 0:ve.clear)==null||Ne.call(ve),T.value="AND",S.value=null},Q=()=>{N(),C.value=null,S.value=null,f("apply-filter",{preflight_status:"1"})};Je(D,ge=>{ge==0&&(T.value="AND")});const ce=()=>{C.value?(q(z(C.value)),S.value=z(C.value)):(q(null),S.value=null)};Je(l,(ge,de)=>{var X;ge&&((X=u.value)==null||X.focus()),ge&&!de?C.value&&(q(z(C.value)),S.value=z(C.value)):!ge&&de&&ce()}),t({getData:pe,getParams:()=>te(pe()),clear:Q,revertToCache:ce});const xe=V(null);return Je(()=>l.value,(ge,de)=>{ge&&!de&&Ct(()=>{setTimeout(()=>{var X;(X=xe.value)==null||X.click()},1e3)})}),(ge,de)=>{var De,re,Ae,H,oe,ve,Ne;const X=wo("focusable");return W(),ae(xt,null,[be("div",{ref_key:"triggerRef",ref:c},[We((W(),Ke(gt,{variant:["secondary"],actived:U(l)||I.value,style:ln({...O.value}),onEscape:U(a)},Yd({prefix:ye(()=>[We((W(),ae("div",fee,[(W(),ae("svg",{width:"14",height:"12",viewBox:"0 0 14 12",fill:A.value,xmlns:"http://www.w3.org/2000/svg"},[be("path",{d:"M0.0998533 0.587105C0.269063 0.228176 0.627991 0 1.02538 0H12.1009C12.4983 0 12.8572 0.228176 13.0264 0.587105C13.1956 0.946034 13.1443 1.36906 12.8931 1.67671L8.20395 7.40675V10.6653C8.20395 10.9755 8.02961 11.2601 7.75016 11.3986C7.47071 11.537 7.13998 11.5088 6.8913 11.3216L5.25048 10.091C5.04281 9.9372 4.92232 9.69364 4.92232 9.4347V7.40675L0.230606 1.67415C-0.0180804 1.36906 -0.0719197 0.94347 0.0998533 0.587105Z",fill:A.value},null,8,gee)],8,pee))])),[[U(o),"Filter"]])]),_:2},[I.value?{name:"suffix",fn:ye(()=>[We((W(),ae("div",{onClick:Pt(Q,["stop","prevent"]),style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center","margin-left":"4px"},class:"rotate-icon"},[fe(at,{src:"XMarkSolid",size:9})])),[[U(o),"Clear filter"]])]),key:"0"}:void 0]),1032,["actived","style","onEscape"])),[[U(s),{isLoading:e.loading,fullwidth:!0}],[X,"3"]])],512),be("div",{ref_key:"popupRef",ref:u,class:ee(ge.$style["basic-filter"]),tabindex:"0"},[be("div",{class:ee(ge.$style.row)},[be("span",{class:ee(ge.$style["filter-header"])},[de[6]||(de[6]=nt(" Filters ",-1)),We(fe(hee,{modelValue:T.value,"onUpdate:modelValue":de[0]||(de[0]=Pe=>T.value=Pe),disabled:P.value},null,8,["modelValue","disabled"]),[[U(o),{content:P.value?"Available only when more than one filter is selected.":"",bypassOverflowCheck:!0}]])],2),D.value>0||((re=(De=S.value)==null?void 0:De.assignees)==null?void 0:re.selectedTypeId)=="all"?(W(),ae("div",{key:0,class:ee(ge.$style.row)},[We((W(),Ke(gt,{size:"small",variant:"secondary",onClick:N,onEscape:U(a)},{default:ye(()=>[...de[7]||(de[7]=[nt(" Clear all ",-1)])]),_:1},8,["onEscape"])),[[X,"3.7"]])],2)):Ye("",!0)],2),fe(wf,{logic:T.value,label:"Assignee",openDropdown:(Ae=p.value)==null?void 0:Ae.triggerFocus},{logic:ye(()=>[...de[8]||(de[8]=[nt("Where",-1)])]),default:ye(()=>[fe(eee,{entityId:i.entityId,ref_key:"FilterAssigneeRef",ref:p,onUpdated:de[1]||(de[1]=Pe=>E("assignees",Pe)),onEscape:U(a)},null,8,["entityId","onEscape"])]),_:1},8,["logic","openDropdown"]),fe(wf,{logic:T.value,label:"Status",openDropdown:(H=g.value)==null?void 0:H.triggerFocus},{default:ye(()=>[fe(iee,{ref_key:"FilterStatusRef",ref:g,entityId:i.entityId,onUpdated:de[2]||(de[2]=Pe=>E("statuses",Pe))},null,8,["entityId"])]),_:1},8,["logic","openDropdown"]),fe(wf,{logic:T.value,openDropdown:(oe=v.value)==null?void 0:oe.triggerFocus,label:"Start Date"},{default:ye(()=>[fe(DO,{focusIndex:"3.3",ref_key:"FilterStartDateRangeRef",ref:v,onUpdated:de[3]||(de[3]=Pe=>E("startDateRange",Pe))},null,512)]),_:1},8,["logic","openDropdown"]),fe(wf,{logic:T.value,label:"Due Date",openDropdown:(ve=y.value)==null?void 0:ve.triggerFocus},{default:ye(()=>[fe(DO,{focusIndex:"3.4",ref_key:"FilterDueDateRangeRef",ref:y,onUpdated:de[4]||(de[4]=Pe=>E("dueDateRange",Pe))},null,512)]),_:1},8,["logic","openDropdown"]),fe(wf,{logic:T.value,label:"Archive Status",openDropdown:(Ne=b.value)==null?void 0:Ne.triggerFocus},{default:ye(()=>[fe(nee,{focusIndex:"3.5",ref_key:"FilterArchiveStatusRef",ref:b,onUpdated:de[5]||(de[5]=Pe=>E("archiveStatuses",Pe))},null,512)]),_:1},8,["logic","openDropdown"]),be("div",{class:ee([ge.$style.row,ge.$style["justify-end"]])},[We((W(),Ke(gt,{size:"small",onClick:k,disabled:x.value,onEscape:U(a)},{default:ye(()=>[...de[9]||(de[9]=[nt(" Apply filter ",-1)])]),_:1},8,["disabled","onEscape"])),[[X,"3.6"]])],2)],2)],64)}}}),[["__cssModules",{$style:{row:"_row_1mu3v_1","justify-end":"_justify-end_1mu3v_7","basic-filter":"_basic-filter_1mu3v_11","filter-grid":"_filter-grid_1mu3v_29","filter-line":"_filter-line_1mu3v_34","filter-tag":"_filter-tag_1mu3v_41",selector:"_selector_1mu3v_56","filter-header":"_filter-header_1mu3v_66"}}]]),vee=it({__name:"RatingRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{},sceneId:{}},setup(e,{expose:t}){var A;const n=So,s=e,{isEditing:o}=_u(s),{apiServices:i}=es(!0,s),r=Z(()=>{var O,I;return{value:a.value,metricConfig:((I=(O=s.params)==null?void 0:O.colDef)==null?void 0:I.context)||s.config,error:s.error,hovered:!1,readOnly:s.disabled,disabled:s.readOnly,apiServices:i.value}}),a=V(Number(s.value)),l=V(!1),{componentState:c,metricConfig:u,ICON_SIZE:d,ratingParams:h,standardNameforIcon:f}=Lk(r,l),{updateCellData:p}=EO((A=s.params)==null?void 0:A.api),g=O=>{a.value=O,b(O)},v=O=>{var I,D,x;p({rowId:String((D=(I=s.params)==null?void 0:I.data)==null?void 0:D.id),field:`metric_${((x=u.value)==null?void 0:x.id)||""}`,value:O})},y=Z(()=>{var O,I;return(s==null?void 0:s.sceneId)||((I=(O=s.params)==null?void 0:O.data)==null?void 0:I.id)}),b=async O=>{var I,D;v(void 0);try{const x=await((D=i.value)==null?void 0:D.bulkUpdateMetric({workspaceId:s.workspaceId||"",itemIds:[y.value||""],value:O==0||O===null?null:O.toString(),metricId:((I=u.value)==null?void 0:I.id)||""}));if((x==null?void 0:x.message)=="Done")v(O),S.value=O;else throw console.error("Rating update: failed, reverting to cached value"),v(S.value),new Error("Update failed")}catch(x){console.error("Rating update: error updating value, reverting to cached value",x),v(S.value)}},S=V(a.value),C=async()=>{Ct(()=>{setTimeout(async()=>{await b(a.value)},100)})},E=Z(()=>({disabled:s.disabled,error:c.value.isError,clickable:!0,readOnly:s.readOnly,isEmpty:c.value.isEmpty})),{argsMain:R}=ms(E),T=V(null);return t({focus:()=>{var O,I;(I=(O=T.value)==null?void 0:O.focus)==null||I.call(O)}}),(O,I)=>(W(),Ke(vs,Jt({style:{"--icon-size":"24px","--box-padding":"0 0 0 0"}},U(R),{ref:"wrapperRef",actived:U(o),size:32,tabindex:"0",bordered:!0}),{default:ye(()=>[U(c).isRating&&U(h).maxRating?We((W(),Ke($A,{key:0,ref_key:"ratingComponentRef",ref:T,modelValue:a.value,"onUpdate:modelValue":I[0]||(I[0]=D=>a.value=D),params:U(h),readOnly:s.readOnly,disabled:s.disabled,onHandleEnter:g},{icon:ye(()=>[fe(at,{onClick:C,source:"rating",src:U(f)()||"Star",size:U(d)},null,8,["src","size"])]),_:1},8,["modelValue","params","readOnly","disabled"])),[[U(n),{isLoading:U(c).isLoading,fullwidth:!0}]]):Ye("",!0)]),_:1},16,["actived"]))}});/*!
|
|
169
169
|
* shared v11.2.8
|
|
170
170
|
* (c) 2025 kazuya kawaguchi
|
|
171
171
|
* Released under the MIT License.
|
|
@@ -249,4 +249,4 @@ See ${xN(e,t)}`;return Array.isArray(s)?s.concat(i):[s,i]}var Vpe={1:"Charting A
|
|
|
249
249
|
If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),Bf(u)}if(a.length>0&&o){const l=this.beans.frameworkOverrides.getDocLink(o);Bf(`to see all the valid ${s} properties please check: ${l}`)}}};function ige(e,t,n){const s={},o=e.filter(i=>!t.some(r=>r===i));if(o.length>0)for(const i of o)s[i]=X0({inputValue:i,allSuggestions:n}).values;return s}var rge=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),age={moduleName:"Validation",version:lt,beans:[oge]};function T2(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var lge=class extends Ge{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){var n;const t=!!((n=this.filterManager)!=null&&n.isChildFilterPresent());this.filterNodes(t,e)}filterNodes(e,t){const n=(s,o)=>{s.hasChildren()&&e&&!o?s.childrenAfterFilter=s.childrenAfterGroup.filter(i=>{const r=i.childrenAfterFilter&&i.childrenAfterFilter.length>0,a=i.data&&this.filterManager.doesRowPassFilter({rowNode:i});return r||a}):s.childrenAfterFilter=s.childrenAfterGroup,T2(s)};if(this.doingTreeDataFiltering()){const s=(i,r)=>{if(i.childrenAfterGroup)for(let a=0;a<i.childrenAfterGroup.length;a++){const l=i.childrenAfterGroup[a],c=r||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?s(i.childrenAfterGroup[a],c):n(l,c)}n(i,r)},o=i=>s(i,!1);t.executeFromRootNode(o)}else{const s=o=>n(o,!1);t.forEachChangedNodeDepthFirst(s,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},cge=class extends TE{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,n,s,o){this.comp=e;const i=jf(this,this.beans.context,o);this.eButtonShowMainFilter=n,this.eFloatingFilterBody=s,this.setGui(t,i),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(i),this.setupLeft(i),this.setupHover(i),this.setupFocus(i),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(i),this.setupUi(),i.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(i);const r=()=>this.onColDefChanged(i);i.addManagedListeners(this.column,{colDefChanged:r}),i.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&r()}}),i.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,n=e.colDef;return 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=li("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 o=vc(t,this.eGui,null,e.shiftKey);if(o){(r=t.headerNavigation)==null||r.scrollToColumn(this.column),e.preventDefault(),o.focus();return}const i=this.findNextColumnWithFloatingFilter(e.shiftKey);i&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:i},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let n=this.column;do if(n=e?t.getColBefore(n):t.getColAfter(n),!n)break;while(!n.getColDef().filter||!n.getColDef().floatingFilter);return n}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case Me.UP:case Me.DOWN:case Me.LEFT:case Me.RIGHT:if(t)return;Cc(e);case Me.ENTER:t&&mc(this.eGui)&&e.preventDefault();break;case Me.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const n=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),s=!!e.relatedTarget&&cc(e.relatedTarget,"ag-floating-filter");if(n&&s&&e.target===this.eGui){const o=this.lastFocusEvent,i=!!(o&&o.key===Me.TAB);if(o&&i){const r=o.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 DE(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=!No(this.gos)}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.colFilter)==null?void 0:t.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){var t;const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;(t=this.beans.menuSvc)==null||t.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:n,gos:s}=this,o=i=>{if((i==null?void 0:i.source)==="filterDestroyed"&&(!this.isAlive()||!(t!=null&&t.isAlive())))return;const r=this.comp.getFloatingFilterComp();r&&r.then(a=>{if(a){if(s.get("enableFilterHandlers")){const 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:o}),t!=null&&t.isFilterActive(n)&&o(null)}setupWidth(e){const t=()=>{const n=`${this.column.getActualWidth()}px`;this.comp.setWidth(n)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){var e;if(!this.suppressFilterButton&&this.comp){const t=!!((e=this.beans.filterManager)!=null&&e.isFilterAllowed(this.column));this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const n=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const s=this.beans.colFilter,o=this.active?s==null?void 0:s.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,i=this.comp.getFloatingFilterComp();!i||!o?this.updateCompDetails(e,o,n):i.then(r=>{!r||s!=null&&s.areFilterCompsDifferent(this.userCompDetails??null,o)?this.updateCompDetails(e,o,n):this.updateFloatingFilterParams(o,"colDef")})}updateCompDetails(e,t,n){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),n&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){var s;if(!e)return;let n=e.params;(s=this.comp.getFloatingFilterComp())==null||s.then(o=>{var i;typeof(o==null?void 0:o.refresh)=="function"&&(this.gos.get("enableFilterHandlers")&&(n={...n,model:_s(((i=this.beans.colFilter)==null?void 0:i.model)??{},this.column.getColId()),source:t}),o.refresh(n))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function uge(e,t){var s;const n=e.colModel.getCol(t);if(!n){bn(12,{colKey:t});return}(s=e.menuSvc)==null||s.showColumnMenu({column:n,positionBy:"auto"})}function dge(e){var t;(t=e.menuSvc)==null||t.hidePopupMenu()}var hge={moduleName:"SharedMenu",version:lt,beans:[Ele],apiFunctions:{showColumnMenu:uge,hidePopupMenu:dge}},fge=class extends Wre{postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getDefaultPopupParent(){return this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:n,event:s}=e,o=t.getBoundingClientRect(),i=this.getParentRect();this.setAlignedTo(t,n);let r=!1;const a=()=>{const l=this.keepXYWithinBounds(n,o.top-i.top,0),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 o.right-i.left-2}function p(){return o.left-i.left-c}};this.positionPopup({ePopup:n,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",n,t,s instanceof MouseEvent?s:void 0)})}callPostProcessPopup(e,t,n,s,o){const i=this.gos.getCallback("postProcessPopup");if(i){const{column:r,rowNode:a}=e;i({column:r,rowNode:a,ePopup:n,type:t,eventSource:s,mouseEvent:o})}}getActivePopups(){return this.popupList.map(e=>e.element)}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const n of this.popupList)t.applyThemeClasses(n.wrapper)}}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return ha(e)}},gy={moduleName:"Popup",version:lt,beans:[fge]},pge=".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 gge(e){const t=e.filterManager;return!!(t!=null&&t.isColumnFilterPresent())||!!(t!=null&&t.isAggregateFilterPresent())}function mge(e,t){var n;return((n=e.filterManager)==null?void 0:n.getColumnFilterInstance(t))??Promise.resolve(void 0)}function vge(e,t){var s;const n=e.colModel.getColDefCol(t);if(n)return(s=e.colFilter)==null?void 0:s.destroyFilter(n,"api")}function yge(e,t){e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=e.filterManager)==null?void 0:n.setFilterModel(t)})}function wge(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function Cge(e,t,n){const{gos:s,colModel:o,colFilter:i}=e;n&&!s.get("enableFilterHandlers")&&(qe(288),n=!1);const r=o.getColDefCol(t);return r?(i==null?void 0:i.getModelForColumn(r,n))??null:null}function bge(e,t,n){var s;return((s=e.filterManager)==null?void 0:s.setColumnFilterModel(t,n))??Promise.resolve()}function Sge(e,t){var s;const n=e.colModel.getCol(t);if(!n){bn(12,{colKey:t});return}(s=e.menuSvc)==null||s.showFilterMenu({column:n,containerType:"columnFilter",positionBy:"auto"})}function Ege(e){var t;(t=e.menuSvc)==null||t.hideFilterMenu()}function _ge(e,t){var s;const n=e.colModel.getCol(t);if(!n){bn(12,{colKey:t});return}return(s=e.colFilter)==null?void 0:s.getHandler(n,!0)}function Rge(e,t){const{colModel:n,colFilter:s,gos:o}=e;if(!o.get("enableFilterHandlers")){qe(287);return}const{colId:i,action:r}=t;if(i){const a=n.getColById(i);a&&(s==null||s.updateModel(a,r))}else s==null||s.updateAllModels(r)}var Dge={filterHandler:()=>({doesFilterPass:()=>!0})},Tge=class extends Ge{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,s;this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)});const e=this.gos,t={...((s=(n=e.get("initialState"))==null?void 0:n.filter)==null?void 0:s.filterModel)??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",n){const{colModel:s,dataTypeSvc:o,filterManager:i}=this.beans;if(o!=null&&o.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const r=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,u)=>{const d=e[u];r.push(this.setModelOnFilterWrapper(c,d)),l.delete(u)}),l.forEach(c=>{const u=s.getColDefCol(c)||s.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;xf(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:s,beans:{colModel:o}}=this;if(n.forEach((r,a)=>{const l=this.getModelFromFilterWrapper(r);ut(l)&&(t[a]=l)}),!e)for(const r of Object.keys(s)){const a=s[r];ut(a)&&!n.has(r)&&((i=o.getCol(r))!=null&&i.isFilterAllowed())&&(t[r]=a)}return t}setState(e,t,n="api"){if(this.state.clear(),t)for(const s of Object.keys(t)){const o=t[s];this.state.set(s,{model:_s(this.model,s),state:o})}this.setModel(e,n,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let n=!1;return e.forEach((s,o)=>{const i=s.state;i!=null&&(n=!0,t[o]=i)}),n?t:void 0}getModelFromFilterWrapper(e){const n=e.column.getColId();if(e.isHandler)return _s(this.model,n);const s=e.filter;return s?typeof s.getModel!="function"?(qe(66),null):s.getModel():_s(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,s=!!P0(n),o=c=>{if(!c.isPrimary())return!0;const d=!t.isPivotActive();return!c.isValueActive()||!d?!1:t.isPivotMode()?!0:s},i=[],r=[],a=(c,u,d)=>{u&&(o(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 s;const n=[];return this.allColumnFilters.forEach(o=>{const i=o.column;if(o.isHandler)n.push(zn.resolve().then(()=>{this.setColFilterActive(i,this.isHandlerActive(i),e,t)}));else{const r=il(o);r&&n.push(r.then(a=>{this.setColFilterActive(i,a.isFilterActive(),e,t)}))}}),(s=this.beans.groupFilter)==null||s.updateFilterFlags(e,t),zn.all(n)}doFiltersPass(e,t,n){const{data:s,aggData:o}=e,i=n?this.activeAggregateFilters:this.activeColumnFilters,r=n?o:s,a=this.model;for(let l=0;l<i.length;l++){const 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:_s(a,u),handlerParams:f}))return!1}else{const h=c.comp;if(typeof h.doesFilterPass!="function"){bn(91);continue}if(!h.doesFilterPass({node:e,data:r}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t!=null&&t.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:n}=this.beans,s=()=>{this.isAlive()&&(n==null||n.onFilterChanged(e))};t.isRefreshInProgress()?setTimeout(s,0):s()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:n}=e,s=t==null?void 0:t.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",n).then(()=>{this.allColumnFilters.forEach(o=>{var a,l,c;const{column:i,isHandler:r}=o;s!==i.getColId()&&(r&&((l=(a=o.handler).onAnyFilterChanged)==null||l.call(a)),(c=il(o,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 s=n.isHandler;s&&((r=(i=n.handler).onNewRowsLoaded)==null||r.call(i));const o=il(n,s);o&&t.push(o.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:s}=this.beans;return(o,i)=>{const r=i?s.getCol(i):e;return r?n.getValue(r,o,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t!=null&&t.isHandler)return this.isHandlerActive(e);const n=t==null?void 0:t.filter;return n?n.isFilterActive():_s(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=ut(_s(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(s=>({comp:s,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const n=this.getOrCreateFilterWrapper(e,t);return n!=null&&n.isHandler?n.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let n=this.cachedFilter(e);return!n&&t&&(n=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,n)),n}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>{var n;return(n=this.beans.dataTypeSvc)==null?void 0:n.getBaseDataType(e)},t)}getDefaultFilterFromDataType(e,t=!1){return Doe(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":pae(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,n,s,o,i){const r=()=>{const c=this.createFilterCompParams(e,o,i),u=s(c,o);return Iie(this.beans.userCompFactory,t,u,n)},a=r();return a?{compDetails:a,createFilterUi:c=>(c?r():a).newAgStackInstance()}:null}createFilterInstance(e,t,n,s){var d,h;const o=this.beans.selectableFilter;o!=null&&o.isSelectable(t)&&(t=o.getFilterDef(e,t));const{handler:i,handlerParams:r,handlerGenerator:a}=this.createHandler(e,t,n)??{},l=this.createFilterComp(e,t,n,s,!!i,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:i,handlerGenerator:a,handlerParams:r};const{compDetails: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:s}=this.beans;return It(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:o=>(n==null?void 0:n.doesRowPassOtherFilters(e.getColId(),o))??!0,rowModel:s})}createFilterCompParams(e,t,n,s){const o=this.filterChangedCallbackFactory(e),i=this.createBaseFilterParams(e,s);if(i.filterChangedCallback=o,i.filterModifiedCallback=s?()=>{}:r=>this.filterModified(e,r),t){const r=i,a=e.getColId(),l=_s(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(()=>{o({...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 s=t(),o={created:!0,create:t,filterParams:e.params,compDetails:e,promise:s};return s.then(n),o}createFilterWrapper(e){var a;const{compDetails:t,handler:n,handlerGenerator:s,handlerParams:o,createFilterUi:i}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),l=>l),r=e.getColId();if(n)return delete this.initialModel[r],(a=n.init)==null||a.call(n,{...o,source:"init",model:_s(this.model,r)}),{column:e,isHandler:!0,handler:n,handlerGenerator:s,handlerParams:o,filterUi:this.createFilterUiForHandler(t,i)};if(i){const l={column:e,filterUi:null,isHandler:!1};return l.filterUi=this.createFilterUiLegacy(t,i,c=>{l.filter=c??void 0}),l}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,n){var f;const{gos:s,frameworkOverrides:o,registry:i}=this.beans;let r;const a=p=>{const g=p.filter;if(oL(g)){const v=g.handler;return v||(r=g.doesFilterPass,r?()=>({doesFilterPass:r}):void 0)}return typeof g=="string"?g:void 0},l=s.get("enableFilterHandlers"),c=l?a(t):void 0,u=p=>()=>this.createBean(i.createDynamicBean(p,!0));let d,h;if(typeof c=="string"){const p=(f=s.get("filterHandlers"))==null?void 0:f[c];p!=null?d=p:nae.has(c)&&(d=u(c),h=c)}else d=c;if(!d){let p;const{compName:g,jsComp:v,fwComp:y}=cL(o,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?(ns(s)&&qe(277,{colId:e.getColId()}),Dge):void 0}createHandler(e,t,n){const s=this.createHandlerFunc(e,t,n);if(!s)return;const o=L0(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:i,filterHandler:r}=s,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,r,o);return{handler:a,handlerParams:l,handlerGenerator:i??r}}createHandlerFromFunc(e,t,n){const s=e.getColDef(),o=t(It(this.gos,{column:e,colDef:s})),i=this.createHandlerParams(e,n);return{handler:o,handlerParams:i}}createHandlerParams(e,t){const n=e.getColDef(),s=e.getColId(),o=this.filterChangedCallbackFactory(e);return 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(s,i))??!0},onModelChange:(i,r)=>{this.updateStoredModel(s,i),this.refreshHandlerAndUi(e,i,"handler",!1,r).then(()=>{o({...r,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:n,groupFilter:s}=this.beans;this.allColumnFilters.forEach((i,r)=>{let a;i.column.isPrimary()?a=t.getColDefCol(r):a=t.getCol(r),!(a&&a===i.column)&&(e.push(i.column),this.disposeFilterWrapper(i,"columnChanged"),this.disposeColumnListener(r))});const o=s&&e.every(i=>s.isGroupFilter(i));e.length>0&&!o&&(n==null||n.onFilterChanged({columns:e,source:"api"}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:n,frameworkOverrides:s,selectableFilter:o}=this.beans,i=h=>{const f=this.getOrCreateFilterUi(e);f!=null&&f.then(p=>{h(qf(p))})},r=e.getColDef(),a=o!=null&&o.isSelectable(r)?o.getFilterDef(e,r):r,l=wae(s,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",c=this.gos.get("enableFilterHandlers"),u=L0(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=_s(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 Oie(n,r,d,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,n,s){const o="paramsUpdated";if(e.isHandler){const i=t.getColId();delete this.initialModel[i],this.state.delete(i);const r=e.filterUi,a=this.createFilterUiForHandler(n,s);e.filterUi=a;const l=this.eventSvc;r!=null&&r.created?r.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:o,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:o,column:t})}else this.destroyFilter(t,o)}destroyFilter(e,t="api"){const n=e.getColId(),s=this.allColumnFilters.get(n);this.disposeColumnListener(n),delete this.initialModel[n],s&&this.disposeFilterWrapper(s,t).then(o=>{var i;o&&this.isAlive()&&((i=this.beans.filterManager)==null||i.onFilterChanged({columns:[e],source:"api"}))})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let n=!1;const{column:s,isHandler:o,filterUi:i}=e,r=s.getColId();o&&(n=this.isHandlerActive(s),this.destroyBean(e.handler),delete this.model[r],this.state.delete(r));const a=()=>{this.setColFilterActive(s,!1,"filterDestroyed"),this.allColumnFilters.delete(r),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:s})};if(i){if(i.created)return i.promise.then(l=>(n=o?n:!!(l!=null&&l.isFilterActive()),this.destroyBean(l),a(),n));a()}return 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 s=this.beans,o=n.column,i=o.getColDef(),r=o.isFilterAllowed(),a=this.getDefaultFilter(o),l=s.selectableFilter,c=l!=null&&l.isSelectable(i)?l.getFilterDef(o,i):i,u=r?this.createHandlerFunc(o,c,this.getDefaultFilter(o)):void 0,d=!!u,h=n.isHandler;if(h!=d){this.destroyFilter(o,"paramsUpdated");return}const{compDetails:f,createFilterUi:p}=(r?this.createFilterComp(o,c,a,R=>R,d,"colDef"):null)??{compDetails:null,createFilterUi:null},g=(f==null?void 0:f.params)??L0(s.userCompFactory,c,this.createFilterCompParams(o,d,"colDef"));if(h){const R=(u==null?void 0:u.handlerNameOrCallback)??(u==null?void 0:u.filterHandler),T=_s(this.model,e);if(n.handlerGenerator!=R){const A=n.handler,{handler:O,handlerParams:I}=this.createHandlerFromFunc(o,u.filterHandler,g);n.handler=O,n.handlerParams=I,n.handlerGenerator=R,delete this.model[e],(v=O.init)==null||v.call(O,{...I,source:"init",model:null}),this.destroyBean(A),T!=null&&((y=this.beans.filterManager)==null||y.onFilterChanged({columns:[o],source:t}))}else{const A=this.createHandlerParams(o,f==null?void 0:f.params);n.handlerParams=A,(S=(b=n.handler).refresh)==null||S.call(b,{...A,source:"colDef",model:T})}}if(this.areFilterCompsDifferent(((C=n.filterUi)==null?void 0:C.compDetails)??null,f)||!n.filterUi||!f){this.destroyFilterUi(n,o,f,p);return}n.filterUi.filterParams=g,(E=il(n,h))==null||E.then(R=>{(R!=null&&R.refresh?R.refresh(g):!0)===!1?this.destroyFilterUi(n,o,f,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:o,params:g})})}refreshHandlerAndUi(e,t,n,s,o){const i=this.cachedFilter(e);if(!i)return s&&this.getOrCreateFilterWrapper(e,!0),zn.resolve();if(!i.isHandler)return zn.resolve();const{filterUi:r,handler:a,handlerParams:l}=i;return sae(()=>{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,o)}setColumnFilterWrapper(e,t){const n=e.getColId();this.allColumnFilters.set(n,t),this.allColumnListeners.set(n,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(n)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:n}=e,{componentClass:s}=t;return!(n===s||(n==null?void 0:n.render)&&(s==null?void 0:s.render)&&n.render===s.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const n=this.getOrCreateFilterUi(t);return n?new Promise(s=>{n.then(o=>{s(qf(o))})}):Promise.resolve(null)}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:e,source:t})=>this.setModel(e,t)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:e,model:t,resolve:n})=>{this.setModelForColumn(e,t).then(()=>n())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:s,model:o}=this,i=e.getColId(),r=s.get(i);return r?r.model??null:_s(o,i)}const n=this.cachedFilter(e);return n?this.getModelFromFilterWrapper(n):null}setModelForColumn(e,t){var n;if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){let s=()=>{};const o=new Promise(i=>{s=i});return this.columnModelUpdates.push({key:e,model:t,resolve:s}),o}return new Promise(s=>{this.setModelForColumnLegacy(e,t).then(o=>s(o))})}getStateForColumn(e){return this.state.get(e)??{model:_s(this.model,e)}}setModelForColumnLegacy(e,t){const n=this.beans.colModel.getColDefCol(e),s=n?this.getOrCreateFilterWrapper(n,!0):null;return s?this.setModelOnFilterWrapper(s,t):zn.resolve()}setColDefPropsForDataType(e,t,n){var u;const s=e.filter,o=s===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):s;if(typeof o!="string")return;let i,r;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;o==="agMultiColumnFilter"?{filterParams:i,filterValueGetter:r}=((u=a.multiFilter)==null?void 0:u.getParamsForDataType(l,c,t,n))??{}:{filterParams:i,filterValueGetter:r}=dae(o,l,c,t,n,a,this.getLocaleTextFunc()),e.filterParams=i,r&&(e.filterValueGetter=r)}setColFilterActive(e,t,n,s){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",n)),e.dispatchColEvent("filterChanged",n,s)}setModelOnFilterWrapper(e,t,n){return new zn(s=>{if(e.isHandler){const i=e.column,r=i.getColId(),a=this.model[r];if(this.updateStoredModel(r,t),n&&t===a){s();return}this.refreshHandlerAndUi(i,t,"api").then(()=>s());return}const o=il(e);if(o){o.then(i=>{if(typeof(i==null?void 0:i.setModel)!="function"){qe(65),s();return}(i.setModel(t)||zn.resolve()).then(()=>s())});return}s()})}updateStoredModel(e,t){ut(t)?this.model[e]=t:delete this.model[e];const n=this.state.get(e),s={model:t,state:n==null?void 0:n.state};this.state.set(e,s)}filterModified(e,t){var n;(n=this.getOrCreateFilterUi(e))==null||n.then(s=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:s,...t})})}filterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"filterUiChanged",column:e,...t})}floatingFilterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:e,...t})}updateModel(e,t,n){var r;const s=e.getColId(),o=this.cachedFilter(e),i=()=>o==null?void 0:o.filterUi;HL(t,i,()=>_s(this.model,s),()=>this.state.get(s),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)},o!=null&&o.isHandler?(r=o.handler.processModelToApply)==null?void 0:r.bind(o.handler):void 0)}updateAllModels(e,t){const n=[];this.allColumnFilters.forEach((s,o)=>{var r;const i=this.beans.colModel.getColDefCol(o);i&&HL(e,()=>s.filterUi,()=>_s(this.model,o),()=>this.state.get(o),a=>this.updateState(i,a),a=>{this.updateStoredModel(o,a),this.dispatchLocalEvent({type:"filterAction",column:i,action:e}),n.push(this.refreshHandlerAndUi(i,a,"ui"))},s!=null&&s.isHandler?(r=s.handler.processModelToApply)==null?void 0:r.bind(s.handler):void 0)}),n.length&&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},()=>_s(this.model,t),()=>this.state.get(t))}updateState(e,t){this.state.set(e.getColId(),t),this.dispatchLocalEvent({type:"filterStateChanged",column:e,state:t})}canApplyAll(){const{state:e,model:t,activeFilterComps:n}=this;for(const o of n)if(o.source==="COLUMN_MENU")return!1;let s=!1;for(const o of e.keys()){const i=e.get(o);if(i.valid===!1)return!1;(i.model??null)!==_s(t,o)&&(s=!0)}return s}hasUnappliedModel(e){var s;const{model:t,state:n}=this;return(((s=n.get(e))==null?void 0:s.model)??null)!==_s(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 xge(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function Ige(e,t="api"){var n;(n=e.filterManager)==null||n.onFilterChanged({source:t})}var Fge=class extends Ge{constructor(){super(...arguments),this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(e){this.quickFilter=e.quickFilter,this.advancedFilter=e.advancedFilter,this.colFilter=e.colFilter}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:s})=>this.onAdvFilterEnabledChanged(s),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter&&this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});const{gos:n}=this;this.alwaysPassFilter=n.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=n.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"&&t(e)}setFilterState(e,t,n="api"){var s;this.isAdvFilterEnabled()||(s=this.colFilter)==null||s.setState(e,t,n)}setFilterModel(e,t="api",n){var s;if(this.isAdvFilterEnabled()){n||this.warnAdvFilters();return}(s=this.colFilter)==null||s.setModel(e,t)}getFilterModel(){var e;return((e=this.colFilter)==null?void 0:e.getModel())??{}}getFilterState(){var e;return(e=this.colFilter)==null?void 0:e.getState()}isColumnFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isFilterPresent())}isAggregateFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isAggFilterPresent())}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(e){var t,n;e?(t=this.colFilter)!=null&&t.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):(n=this.advancedFilter)!=null&&n.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){var e;return!!((e=this.advancedFilter)!=null&&e.isEnabled())}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){P0(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:n,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):zn.resolve()).then(()=>{var i;const o={source:t,type:"filterChanged",columns:s};n&&Qs(o,n),this.eventSvc.dispatchEvent(o),(i=this.colFilter)==null||i.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.colFilter)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilter)!=null&&e.isFilterPresent())}updateAggFiltering(){this.aggFiltering=!!P0(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()}},Pge=class extends Ge{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){var e;(e=this.hidePopup)==null||e.call(this)}showMenuAfterMouseEvent(e,t,n,s){e&&!e.isColumn||this.showPopup(e,o=>{var i;(i=this.popupSvc)==null||i.positionPopupUnderMouseEvent({column:e,type:n,mouseEvent:t,ePopup:o})},n,t.target,No(this.gos),s)}showMenuAfterButtonClick(e,t,n,s){if(e&&!e.isColumn)return;let o=-1,i="left";const r=No(this.gos);!r&&this.gos.get("enableRtl")&&(o=1,i="right");const a=r?void 0:4*o,l=r?void 0:4;this.showPopup(e,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,s)}showPopup(e,t,n,s,o,i){var g;const r=e?this.createBean(new cae(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!(r!=null&&r.hasFilter())||!e){bn(57);return}const a=os({tag:"div",cls:`ag-menu${o?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:v=>this.trapFocusWithin(v,a)}),a.appendChild(r==null?void 0:r.getGui());let l;const c=()=>r==null?void 0:r.afterGuiDetached(),u=Toe(this.gos)?s??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&&s&&gr(s)){const b=mL(s);b==null||b.focus({preventScroll:!0})}c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,n,e),i==null||i()},h=this.getLocaleTextFunc(),f=o&&n!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),p=(g=this.popupSvc)==null?void 0:g.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:d,positionCallback:()=>t(a),anchorToElement: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!==Me.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()}},Age=class extends Ge{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,n){if(!t)return;const s=e.getColDef(),{selectableFilter:o,valueSvc:i}=this.beans,r=n??(o==null?void 0:o.getFilterValueGetter(e.getColId()))??s.filterValueGetter;return r?this.executeFilterValueGetter(r,t.data,e,t,s):i.getValue(e,t)}executeFilterValueGetter(e,t,n,s,o){const{expressionSvc:i,valueSvc:r}=this.beans,a=It(this.gos,{data:t,node:s,column:n,colDef:o,getValue:r.getValueCallback.bind(r,s)});return typeof e=="function"?e(a):i==null?void 0:i.evaluate(e,a)}},kge={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},Oge=class extends yn{constructor(){super(kge,[Gv]),this.eFloatingFilterText=ct}init(e){this.params=e;const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0);if(this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const n=e,s=n.getHandler();if(s.getModelAsString){const o=s.getModelAsString(n.model);this.eFloatingFilterText.setValue(o)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const n=t.getModelAsString(e);this.eFloatingFilterText.setValue(n)}})}refresh(e){this.init(e)}},o_=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const n=e.filterOptions??t;this.filterOptions!==n&&(this.filterOptions=n,this.customFilterOptions={},this.mapCustomOptions()),this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){const{filterOptions:e}=this;if(e)for(const t of e){if(typeof t=="string")continue;const n=[["displayKey"],["displayName"],["predicate","test"]],s=o=>o.some(i=>t[i]!=null)?!0:(qe(72,{keys:o}),!1);if(!n.every(s)){this.filterOptions=e.filter(o=>o===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const n=t[0];if(typeof n=="string")return n;if(n.displayKey)return n.displayKey;qe(73)}else qe(74)}getCustomOption(e){return this.customFilterOptions[e]}};function ap(e,t,n){return n==null?e.splice(t):e.splice(t,n)}function my(e){return e==null||typeof e=="string"&&e.trim().length===0}function Mge(e){return e==="AND"||e==="OR"?e:"AND"}function Nge(e,t,n){if(e==null)return;const{predicate:s}=e;if(s!=null&&!t.some(o=>o==null))return s(t,n)}function Lge(e,t){let n=e.length;return n>t&&(e.splice(t),qe(78),n=t),n}function lp(e,t){const n=t.getCustomOption(e);if(n){const{numberOfInputs:o}=n;return o??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}var i_=class extends yae{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 o_;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=Mge(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions();const t=this.getGui();this.isReadOnly()?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex")}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,n)=>{const s=n===0?e:this.optionsFactory.defaultOption;t.setValue(s,!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){const n=!e.operator,s=!t.operator;if(!n&&s||n&&!s)return!1;let i;if(n){const r=e,a=t;i=this.areSimpleModelsEqual(r,a)}else{const r=e,a=t;i=r.operator===a.operator&&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 s=e;let o=s.conditions;o==null&&(o=[],qe(77));const i=Lge(o,this.maxNumConditions),r=this.getNumConditions();if(i<r)this.removeConditionsAndOperators(i);else if(i>r)for(let l=r;l<i;l++)this.createJoinOperatorPanel(),this.createOption();const a=s.operator==="OR";this.eJoinAnds.forEach(l=>l.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),o.forEach((l,c)=>{this.eTypes[c].setValue(l.type,!0),this.setConditionIntoUi(l,c)})}else{const s=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(s.type,!0),this.setConditionIntoUi(s,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),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 nE);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const n=this.createEValue();this.eConditionBodies.push(n),e.appendChild(n),this.putOptionsIntoDropdown(t),this.resetType(t);const s=this.getNumConditions()-1;this.forEachPositionInput(s,o=>this.resetInput(o)),this.addChangedListeners(t,s)}createJoinOperatorPanel(){const e=os({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),n=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const s=this.eJoinPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,o),this.resetJoinOperatorOr(n,s,o),this.isReadOnly()||(t.onValueChange(this.listener),n.onValueChange(this.listener))}createJoinOperator(e,t,n){const s=this.createManagedBean(new Yie);e.push(s);const o="ag-filter-condition-operator";return s.addCss(o),s.addCss(`${o}-${n}`),t.appendChild(s.getGui()),s}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map(e=>typeof e=="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const n of t)e.addOption(n);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,n=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:n?this.getLocaleTextFunc()(n.displayKey,n.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let n=0;n<this.getNumConditions();n++)this.isConditionUiComplete(n)?e=n:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const n=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<n){this.removeConditionsAndOperators(n+1);const s=e+1,o=n-s;o>0&&this.removeConditionsAndOperators(s,o),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((s,o)=>{const i=this.isConditionDisabled(o,e);s.setDisabled(i||this.filterListOptions.length<=1),o===1&&(Af(this.eJoinPanels[0],i),this.eJoinAnds[0].setDisabled(i),this.eJoinOrs[0].setDisabled(i))}),this.eConditionBodies.forEach((s,o)=>{Vn(s,this.isConditionBodyVisible(o))});const n=(t??this.getJoinOperator())==="OR";for(const s of this.eJoinAnds)s.setValue(!n,!0);for(const s of this.eJoinOrs)s.setValue(n,!0);this.forEachInput((s,o,i,r)=>{this.setElementDisplayed(s,o<r),this.setElementDisabled(s,this.isConditionDisabled(i,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:n,eConditionBodies:s,eJoinPanels:o,eJoinAnds:i,eJoinOrs:r}=this;this.removeComponents(n,e,t),this.removeElements(s,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(o,a,t),this.removeComponents(i,a,t),this.removeComponents(r,a,t)}removeElements(e,t,n){const s=ap(e,t,n);for(const o of s)Ni(o)}removeComponents(e,t,n){const s=ap(e,t,n);for(const o of s)Ni(o.getGui()),this.destroyBean(o)}afterGuiAttached(e){var t;if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus)){let n;if(!this.isReadOnly()){const s=this.getInputs(0)[0];s instanceof yc&&this.isConditionBodyVisible(0)?n=s.getInputElement():n=(t=this.eTypes[0])==null?void 0:t.getFocusableElement()}(n??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){var r;super.afterGuiDetached();const e=this.params;if((r=this.beans.colFilter)!=null&&r.shouldKeepStateOnDetach(e.column))return;e.onStateChange({model:e.model});let t=-1,n=-1,s=!1;const o=this.getJoinOperator();for(let a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))t===-1&&(t=a,n=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),c=a<t;(l||c)&&(this.removeConditionsAndOperators(a,1),s=!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,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=n}getModelAsString(e){var t,n;return((n=(t=this.params.getHandler())==null?void 0:t.getModelAsString)==null?void 0:n.call(t,e))??""}getPlaceholderText(e,t){let n=this.translate(e);if(typeof this.filterPlaceholder=="function"){const s=this.eTypes[t].getValue(),o=this.translate(s);n=this.filterPlaceholder({filterOptionKey:s,filterOption:o,placeholder:n})}else typeof this.filterPlaceholder=="string"&&(n=this.filterPlaceholder);return n}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,n,s,o)=>{if(!(t instanceof yc))return;const i=n===0&&o>1?"inRangeStart":n===0?"filterOoo":"inRangeEnd",r=n===0&&o>1?e("ariaFilterFromValue","Filter from value"):n===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(i,s)),t.setInputAriaLabel(r)})}setElementValue(e,t,n){e instanceof yc&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){nL(e)&&Vn(e.getGui(),t)}setElementDisabled(e,t){nL(e)&&Af(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 s=lp(t,this.optionsFactory),o=this.getInputs(e);for(let i=0;i<o.length;i++){const r=o[i];r!=null&&n(r,i,e,s)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return lp(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(n=>n==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinAnds.forEach((t,n)=>this.resetJoinOperatorAnd(t,n,this.joinOperatorId+n)),this.eJoinOrs.forEach((t,n)=>this.resetJoinOperatorOr(t,n,this.joinOperatorId+n)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.updateUiVisibility(),e||this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){const n=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(n).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),n)}resetJoinOperatorOr(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),n)}resetJoinOperator(e,t,n,s,o){this.updateJoinOperatorDisabled(e.setValue(n,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(s),t)}updateJoinOperatorsDisabled(){const e=(t,n)=>this.updateJoinOperatorDisabled(t,n);this.eJoinAnds.forEach(e),this.eJoinOrs.forEach(e)}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const n=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((s,o,i)=>{i===t&&this.setElementValue(s,n[o]!=null?n[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,n,s)=>{this.setElementValue(t,n===0&&s===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,n=>{this.attachElementOnChange(n,this.listener)}))}hasInvalidInputs(){return!1}isReadOnly(){return!!this.params.readOnly}},x2=class{constructor(e,t,n,s,o,i){this.alive=!0,this.context=e,this.eParent=o;const r=Fie(t,n,s);r&&r.newAgStackInstance().then(a=>{var u,d;if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;o.appendChild(a.getGui()),(u=a==null?void 0:a.afterGuiAttached)==null||u.call(a);const{tempValue:l,disabled:c}=this;l&&a.setDate(l),c!=null&&((d=a.setDisabled)==null||d.call(a,c)),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){Vn(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)}},r_=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function I2(e,t){const{dateFrom:n,dateTo:s,type:o}=e||{};return[n&&fo(n,void 0,!0)||null,s&&fo(s,void 0,!0)||null].slice(0,lp(o,t))}var F2=1e3,P2=1/0,Vge=class extends i_{constructor(){super("dateFilter",I2,r_),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=F2,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",F2),s=t("maxValidYear",P2);this.minValidYear=n,this.maxValidYear=s,n>s&&qe(83);const{minValidDate:o,maxValidDate:i}=e,r=o instanceof Date?o:fo(o);this.minValidDate=r;const a=i instanceof Date?i:fo(i);this.maxValidDate=a,r&&a&&r>a&&qe(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:n,gos:s},params:o}=this,i=new x2(n,t,o.colDef,It(s,{onDateChanged:()=>this.onUiChanged(),filterParams:o,location:"filter"}),e);return this.addDestroyFunc(()=>i.destroy()),i}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=os({tag:"div",cls:"ag-filter-body"});return this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,n,s){const o=os({tag:"div",cls:`ag-filter-${s} ag-filter-date-${s}`});t.push(o),e.appendChild(o),n.push(this.createDateCompWrapper(o))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),ap(this.eConditionPanelsFrom,e,t),ap(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,n){const s=ap(e,t,n);for(const o of s)o.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:n,minValidYear:s,maxValidYear:o}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<s)return!1;if(n){if(e>n)return!1}else if(e.getUTCFullYear()>o)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((n,s,o,i)=>{o!==e||!t||s>=i||(t=t&&this.isValidDateValue(n.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),n={},s=this.getValues(e),o=this.params.useIsoSeparator?"T":" ";return s.length>0&&(n.dateFrom=Lo(s[0],!0,o)),s.length>1&&(n.dateTo=Lo(s[1],!0,o)),{dateFrom:null,dateTo:null,filterType:this.filterType,type:t,...n}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),n=e("ariaFilterValue","Filter Value");this.forEachInput(s=>{s.setInputPlaceholder(t),s.setInputAriaLabel(n)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,i)=>{s<i&&t.push(n.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},A2=class extends Ge{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,n=new o_;this.optionsFactory=n,n.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(n,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,n=this.optionsFactory;n.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:n,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(t==null)return!0;const{operator:n}=t,s=[];if(n){const r=t;s.push(...r.conditions??[])}else s.push(t);const o=n&&n==="OR"?"some":"every",i=this.params.getValue(e.node);return s[o](r=>this.individualConditionPasses(e,r,i))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:n,maxNumConditions:s}}=e;if(t==null)return;let i=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 s=="number"&&i&&i.length>s&&(i=i.slice(0,s),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 s=this.optionsFactory,o=this.mapValuesFromModel(t,s),i=s.getCustomOption(t.type),r=Nge(i,o,n);return r??(n==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(o,n,t,e))}},k2=class extends A2{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:n,includeBlanksInGreaterThan:s,includeBlanksInLessThan:o,includeBlanksInRange:i}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(n)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(s)return!0;break;case"lessThan":case"lessThanOrEqual":if(o)return!0;break;case"inRange":if(i)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,n){const s=n.type;if(!this.isValid(t))return s==="notEqual"||s==="notBlank";const o=this.comparator(),i=e[0]!=null?o(e[0],t):0;switch(s){case"equals":return i===0;case"notEqual":return i!==0;case"greaterThan":return i>0;case"greaterThanOrEqual":return i>=0;case"lessThan":return i<0;case"lessThanOrEqual":return i<=0;case"inRange":{const r=o(e[1],t);return this.params.filterParams.inRangeInclusive?i>=0&&r<=0:i>0&&r<0}case"blank":return my(t);case"notBlank":return!my(t);default:return qe(76,{filterModelType:s}),!0}}},O2={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},Bge={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},a_=class extends Ge{constructor(e,t,n){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=n}getModelAsString(e,t){const n=this.getLocaleTextFunc(),s=t==="filterToolPanel";if(!e)return s?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 s?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,s,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,s,o,i){let r;const a=this.getTypeKey(e);return a&&(r=rl(this,a)),o&&i&&(r=this.getLocaleTextFunc()(o,i)),r!=null?t?`${r} ${rl(this,"filterSummaryInRangeValues",[n(),s()])}`:`${r} ${n()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.valueFormatter;return t?t(e??null)??"":String(e)}},M2=class extends a_{constructor(e,t){super(e,t,n=>{const{dataTypeSvc:s,valueSvc:o}=this.beans,i=t.column,r=s==null?void 0:s.getDateFormatterFunction(i),a=r?r(n??void 0):n;return o.formatValue(i,null,a)}),this.filterTypeKeys=O2}conditionToString(e,t,n,s,o){const{type:i}=e,r=fo(e.dateFrom),a=fo(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>Z0(h,l),u=()=>r!==null?c(r):"null",d=()=>a!==null?c(a):"null";if(t){const h=this.conditionForToolPanel(i,n,u,d,s,o);if(h!=null)return h}return n?`${u()}-${d()}`:r!=null?c(r):`${i}`}};function $ge(e,t){const n=t;return n<e?-1:n>e?1:0}var Hge=class extends k2{constructor(){super(I2,r_),this.filterType="date",this.FilterModelFormatterClass=M2}comparator(){return this.params.filterParams.comparator??$ge}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 o_;this.optionsFactory=t,t.init(e.filterParams,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(t,e.filterParams)),this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){const n=this.optionsFactory.defaultOption;t||(this.lastType=n),this.readOnly=!!e.filterParams.readOnly;const s=this.isTypeEditable(n);this.setEditable(s)}refresh(e){this.params=e;const t=e,n=this.reactive;if((!n||t.source==="colDef")&&this.updateParams(e),n){const{source:s,model:o}=t;if(s==="dataChanged"||s==="ui")return;this.onModelUpdated(o)}}updateParams(e){const t=this.optionsFactory;t.refresh(e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){t!=null&&t.afterFloatingFilter||t!=null&&t.afterDataChange||this.onModelUpdated(e)}hasSingleInput(e){var n;const t=(n=this.optionsFactory.getCustomOption(e))==null?void 0:n.numberOfInputs;return t==null||t==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.readOnly&&this.hasSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},Gge={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"}]},Uge=class extends N2{constructor(){super(Gge,[Gv]),this.eReadOnlyText=ct,this.eDateWrapper=ct,this.FilterModelFormatterClass=M2,this.filterType="date",this.defaultOptions=r_}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?fo(e.dateFrom):null;this.dateComp.setDate(n),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){Vn(this.eDateWrapper,e),Vn(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){const e=this.dateComp.getDate();if(this.reactive){const t=this.params;t.onUiChange();const n=t.model,s=Lo(e),o=s==null?null:{...n??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:s};t.onModelChange(o,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t==null||t.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=dE(e,this.defaultDebounceMs);return It(this.gos,{onDateChanged:Fs(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:n,params:s}=this;this.dateComp=new x2(e,t,s.column.getColDef(),this.getDateComponentParams(),n,o=>{o.setInputAriaLabel(this.getAriaLabel(s))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},Wge={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},zge=class extends yn{constructor(){super(Wge,[Gv]),this.eDateInput=ct,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled()){if(this.isApply){this.applyOnFocusOut=!e,e&&this.params.onDateChanged();return}e||this.params.onDateChanged()}}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}setParams(e){var h;const t=this.eDateInput.getInputElement(),n=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=n&&nl();const{minValidYear:s,maxValidYear:o,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&&s&&qe(85),r&&o&&qe(86),i&&r){const[f,p]=[i,r].map(g=>g instanceof Date?g:fo(g));f&&p&&f.getTime()>p.getTime()&&qe(87)}i?i instanceof Date?t.min=Z0(i):t.min=i:s&&(t.min=`${s}-01-01`),r?r instanceof Date?t.max=Z0(r):t.max=r:o&&(t.max=`${o}-12-31`),this.isApply=e.location==="floatingFilter"&&!!(a!=null&&a.includes("apply"))}refresh(e){this.params=e,this.setParams(e)}getDate(){return fo(this.eDateInput.getValue())}setDate(e){var s;const t=this.params.filterParams.colDef.cellDataType,n=((s=this.beans.dataTypeSvc)==null?void 0:s.getDateIncludesTimeFlag(t))??!1;this.eDateInput.setValue(Lo(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}},l_=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function c_(e){const{allowedCharPattern:t}=e??{};return t??null}function u_(e){return e==null||isNaN(e)?null:e}function L2(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[u_(n),u_(s)].slice(0,lp(o,t))}var jge=class extends i_{constructor(){super("numberFilter",L2,l_),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}setElementValue(e,t,n){const{numberFormatter:s}=this.params,o=!n&&s?s(t??null):t;super.setElementValue(e,o)}createEValue(){const e=c_(this.params),t=os({tag:"div",cls:"ag-filter-body",role:"presentation"});return this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,n,s){const o=this.createManagedBean(s?new wc({allowedCharPattern:s}):new tE);o.addCss(`ag-filter-${n}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const n=s=>this.removeComponents(s,e,t);n(this.eValuesFrom),n(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,i)=>{s<i&&t.push(u_(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},s=this.getValues(e);return s.length>0&&(n.filter=s[0]),s.length>1&&(n.filterTo=s[1]),n}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}},V2=class extends a_{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=O2}conditionToString(e,t,n,s,o){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),s,o);if(c!=null)return c}return n?`${l(i)}-${l(r)}`:i!=null?l(i):`${a}`}},Kge=class extends k2{constructor(){super(L2,l_),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 Ge{constructor(e){super(),this.params=e,this.eInput=ct,this.onValueChanged=()=>{}}setupGui(e){var s;this.eInput=this.createManagedBean(new wc((s=this.params)==null?void 0:s.config));const t=this.eInput.getGui();e.appendChild(t);const n=o=>this.onValueChanged(o);this.addManagedListeners(t,{input:n,keydown:n})}setEditable(e){this.eInput.setDisabled(!e)}getValue(){return this.eInput.getValue()}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setParams({ariaLabel:e,autoComplete:t}){const{eInput:n}=this;n.setInputAriaLabel(e),t!==void 0&&n.setAutoComplete(t)}};function d_(e){const t=e==null?void 0:e.trim();return t===""?e:t}function $2(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[n||null,s||null].slice(0,lp(o,t))}var qge={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},H2=class extends N2{constructor(){super(...arguments),this.eFloatingFilterInputContainer=ct,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(qge)}onModelUpdated(e){this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(e))}setParams(e){this.setupFloatingFilterInputService(e),super.setParams(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.inputSvc=this.createFloatingFilterInputService(e),this.inputSvc.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){const t=e.browserAutoComplete??!1,{inputSvc:n,defaultDebounceMs:s,readOnly:o}=this;if(n.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=Kv(e.filterParams),!o){const i=dE(e.filterParams,s),r=Fs(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();Is(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(n,!0)}syncUpWithParentFilter(e){const t=e.key===Me.ENTER,n=this.reactive;if(n&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:s,params:o,lastType:i}=this;let r=s.getValue();if(o.filterParams.trimInput&&(r=d_(r),s.setValue(r,!0)),n){const a=o,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 o.parentFilterInstance(a=>{a==null||a.onFloatingFilterChanged(i||null,r||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},Yge=class extends Ge{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new tE),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,s=>this.onValueChanged(s)),this.setupListeners(n,s=>this.onValueChanged(s))}setEditable(e){this.numberInputActive=e,this.eNumberInput.setDisplayed(this.numberInputActive),this.eTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eNumberInput.setAutoComplete(e),this.eTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}setValueChangedListener(e){this.onValueChanged=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},Zge=class extends H2{constructor(){super(...arguments),this.FilterModelFormatterClass=V2,this.filterType="number",this.defaultOptions=l_}updateParams(e){c_(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=c_(e.filterParams),this.allowedCharPattern?this.createManagedBean(new B2({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new Yge)}convertValue(e){return e?Number(e):null}},h_=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],Xge=class extends i_{constructor(){super("textFilter",$2,h_),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},s=this.getValues(e);return s.length>0&&(n.filter=s[0]),s.length>1&&(n.filterTo=s[1]),n}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,i)=>{s<i&&t.push(sa(n.getValue()))}),t}createEValue(){const e=os({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:n}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,n,"to"),e}createFromToElement(e,t,n){const s=this.createManagedBean(new wc);s.addCss(`ag-filter-${n}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeEValues(e,t){const n=i=>this.removeComponents(i,e,t),{eValuesFrom:s,eValuesTo:o}=this;n(s),n(o)}},G2=class extends a_{constructor(){super(...arguments),this.filterTypeKeys=Bge}conditionToString(e,t,n,s,o){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),s,o);if(c!=null)return c}return n?`${i}-${r}`:i!=null?`${i}`:`${a}`}},Jge=({filterOption:e,value:t,filterText:n})=>{if(n==null)return!1;switch(e){case"contains":return t.includes(n);case"notContains":return!t.includes(n);case"equals":return t===n;case"notEqual":return t!=n;case"startsWith":return t.indexOf(n)===0;case"endsWith":{const s=t.lastIndexOf(n);return s>=0&&s===t.length-n.length}default:return!1}},Qge=e=>e,eme=e=>e==null?null:e.toString().toLowerCase(),tme=class extends A2{constructor(){super($2,h_),this.filterType="text",this.FilterModelFormatterClass=G2}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??Jge,this.formatter=t.textFormatter??(t.caseSensitive?Qge:eme)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,n,s){const o=e.map(h=>this.formatter(h))||[],i=this.formatter(t),{api:r,colDef:a,column:l,context:c,filterParams:{textFormatter:u}}=this.params;if(n.type==="blank")return my(t);if(n.type==="notBlank")return!my(t);const d={api:r,colDef:a,column:l,context:c,node:s.node,data:s.data,filterOption:n.type,value:i,textFormatter:u};return o.some(h=>this.matcher({...d,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=n=>{const s={...n},{filter:o,filterTo:i}=n;return o&&(s.filter=d_(o)??null),i&&(s.filterTo=d_(i)??null),s};return KL(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},nme=class extends H2{constructor(){super(...arguments),this.FilterModelFormatterClass=G2,this.filterType="text",this.defaultOptions=h_}createFloatingFilterInputService(){return this.createManagedBean(new B2)}};function sme(e){var t;return!!((t=e.quickFilter)!=null&&t.isFilterPresent())}function ome(e){var t;return(t=e.quickFilter)==null?void 0:t.getText()}function ime(e){var t;(t=e.quickFilter)==null||t.resetCache()}var rme=class extends Ge{constructor(){super(...arguments),this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){const e=this.resetCache.bind(this),t=this.gos;this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{t.get("includeHiddenColumnsInQuickFilter")||this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",n=>this.setFilter(n.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(t.get("quickFilterText")),this.parser=t.get("quickFilterParser"),this.matcher=t.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){var l;const{autoColSvc:e,colModel:t,gos:n,pivotResultCols:s}=this.beans,o=t.isPivotMode(),i=e==null?void 0:e.getColumns(),r=t.getColDefCols();let a=(o&&!n.get("applyQuickFilterBeforePivotOrAgg")?(l=s==null?void 0:s.getPivotResultCols())==null?void 0:l.list:r)??[];i&&(a=a.concat(i)),this.colsToUse=n.get("includeHiddenColumnsInQuickFilter")?a:a.filter(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 ut(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 s=this.getTextForColumn(n,e);return ut(s)&&s.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let n;e?(this.checkGenerateAggText(t),n=t.quickFilterAggregateText):n=this.getAggText(t);const{quickFilterParts:s,matcher:o}=this;return o(s,n)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let n=this.beans.filterValueSvc.getValue(e,t);const s=e.getColDef();if(s.getQuickFilterText){const o=It(this.gos,{value:n,node:t,data:t.data,column:e,colDef:s});n=s.getQuickFilterText(o)}return ut(n)?n.toString().toUpperCase():null}getAggText(e){const t=[];for(const n of this.colsToUse){const s=this.getTextForColumn(n,e);ut(s)&&t.push(s)}return t.join(`
|
|
250
250
|
`)}},ame={moduleName:"ClientSideRowModelFilter",version:lt,rowModels:["clientSide"],beans:[lge]},f_={moduleName:"FilterCore",version:lt,beans:[Fge],apiFunctions:{isAnyFilterPresent:xge,onFilterChanged:Ige},css:[pge],dependsOn:[ame]},U2={moduleName:"FilterValue",version:lt,beans:[Age]},vy={moduleName:"ColumnFilter",version:lt,beans:[Tge,Pge],dynamicBeans:{headerFilterCellCtrl:cge},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:gge,getColumnFilterInstance:mge,destroyFilter:vge,setFilterModel:yge,getFilterModel:wge,getColumnFilterModel:Cge,setColumnFilterModel:bge,showColumnFilter:Sge,hideColumnFilter:Ege,getColumnFilterHandler:_ge,doFilterAction:Rge},dependsOn:[f_,gy,U2,hge]},lme={moduleName:"CustomFilter",version:lt,userComponents:{agReadOnlyFloatingFilter:Oge},dependsOn:[vy]},cme={moduleName:"TextFilter",version:lt,dependsOn:[vy],userComponents:{agTextColumnFilter:{classImp:Xge,params:{useForm:!0}},agTextColumnFloatingFilter:nme},dynamicBeans:{agTextColumnFilterHandler:tme}},ume={moduleName:"NumberFilter",version:lt,dependsOn:[vy],userComponents:{agNumberColumnFilter:{classImp:jge,params:{useForm:!0}},agNumberColumnFloatingFilter:Zge},dynamicBeans:{agNumberColumnFilterHandler:Kge}},dme={moduleName:"DateFilter",version:lt,dependsOn:[vy],userComponents:{agDateColumnFilter:{classImp:Vge,params:{useForm:!0}},agDateInput:zge,agDateColumnFloatingFilter:Uge},dynamicBeans:{agDateColumnFilterHandler:Hge}},hme={moduleName:"QuickFilterCore",version:lt,rowModels:["clientSide"],beans:[rme],dependsOn:[f_,U2]},fme={moduleName:"QuickFilter",version:lt,apiFunctions:{isQuickFilterPresent:sme,getQuickFilter:ome,resetQuickFilter:ime},dependsOn:[hme]},pme={moduleName:"ExternalFilter",version:lt,dependsOn:[f_]},gme=".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}}",p_=(e,t,n)=>{var a,l,c;const{editModelSvc:s}=e,o=(l=(a=s==null?void 0:s.getCellValidationModel())==null?void 0:a.getCellValidation(t))==null?void 0:l.errorMessages,i=(c=s==null?void 0:s.getRowValidationModel().getRowValidation(t))==null?void 0:c.errorMessages,r=o||i;return r!=null&&r.length?r.join(n("tooltipValidationErrorSeparator",". ")):void 0},mme=class extends Ge{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,i=s_(o),{column:r,eGui:a}=t,l=r.getColDef();!s&&i&&!l.headerComponent&&(s=Sv(()=>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(o,{location:c,colDef:l,column:r,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>({column:r,colDef:r.getColDef()})};let p=this.createTooltipFeature(f);return p&&(p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip())),p}setupHeaderGroupTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,i=s_(o),{column:r,eGui:a}=t,l=r.getColGroupDef();!s&&i&&!(l!=null&&l.headerGroupComponent)&&(s=Sv(()=>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(o,{location:c,colDef:l,column:r,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>{const g={column:r};return l&&(g.colDef=l),g}},p=this.createTooltipFeature(f);return p&&t.createBean(p)}enableCellTooltipFeature(e,t,n){const{beans:s}=this,{gos:o,editSvc:i}=s,{column:r,rowNode:a}=e;let l="cell";const c=()=>{const f=!!!(i!=null&&i.isEditing(e))&&p_(s,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=r.getColDef(),g=a.data;if(p.tooltipField&&ut(g))return sp(g,p.tooltipField,r.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(It(o,{location:"cell",colDef:r.getColDef(),column:r,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},u=s_(o);n||(u&&!e.isCellRenderer()?n=()=>{const h=!!(i!=null&&i.isEditing(e));if(!h&&p_(s,e,this.getLocaleTextFunc()))return!0;if(!r.isTooltipEnabled())return!1;const g=Sv(()=>{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,s)}setupFullWidthRowTooltip(e,t,n,s){const o={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>n,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:s},i=this.beans,r=i.context;e&&t.destroyBean(e,r);const a=this.createTooltipFeature(o,i);if(a)return t.createBean(a,r)}setupCellEditorTooltip(e,t){var a,l;const{beans:n}=this,{context:s}=n,o=((a=t.getValidationElement)==null?void 0:a.call(t,!0))||!((l=t.isPopup)!=null&&l.call(t))&&e.eGui;if(!o)return;const i={getGui:()=>o,getTooltipValue:()=>p_(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,s)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=ut(t.tooltipField)||ut(t.tooltipValueGetter)||ut(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},vme=class extends Hre{createTooltipComp(e,t){const n=kie(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:lt,beans:[mme],dynamicBeans:{tooltipFeature:FL,highlightTooltipFeature:Gre,tooltipStateManager:vme},userComponents:{agTooltipComponent:zre},dependsOn:[gy],css:[gme]},bd=class{constructor(e){this.cellValueChanges=e}},g_=class extends bd{constructor(e,t,n,s){super(e),this.initialRange=t,this.finalRange=n,this.ranges=s}},yme=10,z2=class{constructor(e){this.actionStack=[],this.maxStackSize=e||yme,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}},wme=class extends Ge{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),s=this.activeRowEdit!==null&&Gce(this.activeRowEdit,t);if(!(n||s||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 s=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:o=>{o.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:s,newColumnsLoaded:s,columnGroupOpened:s,columnRowGroupChanged:s,columnMoved:s,columnPinned:s,columnVisible:s,rowDragEnd:s}),t.whenReady(this,o=>{this.gridBodyCtrl=o.gridBodyCtrl})}getCurrentUndoStackSize(){var e;return((e=this.undoStack)==null?void 0:e.getCurrentStackSize())??0}getCurrentRedoStackSize(){var e;return((e=this.redoStack)==null?void 0:e.getCurrentStackSize())??0}undo(e){const{eventSvc:t,undoStack:n,redoStack:s}=this;t.dispatchEvent({type:"undoStarted",source:e});const o=this.undoRedo(n,s,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:o})}redo(e){const{eventSvc:t,undoStack:n,redoStack:s}=this;t.dispatchEvent({type:"redoStarted",source:e});const o=this.undoRedo(s,n,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:o})}undoRedo(e,t,n,s,o){if(!e)return!1;const i=e.pop();return i!=null&&i.cellValueChanges?(this.processAction(i,r=>r[s],o),i instanceof g_?this.processRange(i.ranges||[i[n]]):this.processCell(i.cellValueChanges),t.push(i),!0):!1}processAction(e,t,n){for(const s of e.cellValueChanges){const{rowIndex:o,rowPinned:i,columnId:r}=s,a={rowIndex:o,rowPinned:i},l=fa(this.beans,a);l.displayed&&l.setDataValue(r,t(s),n)}}processRange(e){let t;const n=this.beans.rangeSvc;n.removeAllCellRanges(!0),e.forEach((s,o)=>{if(!s)return;const i=s.startRow,r=s.endRow;o===e.length-1&&(t={rowPinned:i.rowPinned,rowIndex:i.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:s.startColumn,columns:s.columns};n.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:n,rowPinned:s}=t,o={rowIndex:n,rowPinned:s},i=fa(this.beans,o),r={rowPinned:t.rowPinned,rowIndex:i.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r)}setLastFocusedCell(e){const{rowIndex:t,columnId:n,rowPinned:s}=e,{colModel:o,focusSvc:i,rangeSvc:r}=this.beans,a=o.getCol(n);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:s};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 g_(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&&ia(n)?e=new g_(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()}},Cme=".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) textarea{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}",bme={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},Sme=class extends oy{constructor(){super(bme,[eE]),this.eEditor=ct}initialiseEditor(e){const t=e.value??void 0,n=this.eEditor;n.setValue(t),n.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(n,{fieldValueChanged:o=>this.setAriaLabel(o.selected)})}getValue(){return this.eEditor.getValue()}focusIn(){this.eEditor.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.getLocaleTextFunc(),n=yv(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${s} (${n})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,n=this.getValue();return t?t({value:n,internalErrors:null,cellEditorParams:e}):null}},yy=class extends oy{constructor(e){super(),this.cellEditorInput=e,this.eEditor=ct}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:n}=this,{cellStartedEdit:s,eventKey:o,suppressPreventDefault:i}=e;n.getInputElement().setAttribute("title",""),t.init(n,e);let r,a=!0;s?(this.focusAfterAttached=!0,o===Me.BACKSPACE||o===Me.DELETE?r="":o&&o.length===1?i?a=!1:r=o:(r=t.getStartValue(),o!==Me.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===Me.PAGE_UP||c===Me.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){var s,o;const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;nl()||t.getFocusableElement().focus();const n=t.getInputElement();this.highlightAllOnFocus?n.select():(o=(s=this.cellEditorInput).setCaret)==null||o.call(s)}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),n=e.getInputElement();t.focus(),n.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},Eme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},_me=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Eme}getAgComponents(){return[yL]}init(e,t){var r,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:i}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(r=this.getDataTypeService())==null?void 0:r.getDateIncludesTimeFlag)==null?void 0:a.call(r,i.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:n}=this,{min:s,max:o,getValidationErrors:i}=n;let r=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(s){const l=s instanceof Date?s:new Date(s);if(t<l){const c=l.toLocaleDateString();r.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(o){const l=o instanceof Date?o:new Date(o);if(t>l){const c=l.toLocaleDateString();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!ut(n)&&!ut(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Lo(e,this.includeTime??!1)}},Rme=class extends yy{constructor(){super(new _me(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Dme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},Tme=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Dme}getAgComponents(){return[yL]}init(e,t){var r,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:i}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(r=this.getDataTypeService())==null?void 0:r.getDateIncludesTimeFlag)==null?void 0:a.call(r,i.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,n=e.getInputElement().value,s=this.formatDate(this.parseDate(n??void 0)),{min:o,max:i,getValidationErrors:r}=t;let a=[];if(s){const l=new Date(s),c=this.getLocaleTextFunc();if(o){const u=new Date(o);if(l<u){const d=u.toLocaleDateString();a.push(c("minDateValidation",`Date must be after ${d}`,[d]))}}if(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!ut(n)&&!ut(e.value)?e.value:e.parseValue(n??"")}getStartValue(){return Lo(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):fo(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Lo(e??null,this.includeTime??!1)??void 0}},xme=class extends yy{constructor(){super(new Tme(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Ime={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},Fme=class extends oy{constructor(){super(Ime,[Xie]),this.eEditor=ct}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:n,eventKey:s,maxLength:o,cols:i,rows:r}=e;this.focusAfterAttached=n,t.getInputElement().setAttribute("title",""),t.setMaxLength(o||200).setCols(i||60).setRows(r||10);let a;n?(this.focusAfterAttached=!0,s===Me.BACKSPACE||s===Me.DELETE?a="":s&&s.length===1?a=s:(a=this.getStartValue(e),s!==Me.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===Me.LEFT||t===Me.UP||t===Me.RIGHT||t===Me.DOWN||e.shiftKey&&t===Me.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:n}=this,s=this.getLocaleTextFunc();e.setInputAriaLabel(s("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),n&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:n}=t,s=e.getValue();return!ut(s)&&!ut(n)?n:t.parseValue(s)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,s=this.getLocaleTextFunc(),o=this.getValue();let i=[];return typeof o=="string"&&t!=null&&o.length>t&&i.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),i.length||(i=null),n?n({value:o,internalErrors:i,cellEditorParams:e}):i}},Pme={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},Ame=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Pme}getAgComponents(){return[Jie]}init(e,t){this.eEditor=e,this.params=t;const{max:n,min:s,precision:o,step:i}=t;n!=null&&e.setMax(n),s!=null&&e.setMin(s),o!=null&&e.setPrecision(o),i!=null&&e.setStep(i);const r=e.getInputElement();t.preventStepping?e.addManagedElementListeners(r,{keydown:this.preventStepping}):t.showStepperButtons&&r.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:n,getValidationErrors:s}=e,i=this.eEditor.getInputElement().valueAsNumber,r=this.getLocaleTextFunc();let a=[];return typeof i=="number"&&(t!=null&&i<t&&a.push(r("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),n!=null&&i>n&&a.push(r("maxValueValidation",`Must be less than or equal to ${n}.`,[String(n)]))),a.length||(a=null),s?s({value:i,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===Me.UP||e.key===Me.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!ut(n)&&!ut(t.value))return t.value;let s=t.parseValue(n);if(s==null)return s;if(typeof s=="string"){if(s==="")return null;s=Number(s)}return isNaN(s)?null:s}getStartValue(){return this.params.value}setCaret(){nl()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},kme=class extends yy{constructor(){super(new Ame(()=>this.getLocaleTextFunc()))}},Ome={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},Mme=class extends oy{constructor(){super(Ome,[cre]),this.eEditor=ct,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:n,gos:s}=this,{values:o,value:i,eventKey:r}=e;if(Ln(o)){qe(58);return}this.startedByEnter=r!=null?r===Me.ENTER:!1;let a=!1;o.forEach(d=>{const h={value:d},f=n.formatValue(e.column,null,d),p=f!=null;h.text=p?f:d,t.addOption(h),a=a||i===d}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:u}=e;l!=null&&t.setPickerGap(l),u!=null&&t.setPickerMaxHeight(u),c!=null&&t.setPickerMaxWidth(c),s.get("editType")!=="fullRow"&&this.addManagedListeners(this.eEditor,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eEditor.showPicker()})}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:n}=e,s=this.getValue();let o=[];if(t&&!t.includes(s)){const i=this.getLocaleTextFunc();o.push(i("invalidSelectionValidation","Invalid selection."))}else o=null;return n?n({value:s,internalErrors:o,cellEditorParams:e}):o}},Nme={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},Lme=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Nme}getAgComponents(){return[Gv]}init(e,t){this.eEditor=e,this.params=t;const n=t.maxLength;n!=null&&e.setMaxLength(n)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,s=this.getValue(),o=this.getLocaleTextFunc();let i=[];return t!=null&&typeof s=="string"&&s.length>t&&i.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),i.length||(i=null),n?n({value:s,cellEditorParams:e,internalErrors:i}):i}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();return!ut(n)&&!ut(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=ut(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},j2=class extends yy{constructor(){super(new Lme(()=>this.getLocaleTextFunc()))}};function Vme(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function Bme(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 $me(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function Hme(e){var t;(t=e.undoRedo)==null||t.undo("api")}function Gme(e){var t;(t=e.undoRedo)==null||t.redo("api")}function Ume(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function Wme(e){var s;const t=(s=e.editModelSvc)==null?void 0:s.getEditMap(),n=[];return t==null||t.forEach((o,i)=>{const{rowIndex:r,rowPinned:a}=i;o.forEach((l,c)=>{const{editorValue:u,pendingValue:d,sourceValue:h,state:f}=l,p=pa(l);let g=u??d;g===ui&&(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 zme(e,t=!1){var s;const{editSvc:n}=e;if(n!=null&&n.isBatchEditing()){if(t)for(const o of((s=e.editModelSvc)==null?void 0:s.getEditPositions())??[])o.state==="editing"&&n.revertSingleCellEdit(o);else _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 jme(e,t){var s;const n=Gn(e,t);return((s=e.editSvc)==null?void 0:s.isEditing(n))??!1}function Kme(e,t){const{key:n,colKey:s,rowIndex:o,rowPinned:i}=t,{editSvc:r,colModel:a}=e,l=a.getCol(s);if(!l){qe(12,{colKey:s});return}const u=fa(e,{rowIndex:o,rowPinned:i||null});if(!u){qe(290,{rowIndex:o,rowPinned:i});return}if(!l.isCellEditable(u))return;i==null&&q2(e,o),K2(e,s),r==null||r.startEditing({rowNode:u,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function qme(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function Yme(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function Zme(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var Xme={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},Jme=class extends V0{constructor(e){super(Xme),this.params=e}postConstruct(){fc(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=s=>{wE(this.gos,s,t.node,t.column,!0)||t.onKeyDown(s)};this.addManagedElementListeners(e,{keydown:n})}};function Qme(e,{column:t},n,s,o="ui"){var c;if(n instanceof KeyboardEvent&&(n.key===Me.TAB||n.key===Me.ENTER||n.key===Me.F2||n.key===Me.BACKSPACE&&s))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=eve(e.gos,r),l=n==null?void 0:n.type;return l==="click"&&(n==null?void 0:n.detail)===1&&a===1||l==="dblclick"&&(n==null?void 0:n.detail)===2&&a===2?!0:o==="api"?s??!1:!1}function eve(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function m_(e,{rowNode:t,column:n},s="ui"){const o=n.getColDef().editable,i=e.editModelSvc;return n.isColumnFunc(t,o)||!!i&&i.hasEdits({rowNode:t,column:n},{withOpenEditor:!0})}function tve(e,t,n="ui"){const s=m_(e,t,n);return s===!0||n==="ui"?s:e.colModel.getCols().some(i=>m_(e,{rowNode:t.rowNode,column:i},n))}var wy=(e,t=!1)=>{if(e!==void 0)return pa(e)||t&&e.state==="editing"};function Y2(e,t,n=!1){var s;return wy((s=e.editModelSvc)==null?void 0:s.getEdit(t),n)}var Z2=(e,t,n)=>{if(e)for(let s=0,o=e.length;s<o;++s){const i=e[s];if(i.data&&(wy(t==null?void 0:t.getEdit({rowNode:i,column:n}))||wy(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:s}=t;return e.gos.get("groupTotalRow")&&!(s!=null&&s.footer)?!1:Z2(s==null?void 0:s.childrenAfterGroup,e.editModelSvc,n)}function J2(e,{rowNode:t,column:n}){var s;if(t=t.pinnedSibling,!!t)return wy((s=e.editModelSvc)==null?void 0:s.getEdit({rowNode:t,column:n}))}var nve=class extends Ge{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}setComp(e){this.cellComp=e,this.applyCellStyles()}applyCellStyles(){var o;const{cellCtrl:e,editSvc:t,beans:n}=this;if(t!=null&&t.isBatchEditing()&&t.isEditing()){const i=Y2(n,e)||X2(n,e)||J2(n,e);this.applyBatchingStyle(i)}else this.applyBatchingStyle(!1);const s=!!((o=this.editModelSvc)!=null&&o.getCellValidationModel().hasCellValidation(this.cellCtrl));this.cellComp.toggleCss("ag-cell-editing-error",s)}applyBatchingStyle(e){var t;this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&((t=this.editSvc)==null?void 0:t.isBatchEditing()))??!1)}},sve=class extends Ge{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){var r;const{rowCtrl:e,editModelSvc:t,beans:n}=this;let s=e.rowNode,o=t==null?void 0:t.getEditRow(s);const i=(r=this.editModelSvc)==null?void 0:r.getRowValidationModel().hasRowValidation({rowNode:s});if(!o&&s.pinnedSibling&&(s=s.pinnedSibling,o=t==null?void 0:t.getEditRow(s)),o){const a=Array.from(o.keys()).some(l=>{const c={rowNode:s,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 o,i;const n=((o=this.editSvc)==null?void 0:o.isBatchEditing())??!1,s=this.gos.get("editType")==="fullRow";(i=this.rowCtrl)==null||i.forEachGui(void 0,({rowComp:r})=>{r.toggleCss("ag-row-editing",s&&t),r.toggleCss("ag-row-batch-edit",s&&t&&n),r.toggleCss("ag-row-inline-editing",t),r.toggleCss("ag-row-not-inline-editing",!t),r.toggleCss("ag-row-editing-invalid",s&&t&&e)})}},ove=({rowModel:e,pinnedRowModel:t,editModelSvc:n},s)=>{const o=new Set;e.forEachNode(i=>s.has(i)&&o.add(i)),t==null||t.forEachPinnedRow("top",i=>s.has(i)&&o.add(i)),t==null||t.forEachPinnedRow("bottom",i=>s.has(i)&&o.add(i));for(const i of s)o.has(i)||n.removeEdits({rowNode:i});return o},ive=({editModelSvc:e},t,n)=>{var s;for(const o of t)(s=e==null?void 0:e.getEditRow(o))==null||s.forEach((i,r)=>!n.has(r)&&e.removeEdits({rowNode:o,column:r}))},rve=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),s=new Set(n.keys());ive(e,ove(e,s),t)},ave=new Set(["undo","redo","paste","bulk","rangeSvc"]),lve=new Set(["ui","api"]),Q2={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},cve=new Set(Object.keys(Q2)),uve=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Cy={cancel:!0,source:"api"},dve={cancel:!1,source:"api"},Sd={checkSiblings:!0},cp={force:!0,suppressFlash:!0},hve=class extends Ge{constructor(){super(...arguments),this.beanName="editSvc",this.batch=!1,this.stopping=!1,this.committing=!1}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:s})=>{this.stopEditing(void 0,Cy),this.createStrategy(s)});const t=rve(e),n=()=>{const s=this.model.getCellValidationModel().getCellValidationMap().size>0,o=this.model.getRowValidationModel().getRowValidationMap().size>0;return s||o?this.stopEditing(void 0,Cy):this.isEditing()&&(this.isBatchEditing()?yd(e,this.model.getEditPositions()):this.stopEditing(void 0,dve)),!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,Cy)):(this.stopEditing(void 0,Cy),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:s}=this,o=eB(n,e);if(s){if(s.beanName===o)return s;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(o,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,n,s="ui"){const o=Qme(this.beans,e,t,n,s);return o&&(this.strategy??(this.strategy=this.createStrategy())),o}shouldStopEditing(e,t,n="ui"){var s;return((s=this.strategy)==null?void 0:s.shouldStop(e,t,n))??null}shouldCancelEditing(e,t,n="ui"){var s;return((s=this.strategy)==null?void 0:s.shouldCancel(e,t,n))??null}validateEdit(){return Tfe(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:s=null,source:o="ui",ignoreEventKey:i=!1,silent:r}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=Gn(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,s,n,o);if(l===!1&&o!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,o)&&!t.continueEditing&&this.stopEditing(void 0,{source:o}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:s,source:o,ignoreEventKey:i,startedEdit:n,silent:r})}stopEditing(e,t){var v,y,b;const{event:n,cancel:s,source:o="ui",forceCancel:i,forceStop:r}=t||{},{beans:a,model:l}=this;if(cve.has(o)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const c=this.committing?Q2[o]:o;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=!s&&(!!this.shouldStopEditing(e,n,c)||this.committing&&!this.batch)||(r??!1),g=s&&!!this.shouldCancelEditing(e,n,c)||(i??!1);if(p||g){_c(a,{persist:!0,isCancelling:g||s,isStopping:p});const S=l.getEditMap(),C=this.processEdits(S,s,o);(v=this.strategy)==null||v.stop(s,n);for(const E of C)l.clearEditValue(E);this.bulkRefresh(void 0,h);for(const E of l.getEditPositions(S)){const R=Gn(a,E),T=pa(E);R==null||R.refreshCell({force:!0,suppressFlash:!T})}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===Me.ENTER,E=S===Me.ESCAPE,R=S===Me.TAB;(C||R||E)&&(C||R?_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),YE(a),this.model.hasEdits()||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()),this.bulkRefresh(),g&&this.beans.rowRenderer.refreshRows({rowNodes:Array.from(h.keys())}),this.isBatchEditing()&&(this.beans.rowRenderer.refreshRows({suppressFlash:!0,force:!0}),f&&p&&this.dispatchBatchEvent("batchEditingStopped",h)),this.stopping=!1,f}navigateAfterEdit(e,t){var c;if(!e||!t)return;const{event:n,suppressNavigateAfterEdit:s}=e;if(!(n instanceof KeyboardEvent)||s)return;const{key:i,shiftKey:r}=n,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(i!==Me.ENTER||!a)return;const l=r?Me.UP:Me.DOWN;(c=this.beans.navigation)==null||c.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,n){const s=Array.from(e.keys()),o=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,i=[];for(const r of s){const a=e.get(r);for(const l of a.keys()){const c=a.get(l),u={rowNode:r,column:l},d=pa(c);!t&&d&&!o&&(this.setNodeDataValue(r,l,c.pendingValue,void 0,n)||i.push(u))}}return i}setNodeDataValue(e,t,n,s,o="edit"){const{beans:i}=this,r=Gn(i,{rowNode:e,column:t}),a=lve.has(o)?"edit":o;r&&(r.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,n,a);return r&&(r.suppressRefreshCell=!1),s&&(r==null||r.refreshCell(cp)),l}setEditMap(e,t){var s;this.strategy??(this.strategy=this.createStrategy()),(s=this.strategy)==null||s.setEditMap(e,t),this.bulkRefresh();let n=cp;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...fve(e),...cp}),this.beans.rowRenderer.refreshCells(n)}dispatchEditValuesChanged({rowNode:e,column:t},n={}){if(!e||!t||!n)return;const{pendingValue:s,sourceValue:o}=n,{rowIndex:i,rowPinned:r,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:i,rowPinned:r,column:t,source:"api",data:a,newValue:s,oldValue:o,value:s,colDef:t.getColDef()})}bulkRefresh(e={},t,n={}){var a;const{beans:s,gos:o}=this,{editModelSvc:i,rowModel:r}=s;ns(o)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),n):t&&((a=i==null?void 0:i.getEditMap(!1))==null||a.forEach((l,c)=>{for(const u of l.keys())this.refCell({rowNode:c,column:u},l.get(u),n)})))}refCell({rowNode:e,column:t},n,s={}){var d,h,f;const{beans:o,gos: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(o,{rowNode:p,column:t}))==null||h.refreshCell(s);for(const p of a)(f=Gn(o,{rowNode:p,column:t}))==null||f.refreshCell(s)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:n}=e,{gos:s,beans:o}=this;if(n.group){if(s.get("treeData")){if(!n.data&&!s.get("enableGroupEdit"))return!1}else if(!s.get("enableGroupEdit"))return!1}const i=eB(s)==="fullRow"?tve(o,e,t):m_(o,e,t);return i&&(this.strategy??(this.strategy=this.createStrategy())),i}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,n=!0){var s,o,i,r;if(this.hasValidationErrors(e)){const a=Gn(this.beans,e);return this.cellEditingInvalidCommitBlocks()?((s=t==null?void 0:t.preventDefault)==null||s.call(t),n&&(!(a!=null&&a.hasBrowserFocus())&&(a==null||a.focusCell()),(r=(i=(o=a==null?void 0:a.comp)==null?void 0:o.getCellEditor())==null?void 0:i.focusIn)==null||r.call(i)),"block-stop"):(a&&this.revertSingleCellEdit(a),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){var s,o,i,r;const n=Gn(this.beans,e);(s=n==null?void 0:n.comp)!=null&&s.getCellEditor()&&(yd(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),vd(this.beans,e,{silent:!0}),Rc(this.beans),n==null||n.refreshCell(cp),t&&(n==null||n.focusCell(),(r=(i=(o=n==null?void 0:n.comp)==null?void 0:o.getCellEditor())==null?void 0:i.focusIn)==null||r.call(i)))}hasValidationErrors(e){var s;Rc(this.beans);const t=Gn(this.beans,e);t&&(t.refreshCell(cp),(s=t.rowCtrl.rowEditStyleFeature)==null||s.applyRowStyles());let n=!1;return e!=null&&e.rowNode?(n||(n=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(n||(n=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(n||(n=this.model.getCellValidationModel().getCellValidationMap().size>0),n||(n=this.model.getRowValidationModel().getRowValidationMap().size>0)),n}moveToNextCell(e,t,n,s="ui"){var a;let o;const i=this.isEditing(),r=i&&this.checkNavWithValidation(void 0,n)==="block-stop";return e instanceof wd&&i&&(o=(a=this.strategy)==null?void 0:a.moveToNextEditingCell(e,t,n,s,r)),o===null||(o=o||!!this.beans.focusSvc.focusedHeader,o===!1&&!r&&this.stopEditing()),o}getCellDataValue({rowNode:e,column:t},n=!0){if(!e||!t)return;let s=this.model.getEdit({rowNode:e,column:t});const o=e.pinnedSibling;if(o){const r=this.model.getEdit({rowNode:o,column:t});r&&(s=r)}const i=n?(s==null?void 0:s.editorValue)??(s==null?void 0:s.pendingValue):s==null?void 0:s.pendingValue;return i===ui||!s?(s==null?void 0:s.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):i}addStopEditingWhenGridLosesFocus(e){bfe(this,this.beans,e)}createPopupEditorWrapper(e){return new Jme(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var s;try{if((!this.isEditing()||this.committing)&&!uve.has(n))return;const{beans:o}=this;this.strategy??(this.strategy=this.createStrategy());const i=this.isBatchEditing()?"ui":this.committing?n??"api":"api";if(!n||ave.has(n))return dy(o,e,t,n,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,n);const r=this.model.getEdit(e);if(r){if(r.pendingValue===t)return!1;if(r.sourceValue!==t)return dy(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0;if(r.sourceValue===t)return(s=o.editModelSvc)==null||s.removeEdits(e),this.dispatchEditValuesChanged(e,{...r,pendingValue:t}),!0}return dy(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){_fe(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:s,column:o}=e,{compDetails:i,valueToDisplay:r}=t;if(i){const{params:l}=i;return l.data=this.model.getEditRowDataValue(s,Sd),{compDetails:i}}const a=this.model.getEditRow(e.rowNode,Sd);if(r!==void 0&&(a!=null&&a.has(o)))return{valueToDisplay:this.valueSvc.getValue(o,s)}}cleanupEditors(){var e;(e=this.strategy)==null||e.cleanupEditors()}dispatchCellEvent(e,t,n,s){var o;(o=this.strategy)==null||o.dispatchCellEvent(e,t,n,s)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return 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:s,rangeSvc:o,valueSvc:i}=this;_c(s,{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(o==null||o.forEachRowInRange(d,h=>{const f=fa(s,h);if(f===void 0)return;const p=r.get(f)??new Map;for(const g of d.columns)if(g&&this.isCellEditable({rowNode:f,column:g},"api")){const v=i.getValue(g,f,!0,"api");let 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(),YE(s),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(r)})}),this.bulkRefresh();const l=Gn(s,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new nve(e,t)}createRowStyleFeature(e,t){return new sve(e,t)}setEditingCells(e,t){const{beans:n}=this,{colModel:s,valueSvc:o}=n,i=new Map;for(let{colId:r,column:a,colKey:l,rowIndex:c,rowPinned:u,newValue:d,state:h}of e){const f=r?s.getCol(r):l?s.getCol(l):a;if(!f)continue;const p=fa(n,{rowIndex:c,rowPinned:u});if(!p)continue;const g=o.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!pa({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=i.get(p);v||(v=new Map,i.set(p,v)),d===void 0&&(d=ui),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||!pa(n))return;const o=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(i=this.beans.ariaAnnounce)==null||i.announceValue(o,"pendingChange")}allowedFocusTargetOnValidation(e){return Gn(this.beans,e)}};function fve(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 Ge{postConstruct(){var e,t;this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:(e=this.onCellFocusChanged)==null?void 0:e.bind(this),cellFocusCleared:(t=this.onCellFocusChanged)==null?void 0:t.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const n=e.previousParams,{editSvc:s,beans:o}=this,i=e.type==="cellFocused"?e.sourceEvent:null;n&&(t=Gn(o,n));const{gos:r,editModelSvc:a}=o,l=e.type==="cellFocusCleared";if(s.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:u,rowPinned:d}=e,h={column:c,rowNode:fa(o,{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?s.stopEditing(void 0,{cancel:v,source:l&&p?"api":void 0,event:i}):!0)||(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"}))}t==null||t.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){var o,i;const n=this.model.getEditPositions(),s={all:[],pass:[],fail:[]};for(const r of n){s.all.push(r);const a=this.model.getCellValidationModel().getCellValidation(r);if((((o=a==null?void 0:a.errorMessages)==null?void 0:o.length)??0)>0){s.fail.push(r);continue}s.pass.push(r)}if(e)for(const r of n)hy(this.beans,r,{cancel:e}),this.model.stop(r);else{const r=this.processValidationResults(s);if(r.destroy.length>0)for(const a of r.destroy)hy(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(),s=[];if(e)for(const o of n)o.rowNode!==e&&s.push(o);else for(const o of n)s.push(o);yd(this.beans,s),YE(this.beans,t)}setFocusOutOnEditor(e){var t,n,s;(s=(n=(t=e.comp)==null?void 0:t.getCellEditor())==null?void 0:n.focusOut)==null||s.call(n)}setFocusInOnEditor(e){const t=e.comp,n=t==null?void 0:t.getCellEditor();if(n!=null&&n.focusIn)n.focusIn();else{const s=this.beans.gos.get("editType")==="fullRow";e.focusCell(s),e.onEditorAttachedFuncs.push(()=>{var o,i;return(i=(o=t==null?void 0:t.getCellEditor())==null?void 0:o.focusIn)==null?void 0:i.call(o)})}}setupEditors(e){const{event:t,ignoreEventKey:n=!1,startedEdit:s,position:o,cells:i=this.model.getEditPositions()}=e,r=t instanceof KeyboardEvent&&!n&&t.key||void 0;Efe(this.beans,i,o,r,t,s)}dispatchCellEvent(e,t,n,s){const o=Gn(this.beans,e);o&&this.eventSvc.dispatchEvent({...o.createEvent(t??null,n),...s})}dispatchRowEvent(e,t,n){if(n)return;const s=KE(this.beans,e);s&&this.eventSvc.dispatchEvent(s.createRowEvent(t))}shouldStop(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return s&&n==="api"?!0:s&&(n==="ui"||n==="edit")?!1:n==="api"?!0:t instanceof KeyboardEvent&&!s?t.key===Me.ENTER:null}shouldCancel(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!s&&t.key===Me.ESCAPE||s&&n==="api"||n==="api")}setEditMap(e,t){var s;t!=null&&t.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const n=[];if(e.forEach((o,i)=>{o.forEach((r,a)=>{r.state==="editing"&&n.push({...r,rowNode:i,column:a})})}),t!=null&&t.update&&(e=new Map([...this.model.getEditMap(),...e])),(s=this.model)==null||s.setEditMap(e),n.length>0){const o=n.at(-1),i=o.pendingValue===ui?void 0:o.pendingValue;this.start({position:o,event:new KeyboardEvent("keydown",{key:i}),source:"api"});const r=Gn(this.beans,o);r&&this.setFocusInOnEditor(r)}}destroy(){this.cleanupEditors(),super.destroy()}},pve=class extends tB{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:s}=e||{};if(!KE(this.beans,{rowNode:this.rowNode}))return!0;const i=super.shouldStop({rowNode:this.rowNode},t,n);return i!==null?i:this.rowNode?s!==this.rowNode:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:n,startedEdit:s,event:o,ignoreEventKey:i}=e,{rowNode:r}=t;this.rowNode!==r&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],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:s,event:o,ignoreEventKey:i})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){var o;const{rowNode:n}=this;if(n&&!this.model.hasRowEdits(n))return!1;const s=[];if(e||this.model.getEditMap().forEach((i,r)=>{if(!(!i||i.size===0)){for(const a of i.values())if(pa(a)){s.push(r);break}}}),Rc(this.beans),!e&&((o=this.editSvc)==null?void 0:o.checkNavWithValidation({rowNode:n}))==="block-stop")return!1;super.stop(e,t);for(const i of s)this.dispatchRowEvent({rowNode:i},"rowValueChanged");return this.cleanupEditors({rowNode:n},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,n=e.previousParams;if((n==null?void 0:n.rowIndex)===t||e.sourceEvent instanceof KeyboardEvent)return;const s=Gn(this.beans,n);this.gos.get("invalidEditValueMode")==="block"&&s&&(this.model.getCellValidationModel().getCellValidation(s)||this.model.getRowValidationModel().getRowValidation(s))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);for(const n of this.startedRows)this.dispatchRowEvent({rowNode:n},"rowEditingStopped");this.startedRows.length=0}moveToNextEditingCell(e,t,n,s="ui",o=!1){var h,f,p,g;const i=e.cellPosition;let r;this.model.suspend(!0);try{r=(h=this.beans.navigation)==null?void 0:h.findNextCellToFocusOn(i,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(r===!1)return null;if(r==null)return!1;const a=r.cellPosition,l=e.isCellEditable(),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&&!o?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&&o&&this.setFocusInOnEditor(r),r.focusCell(!0,n)),!u&&!o&&((p=this.editSvc)==null||p.stopEditing({rowNode:e.rowNode},{event:n}),this.cleanupEditors(r,!0),d?r.focusCell(!0,n):this.editSvc.startEditing(r,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),(g=e.rowCtrl)==null||g.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:n},s)=>{var i;if(n!=="editing")return;const o=Gn(this.beans,{rowNode:t,column:s});o&&!((i=o.comp)!=null&&i.getCellEditor())&&vd(this.beans,o,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},gve=class extends tB{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,n="ui"){const s=super.shouldStop(e,t,n);if(s!==null)return s;const{rowNode:o,column:i}=e||{};return(!this.rowNode||!this.column)&&o&&i?null:this.rowNode!==o||this.column!==i}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:n,event:s,ignoreEventKey:o}=e;(this.rowNode!==t.rowNode||this.column!==t.column)&&super.cleanupEditors(),this.rowNode=t.rowNode,this.column=t.column,this.model.start(t),this.setupEditors({cells:[t],position:t,startedEdit:n,event:s,ignoreEventKey:o})}dispatchRowEvent(e,t,n){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){return super.stop(e,t),this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:n}=this.beans,{rowIndex:s,column:o,rowPinned:i}=e,r=fa(this.beans,{rowIndex:s,rowPinned:i}),a=qE(o),l=t.getCol(a),c=e.previousParams;if(c){const u=qE(c.column);if((c==null?void 0:c.rowIndex)===s&&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,s="ui",o=!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),o||(e.eGui.focus(),(g=this.editSvc)==null||g.stopEditing(e,{source:(p=this.editSvc)!=null&&p.isBatchEditing()?"ui":"api",event:n}));try{a=(v=this.beans.navigation)==null?void 0:v.findNextCellToFocusOn(r,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,u=e.isCellEditable(),d=a.isCellEditable(),h=c&&r.rowIndex===c.rowIndex&&r.rowPinned===c.rowPinned;u&&!o&&this.setFocusOutOnEditor(e);const f=this.gos.get("suppressStartEditOnTab");if(!h&&!o&&(super.cleanupEditors(a,!0),f?a.focusCell(!0,n):this.editSvc.startEditing(a,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),d&&!o){if(a.focusCell(!1,n),f)a.focusCell(!0,n);else if(!((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&&o&&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:lt,beans:[Cfe,hve],apiFunctions:{getEditingCells:Wme,getEditRowValues:Ume,getCellEditorInstances:Sfe,startEditingCell:Kme,stopEditing:zme,isEditing:jme,validateEdit:qme},dynamicBeans:{singleCell:gve,fullRow:pve},dependsOn:[gy,W2],css:[Cme]},mve={moduleName:"UndoRedoEdit",version:lt,beans:[wme],apiFunctions:{undoCellEditing:Hme,redoCellEditing:Gme,getCurrentUndoSize:Yme,getCurrentRedoSize:Zme},dependsOn:[ul]},vve={moduleName:"TextEditor",version:lt,userComponents:{agCellEditor:j2,agTextCellEditor:j2},dependsOn:[ul]},yve={moduleName:"NumberEditor",version:lt,userComponents:{agNumberCellEditor:{classImp:kme}},dependsOn:[ul]},wve={moduleName:"DateEditor",version:lt,userComponents:{agDateCellEditor:Rme,agDateStringCellEditor:xme},dependsOn:[ul]},Cve={moduleName:"CheckboxEditor",version:lt,userComponents:{agCheckboxCellEditor:Sme},dependsOn:[ul]},bve={moduleName:"SelectEditor",version:lt,userComponents:{agSelectCellEditor:Mme},dependsOn:[ul]},Sve={moduleName:"LargeTextEditor",version:lt,userComponents:{agLargeTextCellEditor:Fme},dependsOn:[ul]},Eve={moduleName:"CustomEditor",version:lt,dependsOn:[ul]},_ve=class extends Ge{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),Moe(e))}createColumns(e,t){var h,f;const n=()=>{var p;Mv(this.beans,(p=this.columns)==null?void 0:p.tree),this.columns=null},s=e.treeDepth,i=(((h=this.columns)==null?void 0:h.treeDepth)??-1)==s,r=this.generateSelectionCols();if(Ooe(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=>!aa(v));return[...r,...g]})}updateColumns(e){var n;const t=rd(e.source);for(const s of((n=this.columns)==null?void 0:n.list)??[]){const o=this.createSelectionColDef(e.currentValue);s.setColDef(o,null,t),Vi(this.beans,{state:[{...o,colId:s.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>zf(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 s=(((a=(r=t.autoColSvc)==null?void 0:r.getColumns())==null?void 0:a.length)??0)>0;if(n.checkboxLocation==="autoGroupColumn"&&s)return!1;const o=!!id(n),i=Iv(n);return o||i}createSelectionColDef(e){const{gos:t}=this,n=e??t.get("selectionColumnDef"),s=t.get("enableRtl"),{rowSpan:o,spanRows:i,...r}=n??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:s?"right":"left",comparator(a,l,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 s=t&&typeof t!="string"?id(t):void 0,o=e&&typeof e!="string"?id(e):void 0,i=s!==o,r=t&&typeof t!="string"?Iv(t):void 0,a=e&&typeof e!="string"?Iv(e):void 0,l=r!==a,c=Fv(e),u=Fv(t);(i||l||c!==u)&&this.beans.colModel.refreshAll(n)}destroy(){var e;Mv(this.beans,(e=this.columns)==null?void 0:e.tree),super.destroy()}refreshVisibility(e,t,n){var l,c;if(!((l=this.columns)!=null&&l.list.length))return;const s=e.length+t.length+n.length;if(s===0)return;const o=this.columns.list[0];if(!o.isVisible())return;const i=()=>{let u;switch(o.pinned){case"left":case!0:u=e;break;case"right":u=n;break;default:u=t}u&&Li(u,o)};(((c=this.beans.rowNumbersSvc)==null?void 0:c.getColumn(WN))?2:1)===s&&i()}};function Rve(e,t){var r;if(!t.nodes.every(a=>a.rowPinned&&!ep(a)?(qe(59),!1):a.id===void 0?(qe(60),!1):!0))return;const{nodes:s,source:o,newValue:i}=t;(r=e.selectionSvc)==null||r.setNodesSelected({nodes:s,source:o??"api",newValue:i})}function Dve(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.selectAllRowNodes({source:n,selectAll:t})}function Tve(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.deselectAllRowNodes({source:n,selectAll:t})}function xve(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function Ive(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function Fve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function Pve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function Ave(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function kve(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var Ove=class extends Kle{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=Pv(e),this.groupSelectsDescendants=Uf(e),this.groupSelectsFiltered=Av(e)==="filteredDescendants",this.masterSelectsDetail=VN(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=Uf(e),n=Pv(e),s=Av(e)==="filteredDescendants";this.masterSelectsDetail=VN(e)==="detail",(t!==this.groupSelectsDescendants||s!==this.groupSelectsFiltered||n!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=s,this.mode=n)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,n){if(this.isRowSelectionBlocked(t))return 0;const s=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,n);if(s==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in s)return s.reset?this.resetNodes():this.selectRange(s.deselect,!1,n),this.selectRange(s.select,!0,n);{const o=s.checkFilteredNodes?sB(s.node):s.newValue;return this.setNodesSelected({nodes:[s.node],newValue:o,clearSelection:s.clearSelection,keepDescendants:s.keepDescendants,event:e,source:n})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:n,nodes:s,event:o,source:i,keepDescendants:r=!1}){var c;if(s.length===0)return 0;const{gos:a}=this;if(!dc(a)&&e)return qe(132),0;if(s.length>1&&!this.isMultiSelect())return qe(130),0;let l=0;for(let u=0;u<s.length;u++){const d=s[u],h=Ed(d);if(h.rowPinned&&!ep(h)){qe(59);continue}if(h.id===void 0){qe(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,o,i)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((c=h.childrenAfterGroup)!=null&&c.length)&&(l+=this.selectChildren(h,e,i))}return n||(s.length===1&&i==="api"&&this.selectionCtx.setRoot(Ed(s[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(Ed(s[0]),r,i)),l>0&&(this.updateGroupsFromChildrenSelections(i),this.dispatchSelectionChanged(i))),l}selectRange(e,t,n){let s=0;return e.forEach(o=>{const i=Ed(o);if(i.group&&this.groupSelectsDescendants)return;this.selectRowNode(i,t,void 0,n)&&s++}),s>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n)),s}selectChildren(e,t,n){const s=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return s?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:n,nodes:s}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((n,s)=>{e(n)&&t.set(s,n)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:n,rowModel:s}=this.beans;if(!ns(n))return!1;const o=s.rootNode;if(!o)return!1;t||(t=new np(!0,o),t.active=!1);let i=!1;return t.forEachChangedNodeDepthFirst(r=>{if(r!==o){const a=this.calculateSelectedFromChildren(r);i=this.selectRowNode(r,a===null?!1:a,void 0,e)||i}}),i}clearOtherNodes(e,t,n){const s=new Map;let o=0;return this.selectedNodes.forEach(i=>{const r=i.id==e.id;if((t?!Nve(e,i):!0)&&!r){const l=this.selectedNodes.get(i.id);o+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:n}),this.groupSelectsDescendants&&i.parent&&s.set(i.parent.id,i.parent)}}),s.forEach(i=>{const r=this.calculateSelectedFromChildren(i);this.selectRowNode(i,r===null?!1:r,void 0,n)}),o}onRowSelected(e){const t=e.node;this.groupSelectsDescendants&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}createDaemonNode(e){if(!e.id)return;const t=new ol(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(!ns(e))return;const n=t.getTopLevelNodes();if(n===null)return;const s=[];function o(i){for(let r=0,a=i.length;r<a;r++){const l=i[r];l.isSelected()?s.push(l):l.group&&l.childrenAfterGroup&&o(l.childrenAfterGroup)}}return o(n),s}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const n=ns(this.gos);let s=!1;const o=i=>{const r=this.selectRowNode(Ed(i),!1,void 0,e);s||(s=r)};if(t==="currentPage"||t==="filtered"){if(!n){bn(102);return}this.getNodesToSelect(t).forEach(o)}else this.selectedNodes.forEach(o),this.reset(e);if(this.selectionCtx.selectAll=!1,n&&this.groupSelectsDescendants){const i=this.updateGroupsFromChildrenSelections(e);s||(s=i)}s&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,n=0;return this.getNodesToSelect(e).forEach(s=>{this.groupSelectsDescendants&&s.group||(s.isSelected()?t++:s.selectable&&n++)}),{selectedCount:t,notSelectedCount:n}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:n}=this.getSelectedCounts(e);return 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=o=>t.push(o);if(e==="currentPage")return this.forEachNodeOnPage(o=>{if(!o.group){n(o);return}if(!o.expanded&&!o.footer){const i=r=>{var a;n(r),(a=r.childrenAfterFilter)==null||a.forEach(i)};i(o);return}this.groupSelectsDescendants||n(o)}),t;const s=this.beans.rowModel;return e==="filtered"?(s.forEachNodeAfterFilter(n),t):(s.forEachNode(n),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:n}=this.beans,s=t.getFirstRow(),o=t.getLastRow();for(let i=s;i<=o;i++){const r=n.getRow(i);r&&e(r)}}selectAllRowNodes(e){const{gos:t,selectionCtx:n}=this;if(!dc(t)){qe(132);return}if(boe(t)&&!Gf(t)){qe(130);return}if(!this.canSelectAll())return;const{source:s,selectAll:o}=e;let i=!1;if(this.getNodesToSelect(o).forEach(r=>{const a=this.selectRowNode(Ed(r),!0,void 0,s);i||(i=a)}),n.selectAll=!0,ns(t)&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(s);i||(i=r)}i&&this.dispatchSelectionChanged(s)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,n){if(e||(e=[]),!Array.isArray(e)){bn(103);return}const s=new Set(e),o=[];this.beans.rowModel.forEachNode(i=>{s.has(i.id)&&o.push(i)}),n&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:o,source:t})}canSelectAll(){return ns(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!dc(t))return;const s="selectableChanged",o=e!==void 0,i=ns(t)&&this.groupSelectsDescendants,r=[],a=c=>{var d;if(o&&!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 np(!1,c):void 0}e==null||e.forEachChangedNodeDepthFirst(a,!o,!o)}else n.forEachNode(a);r.length&&this.setNodesSelected({nodes:r,newValue:!1,source:s}),!o&&i&&((l=this.updateGroupsFromChildrenSelections)==null||l.call(this,s))}updateSelectableAfterGrouping(e){var t;this.updateSelectable(e),this.groupSelectsDescendants&&((t=this.updateGroupsFromChildrenSelections)!=null&&t.call(this,"rowGroupChanged",e))&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){var i,r;if(!this.masterSelectsDetail)return;const n=(r=(i=e.detailNode)==null?void 0:i.detailGridInfo)==null?void 0:r.api;if(!n)return;const s=Mve(n);if(e.isSelected()!==s&&this.selectRowNode(e,s,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!s){const a=this.detailSelection.get(e.id)??new Set;for(const l of n.getSelectedNodes())a.add(l.id);this.detailSelection.set(e.id,a)}}setDetailSelectionState(e,t,n){if(this.masterSelectsDetail){if(!Gf(t)){qe(269);return}switch(e.isSelected()){case!0:{n.selectAll();break}case!1:{n.deselectAll();break}case void 0:{const s=this.detailSelection.get(e.id);if(s){const o=[];for(const i of s){const r=n.getRowNode(i);r&&o.push(r)}n.setNodesSelected({nodes:o,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function Ed(e){return ep(e)?e.pinnedSibling:e.footer?e.sibling:e}function Mve(e){let t=0,n=0;return e.forEachNode(s=>{s.isSelected()?t++:s.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 Nve(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function sB(e){var s;const t=e.isSelected()===!1,n=((s=e.childrenAfterFilter)==null?void 0:s.some(sB))??!1;return t||n}var Lve={moduleName:"SharedRowSelection",version:lt,beans:[_ve],apiFunctions:{setNodesSelected:Rve,selectAll:Dve,deselectAll:Tve,selectAllFiltered:xve,deselectAllFiltered:Ive,selectAllOnCurrentPage:Fve,deselectAllOnCurrentPage:Pve,getSelectedNodes:Ave,getSelectedRows:kve}},Vve={moduleName:"RowSelection",version:lt,rowModels:["clientSide","infinite","viewport"],beans:[Ove],dependsOn:[Lve]};function Bve(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function $ve(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function oB(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 Hve(e,t,n){var o,i;const s=Gpe(e);if(s){if(((o=e.rowGroupColsSvc)==null?void 0:o.columns.length)===0){if(t<0){bn(238);return}s.setRowCount(t,n);return}bn(28);return}(i=py(e))==null||i.setRowCount(t,n)}function Gve(e){var t;return nd(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function Uve(e){return e.rowModel.isLastRowIndexKnown()}var Wve={moduleName:"CsrmSsrmSharedApi",version:lt,apiFunctions:{expandAll:Bve,collapseAll:$ve}},zve={moduleName:"RowModelSharedApi",version:lt,apiFunctions:{onRowHeightChanged:oB,resetRowHeights:iB}},jve={moduleName:"SsrmInfiniteSharedApi",version:lt,apiFunctions:{setRowCount:Hve,getCacheBlockState:Gve,isLastRowIndexKnown:Uve}},Kve=class extends Ge{constructor(){super(...arguments),this.beanName="alignedGridsSvc",this.consuming=!1}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";return typeof e=="function"&&(e=e()),e.map(s=>{var i;if(!s){bn(18),t||bn(20);return}if(this.isGridApi(s))return s;const o=s;return"current"in o?(i=o.current)==null?void 0:i.api:(o.api||bn(19),o.api)}).filter(s=>!!s&&!s.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){if(!this.consuming)for(const t of this.getAlignedGridApis())t.isDestroyed()||t.dispatchEvent(e)}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const n=[];return e.columns?e.columns.forEach(s=>{n.push(t(s))}):e.column&&n.push(t(e.column)),n}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":qe(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const n of e.columnGroups){let s=null;n&&(s=t.getProvidedColGroup(n.getGroupId())),!(n&&!s)&&t.setColumnGroupOpened(s,n.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let n=null;const s=this.beans,{colResize:o,ctrlsSvc:i,colModel:r}=s;if(t&&(n=r.getColDefCol(t.getColId())),t&&!n)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const d=e.api.getColumnState().map(h=>({colId:h.colId}));Vi(s,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));Vi(s,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));Vi(s,{state:d},"alignedGridChanged")}break;case"columnResized":{const u=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of u.flexColumns??[])d[h.getId()]&&delete d[h.getId()];o==null||o.setColumnWidths(Object.values(d),!1,u.finished,"alignedGridChanged");break}}const c=i.getGridBodyCtrl().isVerticalScrollShowing();for(const u of this.getAlignedGridApis())u.setGridOption("alwaysShowVerticalScroll",c)}},qve={moduleName:"AlignedGrids",version:lt,beans:[Kve],dependsOn:[UV]},Yve=class extends Ge{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},rB(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:n,groupStage:s}=this.beans;t==null||t.reset("rowDataChanged"),n!=null&&n.isManual()&&n.reset(),this.dispatchRowDataUpdateStarted(e),this.allNodesMap=Object.create(null),this.nextId=0;const o=rB(this.rootNode),i=new Array(e.length);o._leafs=i;let r=0;const a=s==null?void 0:s.getNestedDataGetter(),l=a?new Set:null,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(o,e),i.length=r}setImmutableRowData(e,t){var y;const{rootNode:n,gos:s}=this;this.dispatchRowDataUpdateStarted(t);const o=od(s),i=e.changedRowNodes,{adds:r,updates:a}=i,l=new Set,c=[],u=(y=this.beans.groupStage)==null?void 0:y.getNestedDataGetter();let d=s.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,R=S.length;E<R;++E){const T=S[E];if(!T)continue;let A=this.getRowNode(o({data:T,level:C}));if(A?(p(A,T),f||(f=!!u&&A.treeParent!==b)):(A=this.createRowNode(T,C),r.add(A)),!u||l.has(A)){l.add(A);continue}l.add(A),A.treeParent=b;const O=u(T);O&&g(A,O,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?eye(b,l,i):Qve(b,l)&&(i.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},n){const s=this.rootNode._leafs;for(let o=0,i=s.length;o<i;o++){const r=s[o];e.has(r)||(t.add(r),r.isSelected()&&n.push(r),this.deleteNode(r))}return t.size>0}updateRowData(e,t){var a;if(this.dispatchRowDataUpdateStarted(e.add),(a=this.beans.groupStage)!=null&&a.getNestedDataGetter())return qe(268),{remove:[],update:[],add:[]};const n=[],s=od(this.gos),o=this.executeRemove(s,e,t,n),i=this.executeUpdate(s,e,t,n),r=this.executeAdd(e,t);return this.deselect(n),{remove:o,update:i,add:r}}executeRemove(e,{remove:t},{adds:n,updates:s,removals:o},i){const r=this.rootNode._leafs,a=r==null?void 0:r.length,l=t==null?void 0:t.length;if(!l||!a)return[];let 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)):(s.delete(g),o.add(g)),f[c++]=g}return f.length=c,c&&Jve(r,u,d,o,h),f}executeUpdate(e,{update:t},{adds:n,updates:s},o){const i=t==null?void 0:t.length;if(!i)return[];const r=new Array(i);let a=0;for(let l=0;l<i;l++){const c=t[l],u=this.lookupNode(e,c);u&&(u.updateData(c),!u.selectable&&u.isSelected()&&o.push(u),r[a++]=u,n.has(u)||s.add(u))}return r.length=a,r}executeAdd(e,t){var n;const s=(n=this.rootNode)._leafs??(n._leafs=[]),o=s.length,i=e.add,r=i==null?void 0:i.length;if(!r)return[];const a=o+r;let l=this.sanitizeAddIndex(s,e.addIndex);if(l<o){for(let d=o-1,h=a-1;d>=l;--d){const f=s[d];f.sourceRowIndex=h,s[h--]=f}t.reordered=!0}s.length=a;const 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,s[l]=h,c[d]=h,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}deselect(e){var s;const t="rowDataChanged",n=this.beans.selectionSvc;e.length&&(n==null||n.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t})),(s=n==null?void 0:n.updateGroupsFromChildrenSelections)==null||s.call(n,t),e.length&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t,selectedNodes:(n==null?void 0:n.getSelectedNodes())??null,serverSideState:null})}createRowNode(e,t){const n=new ol(this.beans);n.parent=this.rootNode,n.level=t,n.group=!1,n.expanded=!1,n.setDataAndId(e,String(this.nextId++));const s=n.id,o=this.allNodesMap;return o[s]&&qe(2,{nodeId:s}),o[s]=n,n}deleteNode(e){var o;e.clearRowTopAndRowIndex();const t=e.id,n=this.allNodesMap;n[t]===e&&delete n[t];const s=e.pinnedSibling;s&&((o=this.beans.pinnedRowModel)==null||o.pinRow(s,null))}lookupNode(e,t){if(!e)return Xve(this.rootNode._leafs,t);const n=e({data:t,level:0}),s=this.allNodesMap[n];return s||(bn(4,{id:n}),null)}sanitizeAddIndex(e,t){const n=e.length;if(typeof t!="number"||t<0||t>=n||Number.isNaN(t))return n;t=Math.ceil(t);const s=this.gos;return t>0&&s.get("treeData")&&s.get("getDataPath")&&(t=Zve(e,t)),t}},Zve=(e,t)=>{for(let n=0,s=e.length;n<s;n++){const o=e[n];if((o==null?void 0:o.rowIndex)==t-1)return n+1}return t},rB=e=>{var r;e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",((r=e._leafs)==null?void 0:r.length)!==0&&(e._leafs=[]);const t=[],n=[],s=[],o=[];e.childrenAfterGroup=t,e.childrenAfterSort=n,e.childrenAfterAggFilter=s,e.childrenAfterFilter=o;const i=e.sibling;return i&&(i.childrenAfterGroup=t,i.childrenAfterSort=n,i.childrenAfterAggFilter=s,i.childrenAfterFilter=o,i.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},Xve=(e,t)=>{if(e)for(let n=0,s=e.length;n<s;n++){const o=e[n];if(o.data===t)return o}return bn(5,{data:t}),null},Jve=(e,t,n,s,o)=>{t=Math.max(0,t);for(let i=t,r=e.length;i<r;++i){const a=e[i];i<=n&&(s.has(a)||o!=null&&o.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},Qve=(e,t)=>{const n=t.size;e.length=n;let s=0,o=!1,i=!1;for(const r of t){const a=r.sourceRowIndex;a===s?i||(i=o):(a>=0?i=!0:o=!0,r.sourceRowIndex=s,e[s]=r),++s}return i},eye=(e,t,{removals:n,adds:s})=>{const o=e.length;e.length=t.size;let i=0;for(let r=0;r<o;++r){const a=e[r];n.has(a)||(i!==r&&(a.sourceRowIndex=i,e[i]=a),++i)}for(const r of s)r.sourceRowIndex<0&&(r.sourceRowIndex=i,e[i++]=r);e.length=i},aB=e=>{const t=e.childrenAfterSort,n=e.sibling;if(n&&(n.childrenAfterSort=t),!!t)for(let s=0,o=t.length-1;s<=o;s++){const i=t[s],r=s===0,a=s===o;i.firstChild!==r&&(i.firstChild=r,i.dispatchRowEvent("firstChildChanged")),i.lastChild!==a&&(i.lastChild=a,i.dispatchRowEvent("lastChildChanged")),i.childIndex!==s&&(i.childIndex=s,i.dispatchRowEvent("childIndexChanged"))}},tye=class extends Ge{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e){const t=this.beans.sortSvc.getSortOptions(),n=t.length>0&&!!e.changedRowNodes&&this.gos.get("deltaSort");this.sort(t,n,e.changedRowNodes,e.changedPath)}sort(e,t,n,s){const{gos:o,colModel:i,rowGroupColsSvc:r,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,u=o.get("groupMaintainOrder"),d=i.getCols().some(b=>b.isRowGroupActive()),h=r==null?void 0:r.columns,f=i.isPivotMode(),p=o.getCallback("postSortRows");let g=!1,v;const y=b=>{var R,T;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 O=b.level+1;O<h.length&&(A=h[O].getSort()===null)}A||(E=oye(b))}else!e.length||S||(t&&n?E=nye(a,b,n,s,e):E=a.doFullSort(b.childrenAfterAggFilter,e));if(E||(E=((R=b.childrenAfterAggFilter)==null?void 0:R.slice(0))??[]),g||(g=((T=b.childrenAfterSort)==null?void 0:T[0])!==E[0]),b.childrenAfterSort=E,aB(b),p){const A={nodes:b.childrenAfterSort};p(A)}};if(s==null||s.forEachChangedNodeDepthFirst(y),g&&o.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(wr(this.gos)){for(let n=0;n<t;++n){const s=e[n].column;if(s.isPrimary()&&s.isRowGroupActive())return!0}return!1}for(let n=0;n<t;++n)if(e[n].column.getColDef().showRowGroup)return!0;return!1}},nye=(e,t,n,s,o)=>{const i=t.childrenAfterAggFilter,r=t.childrenAfterSort;if(!r)return e.doFullSort(i,o);const a=new Set,l=[],{updates:c,adds:u}=n;for(let h=0,f=i.length;h<f;++h){const p=i[h];c.has(p)||u.has(p)||s&&!s.canSkip(p)?l.push({currentPos:l.length,rowNode:p}):a.add(p)}const d=r.filter(h=>a.has(h)).map((h,f)=>({currentPos:f,rowNode:h}));return l.sort((h,f)=>e.compareRowNodes(o,h,f)),sye(e,o,l,d)},sye=(e,t,n,s)=>{let o=0,i=0;const r=n.length,a=s.length,l=new Array(r+a);let c=0;for(;o<r&&i<a;){const u=n[o],d=s[i];e.compareRowNodes(t,u,d)<0?(l[c++]=u.rowNode,++o):(l[c++]=d.rowNode,++i)}for(;o<r;)l[c++]=n[o++].rowNode;for(;i<a;)l[c++]=s[i++].rowNode;return l},oye=e=>{const t=e.childrenAfterSort,n=e.childrenAfterAggFilter,s=t==null?void 0:t.length,o=n==null?void 0:n.length;if(!s||!o)return null;const i=new Array(o),r=new Set;for(let l=0;l<o;++l)r.add(n[l]);let a=0;for(let l=0;l<s;++l){const c=t[l];r.delete(c)&&(i[a++]=c)}if(r.size===0&&a===s)return t;for(const l of r)i[a++]=l;return i.length=a,i},iye=class extends Ge{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=Fs(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new ol(e);this.rootNode=t,this.nodeManager=this.createBean(new Yve(t));const n=this.refreshModel.bind(this,{step:"group"}),s=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:s,columnRowGroupChanged:n,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:n,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,n=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(s=>!!s);this.stages=n;for(let s=n.length-1;s>=0;--s)for(const o of n[s].refreshProps)t.set(o,s);this.addManagedPropertyListeners([...t.keys()],s=>{var i;const o=(i=s.changeSet)==null?void 0:i.properties;o&&this.onPropChange(o)}),this.addManagedPropertyListener("rowData",()=>this.onPropChange(["rowData"])),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.started=!0,this.rowNodesCountReady?this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0}):this.setInitialData()}setInitialData(){this.gos.get("rowData")&&this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,n,s){let o,i=!1;do{o=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(r,n),c=Math.min(a,s);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),o=!0,i=!0}}o&&this.setRowTopAndRowIndex()}while(o);return i}onPropChange(e){const{nodeManager:t,gos:n,beans:s}=this,o=s.groupStage;if(!t)return;const i=new Set(e),r=o==null?void 0:o.onPropChange(i);let a;i.has("rowData")?a=n.get("rowData"):r&&(a=o==null?void 0:o.extractData()),a&&!Array.isArray(a)&&(a=null,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 ry,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const c=l.rowDataUpdated?"group":this.getRefreshedStage(e);c&&(l.step=c,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:n}=this,s=t.length;let o=s;for(let i=0,r=e.length;i<r&&o;++i)o=Math.min(o,n.get(e[i])??o);return o<s?t[o].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:n}=this,s=t.environment.getDefaultRowHeight();let o=0;const i=Ps(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,s);l.setRowHeight(u.height,u.estimated)}l.setRowTop(o),l.setRowIndex(r),o+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const n=e.active,s=r=>{(r==null?void 0:r.id)!=null&&!t.has(r.id)&&r.clearRowTopAndRowIndex()},o=r=>{s(r),s(r.detailNode),s(r.sibling);const a=r.childrenAfterGroup;if(!r.hasChildren()||!a)return;const l=r.level==-1;if(!(n&&!l&&!r.expanded))for(let u=0,d=a.length;u<d;++u)o(a[u])},i=this.rootNode;i&&o(i)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){var o,i;const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const s=(o=e.sibling)!=null&&o.displayed?1:0;return(((i=e.childrenAfterSort)==null?void 0:i.length)??0)+s}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:n,rowsToDisplay:s}=this;if(!n||!s.length||s[0]===n)return e;const i=n.childrenAfterSort,r=l=>{let 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(s,e,i,r):r(e)}getTopLevelIndexFromDisplayedIndex(e){var a;const{rootNode:t,rowsToDisplay:n}=this;if(!t||!n.length||n[0]===t)return e;let o=this.getRow(e);o.footer&&(o=o.sibling);let i=o.parent;for(;i&&i!==t;)o=i,i=o.parent;const r=((a=t.childrenAfterSort)==null?void 0:a.indexOf(o))??-1;return r>=0?r:e}getRowBounds(e){const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:sd(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const s=t.length===0||t.some(o=>o.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:s,keepRenderedRows:!0,animate:sd(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:sd(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new np(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:n,rowDataUpdated:s}=e;return!(!t||n||!s||t.removals.size||t.adds.size)}refreshModel(e){var c,u;const{nodeManager:t,beans:n,eventSvc:s,started:o,refreshingModel:i}=this;if(!t)return;const r=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&r));if(o&&r&&s.dispatchEvent({type:"rowDataUpdated"}),!o||i||n.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=r);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,(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,s.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}isEmpty(){var e,t,n;return!((t=(e=this.rootNode)==null?void 0:e._leafs)!=null&&t.length)||!((n=this.beans.colModel)!=null&&n.ready)}isRowsToRender(){return this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let n=!1,s=!1;const o=[],i=Uf(this.gos);return this.forEachNodeAfterFilterAndSort(r=>{if(s)return;if(n&&(r===t||r===e)&&(s=!0,i&&r.group)){lB(o,r);return}if(!n){if(r!==t&&r!==e)return;n=!0,t===e&&(s=!0)}(!r.group||!i)&&o.push(r)}),o}getTopLevelNodes(){var e;return((e=this.rootNode)==null?void 0:e.childrenAfterGroup)??null}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,n=t.length;if(this.isEmpty()||n===0)return-1;let s=0,o=n-1;if(e<=0)return 0;if(t[o].rowTop<=e)return o;let r=-1,a=-1;for(;;){const l=Math.floor((s+o)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTop<e?s=l+1:c.rowTop>e&&(o=l-1),r===s&&a===o))return l;r=s,a=o}}isRowInPixel(e,t){const n=e.rowTop,s=n+e.rowHeight;return n<=t&&s>t}forEachLeafNode(e){var n;const t=(n=this.rootNode)==null?void 0:n._leafs;if(t)for(let s=0,o=t.length;s<o;++s)e(t[s],s)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let n=0,s=t.length;n<s;++n)e(t[n],n)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterSort)}forEachPivotNode(e,t,n){const{colModel:s,rowGroupColsSvc:o}=this.beans;if(!s.isPivotMode())return;if(!(o!=null&&o.columns.length)){e(this.rootNode,0);return}const i=n?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,r=>r.leafGroup?null:r[i])}depthFirstSearchRowNodes(e,t=!1,n=i=>i.childrenAfterGroup,s=this.rootNode,o=0){let i=o;if(!s)return i;const r=s===this.rootNode;if(r||e(s,i++),s.hasChildren()&&!s.footer){const a=n(s);if(a){const l=this.beans.footerSvc;i=(l==null?void 0:l.addTotalRows(i,s,e,t,r,"top"))??i;for(const c of a)i=this.depthFirstSearchRowNodes(e,t,n,c,i);return(l==null?void 0:l.addTotalRows(i,s,e,t,r,"bottom"))??i}}return i}doAggregate(e){var n;const t=this.rootNode;t&&((n=this.beans.aggStage)==null||n.execute({rowNode:t,changedPath:e}))}doFilterAggregates(e){const t=this.rootNode,n=this.beans.filterAggStage;if(n){n.execute({rowNode:t,changedPath:e});return}t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const n=this.beans.sortStage;if(n){n.execute({rowNode:this.rootNode,changedRowNodes:e,changedPath:t});return}t.forEachChangedNodeDepthFirst(s=>{s.childrenAfterSort=s.childrenAfterAggFilter.slice(0),aB(s)})}doGrouping(e){var o;const t=this.rootNode,n=this.beans.groupStage,s=n==null?void 0:n.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(s===void 0){const i=t._leafs;t.childrenAfterGroup=i,t.updateHasChildren();const r=t.sibling;r&&(r.childrenAfterGroup=i)}(s||e.rowDataUpdated)&&((o=this.beans.colFilter)==null||o.refreshModel()),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;if(t){t.execute({rowNode:this.rootNode,changedPath:e});return}e.forEachChangedNodeDepthFirst(n=>{n.childrenAfterFilter=n.childrenAfterGroup,T2(n)},!0)}doPivot(e){var t;(t=this.beans.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getRowNode(e){var s,o;const t=(s=this.nodeManager)==null?void 0:s.getRowNode(e);return typeof t=="object"?t:typeof e=="string"&&e.indexOf(lE)===0?(o=this.beans.groupStage)==null?void 0:o.getNode(e):void 0}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const n=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),n)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var a;const{nodeManager:e,beans:t,eventSvc:n,asyncTransactions:s}=this;if(!e)return;(a=t.valueCache)==null||a.onDataChanged();const o=[],i=[],r=new ry;for(const{rowDataTransaction:l,callback:c}of s??[]){this.rowNodesCountReady=!0;const u=e.updateRowData(l,r);o.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),o.length>0&&n.dispatchEvent({type:"asyncTransactionsFlushed",results:o}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){var o;const t=this.nodeManager;if(!t)return null;(o=this.beans.valueCache)==null||o.onDataChanged(),this.rowNodesCountReady=!0;const n=new ry,s=t.updateRowData(e,n);return this.commitTransactions(n),s}commitTransactions(e){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:e,changedPath:this.createChangePath(!0)})}doRowsToDisplay(){const{beans:e,rootNode:t}=this,n=e.flattenStage;if(n){this.rowsToDisplay=n.execute({rowNode:t});return}const s=this.rootNode.childrenAfterSort??[];for(const o of s)o.setUiLevel(0);this.rowsToDisplay=s}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){const e=this.rootNode;if(!e)return;const t=this.resetRowHeightsForAllRowNodes();e.setRowHeight(e.rowHeight,!0);const n=e.sibling;n==null||n.setRowHeight(n.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const n=t.detailNode;n==null||n.setRowHeight(n.rowHeight,!0);const s=t.sibling;s==null||s.setRowHeight(s.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){var t;e.rowHeightChanged&&!((t=this.beans.rowAutoHeight)!=null&&t.active)&&this.resetRowHeights()}onGridReady(){this.started||this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},lB=(e,t)=>{const n=t.childrenAfterGroup;if(n)for(let s=0,o=n.length;s<o;++s){const i=n[s];i.data&&e.push(i),i.group&&lB(e,i)}};function rye(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function aye(e,t){const n=cl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function lye(e){var t;return((t=cl(e))==null?void 0:t.isEmpty())??!0}function cye(e,t){var n;(n=cl(e))==null||n.forEachLeafNode(t)}function uye(e,t){var n;(n=cl(e))==null||n.forEachNodeAfterFilter(t)}function dye(e,t){var n;(n=cl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function hye(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=cl(e))==null?void 0:n.updateRowData(t)})}function fye(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var s;return(s=cl(e))==null?void 0:s.batchUpdateRowData(t,n)})}function pye(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=cl(e))==null?void 0:t.flushAsyncTransactions()})}function gye(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var cB={moduleName:"ClientSideRowModel",version:lt,rowModels:["clientSide"],beans:[iye,tye],dependsOn:[y2]},mye={moduleName:"ClientSideRowModelApi",version:lt,apiFunctions:{onGroupExpandedOrCollapsed:rye,refreshClientSideRowModel:aye,isRowDataEmpty:lye,forEachLeafNode:cye,forEachNodeAfterFilter:uye,forEachNodeAfterFilterAndSort:dye,applyTransaction:hye,applyTransactionAsync:fye,flushAsyncTransactions:pye,getBestCostNodeSelection:gye,resetRowHeights:iB,onRowHeightChanged:oB},dependsOn:[Wve,zve]},vye=class extends Ge{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel}serialize(e,t={}){const{allColumns:n,columnKeys:s,skipRowGroups:o,exportRowNumbers:i}=t,r=this.getColumnsToExport({allColumns:n,skipRowGroups:o,columnKeys:s,exportRowNumbers:i});return[this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,n,s){var p;const o=t.shouldRowBeSkipped||(()=>!1),r=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!r,l=this.colModel.isPivotMode()?s.leafGroup:!s.group,c=!!s.footer,u=s.allChildrenCount===1&&((p=s.childrenAfterGroup)==null?void 0:p.length)===1&&woe(this.gos,s);if(!l&&!c&&(t.skipRowGroups||u||a)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.stub||s.level===-1&&!l&&!c||o(It(this.gos,{node:s})))return;const f=e.onNewBodyRow(s);if(n.forEach((g,v)=>{f.onColumn(g,v,s)}),t.getCustomContentBelowRow){const g=t.getCustomContentBelowRow(It(this.gos,{node:s}));g&&e.addCustomContent(g)}}appendContent(e){return t=>{const n=e.appendContent;return n&&t.addCustomContent(n),t}}prependContent(e){return t=>{const n=e.prependContent;return n&&t.addCustomContent(n),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return n=>{if(!e.skipColumnGroupHeaders){const s=new tL,{colGroupSvc:o}=this.beans,i=o?o.createColumnGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(i,n,e.processGroupHeaderCallback)}return n}}exportHeaders(e,t){return n=>{if(!e.skipColumnHeaders){const s=n.onNewHeaderRow();t.forEach((o,i)=>{s.onColumn(o,i,void 0)})}return n}}processPinnedTopRows(e,t){return n=>{var o,i;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="top").sort((r,a)=>r.rowIndex-a.rowIndex).map(r=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedTopRow(r.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(i=this.pinnedRowModel)==null||i.forEachPinnedRow("top",s),n}}processRows(e,t){return n=>{var c;const s=this.rowModel,o=ns(this.gos),i=nd(this.gos),r=!o&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(u=>u.rowPinned==null).sort((u,d)=>u.rowIndex-d.rowIndex).map(u=>s.getRow(u.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())o?s.forEachPivotNode(a,!0,l==="filteredAndSorted"):i?s.forEachNodeAfterFilterAndSort(a,!0):s.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"?s.forEachNode(a):o||i?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return n}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:n}=this.beans;if(!t||!n)return;const s=t.getSortOptions(),o=(i,r)=>{var a,l;return i.rowIndex!=null&&r.rowIndex!=null?i.rowIndex-r.rowIndex:i.level===r.level?((a=i.parent)==null?void 0:a.id)===((l=r.parent)==null?void 0:l.id)?n.compareRowNodes(s,{rowNode:i,currentPos:i.rowIndex??-1},{rowNode:r,currentPos:r.rowIndex??-1}):o(i.parent,r.parent):i.level>r.level?o(i.parent,r):o(i,r.parent)};e.sort(o)}processPinnedBottomRows(e,t){return n=>{var o,i;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="bottom").sort((r,a)=>r.rowIndex-a.rowIndex).map(r=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedBottomRow(r.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(i=this.pinnedRowModel)==null||i.forEachPinnedRow("bottom",s),n}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:n=!1,exportRowNumbers:s=!1,columnKeys:o}=e,{colModel:i,gos:r,visibleCols:a}=this,l=i.isPivotMode(),c=h=>aa(h)?!1:!la(h)||s;if(o!=null&&o.length)return i.getColsForKeys(o).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?!O0(h):!0)),d}recursivelyAddHeaderGroups(e,t,n){const s=[];for(const o of e){const i=o;if(i.getChildren)for(const r of i.getChildren()??[])s.push(r)}e.length>0&&ss(e[0])&&this.doAddHeaderHeader(t,e,n),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,n)}doAddHeaderHeader(e,t,n){const s=e.onNewHeaderGroupingRow();let o=0;for(const i of t){const r=i;let a;n?a=n(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},[]);s.onColumn(r,a||"",o++,r.getLeafColumns().length-1,c)}}},yye={moduleName:"SharedExport",version:lt,beans:[vye]},uB=`\r
|
|
251
251
|
`,wye=class extends qpe{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,s)=>{s!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,s){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,n){t!=0&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(s.valueFormatted??s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(qe(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=uB),this.isFirstLine=!1}},Cye=class extends Kpe{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),s=new Blob(["\uFEFF",n],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(It(this.gos,{})):t.fileName;Ype(this.getFileName(o),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:s,valueSvc:o,gos:i}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new wye({colModel:t,colNames:n,valueSvc:o,gos:i,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:s})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function bye(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function Sye(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var Eye={moduleName:"CsvExport",version:lt,beans:[Cye],apiFunctions:{getDataAsCsv:bye,exportDataAsCsv:Sye},dependsOn:[yye]},_ye=class extends Ge{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:s,rowNodes:o}=this;for(let i=0;i<e;i++){const r=n+i,a=new ol(s);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),o.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:s}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:s}}}setDataAndId(e,t,n){ut(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Ln(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:s,filterModel:o},gos:i}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:s,filterModel:o,context:It(i,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((s,o)=>{this.startRow+o<n&&e(s,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((o,i)=>{const r=e.rowData?e.rowData[i]:void 0;!o.id&&o.alreadyRendered&&r&&(t[i]=new ol(n),t[i].setRowIndex(o.rowIndex),t[i].setRowTop(o.rowTop),t[i].setRowHeight(o.rowHeight),o.clearRowTopAndRowIndex()),this.setDataAndId(t[i],r,this.startRow+i)});const s=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,s)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},Rye=2,Dye=class extends Ge{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let s=this.blocks[n];if(!s){if(t)return;s=this.createBlock(n)}return s.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new _ye(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 s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,i=Rye-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=i,c=s?a>=o:!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:s}=e;return t.rowIndex>=n&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:s}=this.params,i=(e.id+1)*n+s;this.rowCount<i&&(this.rowCount=i)}}setRowCount(e,t){this.rowCount=e,ut(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,s)=>n.id-s.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let s=-1,o=!1;const i={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(o&&s+1!==l.id){r=!0;continue}s=l.id,l.forEachNode(c=>{const u=c===e||c===t;(o||u)&&n.push(c),u&&(o=!o)},i,this.rowCount)}return r||o?[]:n}},Tye=class extends Ge{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 ol(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=!xf(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;od(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:s,eventSvc:o,gos:i}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:s,initialRowCount:i.get("infiniteInitialRowCount"),maxBlocksInCache:i.get("maxBlocksInCache"),rowHeight:hc(e),overflowSize:i.get("cacheOverflowSize"),blockSize:i.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new Dye(this.cacheParams)),o.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function xye(e){var t;(t=py(e))==null||t.refreshCache()}function Iye(e){var t;(t=py(e))==null||t.purgeCache()}function Fye(e){var t;return(t=py(e))==null?void 0:t.getRowCount()}var Pye=class extends Ge{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=Coe(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Fs(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Li(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:s}=t.getBlockStateJson();e[n]=s}),e}printCacheStatus(){Ja(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},Aye={moduleName:"InfiniteRowModelCore",version:lt,rowModels:["infinite"],beans:[Tye,Pye]},kye={moduleName:"InfiniteRowModel",version:lt,apiFunctions:{refreshInfiniteCache:xye,purgeInfiniteCache:Iye,getInfiniteRowCount:Fye},dependsOn:[Aye,jve]},Oye="↑",Mye="↓",Nye={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},Lye=class extends yn{constructor(){super(Nye),this.eValue=ct,this.eDelta=ct,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),s=e.formatValue(n),o=ut(s)?s:n,i=t>=0,r=this.eDelta;i?r.textContent=Oye+o:r.textContent=Mye+o,r.classList.toggle("ag-value-change-delta-up",i),r.classList.toggle("ag-value-change-delta-down",!i)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Is(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:s}=e,{eValue:o,lastValue:i,beans:r}=this;if(n===i||(ut(s)?o.textContent=s:ut(n)?o.textContent=n:Is(o),(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&&o.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},Vye=".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}",Bye={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},$ye=class extends yn{constructor(){super(Bye),this.eCurrent=ct,this.refreshCount=0,this.registerCSS(Vye)}init(e){this.refresh(e,!0)}addSlideAnimation(){var o;this.refreshCount++;const e=this.refreshCount;(o=this.ePrevious)==null||o.remove();const{beans:t,eCurrent:n}=this,s=os({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=s,s.textContent=n.textContent,this.getGui().insertBefore(s,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var i;e===this.refreshCount&&((i=this.ePrevious)==null||i.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var o;let n=e.value;if(Ln(n)&&(n=""),n===this.lastValue||(o=this.beans.filterManager)!=null&&o.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const s=this.eCurrent;return ut(e.valueFormatted)?s.textContent=e.valueFormatted:ut(e.value)?s.textContent=n:Is(s),!0}},Hye=class extends Ge{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),s=this.beans.gos.get("cellFadeDuration")){const o=this.animations[t];o.delete(e);const i=Date.now(),r=i+n,a=i+n+s,l={phase:"flash",flashEndTime:r,fadeEndTime:a};o.set(e,l);const 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 s=this.animations[n],o=`ag-cell-${n}`,i=`${o}-animation`;for(const[r,a]of s){if(!r.isAlive()||!r.comp){s.delete(r);continue}const{phase:l,flashEndTime: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(o,!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(o,!1),f.toggleCss(i,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),s.delete(r);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=$ce(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 Gye(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const s of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(s,t)})}var Uye={moduleName:"HighlightChanges",version:lt,beans:[Hye],userComponents:{agAnimateShowChangeCellRenderer:Lye,agAnimateSlideCellRenderer:$ye},apiFunctions:{flashCells:Gye}};function Wye(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function zye(e,t,n){var s;return(s=e.stateSvc)==null?void 0:s.setState(t,n)}function dB(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=jye(e)),e.version=lt,e}function jye(e){return e.cellSelection=Kye(e,"rangeSelection"),e}function Kye(e,t){if(e&&typeof e=="object")return e[t]}var qye=class extends Ge{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Fs(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Fs(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=Fs(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=ns(e);const s=dB(e.get("initialState")??{}),o=s.partialColumnState;delete s.partialColumnState,this.cachedState=s;const i=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>i(()=>this.setupStateOnGridReady(s))),(s.columnOrder||s.columnVisibility||s.columnSizing||s.columnPinning||s.columnGroup)&&(n==null||n.hideColumns("columnState"));const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(r(),i(()=>{this.setupStateOnColumnsInitialised(s,!!o),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),i(()=>this.setupStateOnRowCountReady(s))},firstDataRendered:()=>{l==null||l(),i(()=>this.setupStateOnFirstDataRendered(s))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=dB(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const s="api",o=t?new Set(t):void 0;this.setGridReadyState(n,s,o),this.setColumnsInitialisedState(n,s,!!o,o),this.setRowCountState(n,s,o),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,s,o),this.stopSuppressEvents(s)})}setGridReadyState(e,t,n){var s,o;t==="api"&&!(n!=null&&n.has("sideBar"))&&((o=(s=this.beans.sideBar)==null?void 0:s.comp)==null||o.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,s){this.setColumnState(e,t,n,s),this.setColumnGroupState(e,t,s),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=s=>()=>this.updateColumnState([s]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:s,rowGroupExpansion:o,ssrmRowGroupExpansion:i,rowSelection:r,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",s)&&this.setFilterState(s),l("rowGroupExpansion",o)&&this.setRowGroupExpansionState(i,o,t),l("rowSelection",r)&&this.setRowSelectionState(r,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},s=()=>t("filter",this.getFilterState()),{gos:o,colFilter:i}=this.beans;this.addManagedEventListeners({filterChanged:s,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(o.get("groupDefaultExpanded")!==0||o.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&t("pagination",this.getPaginationState())}}),i&&this.addManagedListeners(i,{filterStateChanged:s})}setFirstDataRenderedState(e,t,n){const{scroll:s,cellSelection:o,focusedCell:i,columnOrder:r,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",i)&&this.setFocusedCellState(i),l("cellSelection",o)&&this.setCellSelectionState(o),l("scroll",s)&&this.setScrollState(s),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(r!=null&&r.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:s=>{if(s.finished){const o=this.getRangeSelectionState();t("rangeSelection",o),t("cellSelection",o)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return Wpe(Lv(e),e.colModel.isPivotMode())}setColumnState(e,t,n,s){const{sort:o,rowGroup:i,aggregation:r,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(D,x)=>{const P=!(s!=null&&s.has(D))&&!!(x||t==="api");return h||(h=P),P},p={},g=D=>{let x=p[D];return x||(x={colId:D},p[D]=x,x)},v={},y=f("sort",o);y&&(o==null||o.sortModel.forEach(({colId:D,sort:x},P)=>{const M=g(D);M.sort=x,M.sortIndex=P})),(y||!n)&&(v.sort=null,v.sortIndex=null);const b=f("rowGroup",i);b&&(i==null||i.groupColIds.forEach((D,x)=>{const P=g(D);P.rowGroup=!0,P.rowGroupIndex=x})),(b||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const S=f("aggregation",r);S&&(r==null||r.aggregationModel.forEach(({colId:D,aggFunc:x})=>{g(D).aggFunc=x})),(S||!n)&&(v.aggFunc=null);const C=f("pivot",a);C&&(a==null||a.pivotColIds.forEach((D,x)=>{const P=g(D);P.pivot=!0,P.pivotIndex=x}),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 R=f("columnVisibility",c);if(R)for(const D of(c==null?void 0:c.hiddenColIds)??[])g(D).hide=!0;(R||!n)&&(v.hide=null);const T=f("columnSizing",u);if(T)for(const{colId:D,flex:x,width:P}of(u==null?void 0:u.columnSizingModel)??[]){const M=g(D);M.flex=x??null,M.width=P}(T||!n)&&(v.flex=null);const A=d==null?void 0:d.orderedColIds,O=!!(A!=null&&A.length)&&!(s!=null&&s.has("columnOrder")),I=O?A.map(D=>g(D)):Object.values(p);(I.length||h)&&(this.columnStates=I,Vi(this.beans,{state:I,applyOrder:O,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const s=this.columnGroupStates;this.columnGroupStates=void 0;const o=this.beans,{pivotResultCols:i,colGroupSvc:r}=o;if(i!=null&&i.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)i.getPivotResultCol(l.colId)&&a.push(l);Vi(o,{state:a,applyOrder:e},t)}s&&(r==null||r.setColumnGroupState(s,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return zpe(t)}setColumnGroupState(e,t,n){var a;const s=this.beans.colGroupSvc;if(!s||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const o=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),r=s.getColumnGroupState().map(({groupId:l})=>{const c=o.has(l);return c&&o.delete(l),{groupId:l,open:c}});for(const l of o)r.push({groupId:l,open:!0});r.length&&(this.columnGroupStates=r),s.setColumnGroupState(r,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),s=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||s||n?{filterModel:t,columnFilterState:n,advancedFilterModel:s}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:s,advancedFilterModel:o}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||s!==void 0)&&(t==null||t.setFilterState(n??null,s??null,"columnFilter")),o!==void 0&&(t==null||t.setAdvFilterModel(o??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:s,type:o,startRow:i,endRow:r,columns:a,startColumn:l}=n;return{id:s,type:o,startRow:i,endRow:r,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:s,visibleCols:o}=this.beans;if(!ia(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=s.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=s.getCol(r.startColId);if(!l){const c=o.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:s,rowRenderer:o,animationFrameSvc:i,ctrlsSvc:r}=this.beans;s.wrapIncoming(()=>{var a;r.get("center").setCenterViewportScrollLeft(n),(a=r.getScrollFeature())==null||a.setVerticalScrollPosition(t),o.redraw({afterScroll:!0}),i==null||i.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:s,rowIndex:o,rowPinned:i}=e;t.setFocusedCell({column:n.getCol(s),rowIndex:o,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),s=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!s))return{page:n,pageSize:s}}setPaginationState(e,t){const{pagination:n,gos:s}=this.beans;if(!n)return;const{pageSize:o,page:i}=e??{page:0,pageSize:s.get("paginationPageSize")},r=t==="gridInitializing";o&&!s.get("paginationAutoPageSize")&&n.setPageSize(o,r?"initialState":"pageSizeSelector"),typeof i=="number"&&(r?n.setPage(i):n.goToPage(i))}getRowSelectionState(){var s;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((s=t==null?void 0:t.toggledNodes)!=null&&s.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const s=this.beans.expansionSvc;if(!s)return;const o=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};s.setExpansionState(o,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const s=this.cachedState;for(const o of Object.keys(t)){const i=t[o];xf(i,s[o])||(n=!0)}this.cachedState={...s,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),xf(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")}},Yye={moduleName:"GridState",version:lt,beans:[qye],apiFunctions:{getState:Wye,setState:zye}};function Zye(e){return e.rowModel.isLastRowIndexKnown()}function Xye(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Jye(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function Qye(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function ewe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function twe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function nwe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function swe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function owe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function iwe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var rwe=class extends Ge{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const s=Math.max(hc(t),1),o=Math.floor(e/s);t.pagination.setPageSize(o,"autoCalculated")};this.isBodyRendered?Fs(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},up="paginationPageSizeSelector",awe={tag:"span",cls:"ag-paging-page-size"},lwe=class extends yn{constructor(){super(awe),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(up,()=>{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(){Is(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(up)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const o=this.gos.exists("paginationPageSize"),i=this.gos.get(up)!==!0;qe(94,{pageSizeSet:o,pageSizesSet:i,pageSizeOptions:e,paginationPageSizeOption:t}),i||qe(95,{paginationPageSizeOption:t,paginationPageSizeSelector:up}),e.unshift("")}const s=String(n?"":t);this.selectPageSizeComp?(tl(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(s,!0)):this.createPageSizeSelectorComp(e,s),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),s=n("pageSizeSelectorLabel","Page Size:"),o=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new nE).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(o).setLabel(s).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(up);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,s)=>n-s)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},cwe={selector:"AG-PAGE-SIZE-SELECTOR",component:lwe},uwe=".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}",dwe=class extends SV{constructor(){super(),this.btFirst=ct,this.btPrevious=ct,this.btNext=ct,this.btLast=ct,this.lbRecordCount=ct,this.lbFirstRowOnPage=ct,this.lbLastRowOnPage=ct,this.lbCurrent=ct,this.lbTotal=ct,this.pageSizeComp=ct,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(uwe)}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(),[cwe]);const{btFirst:t,btPrevious:n,btNext:s,btLast:o}=this;this.activateTabIndex([t,n,s,o]),t.insertAdjacentElement("afterbegin",li(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",li(e?"next":"previous",this.beans)),s.insertAdjacentElement("afterbegin",li(e?"previous":"next",this.beans)),o.insertAdjacentElement("afterbegin",li(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):rle(this.beans,i),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:s=>{(s.key===Me.ENTER||s.key===Me.SPACE)&&(s.preventDefault(),n())}})}ile(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}):jpe(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),o=e===n-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Cse(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),s=e?n:null,o=this.pagination.getCurrentPage(),i=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=i*o+1,a=r+i-1,e&&a>s&&(a=s));const l=r+i-1,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?o+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,y;if(e)v=this.formatNumber(t),y=this.formatNumber(s);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,s,o){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} ${s} ${l} ${o}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},hwe={selector:"AG-PAGINATION",component:dwe},fwe=class extends Ge{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return hwe}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,s;if(!this.active)return;let t=e;this.paginateChildRows||(t=((s=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:s.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ut(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ut(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ut(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ut(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,s=t-1;this.totalPages=Math.floor(s/n)+1,this.adjustCurrentPageIfInvalid();const o=this.currentPage,i=n*o;let r=n*(o+1)-1;if(r>s&&(r=s),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(i),r===s)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(r+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,s=e-1;this.totalPages=Math.floor(s/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>s&&(this.bottomDisplayedRowIndex=s)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:s=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:s,keepRenderedRows:t})}},pwe={moduleName:"Pagination",version:lt,beans:[fwe,rwe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:Zye,paginationGetPageSize:Xye,paginationGetCurrentPage:Jye,paginationGetTotalPages:Qye,paginationGetRowCount:ewe,paginationGoToNextPage:twe,paginationGoToPreviousPage:nwe,paginationGoToFirstPage:swe,paginationGoToLastPage:owe,paginationGoToPage:iwe},dependsOn:[gy]};function gwe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function hB(e,t,n,s,o){t&&(s&&t.parent&&t.parent.level!==-1&&hB(e,t.parent,n,s,o),t.setExpanded(n,void 0,o))}function mwe(e,t){return e.rowModel.getRowNode(t)}function vwe(e,t,n,s){e.rowRenderer.addRenderedRowListener(t,n,s)}function ywe(e){return e.rowRenderer.getRenderedNodes()}function wwe(e,t,n){e.rowModel.forEachNode(t,n)}function Cwe(e){return e.rowRenderer.firstRenderedRow}function bwe(e){return e.rowRenderer.lastRenderedRow}function Swe(e,t){return e.rowModel.getRow(t)}function Ewe(e){return e.rowModel.getRowCount()}var _we={moduleName:"RowApi",version:lt,apiFunctions:{redrawRows:gwe,setRowNodeExpanded:hB,getRowNode:mwe,addRenderedRowListener:vwe,getRenderedNodes:ywe,forEachNode:wwe,getFirstDisplayedRowIndex:Cwe,getLastDisplayedRowIndex:bwe,getDisplayedRowAtIndex:Swe,getDisplayedRowCount:Ewe}},Rwe={moduleName:"ScrollApi",version:lt,apiFunctions:{getVerticalPixelRange:Vme,getHorizontalPixelRange:Bme,ensureColumnVisible:K2,ensureIndexVisible:q2,ensureNodeVisible:$me}};function Dwe(e,t,n){if(!t)return;const s=e.ctrlsSvc.getGridBodyCtrl().eGridBody,o=`aria-${t}`;n===null?s.removeAttribute(o):s.setAttribute(o,n)}function Twe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function xwe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function Iwe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function Fwe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function Pwe(e){return{rowHeight:hc(e),headerHeight:Xf(e)}}function Awe(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(qf(a))}if((i=t.columns)!=null&&i.length)return n;const s=[],o=QE(t.rowNodes);for(const r of e.rowRenderer.getAllRowCtrls()){if(o&&!e_(r.rowNode,o)||!r.isFullWidth())continue;const a=r.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&s.push(qf(c))}}return[...s,...n]}var kwe={moduleName:"RenderApi",version:lt,apiFunctions:{setGridAriaProperty:Dwe,refreshCells:Twe,refreshHeader:xwe,isAnimationFrameQueueEmpty:Iwe,flushAllAnimationFrames:Fwe,getSizesForCurrentTheme:Pwe,getCellRendererInstances:Awe}};function Owe(e,t){var n,s;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(s=e.colAutosize)==null||s.sizeColumnsToFitGridBody(t)}function fB({colAutosize:e,visibleCols:t},n,s){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:s,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function Mwe(e,t){var n;t&&typeof t=="object"?fB(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var Nwe=class extends Ge{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const i=e.get("rowData");s=i!=null&&i.length>0&&ns(e)}s&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(o))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(s=>{var c;const o=u=>ad(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return o(s);const i=pB(this.beans),r=u=>n.leftCols.some(d=>zf(d,u)),a=u=>n.rightCols.some(d=>zf(d,u)),l=e.colKeys.filter(u=>!aa(u)&&!la(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}),o(s)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:s,skipHeader:o,skipHeaderGroups:i,stopAtGroup:r,defaultMaxWidth:a,defaultMinWidth:l,columnLimits: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,...R})=>[E,R])),S=o??this.gos.get("skipHeaderOnAutoSize"),C=i??S;for(;y!==0;){y=0;const E=[];for(const R of s){if(!R||koe(R))continue;const T=f.getCol(R);if(!T||v.has(T))continue;const A=p.getPreferredWidthForColumn(T,S);if(A>0){const O=b[T.colId]??{};O.minWidth??(O.minWidth=l),O.maxWidth??(O.maxWidth=a);const I=Lwe(T,A,O);T.setActualWidth(I,u),v.add(T),y++}E.push(T)}E.length&&g.refresh(u)}C||this.autoSizeColumnGroupsByColumns(s,u,r),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:s,ctrlsSvc:o}=this.beans,i=new Set,r=s.getColsForKeys(e);for(const l of r){let 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 o.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),s=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",s);const o=new Sc(e);return o.addEventListener("doubleTap",s),()=>{e.removeEventListener("dblclick",s),o.destroy()}}addColumnGroupResize(e,t,n){const s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{const i=[],r=t.getDisplayedLeafColumns();for(const a of r)a.getColDef().suppressAutoSize||i.push(a.getColId());i.length>0&&this.autoSizeCols({colKeys:i,skipHeader:s,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",o),()=>e.removeEventListener("dblclick",o)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=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,s){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,s));return}const o={};for(const{key:v,...y}of(s==null?void 0:s.columnLimits)??[])o[typeof v=="string"?v:v.getColId()]=y;const i=this.beans.visibleCols.allCols;if(e<=0||!i.length)return;const r=ra(i);if(s!=null&&s.onlyScaleUp&&r>e||e===r&&i.every(y=>{if(y.colDef.suppressSizeToFit)return!0;const b=o==null?void 0:o[y.getId()],S=(b==null?void 0:b.minWidth)??(s==null?void 0:s.defaultMinWidth),C=(b==null?void 0:b.maxWidth)??(s==null?void 0:s.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=s==null?void 0:s.colKeys)==null?void 0:p.some(b=>zf(v,b)))??!0;v.getColDef().suppressSizeToFit||!y?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{Li(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const y=o==null?void 0:o[v.getId()],b=(y==null?void 0:y.minWidth)??(s==null?void 0:s.defaultMinWidth),S=(y==null?void 0:y.maxWidth)??(s==null?void 0:s.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-ra(c);if(v<=0)for(const y of l){const b=((g=o==null?void 0:o[y.getId()])==null?void 0:g.minWidth)??(s==null?void 0:s.defaultMinWidth)??y.minWidth;y.setActualWidth(b,t,!0)}else{const y=v/ra(l);let b=v;for(let S=l.length-1;S>=0;S--){const C=l[S],E=o==null?void 0:o[C.getId()],R=(E==null?void 0:E.minWidth)??(s==null?void 0:s.defaultMinWidth),T=(E==null?void 0:E.maxWidth)??(s==null?void 0:s.defaultMaxWidth),A=C.getMinWidth(),O=C.getMaxWidth(),I=typeof R=="number"&&R>A?R:A,D=typeof T=="number"&&T<O?T:O;let x=Math.round(C.getActualWidth()*y);x<I?(x=I,h(C),d=!1):x>D?(x=D,h(C),d=!1):S===0&&(x=b),C.setActualWidth(x,t,!0),b-=x}}}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 s=n.type;if(s==="fitGridWidth"){const{columnLimits:o,defaultMinWidth:i,defaultMaxWidth:r}=n,a=o==null?void 0:o.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:i,defaultMaxWidth:r,columnLimits:a})}else s==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(s)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var s;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(s=this.beans.colDelayRenderSvc)==null||s.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function Lwe(e,t,n={}){const s=n.minWidth??e.getMinWidth();t<s&&(t=s);const o=n.maxWidth??e.getMaxWidth();return t>o&&(t=o),t}function pB({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),o=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return kf(n.eGridBody)-o}var Vwe={moduleName:"ColumnAutoSize",version:lt,beans:[Nwe],apiFunctions:{sizeColumnsToFit:Owe,autoSizeColumns:fB,autoSizeAllColumns:Mwe},dependsOn:[BV]},Bwe=".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 $we(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function Hwe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function Gwe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function Uwe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function Wwe(e,t,n){var s;return(s=e.pinnedRowModel)==null?void 0:s.forEachPinnedRow(t,n)}var zwe={moduleName:"PinnedRow",version:lt,beans:[Gle],css:[Bwe],apiFunctions:{getPinnedTopRowCount:$we,getPinnedBottomRowCount:Hwe,getPinnedTopRow:Gwe,getPinnedBottomRow:Uwe,forEachPinnedRow:Wwe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},jwe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const s of this.spannedNodes)s!==this.lastNode&&(t+=s.rowHeight);return e-t}},Kwe=class extends Ge{constructor(e){super(),this.column=e}buildCache(e){var S;const{column:t,beans:{gos:n,pinnedRowModel:s,rowModel:o,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 R=i.getValue(t,C);if(f){const T=It(n,{valueA:v,nodeA:p,valueB:R,nodeB:C,column:t,colDef:a});if(!h(T)){y(C,R);return}}else if(d?!d(v,R):v!==R){y(C,R);return}if(!g){const T=l==null?void 0:l.get(p);(T==null?void 0:T.firstNode)===p?(T.reset(),g=T):g=new jwe(t,p),c.set(p,g)}g.addSpannedNode(C),c.set(C,g)};switch(e){case"center":(S=o.forEachDisplayedNode)==null||S.call(o,C=>{(!r||r.isRowInPage(C.rowIndex))&&b(C)}),this.centerValueNodeMap=c;break;case"top":s==null||s.forEachPinnedRow("top",b),this.topValueNodeMap=c;break;case"bottom":s==null||s.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}}},qwe=class extends Ge{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Fs(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Fs(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 Kwe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,s=e.column,o=e.rowIndex,i=this.spanningColumns.get(s);if(!i)return;let r;switch(e.rowPinned){case"top":r=t==null?void 0:t.getPinnedTopRow(o);break;case"bottom":r=t==null?void 0:t.getPinnedBottomRow(o);break;default:r=n.getRow(o)}if(r)return i.getCellSpan(r)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,s]of this.spanningColumns)if(s.isCellSpanning(e)){const o=s.getCellSpan(e);t(n,o)}}destroy(){super.destroy(),this.spanningColumns.clear()}},Ywe=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,s,o,i,r){this.eWrapper=n,super.setComp(e,t,n,s,o,i,r),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||vv(e,t.rowIndex)}setAriaRowSpan(){Rse(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(sy(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}},Zwe=class extends fy{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new Ywe(t,this,this.beans)}isCorrectCtrlForSpan(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},Xwe=class extends Ge{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),s=n.size,o=this.getAllRelevantRowControls(e),i=new Map;let r=!1;for(const l of o)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(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 Zwe(u.firstNode,this.beans,!1,!1,!1);i.set(u.firstNode,h)}));this.setCtrlsMap(e,i);const a=i.size===s;if(!(!r&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const s=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(s)return s.getAllCellCtrls().find(o=>o.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},Jwe={moduleName:"CellSpan",version:lt,beans:[qwe,Xwe]},Qwe=class extends Ge{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,n=e.colDef,s=n.cellClassRules,o=this.getCellClassParams(e,n);XE(this.beans.expressionSvc,s===this.cellClassRules?void 0:this.cellClassRules,s,o,i=>t.toggleCss(i,!0),i=>t.toggleCss(i,!1)),this.cellClassRules=s}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let s;if(typeof n=="function"){const o=this.getCellClassParams(e,t);s=n(o)}else s=n;s&&this.cellComp.setUserStyles(s)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,s=this.getCellClassParams(e,n);for(const i of this.staticClasses)t.toggleCss(i,!1);const o=this.beans.cellStyles.getStaticCellClasses(n,s);this.staticClasses=o;for(const i of o)t.toggleCss(i,!0)}getCellClassParams(e,t){const{value:n,rowNode:s}=this.cellCtrl;return It(this.beans.gos,{value:n,data:s.data,node:s,colDef:t,column:e,rowIndex:s.rowIndex})}},eCe=class extends Ge{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,s){XE(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,s),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let s;return typeof n=="function"?s=n(t):s=n,typeof s=="string"&&(s=[s]),s||[]}createCellCustomStyleFeature(e,t){return new Qwe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(o=>{n(o)})}},tCe={moduleName:"CellStyle",version:lt,beans:[eCe]},nCe={moduleName:"RowStyle",version:lt,beans:[Gfe]};function sCe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var oCe=class extends Ge{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:s,gos:o,element:i,columns:r}=this,a=s.colHover;if(n??!!o.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(i,{mouseover:a.setMouseOver.bind(a,r),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},iCe="ag-column-hover",rCe=class extends Ge{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const s=()=>{const o=this.isHovered(n);t.toggleCss("ag-column-hover",o)};e.addManagedEventListeners({columnHoverChanged:s}),s()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(iCe,n)}addHeaderFilterColumnHoverListener(e,t,n,s){this.createHoverFeature(e,[n],s);const o=()=>{const i=this.isHovered(n);t.toggleCss("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:o}),o()}createHoverFeature(e,t,n){e.createManagedBean(new oCe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},aCe={moduleName:"ColumnHover",version:lt,beans:[rCe],apiFunctions:{isColumnHovered:sCe}},lCe=class extends Ge{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var i;const n=((i=this.wrapSvc)==null?void 0:i.wrap(e,t))??t,s=!uy.has(e),o=s?this.asyncListeners:this.syncListeners;o.has(e)||o.set(e,new Set),o.get(e).add(n),this.eventSvc.addListener(e,n,s)}removeListener(e,t){var i,r;const n=((i=this.wrapSvc)==null?void 0:i.unwrap(e,t))??t,s=this.asyncListeners.get(e),o=!!(s!=null&&s.delete(n));o||(r=this.syncListeners.get(e))==null||r.delete(n),this.eventSvc.removeListener(e,n,o)}addGlobalListener(e){var i;const t=((i=this.wrapSvc)==null?void 0:i.wrapGlobal(e))??e,n=(r,a)=>{uy.has(r)&&t(r,a)},s=(r,a)=>{uy.has(r)||t(r,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:s});const o=this.eventSvc;o.addGlobalListener(n,!1),o.addGlobalListener(s,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:s}=this,o=(n==null?void 0:n.unwrapGlobal(e))??e;if(s.has(o)){const{syncListener:r,asyncListener:a}=s.get(o);t.removeGlobalListener(r,!1),t.removeGlobalListener(a,!0),s.delete(e)}else this.syncGlobalListeners.delete(o),t.removeGlobalListener(o,!1)}destroyEventListeners(e,t){e.forEach((n,s)=>{n.forEach(o=>this.eventSvc.removeListener(s,o,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:s})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(s,!0)}),e.clear()}};function cCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.addListener(t,n)}function uCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.removeListener(t,n)}function dCe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function hCe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var fCe={moduleName:"EventApi",version:lt,apiFunctions:{addEventListener:cCe,addGlobalListener:dCe,removeEventListener:uCe,removeGlobalListener:hCe},beans:[lCe]},pCe={moduleName:"Locale",version:lt,beans:[Upe]},gCe=class extends Ge{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Fs(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:s}=this.beans,o=e.autoHeightCols;let i=!1;const r=d=>{var p;const h=d.__autoHeights;let f=Qa(this.beans,d).height;for(const g of o){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=s==null?void 0:s.forEachPinnedRow)==null||a.call(s,"top",r),(l=s==null?void 0:s.forEachPinnedRow)==null||l.call(s,"bottom",r),(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 s=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,s!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:s,visibleCols:o}=this.beans;if(!n.colSpanActive)return!1;let i=[];switch(e.getPinned()){case"left":i=o.getLeftColsForRow(t);break;case"right":i=o.getRightColsForRow(t);break;case null:i=s.getColsWithinViewport(t);break}return!i.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const s=t.parentElement,{rowNode:o,column:i}=e,r=this.beans,a=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(s),g=d+h+f+p,y=t.offsetHeight+g;if(u<5){const S=Es(r),C=!(S!=null&&S.contains(t)),E=y==0;if(C||E){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(o,y,i)},l=()=>a(0);l();const c=Za(r,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(o,void 0,i)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(o=>o.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const s of t){const o=n.__autoHeights[s.getColId()];if(!o||n.rowHeight<o)return!1}}return!0}},mCe={moduleName:"RowAutoHeight",version:lt,beans:[gCe]},vCe={moduleName:"AllCommunity",version:lt,dependsOn:[cB,Eye,kye,age,vve,yve,wve,Cve,bve,Sve,Eve,mve,cme,ume,dme,lme,fme,pme,Yye,qve,pwe,UV,_we,Rwe,kwe,Vwe,nue,zwe,Vve,_pe,tCe,aCe,nCe,fCe,Tpe,Uye,W2,pCe,mCe,tue,mye,Jwe]};let gB=!1;gB||(coe.registerModules([vCe,cB]),gB=!0);class yCe{constructor(t,n){Jn(this,"gridApi",null);Jn(this,"container");Jn(this,"config");Jn(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:s,onRowSelected:o,...i}=this.config,r={...i,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{s&&s(a)},onRowSelected:a=>{o&&o(a)}};return this.gridApi=Bpe(this.container,r),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const s={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const s={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(s=>{var o;(o=this.gridApi)==null||o.removeEventListener(n,s)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const wCe=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"),CCe=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 s=e,o=n,i=V(null);qb(i,()=>{var v;const g=(v=r.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const r=V(null),a=Z(()=>({width:"100%",height:s.height||"500px"})),l=Z(()=>({...s,theme:wCe}));function c(){if(!i.value){console.warn("Grid container element not found");return}const g={...l.value,height:s.height};r.value=new yCe(i.value,g),r.value.init(),u()}function u(){var v;const g=((v=r.value)==null?void 0:v.getApi())??null;o("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(()=>s.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}),Qn(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),Zt(()=>{c()}),Qn(()=>{h()}),(g,v)=>(W(),ae("div",{ref_key:"gridContainerRef",ref:i,style:ln(a.value),class:ee(["ag-theme-quartz",["ag-table-container",s.isSorting?"is-sorting":""]])},null,6))}});function _d(e){return qM(e)}const bCe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:_d(sc),suppressMovable:!0},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:_d(sc)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:_d(sc)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:_d(sc)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:_d(sc),cellRendererParams:n=>{var s,o,i;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated.value,tooltip:((i=(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated)==null?void 0:i.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:_d(sc),cellRendererParams:n=>{var s,o,i;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.completedOn.value,tooltip:((i=(o=n==null?void 0:n.data)==null?void 0:o.completedOn)==null?void 0:i.tooltip)||void 0,readOnly:!0}}}].map(n=>Tf.fromType(n))],by={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},SCe={field:"blank",headerName:"",flex:1,editable:!1,sortable:!1,filter:!1,cellClass:"ag-cell-optimized",suppressMovable:!0,suppressNavigable:!0,suppressAutoSize:!1,suppressSizeToFit:!1},ECe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:by.WIDTH,minWidth:by.WIDTH,maxWidth:by.WIDTH,cellClass:"ag-checkbox-cell",headerClass:by.HEADER_CLASS,headerComponent:mv(qX),suppressMovable:!0}),_Ce={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},RCe=(e,t,n)=>{const{getCachedValue:s,setCachedValue:o}=wh({dbName:"item_table_column_configs",storeName:"column_configs"}),i=async()=>{const u=await s(t);if(u&&typeof u=="string")try{return JSON.parse(u)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},r=V([]),a=ECe(),l=async u=>{const d=await i(),h=new Map;d==null||d.forEach(x=>{x.width&&h.set(x.field,x.width)});const f=bCe(),p=Tf.fromType(_Ce),v=((u==null?void 0:u.map(x=>{var P;return{headerName:x.name,field:`metric_${x.id}`,editable:((P=x==null?void 0:x.auth_permission)==null?void 0:P.permission)==2,sortable:!0,filter:!1,flex:1,context:{...x},hide:!(x.is_primary||x.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:mv(sc),headerComponentParams:M=>({headerType:x.metric_type.code=="number"||x.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${x.id}`)}}))||[]).map(x=>Tf.fromType(x)),y=[a,...f,...v,SCe,p],b=y.filter(x=>x.pinned==="left"),S=y.filter(x=>x.pinned==="right"||x.field==="blank"),C=y.filter(x=>!x.pinned&&x.field!=="blank");if(!d||d.length===0){r.value=y;return}const E=new Map(d.map(x=>[x.field,x])),R=new Map(C.map(x=>[x.field,x])),T=[];for(const x of d)if(x.field&&R.has(x.field)){const P=R.get(x.field);T.push({...P,hide:x.hide,width:x.width}),R.delete(x.field)}const A=Array.from(R.values()),O=[...T,...A],I=b.map(x=>{const P=E.get(x.field);return P!=null&&P.width?{...x,width:P.width}:x}),D=S.map(x=>{const P=E.get(x.field);return P!=null&&P.width?{...x,width:P.width}:x});r.value=[...I,...O,...D]};Je(e,u=>l(u),{immediate:!0});const c=Ri((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&&o(t,JSON.stringify(v))},sr);return{columnDefs:r,checkboxColumn:a,saveColumnConfig:c}},DCe=()=>{const e=En.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},TCe=e=>{var x,P,M;const{showMessage:t,showErrorNetMessage:n}=lf(),s=bs(),o={domainApi:DCe(),wsCode:En.getInstance().getItem("ws.code"),entityId:e.value.entityId},i=(M=(P=(x=s==null?void 0:s.appContext)==null?void 0:x.config)==null?void 0:P.globalProperties)==null?void 0:M.apiConfig;if(!i||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const r=new Pk(i,o);r.on("call-api",B=>{B.success?t(B.apiCode,"success"):n(B)});const a=yo({}),l=V([]),c=V(!1),u=V(null),d=V(null),h=V(1),f=V(20);let p=Promise.resolve();const{setCachedUsers:g}=C7(),v=B=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:B}),y=50,b=async(B,Y,ne)=>{if(!B.length)return[];const te=k4(B,Y);return(await Promise.all(te.map(ne))).flat()},S=async B=>{try{return(await r.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:B})).data.map(ne=>[ne==null?void 0:ne.id,ne.permission])}catch(Y){return console.error("Failed to fetch item permissions chunk:",Y),[]}},C=async(B,Y)=>{try{const ne=await r.getMetricValues({workspaceId:e.value.workspaceId,item_ids:B,per_page:B.length*Y.length,metric_ids:Y}),te=ne.data.map(pe=>{const q=new Map(pe.item_metrics.map(N=>[N.metric_id,{value:N.value,auth_permission:N==null?void 0:N.auth_permission}])),k=Object.fromEntries(Y.map(N=>[N,q.get(N)??null]));return[pe==null?void 0:pe.id,k]}),z=new Set(ne.data.map(pe=>pe==null?void 0:pe.id));for(const pe of B)if(!z.has(pe)){const q=Object.fromEntries(Y.map(k=>[k,{value:null,auth_permission:void 0}]));te.push([pe,q])}return te}catch(ne){return console.error("Failed to fetch a chunk of metric values:",ne),B.map(z=>[z,Object.fromEntries(Y.map(pe=>[pe,void 0]))])}},E=async B=>{try{const Y=await r.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:B,per_page:B.length}),ne=Y.data.flatMap(te=>te.assignees);return g(ne),Y.data.map(te=>[te==null?void 0:te.id,te==null?void 0:te.assignees])}catch(Y){return console.error("Failed to fetch a chunk of assigned users:",Y),[]}},R=async B=>{if(!B.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const Y=await b(B,y,S);return Object.fromEntries(Y)}catch(Y){return console.error("Failed to fetch item permissions:",Y),{}}},T=async(B,Y)=>!B.length||!Y.length?{}:(p=p.then(async()=>{try{const z=[];let pe=0;for(let k=0;k<Y.length;k+=5){pe++;const N=Y.slice(k,k+5),Q=[];for(let xe=0;xe<N.length;xe++){const ge=N[xe],de=await b(B,y,X=>C(X,[ge]));Q.push(de),await new Promise(X=>setTimeout(X,500))}z.push(...Q);const ce=k+5>=Y.length}const q={};for(const k of z.flat()){const[N,Q]=k;q[N]||(q[N]={}),Object.assign(q[N],Q)}return q}catch(ne){return console.error("Failed to fetch metric values:",ne),{}}}),p),A=async B=>{if(!B.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const Y=await b(B,y,E);return Object.fromEntries(Y)}catch(Y){return console.error("Failed to fetch assigned users:",Y),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async B=>{const{cursor:Y,offset:ne,size:te,searchQuery:z}=B;let pe=[];c.value=!0,u.value=null;try{const q=await r.getAllItem_cursor({...B,cursor:Y||void 0,offset:ne||void 0,pageSize:te||f.value,...v(z),sortBy:B.sort_by});return l.value=q.data,d.value=q.meta,h.value=q.meta.current_page||0,pe=q.data.map(k=>k==null?void 0:k.id),q}catch(q){throw u.value=q,console.error("Failed to fetch items (cursor):",q),q}finally{const q=async()=>{try{const[k,N]=await Promise.all([A(pe),R(pe)]);e.value.updateItemData({assignees:k,permission:N},pe);const Q=await T(pe,e.value.metricIds);e.value.setMetricValues(Q,new Set(pe),e.value.metricIds)}catch(k){console.error("Post-fetch processing failed:",k)}};c.value=!1,setTimeout(q)}},getAssignableStatus:async B=>{try{return await r.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:B})}catch(Y){throw console.error("Failed to fetch assignable status:",Y),Y}},getMetricList:async B=>{try{return await r.getMetricList({workspaceId:e.value.workspaceId,entityId:B})}catch(Y){throw console.error("Failed to fetch metric list:",Y),Y}},getMetricValues:T,getAssignedUsers:A}};function xCe(e){return{updateRowData:(s,o)=>{if(!e.value)return;const i=[],r=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);o.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(i.push(u),s.assignees){const h=r7((s.assignees[c]||[]).map(_F));u.data.assignees=h,r.add("assignees")}s.permission&&(u.data.permissions=s.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:(s,o,i)=>{const r=e.value;if(!r)return;const a=new Map(Array.from(o).map(c=>[c,new Map(i.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(s).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=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 ICe(e,t,n,s,o){let i=!0;return{async getRows(r){try{s(!0),i&&(o(!0),i=!1);const a=Math.floor(r.startRow/t)+1,{rows:l,total: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),s(!1),o(!1)}catch(a){console.error("Datasource fetch error:",a),r.failCallback(),s(!1),o(!1)}}}}function FCe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:s,gridApi:o,fetcher:i}=e,r=V(!0),a=V(!0),l=V(!1),c=()=>{n.value=!n.value},u=v=>{if(r.value=!1,o.value=v,!v)return null;const{addEventListener:y,setGridOption:b}=v;if(!i)return console.error("Fetcher function is undefined"),null;const S=ICe(i,e.perPage,()=>s.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=o.value)==null||y.hideOverlay(),v!==void 0&&(s.value=v),(b=o.value)==null||b.deselectAll(),t.value=[],r.value=!0,!o.value||!i){console.error("Grid API or fetcher is not available"),r.value=!1;return}l.value=!0,a.value=!0,o.value.purgeInfiniteCache(),o.value.ensureIndexVisible(0,"top"),setTimeout(()=>{r.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=o.value)==null||v.deselectAll(),t.value=[]},f=Ri(v=>{d(v)},sr),p=()=>{o.value},g=V(!1);return{isLoading:r,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const PCe={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."]}}},ACe=e=>{var t;return(t=Object.entries(PCe.changelog).find(([n,s])=>n===e))==null?void 0:t[1].changes},kCe={key:1},OCe=St(it({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=V(null),o=e,i=()=>{s.value&&s.value.show()},r=V(""),a=V("idle"),l=V({file:null,format:null}),{apiServices:c}=es(!1,{}),u=V(!1),d=async()=>{u.value=!0;const T=o.workspaceId,A=o.entityId;if(!T||!A||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(T,A))throw new Error("No response from downloadTemplate API")}catch(O){console.error("Error downloading template:",O)}u.value=!1},h=n,f=()=>{h("import-success"),b()},p=async T=>{var I,D,x;const A=new FormData,O=((I=T.name.split(".").pop())==null?void 0:I.toString())||"";if(A.append("file",T),A.append("format",O),A.append("entity_id",o.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,A),g()}catch(P){throw console.error("Error uploading file:",P),v(((x=(D=P.response)==null?void 0:D.data)==null?void 0:x.message)||"An unknown error occurred during file upload."),P}},g=()=>{a.value="success"},v=T=>{r.value=T,a.value="error"},y=async()=>{!l.value||!l.value.file||await p(l.value.file)},b=()=>{var T;R(),(T=s.value)==null||T.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=V(null),R=()=>{var T;(T=E.value)==null||T.clear(),r.value="",l.value={file:null,format:null},a.value="idle"};return(T,A)=>(W(),Ke(U($k),{"popup-name":S.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:R},Yd({default:ye(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(W(),Ke(GM,{key:0,state:a.value,"error-message":r.value,overwrite:!0},null,8,["state","error-message"])):(W(),ae("div",kCe,[be("div",{class:ee(T.$style["step-section"])},[be("span",{class:ee(T.$style["step-title"])},"Step 1: Download current data",2),be("span",{class:ee(T.$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),be("br",null,null,-1),be("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),fe(U(gt),{class:ee(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:ye(()=>[fe(U(at),{src:"Download"})]),default:ye(()=>[A[2]||(A[2]=nt(" Download file ",-1))]),_:1},8,["class","disabled"])],2),be("div",{class:ee(T.$style["step-section"])},[be("span",{class:ee(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),fe(U(RO),{modelValue:l.value,"onUpdate:modelValue":A[0]||(A[0]=O=>l.value=O),ref_key:"filUploaderRef",ref:E},null,8,["modelValue"])],2),be("div",{class:ee(T.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[fe(UM)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:ye(()=>[fe(U(gt),{style:{flex:"1"},variant:"secondary",onClick:b},{default:ye(()=>[...A[3]||(A[3]=[nt(" Cancel ",-1)])]),_:1}),fe(U(gt),{disabled:C.value,style:{flex:"1"},variant:"primary",onClick:y},{default:ye(()=>[...A[4]||(A[4]=[nt(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ye(()=>[fe(U(gt),{style:{flex:"1"},variant:"primary",onClick:f},{default:ye(()=>[...A[5]||(A[5]=[nt(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:ye(()=>[fe(U(gt),{style:{flex:"1"},variant:"primary",onClick:R},{default:ye(()=>[...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"}}]]),MCe={style:{cursor:"help"}},NCe=St(it({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=So,s=Wb(),{setUserPermissions:o,setEntityPermissions:i}=s,{entityPermissions:r}=Xs(s),a=Yt,l=V(null),c={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},u=V(""),d=Z(()=>{var ze;const Oe=((ze=r.value)==null?void 0:ze.has_create_item_permission)==1||!1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!Oe},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!Oe,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!Oe,id:"overwrite_scenes_option"}]}),h=e;Tf.initialize({wrapVueCellRenderer:mv,wrapVueCellEditor:qM});const f=qh(),{switchInstanceFunc:p}=Xs(f);Zt(()=>{const Oe=bs();p.value=Oe==null?void 0:Oe.appContext.config.globalProperties.switchInstance;const ze=new BroadcastChannel("focusable_channel");Ct(()=>{setTimeout(()=>{ze.postMessage("Focusable elements updated")},7e3)})});const g=V(null),v=V([]),y=Vm(),{rowCount:b}=Xs(y),S=V(!1),C=V(""),E=V(),R=BA(),{metricList:T}=Xs(R),A=V(""),O=V(!1),I=V(new Set),D=V(new Map),{apiServices:x}=es(!1,h),{columnDefs:P,checkboxColumn:M,saveColumnConfig:B}=RCe(T,h.entityId,g),Y=V();Je(()=>P,()=>{var Oe;(Oe=Y.value)==null||Oe.updateColumnDefs(P.value)},{deep:!0});const ne=(Oe,ze)=>{B(Oe,ze)},{updateRowData:te,setMetricValues:z}=xCe(g),pe=Z(()=>({isSearching:C.value.length>0,isFiltering:!(Object.keys(ve.value||{}).length==1&&Object.keys(ve.value)[0]=="preflight_status")&&Object.keys(ve.value||{}).length>0})),q=Z(om),k=Z(()=>P.value.filter(Oe=>{var ze;return((ze=Oe.field)==null?void 0:ze.startsWith("metric_"))&&!Oe.hide}).map(Oe=>{var ze;return((ze=Oe.field)==null?void 0:ze.replace("metric_",""))||""}));Ki("timezone",q);const N=Z(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:k.value,updateItemData:te,setMetricValues:z})),{fetchItems:Q,getMetricList:ce,cusorMap:xe,getMetricValues:ge}=TCe(N),de=Z(()=>{if(!g.value)return!1;const Oe=g.value.getSelectedRows().length;return Oe>0&&Oe>=b.value.total}),X=Z(()=>{var Oe;return((Oe=l.value)==null?void 0:Oe.name)||"Items"}),De=(Oe,ze)=>{var en,Ht,As;b.value.total=Oe.meta.total??0,(en=Oe.meta.next)!=null&&en.cursor&&(xe[ze+1]=Oe.meta.next.cursor),A.value=Oe.meta["X-Tsr-signature"]||"",Oe.meta.total===0?(Ht=g.value)==null||Ht.showNoRowsOverlay():(As=g.value)==null||As.hideOverlay()},re=_O(),Ae=V(null),{sortingAPIConfiguration:H,isSortingRunning:oe}=Xs(re),ve=V({preflight_status:"1"}),Ne=Z(()=>({...ve.value,search:C.value}));Ki("filterParams",Ne);const Pe=V([]),K=async({page:Oe,pageSize:ze,filterText:en})=>{var Vo;(Vo=g.value)==null||Vo.hideOverlay();const Ht=xe[Oe],As=!Ht&&Oe>1?(Oe-1)*ze:void 0,ma=H.value;ma.length>0&&(oe.value=!0);try{const va={cursor:Ht,size:ze,searchQuery:en,offset:As,sort_by:ma,...ve.value},eo=await Q(va);if(!eo)return{rows:[],total:0};const dp=(jn=>{const Fr=jn.data.map(mo=>DF(mo,q.value));return Fr.forEach(mo=>{I.value.add(String(mo.id)),D.value.set(String(mo.id),{})}),Fr})(eo);return De(eo,Oe),{rows:dp,total:b.value.total}}catch(va){return console.error("Failed to fetch items:",va),{rows:[],total:0}}finally{oe.value=!1}},{isLoading:$,toggleSidebar:J,onGridReady:ie,handleUnSelect:ke,handleSelectAll:Xe,onSearch:me,firstLoad:ue}=FCe({selectRowData:V([]),isSidebarOpen:S,quickFilterText:C,gridApi:g,perPage:c.ROWS_PER_PAGE,fetcher:K}),Ee=V([]),et=()=>{var Oe;Ee.value=((Oe=g.value)==null?void 0:Oe.getSelectedRows())||[]},ft=yo({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:sn,noRowsOverlayComponent:mv(kQ),noRowsOverlayComponentParams:()=>pe.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Oe=>Oe.data.id,getRowClass:Oe=>{if(!Oe.data)return["row-empty"];const ze=["row-highlight"];return Oe.data.id||ze.push("row-inactive"),Oe.data.isDeleted&&ze.push("row-deleted"),Oe.data.disabled&&ze.push("row-deleted"),Oe.data.isArchived&&ze.push("row-archived"),Oe.data.isLocked&&ze.push("row-locked"),ze},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:x.value,sorting:oe.value},onCellKeyDown:Oe=>{var ze,en,Ht;if(Oe.data.isDeleted)return!1;if(((ze=Oe==null?void 0:Oe.event)==null?void 0:ze.key)==="Enter"){const{api:As,node:ma,column:Vo}=Oe,va=As.getCellRendererInstances({rowNodes:[ma],columns:[Vo]});if(va.length>0){const eo=va[0];eo&&typeof((en=eo.componsenExposed)==null?void 0:en.focus)=="function"&&((Ht=eo.componsenExposed)==null||Ht.focus())}}},isRowSelectable:Oe=>!Oe.group,suppressKeyboardEvent:Oe=>{var Ht;if((Ht=Oe.data)!=null&&Ht.isDeleted)return!0;const ze=Oe.event.key,en=Oe.editing;return en&&ze==="Tab"?!0:en&&ze==="Enter"?!1:ze==="Enter"?(Oe.event.preventDefault(),Oe.event.stopPropagation(),!0):ze==="ArrowUp"||ze==="ArrowDown"||ze==="ArrowLeft"||ze==="ArrowRight"||ze==="Tab"||ze==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Oe=>{const ze=Oe.api.getFirstDisplayedRowIndex(),en=Oe.api.getLastDisplayedRowIndex();ft.rowsDisplay.fromIndex=ze,ft.rowsDisplay.toIndex=en,ft.columnsDisplay=Oe.api.getAllDisplayedVirtualColumns().map(Ht=>Ht.getColId())},onViewportChanged:Oe=>{ft.columnsDisplay=Oe.api.getAllDisplayedVirtualColumns().map(ze=>ze.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Oe){if(Oe.data.isDeleted&&Oe.api.stopEditing(),Oe.colDef.field=="options"){const ze=Oe.api.getCellRendererInstances({rowNodes:[Oe.node],columns:[Oe.column]});ze.length>0&&ze[0].focusUi()}},tabToNextCell:Oe=>{let ze=Oe.nextCellPosition;if(ze&&ze.column.getColId()==="ag-Grid-SelectionColumn"){const en=Oe.api.getAllDisplayedColumns(),Ht=en.indexOf(ze.column),As=Oe.backwards?-1:1,ma=en[Ht+As];if(ma)return{rowIndex:ze.rowIndex,column:ma,rowPinned:ze.rowPinned}}return ze}}));function sn(){if(!g.value)return;let Oe=0;g.value.forEachNode(ze=>{ze.data&&Oe++}),b.value.loaded=Math.min(Oe,b.value.total)}Je(()=>H,()=>{g.value&&(A.value="",I.value.clear(),g.value.deselectAll(),Object.keys(xe).forEach(Oe=>delete xe[Number(Oe)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const Kt=V(),Gt=V(),on=()=>{var Oe;(Oe=Gt.value)==null||Oe.open()},Ve=()=>{var Oe;(Oe=Kt.value)==null||Oe.open()},Ue=async()=>{ue.value=!0,g.value&&(A.value="",I.value.clear(),Object.keys(xe).forEach(Oe=>delete xe[Number(Oe)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},Et=Z(()=>En.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),kt=V(),Ut=Z(()=>{var Oe;return(Oe=ACe(Et.value))==null?void 0:Oe.map(ze=>`<div>• ${ze}</div>`).join(`
|
|
252
|
-
`)});function tt(Oe){var ze;Oe==="new_scene"?(ze=kt.value)==null||ze.show():Oe==="import_scenes"?Ve():Oe==="overwrite_scenes"&&on()}const Rs=Oe=>{v.value=Oe.api.getSelectedRows().map(ze=>ze.id)},$i=Oe=>{const ze=ie(Oe);return ze&&(ze.addEventListener("modelUpdated",sn),ze.addEventListener("bodyScroll",()=>ze.stopEditing()),ze.addEventListener("selectionChanged",et),ze.addEventListener("columnMoved",Ht=>ne(Ht,!0)),ze.addEventListener("columnResized",Ht=>ne(Ht,!0)),ze.addEventListener("firstDataRendered",()=>{ue.value=!1}),!document.querySelector(".ag-body-viewport")),ze},Tr=()=>{var Oe;u.value=(((Oe=document.getElementById("item-table-layout-id"))==null?void 0:Oe.clientHeight)??0)-78+"px"};Zt(()=>{Ct(()=>{Tr()}),window.addEventListener("resize",Tr);function Oe(){requestAnimationFrame(Oe)}Oe()}),Qn(()=>{window.removeEventListener("resize",Tr)});const di=async({code:Oe,name:ze})=>{await me(Oe),setTimeout(()=>{var en;(en=E.value)==null||en.setValue(ze)},300)},ga=Oe=>{if(!g.value)return;const ze=g.value.getRowNode(Oe);ze?(g.value.ensureIndexVisible(Number(ze.rowIndex),"middle"),g.value.flashCells({rowNodes:[ze],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(b.value.total-1,"bottom")},dl=Oe=>Oe.metric_type.code==="number"?"number":"default",xr=async()=>{if(h.entityId)try{const Oe=await ce(h.entityId);T.value=Oe.data.map(ze=>({...ze,sortType:dl(ze)}))}catch(Oe){console.error("Failed to initialize metric list:",Oe),T.value=[]}},Ir=async()=>{if(x.value)try{const Oe=await x.value.getUserPermission(h.workspaceId);o(Oe)}catch(Oe){console.error("Failed to fetch user permissions:",Oe)}},hi=async()=>{if(x.value)try{const Oe=await x.value.getEntityDetail(h.workspaceId,h.entityId);i(Oe.permission),l.value=Oe}catch(Oe){console.error("Failed to fetch entity details:",Oe)}},Hi=rv(),{setUser:Rd}=Hi,An=async()=>{if(x.value)try{const Oe=await x.value.getMe();return Rd(Oe),Oe}catch(Oe){console.error("Failed to fetch user details:",Oe)}},fs=async()=>{var Oe;if(x.value)try{const ze=await x.value.getWorkspaces(h.workspaceId),en=(Oe=ze.data[0])==null?void 0:Oe.ws_user_role_id;return en&&Hi.setUserRoleId(en),ze}catch(ze){console.error("Failed to fetch workspace details:",ze)}};Je(()=>[h.entityId,h.workspaceId],async([Oe,ze])=>{!Oe||!ze||(An(),fs(),xr(),Ir(),hi())},{immediate:!0,deep:!0}),Je(k,(Oe,ze)=>{const en=Oe.filter(Ht=>!(ze!=null&&ze.includes(Ht)));en.length>0&&ge(Array.from(I.value),en).then(Ht=>{z(Ht,I.value,en)})},{immediate:!0,deep:!0}),Je(A,(Oe,ze)=>{O.value=!!(ze&&Oe&&ze!==Oe)}),t({refreshTable:Ue});const y_=Oe=>{ve.value=Oe,Ue()},Dd=Oe=>{Pe.value=Oe,Ue()},Td=Oe=>{P.value=Oe||[],ne({},!0)},xd=Z(()=>{var Ht;const Oe=En.getInstance().getItem("ws.terminology"),ze=Oe?JSON.parse(Oe):null;return`New ${((Ht=ze==null?void 0:ze.find(As=>As.code==="scene"))==null?void 0:Ht.name)||"Scene"}`});return(Oe,ze)=>{const en=wo("focusable");return W(),Ke(U(UX),{"is-sidebar-open":S.value,onCloseSidebar:U(J),onSidebarClear:U(J),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U(J)},{"header-left":ye(()=>{var Ht;return[((Ht=U(r))==null?void 0:Ht.has_create_item_permission)==1?(W(),Ke(U(cS),{key:0,variant:["primary"],options:d.value,onSelect:tt,onHandleClick:ze[1]||(ze[1]=As=>tt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ye(()=>[We(fe(U(gt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:ze[0]||(ze[0]=As=>tt("new_scene")),label:xd.value},null,8,["label"]),[[en,1]])]),_:1},8,["options"])):Ye("",!0),be("div",{class:ee(Oe.$style["beta-tag"])},"Beta",2),We((W(),ae("span",MCe,[nt(mt(Et.value),1)])),[[U(a),Ut.value||""]])]}),"header-actions":ye(()=>[fe(U(mee),{"onUpdate:assignees":Dd,onApplyFilter:y_,loading:U(ue),entityId:h.entityId},null,8,["loading","entityId"]),We(fe(U(Zb),{focusIndex:"4",modelValue:C.value,"onUpdate:modelValue":ze[2]||(ze[2]=Ht=>C.value=Ht),onSearch:U(me),class:ee(Oe.$style.itemSearchBox),onClear:ze[3]||(ze[3]=Ht=>U(me)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(ue),fullwidth:!0}]]),We((W(),Ke(U(OA),{status:U($)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":O.value},{default:ye(()=>[We((W(),Ke(U(gt),{variant:["secondary","icon"],disabled:U($),onClick:Ue},{default:ye(()=>[fe(U(at),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[en,5],[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(ue),fullwidth:!0}]]),We(fe(U(gQ),{"model-value":U(P),onChange:ze[4]||(ze[4]=Ht=>Td(Ht)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:Y,"checkbox-column":U(M),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(ue),fullwidth:!0}]])]),grid:ye(({availableHeight:Ht})=>[fe(U(CCe),Jt({id:"item_table_main",ref_key:"agGrid",ref:Ae},Ft.value,{height:Ht+"px",isSorting:U(oe),onOnGridReady:$i,onSelectionChanged:Rs}),null,16,["height","isSorting"])]),footer:ye(()=>[be("div",{class:ee(Oe.$style.tableFooter),id:"table_footer"},[be("span",null,[ze[5]||(ze[5]=nt(" Showing ",-1)),be("b",null,mt(U(b).loaded)+" of "+mt(U(b).total),1)])],2)]),"new-row":ye(()=>[fe(U(jQ),{ref_key:"createNewSceneRef",ref:kt,onSearchForCode:di,onFocusOnId:ga},null,512)]),"bulk-update-actions":ye(()=>[We(fe(U(MX),{selectRowData:Ee.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(ke),onSelectAll:U(Xe),"take-name":X.value,"selected-all":de.value,"total-rows":U(b).total,"visible-rows":U(b).loaded,onUpdated:et,loading:U($)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"]),[[Ei,!S.value&&v.value.length>0]])]),snackbar:ye(()=>[fe(U(RJ))]),popup:ye(()=>[fe(Qne,{ref_key:"popupCreateSceneRef",ref:Kt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ue},null,8,["workspace-id","entity-id"]),fe(OCe,{ref_key:"popupOverwriteScenesRef",ref:Gt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ue},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.
|
|
252
|
+
`)});function tt(Oe){var ze;Oe==="new_scene"?(ze=kt.value)==null||ze.show():Oe==="import_scenes"?Ve():Oe==="overwrite_scenes"&&on()}const Rs=Oe=>{v.value=Oe.api.getSelectedRows().map(ze=>ze.id)},$i=Oe=>{const ze=ie(Oe);return ze&&(ze.addEventListener("modelUpdated",sn),ze.addEventListener("bodyScroll",()=>ze.stopEditing()),ze.addEventListener("selectionChanged",et),ze.addEventListener("columnMoved",Ht=>ne(Ht,!0)),ze.addEventListener("columnResized",Ht=>ne(Ht,!0)),ze.addEventListener("firstDataRendered",()=>{ue.value=!1}),!document.querySelector(".ag-body-viewport")),ze},Tr=()=>{var Oe;u.value=(((Oe=document.getElementById("item-table-layout-id"))==null?void 0:Oe.clientHeight)??0)-78+"px"};Zt(()=>{Ct(()=>{Tr()}),window.addEventListener("resize",Tr);function Oe(){requestAnimationFrame(Oe)}Oe()}),Qn(()=>{window.removeEventListener("resize",Tr)});const di=async({code:Oe,name:ze})=>{await me(Oe),setTimeout(()=>{var en;(en=E.value)==null||en.setValue(ze)},300)},ga=Oe=>{if(!g.value)return;const ze=g.value.getRowNode(Oe);ze?(g.value.ensureIndexVisible(Number(ze.rowIndex),"middle"),g.value.flashCells({rowNodes:[ze],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(b.value.total-1,"bottom")},dl=Oe=>Oe.metric_type.code==="number"?"number":"default",xr=async()=>{if(h.entityId)try{const Oe=await ce(h.entityId);T.value=Oe.data.map(ze=>({...ze,sortType:dl(ze)}))}catch(Oe){console.error("Failed to initialize metric list:",Oe),T.value=[]}},Ir=async()=>{if(x.value)try{const Oe=await x.value.getUserPermission(h.workspaceId);o(Oe)}catch(Oe){console.error("Failed to fetch user permissions:",Oe)}},hi=async()=>{if(x.value)try{const Oe=await x.value.getEntityDetail(h.workspaceId,h.entityId);i(Oe.permission),l.value=Oe}catch(Oe){console.error("Failed to fetch entity details:",Oe)}},Hi=rv(),{setUser:Rd}=Hi,An=async()=>{if(x.value)try{const Oe=await x.value.getMe();return Rd(Oe),Oe}catch(Oe){console.error("Failed to fetch user details:",Oe)}},fs=async()=>{var Oe;if(x.value)try{const ze=await x.value.getWorkspaces(h.workspaceId),en=(Oe=ze.data[0])==null?void 0:Oe.ws_user_role_id;return en&&Hi.setUserRoleId(en),ze}catch(ze){console.error("Failed to fetch workspace details:",ze)}};Je(()=>[h.entityId,h.workspaceId],async([Oe,ze])=>{!Oe||!ze||(An(),fs(),xr(),Ir(),hi())},{immediate:!0,deep:!0}),Je(k,(Oe,ze)=>{const en=Oe.filter(Ht=>!(ze!=null&&ze.includes(Ht)));en.length>0&&ge(Array.from(I.value),en).then(Ht=>{z(Ht,I.value,en)})},{immediate:!0,deep:!0}),Je(A,(Oe,ze)=>{O.value=!!(ze&&Oe&&ze!==Oe)}),t({refreshTable:Ue});const y_=Oe=>{ve.value=Oe,Ue()},Dd=Oe=>{Pe.value=Oe,Ue()},Td=Oe=>{P.value=Oe||[],ne({},!0)},xd=Z(()=>{var Ht;const Oe=En.getInstance().getItem("ws.terminology"),ze=Oe?JSON.parse(Oe):null;return`New ${((Ht=ze==null?void 0:ze.find(As=>As.code==="scene"))==null?void 0:Ht.name)||"Scene"}`});return(Oe,ze)=>{const en=wo("focusable");return W(),Ke(U(UX),{"is-sidebar-open":S.value,onCloseSidebar:U(J),onSidebarClear:U(J),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U(J)},{"header-left":ye(()=>{var Ht;return[((Ht=U(r))==null?void 0:Ht.has_create_item_permission)==1?(W(),Ke(U(cS),{key:0,variant:["primary"],options:d.value,onSelect:tt,onHandleClick:ze[1]||(ze[1]=As=>tt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ye(()=>[We(fe(U(gt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:ze[0]||(ze[0]=As=>tt("new_scene")),label:xd.value},null,8,["label"]),[[en,1]])]),_:1},8,["options"])):Ye("",!0),be("div",{class:ee(Oe.$style["beta-tag"])},"Beta",2),We((W(),ae("span",MCe,[nt(mt(Et.value),1)])),[[U(a),Ut.value||""]])]}),"header-actions":ye(()=>[fe(U(mee),{"onUpdate:assignees":Dd,onApplyFilter:y_,loading:U(ue),entityId:h.entityId},null,8,["loading","entityId"]),We(fe(U(Zb),{focusIndex:"4",modelValue:C.value,"onUpdate:modelValue":ze[2]||(ze[2]=Ht=>C.value=Ht),onSearch:U(me),class:ee(Oe.$style.itemSearchBox),onClear:ze[3]||(ze[3]=Ht=>U(me)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(ue),fullwidth:!0}]]),We((W(),Ke(U(OA),{status:U($)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":O.value},{default:ye(()=>[We((W(),Ke(U(gt),{variant:["secondary","icon"],disabled:U($),onClick:Ue},{default:ye(()=>[fe(U(at),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[en,5],[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(ue),fullwidth:!0}]]),We(fe(U(gQ),{"model-value":U(P),onChange:ze[4]||(ze[4]=Ht=>Td(Ht)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:Y,"checkbox-column":U(M),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(ue),fullwidth:!0}]])]),grid:ye(({availableHeight:Ht})=>[fe(U(CCe),Jt({id:"item_table_main",ref_key:"agGrid",ref:Ae},Ft.value,{height:Ht+"px",isSorting:U(oe),onOnGridReady:$i,onSelectionChanged:Rs}),null,16,["height","isSorting"])]),footer:ye(()=>[be("div",{class:ee(Oe.$style.tableFooter),id:"table_footer"},[be("span",null,[ze[5]||(ze[5]=nt(" Showing ",-1)),be("b",null,mt(U(b).loaded)+" of "+mt(U(b).total),1)])],2)]),"new-row":ye(()=>[fe(U(jQ),{ref_key:"createNewSceneRef",ref:kt,onSearchForCode:di,onFocusOnId:ga},null,512)]),"bulk-update-actions":ye(()=>[We(fe(U(MX),{selectRowData:Ee.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(ke),onSelectAll:U(Xe),"take-name":X.value,"selected-all":de.value,"total-rows":U(b).total,"visible-rows":U(b).loaded,onUpdated:et,loading:U($)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"]),[[Ei,!S.value&&v.value.length>0]])]),snackbar:ye(()=>[fe(U(RJ))]),popup:ye(()=>[fe(Qne,{ref_key:"popupCreateSceneRef",ref:Kt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ue},null,8,["workspace-id","entity-id"]),fe(OCe,{ref_key:"popupOverwriteScenesRef",ref:Gt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ue},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.89",LCe={key:0},VCe=St(it({__name:"app",setup(e){const t=Z(()=>n.id.length===0||n.workspaceId.length===0),n=yo({id:"",workspaceId:"",apiConfig:{}}),s=lf(),{showMessage:o,showErrorNetMessage:i}=s,r=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):r.includes(h.apiCode)||i(h)},l=V(null),c=()=>{const h=En.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Yp(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",mB);try{if(l.value=bs(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||En.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:En.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new Pk(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),Qn(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=Z(()=>n.id),d=Z(()=>n.workspaceId);return Ki("workspaceId",d),Ki("entityId",u),(h,f)=>(W(),ae("div",{class:ee(h.$style.dashboardPluginWrapper)},[t.value?(W(),ae("span",LCe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(W(),Ke(U(NCe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ye("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),v_=async(e={},t={})=>{const n=C1(VCe),s=zq();n.use(s);const o=["apiConfig","workspaceId","id"],i={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,i[a]=l,o.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=i,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,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",Gr);const r=await Zne();return n.use(r),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=v_),kn.default=v_,kn.initDashboard=v_,Object.defineProperties(kn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|