@arbocollab/arbo-plugin-item-table 0.1.179 → 0.1.180

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.
@@ -143,7 +143,7 @@ Only state can be modified.`);i[0]="$state",Vu=!1,o.set(r,i,o.state.value),Vu=!0
143
143
  state: () => new MyClass()
144
144
  Found in store "${I.$id}".`),p&&r&&n.hydrate&&n.hydrate(I.$state,p),c=!0,u=!0,I}/*! #__NO_SIDE_EFFECTS__ */function rc(e,t,n){let o;const s=typeof t=="function";o=s?n:t;function r(i,a){const l=Kw();if(i=(J.env.NODE_ENV==="test"&&nc&&nc._testing?null:i)||(l?yn(Um,null):null),i&&gf(i),J.env.NODE_ENV!=="production"&&!nc)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
145
145
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
146
- This will fail in production.`);i=nc,i._s.has(e)||(s?mS(e,t,o,i):gA(e,o,i),J.env.NODE_ENV!=="production"&&(r._pinia=i));const c=i._s.get(e);if(J.env.NODE_ENV!=="production"&&a){const u="__hot:"+e,d=s?mS(u,t,o,i,!0):gA(u,sr({},o),i,!0);a._hotUpdate(d),delete i.state.value[u],i._s.delete(u)}if(J.env.NODE_ENV!=="production"&&ea){const u=oo();if(u&&u.proxy&&!a){const d=u.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[e]=c}}return c}return r.$id=e,r}function ns(e){const t=Lt(e),n={};for(const o in t){const s=t[o];s.effect?n[o]=q({get:()=>e[o],set(r){e[o]=r}}):(mn(s)||zs(s))&&(n[o]=Yr(e,o))}return n}const vS=rc("permissionStore",()=>{const e=V([]),t=V(),n=V({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:i=>{e.value=i},setEntityPermissions:i=>{t.value=i},setItemPermission:(i,a)=>{n.value[i]=a}}}),mZ="woohoo_getWoohooUserInterface_read",yS="media_getReviewUserInterface_read",vZ="update_getUpdateUserInterface_read",mA="Unarchive parent folder first to continue",yZ=(e,t,n,o,s,r)=>{const i=vS(),{userPermissions:a}=ns(i),l=q(()=>{const T=un.getInstance().getItem("BASE_URL"),P=un.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:M,entity_id:D,scene_id:F}=e.value;return{baseDomain:T||"",ws_code:M||"",entity_id:D||"",scene_id:F||"",reviewDomain:P||"",take_id:D||"",woohoo_id:D||"",parent_id:D||""}}),c=q(()=>{var P;const T=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:a.value.includes(yS),canCopyLink:!0,canRename:(T==null?void 0:T.has_edit_permission)??!1,canOpenTakeInReview:a.value.includes(yS),canOpenTakeInUpdate:a.value.includes(vZ),canOpenTakeInWoohoo:a.value.includes(mZ),canDeleteRendition:((P=T==null?void 0:T.media)==null?void 0:P.has_delete_rendition_permission)??!1,canDeleteThumbnail:(T==null?void 0:T.has_edit_thumbnail_permission)??!1,canArchiveScene:T==null?void 0:T.has_archive_permission,canUnarchiveScene:T==null?void 0:T.has_archive_permission,canDeleteScene:(T==null?void 0:T.has_delete_permission)??!1,canEditDescription:(T==null?void 0:T.has_edit_permission)??!1}}),u=q(()=>({project:es({type:"project",config:l.value}).url,take_review:es({type:"review_take",config:l.value}).url,review:es({type:"review_scene",config:l.value}).url,review_scene:es({type:"review_scene",config:l.value}).url,woohoo:es({type:"woohoo",config:l.value}).url,update:es({type:"update",config:l.value}).url,scene_hub:es({type:"scene_hub",config:l.value}).url})),d=(T,P)=>{const M=T.metaKey||T.ctrlKey,D=u.value[P]||"";if(D){if(P==="scene_hub"){if(M){window.open(D,"_blank");return}if(!o){console.error("Switch instance not found.",{openSceneHub:o,windowFunc:globalThis.window.$switchInstance});return}o(l.value.scene_id||"");return}M?window.open(D,"_blank"):window.location.href=D}},h=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.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{s()}},f=async(T,P)=>{var M;try{await((M=e.value.axiosService.value)==null?void 0:M.deleteThumbnail({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""]}))}catch(D){console.error("Error deleting thumbnail",D)}finally{s()}},p=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.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."),P&&P("archived")}catch(D){console.error("Error archiving item",D)}finally{s()}},g=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.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."),P&&P("deleted")}catch(D){console.error("Error deleting item",D)}finally{s()}},v=T=>{const P=u.value.scene_hub||"";P&&(_.value="Copied",navigator.clipboard.writeText(P),setTimeout(()=>{_.value="Copy link"},5e3))},w=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.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."),P&&P("unarchived")}catch(D){console.error("Error unarchiving item",D)}finally{s()}},S=T=>p(T,t),b=T=>w(T,t),C=T=>g(T,t),_=V("Copy link"),E=T=>d(T,"review"),I=q(()=>{let T=[];if(!l.value.scene_id&&e.value.optionBlock&&T.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length)return e.value.optionBlock;const P=()=>Math.random().toString(36).substring(2,9);return[{id:P(),type:"column",groupLabel:"Download Options",options:[{id:"open_review",label:"Open Review",icon:"PenRuler",action:E,hide:!c.value.canOpenReview,disabled:!c.value.canOpenReview,description:"",type:"icon"},{id:P(),label:_.value,icon:"Link",action:v,hide:!c.value.canCopyLink,disabled:!c.value.canCopyLink,description:"",type:"icon"}]},{id:P(),type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:S,hide:c.value.canArchiveScene==0,disabled:c.value.canArchiveScene!==1,description:c.value.canArchiveScene==-1?mA:"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:b,hide:c.value.canUnarchiveScene==0,disabled:c.value.canUnarchiveScene!==1,description:c.value.canUnarchiveScene===-1?mA:"",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:w,options:I}};function Co(e){const t=V(!1),n=V(!1),o=q(()=>{var d;const c=e.value,u=!!c.readOnly;return{readOnly:u,disabled:!!c.disabled,hovered:n.value,focused:t.value,isEmpty:c.empty??!1,error:!!c.error,actived:!!((d=c.active)!=null&&d.value),clickable:u?!1:c.clickable??!1}}),s=()=>{t.value=!0,vt(()=>{const c=l(e.value.inputRef);c==null||c.focus()})},r=()=>{t.value=!1},i=()=>{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 Qt(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.addEventListener("focus",s),c.addEventListener("blur",r)),u&&(u.addEventListener("mouseenter",i),u.addEventListener("mouseleave",a))}),qn(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.removeEventListener("focus",s),c.removeEventListener("blur",r)),u&&(u.removeEventListener("mouseenter",i),u.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:o,handleFocus:s}}const $u=e=>{const t=V(!1),n=q(()=>t.value);return Qt(()=>{var a,l,c,u;const o=(a=e.params)==null?void 0:a.api,s=(l=e.params)==null?void 0:l.node,r=s==null?void 0:s.rowIndex,i=(u=(c=e.params)==null?void 0:c.colDef)==null?void 0:u.field;return o==null||o.addEventListener("cellEditingStarted",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!0)}),o==null||o.addEventListener("cellEditingStopped",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}},vA=Ct(st({__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=Ts,{triggerRef:n,popupRef:o}=yo({toggleOnClick:!0,trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),s=q(()=>{switch(r.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"transparent"}}),r=e;return(i,a)=>(K(),ie("div",{class:te(i.$style["status-badge-wrapper"]),style:cn({"--badge-size":`${r.size}px`,"--badge-color":s.value})},[Dt(i.$slots,"default"),Ke(me("div",{class:te(i.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[Ks,r.showBadge],[H(t),{isLoading:r.loading,fullwidth:!0}]]),me("div",{ref_key:"popupRef",ref:o,class:te(i.$style["badge-tooltip"])},ht(r.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"}}]]),mf=rc("switchStore",()=>{const e=V(null),t=yn("switchInstance");return{openSceneHub:(s,r)=>{if(s){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");r?t("scene_hub",{id:s,commentId:r},{showLoading:!1}):t("scene_hub",{id:s,tab:"home"},{showLoading:!1})}},openPeopleInsight:s=>{if(!s){console.error("No people_id provided, defaulting to empty string");return}const r=t||e.value;if(!r)console.error("Switch instance not found");else if(window.switchApploader)window.switchApploader("people_insight",{tab:"home",id:s||""},{showLoading:!1});else throw console.error("Switch instance not found and switchApploader is not available"),new Error("Switch instance not found and switchApploader is not available");r("people_insight",{tab:"home",id:s||""},{showLoading:!1})},switchInstanceFunc:e}}),wZ=st({__name:"MiniPeopleCard",props:{user:{},status:{default:void 0},timezone:{default:Tm()},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:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},private:{type:Boolean,default:!1},showPrivateUser:{type:Boolean,default:!1},switchInstance:{type:Function,default:void 0}},emits:["insightClick","copyLink","dataUpdated"],setup(e,{emit:t}){const n=Yt,o=Ts,s=e,r=t,i={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(new Date),l=V(!0),c=V(!1),u=V(!1),d=V(null);let h=null,f=null;const p=mf(),{openPeopleInsight:g}=p,v=q(()=>!s.private&&!c.value),w=q(()=>{var x,$;return((x=d.value)==null?void 0:x.display_name)??(($=s.user)==null?void 0:$.name)}),S=q(()=>{var x,$;return!v.value||!d.value?s.status:(x=d.value.private_info)!=null&&x.is_offline?"offline":($=d.value.private_info)!=null&&$.last_active?"active":"away"}),b=q(()=>{const x=S.value;return x?i[x]:""}),C=q(()=>{var x,$;return(($=(x=d.value)==null?void 0:x.private_info)==null?void 0:$.timezone)??s.timezone}),_=q(()=>{if(!C.value)return"";try{return a.value.toLocaleTimeString("en-US",{timeZone:C.value,hour:"numeric",minute:"2-digit",hour12:!0})}catch{return console.error("Invalid timezone:",C.value),""}}),E=q(()=>{var x,$,W;return{id:s.user.id,name:w.value,initial:((x=d.value)==null?void 0:x.initial)??s.user.initial,profile_image:(($=d.value)==null?void 0:$.profile_image)??s.user.profile_image,color:((W=d.value)==null?void 0:W.color)??s.user.color,size:72,borderRadius:"8px"}}),I=q(()=>{const x=un.getInstance().getItem("BASE_URL"),$=un.getInstance().getItem("ws.code")||"";return es({type:"people_insight",config:{ws_code:$,baseDomain:x,user_id:s.user.id}}).url}),{copyToClipboard:T,tooltip:P}=fP(I.value,()=>r("copyLink",s.user.id)),M=async()=>{if(!s.apiUpdateFunction){l.value=!1;return}try{const x=await s.apiUpdateFunction(s.user.id);x?(d.value=x,r("dataUpdated",x)):(c.value=!0,u.value=!0,r("dataUpdated",null))}catch(x){c.value=!0,u.value=!0,console.error("Failed to fetch user data:",x)}finally{l.value=!1}},D=()=>{F(),s.apiUpdateFunction&&s.enableAutoRefresh&&(f=setInterval(M,s.refreshInterval))},F=()=>{f!==null&&(clearInterval(f),f=null)},O=x=>{var $;if(x.ctrlKey||x.metaKey){window.open(I.value,"_blank");return}try{g(String(s.user.id))}catch{s.switchInstance?($=s.switchInstance)==null||$.call(s,"people_insight",{tab:"home",id:s.user.id||""},{showLoading:!1}):window.open(I.value,"_blank")}},k=x=>{O(x),r("insightClick",s.user.id)};return tt([()=>s.enableAutoRefresh,()=>s.refreshInterval,()=>s.apiUpdateFunction],D),Qt(async()=>{h=setInterval(()=>{a.value=new Date},1e4),s.apiUpdateFunction?(await M(),D()):l.value=!1}),Ol(()=>{h&&clearInterval(h),F()}),(x,$)=>s.showPrivateUser&&(s.private||u.value)?(K(),ie("div",{key:0,class:te([x.$style["info-row"],x.$style["private-badge"]])},[...$[0]||($[0]=[me("span",null,"Private User",-1)])],2)):(K(),ie("div",{key:1,class:te([x.$style["mini-people-card"],{[x.$style.loading]:l.value},"bg-skeleton"])},[me("div",{class:te(x.$style["avatar-section"])},[v.value?(K(),Ue(vA,{key:0,size:12,status:S.value,loading:l.value,"status-tooltip":b.value},{default:he(()=>[ue(Gh,Wt({readOnly:!0},E.value),null,16)]),_:1},8,["status","loading","status-tooltip"])):(K(),Ue(Gh,Wt({key:1,readOnly:!0},E.value),null,16))],2),me("div",{class:te(x.$style["user-info"])},[me("div",{class:te(x.$style["info-column"])},[Ke((K(),ie("span",{class:te(x.$style["user-name"])},[Qe(ht(w.value),1)],2)),[[H(n),{content:w.value,delay:[1e3,0]}]]),C.value&&v.value?(K(),ie("div",{key:0,class:te([x.$style["info-row"],x.$style["time-row"]])},[Ke((K(),ie("div",{class:te(x.$style["time-display"])},[ue(lt,{source:"remote",src:"Globe",class:te(x.$style["clock-icon"]),size:"10"},null,8,["class"]),me("span",{class:te(x.$style["time-text"])},ht(_.value)+" ("+ht(C.value)+")",3)],2)),[[H(o),{isLoading:l.value,fullwidth:!0}]])],2)):Xe("",!0)],2),!e.readOnly&&v.value?(K(),ie("div",{key:0,class:te([x.$style["info-row"],x.$style.actions])},[e.showInsightButton?(K(),Ue(at,{key:0,label:"Insights",variant:"secondary",size:"small",onClick:kt(k,["prevent","stop"]),disabled:s.disabled},null,8,["disabled"])):Xe("",!0),e.showCopyLinkButton?Ke((K(),Ue(at,{key:1,variant:["icon","secondary"],size:"small",onClick:kt(H(T),["prevent","stop"]),disabled:s.disabled},{default:he(()=>[ue(lt,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[H(n),{content:H(P),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Xe("",!0)],2)):Xe("",!0)],2)],2))}}),CZ=Ct(wZ,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_ign8a_1",loading:"_loading_ign8a_25","avatar-section":"_avatar-section_ign8a_28","user-info":"_user-info_ign8a_33","info-column":"_info-column_ign8a_42","info-row":"_info-row_ign8a_50","time-row":"_time-row_ign8a_56","time-display":"_time-display_ign8a_62","time-text":"_time-text_ign8a_70",actions:"_actions_ign8a_79","user-name":"_user-name_ign8a_83","v-enter-active":"_v-enter-active_ign8a_103","v-leave-active":"_v-leave-active_ign8a_104","v-enter-from":"_v-enter-from_ign8a_108","v-leave-to":"_v-leave-to_ign8a_109"}}]]),bZ=Ct(st({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=ko,o=Yt,s=e,{isEditing:r}=$u(s),i=()=>{var h,f;const u=(h=s.params)==null?void 0:h.api,d={rowIndex:(f=u==null?void 0:u.getRowNode(String(s.id)))==null?void 0:f.rowIndex,colKey:"options"};u==null||u.startEditingCell(d)},a=q(()=>{var d,h;const u=(h=(d=s.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(s.id));return((u==null?void 0:u.rowIndex)??0)+10}),l=()=>{var u,d;(d=(u=s.params)==null?void 0:u.api)==null||d.stopEditing()},c=V();return t({focus(){var u;(u=c.value)==null||u.focus()},blur(){var u;(u=c.value)==null||u.blur()}}),(u,d)=>Ke((K(),Ue(at,{class:te(u.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:H(r),onClick:kt(i,["stop"]),onEscape:l,ref_key:"buttonRef",ref:c},{default:he(()=>[ue(lt,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[H(o),"More actions"],[H(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_137ge_1"}}]]),SZ=["src","width","height","alt"],Ka=Ct(st({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=Ts,{getCachedValue:n,setCachedValue:o}=$h({dbName:"visual-cache-db",storeName:"visuals"}),s=h=>{if(h!==void 0)return typeof h=="number"?`${h}px`:typeof h=="string"&&/^\d+$/.test(h)?`${h}px`:h},r=e,i=q(()=>({minWidth:s(r.minWidth),maxWidth:s(r.maxWidth),minHeight:s(r.minHeight),maxHeight:s(r.maxHeight),aspectRatio:r.ratio,width:s(r.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await o(h,f)},c=q(()=>({name:r.src,size:Number(r.size||100),color:""})),{url:u,loading:d}=TI(c,"visual",l,a);return(h,f)=>Ke((K(),ie("div",{class:te([h.$style.visualWrapper,{[h.$style.loading]:H(d)}]),style:cn(i.value)},[me("img",{src:H(u),width:e.size,height:e.size,alt:"visual-"+e.src,style:cn(i.value)},null,12,SZ)],6)),[[H(t),{isLoading:H(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),EZ=["tabindex"],_o=Ct(st({__name:"DisplayWrapper",props:{prefix:{},suffix:{},inputType:{},readOnly:{type:Boolean},disabled:{type:Boolean},hovered:{type:Boolean},focused:{type:Boolean},error:{type:Boolean},actived:{type:Boolean},clickable:{type:Boolean},size:{},bordered:{type:Boolean},tabIndex:{}},emits:["event","escape"],setup(e,{expose:t,emit:n}){const o=e,s=n;bg();const r=Og(),i=V(null),a=V("default"),l=q(()=>{if(typeof o.size=="number")return`${o.size}px`;switch(o.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),c=q(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),u=q(()=>({[r["display-wrapper"]]:!0,[r.disabled]:o.disabled,[r.readOnly]:o.readOnly,[r.error]:o.error,[r.clickable]:o.clickable,[r.active]:o.actived,[r.hovered]:o.hovered,[r.focused]:!o.readOnly&&!o.disabled&&o.focused,[r.bordered]:o.bordered})),d=()=>{var C,_;const g=((C=i.value)==null?void 0:C.querySelectorAll(":scope > .wrapper-prefix").length)||0,v=((_=i.value)==null?void 0:_.querySelectorAll(":scope > .wrapper-suffix").length)||0,w="var(--icon-size)",b=`calc(var(--gap-size) * ${g+v})`;return g&&!v?`repeat(${g}, ${w}) calc(100% - (${g} * ${w} + ${b}))`:!g&&v?`calc(100% - (${v} * ${w} + ${b})) repeat(${v}, ${w})`:g&&v?`repeat(${g}, ${w}) calc(100% - (${g} * ${w} + ${v} * ${w} + ${b})) repeat(${v}, ${w})`:"100%"},h=V("100%"),f=()=>{h.value=d()};mh(()=>{f()}),Qt(()=>{f()});const p=g=>{a.value=g};return t({rootEl:i,updateState:p,componentState:a,focus:()=>{vt(()=>{var g;(g=i.value)==null||g.focus()})},escape:()=>{s("escape")}}),(g,v)=>(K(),ie("div",{ref_key:"rootEl",ref:i,class:te([H(r)["display-wrapper"],u.value]),tabindex:e.tabIndex,style:cn({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":c.value})},[Dt(g.$slots,"prefix",{hovered:o.hovered,focused:o.focused}),Dt(g.$slots,"default",{hovered:o.hovered,focused:o.focused,updateComponentState:p,disabled:o.disabled}),Dt(g.$slots,"suffix",{hovered:o.hovered,focused:o.focused})],14,EZ))}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_46uq2_1",readOnly:"_readOnly_46uq2_26",bordered:"_bordered_46uq2_29",disabled:"_disabled_46uq2_29",active:"_active_46uq2_29",focused:"_focused_46uq2_29",hovered:"_hovered_46uq2_33",error:"_error_46uq2_37",clickable:"_clickable_46uq2_50",suffix:"_suffix_46uq2_56",prefix:"_prefix_46uq2_57"}}]]),_Z=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const RZ=Object.prototype.toString,DZ=e=>RZ.call(e)==="[object Object]",Hu=()=>{};function TZ(e,t){function n(...o){return new Promise((s,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(s).catch(r)})}return n}function IZ(e,t={}){let n,o,s=Hu;const r=l=>{clearTimeout(l),s(),s=Hu};let i;return l=>{const c=Hi(e),u=Hi(t.maxWait);return n&&r(n),c<=0||u!==void 0&&u<=0?(o&&(r(o),o=void 0),Promise.resolve(l())):new Promise((d,h)=>{s=t.rejectOnCancel?h:d,i=l,u&&!o&&(o=setTimeout(()=>{n&&r(n),o=void 0,d(i())},u)),n=setTimeout(()=>{o&&r(o),o=void 0,d(l())},c)})}}function wS(e){return Array.isArray(e)?e:[e]}function xZ(e,t=200,n={}){return TZ(IZ(t,n),e)}function FZ(e,t,n){return tt(e,t,{...n,immediate:!0})}const yA=_Z?window:void 0;function vf(e){var t;const n=Hi(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function CS(...e){const t=(o,s,r,i)=>(o.addEventListener(s,r,i),()=>o.removeEventListener(s,r,i)),n=q(()=>{const o=wS(Hi(e[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return FZ(()=>{var o,s;return[(o=(s=n.value)===null||s===void 0?void 0:s.map(r=>vf(r)))!==null&&o!==void 0?o:[yA].filter(r=>r!=null),wS(Hi(n.value?e[1]:e[0])),wS(H(n.value?e[2]:e[1])),Hi(n.value?e[3]:e[2])]},([o,s,r,i],a,l)=>{if(!(o!=null&&o.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const c=DZ(i)?{...i}:i,u=o.flatMap(d=>s.flatMap(h=>r.map(f=>t(d,h,f,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function bS(e,t,n={}){const{window:o=yA,ignore:s=[],capture:r=!0,detectIframe:i=!1,controls:a=!1}=n;if(!o)return a?{stop:Hu,cancel:Hu,trigger:Hu}:Hu;let l=!0;const c=v=>Hi(s).some(w=>{if(typeof w=="string")return Array.from(o.document.querySelectorAll(w)).some(S=>S===v.target||v.composedPath().includes(S));{const S=vf(w);return S&&(v.target===S||v.composedPath().includes(S))}});function u(v){const w=Hi(v);return w&&w.$.subTree.shapeFlag===16}function d(v,w){const S=Hi(v),b=S.$.subTree&&S.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(C=>C.el===w.target||w.composedPath().includes(C.el))}const h=v=>{const w=vf(e);if(v.target!=null&&!(!(w instanceof Element)&&u(e)&&d(e,v))&&!(!w||w===v.target||v.composedPath().includes(w))){if("detail"in v&&v.detail===0&&(l=!c(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[CS(o,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:r}),CS(o,"pointerdown",v=>{const w=vf(e);l=!c(v)&&!!(w&&!v.composedPath().includes(w))},{passive:!0}),i&&CS(o,"blur",v=>{setTimeout(()=>{var w;const S=vf(e);((w=o.document.activeElement)===null||w===void 0?void 0:w.tagName)==="IFRAME"&&!(S!=null&&S.contains(o.document.activeElement))&&t(v)},0)},{passive:!0})].filter(Boolean),g=()=>p.forEach(v=>v());return a?{stop:g,cancel:()=>{l=!1},trigger:v=>{l=!0,h(v),l=!1}}:g}const PZ=["value","placeholder","disabled","readonly","inputmode","maxlength"],SS=Ct(st({__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 o=ko,s=Yt,r=e,i=n,a=V(null),l=V(r.modelValue||"");tt(l,()=>{i("onValidation",l.value)});const c=V(!1),u=V(r.modelValue||"");tt(()=>r.modelValue,N=>{l.value=N||"",u.value=N||""});const d=q(()=>{var N;return((N=l.value)==null?void 0:N.length)>0}),h={text:N=>N.slice(0,r.maxLength||255),number:N=>{let z=N.replace(/[^\d.-]/g,"");const ne=z.split(".");ne.length>2&&(z=ne[0]+"."+ne.slice(1).join("")),z=z.replace(/-/g,(U,ge)=>ge===0?U:"");const ve=z.startsWith("-")?"-":"",re=z.replace("-","").split(".");return re[0].length>17&&(re[0]=re[0].substring(0,17)),r.maxDecimalChar!==void 0&&re.length>1&&(re[1]=re[1].substring(0,r.maxDecimalChar)),z=ve+re.join("."),z},email:N=>N.replace(/\s/g,"").slice(0,r.maxLength||255),url:N=>N.replace(/\s/g,"").slice(0,r.maxLength||255),tel:N=>N.replace(/[^\d+\-() ]/g,"").slice(0,r.maxLength||20)},f=N=>{const z=h[r.type];return z?z(N):N},p=xZ(N=>{r.autoEmit&&(i("update:modelValue",N),i("input",N))},r.debounceDelay),g=N=>{const z=N;if(r.disabled||r.readOnly){z.preventDefault();return}const ne=z.target,pe=ne.selectionStart||0,ve=l.value,we=f(ne.value);ve!==we&&(l.value=we,i("input",we),r.autoEmit&&p(we),ne.value!==we&&(ne.value=we,vt(()=>{let re=pe;if(we.length<ne.value.length)re=pe;else{const U=we.length-ve.length;re=pe+U}re=Math.max(0,Math.min(re,we.length)),ne.setSelectionRange(re,re)})))},v=N=>{if(r.disabled||r.readOnly){N.preventDefault();return}c.value=!0;const z=l.value;l.value="",i("update:modelValue",""),i("clear"),z!==""&&i("change",""),N.preventDefault(),N.stopImmediatePropagation(),N.stopPropagation(),vt(()=>{var ne;(ne=a.value)==null||ne.focus(),setTimeout(()=>{c.value=!1},100)})},w=N=>{r.disabled||r.readOnly||(i("focus",N),r.selectOnFocus&&vt(()=>{N.target.select()}))},S=N=>{if(c.value)return;const ne=N.target.value;r.autoEmit||i("update:modelValue",ne),u.value!==ne&&(i("change",ne),u.value=ne),i("blur",ne,N)},b=N=>{setTimeout(()=>{vt(()=>{const ne=N.target.value;i("enter",ne,N),i("enterValue",ne),r.submitOnEnter&&(N.preventDefault(),r.autoEmit||i("update:modelValue",ne),u.value!==ne&&(i("change",ne),u.value=ne))})},1e3)},C=N=>{const z=N.target,ne=z.value;if(i("escape",ne,N),N.preventDefault(),N.stopImmediatePropagation(),N.stopPropagation(),r.autoEmit){i("cancel"),r.blurOnEscape&&z.blur();return}l.value=r.modelValue||"",a.value&&(a.value.value=l.value),i("cancel"),r.blurOnEscape&&z.blur()},_=N=>{const ne=N.target.value;i("tab",ne,N),r.autoEmit||(i("update:modelValue",ne),u.value!==ne&&(i("change",ne),u.value=ne))},E=(N,z,ne)=>N===""?!0:N==="."?ne>0:new RegExp(`^\\d{0,${z}}(\\.\\d{0,${ne}})?$`).test(N),I=N=>{if(i("keydown",N),N.key===" "&&N.stopPropagation(),r.type==="number"){if(N.key==="e"||N.key==="E"){N.preventDefault();return}if(!(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"].includes(N.key)||N.ctrlKey||N.metaKey||N.altKey)){if(Number.isNaN(Number(N.key))&&N.key!=="."&&N.key!=="-"){N.preventDefault();return}const pe=l.value+N.key;if(!E(pe,17,r.maxDecimalChar||2)){N.preventDefault();return}}}N.key==="Escape"?C(N):N.key==="Enter"?b(N):N.key==="Tab"?_(N):(N.key==="ArrowUp"||N.key==="ArrowDown")&&r.type==="number"&&N.preventDefault()},T=N=>{i("keyup",N)},P=N=>{if(r.disabled||r.readOnly){N.preventDefault();return}i("paste",N)},M=N=>{if(r.disabled||r.readOnly){N.preventDefault();return}i("cut",N)},D=N=>{i("select",N)},F=`input-text-${Math.random().toString(36).substr(2,9)}`,O=V(!1),k=q(()=>{switch(r.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});tt(()=>l.value,N=>{r.validatorFnc?O.value=!!N&&!r.validatorFnc(N):O.value=!1});const x=V(null),$=q(()=>({disabled:r.disabled,readOnly:r.readOnly,error:O.value,inputRef:a,clickable:!r.disabled&&!r.readOnly,focused:r.focused,wrapperRef:x,bordered:!0})),{argsMain:W,isHover:Q,isFocus:ae}=Co($);t({triggerFocus:()=>{vt(()=>{var N;(N=a.value)==null||N.focus()})},focus:()=>{ee()},blur:()=>{vt(()=>{var N;(N=a.value)==null||N.blur()})},select:()=>{vt(()=>{var N;(N=a.value)==null||N.select()})},setSelectionRange:(N,z)=>{vt(()=>{var ne;(ne=a.value)==null||ne.setSelectionRange(N,z)})},getValue:()=>l.value,setValue:N=>{l.value=f(N),a.value&&(a.value.value=l.value)},reset:()=>{l.value=r.modelValue||"",a.value&&(a.value.value=l.value)}});const ee=()=>{!r.disabled&&!r.readOnly&&vt(()=>{var N;(N=a.value)==null||N.focus()})},X=q(()=>ae.value&&d.value);return(N,z)=>(K(),ie("div",{class:te([N.$style["input-wrapper"],"input-editor"]),onClick:ee},[Ke((K(),Ue(_o,Wt(H(W),{ref_key:"wrapperRef",ref:x,class:[N.$style["input-box"],{[N.$style["is-hovered"]]:H(Q),[N.$style["is-focused"]]:H(ae),[N.$style["has-input"]]:d.value,[N.$style["is-editting"]]:X.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:r.bordered}),{prefix:he(()=>[Dt(N.$slots,"prefix")]),suffix:he(()=>[d.value&&!r.disabled&&!r.readOnly?Dt(N.$slots,"clear",{key:0},()=>[Ke((K(),Ue(at,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:kt(v,["prevent","stop"]),size:18,rounded:!0,class:te(["wrapper-suffix",N.$style["clear-button"]])},{default:he(()=>[ue(lt,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[H(s),{content:"Clear",contentClass:"extra-padding"}]])]):Dt(N.$slots,"suffix",{key:1})]),default:he(()=>[me("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:"text",value:l.value,placeholder:e.placeholder,class:te([N.$style["column-config__input"]]),id:F,disabled:e.disabled,readonly:e.readOnly,inputmode:k.value,maxlength:r.maxLength,onInput:g,onFocus:w,onBlur:S,onKeydown:I,onKeyup:T,onPaste:P,onCut:M,onSelect:D},null,42,PZ)]),_:3},16,["class","bordered"])),[[H(o),r.focusIndex]]),O.value?Dt(N.$slots,"error",{key:0}):Xe("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_1p4v0_1","is-disabled":"_is-disabled_1p4v0_16","is-readonly":"_is-readonly_1p4v0_16","is-hovered":"_is-hovered_1p4v0_16","is-focused":"_is-focused_1p4v0_20","column-config__input":"_column-config__input_1p4v0_40","clear-button":"_clear-button_1p4v0_55"}}]]),kZ={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},ES=st({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search"},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{default:void 0}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=V(null),i=xr(c=>{s("update:modelValue",c),s("search",c)},li),a=()=>{s("update:modelValue",""),s("clear"),vt(()=>{var c;(c=r.value)==null||c.focus()})},l=V(o.modelValue);return t({focus:()=>{var c;(c=r.value)==null||c.focus()},setValue(c){l.value=c}}),(c,u)=>(K(),Ue(SS,{focusIndex:o.focusIndex,ref_key:"searchInput",ref:r,modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:H(i),onClear:a,onCancel:u[1]||(u[1]=d=>s("cancel")),"auto-emit":!0},{prefix:he(()=>[me("div",kZ,[ue(lt,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),ic=Ct(st({name:"ListItem",directives:{tooltip:Yt,focusable:ko},__name:"ListItem",props:{itemWidth:{default:"250px"},label:{},value:{},type:{},selected:{type:Boolean},disabled:{type:Boolean},hover:{type:Boolean},clickable:{type:Boolean,default:!0},danger:{type:Boolean},data:{},icon:{},readOnly:{type:Boolean,default:!1},show:{type:Boolean},focusIndex:{}},emits:["click","handleClick","keydown","update:selected","select","escape"],setup(e,{expose:t,emit:n}){const o=ko,s=e,r=n,i=V(!1),a=V(!1);function l(_){if(!_||typeof _!="object")return!1;const E=_;return typeof E.name=="string"&&typeof E.id=="string"&&typeof E.initial=="string"}const c=q(()=>s.type==="status"||s.type==="assignee"||s.type==="icon"||!!C.prefix),u=q(()=>!!C.suffix||s.danger&&i.value),d=q(()=>{var _;return s.type==="status"&&typeof((_=s.data)==null?void 0:_.color)=="string"?{backgroundColor:s.data.color,border:em(s.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),h=Og(),f=q(()=>({[h.active]:s.selected??!1,[h.disabled]:s.disabled??!1,[h.hover]:s.hover??!1,[h.clickable]:(s.clickable??!0)&&!s.disabled,[h.danger]:s.danger??!1,[h["has-prefix"]]:c.value,[h["has-suffix"]]:u.value,[h.readOnly]:s.readOnly}));q(()=>({content:"Cancel",...b})),q(()=>({content:"Confirm",theme:"warning",...b}));function p(_){return{name:_.name,initial:_.initial,id:_.id,profile_image:_.profile_image??null,color:_.color,size:24}}function g(){i.value=!1}function v(_){_?r("click",_):(s.clickable??!0)&&(r("update:selected",!s.selected),r("select",!s.selected))}function w(_){if(!s.disabled){if(s.danger&&!i.value){i.value=!0;return}else s.danger||v(_);r("handleClick",_)}}const S=()=>{i.value?g():r("escape")},b=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),C=bg();return tt(()=>s.show,_=>{_===!1&&(i.value=!1)}),t({select:()=>{w(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(_,E)=>{const I=eu("tooltip");return Ke((K(),Ue(at,{variant:["menu-item",e.danger?"danger":"menu-item"],class:te([_.$style["list-item"],f.value]),onHandleClick:w,onMouseenter:E[0]||(E[0]=T=>a.value=!0),onMouseleave:E[1]||(E[1]=T=>a.value=!1),onEscape:S,style:cn({width:s.itemWidth})},{default:he(()=>[c.value?(K(),ie("div",{key:0,class:te(_.$style["list-item__prefix"])},[Dt(_.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(K(),Ue(lt,{key:0,src:e.icon,source:"remote",class:te(_.$style["item-icon"]),color:s.danger?void 0:"#a6a6a6"},null,8,["src","class","color"])):e.type==="status"?(K(),ie("div",{key:1,class:te(_.$style["status-indicator"]),style:cn(d.value)},null,6)):e.type==="assignee"&&l(e.data)?(K(),Ue(Gh,Wt({key:2},p(e.data),{class:_.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Xe("",!0)])],2)):Xe("",!0),me("div",{class:te(_.$style["list-item__label"])},[Dt(_.$slots,"label",{selected:e.selected},()=>[Qe(ht(e.label),1)])],2),u.value?(K(),ie("div",{key:1,class:te(_.$style["list-item__suffix"])},[Dt(_.$slots,"suffix",{item:_.$props,hovered:a.value},()=>[e.danger&&i.value?(K(),ie("div",{key:0,class:te(_.$style["confirm-action"])},[Ke((K(),Ue(at,{variant:["tertiary","icon","danger"],size:"small",onClick:kt(g,["stop","prevent"])},{default:he(()=>[ue(lt,{src:"Xmark",source:"remote"})]),_:1})),[[H(o),`${s.focusIndex}.0`],[I,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((K(),Ue(at,{variant:["danger","primary","icon"],size:"small",onClick:kt(v,["stop","prevent"])},{default:he(()=>[ue(lt,{src:"Check",source:"remote"})]),_:1})),[[H(o),`${s.focusIndex}.1`],[I,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Xe("",!0)])],2)):Xe("",!0)]),_:3},8,["variant","class","style"])),[[H(o),s.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_tuyyv_1",disabled:"_disabled_tuyyv_16",danger:"_danger_tuyyv_23","has-prefix":"_has-prefix_tuyyv_26","has-suffix":"_has-suffix_tuyyv_26",clickable:"_clickable_tuyyv_40",readOnly:"_readOnly_tuyyv_43",hover:"_hover_tuyyv_47",active:"_active_tuyyv_53","list-item__prefix":"_list-item__prefix_tuyyv_78","list-item__label":"_list-item__label_tuyyv_86","list-item__suffix":"_list-item__suffix_tuyyv_100","status-indicator":"_status-indicator_tuyyv_107","item-icon":"_item-icon_tuyyv_113","arbo-icon-state":"_arbo-icon-state_tuyyv_118","item-avatar":"_item-avatar_tuyyv_121","confirm-action":"_confirm-action_tuyyv_130"}}]]),AZ=["aria-activedescendant"],OZ=["innerHTML"],MZ=10,na=Ct(st({__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"},itemWidth:{default:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const o=Yt,s={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},r=e,i=n,a=V(""),l=V(-1),c=V(null),u=V(null),d=V(new Map),h=q(()=>Vb(a.value)),f=()=>{const X=h.value;if(!X||X.length<r.minQueryLength)return r.options;if(d.value.has(X))return d.value.get(X);const N=r.options.map(z=>({item:z,score:k7(` ${z.label} `,X)})).filter(({score:z})=>z>0).sort((z,ne)=>ne.score-z.score).map(({item:z})=>z);return d.value.set(X,N),N},p=V([]);tt(()=>r.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=q(()=>r.hasMore&&!r.loading&&!r.loadingMore),v=xr(X=>{a.value=X,l.value=-1,i("search",X)},li),w=async X=>{ae.value=0,await v(X||""),ae.value=1},S=X=>a.value?A7(X,a.value):X,b=X=>{const z={[s.ARROW_DOWN]:()=>C(X),[s.ARROW_UP]:()=>_(X),[s.ENTER]:()=>T(X),[s.ESCAPE]:()=>P(X),[s.TAB]:()=>M(X)}[X.key];z&&z()},C=X=>{X.preventDefault(),E(1)},_=X=>{X.preventDefault(),E(-1)},E=X=>{const N=p.value.length;if(N===0)return;let z;X>0?z=(l.value+1)%N:l.value>0?z=l.value-1:z=N-1,l.value=z,I()},I=()=>{vt(()=>{var N;const X=(N=u.value)==null?void 0:N.querySelectorAll('[role="menuitem"]')[l.value];X==null||X.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},T=X=>{if(X.preventDefault(),l.value>=0&&l.value<p.value.length){const z=p.value[l.value];D(z,X)}},P=X=>{X.preventDefault(),O()},M=X=>{i("tab",X)},D=(X,N)=>{!X||X.disabled||(i("select",X,N),l.value=-1,O())},F=X=>{X>=0&&X<p.value.length&&(l.value=X)},O=()=>{i("close")},k=()=>{if(!g.value||!u.value)return;const{scrollTop:X,clientHeight:N,scrollHeight:z}=u.value;z-(X+N)<=MZ&&i("loadMore")},x=()=>{var X,N,z;(X=u.value)==null||X.addEventListener("scroll",k),(z=(N=Q.value)==null?void 0:N.$el)==null||z.addEventListener("keydown",b)},$=()=>{var X,N,z;(X=u.value)==null||X.removeEventListener("scroll",k),(z=(N=Q.value)==null?void 0:N.$el)==null||z.removeEventListener("keydown",b)};Qt(()=>{x()}),qn(()=>{$()}),tt(()=>r.loading,X=>{!X&&p.value.length>0&&(l.value=-1)});const W=X=>X?Array.isArray(r.selectedId)?r.selectedId.includes(String(X.id)):r.selectedId==X.id:!1,Q=V(null);tt(l,()=>{I()}),t({focus:()=>{vt(()=>{var X;(X=Q.value)==null||X.focus()})},reset:()=>{var X;(X=Q.value)==null||X.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:O,clearSearch:()=>{a.value=""},scrollTo:X=>{u.value&&(u.value.scrollTop=X)},selectIndex:X=>{X>=0&&X<p.value.length&&(l.value=X,I())}});const ae=V(0);tt([()=>r.loading,()=>a.value,()=>r.options,()=>r.loadingMore],()=>{const X=r.options.length>0&&p.value.length>0,N=!X&&a.value.length>0,z=!X&&a.value.length===0;r.loading?ae.value=0:X?ae.value=1:N?ae.value=2:z&&(ae.value=3)},{immediate:!0,deep:!0});const ee=()=>{i("cancel")};return(X,N)=>(K(),ie("datalist",{ref_key:"searchListRef",ref:c,class:te([X.$style["search-list"],ae.value===3||ae.value===2?X.$style.empty:"",p.value.length>8?X.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:cn({width:e.itemWidth||e.width})},[ue(ES,{ref_key:"searchBoxRef",ref:Q,modelValue:a.value,"onUpdate:modelValue":N[0]||(N[0]=z=>a.value=z),class:te(X.$style["search-box"]),disabled:e.loading,onSearch:w,onClear:N[1]||(N[1]=z=>w("")),onCancel:ee},null,8,["modelValue","class","disabled"]),me("div",{ref_key:"popupRef",ref:u,class:te(X.$style["list-container"])},[Dt(X.$slots,"extra-item",{query:a.value,isEmpty:ae.value===3||ae.value===2,isLoading:r.loading}),(K(!0),ie(It,null,Fn(p.value,(z,ne)=>Ke((K(),ie("div",{key:`${z.id}-${ne}`,role:"menuitem"},[Dt(X.$slots,"item",{item:z,index:ne,selectedIndex:l.value,isSelected:W,handleSelect:D,handleItemHover:F,getHighlightedLabel:S,query:a.value,idx:ne,focused:l.value==ne},()=>[z.hide?Xe("",!0):(K(),Ue(ic,Wt({key:0,ref_for:!0},z,{hover:ne===l.value,selected:W(z),type:z.type,id:`item-${ne}`,"aria-selected":ne===l.value,onClick:pe=>D(z,pe),onMouseover:pe=>F(ne),onEscape:O,itemWidth:e.itemWidth||e.width}),{prefix:he(()=>[Dt(X.$slots,"prefix-item",{item:z})]),label:he(()=>[a.value?Ke((K(),ie("span",{key:0,class:te(X.$style.match),innerHTML:S(z.label)},null,10,OZ)),[[H(o),{content:z.label,delay:[1e3,0]}]]):Ke((K(),ie("span",{key:1,class:te(X.$style["item-label"])},[Qe(ht(z.label),1)],2)),[[H(o),{content:z.label,delay:[1e3,0]}]])]),suffix:he(({hovered:pe})=>[Dt(X.$slots,"action",{item:z,isHovered:ne===l.value,hovered:pe,selected:l.value==ne})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover","itemWidth"]))])])),[[Ks,ae.value===1]])),128)),ae.value===0?Dt(X.$slots,"loading-more",{key:0},()=>[(K(),ie(It,null,Fn(8,z=>me("div",{class:te(X.$style["loading-more"]),key:z},[me("div",{class:te(X.$style["loading-skeleton"])},null,2),me("div",{class:te(X.$style["loading-skeleton"])},null,2)],2)),64))]):Xe("",!0),ae.value===2?(K(),ie("div",{key:1,class:te(X.$style["no-results"])},[Dt(X.$slots,"empty",{query:a.value},()=>[me("div",{class:te(X.$style["no-results-content"])},[...N[2]||(N[2]=[me("div",null,[Qe(" No results. "),me("br"),Qe(" Try another search. ")],-1)])],2)])],2)):Xe("",!0),ae.value===3?(K(),ie("div",{key:2,class:te(X.$style["no-results"])},[Dt(X.$slots,"empty-list",{},()=>[me("div",{class:te(X.$style["no-results-content"])},[...N[3]||(N[3]=[me("div",null,"No items available.",-1)])],2)])],2)):Xe("",!0),Dt(X.$slots,"footer")],2)],14,AZ))}}),[["__cssModules",{$style:{"search-list":"_search-list_1rcj9_1",empty:"_empty_1rcj9_11",scrollable:"_scrollable_1rcj9_17","list-container":"_list-container_1rcj9_24","item-label":"_item-label_1rcj9_45","loading-state":"_loading-state_1rcj9_53","loading-more":"_loading-more_1rcj9_54","loading-skeleton":"_loading-skeleton_1rcj9_65","is-loading":"_is-loading_1rcj9_72","no-results":"_no-results_1rcj9_127","no-results-content":"_no-results-content_1rcj9_134",title:"_title_1rcj9_137",tips:"_tips_1rcj9_143",match:"_match_1rcj9_157","skeleton-loading":"_skeleton-loading_1rcj9_1"}}]]),Gu=st({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=C3,n=e,o=V(n.appendTo||void 0),s=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:o.value}),r=V(s());tt(()=>n,()=>{setTimeout(()=>{vt(()=>{o.value=n.appendTo||void 0,r.value=s()})},50)},{immediate:!0,deep:!0});const i=q(()=>un.getInstance().getItem("user.ws_user_role_id")),a=q(()=>({id:n.user.id,name:n.user.name,profile_image:n.user.profile_image,color:n.user.color,initial:n.user.initial,isMe:n.user.id===i.value}));return(l,c)=>Ke((K(),Ue(Gh,RH(pT(a.value)),null,16)),[[H(t),r.value]])}}),NZ={class:"avatar-wrapper"},LZ={class:"assignee-label"},wA=Ct(st({__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,o=e,s=q(()=>({name:o.user.name,id:o.user.id,profile_image:o.user.profile_image,color:{bgColor:o.user.color.bgColor,textColor:o.user.color.textColor},initial:o.user.initial})),r=bg(),i=q(()=>{if(!a.value&&!o.hover&&!o.focused||!r.actions)return 0;let l=0;const c=u=>{u.forEach(d=>{d.type===It&&Array.isArray(d.children)?c(d.children):d.type!==Yn&&d.type!==Fa&&l++})};return c(r.actions()),l}),a=V(!1);return(l,c)=>(K(),ie("div",{class:te(["assignee-selector-item",{hovered:a.value||o.hover,disabled:o.disabled,selected:o.selected,single:i.value==0,focused:o.focused}]),style:cn({"--actions-count":i.value}),onMouseenter:c[0]||(c[0]=u=>a.value=!0),onMouseleave:c[1]||(c[1]=u=>a.value=!1)},[me("div",NZ,[ue(Gu,{user:s.value,"show-profile":!0,"append-to":o.appendTo,"api-update-function":o.apiUpdateFunction},null,8,["user","append-to","api-update-function"]),o.multipleSelect?(K(),ie("div",{key:0,class:te(["avatar-indicator",[o.selected?"remove":"add"]])},[o.selected?(K(),Ue(lt,{key:0,src:"CircleXMark"})):(K(),Ue(lt,{key:1,src:"CirclePlus"}))],2)):Xe("",!0)]),Ke((K(),ie("div",LZ,[Dt(l.$slots,"name",{},()=>[Qe(ht(o.user.name),1)],!0)])),[[H(n),{content:o.user.name,delay:[1e3,0]}]]),a.value||o.hover||o.focused?Dt(l.$slots,"actions",{key:0},void 0,!0):Xe("",!0)],38))}}),[["__scopeId","data-v-dbfbcc0c"]]),VZ={class:"unassign-icon"},_S=Ct(st({__name:"UnassignBtn",props:{actived:{type:Boolean,default:!1},label:{default:"No assignee"},borderLeft:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t,o=()=>{n("click")};return(s,r)=>(K(),Ue(H(at),{variant:"menu-item",onClick:o,actived:e.actived,style:cn({"border-top-width":0,"border-bottom-width":0,"border-left-width":e.borderLeft?"4px":"0"})},{prefix:he(()=>[me("div",VZ,[Dt(s.$slots,"icon",{},()=>[r[0]||(r[0]=me("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[me("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:he(()=>[Dt(s.$slots,"label",{},()=>[Qe(ht(e.label),1)],!0)]),_:3},8,["actived","style"]))}}),[["__scopeId","data-v-ec3b3a15"]]),BZ=["innerHTML"],CA=20,bA=Ct(st({__name:"AssigneeGroupEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{}},emits:["updated","cancel","update-start","update-failed","update-completed"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,{id:r}=ag(s),i=n,a=ne=>{var ve,we;const pe=(we=(ve=s.params)==null?void 0:ve.api)==null?void 0:we.getRowNode(String(r.value));pe==null||pe.setDataValue("assignees",rb(ne.assignees)),z("updated",ne)},l=V(!1),c=V(!1),u=V(null),d=V(1),h=V(!0),f=V(0),p=V(""),g=yn("bulkUpdate",V(!1)),v=yn("isSelectAll",V(!1)),w=q(()=>{var ne;return g.value&&v.value?[]:(ne=s.ids)!=null&&ne.length?s.ids:[String(r.value)]}),{unAssignAll:S,replaceAssignees:b,handleSelect:C,assigneeList:_,mergedOptions:E,selectedUserIds:I}=Om({...s,entityId:s.entityId,updateRowData:a,value:s.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{z("update-failed")}},w),{apiServices:T}=Zn(!g.value,s),P=yn("workspaceId"),M=async(ne=1,pe="",ve=!1)=>{var re,U,ge,oe,Re,G;if(!T.value)throw console.error("API service or item identifiers are undefined",T.value),new Error("API service or item identifiers are undefined");if(ve?c.value=!0:l.value=!0,u.value=null,!((re=T.value)!=null&&re.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");const we=(s.ids??(s.id?[s.id]:[])).map(String);try{let Y;we.length==0?Y=await((U=T.value)==null?void 0:U.getEntityUserRoles({workspaceId:String(P),page:ne,per_page:CA,display_name_like:pe.trim(),entity_ids:String(s.entityId)})):Y=await((ge=T.value)==null?void 0:ge.multipleAssignableUser({workspaceId:String(P),itemIds:we,page:ne,perPage:CA,q:pe.trim(),entityId:String(s.entityId)}));const de=((oe=Pu(Y.data))==null?void 0:oe.map(Am))??[];_.value=ve?vu(_.value,de,"id"):de,f.value=Y.meta.total,h.value=(((Re=Y==null?void 0:Y.meta)==null?void 0:Re.current_page)||0)<(((G=Y==null?void 0:Y.meta)==null?void 0:G.last_page)||0),d.value=ne}catch(Y){console.error("Error fetching assignable users:",Y),u.value="Failed to load assignable users"}finally{l.value=!1,c.value=!1}},D=()=>{!c.value&&h.value&&M(d.value+1,p.value,!0)},F=xr(async ne=>{p.value=ne,await M(1,ne,!1)},li),O=()=>M(1,p.value,!1);Qt(()=>{var ne;(ne=x.value)==null||ne.focus()}),t({getValue:()=>{var ne;return(ne=E.value.find(pe=>pe.selected))==null?void 0:ne.value},refresh:O,clearInternal:()=>{I.value=[]},focus:()=>{var ne;(ne=x.value)==null||ne.focus()}});const k=()=>{const ne=un.getInstance().getItem("BASE_URL"),pe=es({type:"access_setting",config:{baseDomain:ne,ws_code:s.workspaceId,entity_id:P}}).url;window.open(pe,"_blank")},x=V(null);Qt(()=>{vt(()=>{var ne;(ne=x.value)==null||ne.focus()})}),tt([()=>s.id,()=>s.workspaceId],()=>{M()},{deep:!0,immediate:!0});const $=ne=>{var ve;const pe=un.getInstance().getItem("ws.code");return((ve=T.value)==null?void 0:ve.getUserInformation(pe,ne))||Promise.resolve(null)},W=async(ne,pe,ve)=>{pe.preventDefault(),pe.stopPropagation(),pe.stopImmediatePropagation(),z("update-start");try{if(await C(ne))z("update-completed");else throw new Error("Failed to update assignees")}catch(we){z("update-failed"),console.error("Error updating assignees:",we)}},Q=async()=>{try{if(z("update-start"),await S())z("update-completed");else throw new Error("Failed to unassign all assignees")}catch(ne){z("update-failed"),console.error("Error unassigning all assignees:",ne)}finally{}},ae=async ne=>{try{if(z("update-start"),await b(ne))z("update-completed");else throw new Error("Failed to replace assignees")}catch(pe){z("update-failed"),console.error("Error replacing assignees:",pe)}finally{}},ee=()=>{var ne,pe;i("cancel"),(pe=(ne=s.params)==null?void 0:ne.api)==null||pe.stopEditing()};Jr("popupAttachRef",x);const X=V(),N=V(!1),z=(ne,pe)=>{switch(ne){case"updated":i("updated",pe);break;case"update-start":i("update-start");break;case"update-failed":i("update-failed");break;case"update-completed":i("update-completed");break}};return Qt(()=>{vt(()=>{setTimeout(()=>{N.value=!0},50)})}),(ne,pe)=>(K(),ie("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:X},[ue(na,Wt({"selected-id":H(I)},{...s},{options:H(E),loading:l.value,ref_key:"popupRef",ref:x,"loading-more":c.value,"has-more":h.value,onSelect:pe[0]||(pe[0]=(ve,we)=>{W(ve,we)}),"data-wrapper":"true",onSearch:H(F),onLoadMore:D,onCancel:ee,onClose:ee}),tu({"extra-item":he(({isEmpty:ve,isLoading:we})=>[!ve&&!we?(K(),Ue(_S,{key:0,onClick:Q,actived:!1,label:"Unassign"},{icon:he(()=>[ue(lt,{src:"UserXMark",source:"remote"})]),_:1})):Xe("",!0)]),item:he(({item:ve,selectedIndex:we,isSelected:re,handleItemHover:U,getHighlightedLabel:ge,query:oe,idx:Re,focused:G})=>[ue(wA,{user:ve.data,"multiple-select":!0,"append-to":X.value,isMe:!1,hover:Re===we,selected:re(ve),focused:G,onClick:kt(Y=>W(ve,Y,"click"),["stop","prevent"]),onMouseover:Y=>U(Re),"api-update-function":$},{name:he(()=>[oe?Ke((K(),ie("span",{key:0,class:te([ne.$style["item-label"],ne.$style.match]),style:{flex:"1"},innerHTML:ge(ve.label)},null,10,BZ)),[[H(o),{content:ve.label}]]):Ke((K(),ie("span",{key:1,class:te(ne.$style["item-label"]),style:{flex:"1"}},[Qe(ht(ve.label),1)],2)),[[H(o),{content:ve.label}]])]),actions:he(()=>[Ke((K(),Ue(at,{tabindex:-1,variant:["secondary","icon"],size:"small",label:"",onClick:kt(Y=>{var de;return ae((de=ve.data)==null?void 0:de.id)},["stop"])},{default:he(()=>[ue(lt,{src:"PeopleArrows"})]),_:1},8,["onClick"])),[[H(o),"Unassign others and reassign"]])]),_:2},1032,["user","append-to","hover","selected","focused","onClick","onMouseover"])]),"empty-list":he(()=>[me("div",{class:te(ne.$style["empty-state"])},[pe[3]||(pe[3]=Qe(" No assignee available. ",-1)),pe[4]||(pe[4]=me("br",null,null,-1)),ue(at,{onClick:k,variant:["tertiary"],size:"small"},{default:he(()=>[...pe[2]||(pe[2]=[Qe(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[u.value?{name:"error",fn:he(()=>[me("div",{class:te(ne.$style["error-message"])},[Qe(ht(u.value)+" ",1),ue(at,{onClick:O,size:"small"},{default:he(()=>[...pe[1]||(pe[1]=[Qe(" 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"}}]]),$Z={key:0,class:"inner"},yf=Ct(st({__name:"BulkUpdateBtnWrapper",props:{isUpdating:{type:Boolean,default:!1},disabled:{type:Boolean}},emits:["onVisibleChange"],setup(e,{expose:t,emit:n}){const o=e,s=V(null),{triggerRef:r,popupRef:i,isVisible:a,hide:l,toggle:c,show:u}=yo({toggleOnClick:!0,zIndex:2,disabled:o.disabled,placement:"top",appendTo:s.value||void 0}),d=V(null),h=v=>{v.key==="Escape"&&i.value&&l()},f=ds({isShow:!1,isRender:!1});Qt(()=>{var w;const v=d.value instanceof HTMLElement?d.value:(w=d.value)==null?void 0:w.$el;v&&v.addEventListener("keydown",h)}),qn(()=>{var w;const v=d.value instanceof HTMLElement?d.value:(w=d.value)==null?void 0:w.$el;v&&v.removeEventListener("keydown",h)});const p=n,g=(v,w)=>{f.isShow=v,f.isRender=w};return tt(()=>a.value,(v,w)=>{v&&v!==w&&vt(()=>{g(!0,!0)}),p("onVisibleChange",v,w)}),t({hide:()=>{l(),g(!1,!0)},isVisible:a,open:()=>{u(),g(!0,!0)},destroy(){l(),g(!1,!1)}}),(v,w)=>(K(),ie("div",{class:"bulk-update-btn-wrapper",ref_key:"containerRef",ref:s},[me("div",{class:"trigger-slot",ref_key:"triggerRef",ref:r},[Dt(v.$slots,"trigger",{isVisible:H(a),hide:H(l),disabled:o.isUpdating||o.disabled,popupRef:H(i),triggerRef:H(r),toggle:H(c)},void 0,!0)],512),me("div",{class:"popup-slot",ref_key:"popupRef",ref:i},[f.isRender?Ke((K(),ie("div",$Z,[Dt(v.$slots,"popup",{isVisible:H(a),hide:H(l),popupRef:H(i),triggerRef:H(r),toggle:H(c),open:H(u)},void 0,!0)],512)),[[Ks,!o.isUpdating&&!o.disabled&&f.isShow]]):Xe("",!0)],512)],512))}}),[["__scopeId","data-v-aab33e10"]]),HZ=st({__name:"AssignneeUpdateButton",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},variant:{},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e;Jr("bulkUpdate",!0);const o=V(!1),s=t,r=V(null),i=()=>{o.value=!0,s("update-start"),setTimeout(()=>{var d;(d=l.value)==null||d.hide()},0)},a=d=>{var h,f;o.value=!1,d?(s("update-completed"),(h=l.value)==null||h.destroy()):(s("update-failed"),(f=l.value)==null||f.open())},l=V(null),c=d=>{var h;s("update",d),(h=r.value)==null||h.clearInternal()},u=(d,h)=>{vt(()=>{var f,p;d?(f=r.value)==null||f.focus():(p=r.value)==null||p.clearInternal()})};return tt(()=>n.ids,()=>{vt(()=>{var d;(d=l.value)==null||d.destroy()})}),(d,h)=>(K(),Ue(yf,{ref_key:"wrapperRef",ref:l,isUpdating:o.value,disabled:n.disabled||o.value,onOnVisibleChange:u},{trigger:he(({hide:f,disabled:p})=>[ue(at,{variant:n.variant,loading:o.value,disabled:p,onEscape:f},{default:he(()=>[ue(lt,{src:"UserPlus",class:"icon"}),h[2]||(h[2]=Qe(" Assignee ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:he(({hide:f})=>[ue(bA,Wt({ref_key:"assigneeGroupEditorRef",ref:r},n,{ids:e.ids,onUpdated:c,onUpdateStart:i,onUpdateFailed:h[0]||(h[0]=p=>a(!1)),onUpdateCompleted:h[1]||(h[1]=p=>a(!0)),onCancel:f}),null,16,["ids","onCancel"])]),default:he(()=>[h[3]||(h[3]=Qe(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),wf=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],GZ=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),qa=(e,t)=>{const n=o=>{var s,r;if(o.key==="Tab"){const i=o.shiftKey||o.metaKey;o.preventDefault(),o.stopImmediatePropagation(),o.stopPropagation();const a=document.activeElement,l=(s=a==null?void 0:a.dataset)==null?void 0:s.index;if(l){let c=wf.indexOf(l);const u=i?-1:1;for(const d of wf){c=(c+u+wf.length)%wf.length;const h=wf[c],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(o.key==="Enter")(r=o.target)==null||r.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(o.key==="Escape"){o.stopPropagation(),o.stopImmediatePropagation();const i=document.querySelector('[data-index="calendar-wrapper"]');i==null||i.focus()}};if(GZ.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},UZ=["aria-label"],WZ=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],zZ={style:{flex:"1"}},jZ=Ct(st({__name:"MainCalendar",props:LD({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:LD(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{expose:t,emit:n}){const o=Yt,s=V(null),r=e,i=q(()=>r.startDate&&r.endDate),a=rU(e,"tracingCase"),l=n,c=V(r.year),u=V(r.month);tt(()=>[r.year,r.month],([N,z])=>{c.value=N,u.value=z});const d=q(()=>bt.fromObject({year:c.value,month:u.value,day:1},{zone:r.timezone}).setLocale(r.locale||"en-US").toFormat("LLLL yyyy")),h=q(()=>bt.now().setZone(r.timezone)),f=q(()=>r.startDate?bt.fromJSDate(r.startDate,{zone:r.timezone}):null),p=q(()=>r.endDate?bt.fromJSDate(r.endDate,{zone:r.timezone}):null),g=V(f.value),v=V(p.value),w=V(f.value),S=V(p.value);tt([f,p],()=>{r.requireConfirm||(g.value=f.value,v.value=p.value,w.value=f.value,S.value=p.value)},{immediate:!0});const b=q(()=>r.requireConfirm?g.value:f.value),C=q(()=>r.requireConfirm?v.value:p.value);tt(()=>r.activeField,N=>{const z=N==="start"?b.value:C.value;z&&(c.value=z.year,u.value=z.month)}),tt(()=>{var N,z;return[(N=b.value)==null?void 0:N.toISODate(),(z=C.value)==null?void 0:z.toISODate(),r.activeField]},()=>{const N=r.activeField==="start"?b.value:C.value;N&&(N.year!==c.value||N.month!==u.value)&&(c.value=N.year,u.value=N.month)});function _(N){return N.setZone("utc")}const E=V("");function I(N){E.value=N.toISODate()||"",vt(()=>{const z=document.querySelector(`.arbo-calendar-day[data-date="${E.value}"]`);z==null||z.focus()})}tt(()=>{var N,z;return[c.value,u.value,r.activeField,(N=b.value)==null?void 0:N.toISODate(),(z=C.value)==null?void 0:z.toISODate()]},()=>{const N=r.activeField==="start"?b.value:C.value;let z;N&&N.year===c.value&&N.month===u.value?z=N:b.value&&b.value.year===c.value&&b.value.month===u.value?z=b.value:z=h.value,I(z)});function T(N){return N.toFormat("d")}const P=q(()=>{const N=bt.fromObject({year:c.value,month:u.value,day:1},{zone:r.timezone}),z=N.weekday,ne=r.weekStart===1?(z+6)%7:z%7;let pe=N.minus({days:ne});const ve=[],we=xu.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"}),re=Og();for(let ge=0;ge<42;ge++){const oe=[];pe.month!==u.value&&oe.push(re["is-outside"]),pe.hasSame(h.value,"day")&&oe.push(re["is-today"]),b.value&&pe.hasSame(b.value,"day")&&oe.push(re["is-selected-start"]),C.value&&pe.hasSame(C.value,"day")&&oe.push(re["is-selected-end"]),b.value&&C.value&&pe>b.value&&pe<C.value&&oe.push(re["is-in-range"]);const Re=T(pe),G=we[pe.weekday-1]||"";ve.push({dt:pe,iso:pe.toISODate()||"",label:pe.toFormat("d"),displayLabel:Re,weekdayLabel:G,aria:pe.setLocale(r.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:oe}),pe=pe.plus({days:1})}const U=[];for(let ge=0;ge<6;ge++)U.push(ve.slice(ge*7,ge*7+7));return U}),M=q(()=>{const N=xu.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"});return r.weekStart===1?N:[N[6],...N.slice(0,6)]});function D(N,z,ne){const pe=N==="start"?z.startOf("day"):z.endOf("day"),ve=_(pe),we={year:pe.year,month:pe.month,day:pe.day,utc:ve.toISO()||""};N==="start"?(l("select-start",we,ne??!0),l("select-start-utc",we.utc)):(l("select-end",we),l("select-end-utc",we.utc))}function F(N){let z=c.value,ne=u.value+N;for(;ne<1;)ne+=12,z-=1;for(;ne>12;)ne-=12,z+=1;c.value=z,u.value=ne,l("update:year",z),l("update:month",ne)}function O(N){const ne=(E.value?bt.fromISO(E.value,{zone:r.timezone}):h.value).plus({days:N});ne.month===u.value&&ne.year===c.value&&I(ne)}function k(N=!1){const ne=(E.value?bt.fromISO(E.value,{zone:r.timezone}):h.value).weekday%7,pe=N?6-ne:-ne;O(pe)}const x=N=>{$(N)};function $(N){switch(N.preventDefault(),N.stopPropagation(),N.key){case"ArrowLeft":N.preventDefault(),O(-1);break;case"ArrowRight":N.preventDefault(),O(1);break;case"ArrowUp":N.preventDefault(),O(-7);break;case"ArrowDown":N.preventDefault(),O(7);break;case"Home":N.preventDefault(),k(!1);break;case"End":N.preventDefault(),k(!0);break;case"PageUp":N.preventDefault(),F(N.shiftKey?-12:-1);break;case"PageDown":N.preventDefault(),F(N.shiftKey?12:1);break;case"Enter":case" ":{N.preventDefault();const z=E.value?bt.fromISO(E.value,{zone:r.timezone}):h.value,ne=P.value.flat().find(pe=>pe.iso===z.toISODate());ne&&Q(ne);break}}}const W=N=>{const z=bt.now().setZone(r.timezone);c.value=z.year,u.value=z.month,l("update:year",z.year),l("update:month",z.month),I(z),l("gotoToday")};function Q(N){var de,ke;const z=!!f.value,ne=!!p.value,pe=r.activeField,ve=((de=f.value)==null?void 0:de.toISODate())||"null",we=((ke=p.value)==null?void 0:ke.toISODate())||"null",re=N.dt.toISODate()||"",U=(xe,Ve)=>{a.value={case:xe,behavior:Ve}},ge=()=>`Selected start ${re} > existing end ${we} -> reset both to ${re}`,oe=()=>`Selected end ${re} < existing start ${ve} -> reset both to ${re}`,Re=()=>{D("start",N.dt,!0),D("end",N.dt),l("update:activeField","end")},G=(xe=!1)=>{D("start",N.dt,xe),xe&&l("update:activeField","end")},Y=(xe=!1)=>{D("end",N.dt),xe&&l("close")};if(z&&ne){pe==="start"?p.value&&N.dt>p.value?(Re(),U("INVERT_RANGE_FROM_START",ge())):(G(!1),U("UPDATE_START_IN_RANGE",`Updated start from ${ve} to ${re}; end remains ${we}`)):f.value&&N.dt<f.value?(Re(),U("INVERT_RANGE_FROM_END",oe())):(Y(!1),U("UPDATE_END_IN_RANGE",`Updated end from ${we} to ${re}; start remains ${ve}`));return}if(!z&&ne&&pe==="start"&&p.value&&N.dt>p.value){Re(),U("CREATE_RANGE_FROM_LATE_START",ge());return}if(z&&!ne&&pe==="end"&&f.value&&N.dt<f.value){Re(),U("CREATE_RANGE_FROM_EARLY_END",oe());return}if(!z&&!ne){if(pe==="start"){G(!0),U("INIT_START",`Picked start ${re}; awaiting end selection`);return}Y(r.immediatelyUpdate),U("INIT_END",`Picked end ${re}; awaiting start selection`);return}if(!z&&ne){if(pe==="start"){G(!0),U("FILL_MISSING_START",`Inserted start ${re}; existing end ${we}`);return}Y(!1),U("STRICT_UPDATE_END_ONLY",`Updated end to ${re}; start still null`);return}if(z&&!ne){if(pe==="start"){G(!0),U("RESELECT_START_BEFORE_END",`Replaced start with ${re}; end still null, switching to end`);return}Y(r.immediatelyUpdate),U("FILL_MISSING_END",`Picked end ${re}; start ${ve}`);return}}function ae(){w.value=g.value,S.value=v.value,l("confirm")}function ee(){g.value=w.value,v.value=S.value,l("cancel")}function X(){vt(()=>{var N;(N=s.value)==null||N.focus()})}return Qt(()=>{X()}),t({focus:X}),(N,z)=>(K(),ie("div",{ref_key:"calendarRef",ref:s,class:te([N.$style["arbo-calendar"],{[N.$style["arbo-date-range-picker"]]:i.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[me("div",{class:te([N.$style["arbo-calendar-header"],N.$style["arbo-calendar-week"]]),role:"row"},[(K(!0),ie(It,null,Fn(M.value,ne=>(K(),ie("div",{key:ne,class:te(N.$style["arbo-calendar-weekday"]),role:"columnheader"},ht(ne),3))),128))],2),me("div",{class:te(N.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:z[0]||(z[0]=kt(ne=>H(qa)(ne,x),["prevent","stop"]))},[(K(!0),ie(It,null,Fn(P.value,(ne,pe)=>(K(),ie("div",{key:pe,class:te(N.$style["arbo-calendar-week"])},[(K(!0),ie(It,null,Fn(ne,ve=>(K(),ie("div",{key:ve.iso,class:te([N.$style["arbo-calendar-day"],ve.classes,{[N.$style["is-focused"]]:ve.iso===E.value}]),disabled:r.disabled,readOnly:r.readOnly,"aria-label":ve.aria,"data-date":ve.iso,"data-weekday":ve.weekdayLabel,tabindex:ve.iso===E.value?0:-1,onClick:we=>Q(ve)},ht(ve.displayLabel),11,WZ))),128))],2))),128))],34),r.readOnly?Xe("",!0):(K(),ie("div",{key:0,class:te(N.$style["arbo-calendar-actions"])},[me("div",zZ,[Ke((K(),Ue(at,{variant:"secondary",size:"medium",onClick:z[1]||(z[1]=ne=>W()),onKeydown:H(qa),"data-index":"today-btn"},{prefix:he(()=>[ue(lt,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[H(o),"Today"]])]),ue(at,{disabled:r.disabled,readOnly:r.readOnly,onKeydown:H(qa),variant:"secondary",size:"medium",onClick:ee,"data-index":"cancel-btn"},{default:he(()=>[Qe(ht(r.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),ue(at,{disabled:r.disabled||r.disableConfirm,readOnly:r.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:H(qa),onClick:ae},{default:he(()=>[Qe(ht(r.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,UZ))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_99b61_1","arbo-calendar-day":"_arbo-calendar-day_99b61_2","arbo-calendar-week":"_arbo-calendar-week_99b61_3","arbo-calendar":"_arbo-calendar_99b61_2","arbo-calendar-nav":"_arbo-calendar-nav_99b61_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_99b61_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_99b61_53","arbo-calendar-weekday":"_arbo-calendar-weekday_99b61_58","arbo-calendar-weeks":"_arbo-calendar-weeks_99b61_63","is-today":"_is-today_99b61_92","is-selected-start":"_is-selected-start_99b61_97","is-selected-end":"_is-selected-end_99b61_105","is-outside":"_is-outside_99b61_125","is-focused":"_is-focused_99b61_128","is-in-range":"_is-in-range_99b61_133","arbo-calendar-actions":"_arbo-calendar-actions_99b61_139","arbo-calendar-btn":"_arbo-calendar-btn_99b61_147",cancel:"_cancel_99b61_156",confirm:"_confirm_99b61_161"}}]]),KZ=["onClick"],qZ=["variant","onClick"],YZ=Ct(st({__name:"CalendarNavigationControl",props:{year:{},month:{},minYear:{default:1970},maxYear:{default:2100},yearSpan:{default:12},monthLabels:{},locale:{default:"en-US"},monthLabelStyle:{default:"short"},ariaPrevLabel:{default:"Previous"},ariaNextLabel:{default:"Next"},ariaToolbarLabel:{default:"Calendar navigation"},ariaSelectYearLabel:{default:"Select year"},ariaSelectMonthLabel:{default:"Select month"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["update:year","update:month","mode-change","year-selected","month-selected"],setup(e,{expose:t,emit:n}){const o=e,s=q(()=>{if(o.monthLabels&&o.monthLabels.length===12)return o.monthLabels;const O=o.locale||"en-US",k=o.monthLabelStyle||"short",x=new Intl.DateTimeFormat(O,{month:k,timeZone:"UTC"});return Array.from({length:12},(W,Q)=>x.format(new Date(Date.UTC(2020,Q,1))))}),r=n,i=V(o.year),a=V(o.month),l=V(o.year);tt(()=>o.year,O=>{O!==i.value&&(i.value=O,l.value=O)}),tt(()=>o.month,O=>{O!==a.value&&(a.value=O)});const c=V("days");function u(O){c.value!==O&&(c.value=O,r("mode-change",O))}const d=q(()=>o.minYear),h=q(()=>o.maxYear),f=q(()=>{const O=o.yearSpan;return l.value-l.value%O}),p=q(()=>f.value+o.yearSpan-1);function g(){const O=o.yearSpan,k=f.value-O;k>=d.value&&(l.value=k)}function v(){const O=o.yearSpan,k=f.value+O;k<=h.value&&(l.value=k)}const w=q(()=>f.value-o.yearSpan<d.value),S=q(()=>p.value+o.yearSpan>h.value),b=q(()=>{const O=o.yearSpan;return Math.ceil(O/3)});function C(O){const x=f.value+(O-1)*3;return Array.from({length:3},($,W)=>x+W).filter($=>$<=p.value)}function _(){c.value==="months"?u("days"):u("months")}function E(){c.value==="years"?u("days"):u("years")}function I(O){i.value=O,l.value=O,r("update:year",O),r("year-selected",O),u("months")}function T(O){a.value=O,r("update:month",O),r("month-selected",O),u("days")}function P(){if(c.value==="days"){let O=i.value,k=a.value-1;if(k<1&&(k=12,O--),O<d.value)return;i.value=O,a.value=k,r("update:year",O),r("update:month",k)}else if(c.value==="months"){if(i.value-1<d.value)return;i.value--,r("update:year",i.value)}else c.value==="years"&&g()}function M(){if(c.value==="days"){let O=i.value,k=a.value+1;if(k>12&&(k=1,O++),O>h.value)return;i.value=O,a.value=k,r("update:year",O),r("update:month",k)}else if(c.value==="months"){if(i.value+1>h.value)return;i.value++,r("update:year",i.value)}else c.value==="years"&&v()}const D=q(()=>c.value==="days"?i.value===d.value&&a.value===1:c.value==="months"?i.value-1<d.value:w.value),F=q(()=>c.value==="days"?i.value===h.value&&a.value===12:c.value==="months"?i.value+1>h.value:S.value);return t({setNavigation:(O,k)=>{i.value=O,a.value=k}}),(O,k)=>(K(),ie("div",{class:te([O.$style["cal-nav-wrapper"]])},[Dt(O.$slots,"selection"),c.value==="days"?(K(),ie("div",{key:0,class:te(O.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[ue(at,{variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.prev]),"aria-label":"Previous",disabled:D.value,label:"",onClick:P,"data-index":"prev-btn",onKeydownCapture:jn(kt(P,["prevent","stop"]),["enter"]),onKeydown:H(qa)},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),me("div",{class:te(O.$style["cal-nav-center"])},[ue(at,{"data-index":"month-btn",variant:"secondary",onClick:_,onKeydown:H(qa)},{default:he(()=>[Qe(ht(s.value[a.value-1]),1)]),_:1},8,["onKeydown"]),ue(at,{variant:"secondary",onClick:E,"data-index":"year-btn",onKeydown:H(qa)},{default:he(()=>[Qe(ht(i.value),1)]),_:1},8,["onKeydown"])],2),ue(at,{"data-index":"next-btn",variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.next]),"aria-label":"Next",disabled:F.value,label:"",onClick:M,onKeydownCapture:jn(kt(M,["prevent","stop"]),["enter"]),onKeydown:H(qa)},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Xe("",!0),c.value==="years"?(K(),ie("div",{key:1,class:te(O.$style["year-grid"])},[me("div",{class:te(O.$style["year-grid-header"])},[ue(at,{variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.prev]),"aria-label":"Next",disabled:w.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),me("div",{class:te(O.$style["range-label"])},ht(f.value)+" - "+ht(p.value),3),ue(at,{variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.next]),"aria-label":"Next",disabled:S.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),me("div",{class:te(O.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(K(!0),ie(It,null,Fn(b.value,x=>(K(),ie("div",{key:"yr-row-"+x,class:te(O.$style["year-grid-row"])},[(K(!0),ie(It,null,Fn(C(x),$=>(K(),ie("a",{key:$,tabindex:"0",class:te([O.$style["year-cell"],{[O.$style.selected]:$===i.value}]),onClick:W=>I($)},ht($),11,KZ))),128))],2))),128))],2)],2)):c.value==="months"?(K(),ie("div",{key:2,class:te(O.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[me("div",{class:te(O.$style.months)},[(K(!0),ie(It,null,Fn(s.value,(x,$)=>(K(),ie("a",{tabindex:"0",key:x,variant:$+1===a.value?"primary":"text",class:te([O.$style["month-cell"],{[O.$style.selected]:$+1===a.value}]),onClick:W=>T($+1)},ht(x),11,qZ))),128))],2)],2)):(K(),ie("div",{key:3,class:te(O.$style["days-slot"])},[Dt(O.$slots,"default",{year:i.value,month:a.value,mode:c.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_mtd4w_1","cal-nav-bar":"_cal-nav-bar_mtd4w_12","cal-nav-btn":"_cal-nav-btn_mtd4w_20",prev:"_prev_mtd4w_33","year-grid-header":"_year-grid-header_mtd4w_37","cal-nav-center":"_cal-nav-center_mtd4w_46","cal-nav-label":"_cal-nav-label_mtd4w_52","month-grid":"_month-grid_mtd4w_66","year-grid":"_year-grid_mtd4w_37",months:"_months_mtd4w_75","month-cell":"_month-cell_mtd4w_82","year-cell":"_year-cell_mtd4w_83","pg-btn":"_pg-btn_mtd4w_105","year-grid-body":"_year-grid-body_mtd4w_118","year-grid-row":"_year-grid-row_mtd4w_125",selected:"_selected_mtd4w_131","days-slot":"_days-slot_mtd4w_137","range-label":"_range-label_mtd4w_141"}}]]);function ZZ(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:o,maxDate:s}=e,r=V(""),i=q(()=>{const g=bt.fromFormat(r.value,t,{zone:n});return g.isValid?g:null}),a=q(()=>{if(!o||!i.value)return!0;const g={year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()},v={year:i.value.year,month:i.value.month,day:i.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 w=new Date(g.year,g.month-1,g.day),S=new Date(v.year,v.month-1,v.day);return w<S?-1:w>S?1:0},c=q(()=>{if(!s||!i.value)return!0;const g={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate()},v={year:i.value.year,month:i.value.month,day:i.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=q(()=>r.value.length==0||r.value.length>0&&i.value!==null&&a.value&&c.value),d=q(()=>r.value.length===t.length&&u.value);return{inputValue:r,isValid:u,isComplete:d,clear:()=>{r.value=""},setDate:g=>{let v;g instanceof Date?v=bt.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?r.value=v.toFormat(t):r.value=""},getDate:()=>u.value?i.value:null}}const XZ={key:0,style:{marginLeft:"8px"}},JZ=["disabled","readonly","placeholder"],SA=Ct(st({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear","blur","tab"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=n,i=V(null),a=V(null),{isValid:l,isComplete:c,inputValue:u,clear:d,setDate:h,getDate:f}=ZZ({format:s.format,allowPastDates:s.allowPastDates,allowFutureDates:s.allowFutureDates,timezone:s.timezone,minDate:s.minDate,maxDate:s.maxDate}),p=q(()=>s.active),g=q(()=>({disabled:s.disabled,error:!l.value&&u.value.length>0,readOnly:s.readOnly,isEmpty:u.value.length===0,inputRef:i,wrapperRef:a,active:p})),{argsMain:v,isHover:w,isFocus:S}=Co(g),b=T=>{var M;const P=(M=T.clipboardData)==null?void 0:M.getData("text/plain");P&&(u.value=P.trim())},C=T=>{if(T.key==="Escape"){r("blur"),T.target.blur(),T.preventDefault(),T.stopPropagation(),T.stopImmediatePropagation();return}else T.key==="Tab"&&I(T)},_=()=>{d(),r("clear")};t({clear:_,setDate:h,getDate:f,focus:()=>{var T;return(T=i.value)==null?void 0:T.focus()}}),tt(()=>s.modelValue,T=>{T?h(T):d()},{immediate:!0}),tt([()=>c.value,()=>u.value],()=>{if(u.value.length===0)r("complete",null);else if(l.value&&!s.readOnly&&!s.disabled&&c.value){const T=f();(T||u.value.length===0)&&r("complete",T)}}),tt(()=>l.value,T=>{T||r("invalid","")});const E=q(()=>!!s.isMultipleDate),I=T=>{T.preventDefault(),T.stopImmediatePropagation(),T.stopPropagation(),r("tab",T)};return(T,P)=>(K(),Ue(_o,Wt(H(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:he(()=>[me("div",{class:te([T.$style["date-input-wrapper"]])},[E.value?(K(),ie("span",XZ," Multiple ")):Ke((K(),ie("input",{key:1,disabled:s.disabled,readonly:s.readOnly,ref_key:"inputRef",ref:i,type:"text","onUpdate:modelValue":P[0]||(P[0]=M=>mn(u)?u.value=M:null),onPaste:kt(b,["prevent"]),placeholder:s.placeholder,class:te([T.$style["date-input"]]),onKeydown:C},null,42,JZ)),[[QT,H(u)]]),Dt(T.$slots,"clear",{handleClear:_},()=>[(H(u).length>0||E.value)&&!s.readOnly&&!s.disabled&&(H(w)||H(S))?Ke((K(),Ue(at,{key:0,variant:["icon","primary"],onClick:kt(_,["stop"]),size:16,rounded:!0},{default:he(()=>[ue(lt,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[H(o),"Clear"]]):(K(),Ue(lt,{key:1,src:"Calendar",source:"remote",class:te(T.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_132fk_1","icon-calendar":"_icon-calendar_132fk_9",focus:"_focus_132fk_12",hover:"_hover_132fk_12",active:"_active_132fk_12","date-input":"_date-input_132fk_1",invalid:"_invalid_132fk_38"}}]]),QZ=st({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:Hb()},format:{default:"LLL dd"},placeholder:{},enableRangeFeedback:{type:Boolean},messages:{},isCompleted:{type:Boolean},isStarted:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{},duePlaceholder:{default:"Due"},startPlaceholder:{default:"Start"},startTooltip:{default:"Select start date"},dueTooltip:{default:"Select due date"},showCalendarIcon:{type:Boolean,default:!0},locale:{default:"en-US"},immediatelyUpdate:{type:Boolean,default:!1},multipleStartDates:{type:Boolean},multipleDueDates:{type:Boolean}},emits:["clearStart","clearDue","clearAll","update","update:start","update:end","range:invalid","range:corrected","tracing","confirmed","closed","start-update","finish-update","tab"],setup(e,{expose:t,emit:n}){const o=V({case:"",behavior:""}),s=e,r=V(null),i=n,a=async(U,ge)=>{i("start-update"),await U(),i("finish-update"),vt(()=>{var oe,Re;ge(),(Re=(oe=s.params)==null?void 0:oe.api)==null||Re.stopEditing()})},l=(U,ge)=>{U(),vt(()=>{var oe,Re;ge(),(Re=(oe=s.params)==null?void 0:oe.api)==null||Re.stopEditing()})},c=()=>{var ge;const U=bt.now().setZone(s.timezone);z.value=U.year,ne.value=U.month,(ge=N.value)==null||ge.setNavigation(U.year,U.month)},u=ds({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:w,beginInteraction:S,clearStart:b,clearDue:C}=L7(s,i),_=q(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});tt(()=>s.multipleStartDates,U=>{h.value=!!U},{immediate:!0}),tt(()=>s.multipleDueDates,U=>{f.value=!!U},{immediate:!0});const E=V(null),I=V(null),T=U=>{U.preventDefault(),U.stopImmediatePropagation(),U.stopPropagation(),ae()},P=()=>{var U;(U=I.value)==null||U.focus()},M=U=>{if(!U){u.start=!1,b();return}const ge=d.endDate?bt.fromJSDate(d.endDate,{zone:s.timezone}):null;if(ge&&D(U,ge)>0){const Re={year:U.year,month:U.month,day:U.day};u.start=!1,w(Re,!1),p(Re),vt(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const oe={year:U.year,month:U.month,day:U.day};u.start=!1,w(oe,!0)},D=(U,ge)=>{const oe=U.startOf("day"),Re=ge.startOf("day");return oe<Re?-1:oe>Re?1:0},F=U=>{var ge;U.preventDefault(),U.stopImmediatePropagation(),U.stopPropagation(),(ge=document.querySelector('[data-index="prev-btn"]'))==null||ge.focus()},O=U=>{if(!U){u.end=!1,C();return}const ge=d.startDate?bt.fromJSDate(d.startDate,{zone:s.timezone}):null;if(ge&&D(U,ge)<0){const Re={year:U.year,month:U.month,day:U.day};u.end=!1,w(Re),p(Re),vt(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const oe={year:U.year,month:U.month,day:U.day};u.end=!1,p(oe)},k=()=>{h.value=!1,b()},x=()=>{f.value=!1,C()},$=()=>{ee()},W=q(()=>d.isSelectingStart||d.isSelectingEnd);function Q(){s.disabled||s.readOnly||(S(),d.isSelectingStart=!0,d.isSelectingEnd=!1,vt(()=>{var U;(U=r.value)==null||U.focus()}))}function ae(){s.disabled||s.readOnly||(S(),d.isSelectingEnd=!0,d.isSelectingStart=!1,vt(()=>{var U;(U=E.value)==null||U.focus()}))}function ee(){d.isSelectingStart=!1,d.isSelectingEnd=!1,i("closed")}function X(U){U.key==="Escape"?(U.stopPropagation(),ee()):U.key=="Tab"&&i("tab",U)}const N=V(null),z=V(new Date().getFullYear()),ne=V(new Date().getMonth()+1);tt(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(z.value=d.startDate.getFullYear(),ne.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(z.value=d.endDate.getFullYear(),ne.value=d.endDate.getMonth()+1)},{immediate:!0});const pe=V(null);function ve(){if(Array.isArray(s.value)){const[ge,oe]=s.value;d.startDate=ge||null,d.endDate=oe||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const U=d.startDate||d.endDate||new Date;z.value=U.getFullYear(),ne.value=U.getMonth()+1}tt(()=>{var U,ge,oe,Re,G,Y,de,ke;return[((oe=(ge=(U=s.value)==null?void 0:U[0])==null?void 0:ge.getTime)==null?void 0:oe.call(ge))||((Re=s.value)==null?void 0:Re[0]),((de=(Y=(G=s.value)==null?void 0:G[1])==null?void 0:Y.getTime)==null?void 0:de.call(Y))||((ke=s.value)==null?void 0:ke[1]),s.timezone,s.format,s.placeholder,s.enableRangeFeedback]},()=>{ve()},{immediate:!0,deep:!0}),t({resetCalendarLogic:ve,openStart:Q,openEnd:ae,closePicker:ee,clearAll:$,isOpen:W,drpRef:pe,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?Q():ae():Q()}});const re=V(null);return tt(()=>W.value,U=>{if(s.disabled||s.readOnly)return;const ge=re.value;ge&&(U?ge.show():ge.hide())},{immediate:!0}),(U,ge)=>(K(),ie("div",{class:te(U.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:I,onKeydown:X,tabindex:"1","data-index":"calendar-wrapper"},[ue(YZ,{year:z.value,"onUpdate:year":ge[6]||(ge[6]=oe=>z.value=oe),month:ne.value,"onUpdate:month":ge[7]||(ge[7]=oe=>ne.value=oe),locale:s.locale,disabled:s.disabled,readOnly:s.readOnly,ref_key:"navigationRef",ref:N},{selection:he(()=>[me("div",{class:te(U.$style["calendar-input-section"])},[ue(SA,{ref_key:"starDateRef",ref:r,"model-value":H(d).startDate,placeholder:s.startPlaceholder,timezone:s.timezone,active:H(d).isSelectingStart,onClick:Q,onClear:k,onComplete:M,onInvalid:ge[0]||(ge[0]=oe=>u.start=!0),disabled:s.disabled,readOnly:s.readOnly,onBlur:P,onTab:T},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),ue(SA,{ref_key:"endDateRef",ref:E,"model-value":H(d).endDate,placeholder:s.duePlaceholder,timezone:s.timezone,active:H(d).isSelectingEnd,onClick:ae,onClear:x,disabled:s.disabled,onComplete:O,onInvalid:ge[1]||(ge[1]=oe=>u.end=!0),readOnly:s.readOnly,isMultipleDate:H(f),onTab:F},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:he(({year:oe,month:Re})=>[ue(jZ,{disabled:s.disabled,disableConfirm:u.end||u.start,readOnly:s.readOnly,ref_key:"drpRef",ref:pe,"tracing-case":o.value,"onUpdate:tracingCase":ge[2]||(ge[2]=G=>o.value=G),year:oe,month:Re,"start-date":H(d).startDate,"end-date":H(d).endDate,"active-field":_.value,timezone:s.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:H(w),onSelectEnd:H(p),onGotoToday:c,onConfirm:ge[3]||(ge[3]=()=>{a(H(v),ee)}),onCancel:ge[4]||(ge[4]=G=>l(H(g),ee)),onClose:ge[5]||(ge[5]=G=>a(H(v),ee))},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))}}),Ym=Ct(QZ,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_139py_1","calendar-input-section":"_calendar-input-section_139py_11","display-wrapper":"_display-wrapper_139py_19","calendar-actions":"_calendar-actions_139py_23","clear-all-btn":"_clear-all-btn_139py_29"}}]]),eX=st({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=t,o=e,s=yn("isSelectAll",V(!1)),r=yn("bulkUpdate",V(!1)),i=q(()=>!!o.entityId&&r.value&&s.value),{apiServices:a}=Zn(!r.value,o),l=yn("filterParams",null),c=V(null),u=async T=>{var P,M,D,F;try{C.value=!0,n("update-start");let O={workspaceId:o.workspaceId,entityId:o.entityId,itemIds:o.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in T&&(O.startDate=T.start?km(T.start):null),"end"in T&&(O.dueDate=T.end?km(T.end):null),i.value?(O.itemIds=void 0,O.entityId=o.entityId):O.entityId=void 0,await((M=(P=a.value)==null?void 0:P.changeDate)==null?void 0:M.call(P,O)),n("updated",{workspaceId:o.workspaceId,itemIds:o.ids,data:O}),n("update-completed"),(D=c.value)==null||D.hide()}catch(O){console.error("Failed to update dates:",O),vt(()=>{vt(()=>{var k;n("update-failed"),(k=c.value)==null||k.open()})})}finally{(F=S.value)==null||F.resetCalendarLogic(),C.value=!1}},d=()=>{if(!o.rowSelected||o.rowSelected.length===0){h();return}o.rowSelected.length===1?f():p()},h=()=>{w.value=!1,v.value=!1,b.value=[null,null]},f=()=>{const P=o.rowSelected[0].dateRange;b.value=[(P==null?void 0:P[0])??null,(P==null?void 0:P[1])??null],w.value=!1,v.value=!1},p=()=>{var P,M;if(o.rowSelected.some(D=>D.dateRange&&(D.dateRange[0]!==null||D.dateRange[1]!==null))){const D=g(0),F=g(1);if(v.value=D,w.value=F,D)b.value[0]=null;else{const O=((P=o.rowSelected[0].dateRange)==null?void 0:P[0])??null;b.value[0]=O}if(F)b.value[1]=null;else{const O=((M=o.rowSelected[0].dateRange)==null?void 0:M[1])??null;b.value[1]=O}}else v.value=!1,w.value=!1,b.value=[null,null]},g=T=>{const P=o.rowSelected.map(D=>{var F;return(F=D.dateRange)==null?void 0:F[T]});return P.length===0?!1:new Set(P.map(D=>{var F;return(F=D==null?void 0:D.getTime)==null?void 0:F.call(D)})).size>1},v=V(!1),w=V(!1),S=V(null),b=V([null,null]);tt([()=>o.ids,()=>o.rowSelected],T=>{d(),vt(()=>{var P;(P=S.value)==null||P.focus()})},{immediate:!0,deep:!0});const C=V(!1),_=()=>{C.value=!0},E=()=>{vt(()=>{setTimeout(()=>{C.value=!1},500)})},I=(T,P)=>{T&&vt(()=>{var M;(M=S.value)==null||M.focus()})};return(T,P)=>(K(),Ue(yf,{ref_key:"wrapperRef",ref:c,isUpdating:C.value,disabled:o.disabled||C.value,onOnVisibleChange:I},{trigger:he(({hide:M,disabled:D})=>[ue(at,{variant:o.variant,loading:C.value,disabled:D,onEscape:M},{default:he(()=>[ue(lt,{src:"Calendar"}),P[0]||(P[0]=Qe(" Date ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:he(({isVisible:M,hide:D})=>[M?(K(),Ue(Ym,{key:0,immediatelyUpdate:!1,value:b.value,onConfirmed:u,ref_key:"calendarRef",ref:S,onClosed:D,onStartUpdate:_,onFinishUpdate:E,multipleDueDates:w.value,multipleStartDates:v.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):Xe("",!0)]),default:he(()=>[P[1]||(P[1]=Qe(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),tX=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"},EA=rc("metricStore",()=>{const e=V();return{metricList:e,setMetricList:o=>{e.value=o},checkEditType:o=>{var s;if(((s=o==null?void 0:o.auth_permission)==null?void 0:s.permission)==2)return tX(o)}}}),nX=["onKeydown"],oX=["width","height","viewBox"],sX=["d"],rX="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=st({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change","handleEnter","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=V(o.modelValue??0),i=V(null),a=q(()=>{var D;return((D=o.params)==null?void 0:D.size)??24}),l=q(()=>{var D;return((D=o.params)==null?void 0:D.iconViewBox)??"0 0 24 24"}),c=q(()=>{var D;return((D=o.params)==null?void 0:D.iconPath)??rX}),u=q(()=>{var D;return((D=o.params)==null?void 0:D.wrapperTag)??"span"}),d=q(()=>{var D;return o.disabled||((D=o.params)==null?void 0:D.disabled)||!1}),h=q(()=>{var D;return o.readOnly||((D=o.params)==null?void 0:D.readOnly)||!1}),f=q(()=>!d.value&&!h.value),p=q(()=>d.value?"not-allowed":h.value?"default":"pointer");tt(()=>o.modelValue,D=>{typeof D=="number"&&D!==r.value&&(r.value=D)});const g=D=>{var F;return((F=o.params)==null?void 0:F.maxRating)-D+1<=r.value&&!v.value},v=V(!1),w=()=>{v.value=!0},S=()=>{v.value=!1},b=D=>{f.value&&C(D)},C=D=>{var O,k;if(!f.value)return;let F=((O=o.params)==null?void 0:O.maxRating)-D+1;F===r.value&&(F=0),r.value=F,s("update:modelValue",F),s("update",F),s("change",F),(k=o.params)!=null&&k.onUpdate&&o.params.onUpdate(F)},_=D=>{var F;D!==r.value&&(r.value=D,s("update:modelValue",D),s("update",D),s("change",D),(F=o.params)!=null&&F.onUpdate&&o.params.onUpdate(D),E.value=D)},E=V(r.value),I=D=>{D.preventDefault(),D.stopPropagation(),D.stopImmediatePropagation(),r.value=E.value,s("cancel")},T=D=>{D.preventDefault(),_(r.value),s("handleEnter",r.value)},P=()=>{f.value&&(r.value=Math.min(r.value+1%(o.params.maxRating+1),o.params.maxRating),_(r.value))},M=()=>{f.value&&(r.value=Math.max(r.value-1,0),_(r.value))};return t({focus:()=>{var D;(D=i.value)==null||D.focus()}}),(D,F)=>(K(),ie("div",{class:te(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:cn({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:i,tabindex:"1",onKeydown:[jn(kt(M,["prevent"]),["left"]),jn(kt(P,["prevent"]),["right"]),jn(kt(M,["prevent"]),["down"]),jn(kt(P,["prevent"]),["up"]),jn(kt(T,["prevent"]),["enter"]),jn(kt(T,["prevent"]),["tab"]),jn(kt(I,["prevent"]),["escape"])]},[(K(!0),ie(It,null,Fn(e.params.maxRating,O=>(K(),Ue($w(u.value),{key:O,class:te(["rating-item",{filled:g(O),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:cn({cursor:p.value,order:e.params.maxRating-O,height:a.value+"px",width:a.value+"px"}),"aria-checked":g(O),"aria-disabled":d.value,"aria-readOnly":h.value,title:e.params.maxRating-O+1,tabindex:-1,onClick:kt(k=>b(O),["prevent","stop"]),onMouseenter:w,onMouseleave:S},{default:he(()=>[Dt(D.$slots,"icon",{index:O,filled:g(O),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value,value:O},()=>[(K(),ie("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[me("path",{d:c.value},null,8,sX)],8,oX))]),Dt(D.$slots,"overlay",{index:O,filled:g(O),disabled:d.value,readOnly:h.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,nX))}}),iX={style:{maxWidth:"180px",lineHeight:"15px"}},aX=["innerHTML"],RA=st({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=n,i=()=>{r("handleCancel")},a=()=>{r("close")},l=v=>{var w;if(v.format_type==="dropdown"&&v.format_value)try{const S=JSON.parse(v.format_value);if(Array.isArray(S)){const b=S.map(C=>({label:C.name,value:C.name,id:C.name}));return b.unshift({label:"-",value:void 0,id:"-"}),b}}catch(S){console.error("Failed to parse dropdown options",S)}if(v.format_type=="number"&&v.restricted_type=="exact"){const S=((w=v.restricted_value)==null?void 0:w.split(",").map(b=>({label:v.mapping[`!${b}`]||b,value:b,id:b})))||[];return S.unshift({label:"-",value:void 0,id:"-"}),S}return[]},c=q(()=>l(s.config)),u=V(s.modelValue),d=v=>{u.value=v,r("update:modelValue",v),r("change",v||null)},h=V(c.value),f=V(!1),p=v=>{f.value=!0,v?h.value=c.value.filter(w=>w.label.toLowerCase().includes(v.toLowerCase())):h.value=c.value,setTimeout(()=>{f.value=!1},300)},g=V(null);return Qt(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,w)=>(K(),Ue(na,{style:{width:326},loading:f.value,options:h.value,"selected-id":e.modelValue||void 0,onSearch:p,onSelect:w[0]||(w[0]=S=>d(S.id)),ref_key:"searchListRef",ref:g,onClose:a,onCancel:i},{item:he(({item:S,getHighlightedLabel:b,selectedIndex:C,index:_})=>[ue(ic,{hover:C==_,selected:S.value===e.modelValue,label:S.label,onSelect:E=>d(S.value||null),onClick:E=>d(S.value||null)},{label:he(()=>[me("div",iX,[Ke(me("span",{innerHTML:b(S.label)},null,8,aX),[[H(o),{content:S.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":he(()=>[...w[1]||(w[1]=[Qe("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),lX={class:"metric-input-wrapper"},cX={key:0,class:"error-text input-2"},DA=st({__name:"MetricEditorInput",props:{config:{},modelValue:{},saveOnBlur:{type:Boolean,default:!0},saveOnEscape:{type:Boolean,default:!1},showInlineError:{type:Boolean,default:!1}},emits:["update:modelValue","handleChange","cancel","enter","onValidation"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=V(s.modelValue),i=V(s.modelValue),a=V(!1),l=V(!0),c=V(""),u=q(()=>{var x;const k=Number.parseInt(String((x=s.config)==null?void 0:x.format_value)||"2",10);return Number.isFinite(k)&&k>=0?k:2}),d=k=>{if(!k)return k;const x=String(k).split(".");return x.length>1&&x[1].length>u.value?u.value===0?x[0]:`${x[0]}.${x[1].slice(0,u.value)}`:String(k)},h=k=>{const x=d(k);x!==k&&b.value?r.value=x:r.value=k},f=k=>{const x=k.target;if(!x)return;const $=x.value||"",W=$.indexOf(".");if(k.key==="."&&u.value===0){k.preventDefault();return}W!==-1&&/[0-9]/.test(k.key)&&$.slice(W+1).length>=u.value&&k.preventDefault()},p=q(()=>l.value||s.showInlineError?{content:""}:{content:c.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),g=()=>{var X;const k=s.config.restricted_type.trim(),x=((X=s.config.restricted_value)==null?void 0:X.split(",").map(Number))||[],[$,W]=x,ae={range:`Enter a value between ${$} and ${W}`,not:`These values are not allowed: ${x.join(", ")}`,exact:"Value is not allowed"}[k];return l.value?"":ae},v=q(()=>{var x;let k="";return Number((x=s.config)==null?void 0:x.format_value)&&(k+="."+Array.from({length:Number(s.config.format_value)}).map(()=>"0").join("")),`0${k}`});tt(()=>s.modelValue,k=>{r.value=k,i.value=k});const w=k=>Im(s.config,k),S=n,b=V(null),C=k=>{const x=k===""?null:k,$=i.value===""?null:i.value;return x!==$},_=k=>{const x=d(k);if(!C(x))return!1;const $=x===""?null:x;return r.value=$,i.value=$,S("update:modelValue",$),S("handleChange",$),!0},E=()=>{r.value=i.value,S("update:modelValue",i.value)},I=(k,x)=>{_(k),S("enter")},T=(k,x)=>{if(a.value){a.value=!1;return}s.saveOnBlur?_(k):E()},P=k=>{if(k===null||k===""){l.value=!0;return}l.value=Im(s.config,Number(k)),c.value=l.value?"":g()},M=(k,x)=>{a.value=!0,s.saveOnEscape?_(k):E(),S("cancel"),setTimeout(()=>{a.value=!1},100)},D=k=>{P(k),S("onValidation",k)},F=()=>{a.value=!0,E(),S("cancel"),setTimeout(()=>{a.value=!1},100)},O=()=>{var k;r.value=null,i.value=null,S("update:modelValue",null),S("handleChange",null),(k=b.value)==null||k.focus()};return t({focus:()=>{var k;return(k=b.value)==null?void 0:k.focus()},blur:()=>{var k;return(k=b.value)==null?void 0:k.blur()},getValue:()=>r.value,getCachedValue:()=>i.value,save:()=>_(r.value),revert:E}),Qt(()=>{var k;(k=b.value)==null||k.focus()}),(k,x)=>Ke((K(),ie("div",lX,[ue(SS,{maxDecimalChar:u.value,modelValue:r.value,"onUpdate:modelValue":x[0]||(x[0]=$=>r.value=$),placeholder:v.value,validatorFnc:w,style:{"--bg-input":"#FAFAFA"},onInput:h,onKeydown:f,onEnter:I,onBlur:T,onClear:O,onEscape:M,onCancel:F,onOnValidation:D,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:b},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(K(),ie("span",cX,ht(c.value),1)):Xe("",!0)])),[[H(o),p.value]])}}),uX={key:2},dX={class:"wrapper-suffix"},hX={key:3},fX=Ct(st({__name:"MetricEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},config:{},attachTo:{},focus:{type:Boolean}},emits:["enter","cancel","blur","updateMetric"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=V(null),i=V(0),a=V(null),l=V(null),c=q(()=>uP(s.config)),u=V(!1),d=q(()=>!!pe.value),h=n,f=()=>{u.value=!1,ne(),h("cancel")},p=V(!0),g=re=>{if(re===null||re===""){p.value=!0;return}if(c.value!=="number"){p.value=!0;return}p.value=Im(s.config,Number(re)),w.value=S()},v=()=>{u.value=!0,W()},w=V(""),S=()=>{var de;const re=s.config.restricted_type.trim(),U=((de=s.config.restricted_value)==null?void 0:de.split(",").map(Number))||[],[ge,oe]=U,G={range:`Enter a value between ${ge} and ${oe}`,not:`These values are not allowed: ${U.join(", ")}`,exact:"Value is not allowed"}[re];return p.value?"":G},b=q(()=>{var U;const re=Number.parseInt(String((U=s.config)==null?void 0:U.format_value)||"2",10);return Number.isFinite(re)&&re>=0?re:2}),C=re=>{u.value=!0,r.value=re},_=()=>{u.value=!0,ne(),W()},E=re=>{i.value=re,u.value=!0,W()},I=()=>(s.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(U=>U.charAt(0).toUpperCase()+U.slice(1)).join("").replace(/Outline|Solid/g,""),T=V(null),P=V(!0),M=q(()=>{var re;return{disabled:s.disabled,error:!1,readOnly:!1,isEmpty:((re=r.value)==null?void 0:re.length)===0,wrapperRef:N,active:d,focus:s.focus,bordered:!0}}),D=V(null),F=q(()=>P.value),O=q(()=>({disabled:s.disabled,error:!1,readOnly:!1,isEmpty:i.value===0,wrapperRef:D,active:F,focus:P.value,bordered:!0})),{argsMain:k}=Co(O),{argsMain:x}=Co(M),$=V(null),W=()=>{vt(()=>{var re;(re=$.value)==null||re.focus()})},Q=re=>{var U;if(re.format_type==="dropdown"&&re.format_value)try{const ge=JSON.parse(re.format_value);if(Array.isArray(ge))return ge.map(oe=>({label:oe.name,value:oe.name,id:oe.name}))}catch(ge){console.error("Failed to parse dropdown options",ge)}return re.format_type=="number"&&re.restricted_type=="exact"?((U=re.restricted_value)==null?void 0:U.split(",").map(oe=>({label:re.mapping[`!${oe}`]||oe,value:oe,id:oe})))||[]:[]},ae=q(()=>Q(s.config)),ee=q(()=>{var re;return((re=ae.value.find(U=>U.value===r.value))==null?void 0:re.label)||r.value||"-"}),X=()=>{var re;if(c.value=="rating")h("updateMetric",i.value==0?null:i.value);else if(c.value=="number"){const U=(re=l.value)==null?void 0:re.getValue();h("updateMetric",U||null)}else h("updateMetric",r.value||null);u.value=!1,ne()},{triggerRef:N,popupRef:z,hide:ne,isVisible:pe,show:ve}=yo({toggleOnClick:!0,appendTo:()=>s.attachTo||"parent",zIndex:1e4,offset:[0,0]}),we=()=>{switch(c.value){case"number":vt(()=>{var re;(re=l.value)==null||re.focus()});break;case"dropdown":ve(),vt(()=>{var re;(re=T.value)==null||re.focus()});break;case"rating":P.value=!0,vt(()=>{var re;(re=a.value)==null||re.focus()});break}};return t({resetState:()=>{r.value=null,i.value=0,u.value=!1},focus:we,hasChanges:()=>u.value}),Qt(()=>{vt(()=>{setTimeout(()=>{we()},300)})}),(re,U)=>(K(),ie("div",{class:te(re.$style["metric-editor"])},[c.value=="number"?(K(),Ue(DA,{key:0,config:s.config,modelValue:r.value,"onUpdate:modelValue":U[0]||(U[0]=ge=>r.value=ge),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:C,maxDecimalChar:b.value,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue","maxDecimalChar"])):c.value=="rating"?(K(),Ue(_o,Wt({key:1,"tab-index":1},H(k),{ref_key:"triggerRef2",ref:D,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:he(()=>[ue(_A,{params:{maxRating:s.config.range},modelValue:i.value,"onUpdate:modelValue":U[1]||(U[1]=ge=>i.value=ge),onHandleEnter:E,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:he(()=>[ue(lt,{source:"rating",src:I()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):c.value=="dropdown"?(K(),ie("div",uX,[ue(_o,Wt(H(x),{ref_key:"triggerRef",ref:N,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:he(({})=>[me("div",dX,[ue(lt,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:he(()=>[Ke((K(),ie("span",null,[Qe(ht(ee.value||""),1)])),[[H(o),{content:ee.value}]])]),_:1},16),me("div",{ref_key:"popupRef",ref:z},[H(pe)?(K(),Ue(RA,{key:0,ref_key:"metricEditorDropdownRef",ref:T,config:s.config,modelValue:r.value,"onUpdate:modelValue":U[2]||(U[2]=ge=>r.value=ge),onChange:_,onCancel:f},null,8,["config","modelValue"])):Xe("",!0)],512)])):(K(),ie("span",hX,"Formular")),Ke((K(),Ue(at,{ref_key:"confirmButtonRef",ref:$,onHandleClick:X,"tab-index":"1",onKeypress:[jn(kt(we,["shift","prevent"]),["tab"]),jn(kt(f,["prevent"]),["escape"])],disabled:!p.value},{default:he(()=>[ue(lt,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[H(o),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),pX=Ct(st({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=n,i=V(!1),a=V(null),l=V(null),c=()=>{i.value=!i.value},u=()=>{var g;i.value=!1,(g=l.value)==null||g.resetState()},d=async()=>{var g;i.value=!0,await vt(),(g=l.value)==null||g.focus()},h=g=>{r("handleUpdate",{id:s.config.id.toString(),value:g})},f=()=>{var g;(g=a.value)==null||g.focus(),r("loseFocus")},p=g=>{const w={Escape:()=>{g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation(),r("focusOnSearch",g)},Tab:()=>{i.value&&u()},Enter:()=>{i.value||d()},ArrowDown:()=>{r("openSibling","down")},ArrowUp:()=>{r("openSibling","up")}}[g.key];w&&w()};return tt(i,g=>{g&&r("open")}),t({hide:u,show:d}),(g,v)=>(K(),ie("div",{class:te([g.$style["metric-item"],i.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[me("div",{class:te(g.$style["metric-label"]),onClick:kt(c,["stop"])},[Dt(g.$slots,"default",{open:i.value},()=>[Ke((K(),ie("span",{class:te(g.$style["metric-name"])},[Qe(ht(e.label),1)],2)),[[H(o),{content:e.label}]]),e.morpheme&&i.value?(K(),ie("small",{key:0,class:te(g.$style["metric-morpheme"])}," ("+ht(e.morpheme)+") ",3)):Xe("",!0)])],2),ue(xT,{mode:"out-in",name:"slide"},{default:he(()=>[i.value?(K(),Ue(fX,{key:`editor-${e.config.id}`,"read-only":!1,focus:i.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"])):Xe("",!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 Uu=(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))(Uu||{});function TA(e,t){return function(){return e.apply(t,arguments)}}const{toString:gX}=Object.prototype,{getPrototypeOf:RS}=Object,{iterator:Zm,toStringTag:IA}=Symbol,Xm=(e=>t=>{const n=gX.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Mr=e=>(e=e.toLowerCase(),t=>Xm(t)===e),Jm=e=>t=>typeof t===e,{isArray:Wu}=Array,zu=Jm("undefined");function Cf(e){return e!==null&&!zu(e)&&e.constructor!==null&&!zu(e.constructor)&&ps(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const xA=Mr("ArrayBuffer");function mX(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&xA(e.buffer),t}const vX=Jm("string"),ps=Jm("function"),FA=Jm("number"),bf=e=>e!==null&&typeof e=="object",yX=e=>e===!0||e===!1,Qm=e=>{if(Xm(e)!=="object")return!1;const t=RS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(IA in e)&&!(Zm in e)},wX=e=>{if(!bf(e)||Cf(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},CX=Mr("Date"),bX=Mr("File"),SX=Mr("Blob"),EX=Mr("FileList"),_X=e=>bf(e)&&ps(e.pipe),RX=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ps(e.append)&&((t=Xm(e))==="formdata"||t==="object"&&ps(e.toString)&&e.toString()==="[object FormData]"))},DX=Mr("URLSearchParams"),[TX,IX,xX,FX]=["ReadableStream","Request","Response","Headers"].map(Mr),PX=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Sf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let o,s;if(typeof e!="object"&&(e=[e]),Wu(e))for(o=0,s=e.length;o<s;o++)t.call(null,e[o],o,e);else{if(Cf(e))return;const r=n?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let a;for(o=0;o<i;o++)a=r[o],t.call(null,e[a],a,e)}}function PA(e,t){if(Cf(e))return null;t=t.toLowerCase();const n=Object.keys(e);let o=n.length,s;for(;o-- >0;)if(s=n[o],t===s.toLowerCase())return s;return null}const ac=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,kA=e=>!zu(e)&&e!==ac;function DS(){const{caseless:e,skipUndefined:t}=kA(this)&&this||{},n={},o=(s,r)=>{const i=e&&PA(n,r)||r;Qm(n[i])&&Qm(s)?n[i]=DS(n[i],s):Qm(s)?n[i]=DS({},s):Wu(s)?n[i]=s.slice():(!t||!zu(s))&&(n[i]=s)};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Sf(arguments[s],o);return n}const kX=(e,t,n,{allOwnKeys:o}={})=>(Sf(t,(s,r)=>{n&&ps(s)?e[r]=TA(s,n):e[r]=s},{allOwnKeys:o}),e),AX=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),OX=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},MX=(e,t,n,o)=>{let s,r,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),r=s.length;r-- >0;)i=s[r],(!o||o(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&RS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},NX=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return o!==-1&&o===n},LX=e=>{if(!e)return null;if(Wu(e))return e;let t=e.length;if(!FA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},VX=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&RS(Uint8Array)),BX=(e,t)=>{const o=(e&&e[Zm]).call(e);let s;for(;(s=o.next())&&!s.done;){const r=s.value;t.call(e,r[0],r[1])}},$X=(e,t)=>{let n;const o=[];for(;(n=e.exec(t))!==null;)o.push(n);return o},HX=Mr("HTMLFormElement"),GX=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,s){return o.toUpperCase()+s}),AA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),UX=Mr("RegExp"),OA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};Sf(n,(s,r)=>{let i;(i=t(s,r,e))!==!1&&(o[r]=i||s)}),Object.defineProperties(e,o)},WX=e=>{OA(e,(t,n)=>{if(ps(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const o=e[n];if(ps(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},zX=(e,t)=>{const n={},o=s=>{s.forEach(r=>{n[r]=!0})};return Wu(e)?o(e):o(String(e).split(t)),n},jX=()=>{},KX=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function qX(e){return!!(e&&ps(e.append)&&e[IA]==="FormData"&&e[Zm])}const YX=e=>{const t=new Array(10),n=(o,s)=>{if(bf(o)){if(t.indexOf(o)>=0)return;if(Cf(o))return o;if(!("toJSON"in o)){t[s]=o;const r=Wu(o)?[]:{};return Sf(o,(i,a)=>{const l=n(i,s+1);!zu(l)&&(r[a]=l)}),t[s]=void 0,r}}return o};return n(e,0)},ZX=Mr("AsyncFunction"),XX=e=>e&&(bf(e)||ps(e))&&ps(e.then)&&ps(e.catch),MA=((e,t)=>e?setImmediate:t?((n,o)=>(ac.addEventListener("message",({source:s,data:r})=>{s===ac&&r===n&&o.length&&o.shift()()},!1),s=>{o.push(s),ac.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ps(ac.postMessage)),JX=typeof queueMicrotask<"u"?queueMicrotask.bind(ac):typeof J<"u"&&J.nextTick||MA,Be={isArray:Wu,isArrayBuffer:xA,isBuffer:Cf,isFormData:RX,isArrayBufferView:mX,isString:vX,isNumber:FA,isBoolean:yX,isObject:bf,isPlainObject:Qm,isEmptyObject:wX,isReadableStream:TX,isRequest:IX,isResponse:xX,isHeaders:FX,isUndefined:zu,isDate:CX,isFile:bX,isBlob:SX,isRegExp:UX,isFunction:ps,isStream:_X,isURLSearchParams:DX,isTypedArray:VX,isFileList:EX,forEach:Sf,merge:DS,extend:kX,trim:PX,stripBOM:AX,inherits:OX,toFlatObject:MX,kindOf:Xm,kindOfTest:Mr,endsWith:NX,toArray:LX,forEachEntry:BX,matchAll:$X,isHTMLForm:HX,hasOwnProperty:AA,hasOwnProp:AA,reduceDescriptors:OA,freezeMethods:WX,toObjectSet:zX,toCamelCase:GX,noop:jX,toFiniteNumber:KX,findKey:PA,global:ac,isContextDefined:kA,isSpecCompliantForm:qX,toJSONObject:YX,isAsyncFn:ZX,isThenable:XX,setImmediate:MA,asap:JX,isIterable:e=>e!=null&&ps(e[Zm])};function Zt(e,t,n,o,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),s&&(this.response=s,this.status=s.status?s.status:null)}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 NA=Zt.prototype,LA={};["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=>{LA[e]={value:e}}),Object.defineProperties(Zt,LA),Object.defineProperty(NA,"isAxiosError",{value:!0}),Zt.from=(e,t,n,o,s,r)=>{const i=Object.create(NA);Be.toFlatObject(e,i,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(i,a,l,n,o,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",r&&Object.assign(i,r),i};const QX=null;function TS(e){return Be.isPlainObject(e)||Be.isArray(e)}function VA(e){return Be.endsWith(e,"[]")?e.slice(0,-2):e}function BA(e,t,n){return e?e.concat(t).map(function(s,r){return s=VA(s),!n&&r?"["+s+"]":s}).join(n?".":""):t}function eJ(e){return Be.isArray(e)&&!e.some(TS)}const tJ=Be.toFlatObject(Be,{},null,function(t){return/^is[A-Z]/.test(t)});function ev(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 o=n.metaTokens,s=n.visitor||u,r=n.dots,i=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Be.isSpecCompliantForm(t);if(!Be.isFunction(s))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 w=p;if(p&&!v&&typeof p=="object"){if(Be.endsWith(g,"{}"))g=o?g:g.slice(0,-2),p=JSON.stringify(p);else if(Be.isArray(p)&&eJ(p)||(Be.isFileList(p)||Be.endsWith(g,"[]"))&&(w=Be.toArray(p)))return g=VA(g),w.forEach(function(b,C){!(Be.isUndefined(b)||b===null)&&t.append(i===!0?BA([g],C,r):i===null?g:g+"[]",c(b))}),!1}return TS(p)?!0:(t.append(BA(v,g,r),c(p)),!1)}const d=[],h=Object.assign(tJ,{defaultVisitor:u,convertValue:c,isVisitable:TS});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(w,S){(!(Be.isUndefined(w)||w===null)&&s.call(t,w,Be.isString(S)?S.trim():S,g,h))===!0&&f(w,g?g.concat(S):[S])}),d.pop()}}if(!Be.isObject(e))throw new TypeError("data must be an object");return f(e),t}function $A(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function IS(e,t){this._pairs=[],e&&ev(e,this,t)}const HA=IS.prototype;HA.append=function(t,n){this._pairs.push([t,n])},HA.toString=function(t){const n=t?function(o){return t.call(this,o,$A)}:$A;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function nJ(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function GA(e,t,n){if(!t)return e;const o=n&&n.encode||nJ;Be.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let r;if(s?r=s(t,n):r=Be.isURLSearchParams(t)?t.toString():new IS(t,n).toString(o),r){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e}class UA{constructor(){this.handlers=[]}use(t,n,o){return this.handlers.push({fulfilled:t,rejected:n,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Be.forEach(this.handlers,function(o){o!==null&&t(o)})}}const WA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},oJ={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:IS,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xS=typeof window<"u"&&typeof document<"u",FS=typeof navigator=="object"&&navigator||void 0,sJ=xS&&(!FS||["ReactNative","NativeScript","NS"].indexOf(FS.product)<0),rJ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",iJ=xS&&window.location.href||"http://localhost",zo={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xS,hasStandardBrowserEnv:sJ,hasStandardBrowserWebWorkerEnv:rJ,navigator:FS,origin:iJ},Symbol.toStringTag,{value:"Module"})),...oJ};function aJ(e,t){return ev(e,new zo.classes.URLSearchParams,{visitor:function(n,o,s,r){return zo.isNode&&Be.isBuffer(n)?(this.append(o,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}function lJ(e){return Be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function cJ(e){const t={},n=Object.keys(e);let o;const s=n.length;let r;for(o=0;o<s;o++)r=n[o],t[r]=e[r];return t}function zA(e){function t(n,o,s,r){let i=n[r++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),l=r>=n.length;return i=!i&&Be.isArray(s)?s.length:i,l?(Be.hasOwnProp(s,i)?s[i]=[s[i],o]:s[i]=o,!a):((!s[i]||!Be.isObject(s[i]))&&(s[i]=[]),t(n,o,s[i],r)&&Be.isArray(s[i])&&(s[i]=cJ(s[i])),!a)}if(Be.isFormData(e)&&Be.isFunction(e.entries)){const n={};return Be.forEachEntry(e,(o,s)=>{t(lJ(o),s,n,0)}),n}return null}function uJ(e,t,n){if(Be.isString(e))try{return(t||JSON.parse)(e),Be.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(n||JSON.stringify)(e)}const Ef={transitional:WA,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const o=n.getContentType()||"",s=o.indexOf("application/json")>-1,r=Be.isObject(t);if(r&&Be.isHTMLForm(t)&&(t=new FormData(t)),Be.isFormData(t))return s?JSON.stringify(zA(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(r){if(o.indexOf("application/x-www-form-urlencoded")>-1)return aJ(t,this.formSerializer).toString();if((a=Be.isFileList(t))||o.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ev(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return r||s?(n.setContentType("application/json",!1),uJ(t)):t}],transformResponse:[function(t){const n=this.transitional||Ef.transitional,o=n&&n.forcedJSONParsing,s=this.responseType==="json";if(Be.isResponse(t)||Be.isReadableStream(t))return t;if(t&&Be.isString(t)&&(o&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)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:zo.classes.FormData,Blob:zo.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 dJ=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"]),hJ=e=>{const t={};let n,o,s;return e&&e.split(`
146
+ This will fail in production.`);i=nc,i._s.has(e)||(s?mS(e,t,o,i):gA(e,o,i),J.env.NODE_ENV!=="production"&&(r._pinia=i));const c=i._s.get(e);if(J.env.NODE_ENV!=="production"&&a){const u="__hot:"+e,d=s?mS(u,t,o,i,!0):gA(u,sr({},o),i,!0);a._hotUpdate(d),delete i.state.value[u],i._s.delete(u)}if(J.env.NODE_ENV!=="production"&&ea){const u=oo();if(u&&u.proxy&&!a){const d=u.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[e]=c}}return c}return r.$id=e,r}function ns(e){const t=Lt(e),n={};for(const o in t){const s=t[o];s.effect?n[o]=q({get:()=>e[o],set(r){e[o]=r}}):(mn(s)||zs(s))&&(n[o]=Yr(e,o))}return n}const vS=rc("permissionStore",()=>{const e=V([]),t=V(),n=V({});return{userPermissions:e,entityPermissions:t,itemPermission:n,setUserPermissions:i=>{e.value=i},setEntityPermissions:i=>{t.value=i},setItemPermission:(i,a)=>{n.value[i]=a}}}),mZ="woohoo_getWoohooUserInterface_read",yS="media_getReviewUserInterface_read",vZ="update_getUpdateUserInterface_read",mA="Unarchive parent folder first to continue",yZ=(e,t,n,o,s,r)=>{const i=vS(),{userPermissions:a}=ns(i),l=q(()=>{const T=un.getInstance().getItem("BASE_URL"),P=un.getInstance().getItem("BASE_REVIEW_URL"),{ws_code:M,entity_id:D,scene_id:F}=e.value;return{baseDomain:T||"",ws_code:M||"",entity_id:D||"",scene_id:F||"",reviewDomain:P||"",take_id:D||"",woohoo_id:D||"",parent_id:D||""}}),c=q(()=>{var P;const T=e.value.permissions;return{canOpenSceneHub:!0,canOpenReview:a.value.includes(yS),canCopyLink:!0,canRename:(T==null?void 0:T.has_edit_permission)??!1,canOpenTakeInReview:a.value.includes(yS),canOpenTakeInUpdate:a.value.includes(vZ),canOpenTakeInWoohoo:a.value.includes(mZ),canDeleteRendition:((P=T==null?void 0:T.media)==null?void 0:P.has_delete_rendition_permission)??!1,canDeleteThumbnail:(T==null?void 0:T.has_edit_thumbnail_permission)??!1,canArchiveScene:T==null?void 0:T.has_archive_permission,canUnarchiveScene:T==null?void 0:T.has_archive_permission,canDeleteScene:(T==null?void 0:T.has_delete_permission)??!1,canEditDescription:(T==null?void 0:T.has_edit_permission)??!1}}),u=q(()=>({project:es({type:"project",config:l.value}).url,take_review:es({type:"review_take",config:l.value}).url,review:es({type:"review_scene",config:l.value}).url,review_scene:es({type:"review_scene",config:l.value}).url,woohoo:es({type:"woohoo",config:l.value}).url,update:es({type:"update",config:l.value}).url,scene_hub:es({type:"scene_hub",config:l.value}).url})),d=(T,P)=>{const M=T.metaKey||T.ctrlKey,D=u.value[P]||"";if(D){if(P==="scene_hub"){if(M){window.open(D,"_blank");return}if(!o){console.error("Switch instance not found.",{openSceneHub:o,windowFunc:globalThis.window.$switchInstance});return}o(l.value.scene_id||"");return}M?window.open(D,"_blank"):window.location.href=D}},h=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.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{s()}},f=async(T,P)=>{var M;try{await((M=e.value.axiosService.value)==null?void 0:M.deleteThumbnail({workspaceId:l.value.ws_code,itemIds:[l.value.scene_id||""]}))}catch(D){console.error("Error deleting thumbnail",D)}finally{s()}},p=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.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."),P&&P("archived")}catch(D){console.error("Error archiving item",D)}finally{s()}},g=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.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."),P&&P("deleted")}catch(D){console.error("Error deleting item",D)}finally{s()}},v=T=>{const P=u.value.scene_hub||"";P&&(_.value="Copied",navigator.clipboard.writeText(P),setTimeout(()=>{_.value="Copy link"},5e3))},w=async(T,P)=>{var M;try{const D=await((M=e.value.axiosService.value)==null?void 0:M.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."),P&&P("unarchived")}catch(D){console.error("Error unarchiving item",D)}finally{s()}},S=T=>p(T,t),b=T=>w(T,t),C=T=>g(T,t),_=V("Copy link"),E=T=>d(T,"review"),I=q(()=>{let T=[];if(!l.value.scene_id&&e.value.optionBlock&&T.push(...e.value.optionBlock),Array.isArray(e.value.optionBlock)&&e.value.optionBlock.length)return e.value.optionBlock;const P=()=>Math.random().toString(36).substring(2,9);return[{id:P(),type:"column",groupLabel:"Download Options",options:[{id:"open_review",label:"Open Review",icon:"PenRuler",action:E,hide:!c.value.canOpenReview,disabled:!c.value.canOpenReview,description:"",type:"icon"},{id:P(),label:_.value,icon:"Link",action:v,hide:!c.value.canCopyLink,disabled:!c.value.canCopyLink,description:"",type:"icon"}]},{id:P(),type:"column",groupLabel:"Download Options",options:[{id:"archive",label:"Archive",icon:"BoxArchive",action:S,hide:c.value.canArchiveScene==0,disabled:c.value.canArchiveScene!==1,description:c.value.canArchiveScene==-1?mA:"",type:"icon"},{id:"unarchive",label:"Unarchive",icon:"BoxArchive",action:b,hide:c.value.canUnarchiveScene==0,disabled:c.value.canUnarchiveScene!==1,description:c.value.canUnarchiveScene===-1?mA:"",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:w,options:I}};function Co(e){const t=V(!1),n=V(!1),o=q(()=>{var d;const c=e.value,u=!!c.readOnly;return{readOnly:u,disabled:!!c.disabled,hovered:n.value,focused:t.value,isEmpty:c.empty??!1,error:!!c.error,actived:!!((d=c.active)!=null&&d.value),clickable:u?!1:c.clickable??!1}}),s=()=>{t.value=!0,vt(()=>{const c=l(e.value.inputRef);c==null||c.focus()})},r=()=>{t.value=!1},i=()=>{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 Qt(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.addEventListener("focus",s),c.addEventListener("blur",r)),u&&(u.addEventListener("mouseenter",i),u.addEventListener("mouseleave",a))}),qn(()=>{const c=l(e.value.inputRef),u=l(e.value.wrapperRef);c&&(c.removeEventListener("focus",s),c.removeEventListener("blur",r)),u&&(u.removeEventListener("mouseenter",i),u.removeEventListener("mouseleave",a))}),{isFocus:t,isHover:n,argsMain:o,handleFocus:s}}const $u=e=>{const t=V(!1),n=q(()=>t.value);return Qt(()=>{var a,l,c,u;const o=(a=e.params)==null?void 0:a.api,s=(l=e.params)==null?void 0:l.node,r=s==null?void 0:s.rowIndex,i=(u=(c=e.params)==null?void 0:c.colDef)==null?void 0:u.field;return o==null||o.addEventListener("cellEditingStarted",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!0)}),o==null||o.addEventListener("cellEditingStopped",d=>{d.rowIndex===r&&d.colDef.field===i&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}},vA=Ct(st({__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=Ts,{triggerRef:n,popupRef:o}=yo({toggleOnClick:!0,trigger:"mouseenter focus",theme:"dark",placement:"right",arrow:!0}),s=q(()=>{switch(r.status){case"active":return"#02C39A";case"offline":return"#808080";case"busy":return"#ff0000";case"away":return"#F7941D";default:return"transparent"}}),r=e;return(i,a)=>(K(),ie("div",{class:te(i.$style["status-badge-wrapper"]),style:cn({"--badge-size":`${r.size}px`,"--badge-color":s.value})},[Dt(i.$slots,"default"),Ke(me("div",{class:te(i.$style["badge-indicator"]),ref_key:"triggerRef",ref:n},null,2),[[Ks,r.showBadge],[H(t),{isLoading:r.loading,fullwidth:!0}]]),me("div",{ref_key:"popupRef",ref:o,class:te(i.$style["badge-tooltip"])},ht(r.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"}}]]),mf=rc("switchStore",()=>{const e=V(null),t=yn("switchInstance");return{openSceneHub:(s,r)=>{if(s){if(!t)throw console.error("Switch instance not found"),new Error("Switch instance not found");r?t("scene_hub",{id:s,commentId:r},{showLoading:!1}):t("scene_hub",{id:s,tab:"home"},{showLoading:!1})}},openPeopleInsight:s=>{if(!s){console.error("No people_id provided, defaulting to empty string");return}const r=t||e.value;if(!r)console.error("Switch instance not found");else if(window.switchApploader)window.switchApploader("people_insight",{tab:"home",id:s||""},{showLoading:!1});else throw console.error("Switch instance not found and switchApploader is not available"),new Error("Switch instance not found and switchApploader is not available");r("people_insight",{tab:"home",id:s||""},{showLoading:!1})},switchInstanceFunc:e}}),wZ=st({__name:"MiniPeopleCard",props:{user:{},status:{default:void 0},timezone:{default:Tm()},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:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},private:{type:Boolean,default:!1},showPrivateUser:{type:Boolean,default:!1},switchInstance:{type:Function,default:void 0}},emits:["insightClick","copyLink","dataUpdated"],setup(e,{emit:t}){const n=Yt,o=Ts,s=e,r=t,i={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(new Date),l=V(!0),c=V(!1),u=V(!1),d=V(null);let h=null,f=null;const p=mf(),{openPeopleInsight:g}=p,v=q(()=>!s.private&&!c.value),w=q(()=>{var x,$;return((x=d.value)==null?void 0:x.display_name)??(($=s.user)==null?void 0:$.name)}),S=q(()=>{var x,$;return!v.value||!d.value?s.status:(x=d.value.private_info)!=null&&x.is_offline?"offline":($=d.value.private_info)!=null&&$.last_active?"active":"away"}),b=q(()=>{const x=S.value;return x?i[x]:""}),C=q(()=>{var x,$;return(($=(x=d.value)==null?void 0:x.private_info)==null?void 0:$.timezone)??s.timezone}),_=q(()=>{if(!C.value)return"";try{return a.value.toLocaleTimeString("en-US",{timeZone:C.value,hour:"numeric",minute:"2-digit",hour12:!0})}catch{return console.error("Invalid timezone:",C.value),""}}),E=q(()=>{var x,$,W;return{id:s.user.id,name:w.value,initial:((x=d.value)==null?void 0:x.initial)??s.user.initial,profile_image:(($=d.value)==null?void 0:$.profile_image)??s.user.profile_image,color:((W=d.value)==null?void 0:W.color)??s.user.color,size:72,borderRadius:"8px"}}),I=q(()=>{const x=un.getInstance().getItem("BASE_URL"),$=un.getInstance().getItem("ws.code")||"";return es({type:"people_insight",config:{ws_code:$,baseDomain:x,user_id:s.user.id}}).url}),{copyToClipboard:T,tooltip:P}=fP(I.value,()=>r("copyLink",s.user.id)),M=async()=>{if(!s.apiUpdateFunction){l.value=!1;return}try{const x=await s.apiUpdateFunction(s.user.id);x?(d.value=x,r("dataUpdated",x)):(c.value=!0,u.value=!0,r("dataUpdated",null))}catch(x){c.value=!0,u.value=!0,console.error("Failed to fetch user data:",x)}finally{l.value=!1}},D=()=>{F(),s.apiUpdateFunction&&s.enableAutoRefresh&&(f=setInterval(M,s.refreshInterval))},F=()=>{f!==null&&(clearInterval(f),f=null)},O=x=>{var $;if(x.ctrlKey||x.metaKey){window.open(I.value,"_blank");return}try{g(String(s.user.id))}catch{s.switchInstance?($=s.switchInstance)==null||$.call(s,"people_insight",{tab:"home",id:s.user.id||""},{showLoading:!1}):window.open(I.value,"_blank")}},k=x=>{O(x),r("insightClick",s.user.id)};return tt([()=>s.enableAutoRefresh,()=>s.refreshInterval,()=>s.apiUpdateFunction],D),Qt(async()=>{h=setInterval(()=>{a.value=new Date},1e4),s.apiUpdateFunction?(await M(),D()):l.value=!1}),Ol(()=>{h&&clearInterval(h),F()}),(x,$)=>s.showPrivateUser&&(s.private||u.value)?(K(),ie("div",{key:0,class:te([x.$style["info-row"],x.$style["private-badge"]])},[...$[0]||($[0]=[me("span",null,"Private User",-1)])],2)):(K(),ie("div",{key:1,class:te([x.$style["mini-people-card"],{[x.$style.loading]:l.value},"bg-skeleton"])},[me("div",{class:te(x.$style["avatar-section"])},[v.value?(K(),Ue(vA,{key:0,size:12,status:S.value,loading:l.value,"status-tooltip":b.value},{default:he(()=>[ue(Gh,Wt({readOnly:!0},E.value),null,16)]),_:1},8,["status","loading","status-tooltip"])):(K(),Ue(Gh,Wt({key:1,readOnly:!0},E.value),null,16))],2),me("div",{class:te(x.$style["user-info"])},[me("div",{class:te(x.$style["info-column"])},[Ke((K(),ie("span",{class:te(x.$style["user-name"])},[Qe(ht(w.value),1)],2)),[[H(n),{content:w.value,delay:[1e3,0]}]]),C.value&&v.value?(K(),ie("div",{key:0,class:te([x.$style["info-row"],x.$style["time-row"]])},[Ke((K(),ie("div",{class:te(x.$style["time-display"])},[ue(lt,{source:"remote",src:"Globe",class:te(x.$style["clock-icon"]),size:"10"},null,8,["class"]),me("span",{class:te(x.$style["time-text"])},ht(_.value)+" ("+ht(C.value)+")",3)],2)),[[H(o),{isLoading:l.value,fullwidth:!0}]])],2)):Xe("",!0)],2),!e.readOnly&&v.value?(K(),ie("div",{key:0,class:te([x.$style["info-row"],x.$style.actions])},[e.showInsightButton?(K(),Ue(at,{key:0,label:"Insights",variant:"secondary",size:"small",onClick:kt(k,["prevent","stop"]),disabled:s.disabled},null,8,["disabled"])):Xe("",!0),e.showCopyLinkButton?Ke((K(),Ue(at,{key:1,variant:["icon","secondary"],size:"small",onClick:kt(H(T),["prevent","stop"]),disabled:s.disabled},{default:he(()=>[ue(lt,{source:"remote",src:"Link"})]),_:1},8,["onClick","disabled"])),[[H(n),{content:H(P),contentClass:["extra-padding"],hideOnClick:!1,delay:[300,0]}]]):Xe("",!0)],2)):Xe("",!0)],2)],2))}}),CZ=Ct(wZ,[["__cssModules",{$style:{"mini-people-card":"_mini-people-card_ign8a_1",loading:"_loading_ign8a_25","avatar-section":"_avatar-section_ign8a_28","user-info":"_user-info_ign8a_33","info-column":"_info-column_ign8a_42","info-row":"_info-row_ign8a_50","time-row":"_time-row_ign8a_56","time-display":"_time-display_ign8a_62","time-text":"_time-text_ign8a_70",actions:"_actions_ign8a_79","user-name":"_user-name_ign8a_83","v-enter-active":"_v-enter-active_ign8a_103","v-leave-active":"_v-leave-active_ign8a_104","v-enter-from":"_v-enter-from_ign8a_108","v-leave-to":"_v-leave-to_ign8a_109"}}]]),bZ=Ct(st({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=ko,o=Yt,s=e,{isEditing:r}=$u(s),i=()=>{var h,f;const u=(h=s.params)==null?void 0:h.api,d={rowIndex:(f=u==null?void 0:u.getRowNode(String(s.id)))==null?void 0:f.rowIndex,colKey:"options"};u==null||u.startEditingCell(d)},a=q(()=>{var d,h;const u=(h=(d=s.params)==null?void 0:d.api)==null?void 0:h.getRowNode(String(s.id));return((u==null?void 0:u.rowIndex)??0)+10}),l=()=>{var u,d;(d=(u=s.params)==null?void 0:u.api)==null||d.stopEditing()},c=V();return t({focus(){var u;(u=c.value)==null||u.focus()},blur(){var u;(u=c.value)==null||u.blur()}}),(u,d)=>Ke((K(),Ue(at,{class:te(u.$style.btnMoreOptions),variant:["secondary","icon"],size:"small",actived:H(r),onClick:kt(i,["stop"]),onEscape:l,ref_key:"buttonRef",ref:c},{default:he(()=>[ue(lt,{src:"EllipsisVertical",source:"remote"})]),_:1},8,["class","actived"])),[[H(o),"More actions"],[H(n),a.value]])}}),[["__cssModules",{$style:{btnMoreOptions:"_btnMoreOptions_137ge_1"}}]]),SZ=["src","width","height","alt"],Ka=Ct(st({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=Ts,{getCachedValue:n,setCachedValue:o}=$h({dbName:"visual-cache-db",storeName:"visuals"}),s=h=>{if(h!==void 0)return typeof h=="number"?`${h}px`:typeof h=="string"&&/^\d+$/.test(h)?`${h}px`:h},r=e,i=q(()=>({minWidth:s(r.minWidth),maxWidth:s(r.maxWidth),minHeight:s(r.minHeight),maxHeight:s(r.maxHeight),aspectRatio:r.ratio,width:s(r.size)})),a=async h=>{const f=await n(h);if(typeof f=="string")return f},l=async(h,f)=>{await o(h,f)},c=q(()=>({name:r.src,size:Number(r.size||100),color:""})),{url:u,loading:d}=TI(c,"visual",l,a);return(h,f)=>Ke((K(),ie("div",{class:te([h.$style.visualWrapper,{[h.$style.loading]:H(d)}]),style:cn(i.value)},[me("img",{src:H(u),width:e.size,height:e.size,alt:"visual-"+e.src,style:cn(i.value)},null,12,SZ)],6)),[[H(t),{isLoading:H(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),[["__cssModules",{$style:{visualWrapper:"_visualWrapper_lvp0k_1",loading:"_loading_lvp0k_8",pulse:"_pulse_lvp0k_1"}}]]),EZ=["tabindex"],_o=Ct(st({__name:"DisplayWrapper",props:{prefix:{},suffix:{},inputType:{},readOnly:{type:Boolean},disabled:{type:Boolean},hovered:{type:Boolean},focused:{type:Boolean},error:{type:Boolean},actived:{type:Boolean},clickable:{type:Boolean},size:{},bordered:{type:Boolean},tabIndex:{}},emits:["event","escape"],setup(e,{expose:t,emit:n}){const o=e,s=n;bg();const r=Og(),i=V(null),a=V("default"),l=q(()=>{if(typeof o.size=="number")return`${o.size}px`;switch(o.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),c=q(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),u=q(()=>({[r["display-wrapper"]]:!0,[r.disabled]:o.disabled,[r.readOnly]:o.readOnly,[r.error]:o.error,[r.clickable]:o.clickable,[r.active]:o.actived,[r.hovered]:o.hovered,[r.focused]:!o.readOnly&&!o.disabled&&o.focused,[r.bordered]:o.bordered})),d=()=>{var C,_;const g=((C=i.value)==null?void 0:C.querySelectorAll(":scope > .wrapper-prefix").length)||0,v=((_=i.value)==null?void 0:_.querySelectorAll(":scope > .wrapper-suffix").length)||0,w="var(--icon-size)",b=`calc(var(--gap-size) * ${g+v})`;return g&&!v?`repeat(${g}, ${w}) calc(100% - (${g} * ${w} + ${b}))`:!g&&v?`calc(100% - (${v} * ${w} + ${b})) repeat(${v}, ${w})`:g&&v?`repeat(${g}, ${w}) calc(100% - (${g} * ${w} + ${v} * ${w} + ${b})) repeat(${v}, ${w})`:"100%"},h=V("100%"),f=()=>{h.value=d()};mh(()=>{f()}),Qt(()=>{f()});const p=g=>{a.value=g};return t({rootEl:i,updateState:p,componentState:a,focus:()=>{vt(()=>{var g;(g=i.value)==null||g.focus()})},escape:()=>{s("escape")}}),(g,v)=>(K(),ie("div",{ref_key:"rootEl",ref:i,class:te([H(r)["display-wrapper"],u.value]),tabindex:e.tabIndex,style:cn({"--grid-template":h.value,"--wrapper-size":l.value,"--loading-overlay-width":c.value})},[Dt(g.$slots,"prefix",{hovered:o.hovered,focused:o.focused}),Dt(g.$slots,"default",{hovered:o.hovered,focused:o.focused,updateComponentState:p,disabled:o.disabled}),Dt(g.$slots,"suffix",{hovered:o.hovered,focused:o.focused})],14,EZ))}}),[["__cssModules",{$style:{"display-wrapper":"_display-wrapper_46uq2_1",readOnly:"_readOnly_46uq2_26",bordered:"_bordered_46uq2_29",disabled:"_disabled_46uq2_29",active:"_active_46uq2_29",focused:"_focused_46uq2_29",hovered:"_hovered_46uq2_33",error:"_error_46uq2_37",clickable:"_clickable_46uq2_50",suffix:"_suffix_46uq2_56",prefix:"_prefix_46uq2_57"}}]]),_Z=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const RZ=Object.prototype.toString,DZ=e=>RZ.call(e)==="[object Object]",Hu=()=>{};function TZ(e,t){function n(...o){return new Promise((s,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(s).catch(r)})}return n}function IZ(e,t={}){let n,o,s=Hu;const r=l=>{clearTimeout(l),s(),s=Hu};let i;return l=>{const c=Hi(e),u=Hi(t.maxWait);return n&&r(n),c<=0||u!==void 0&&u<=0?(o&&(r(o),o=void 0),Promise.resolve(l())):new Promise((d,h)=>{s=t.rejectOnCancel?h:d,i=l,u&&!o&&(o=setTimeout(()=>{n&&r(n),o=void 0,d(i())},u)),n=setTimeout(()=>{o&&r(o),o=void 0,d(l())},c)})}}function wS(e){return Array.isArray(e)?e:[e]}function xZ(e,t=200,n={}){return TZ(IZ(t,n),e)}function FZ(e,t,n){return tt(e,t,{...n,immediate:!0})}const yA=_Z?window:void 0;function vf(e){var t;const n=Hi(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function CS(...e){const t=(o,s,r,i)=>(o.addEventListener(s,r,i),()=>o.removeEventListener(s,r,i)),n=q(()=>{const o=wS(Hi(e[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return FZ(()=>{var o,s;return[(o=(s=n.value)===null||s===void 0?void 0:s.map(r=>vf(r)))!==null&&o!==void 0?o:[yA].filter(r=>r!=null),wS(Hi(n.value?e[1]:e[0])),wS(H(n.value?e[2]:e[1])),Hi(n.value?e[3]:e[2])]},([o,s,r,i],a,l)=>{if(!(o!=null&&o.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const c=DZ(i)?{...i}:i,u=o.flatMap(d=>s.flatMap(h=>r.map(f=>t(d,h,f,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function bS(e,t,n={}){const{window:o=yA,ignore:s=[],capture:r=!0,detectIframe:i=!1,controls:a=!1}=n;if(!o)return a?{stop:Hu,cancel:Hu,trigger:Hu}:Hu;let l=!0;const c=v=>Hi(s).some(w=>{if(typeof w=="string")return Array.from(o.document.querySelectorAll(w)).some(S=>S===v.target||v.composedPath().includes(S));{const S=vf(w);return S&&(v.target===S||v.composedPath().includes(S))}});function u(v){const w=Hi(v);return w&&w.$.subTree.shapeFlag===16}function d(v,w){const S=Hi(v),b=S.$.subTree&&S.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(C=>C.el===w.target||w.composedPath().includes(C.el))}const h=v=>{const w=vf(e);if(v.target!=null&&!(!(w instanceof Element)&&u(e)&&d(e,v))&&!(!w||w===v.target||v.composedPath().includes(w))){if("detail"in v&&v.detail===0&&(l=!c(v)),!l){l=!0;return}t(v)}};let f=!1;const p=[CS(o,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),h(v))},{passive:!0,capture:r}),CS(o,"pointerdown",v=>{const w=vf(e);l=!c(v)&&!!(w&&!v.composedPath().includes(w))},{passive:!0}),i&&CS(o,"blur",v=>{setTimeout(()=>{var w;const S=vf(e);((w=o.document.activeElement)===null||w===void 0?void 0:w.tagName)==="IFRAME"&&!(S!=null&&S.contains(o.document.activeElement))&&t(v)},0)},{passive:!0})].filter(Boolean),g=()=>p.forEach(v=>v());return a?{stop:g,cancel:()=>{l=!1},trigger:v=>{l=!0,h(v),l=!1}}:g}const PZ=["value","placeholder","disabled","readonly","inputmode","maxlength"],SS=Ct(st({__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 o=ko,s=Yt,r=e,i=n,a=V(null),l=V(r.modelValue||"");tt(l,()=>{i("onValidation",l.value)});const c=V(!1),u=V(r.modelValue||"");tt(()=>r.modelValue,N=>{l.value=N||"",u.value=N||""});const d=q(()=>{var N;return((N=l.value)==null?void 0:N.length)>0}),h={text:N=>N.slice(0,r.maxLength||255),number:N=>{let z=N.replace(/[^\d.-]/g,"");const ne=z.split(".");ne.length>2&&(z=ne[0]+"."+ne.slice(1).join("")),z=z.replace(/-/g,(U,ge)=>ge===0?U:"");const ve=z.startsWith("-")?"-":"",re=z.replace("-","").split(".");return re[0].length>17&&(re[0]=re[0].substring(0,17)),r.maxDecimalChar!==void 0&&re.length>1&&(re[1]=re[1].substring(0,r.maxDecimalChar)),z=ve+re.join("."),z},email:N=>N.replace(/\s/g,"").slice(0,r.maxLength||255),url:N=>N.replace(/\s/g,"").slice(0,r.maxLength||255),tel:N=>N.replace(/[^\d+\-() ]/g,"").slice(0,r.maxLength||20)},f=N=>{const z=h[r.type];return z?z(N):N},p=xZ(N=>{r.autoEmit&&(i("update:modelValue",N),i("input",N))},r.debounceDelay),g=N=>{const z=N;if(r.disabled||r.readOnly){z.preventDefault();return}const ne=z.target,pe=ne.selectionStart||0,ve=l.value,we=f(ne.value);ve!==we&&(l.value=we,i("input",we),r.autoEmit&&p(we),ne.value!==we&&(ne.value=we,vt(()=>{let re=pe;if(we.length<ne.value.length)re=pe;else{const U=we.length-ve.length;re=pe+U}re=Math.max(0,Math.min(re,we.length)),ne.setSelectionRange(re,re)})))},v=N=>{if(r.disabled||r.readOnly){N.preventDefault();return}c.value=!0;const z=l.value;l.value="",i("update:modelValue",""),i("clear"),z!==""&&i("change",""),N.preventDefault(),N.stopImmediatePropagation(),N.stopPropagation(),vt(()=>{var ne;(ne=a.value)==null||ne.focus(),setTimeout(()=>{c.value=!1},100)})},w=N=>{r.disabled||r.readOnly||(i("focus",N),r.selectOnFocus&&vt(()=>{N.target.select()}))},S=N=>{if(c.value)return;const ne=N.target.value;r.autoEmit||i("update:modelValue",ne),u.value!==ne&&(i("change",ne),u.value=ne),i("blur",ne,N)},b=N=>{setTimeout(()=>{vt(()=>{const ne=N.target.value;i("enter",ne,N),i("enterValue",ne),r.submitOnEnter&&(N.preventDefault(),r.autoEmit||i("update:modelValue",ne),u.value!==ne&&(i("change",ne),u.value=ne))})},1e3)},C=N=>{const z=N.target,ne=z.value;if(i("escape",ne,N),N.preventDefault(),N.stopImmediatePropagation(),N.stopPropagation(),r.autoEmit){i("cancel"),r.blurOnEscape&&z.blur();return}l.value=r.modelValue||"",a.value&&(a.value.value=l.value),i("cancel"),r.blurOnEscape&&z.blur()},_=N=>{const ne=N.target.value;i("tab",ne,N),r.autoEmit||(i("update:modelValue",ne),u.value!==ne&&(i("change",ne),u.value=ne))},E=(N,z,ne)=>N===""?!0:N==="."?ne>0:new RegExp(`^\\d{0,${z}}(\\.\\d{0,${ne}})?$`).test(N),I=N=>{if(i("keydown",N),N.key===" "&&N.stopPropagation(),r.type==="number"){if(N.key==="e"||N.key==="E"){N.preventDefault();return}if(!(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"].includes(N.key)||N.ctrlKey||N.metaKey||N.altKey)){if(Number.isNaN(Number(N.key))&&N.key!=="."&&N.key!=="-"){N.preventDefault();return}const pe=l.value+N.key;if(!E(pe,17,r.maxDecimalChar||2)){N.preventDefault();return}}}N.key==="Escape"?C(N):N.key==="Enter"?b(N):N.key==="Tab"?_(N):(N.key==="ArrowUp"||N.key==="ArrowDown")&&r.type==="number"&&N.preventDefault()},T=N=>{i("keyup",N)},P=N=>{if(r.disabled||r.readOnly){N.preventDefault();return}i("paste",N)},M=N=>{if(r.disabled||r.readOnly){N.preventDefault();return}i("cut",N)},D=N=>{i("select",N)},F=`input-text-${Math.random().toString(36).substr(2,9)}`,O=V(!1),k=q(()=>{switch(r.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});tt(()=>l.value,N=>{r.validatorFnc?O.value=!!N&&!r.validatorFnc(N):O.value=!1});const x=V(null),$=q(()=>({disabled:r.disabled,readOnly:r.readOnly,error:O.value,inputRef:a,clickable:!r.disabled&&!r.readOnly,focused:r.focused,wrapperRef:x,bordered:!0})),{argsMain:W,isHover:Q,isFocus:ae}=Co($);t({triggerFocus:()=>{vt(()=>{var N;(N=a.value)==null||N.focus()})},focus:()=>{ee()},blur:()=>{vt(()=>{var N;(N=a.value)==null||N.blur()})},select:()=>{vt(()=>{var N;(N=a.value)==null||N.select()})},setSelectionRange:(N,z)=>{vt(()=>{var ne;(ne=a.value)==null||ne.setSelectionRange(N,z)})},getValue:()=>l.value,setValue:N=>{l.value=f(N),a.value&&(a.value.value=l.value)},reset:()=>{l.value=r.modelValue||"",a.value&&(a.value.value=l.value)}});const ee=()=>{!r.disabled&&!r.readOnly&&vt(()=>{var N;(N=a.value)==null||N.focus()})},X=q(()=>ae.value&&d.value);return(N,z)=>(K(),ie("div",{class:te([N.$style["input-wrapper"],"input-editor"]),onClick:ee},[Ke((K(),Ue(_o,Wt(H(W),{ref_key:"wrapperRef",ref:x,class:[N.$style["input-box"],{[N.$style["is-hovered"]]:H(Q),[N.$style["is-focused"]]:H(ae),[N.$style["has-input"]]:d.value,[N.$style["is-editting"]]:X.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:r.bordered}),{prefix:he(()=>[Dt(N.$slots,"prefix")]),suffix:he(()=>[d.value&&!r.disabled&&!r.readOnly?Dt(N.$slots,"clear",{key:0},()=>[Ke((K(),Ue(at,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:kt(v,["prevent","stop"]),size:18,rounded:!0,class:te(["wrapper-suffix",N.$style["clear-button"]])},{default:he(()=>[ue(lt,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[H(s),{content:"Clear",contentClass:"extra-padding"}]])]):Dt(N.$slots,"suffix",{key:1})]),default:he(()=>[me("input",{tabindex:"-1",ref_key:"inputRef",ref:a,type:"text",value:l.value,placeholder:e.placeholder,class:te([N.$style["column-config__input"]]),id:F,disabled:e.disabled,readonly:e.readOnly,inputmode:k.value,maxlength:r.maxLength,onInput:g,onFocus:w,onBlur:S,onKeydown:I,onKeyup:T,onPaste:P,onCut:M,onSelect:D},null,42,PZ)]),_:3},16,["class","bordered"])),[[H(o),r.focusIndex]]),O.value?Dt(N.$slots,"error",{key:0}):Xe("",!0)],2))}}),[["__cssModules",{$style:{"input-box":"_input-box_1p4v0_1","is-disabled":"_is-disabled_1p4v0_16","is-readonly":"_is-readonly_1p4v0_16","is-hovered":"_is-hovered_1p4v0_16","is-focused":"_is-focused_1p4v0_20","column-config__input":"_column-config__input_1p4v0_40","clear-button":"_clear-button_1p4v0_55"}}]]),kZ={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},ES=st({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search"},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{default:void 0}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=V(null),i=xr(c=>{s("update:modelValue",c),s("search",c)},li),a=()=>{s("update:modelValue",""),s("clear"),vt(()=>{var c;(c=r.value)==null||c.focus()})},l=V(o.modelValue);return t({focus:()=>{var c;(c=r.value)==null||c.focus()},setValue(c){l.value=c}}),(c,u)=>(K(),Ue(SS,{focusIndex:o.focusIndex,ref_key:"searchInput",ref:r,modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:H(i),onClear:a,onCancel:u[1]||(u[1]=d=>s("cancel")),"auto-emit":!0},{prefix:he(()=>[me("div",kZ,[ue(lt,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),ic=Ct(st({name:"ListItem",directives:{tooltip:Yt,focusable:ko},__name:"ListItem",props:{itemWidth:{default:"250px"},label:{},value:{},type:{},selected:{type:Boolean},disabled:{type:Boolean},hover:{type:Boolean},clickable:{type:Boolean,default:!0},danger:{type:Boolean},data:{},icon:{},readOnly:{type:Boolean,default:!1},show:{type:Boolean},focusIndex:{}},emits:["click","handleClick","keydown","update:selected","select","escape"],setup(e,{expose:t,emit:n}){const o=ko,s=e,r=n,i=V(!1),a=V(!1);function l(_){if(!_||typeof _!="object")return!1;const E=_;return typeof E.name=="string"&&typeof E.id=="string"&&typeof E.initial=="string"}const c=q(()=>s.type==="status"||s.type==="assignee"||s.type==="icon"||!!C.prefix),u=q(()=>!!C.suffix||s.danger&&i.value),d=q(()=>{var _;return s.type==="status"&&typeof((_=s.data)==null?void 0:_.color)=="string"?{backgroundColor:s.data.color,border:em(s.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),h=Og(),f=q(()=>({[h.active]:s.selected??!1,[h.disabled]:s.disabled??!1,[h.hover]:s.hover??!1,[h.clickable]:(s.clickable??!0)&&!s.disabled,[h.danger]:s.danger??!1,[h["has-prefix"]]:c.value,[h["has-suffix"]]:u.value,[h.readOnly]:s.readOnly}));q(()=>({content:"Cancel",...b})),q(()=>({content:"Confirm",theme:"warning",...b}));function p(_){return{name:_.name,initial:_.initial,id:_.id,profile_image:_.profile_image??null,color:_.color,size:24}}function g(){i.value=!1}function v(_){_?r("click",_):(s.clickable??!0)&&(r("update:selected",!s.selected),r("select",!s.selected))}function w(_){if(!s.disabled){if(s.danger&&!i.value){i.value=!0;return}else s.danger||v(_);r("handleClick",_)}}const S=()=>{i.value?g():r("escape")},b=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),C=bg();return tt(()=>s.show,_=>{_===!1&&(i.value=!1)}),t({select:()=>{w(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(_,E)=>{const I=eu("tooltip");return Ke((K(),Ue(at,{variant:["menu-item",e.danger?"danger":"menu-item"],class:te([_.$style["list-item"],f.value]),onHandleClick:w,onMouseenter:E[0]||(E[0]=T=>a.value=!0),onMouseleave:E[1]||(E[1]=T=>a.value=!1),onEscape:S,style:cn({width:s.itemWidth})},{default:he(()=>[c.value?(K(),ie("div",{key:0,class:te(_.$style["list-item__prefix"])},[Dt(_.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(K(),Ue(lt,{key:0,src:e.icon,source:"remote",class:te(_.$style["item-icon"]),color:s.danger?void 0:"#a6a6a6"},null,8,["src","class","color"])):e.type==="status"?(K(),ie("div",{key:1,class:te(_.$style["status-indicator"]),style:cn(d.value)},null,6)):e.type==="assignee"&&l(e.data)?(K(),Ue(Gh,Wt({key:2},p(e.data),{class:_.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Xe("",!0)])],2)):Xe("",!0),me("div",{class:te(_.$style["list-item__label"])},[Dt(_.$slots,"label",{selected:e.selected},()=>[Qe(ht(e.label),1)])],2),u.value?(K(),ie("div",{key:1,class:te(_.$style["list-item__suffix"])},[Dt(_.$slots,"suffix",{item:_.$props,hovered:a.value},()=>[e.danger&&i.value?(K(),ie("div",{key:0,class:te(_.$style["confirm-action"])},[Ke((K(),Ue(at,{variant:["tertiary","icon","danger"],size:"small",onClick:kt(g,["stop","prevent"])},{default:he(()=>[ue(lt,{src:"Xmark",source:"remote"})]),_:1})),[[H(o),`${s.focusIndex}.0`],[I,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),Ke((K(),Ue(at,{variant:["danger","primary","icon"],size:"small",onClick:kt(v,["stop","prevent"])},{default:he(()=>[ue(lt,{src:"Check",source:"remote"})]),_:1})),[[H(o),`${s.focusIndex}.1`],[I,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Xe("",!0)])],2)):Xe("",!0)]),_:3},8,["variant","class","style"])),[[H(o),s.focusIndex]])}}}),[["__cssModules",{$style:{"list-item":"_list-item_tuyyv_1",disabled:"_disabled_tuyyv_16",danger:"_danger_tuyyv_23","has-prefix":"_has-prefix_tuyyv_26","has-suffix":"_has-suffix_tuyyv_26",clickable:"_clickable_tuyyv_40",readOnly:"_readOnly_tuyyv_43",hover:"_hover_tuyyv_47",active:"_active_tuyyv_53","list-item__prefix":"_list-item__prefix_tuyyv_78","list-item__label":"_list-item__label_tuyyv_86","list-item__suffix":"_list-item__suffix_tuyyv_100","status-indicator":"_status-indicator_tuyyv_107","item-icon":"_item-icon_tuyyv_113","arbo-icon-state":"_arbo-icon-state_tuyyv_118","item-avatar":"_item-avatar_tuyyv_121","confirm-action":"_confirm-action_tuyyv_130"}}]]),AZ=["aria-activedescendant"],OZ=["innerHTML"],MZ=10,na=Ct(st({__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"},itemWidth:{default:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const o=Yt,s={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},r=e,i=n,a=V(""),l=V(-1),c=V(null),u=V(null),d=V(new Map),h=q(()=>Vb(a.value)),f=()=>{const X=h.value;if(!X||X.length<r.minQueryLength)return r.options;if(d.value.has(X))return d.value.get(X);const N=r.options.map(z=>({item:z,score:k7(` ${z.label} `,X)})).filter(({score:z})=>z>0).sort((z,ne)=>ne.score-z.score).map(({item:z})=>z);return d.value.set(X,N),N},p=V([]);tt(()=>r.options,()=>{p.value=f()},{immediate:!0,deep:!0});const g=q(()=>r.hasMore&&!r.loading&&!r.loadingMore),v=xr(X=>{a.value=X,l.value=-1,i("search",X)},li),w=async X=>{ae.value=0,await v(X||""),ae.value=1},S=X=>a.value?A7(X,a.value):X,b=X=>{const z={[s.ARROW_DOWN]:()=>C(X),[s.ARROW_UP]:()=>_(X),[s.ENTER]:()=>T(X),[s.ESCAPE]:()=>P(X),[s.TAB]:()=>M(X)}[X.key];z&&z()},C=X=>{X.preventDefault(),E(1)},_=X=>{X.preventDefault(),E(-1)},E=X=>{const N=p.value.length;if(N===0)return;let z;X>0?z=(l.value+1)%N:l.value>0?z=l.value-1:z=N-1,l.value=z,I()},I=()=>{vt(()=>{var N;const X=(N=u.value)==null?void 0:N.querySelectorAll('[role="menuitem"]')[l.value];X==null||X.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},T=X=>{if(X.preventDefault(),l.value>=0&&l.value<p.value.length){const z=p.value[l.value];D(z,X)}},P=X=>{X.preventDefault(),O()},M=X=>{i("tab",X)},D=(X,N)=>{!X||X.disabled||(i("select",X,N),l.value=-1,O())},F=X=>{X>=0&&X<p.value.length&&(l.value=X)},O=()=>{i("close")},k=()=>{if(!g.value||!u.value)return;const{scrollTop:X,clientHeight:N,scrollHeight:z}=u.value;z-(X+N)<=MZ&&i("loadMore")},x=()=>{var X,N,z;(X=u.value)==null||X.addEventListener("scroll",k),(z=(N=Q.value)==null?void 0:N.$el)==null||z.addEventListener("keydown",b)},$=()=>{var X,N,z;(X=u.value)==null||X.removeEventListener("scroll",k),(z=(N=Q.value)==null?void 0:N.$el)==null||z.removeEventListener("keydown",b)};Qt(()=>{x()}),qn(()=>{$()}),tt(()=>r.loading,X=>{!X&&p.value.length>0&&(l.value=-1)});const W=X=>X?Array.isArray(r.selectedId)?r.selectedId.includes(String(X.id)):r.selectedId==X.id:!1,Q=V(null);tt(l,()=>{I()}),t({focus:()=>{vt(()=>{var X;(X=Q.value)==null||X.focus()})},reset:()=>{var X;(X=Q.value)==null||X.focus(),l.value=-1},query:a,filteredOptions:p,selectedIndex:l,closeDropdown:O,clearSearch:()=>{a.value=""},scrollTo:X=>{u.value&&(u.value.scrollTop=X)},selectIndex:X=>{X>=0&&X<p.value.length&&(l.value=X,I())}});const ae=V(0);tt([()=>r.loading,()=>a.value,()=>r.options,()=>r.loadingMore],()=>{const X=r.options.length>0&&p.value.length>0,N=!X&&a.value.length>0,z=!X&&a.value.length===0;r.loading?ae.value=0:X?ae.value=1:N?ae.value=2:z&&(ae.value=3)},{immediate:!0,deep:!0});const ee=()=>{i("cancel")};return(X,N)=>(K(),ie("datalist",{ref_key:"searchListRef",ref:c,class:te([X.$style["search-list"],ae.value===3||ae.value===2?X.$style.empty:"",p.value.length>8?X.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:cn({width:e.itemWidth||e.width})},[ue(ES,{ref_key:"searchBoxRef",ref:Q,modelValue:a.value,"onUpdate:modelValue":N[0]||(N[0]=z=>a.value=z),class:te(X.$style["search-box"]),disabled:e.loading,onSearch:w,onClear:N[1]||(N[1]=z=>w("")),onCancel:ee},null,8,["modelValue","class","disabled"]),me("div",{ref_key:"popupRef",ref:u,class:te(X.$style["list-container"])},[Dt(X.$slots,"extra-item",{query:a.value,isEmpty:ae.value===3||ae.value===2,isLoading:r.loading}),(K(!0),ie(It,null,Fn(p.value,(z,ne)=>Ke((K(),ie("div",{key:`${z.id}-${ne}`,role:"menuitem"},[Dt(X.$slots,"item",{item:z,index:ne,selectedIndex:l.value,isSelected:W,handleSelect:D,handleItemHover:F,getHighlightedLabel:S,query:a.value,idx:ne,focused:l.value==ne},()=>[z.hide?Xe("",!0):(K(),Ue(ic,Wt({key:0,ref_for:!0},z,{hover:ne===l.value,selected:W(z),type:z.type,id:`item-${ne}`,"aria-selected":ne===l.value,onClick:pe=>D(z,pe),onMouseover:pe=>F(ne),onEscape:O,itemWidth:e.itemWidth||e.width}),{prefix:he(()=>[Dt(X.$slots,"prefix-item",{item:z})]),label:he(()=>[a.value?Ke((K(),ie("span",{key:0,class:te(X.$style.match),innerHTML:S(z.label)},null,10,OZ)),[[H(o),{content:z.label,delay:[1e3,0]}]]):Ke((K(),ie("span",{key:1,class:te(X.$style["item-label"])},[Qe(ht(z.label),1)],2)),[[H(o),{content:z.label,delay:[1e3,0]}]])]),suffix:he(({hovered:pe})=>[Dt(X.$slots,"action",{item:z,isHovered:ne===l.value,hovered:pe,selected:l.value==ne})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover","itemWidth"]))])])),[[Ks,ae.value===1]])),128)),ae.value===0?Dt(X.$slots,"loading-more",{key:0},()=>[(K(),ie(It,null,Fn(8,z=>me("div",{class:te(X.$style["loading-more"]),key:z},[me("div",{class:te(X.$style["loading-skeleton"])},null,2),me("div",{class:te(X.$style["loading-skeleton"])},null,2)],2)),64))]):Xe("",!0),ae.value===2?(K(),ie("div",{key:1,class:te(X.$style["no-results"])},[Dt(X.$slots,"empty",{query:a.value},()=>[me("div",{class:te(X.$style["no-results-content"])},[...N[2]||(N[2]=[me("div",null,[Qe(" No results. "),me("br"),Qe(" Try another search. ")],-1)])],2)])],2)):Xe("",!0),ae.value===3?(K(),ie("div",{key:2,class:te(X.$style["no-results"])},[Dt(X.$slots,"empty-list",{},()=>[me("div",{class:te(X.$style["no-results-content"])},[...N[3]||(N[3]=[me("div",null,"No items available.",-1)])],2)])],2)):Xe("",!0),Dt(X.$slots,"footer")],2)],14,AZ))}}),[["__cssModules",{$style:{"search-list":"_search-list_1rcj9_1",empty:"_empty_1rcj9_11",scrollable:"_scrollable_1rcj9_17","list-container":"_list-container_1rcj9_24","item-label":"_item-label_1rcj9_45","loading-state":"_loading-state_1rcj9_53","loading-more":"_loading-more_1rcj9_54","loading-skeleton":"_loading-skeleton_1rcj9_65","is-loading":"_is-loading_1rcj9_72","no-results":"_no-results_1rcj9_127","no-results-content":"_no-results-content_1rcj9_134",title:"_title_1rcj9_137",tips:"_tips_1rcj9_143",match:"_match_1rcj9_157","skeleton-loading":"_skeleton-loading_1rcj9_1"}}]]),Gu=st({__name:"AvatarProfile",props:{user:{},showProfile:{type:Boolean,default:!0},apiUpdateFunction:{},appendTo:{}},setup(e){const t=C3,n=e,o=V(n.appendTo||void 0),s=()=>({user:n.showProfile?n.user:void 0,placement:"bottom-start",showInsightButton:!0,showCopyLinkButton:!0,apiUpdateFunction:n.apiUpdateFunction,appendTo:o.value}),r=V(s());tt(()=>n,()=>{setTimeout(()=>{vt(()=>{o.value=n.appendTo||void 0,r.value=s()})},50)},{immediate:!0,deep:!0});const i=q(()=>un.getInstance().getItem("user.ws_user_role_id")),a=q(()=>({id:n.user.id,name:n.user.name,profile_image:n.user.profile_image,color:n.user.color,initial:n.user.initial,isMe:n.user.id===i.value}));return(l,c)=>Ke((K(),Ue(Gh,RH(pT(a.value)),null,16)),[[H(t),r.value]])}}),NZ={class:"avatar-wrapper"},LZ={class:"assignee-label"},wA=Ct(st({__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,o=e,s=q(()=>({name:o.user.name,id:o.user.id,profile_image:o.user.profile_image,color:{bgColor:o.user.color.bgColor,textColor:o.user.color.textColor},initial:o.user.initial})),r=bg(),i=q(()=>{if(!a.value&&!o.hover&&!o.focused||!r.actions)return 0;let l=0;const c=u=>{u.forEach(d=>{d.type===It&&Array.isArray(d.children)?c(d.children):d.type!==Yn&&d.type!==Fa&&l++})};return c(r.actions()),l}),a=V(!1);return(l,c)=>(K(),ie("div",{class:te(["assignee-selector-item",{hovered:a.value||o.hover,disabled:o.disabled,selected:o.selected,single:i.value==0,focused:o.focused}]),style:cn({"--actions-count":i.value}),onMouseenter:c[0]||(c[0]=u=>a.value=!0),onMouseleave:c[1]||(c[1]=u=>a.value=!1)},[me("div",NZ,[ue(Gu,{user:s.value,"show-profile":!0,"append-to":o.appendTo,"api-update-function":o.apiUpdateFunction},null,8,["user","append-to","api-update-function"]),o.multipleSelect?(K(),ie("div",{key:0,class:te(["avatar-indicator",[o.selected?"remove":"add"]])},[o.selected?(K(),Ue(lt,{key:0,src:"CircleXMark"})):(K(),Ue(lt,{key:1,src:"CirclePlus"}))],2)):Xe("",!0)]),Ke((K(),ie("div",LZ,[Dt(l.$slots,"name",{},()=>[Qe(ht(o.user.name),1)],!0)])),[[H(n),{content:o.user.name,delay:[1e3,0]}]]),a.value||o.hover||o.focused?Dt(l.$slots,"actions",{key:0},void 0,!0):Xe("",!0)],38))}}),[["__scopeId","data-v-dbfbcc0c"]]),VZ={class:"unassign-icon"},_S=Ct(st({__name:"UnassignBtn",props:{actived:{type:Boolean,default:!1},label:{default:"No assignee"},borderLeft:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t,o=()=>{n("click")};return(s,r)=>(K(),Ue(H(at),{variant:"menu-item",onClick:o,actived:e.actived,style:cn({"border-top-width":0,"border-bottom-width":0,"border-left-width":e.borderLeft?"4px":"0"})},{prefix:he(()=>[me("div",VZ,[Dt(s.$slots,"icon",{},()=>[r[0]||(r[0]=me("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[me("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:he(()=>[Dt(s.$slots,"label",{},()=>[Qe(ht(e.label),1)],!0)]),_:3},8,["actived","style"]))}}),[["__scopeId","data-v-ec3b3a15"]]),BZ=["innerHTML"],CA=20,bA=Ct(st({__name:"AssigneeGroupEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{}},emits:["updated","cancel","update-start","update-failed","update-completed"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,{id:r}=ag(s),i=n,a=ne=>{var ve,we;const pe=(we=(ve=s.params)==null?void 0:ve.api)==null?void 0:we.getRowNode(String(r.value));pe==null||pe.setDataValue("assignees",rb(ne.assignees)),z("updated",ne)},l=V(!1),c=V(!1),u=V(null),d=V(1),h=V(!0),f=V(0),p=V(""),g=yn("bulkUpdate",V(!1)),v=yn("isSelectAll",V(!1)),w=q(()=>{var ne;return g.value&&v.value?[]:(ne=s.ids)!=null&&ne.length?s.ids:[String(r.value)]}),{unAssignAll:S,replaceAssignees:b,handleSelect:C,assigneeList:_,mergedOptions:E,selectedUserIds:I}=Om({...s,entityId:s.entityId,updateRowData:a,value:s.value,isBulkUpdate:g,isSelectAll:v,errorCallback:()=>{z("update-failed")}},w),{apiServices:T}=Zn(!g.value,s),P=yn("workspaceId"),M=async(ne=1,pe="",ve=!1)=>{var re,U,ge,oe,Re,G;if(!T.value)throw console.error("API service or item identifiers are undefined",T.value),new Error("API service or item identifiers are undefined");if(ve?c.value=!0:l.value=!0,u.value=null,!((re=T.value)!=null&&re.multipleAssignableUser))throw new Error("API service getAssignableUsers is undefined");const we=(s.ids??(s.id?[s.id]:[])).map(String);try{let Y;we.length==0?Y=await((U=T.value)==null?void 0:U.getEntityUserRoles({workspaceId:String(P),page:ne,per_page:CA,display_name_like:pe.trim(),entity_ids:String(s.entityId)})):Y=await((ge=T.value)==null?void 0:ge.multipleAssignableUser({workspaceId:String(P),itemIds:we,page:ne,perPage:CA,q:pe.trim(),entityId:String(s.entityId)}));const de=((oe=Pu(Y.data))==null?void 0:oe.map(Am))??[];_.value=ve?vu(_.value,de,"id"):de,f.value=Y.meta.total,h.value=(((Re=Y==null?void 0:Y.meta)==null?void 0:Re.current_page)||0)<(((G=Y==null?void 0:Y.meta)==null?void 0:G.last_page)||0),d.value=ne}catch(Y){console.error("Error fetching assignable users:",Y),u.value="Failed to load assignable users"}finally{l.value=!1,c.value=!1}},D=()=>{!c.value&&h.value&&M(d.value+1,p.value,!0)},F=xr(async ne=>{p.value=ne,await M(1,ne,!1)},li),O=()=>M(1,p.value,!1);Qt(()=>{var ne;(ne=x.value)==null||ne.focus()}),t({getValue:()=>{var ne;return(ne=E.value.find(pe=>pe.selected))==null?void 0:ne.value},refresh:O,clearInternal:()=>{I.value=[]},focus:()=>{var ne;(ne=x.value)==null||ne.focus()}});const k=()=>{const ne=un.getInstance().getItem("BASE_URL"),pe=es({type:"access_setting",config:{baseDomain:ne,ws_code:s.workspaceId,entity_id:P}}).url;window.open(pe,"_blank")},x=V(null);Qt(()=>{vt(()=>{var ne;(ne=x.value)==null||ne.focus()})}),tt([()=>s.id,()=>s.workspaceId],()=>{M()},{deep:!0,immediate:!0});const $=ne=>{var ve;const pe=un.getInstance().getItem("ws.code");return((ve=T.value)==null?void 0:ve.getUserInformation(pe,ne))||Promise.resolve(null)},W=async(ne,pe,ve)=>{pe.preventDefault(),pe.stopPropagation(),pe.stopImmediatePropagation(),z("update-start");try{if(await C(ne))z("update-completed");else throw new Error("Failed to update assignees")}catch(we){z("update-failed"),console.error("Error updating assignees:",we)}},Q=async()=>{try{if(z("update-start"),await S())z("update-completed");else throw new Error("Failed to unassign all assignees")}catch(ne){z("update-failed"),console.error("Error unassigning all assignees:",ne)}finally{}},ae=async ne=>{try{if(z("update-start"),await b(ne))z("update-completed");else throw new Error("Failed to replace assignees")}catch(pe){z("update-failed"),console.error("Error replacing assignees:",pe)}finally{}},ee=()=>{var ne,pe;i("cancel"),(pe=(ne=s.params)==null?void 0:ne.api)==null||pe.stopEditing()};Jr("popupAttachRef",x);const X=V(),N=V(!1),z=(ne,pe)=>{switch(ne){case"updated":i("updated",pe);break;case"update-start":i("update-start");break;case"update-failed":i("update-failed");break;case"update-completed":i("update-completed");break}};return Qt(()=>{vt(()=>{setTimeout(()=>{N.value=!0},50)})}),(ne,pe)=>(K(),ie("div",{class:"assigne-editor-wrapper",ref_key:"wrapperRef",ref:X},[ue(na,Wt({"selected-id":H(I)},{...s},{options:H(E),loading:l.value,ref_key:"popupRef",ref:x,"loading-more":c.value,"has-more":h.value,onSelect:pe[0]||(pe[0]=(ve,we)=>{W(ve,we)}),"data-wrapper":"true",onSearch:H(F),onLoadMore:D,onCancel:ee,onClose:ee}),tu({"extra-item":he(({isEmpty:ve,isLoading:we})=>[!ve&&!we?(K(),Ue(_S,{key:0,onClick:Q,actived:!1,label:"Unassign"},{icon:he(()=>[ue(lt,{src:"UserXMark",source:"remote"})]),_:1})):Xe("",!0)]),item:he(({item:ve,selectedIndex:we,isSelected:re,handleItemHover:U,getHighlightedLabel:ge,query:oe,idx:Re,focused:G})=>[ue(wA,{user:ve.data,"multiple-select":!0,"append-to":X.value,isMe:!1,hover:Re===we,selected:re(ve),focused:G,onClick:kt(Y=>W(ve,Y,"click"),["stop","prevent"]),onMouseover:Y=>U(Re),"api-update-function":$},{name:he(()=>[oe?Ke((K(),ie("span",{key:0,class:te([ne.$style["item-label"],ne.$style.match]),style:{flex:"1"},innerHTML:ge(ve.label)},null,10,BZ)),[[H(o),{content:ve.label}]]):Ke((K(),ie("span",{key:1,class:te(ne.$style["item-label"]),style:{flex:"1"}},[Qe(ht(ve.label),1)],2)),[[H(o),{content:ve.label}]])]),actions:he(()=>[Ke((K(),Ue(at,{tabindex:-1,variant:["secondary","icon"],size:"small",label:"",onClick:kt(Y=>{var de;return ae((de=ve.data)==null?void 0:de.id)},["stop"])},{default:he(()=>[ue(lt,{src:"PeopleArrows"})]),_:1},8,["onClick"])),[[H(o),"Unassign others and reassign"]])]),_:2},1032,["user","append-to","hover","selected","focused","onClick","onMouseover"])]),"empty-list":he(()=>[me("div",{class:te(ne.$style["empty-state"])},[pe[3]||(pe[3]=Qe(" No assignee available. ",-1)),pe[4]||(pe[4]=me("br",null,null,-1)),ue(at,{onClick:k,variant:["tertiary"],size:"small"},{default:he(()=>[...pe[2]||(pe[2]=[Qe(" Go to Access Settings to add team. ",-1)])]),_:1})],2)]),_:2},[u.value?{name:"error",fn:he(()=>[me("div",{class:te(ne.$style["error-message"])},[Qe(ht(u.value)+" ",1),ue(at,{onClick:O,size:"small"},{default:he(()=>[...pe[1]||(pe[1]=[Qe(" 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"}}]]),$Z={key:0,class:"inner"},yf=Ct(st({__name:"BulkUpdateBtnWrapper",props:{isUpdating:{type:Boolean,default:!1},disabled:{type:Boolean}},emits:["onVisibleChange"],setup(e,{expose:t,emit:n}){const o=e,s=V(null),{triggerRef:r,popupRef:i,isVisible:a,hide:l,toggle:c,show:u}=yo({toggleOnClick:!0,zIndex:2,disabled:o.disabled,placement:"top",appendTo:s.value||void 0}),d=V(null),h=v=>{v.key==="Escape"&&i.value&&l()},f=ds({isShow:!1,isRender:!1});Qt(()=>{var w;const v=d.value instanceof HTMLElement?d.value:(w=d.value)==null?void 0:w.$el;v&&v.addEventListener("keydown",h)}),qn(()=>{var w;const v=d.value instanceof HTMLElement?d.value:(w=d.value)==null?void 0:w.$el;v&&v.removeEventListener("keydown",h)});const p=n,g=(v,w)=>{f.isShow=v,f.isRender=w};return tt(()=>a.value,(v,w)=>{v&&v!==w&&vt(()=>{g(!0,!0)}),p("onVisibleChange",v,w)}),t({hide:()=>{l(),g(!1,!0)},isVisible:a,open:()=>{u(),g(!0,!0)},destroy(){l(),g(!1,!1)}}),(v,w)=>(K(),ie("div",{class:"bulk-update-btn-wrapper",ref_key:"containerRef",ref:s},[me("div",{class:"trigger-slot",ref_key:"triggerRef",ref:r},[Dt(v.$slots,"trigger",{isVisible:H(a),hide:H(l),disabled:o.isUpdating||o.disabled,popupRef:H(i),triggerRef:H(r),toggle:H(c)},void 0,!0)],512),me("div",{class:"popup-slot",ref_key:"popupRef",ref:i},[f.isRender?Ke((K(),ie("div",$Z,[Dt(v.$slots,"popup",{isVisible:H(a),hide:H(l),popupRef:H(i),triggerRef:H(r),toggle:H(c),open:H(u)},void 0,!0)],512)),[[Ks,!o.isUpdating&&!o.disabled&&f.isShow]]):Xe("",!0)],512)],512))}}),[["__scopeId","data-v-a587bb19"]]),HZ=st({__name:"AssignneeUpdateButton",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},variant:{},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e;Jr("bulkUpdate",!0);const o=V(!1),s=t,r=V(null),i=()=>{o.value=!0,s("update-start"),setTimeout(()=>{var d;(d=l.value)==null||d.hide()},0)},a=d=>{var h,f;o.value=!1,d?(s("update-completed"),(h=l.value)==null||h.destroy()):(s("update-failed"),(f=l.value)==null||f.open())},l=V(null),c=d=>{var h;s("update",d),(h=r.value)==null||h.clearInternal()},u=(d,h)=>{vt(()=>{var f,p;d?(f=r.value)==null||f.focus():(p=r.value)==null||p.clearInternal()})};return tt(()=>n.ids,()=>{vt(()=>{var d;(d=l.value)==null||d.destroy()})}),(d,h)=>(K(),Ue(yf,{ref_key:"wrapperRef",ref:l,isUpdating:o.value,disabled:n.disabled||o.value,onOnVisibleChange:u},{trigger:he(({hide:f,disabled:p})=>[ue(at,{variant:n.variant,loading:o.value,disabled:p,onEscape:f},{default:he(()=>[ue(lt,{src:"UserPlus",class:"icon"}),h[2]||(h[2]=Qe(" Assignee ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:he(({hide:f})=>[ue(bA,Wt({ref_key:"assigneeGroupEditorRef",ref:r},n,{ids:e.ids,onUpdated:c,onUpdateStart:i,onUpdateFailed:h[0]||(h[0]=p=>a(!1)),onUpdateCompleted:h[1]||(h[1]=p=>a(!0)),onCancel:f}),null,16,["ids","onCancel"])]),default:he(()=>[h[3]||(h[3]=Qe(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),wf=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],GZ=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),qa=(e,t)=>{const n=o=>{var s,r;if(o.key==="Tab"){const i=o.shiftKey||o.metaKey;o.preventDefault(),o.stopImmediatePropagation(),o.stopPropagation();const a=document.activeElement,l=(s=a==null?void 0:a.dataset)==null?void 0:s.index;if(l){let c=wf.indexOf(l);const u=i?-1:1;for(const d of wf){c=(c+u+wf.length)%wf.length;const h=wf[c],f=document.querySelector(`[data-index="${h}"]`);if(f){f.focus();return}}}}else if(o.key==="Enter")(r=o.target)==null||r.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(o.key==="Escape"){o.stopPropagation(),o.stopImmediatePropagation();const i=document.querySelector('[data-index="calendar-wrapper"]');i==null||i.focus()}};if(GZ.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},UZ=["aria-label"],WZ=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],zZ={style:{flex:"1"}},jZ=Ct(st({__name:"MainCalendar",props:LD({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:LD(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{expose:t,emit:n}){const o=Yt,s=V(null),r=e,i=q(()=>r.startDate&&r.endDate),a=rU(e,"tracingCase"),l=n,c=V(r.year),u=V(r.month);tt(()=>[r.year,r.month],([N,z])=>{c.value=N,u.value=z});const d=q(()=>bt.fromObject({year:c.value,month:u.value,day:1},{zone:r.timezone}).setLocale(r.locale||"en-US").toFormat("LLLL yyyy")),h=q(()=>bt.now().setZone(r.timezone)),f=q(()=>r.startDate?bt.fromJSDate(r.startDate,{zone:r.timezone}):null),p=q(()=>r.endDate?bt.fromJSDate(r.endDate,{zone:r.timezone}):null),g=V(f.value),v=V(p.value),w=V(f.value),S=V(p.value);tt([f,p],()=>{r.requireConfirm||(g.value=f.value,v.value=p.value,w.value=f.value,S.value=p.value)},{immediate:!0});const b=q(()=>r.requireConfirm?g.value:f.value),C=q(()=>r.requireConfirm?v.value:p.value);tt(()=>r.activeField,N=>{const z=N==="start"?b.value:C.value;z&&(c.value=z.year,u.value=z.month)}),tt(()=>{var N,z;return[(N=b.value)==null?void 0:N.toISODate(),(z=C.value)==null?void 0:z.toISODate(),r.activeField]},()=>{const N=r.activeField==="start"?b.value:C.value;N&&(N.year!==c.value||N.month!==u.value)&&(c.value=N.year,u.value=N.month)});function _(N){return N.setZone("utc")}const E=V("");function I(N){E.value=N.toISODate()||"",vt(()=>{const z=document.querySelector(`.arbo-calendar-day[data-date="${E.value}"]`);z==null||z.focus()})}tt(()=>{var N,z;return[c.value,u.value,r.activeField,(N=b.value)==null?void 0:N.toISODate(),(z=C.value)==null?void 0:z.toISODate()]},()=>{const N=r.activeField==="start"?b.value:C.value;let z;N&&N.year===c.value&&N.month===u.value?z=N:b.value&&b.value.year===c.value&&b.value.month===u.value?z=b.value:z=h.value,I(z)});function T(N){return N.toFormat("d")}const P=q(()=>{const N=bt.fromObject({year:c.value,month:u.value,day:1},{zone:r.timezone}),z=N.weekday,ne=r.weekStart===1?(z+6)%7:z%7;let pe=N.minus({days:ne});const ve=[],we=xu.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"}),re=Og();for(let ge=0;ge<42;ge++){const oe=[];pe.month!==u.value&&oe.push(re["is-outside"]),pe.hasSame(h.value,"day")&&oe.push(re["is-today"]),b.value&&pe.hasSame(b.value,"day")&&oe.push(re["is-selected-start"]),C.value&&pe.hasSame(C.value,"day")&&oe.push(re["is-selected-end"]),b.value&&C.value&&pe>b.value&&pe<C.value&&oe.push(re["is-in-range"]);const Re=T(pe),G=we[pe.weekday-1]||"";ve.push({dt:pe,iso:pe.toISODate()||"",label:pe.toFormat("d"),displayLabel:Re,weekdayLabel:G,aria:pe.setLocale(r.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:oe}),pe=pe.plus({days:1})}const U=[];for(let ge=0;ge<6;ge++)U.push(ve.slice(ge*7,ge*7+7));return U}),M=q(()=>{const N=xu.weekdays(r.weekdayLabelStyle||"short",{locale:r.locale||"en-US"});return r.weekStart===1?N:[N[6],...N.slice(0,6)]});function D(N,z,ne){const pe=N==="start"?z.startOf("day"):z.endOf("day"),ve=_(pe),we={year:pe.year,month:pe.month,day:pe.day,utc:ve.toISO()||""};N==="start"?(l("select-start",we,ne??!0),l("select-start-utc",we.utc)):(l("select-end",we),l("select-end-utc",we.utc))}function F(N){let z=c.value,ne=u.value+N;for(;ne<1;)ne+=12,z-=1;for(;ne>12;)ne-=12,z+=1;c.value=z,u.value=ne,l("update:year",z),l("update:month",ne)}function O(N){const ne=(E.value?bt.fromISO(E.value,{zone:r.timezone}):h.value).plus({days:N});ne.month===u.value&&ne.year===c.value&&I(ne)}function k(N=!1){const ne=(E.value?bt.fromISO(E.value,{zone:r.timezone}):h.value).weekday%7,pe=N?6-ne:-ne;O(pe)}const x=N=>{$(N)};function $(N){switch(N.preventDefault(),N.stopPropagation(),N.key){case"ArrowLeft":N.preventDefault(),O(-1);break;case"ArrowRight":N.preventDefault(),O(1);break;case"ArrowUp":N.preventDefault(),O(-7);break;case"ArrowDown":N.preventDefault(),O(7);break;case"Home":N.preventDefault(),k(!1);break;case"End":N.preventDefault(),k(!0);break;case"PageUp":N.preventDefault(),F(N.shiftKey?-12:-1);break;case"PageDown":N.preventDefault(),F(N.shiftKey?12:1);break;case"Enter":case" ":{N.preventDefault();const z=E.value?bt.fromISO(E.value,{zone:r.timezone}):h.value,ne=P.value.flat().find(pe=>pe.iso===z.toISODate());ne&&Q(ne);break}}}const W=N=>{const z=bt.now().setZone(r.timezone);c.value=z.year,u.value=z.month,l("update:year",z.year),l("update:month",z.month),I(z),l("gotoToday")};function Q(N){var de,ke;const z=!!f.value,ne=!!p.value,pe=r.activeField,ve=((de=f.value)==null?void 0:de.toISODate())||"null",we=((ke=p.value)==null?void 0:ke.toISODate())||"null",re=N.dt.toISODate()||"",U=(xe,Ve)=>{a.value={case:xe,behavior:Ve}},ge=()=>`Selected start ${re} > existing end ${we} -> reset both to ${re}`,oe=()=>`Selected end ${re} < existing start ${ve} -> reset both to ${re}`,Re=()=>{D("start",N.dt,!0),D("end",N.dt),l("update:activeField","end")},G=(xe=!1)=>{D("start",N.dt,xe),xe&&l("update:activeField","end")},Y=(xe=!1)=>{D("end",N.dt),xe&&l("close")};if(z&&ne){pe==="start"?p.value&&N.dt>p.value?(Re(),U("INVERT_RANGE_FROM_START",ge())):(G(!1),U("UPDATE_START_IN_RANGE",`Updated start from ${ve} to ${re}; end remains ${we}`)):f.value&&N.dt<f.value?(Re(),U("INVERT_RANGE_FROM_END",oe())):(Y(!1),U("UPDATE_END_IN_RANGE",`Updated end from ${we} to ${re}; start remains ${ve}`));return}if(!z&&ne&&pe==="start"&&p.value&&N.dt>p.value){Re(),U("CREATE_RANGE_FROM_LATE_START",ge());return}if(z&&!ne&&pe==="end"&&f.value&&N.dt<f.value){Re(),U("CREATE_RANGE_FROM_EARLY_END",oe());return}if(!z&&!ne){if(pe==="start"){G(!0),U("INIT_START",`Picked start ${re}; awaiting end selection`);return}Y(r.immediatelyUpdate),U("INIT_END",`Picked end ${re}; awaiting start selection`);return}if(!z&&ne){if(pe==="start"){G(!0),U("FILL_MISSING_START",`Inserted start ${re}; existing end ${we}`);return}Y(!1),U("STRICT_UPDATE_END_ONLY",`Updated end to ${re}; start still null`);return}if(z&&!ne){if(pe==="start"){G(!0),U("RESELECT_START_BEFORE_END",`Replaced start with ${re}; end still null, switching to end`);return}Y(r.immediatelyUpdate),U("FILL_MISSING_END",`Picked end ${re}; start ${ve}`);return}}function ae(){w.value=g.value,S.value=v.value,l("confirm")}function ee(){g.value=w.value,v.value=S.value,l("cancel")}function X(){vt(()=>{var N;(N=s.value)==null||N.focus()})}return Qt(()=>{X()}),t({focus:X}),(N,z)=>(K(),ie("div",{ref_key:"calendarRef",ref:s,class:te([N.$style["arbo-calendar"],{[N.$style["arbo-date-range-picker"]]:i.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[me("div",{class:te([N.$style["arbo-calendar-header"],N.$style["arbo-calendar-week"]]),role:"row"},[(K(!0),ie(It,null,Fn(M.value,ne=>(K(),ie("div",{key:ne,class:te(N.$style["arbo-calendar-weekday"]),role:"columnheader"},ht(ne),3))),128))],2),me("div",{class:te(N.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:z[0]||(z[0]=kt(ne=>H(qa)(ne,x),["prevent","stop"]))},[(K(!0),ie(It,null,Fn(P.value,(ne,pe)=>(K(),ie("div",{key:pe,class:te(N.$style["arbo-calendar-week"])},[(K(!0),ie(It,null,Fn(ne,ve=>(K(),ie("div",{key:ve.iso,class:te([N.$style["arbo-calendar-day"],ve.classes,{[N.$style["is-focused"]]:ve.iso===E.value}]),disabled:r.disabled,readOnly:r.readOnly,"aria-label":ve.aria,"data-date":ve.iso,"data-weekday":ve.weekdayLabel,tabindex:ve.iso===E.value?0:-1,onClick:we=>Q(ve)},ht(ve.displayLabel),11,WZ))),128))],2))),128))],34),r.readOnly?Xe("",!0):(K(),ie("div",{key:0,class:te(N.$style["arbo-calendar-actions"])},[me("div",zZ,[Ke((K(),Ue(at,{variant:"secondary",size:"medium",onClick:z[1]||(z[1]=ne=>W()),onKeydown:H(qa),"data-index":"today-btn"},{prefix:he(()=>[ue(lt,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[H(o),"Today"]])]),ue(at,{disabled:r.disabled,readOnly:r.readOnly,onKeydown:H(qa),variant:"secondary",size:"medium",onClick:ee,"data-index":"cancel-btn"},{default:he(()=>[Qe(ht(r.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),ue(at,{disabled:r.disabled||r.disableConfirm,readOnly:r.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:H(qa),onClick:ae},{default:he(()=>[Qe(ht(r.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,UZ))}}),[["__cssModules",{$style:{"arbo-date-range-picker":"_arbo-date-range-picker_99b61_1","arbo-calendar-day":"_arbo-calendar-day_99b61_2","arbo-calendar-week":"_arbo-calendar-week_99b61_3","arbo-calendar":"_arbo-calendar_99b61_2","arbo-calendar-nav":"_arbo-calendar-nav_99b61_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_99b61_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_99b61_53","arbo-calendar-weekday":"_arbo-calendar-weekday_99b61_58","arbo-calendar-weeks":"_arbo-calendar-weeks_99b61_63","is-today":"_is-today_99b61_92","is-selected-start":"_is-selected-start_99b61_97","is-selected-end":"_is-selected-end_99b61_105","is-outside":"_is-outside_99b61_125","is-focused":"_is-focused_99b61_128","is-in-range":"_is-in-range_99b61_133","arbo-calendar-actions":"_arbo-calendar-actions_99b61_139","arbo-calendar-btn":"_arbo-calendar-btn_99b61_147",cancel:"_cancel_99b61_156",confirm:"_confirm_99b61_161"}}]]),KZ=["onClick"],qZ=["variant","onClick"],YZ=Ct(st({__name:"CalendarNavigationControl",props:{year:{},month:{},minYear:{default:1970},maxYear:{default:2100},yearSpan:{default:12},monthLabels:{},locale:{default:"en-US"},monthLabelStyle:{default:"short"},ariaPrevLabel:{default:"Previous"},ariaNextLabel:{default:"Next"},ariaToolbarLabel:{default:"Calendar navigation"},ariaSelectYearLabel:{default:"Select year"},ariaSelectMonthLabel:{default:"Select month"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["update:year","update:month","mode-change","year-selected","month-selected"],setup(e,{expose:t,emit:n}){const o=e,s=q(()=>{if(o.monthLabels&&o.monthLabels.length===12)return o.monthLabels;const O=o.locale||"en-US",k=o.monthLabelStyle||"short",x=new Intl.DateTimeFormat(O,{month:k,timeZone:"UTC"});return Array.from({length:12},(W,Q)=>x.format(new Date(Date.UTC(2020,Q,1))))}),r=n,i=V(o.year),a=V(o.month),l=V(o.year);tt(()=>o.year,O=>{O!==i.value&&(i.value=O,l.value=O)}),tt(()=>o.month,O=>{O!==a.value&&(a.value=O)});const c=V("days");function u(O){c.value!==O&&(c.value=O,r("mode-change",O))}const d=q(()=>o.minYear),h=q(()=>o.maxYear),f=q(()=>{const O=o.yearSpan;return l.value-l.value%O}),p=q(()=>f.value+o.yearSpan-1);function g(){const O=o.yearSpan,k=f.value-O;k>=d.value&&(l.value=k)}function v(){const O=o.yearSpan,k=f.value+O;k<=h.value&&(l.value=k)}const w=q(()=>f.value-o.yearSpan<d.value),S=q(()=>p.value+o.yearSpan>h.value),b=q(()=>{const O=o.yearSpan;return Math.ceil(O/3)});function C(O){const x=f.value+(O-1)*3;return Array.from({length:3},($,W)=>x+W).filter($=>$<=p.value)}function _(){c.value==="months"?u("days"):u("months")}function E(){c.value==="years"?u("days"):u("years")}function I(O){i.value=O,l.value=O,r("update:year",O),r("year-selected",O),u("months")}function T(O){a.value=O,r("update:month",O),r("month-selected",O),u("days")}function P(){if(c.value==="days"){let O=i.value,k=a.value-1;if(k<1&&(k=12,O--),O<d.value)return;i.value=O,a.value=k,r("update:year",O),r("update:month",k)}else if(c.value==="months"){if(i.value-1<d.value)return;i.value--,r("update:year",i.value)}else c.value==="years"&&g()}function M(){if(c.value==="days"){let O=i.value,k=a.value+1;if(k>12&&(k=1,O++),O>h.value)return;i.value=O,a.value=k,r("update:year",O),r("update:month",k)}else if(c.value==="months"){if(i.value+1>h.value)return;i.value++,r("update:year",i.value)}else c.value==="years"&&v()}const D=q(()=>c.value==="days"?i.value===d.value&&a.value===1:c.value==="months"?i.value-1<d.value:w.value),F=q(()=>c.value==="days"?i.value===h.value&&a.value===12:c.value==="months"?i.value+1>h.value:S.value);return t({setNavigation:(O,k)=>{i.value=O,a.value=k}}),(O,k)=>(K(),ie("div",{class:te([O.$style["cal-nav-wrapper"]])},[Dt(O.$slots,"selection"),c.value==="days"?(K(),ie("div",{key:0,class:te(O.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[ue(at,{variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.prev]),"aria-label":"Previous",disabled:D.value,label:"",onClick:P,"data-index":"prev-btn",onKeydownCapture:jn(kt(P,["prevent","stop"]),["enter"]),onKeydown:H(qa)},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),me("div",{class:te(O.$style["cal-nav-center"])},[ue(at,{"data-index":"month-btn",variant:"secondary",onClick:_,onKeydown:H(qa)},{default:he(()=>[Qe(ht(s.value[a.value-1]),1)]),_:1},8,["onKeydown"]),ue(at,{variant:"secondary",onClick:E,"data-index":"year-btn",onKeydown:H(qa)},{default:he(()=>[Qe(ht(i.value),1)]),_:1},8,["onKeydown"])],2),ue(at,{"data-index":"next-btn",variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.next]),"aria-label":"Next",disabled:F.value,label:"",onClick:M,onKeydownCapture:jn(kt(M,["prevent","stop"]),["enter"]),onKeydown:H(qa)},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Xe("",!0),c.value==="years"?(K(),ie("div",{key:1,class:te(O.$style["year-grid"])},[me("div",{class:te(O.$style["year-grid-header"])},[ue(at,{variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.prev]),"aria-label":"Next",disabled:w.value,"prefix-icon":"AnglesRight",label:"",onClick:g},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),me("div",{class:te(O.$style["range-label"])},ht(f.value)+" - "+ht(p.value),3),ue(at,{variant:"tertiary",class:te([O.$style["cal-nav-btn"],O.$style.next]),"aria-label":"Next",disabled:S.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:he(({hovered:x})=>[ue(lt,{src:"AnglesRight",source:"remote",color:x?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),me("div",{class:te(O.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(K(!0),ie(It,null,Fn(b.value,x=>(K(),ie("div",{key:"yr-row-"+x,class:te(O.$style["year-grid-row"])},[(K(!0),ie(It,null,Fn(C(x),$=>(K(),ie("a",{key:$,tabindex:"0",class:te([O.$style["year-cell"],{[O.$style.selected]:$===i.value}]),onClick:W=>I($)},ht($),11,KZ))),128))],2))),128))],2)],2)):c.value==="months"?(K(),ie("div",{key:2,class:te(O.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[me("div",{class:te(O.$style.months)},[(K(!0),ie(It,null,Fn(s.value,(x,$)=>(K(),ie("a",{tabindex:"0",key:x,variant:$+1===a.value?"primary":"text",class:te([O.$style["month-cell"],{[O.$style.selected]:$+1===a.value}]),onClick:W=>T($+1)},ht(x),11,qZ))),128))],2)],2)):(K(),ie("div",{key:3,class:te(O.$style["days-slot"])},[Dt(O.$slots,"default",{year:i.value,month:a.value,mode:c.value})],2))],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_mtd4w_1","cal-nav-bar":"_cal-nav-bar_mtd4w_12","cal-nav-btn":"_cal-nav-btn_mtd4w_20",prev:"_prev_mtd4w_33","year-grid-header":"_year-grid-header_mtd4w_37","cal-nav-center":"_cal-nav-center_mtd4w_46","cal-nav-label":"_cal-nav-label_mtd4w_52","month-grid":"_month-grid_mtd4w_66","year-grid":"_year-grid_mtd4w_37",months:"_months_mtd4w_75","month-cell":"_month-cell_mtd4w_82","year-cell":"_year-cell_mtd4w_83","pg-btn":"_pg-btn_mtd4w_105","year-grid-body":"_year-grid-body_mtd4w_118","year-grid-row":"_year-grid-row_mtd4w_125",selected:"_selected_mtd4w_131","days-slot":"_days-slot_mtd4w_137","range-label":"_range-label_mtd4w_141"}}]]);function ZZ(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:o,maxDate:s}=e,r=V(""),i=q(()=>{const g=bt.fromFormat(r.value,t,{zone:n});return g.isValid?g:null}),a=q(()=>{if(!o||!i.value)return!0;const g={year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()},v={year:i.value.year,month:i.value.month,day:i.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 w=new Date(g.year,g.month-1,g.day),S=new Date(v.year,v.month-1,v.day);return w<S?-1:w>S?1:0},c=q(()=>{if(!s||!i.value)return!0;const g={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate()},v={year:i.value.year,month:i.value.month,day:i.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=q(()=>r.value.length==0||r.value.length>0&&i.value!==null&&a.value&&c.value),d=q(()=>r.value.length===t.length&&u.value);return{inputValue:r,isValid:u,isComplete:d,clear:()=>{r.value=""},setDate:g=>{let v;g instanceof Date?v=bt.fromJSDate(g,{zone:n}):v=g.setZone(n),v.isValid?r.value=v.toFormat(t):r.value=""},getDate:()=>u.value?i.value:null}}const XZ={key:0,style:{marginLeft:"8px"}},JZ=["disabled","readonly","placeholder"],SA=Ct(st({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear","blur","tab"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=n,i=V(null),a=V(null),{isValid:l,isComplete:c,inputValue:u,clear:d,setDate:h,getDate:f}=ZZ({format:s.format,allowPastDates:s.allowPastDates,allowFutureDates:s.allowFutureDates,timezone:s.timezone,minDate:s.minDate,maxDate:s.maxDate}),p=q(()=>s.active),g=q(()=>({disabled:s.disabled,error:!l.value&&u.value.length>0,readOnly:s.readOnly,isEmpty:u.value.length===0,inputRef:i,wrapperRef:a,active:p})),{argsMain:v,isHover:w,isFocus:S}=Co(g),b=T=>{var M;const P=(M=T.clipboardData)==null?void 0:M.getData("text/plain");P&&(u.value=P.trim())},C=T=>{if(T.key==="Escape"){r("blur"),T.target.blur(),T.preventDefault(),T.stopPropagation(),T.stopImmediatePropagation();return}else T.key==="Tab"&&I(T)},_=()=>{d(),r("clear")};t({clear:_,setDate:h,getDate:f,focus:()=>{var T;return(T=i.value)==null?void 0:T.focus()}}),tt(()=>s.modelValue,T=>{T?h(T):d()},{immediate:!0}),tt([()=>c.value,()=>u.value],()=>{if(u.value.length===0)r("complete",null);else if(l.value&&!s.readOnly&&!s.disabled&&c.value){const T=f();(T||u.value.length===0)&&r("complete",T)}}),tt(()=>l.value,T=>{T||r("invalid","")});const E=q(()=>!!s.isMultipleDate),I=T=>{T.preventDefault(),T.stopImmediatePropagation(),T.stopPropagation(),r("tab",T)};return(T,P)=>(K(),Ue(_o,Wt(H(v),{ref_key:"wrapperRef",ref:a,bordered:!0,actived:p.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:he(()=>[me("div",{class:te([T.$style["date-input-wrapper"]])},[E.value?(K(),ie("span",XZ," Multiple ")):Ke((K(),ie("input",{key:1,disabled:s.disabled,readonly:s.readOnly,ref_key:"inputRef",ref:i,type:"text","onUpdate:modelValue":P[0]||(P[0]=M=>mn(u)?u.value=M:null),onPaste:kt(b,["prevent"]),placeholder:s.placeholder,class:te([T.$style["date-input"]]),onKeydown:C},null,42,JZ)),[[QT,H(u)]]),Dt(T.$slots,"clear",{handleClear:_},()=>[(H(u).length>0||E.value)&&!s.readOnly&&!s.disabled&&(H(w)||H(S))?Ke((K(),Ue(at,{key:0,variant:["icon","primary"],onClick:kt(_,["stop"]),size:16,rounded:!0},{default:he(()=>[ue(lt,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[H(o),"Clear"]]):(K(),Ue(lt,{key:1,src:"Calendar",source:"remote",class:te(T.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),[["__cssModules",{$style:{"date-input-wrapper":"_date-input-wrapper_132fk_1","icon-calendar":"_icon-calendar_132fk_9",focus:"_focus_132fk_12",hover:"_hover_132fk_12",active:"_active_132fk_12","date-input":"_date-input_132fk_1",invalid:"_invalid_132fk_38"}}]]),QZ=st({__name:"Calendar",props:{params:{},label:{},value:{},timezone:{default:Hb()},format:{default:"LLL dd"},placeholder:{},enableRangeFeedback:{type:Boolean},messages:{},isCompleted:{type:Boolean},isStarted:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{},duePlaceholder:{default:"Due"},startPlaceholder:{default:"Start"},startTooltip:{default:"Select start date"},dueTooltip:{default:"Select due date"},showCalendarIcon:{type:Boolean,default:!0},locale:{default:"en-US"},immediatelyUpdate:{type:Boolean,default:!1},multipleStartDates:{type:Boolean},multipleDueDates:{type:Boolean}},emits:["clearStart","clearDue","clearAll","update","update:start","update:end","range:invalid","range:corrected","tracing","confirmed","closed","start-update","finish-update","tab"],setup(e,{expose:t,emit:n}){const o=V({case:"",behavior:""}),s=e,r=V(null),i=n,a=async(U,ge)=>{i("start-update"),await U(),i("finish-update"),vt(()=>{var oe,Re;ge(),(Re=(oe=s.params)==null?void 0:oe.api)==null||Re.stopEditing()})},l=(U,ge)=>{U(),vt(()=>{var oe,Re;ge(),(Re=(oe=s.params)==null?void 0:oe.api)==null||Re.stopEditing()})},c=()=>{var ge;const U=bt.now().setZone(s.timezone);z.value=U.year,ne.value=U.month,(ge=N.value)==null||ge.setNavigation(U.year,U.month)},u=ds({start:!1,end:!1}),{states:d,showMultipleStartDates:h,showMultipleDueDates:f,selectEndDate:p,cancelSelection:g,confirmSelection:v,selectStartDate:w,beginInteraction:S,clearStart:b,clearDue:C}=L7(s,i),_=q(()=>{if(d.isSelectingStart)return"start";if(d.isSelectingEnd)return"end"});tt(()=>s.multipleStartDates,U=>{h.value=!!U},{immediate:!0}),tt(()=>s.multipleDueDates,U=>{f.value=!!U},{immediate:!0});const E=V(null),I=V(null),T=U=>{U.preventDefault(),U.stopImmediatePropagation(),U.stopPropagation(),ae()},P=()=>{var U;(U=I.value)==null||U.focus()},M=U=>{if(!U){u.start=!1,b();return}const ge=d.endDate?bt.fromJSDate(d.endDate,{zone:s.timezone}):null;if(ge&&D(U,ge)>0){const Re={year:U.year,month:U.month,day:U.day};u.start=!1,w(Re,!1),p(Re),vt(()=>{d.isSelectingStart=!0,d.isSelectingEnd=!1});return}const oe={year:U.year,month:U.month,day:U.day};u.start=!1,w(oe,!0)},D=(U,ge)=>{const oe=U.startOf("day"),Re=ge.startOf("day");return oe<Re?-1:oe>Re?1:0},F=U=>{var ge;U.preventDefault(),U.stopImmediatePropagation(),U.stopPropagation(),(ge=document.querySelector('[data-index="prev-btn"]'))==null||ge.focus()},O=U=>{if(!U){u.end=!1,C();return}const ge=d.startDate?bt.fromJSDate(d.startDate,{zone:s.timezone}):null;if(ge&&D(U,ge)<0){const Re={year:U.year,month:U.month,day:U.day};u.end=!1,w(Re),p(Re),vt(()=>{d.isSelectingEnd=!0,d.isSelectingStart=!1});return}const oe={year:U.year,month:U.month,day:U.day};u.end=!1,p(oe)},k=()=>{h.value=!1,b()},x=()=>{f.value=!1,C()},$=()=>{ee()},W=q(()=>d.isSelectingStart||d.isSelectingEnd);function Q(){s.disabled||s.readOnly||(S(),d.isSelectingStart=!0,d.isSelectingEnd=!1,vt(()=>{var U;(U=r.value)==null||U.focus()}))}function ae(){s.disabled||s.readOnly||(S(),d.isSelectingEnd=!0,d.isSelectingStart=!1,vt(()=>{var U;(U=E.value)==null||U.focus()}))}function ee(){d.isSelectingStart=!1,d.isSelectingEnd=!1,i("closed")}function X(U){U.key==="Escape"?(U.stopPropagation(),ee()):U.key=="Tab"&&i("tab",U)}const N=V(null),z=V(new Date().getFullYear()),ne=V(new Date().getMonth()+1);tt(()=>[d.isSelectingStart,d.isSelectingEnd,d.startDate,d.endDate],()=>{d.isSelectingStart&&d.startDate?(z.value=d.startDate.getFullYear(),ne.value=d.startDate.getMonth()+1):d.isSelectingEnd&&d.endDate&&(z.value=d.endDate.getFullYear(),ne.value=d.endDate.getMonth()+1)},{immediate:!0});const pe=V(null);function ve(){if(Array.isArray(s.value)){const[ge,oe]=s.value;d.startDate=ge||null,d.endDate=oe||null}d.isSelectingStart=!1,d.isSelectingEnd=!1;const U=d.startDate||d.endDate||new Date;z.value=U.getFullYear(),ne.value=U.getMonth()+1}tt(()=>{var U,ge,oe,Re,G,Y,de,ke;return[((oe=(ge=(U=s.value)==null?void 0:U[0])==null?void 0:ge.getTime)==null?void 0:oe.call(ge))||((Re=s.value)==null?void 0:Re[0]),((de=(Y=(G=s.value)==null?void 0:G[1])==null?void 0:Y.getTime)==null?void 0:de.call(Y))||((ke=s.value)==null?void 0:ke[1]),s.timezone,s.format,s.placeholder,s.enableRangeFeedback]},()=>{ve()},{immediate:!0,deep:!0}),t({resetCalendarLogic:ve,openStart:Q,openEnd:ae,closePicker:ee,clearAll:$,isOpen:W,drpRef:pe,getValues:()=>({startDate:d.startDate,endDate:d.endDate,dateRange:[d.startDate,d.endDate]}),focus:()=>{d.startDate||d.endDate?d.startDate?Q():ae():Q()}});const re=V(null);return tt(()=>W.value,U=>{if(s.disabled||s.readOnly)return;const ge=re.value;ge&&(U?ge.show():ge.hide())},{immediate:!0}),(U,ge)=>(K(),ie("div",{class:te(U.$style["calendar-wrapper"]),ref_key:"calendarWrapperRef",ref:I,onKeydown:X,tabindex:"1","data-index":"calendar-wrapper"},[ue(YZ,{year:z.value,"onUpdate:year":ge[6]||(ge[6]=oe=>z.value=oe),month:ne.value,"onUpdate:month":ge[7]||(ge[7]=oe=>ne.value=oe),locale:s.locale,disabled:s.disabled,readOnly:s.readOnly,ref_key:"navigationRef",ref:N},{selection:he(()=>[me("div",{class:te(U.$style["calendar-input-section"])},[ue(SA,{ref_key:"starDateRef",ref:r,"model-value":H(d).startDate,placeholder:s.startPlaceholder,timezone:s.timezone,active:H(d).isSelectingStart,onClick:Q,onClear:k,onComplete:M,onInvalid:ge[0]||(ge[0]=oe=>u.start=!0),disabled:s.disabled,readOnly:s.readOnly,onBlur:P,onTab:T},null,8,["model-value","placeholder","timezone","active","disabled","readOnly"]),ue(SA,{ref_key:"endDateRef",ref:E,"model-value":H(d).endDate,placeholder:s.duePlaceholder,timezone:s.timezone,active:H(d).isSelectingEnd,onClick:ae,onClear:x,disabled:s.disabled,onComplete:O,onInvalid:ge[1]||(ge[1]=oe=>u.end=!0),readOnly:s.readOnly,isMultipleDate:H(f),onTab:F},null,8,["model-value","placeholder","timezone","active","disabled","readOnly","isMultipleDate"])],2)]),default:he(({year:oe,month:Re})=>[ue(jZ,{disabled:s.disabled,disableConfirm:u.end||u.start,readOnly:s.readOnly,ref_key:"drpRef",ref:pe,"tracing-case":o.value,"onUpdate:tracingCase":ge[2]||(ge[2]=G=>o.value=G),year:oe,month:Re,"start-date":H(d).startDate,"end-date":H(d).endDate,"active-field":_.value,timezone:s.timezone,immediatelyUpdate:e.immediatelyUpdate,onSelectStart:H(w),onSelectEnd:H(p),onGotoToday:c,onConfirm:ge[3]||(ge[3]=()=>{a(H(v),ee)}),onCancel:ge[4]||(ge[4]=G=>l(H(g),ee)),onClose:ge[5]||(ge[5]=G=>a(H(v),ee))},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))}}),Ym=Ct(QZ,[["__cssModules",{$style:{"calendar-wrapper":"_calendar-wrapper_139py_1","calendar-input-section":"_calendar-input-section_139py_11","display-wrapper":"_display-wrapper_139py_19","calendar-actions":"_calendar-actions_139py_23","clear-all-btn":"_clear-all-btn_139py_29"}}]]),eX=st({__name:"DateUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},rowSelected:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=t,o=e,s=yn("isSelectAll",V(!1)),r=yn("bulkUpdate",V(!1)),i=q(()=>!!o.entityId&&r.value&&s.value),{apiServices:a}=Zn(!r.value,o),l=yn("filterParams",null),c=V(null),u=async T=>{var P,M,D,F;try{C.value=!0,n("update-start");let O={workspaceId:o.workspaceId,entityId:o.entityId,itemIds:o.ids,startDate:void 0,dueDate:void 0,filterParams:l!=null&&l.value?l.value:void 0};"start"in T&&(O.startDate=T.start?km(T.start):null),"end"in T&&(O.dueDate=T.end?km(T.end):null),i.value?(O.itemIds=void 0,O.entityId=o.entityId):O.entityId=void 0,await((M=(P=a.value)==null?void 0:P.changeDate)==null?void 0:M.call(P,O)),n("updated",{workspaceId:o.workspaceId,itemIds:o.ids,data:O}),n("update-completed"),(D=c.value)==null||D.hide()}catch(O){console.error("Failed to update dates:",O),vt(()=>{vt(()=>{var k;n("update-failed"),(k=c.value)==null||k.open()})})}finally{(F=S.value)==null||F.resetCalendarLogic(),C.value=!1}},d=()=>{if(!o.rowSelected||o.rowSelected.length===0){h();return}o.rowSelected.length===1?f():p()},h=()=>{w.value=!1,v.value=!1,b.value=[null,null]},f=()=>{const P=o.rowSelected[0].dateRange;b.value=[(P==null?void 0:P[0])??null,(P==null?void 0:P[1])??null],w.value=!1,v.value=!1},p=()=>{var P,M;if(o.rowSelected.some(D=>D.dateRange&&(D.dateRange[0]!==null||D.dateRange[1]!==null))){const D=g(0),F=g(1);if(v.value=D,w.value=F,D)b.value[0]=null;else{const O=((P=o.rowSelected[0].dateRange)==null?void 0:P[0])??null;b.value[0]=O}if(F)b.value[1]=null;else{const O=((M=o.rowSelected[0].dateRange)==null?void 0:M[1])??null;b.value[1]=O}}else v.value=!1,w.value=!1,b.value=[null,null]},g=T=>{const P=o.rowSelected.map(D=>{var F;return(F=D.dateRange)==null?void 0:F[T]});return P.length===0?!1:new Set(P.map(D=>{var F;return(F=D==null?void 0:D.getTime)==null?void 0:F.call(D)})).size>1},v=V(!1),w=V(!1),S=V(null),b=V([null,null]);tt([()=>o.ids,()=>o.rowSelected],T=>{d(),vt(()=>{var P;(P=S.value)==null||P.focus()})},{immediate:!0,deep:!0});const C=V(!1),_=()=>{C.value=!0},E=()=>{vt(()=>{setTimeout(()=>{C.value=!1},500)})},I=(T,P)=>{T&&vt(()=>{var M;(M=S.value)==null||M.focus()})};return(T,P)=>(K(),Ue(yf,{ref_key:"wrapperRef",ref:c,isUpdating:C.value,disabled:o.disabled||C.value,onOnVisibleChange:I},{trigger:he(({hide:M,disabled:D})=>[ue(at,{variant:o.variant,loading:C.value,disabled:D,onEscape:M},{default:he(()=>[ue(lt,{src:"Calendar"}),P[0]||(P[0]=Qe(" Date ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:he(({isVisible:M,hide:D})=>[M?(K(),Ue(Ym,{key:0,immediatelyUpdate:!1,value:b.value,onConfirmed:u,ref_key:"calendarRef",ref:S,onClosed:D,onStartUpdate:_,onFinishUpdate:E,multipleDueDates:w.value,multipleStartDates:v.value},null,8,["value","onClosed","multipleDueDates","multipleStartDates"])):Xe("",!0)]),default:he(()=>[P[1]||(P[1]=Qe(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),tX=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"},EA=rc("metricStore",()=>{const e=V();return{metricList:e,setMetricList:o=>{e.value=o},checkEditType:o=>{var s;if(((s=o==null?void 0:o.auth_permission)==null?void 0:s.permission)==2)return tX(o)}}}),nX=["onKeydown"],oX=["width","height","viewBox"],sX=["d"],rX="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=st({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change","handleEnter","cancel"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=V(o.modelValue??0),i=V(null),a=q(()=>{var D;return((D=o.params)==null?void 0:D.size)??24}),l=q(()=>{var D;return((D=o.params)==null?void 0:D.iconViewBox)??"0 0 24 24"}),c=q(()=>{var D;return((D=o.params)==null?void 0:D.iconPath)??rX}),u=q(()=>{var D;return((D=o.params)==null?void 0:D.wrapperTag)??"span"}),d=q(()=>{var D;return o.disabled||((D=o.params)==null?void 0:D.disabled)||!1}),h=q(()=>{var D;return o.readOnly||((D=o.params)==null?void 0:D.readOnly)||!1}),f=q(()=>!d.value&&!h.value),p=q(()=>d.value?"not-allowed":h.value?"default":"pointer");tt(()=>o.modelValue,D=>{typeof D=="number"&&D!==r.value&&(r.value=D)});const g=D=>{var F;return((F=o.params)==null?void 0:F.maxRating)-D+1<=r.value&&!v.value},v=V(!1),w=()=>{v.value=!0},S=()=>{v.value=!1},b=D=>{f.value&&C(D)},C=D=>{var O,k;if(!f.value)return;let F=((O=o.params)==null?void 0:O.maxRating)-D+1;F===r.value&&(F=0),r.value=F,s("update:modelValue",F),s("update",F),s("change",F),(k=o.params)!=null&&k.onUpdate&&o.params.onUpdate(F)},_=D=>{var F;D!==r.value&&(r.value=D,s("update:modelValue",D),s("update",D),s("change",D),(F=o.params)!=null&&F.onUpdate&&o.params.onUpdate(D),E.value=D)},E=V(r.value),I=D=>{D.preventDefault(),D.stopPropagation(),D.stopImmediatePropagation(),r.value=E.value,s("cancel")},T=D=>{D.preventDefault(),_(r.value),s("handleEnter",r.value)},P=()=>{f.value&&(r.value=Math.min(r.value+1%(o.params.maxRating+1),o.params.maxRating),_(r.value))},M=()=>{f.value&&(r.value=Math.max(r.value-1,0),_(r.value))};return t({focus:()=>{var D;(D=i.value)==null||D.focus()}}),(D,F)=>(K(),ie("div",{class:te(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":h.value}]),style:cn({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:i,tabindex:"1",onKeydown:[jn(kt(M,["prevent"]),["left"]),jn(kt(P,["prevent"]),["right"]),jn(kt(M,["prevent"]),["down"]),jn(kt(P,["prevent"]),["up"]),jn(kt(T,["prevent"]),["enter"]),jn(kt(T,["prevent"]),["tab"]),jn(kt(I,["prevent"]),["escape"])]},[(K(!0),ie(It,null,Fn(e.params.maxRating,O=>(K(),Ue($w(u.value),{key:O,class:te(["rating-item",{filled:g(O),"rating-item--disabled":d.value,"rating-item--readOnly":h.value}]),style:cn({cursor:p.value,order:e.params.maxRating-O,height:a.value+"px",width:a.value+"px"}),"aria-checked":g(O),"aria-disabled":d.value,"aria-readOnly":h.value,title:e.params.maxRating-O+1,tabindex:-1,onClick:kt(k=>b(O),["prevent","stop"]),onMouseenter:w,onMouseleave:S},{default:he(()=>[Dt(D.$slots,"icon",{index:O,filled:g(O),size:a.value,iconViewBox:l.value,disabled:d.value,readOnly:h.value,value:O},()=>[(K(),ie("svg",{class:"rating-icon",width:a.value,height:a.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[me("path",{d:c.value},null,8,sX)],8,oX))]),Dt(D.$slots,"overlay",{index:O,filled:g(O),disabled:d.value,readOnly:h.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,nX))}}),iX={style:{maxWidth:"180px",lineHeight:"15px"}},aX=["innerHTML"],RA=st({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=n,i=()=>{r("handleCancel")},a=()=>{r("close")},l=v=>{var w;if(v.format_type==="dropdown"&&v.format_value)try{const S=JSON.parse(v.format_value);if(Array.isArray(S)){const b=S.map(C=>({label:C.name,value:C.name,id:C.name}));return b.unshift({label:"-",value:void 0,id:"-"}),b}}catch(S){console.error("Failed to parse dropdown options",S)}if(v.format_type=="number"&&v.restricted_type=="exact"){const S=((w=v.restricted_value)==null?void 0:w.split(",").map(b=>({label:v.mapping[`!${b}`]||b,value:b,id:b})))||[];return S.unshift({label:"-",value:void 0,id:"-"}),S}return[]},c=q(()=>l(s.config)),u=V(s.modelValue),d=v=>{u.value=v,r("update:modelValue",v),r("change",v||null)},h=V(c.value),f=V(!1),p=v=>{f.value=!0,v?h.value=c.value.filter(w=>w.label.toLowerCase().includes(v.toLowerCase())):h.value=c.value,setTimeout(()=>{f.value=!1},300)},g=V(null);return Qt(()=>{var v;(v=g.value)==null||v.focus()}),t({focus:()=>{var v;(v=g.value)==null||v.focus()}}),(v,w)=>(K(),Ue(na,{style:{width:326},loading:f.value,options:h.value,"selected-id":e.modelValue||void 0,onSearch:p,onSelect:w[0]||(w[0]=S=>d(S.id)),ref_key:"searchListRef",ref:g,onClose:a,onCancel:i},{item:he(({item:S,getHighlightedLabel:b,selectedIndex:C,index:_})=>[ue(ic,{hover:C==_,selected:S.value===e.modelValue,label:S.label,onSelect:E=>d(S.value||null),onClick:E=>d(S.value||null)},{label:he(()=>[me("div",iX,[Ke(me("span",{innerHTML:b(S.label)},null,8,aX),[[H(o),{content:S.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":he(()=>[...w[1]||(w[1]=[Qe("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),lX={class:"metric-input-wrapper"},cX={key:0,class:"error-text input-2"},DA=st({__name:"MetricEditorInput",props:{config:{},modelValue:{},saveOnBlur:{type:Boolean,default:!0},saveOnEscape:{type:Boolean,default:!1},showInlineError:{type:Boolean,default:!1}},emits:["update:modelValue","handleChange","cancel","enter","onValidation"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=V(s.modelValue),i=V(s.modelValue),a=V(!1),l=V(!0),c=V(""),u=q(()=>{var x;const k=Number.parseInt(String((x=s.config)==null?void 0:x.format_value)||"2",10);return Number.isFinite(k)&&k>=0?k:2}),d=k=>{if(!k)return k;const x=String(k).split(".");return x.length>1&&x[1].length>u.value?u.value===0?x[0]:`${x[0]}.${x[1].slice(0,u.value)}`:String(k)},h=k=>{const x=d(k);x!==k&&b.value?r.value=x:r.value=k},f=k=>{const x=k.target;if(!x)return;const $=x.value||"",W=$.indexOf(".");if(k.key==="."&&u.value===0){k.preventDefault();return}W!==-1&&/[0-9]/.test(k.key)&&$.slice(W+1).length>=u.value&&k.preventDefault()},p=q(()=>l.value||s.showInlineError?{content:""}:{content:c.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),g=()=>{var X;const k=s.config.restricted_type.trim(),x=((X=s.config.restricted_value)==null?void 0:X.split(",").map(Number))||[],[$,W]=x,ae={range:`Enter a value between ${$} and ${W}`,not:`These values are not allowed: ${x.join(", ")}`,exact:"Value is not allowed"}[k];return l.value?"":ae},v=q(()=>{var x;let k="";return Number((x=s.config)==null?void 0:x.format_value)&&(k+="."+Array.from({length:Number(s.config.format_value)}).map(()=>"0").join("")),`0${k}`});tt(()=>s.modelValue,k=>{r.value=k,i.value=k});const w=k=>Im(s.config,k),S=n,b=V(null),C=k=>{const x=k===""?null:k,$=i.value===""?null:i.value;return x!==$},_=k=>{const x=d(k);if(!C(x))return!1;const $=x===""?null:x;return r.value=$,i.value=$,S("update:modelValue",$),S("handleChange",$),!0},E=()=>{r.value=i.value,S("update:modelValue",i.value)},I=(k,x)=>{_(k),S("enter")},T=(k,x)=>{if(a.value){a.value=!1;return}s.saveOnBlur?_(k):E()},P=k=>{if(k===null||k===""){l.value=!0;return}l.value=Im(s.config,Number(k)),c.value=l.value?"":g()},M=(k,x)=>{a.value=!0,s.saveOnEscape?_(k):E(),S("cancel"),setTimeout(()=>{a.value=!1},100)},D=k=>{P(k),S("onValidation",k)},F=()=>{a.value=!0,E(),S("cancel"),setTimeout(()=>{a.value=!1},100)},O=()=>{var k;r.value=null,i.value=null,S("update:modelValue",null),S("handleChange",null),(k=b.value)==null||k.focus()};return t({focus:()=>{var k;return(k=b.value)==null?void 0:k.focus()},blur:()=>{var k;return(k=b.value)==null?void 0:k.blur()},getValue:()=>r.value,getCachedValue:()=>i.value,save:()=>_(r.value),revert:E}),Qt(()=>{var k;(k=b.value)==null||k.focus()}),(k,x)=>Ke((K(),ie("div",lX,[ue(SS,{maxDecimalChar:u.value,modelValue:r.value,"onUpdate:modelValue":x[0]||(x[0]=$=>r.value=$),placeholder:v.value,validatorFnc:w,style:{"--bg-input":"#FAFAFA"},onInput:h,onKeydown:f,onEnter:I,onBlur:T,onClear:O,onEscape:M,onCancel:F,onOnValidation:D,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:b},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(K(),ie("span",cX,ht(c.value),1)):Xe("",!0)])),[[H(o),p.value]])}}),uX={key:2},dX={class:"wrapper-suffix"},hX={key:3},fX=Ct(st({__name:"MetricEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},config:{},attachTo:{},focus:{type:Boolean}},emits:["enter","cancel","blur","updateMetric"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=V(null),i=V(0),a=V(null),l=V(null),c=q(()=>uP(s.config)),u=V(!1),d=q(()=>!!pe.value),h=n,f=()=>{u.value=!1,ne(),h("cancel")},p=V(!0),g=re=>{if(re===null||re===""){p.value=!0;return}if(c.value!=="number"){p.value=!0;return}p.value=Im(s.config,Number(re)),w.value=S()},v=()=>{u.value=!0,W()},w=V(""),S=()=>{var de;const re=s.config.restricted_type.trim(),U=((de=s.config.restricted_value)==null?void 0:de.split(",").map(Number))||[],[ge,oe]=U,G={range:`Enter a value between ${ge} and ${oe}`,not:`These values are not allowed: ${U.join(", ")}`,exact:"Value is not allowed"}[re];return p.value?"":G},b=q(()=>{var U;const re=Number.parseInt(String((U=s.config)==null?void 0:U.format_value)||"2",10);return Number.isFinite(re)&&re>=0?re:2}),C=re=>{u.value=!0,r.value=re},_=()=>{u.value=!0,ne(),W()},E=re=>{i.value=re,u.value=!0,W()},I=()=>(s.config.format_symbol||"BoltSolid").split(/[\s-_]+/).map(U=>U.charAt(0).toUpperCase()+U.slice(1)).join("").replace(/Outline|Solid/g,""),T=V(null),P=V(!0),M=q(()=>{var re;return{disabled:s.disabled,error:!1,readOnly:!1,isEmpty:((re=r.value)==null?void 0:re.length)===0,wrapperRef:N,active:d,focus:s.focus,bordered:!0}}),D=V(null),F=q(()=>P.value),O=q(()=>({disabled:s.disabled,error:!1,readOnly:!1,isEmpty:i.value===0,wrapperRef:D,active:F,focus:P.value,bordered:!0})),{argsMain:k}=Co(O),{argsMain:x}=Co(M),$=V(null),W=()=>{vt(()=>{var re;(re=$.value)==null||re.focus()})},Q=re=>{var U;if(re.format_type==="dropdown"&&re.format_value)try{const ge=JSON.parse(re.format_value);if(Array.isArray(ge))return ge.map(oe=>({label:oe.name,value:oe.name,id:oe.name}))}catch(ge){console.error("Failed to parse dropdown options",ge)}return re.format_type=="number"&&re.restricted_type=="exact"?((U=re.restricted_value)==null?void 0:U.split(",").map(oe=>({label:re.mapping[`!${oe}`]||oe,value:oe,id:oe})))||[]:[]},ae=q(()=>Q(s.config)),ee=q(()=>{var re;return((re=ae.value.find(U=>U.value===r.value))==null?void 0:re.label)||r.value||"-"}),X=()=>{var re;if(c.value=="rating")h("updateMetric",i.value==0?null:i.value);else if(c.value=="number"){const U=(re=l.value)==null?void 0:re.getValue();h("updateMetric",U||null)}else h("updateMetric",r.value||null);u.value=!1,ne()},{triggerRef:N,popupRef:z,hide:ne,isVisible:pe,show:ve}=yo({toggleOnClick:!0,appendTo:()=>s.attachTo||"parent",zIndex:1e4,offset:[0,0]}),we=()=>{switch(c.value){case"number":vt(()=>{var re;(re=l.value)==null||re.focus()});break;case"dropdown":ve(),vt(()=>{var re;(re=T.value)==null||re.focus()});break;case"rating":P.value=!0,vt(()=>{var re;(re=a.value)==null||re.focus()});break}};return t({resetState:()=>{r.value=null,i.value=0,u.value=!1},focus:we,hasChanges:()=>u.value}),Qt(()=>{vt(()=>{setTimeout(()=>{we()},300)})}),(re,U)=>(K(),ie("div",{class:te(re.$style["metric-editor"])},[c.value=="number"?(K(),Ue(DA,{key:0,config:s.config,modelValue:r.value,"onUpdate:modelValue":U[0]||(U[0]=ge=>r.value=ge),style:{width:"100%"},saveOnBlur:!0,saveOnEscape:!1,"show-inline-error":!0,onCancel:f,onOnValidation:g,onEnter:v,onHandleChange:C,maxDecimalChar:b.value,ref_key:"metricEditorInputRef",ref:l},null,8,["config","modelValue","maxDecimalChar"])):c.value=="rating"?(K(),Ue(_o,Wt({key:1,"tab-index":1},H(k),{ref_key:"triggerRef2",ref:D,bordered:!0,style:{"--box-padding":"0 ","--icon-size":"18px",background:"#FAFAFA"}}),{default:he(()=>[ue(_A,{params:{maxRating:s.config.range},modelValue:i.value,"onUpdate:modelValue":U[1]||(U[1]=ge=>i.value=ge),onHandleEnter:E,onCancel:f,ref_key:"ratingComponentRef",ref:a},{icon:he(()=>[ue(lt,{source:"rating",src:I()||"Star",size:17},null,8,["src"])]),_:1},8,["params","modelValue"])]),_:1},16)):c.value=="dropdown"?(K(),ie("div",uX,[ue(_o,Wt(H(x),{ref_key:"triggerRef",ref:N,bordered:!0,style:{"--box-padding":"0 4px 0 4px","--icon-size":"18px",background:"#FAFAFA"}}),{suffix:he(({})=>[me("div",dX,[ue(lt,{src:"ChevronDown",color:"#A6A6A6",size:"12"})])]),default:he(()=>[Ke((K(),ie("span",null,[Qe(ht(ee.value||""),1)])),[[H(o),{content:ee.value}]])]),_:1},16),me("div",{ref_key:"popupRef",ref:z},[H(pe)?(K(),Ue(RA,{key:0,ref_key:"metricEditorDropdownRef",ref:T,config:s.config,modelValue:r.value,"onUpdate:modelValue":U[2]||(U[2]=ge=>r.value=ge),onChange:_,onCancel:f},null,8,["config","modelValue"])):Xe("",!0)],512)])):(K(),ie("span",hX,"Formular")),Ke((K(),Ue(at,{ref_key:"confirmButtonRef",ref:$,onHandleClick:X,"tab-index":"1",onKeypress:[jn(kt(we,["shift","prevent"]),["tab"]),jn(kt(f,["prevent"]),["escape"])],disabled:!p.value},{default:he(()=>[ue(lt,{src:"Check"})]),_:1},8,["onKeypress","disabled"])),[[H(o),"Update"]])],2))}}),[["__cssModules",{$style:{"metric-editor":"_metric-editor_18l4p_1","dropdown-trigger":"_dropdown-trigger_18l4p_10"}}]]),pX=Ct(st({__name:"MetricBulkItem",props:{label:{},morpheme:{},type:{},config:{},attachTo:{}},emits:["loseFocus","open","handleUpdate","focusOnSearch","openSibling"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=n,i=V(!1),a=V(null),l=V(null),c=()=>{i.value=!i.value},u=()=>{var g;i.value=!1,(g=l.value)==null||g.resetState()},d=async()=>{var g;i.value=!0,await vt(),(g=l.value)==null||g.focus()},h=g=>{r("handleUpdate",{id:s.config.id.toString(),value:g})},f=()=>{var g;(g=a.value)==null||g.focus(),r("loseFocus")},p=g=>{const w={Escape:()=>{g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation(),r("focusOnSearch",g)},Tab:()=>{i.value&&u()},Enter:()=>{i.value||d()},ArrowDown:()=>{r("openSibling","down")},ArrowUp:()=>{r("openSibling","up")}}[g.key];w&&w()};return tt(i,g=>{g&&r("open")}),t({hide:u,show:d}),(g,v)=>(K(),ie("div",{class:te([g.$style["metric-item"],i.value?g.$style.open:""]),tabindex:"0",ref_key:"metricRef",ref:a,onKeydown:p},[me("div",{class:te(g.$style["metric-label"]),onClick:kt(c,["stop"])},[Dt(g.$slots,"default",{open:i.value},()=>[Ke((K(),ie("span",{class:te(g.$style["metric-name"])},[Qe(ht(e.label),1)],2)),[[H(o),{content:e.label}]]),e.morpheme&&i.value?(K(),ie("small",{key:0,class:te(g.$style["metric-morpheme"])}," ("+ht(e.morpheme)+") ",3)):Xe("",!0)])],2),ue(xT,{mode:"out-in",name:"slide"},{default:he(()=>[i.value?(K(),Ue(fX,{key:`editor-${e.config.id}`,"read-only":!1,focus:i.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"])):Xe("",!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 Uu=(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))(Uu||{});function TA(e,t){return function(){return e.apply(t,arguments)}}const{toString:gX}=Object.prototype,{getPrototypeOf:RS}=Object,{iterator:Zm,toStringTag:IA}=Symbol,Xm=(e=>t=>{const n=gX.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Mr=e=>(e=e.toLowerCase(),t=>Xm(t)===e),Jm=e=>t=>typeof t===e,{isArray:Wu}=Array,zu=Jm("undefined");function Cf(e){return e!==null&&!zu(e)&&e.constructor!==null&&!zu(e.constructor)&&ps(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const xA=Mr("ArrayBuffer");function mX(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&xA(e.buffer),t}const vX=Jm("string"),ps=Jm("function"),FA=Jm("number"),bf=e=>e!==null&&typeof e=="object",yX=e=>e===!0||e===!1,Qm=e=>{if(Xm(e)!=="object")return!1;const t=RS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(IA in e)&&!(Zm in e)},wX=e=>{if(!bf(e)||Cf(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},CX=Mr("Date"),bX=Mr("File"),SX=Mr("Blob"),EX=Mr("FileList"),_X=e=>bf(e)&&ps(e.pipe),RX=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ps(e.append)&&((t=Xm(e))==="formdata"||t==="object"&&ps(e.toString)&&e.toString()==="[object FormData]"))},DX=Mr("URLSearchParams"),[TX,IX,xX,FX]=["ReadableStream","Request","Response","Headers"].map(Mr),PX=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Sf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let o,s;if(typeof e!="object"&&(e=[e]),Wu(e))for(o=0,s=e.length;o<s;o++)t.call(null,e[o],o,e);else{if(Cf(e))return;const r=n?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let a;for(o=0;o<i;o++)a=r[o],t.call(null,e[a],a,e)}}function PA(e,t){if(Cf(e))return null;t=t.toLowerCase();const n=Object.keys(e);let o=n.length,s;for(;o-- >0;)if(s=n[o],t===s.toLowerCase())return s;return null}const ac=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,kA=e=>!zu(e)&&e!==ac;function DS(){const{caseless:e,skipUndefined:t}=kA(this)&&this||{},n={},o=(s,r)=>{const i=e&&PA(n,r)||r;Qm(n[i])&&Qm(s)?n[i]=DS(n[i],s):Qm(s)?n[i]=DS({},s):Wu(s)?n[i]=s.slice():(!t||!zu(s))&&(n[i]=s)};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Sf(arguments[s],o);return n}const kX=(e,t,n,{allOwnKeys:o}={})=>(Sf(t,(s,r)=>{n&&ps(s)?e[r]=TA(s,n):e[r]=s},{allOwnKeys:o}),e),AX=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),OX=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},MX=(e,t,n,o)=>{let s,r,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),r=s.length;r-- >0;)i=s[r],(!o||o(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&RS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},NX=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return o!==-1&&o===n},LX=e=>{if(!e)return null;if(Wu(e))return e;let t=e.length;if(!FA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},VX=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&RS(Uint8Array)),BX=(e,t)=>{const o=(e&&e[Zm]).call(e);let s;for(;(s=o.next())&&!s.done;){const r=s.value;t.call(e,r[0],r[1])}},$X=(e,t)=>{let n;const o=[];for(;(n=e.exec(t))!==null;)o.push(n);return o},HX=Mr("HTMLFormElement"),GX=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,s){return o.toUpperCase()+s}),AA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),UX=Mr("RegExp"),OA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};Sf(n,(s,r)=>{let i;(i=t(s,r,e))!==!1&&(o[r]=i||s)}),Object.defineProperties(e,o)},WX=e=>{OA(e,(t,n)=>{if(ps(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const o=e[n];if(ps(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},zX=(e,t)=>{const n={},o=s=>{s.forEach(r=>{n[r]=!0})};return Wu(e)?o(e):o(String(e).split(t)),n},jX=()=>{},KX=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function qX(e){return!!(e&&ps(e.append)&&e[IA]==="FormData"&&e[Zm])}const YX=e=>{const t=new Array(10),n=(o,s)=>{if(bf(o)){if(t.indexOf(o)>=0)return;if(Cf(o))return o;if(!("toJSON"in o)){t[s]=o;const r=Wu(o)?[]:{};return Sf(o,(i,a)=>{const l=n(i,s+1);!zu(l)&&(r[a]=l)}),t[s]=void 0,r}}return o};return n(e,0)},ZX=Mr("AsyncFunction"),XX=e=>e&&(bf(e)||ps(e))&&ps(e.then)&&ps(e.catch),MA=((e,t)=>e?setImmediate:t?((n,o)=>(ac.addEventListener("message",({source:s,data:r})=>{s===ac&&r===n&&o.length&&o.shift()()},!1),s=>{o.push(s),ac.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ps(ac.postMessage)),JX=typeof queueMicrotask<"u"?queueMicrotask.bind(ac):typeof J<"u"&&J.nextTick||MA,Be={isArray:Wu,isArrayBuffer:xA,isBuffer:Cf,isFormData:RX,isArrayBufferView:mX,isString:vX,isNumber:FA,isBoolean:yX,isObject:bf,isPlainObject:Qm,isEmptyObject:wX,isReadableStream:TX,isRequest:IX,isResponse:xX,isHeaders:FX,isUndefined:zu,isDate:CX,isFile:bX,isBlob:SX,isRegExp:UX,isFunction:ps,isStream:_X,isURLSearchParams:DX,isTypedArray:VX,isFileList:EX,forEach:Sf,merge:DS,extend:kX,trim:PX,stripBOM:AX,inherits:OX,toFlatObject:MX,kindOf:Xm,kindOfTest:Mr,endsWith:NX,toArray:LX,forEachEntry:BX,matchAll:$X,isHTMLForm:HX,hasOwnProperty:AA,hasOwnProp:AA,reduceDescriptors:OA,freezeMethods:WX,toObjectSet:zX,toCamelCase:GX,noop:jX,toFiniteNumber:KX,findKey:PA,global:ac,isContextDefined:kA,isSpecCompliantForm:qX,toJSONObject:YX,isAsyncFn:ZX,isThenable:XX,setImmediate:MA,asap:JX,isIterable:e=>e!=null&&ps(e[Zm])};function Zt(e,t,n,o,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),s&&(this.response=s,this.status=s.status?s.status:null)}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 NA=Zt.prototype,LA={};["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=>{LA[e]={value:e}}),Object.defineProperties(Zt,LA),Object.defineProperty(NA,"isAxiosError",{value:!0}),Zt.from=(e,t,n,o,s,r)=>{const i=Object.create(NA);Be.toFlatObject(e,i,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(i,a,l,n,o,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",r&&Object.assign(i,r),i};const QX=null;function TS(e){return Be.isPlainObject(e)||Be.isArray(e)}function VA(e){return Be.endsWith(e,"[]")?e.slice(0,-2):e}function BA(e,t,n){return e?e.concat(t).map(function(s,r){return s=VA(s),!n&&r?"["+s+"]":s}).join(n?".":""):t}function eJ(e){return Be.isArray(e)&&!e.some(TS)}const tJ=Be.toFlatObject(Be,{},null,function(t){return/^is[A-Z]/.test(t)});function ev(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 o=n.metaTokens,s=n.visitor||u,r=n.dots,i=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Be.isSpecCompliantForm(t);if(!Be.isFunction(s))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 w=p;if(p&&!v&&typeof p=="object"){if(Be.endsWith(g,"{}"))g=o?g:g.slice(0,-2),p=JSON.stringify(p);else if(Be.isArray(p)&&eJ(p)||(Be.isFileList(p)||Be.endsWith(g,"[]"))&&(w=Be.toArray(p)))return g=VA(g),w.forEach(function(b,C){!(Be.isUndefined(b)||b===null)&&t.append(i===!0?BA([g],C,r):i===null?g:g+"[]",c(b))}),!1}return TS(p)?!0:(t.append(BA(v,g,r),c(p)),!1)}const d=[],h=Object.assign(tJ,{defaultVisitor:u,convertValue:c,isVisitable:TS});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(w,S){(!(Be.isUndefined(w)||w===null)&&s.call(t,w,Be.isString(S)?S.trim():S,g,h))===!0&&f(w,g?g.concat(S):[S])}),d.pop()}}if(!Be.isObject(e))throw new TypeError("data must be an object");return f(e),t}function $A(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function IS(e,t){this._pairs=[],e&&ev(e,this,t)}const HA=IS.prototype;HA.append=function(t,n){this._pairs.push([t,n])},HA.toString=function(t){const n=t?function(o){return t.call(this,o,$A)}:$A;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function nJ(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function GA(e,t,n){if(!t)return e;const o=n&&n.encode||nJ;Be.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let r;if(s?r=s(t,n):r=Be.isURLSearchParams(t)?t.toString():new IS(t,n).toString(o),r){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e}class UA{constructor(){this.handlers=[]}use(t,n,o){return this.handlers.push({fulfilled:t,rejected:n,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Be.forEach(this.handlers,function(o){o!==null&&t(o)})}}const WA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},oJ={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:IS,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xS=typeof window<"u"&&typeof document<"u",FS=typeof navigator=="object"&&navigator||void 0,sJ=xS&&(!FS||["ReactNative","NativeScript","NS"].indexOf(FS.product)<0),rJ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",iJ=xS&&window.location.href||"http://localhost",zo={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xS,hasStandardBrowserEnv:sJ,hasStandardBrowserWebWorkerEnv:rJ,navigator:FS,origin:iJ},Symbol.toStringTag,{value:"Module"})),...oJ};function aJ(e,t){return ev(e,new zo.classes.URLSearchParams,{visitor:function(n,o,s,r){return zo.isNode&&Be.isBuffer(n)?(this.append(o,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}function lJ(e){return Be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function cJ(e){const t={},n=Object.keys(e);let o;const s=n.length;let r;for(o=0;o<s;o++)r=n[o],t[r]=e[r];return t}function zA(e){function t(n,o,s,r){let i=n[r++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),l=r>=n.length;return i=!i&&Be.isArray(s)?s.length:i,l?(Be.hasOwnProp(s,i)?s[i]=[s[i],o]:s[i]=o,!a):((!s[i]||!Be.isObject(s[i]))&&(s[i]=[]),t(n,o,s[i],r)&&Be.isArray(s[i])&&(s[i]=cJ(s[i])),!a)}if(Be.isFormData(e)&&Be.isFunction(e.entries)){const n={};return Be.forEachEntry(e,(o,s)=>{t(lJ(o),s,n,0)}),n}return null}function uJ(e,t,n){if(Be.isString(e))try{return(t||JSON.parse)(e),Be.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(n||JSON.stringify)(e)}const Ef={transitional:WA,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const o=n.getContentType()||"",s=o.indexOf("application/json")>-1,r=Be.isObject(t);if(r&&Be.isHTMLForm(t)&&(t=new FormData(t)),Be.isFormData(t))return s?JSON.stringify(zA(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(r){if(o.indexOf("application/x-www-form-urlencoded")>-1)return aJ(t,this.formSerializer).toString();if((a=Be.isFileList(t))||o.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ev(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return r||s?(n.setContentType("application/json",!1),uJ(t)):t}],transformResponse:[function(t){const n=this.transitional||Ef.transitional,o=n&&n.forcedJSONParsing,s=this.responseType==="json";if(Be.isResponse(t)||Be.isReadableStream(t))return t;if(t&&Be.isString(t)&&(o&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)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:zo.classes.FormData,Blob:zo.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 dJ=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"]),hJ=e=>{const t={};let n,o,s;return e&&e.split(`
147
147
  `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),o=i.substring(s+1).trim(),!(!n||t[n]&&dJ[n])&&(n==="set-cookie"?t[n]?t[n].push(o):t[n]=[o]:t[n]=t[n]?t[n]+", "+o:o)}),t},jA=Symbol("internals");function _f(e){return e&&String(e).trim().toLowerCase()}function tv(e){return e===!1||e==null?e:Be.isArray(e)?e.map(tv):String(e)}function fJ(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}const pJ=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function PS(e,t,n,o,s){if(Be.isFunction(o))return o.call(this,t,n);if(s&&(t=n),!!Be.isString(t)){if(Be.isString(o))return t.indexOf(o)!==-1;if(Be.isRegExp(o))return o.test(t)}}function gJ(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,o)=>n.toUpperCase()+o)}function mJ(e,t){const n=Be.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+n,{value:function(s,r,i){return this[o].call(this,t,s,r,i)},configurable:!0})})}let gs=class{constructor(t){t&&this.set(t)}set(t,n,o){const s=this;function r(a,l,c){const u=_f(l);if(!u)throw new Error("header name must be a non-empty string");const d=Be.findKey(s,u);(!d||s[d]===void 0||c===!0||c===void 0&&s[d]!==!1)&&(s[d||l]=tv(a))}const i=(a,l)=>Be.forEach(a,(c,u)=>r(c,u,l));if(Be.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(Be.isString(t)&&(t=t.trim())&&!pJ(t))i(hJ(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]}i(a,n)}else t!=null&&r(n,t,o);return this}get(t,n){if(t=_f(t),t){const o=Be.findKey(this,t);if(o){const s=this[o];if(!n)return s;if(n===!0)return fJ(s);if(Be.isFunction(n))return n.call(this,s,o);if(Be.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=_f(t),t){const o=Be.findKey(this,t);return!!(o&&this[o]!==void 0&&(!n||PS(this,this[o],o,n)))}return!1}delete(t,n){const o=this;let s=!1;function r(i){if(i=_f(i),i){const a=Be.findKey(o,i);a&&(!n||PS(o,o[a],a,n))&&(delete o[a],s=!0)}}return Be.isArray(t)?t.forEach(r):r(t),s}clear(t){const n=Object.keys(this);let o=n.length,s=!1;for(;o--;){const r=n[o];(!t||PS(this,this[r],r,t,!0))&&(delete this[r],s=!0)}return s}normalize(t){const n=this,o={};return Be.forEach(this,(s,r)=>{const i=Be.findKey(o,r);if(i){n[i]=tv(s),delete n[r];return}const a=t?gJ(r):String(r).trim();a!==r&&delete n[r],n[a]=tv(s),o[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Be.forEach(this,(o,s)=>{o!=null&&o!==!1&&(n[s]=t&&Be.isArray(o)?o.join(", "):o)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
148
148
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const o=new this(t);return n.forEach(s=>o.set(s)),o}static accessor(t){const o=(this[jA]=this[jA]={accessors:{}}).accessors,s=this.prototype;function r(i){const a=_f(i);o[a]||(mJ(s,i),o[a]=!0)}return Be.isArray(t)?t.forEach(r):r(t),this}};gs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Be.reduceDescriptors(gs.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}}),Be.freezeMethods(gs);function kS(e,t){const n=this||Ef,o=t||n,s=gs.from(o.headers);let r=o.data;return Be.forEach(e,function(a){r=a.call(n,r,s.normalize(),t?t.status:void 0)}),s.normalize(),r}function KA(e){return!!(e&&e.__CANCEL__)}function ju(e,t,n){Zt.call(this,e??"canceled",Zt.ERR_CANCELED,t,n),this.name="CanceledError"}Be.inherits(ju,Zt,{__CANCEL__:!0});function qA(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new Zt("Request failed with status code "+n.status,[Zt.ERR_BAD_REQUEST,Zt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function vJ(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function yJ(e,t){e=e||10;const n=new Array(e),o=new Array(e);let s=0,r=0,i;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=o[r];i||(i=c),n[s]=l,o[s]=c;let d=r,h=0;for(;d!==s;)h+=n[d++],d=d%e;if(s=(s+1)%e,s===r&&(r=(r+1)%e),c-i<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function wJ(e,t){let n=0,o=1e3/t,s,r;const i=(c,u=Date.now())=>{n=u,s=null,r&&(clearTimeout(r),r=null),e(...c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=o?i(c,u):(s=c,r||(r=setTimeout(()=>{r=null,i(s)},o-d)))},()=>s&&i(s)]}const nv=(e,t,n=3)=>{let o=0;const s=yJ(50,250);return wJ(r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,l=i-o,c=s(l),u=i<=a;o=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-i)/c:void 0,event:r,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},YA=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},ZA=e=>(...t)=>Be.asap(()=>e(...t)),CJ=zo.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,zo.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(zo.origin),zo.navigator&&/(msie|trident)/i.test(zo.navigator.userAgent)):()=>!0,bJ=zo.hasStandardBrowserEnv?{write(e,t,n,o,s,r,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];Be.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Be.isString(o)&&a.push(`path=${o}`),Be.isString(s)&&a.push(`domain=${s}`),r===!0&&a.push("secure"),Be.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function SJ(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function EJ(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function XA(e,t,n){let o=!SJ(t);return e&&(o||n==!1)?EJ(e,t):t}const JA=e=>e instanceof gs?{...e}:e;function lc(e,t){t=t||{};const n={};function o(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 s(c,u,d,h){if(Be.isUndefined(u)){if(!Be.isUndefined(c))return o(void 0,c,d,h)}else return o(c,u,d,h)}function r(c,u){if(!Be.isUndefined(u))return o(void 0,u)}function i(c,u){if(Be.isUndefined(u)){if(!Be.isUndefined(c))return o(void 0,c)}else return o(void 0,u)}function a(c,u,d){if(d in t)return o(c,u);if(d in e)return o(void 0,c)}const l={url:r,method:r,data:r,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(c,u,d)=>s(JA(c),JA(u),d,!0)};return Be.forEach(Object.keys({...e,...t}),function(u){const d=l[u]||s,h=d(e[u],t[u],u);Be.isUndefined(h)&&d!==a||(n[u]=h)}),n}const QA=e=>{const t=lc({},e);let{data:n,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:r,headers:i,auth:a}=t;if(t.headers=i=gs.from(i),t.url=GA(XA(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Be.isFormData(n)){if(zo.hasStandardBrowserEnv||zo.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(Be.isFunction(n.getHeaders)){const l=n.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([u,d])=>{c.includes(u.toLowerCase())&&i.set(u,d)})}}if(zo.hasStandardBrowserEnv&&(o&&Be.isFunction(o)&&(o=o(t)),o||o!==!1&&CJ(t.url))){const l=s&&r&&bJ.read(r);l&&i.set(s,l)}return t},_J=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,o){const s=QA(e);let r=s.data;const i=gs.from(s.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=s,u,d,h,f,p;function g(){f&&f(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(s.method.toUpperCase(),s.url,!0),v.timeout=s.timeout;function w(){if(!v)return;const b=gs.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),_={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:b,config:e,request:v};qA(function(I){n(I),g()},function(I){o(I),g()},_),v=null}"onloadend"in v?v.onloadend=w:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(w)},v.onabort=function(){v&&(o(new Zt("Request aborted",Zt.ECONNABORTED,e,v)),v=null)},v.onerror=function(C){const _=C&&C.message?C.message:"Network Error",E=new Zt(_,Zt.ERR_NETWORK,e,v);E.event=C||null,o(E),v=null},v.ontimeout=function(){let C=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const _=s.transitional||WA;s.timeoutErrorMessage&&(C=s.timeoutErrorMessage),o(new Zt(C,_.clarifyTimeoutError?Zt.ETIMEDOUT:Zt.ECONNABORTED,e,v)),v=null},r===void 0&&i.setContentType(null),"setRequestHeader"in v&&Be.forEach(i.toJSON(),function(C,_){v.setRequestHeader(_,C)}),Be.isUndefined(s.withCredentials)||(v.withCredentials=!!s.withCredentials),a&&a!=="json"&&(v.responseType=s.responseType),c&&([h,p]=nv(c,!0),v.addEventListener("progress",h)),l&&v.upload&&([d,f]=nv(l),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",f)),(s.cancelToken||s.signal)&&(u=b=>{v&&(o(!b||b.type?new ju(null,e,v):b),v.abort(),v=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const S=vJ(s.url);if(S&&zo.protocols.indexOf(S)===-1){o(new Zt("Unsupported protocol "+S+":",Zt.ERR_BAD_REQUEST,e));return}v.send(r||null)})},RJ=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let o=new AbortController,s;const r=function(c){if(!s){s=!0,a();const u=c instanceof Error?c:this.reason;o.abort(u instanceof Zt?u:new ju(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,r(new Zt(`timeout ${t} of ms exceeded`,Zt.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),e=null)};e.forEach(c=>c.addEventListener("abort",r));const{signal:l}=o;return l.unsubscribe=()=>Be.asap(a),l}},DJ=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let o=0,s;for(;o<n;)s=o+t,yield e.slice(o,s),o=s},TJ=async function*(e,t){for await(const n of IJ(e))yield*DJ(n,t)},IJ=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:o}=await t.read();if(n)break;yield o}}finally{await t.cancel()}},eO=(e,t,n,o)=>{const s=TJ(e,t);let r=0,i,a=l=>{i||(i=!0,o&&o(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await s.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let h=r+=d;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),s.return()}},{highWaterMark:2})},tO=64*1024,{isFunction:ov}=Be,xJ=(({Request:e,Response:t})=>({Request:e,Response:t}))(Be.global),{ReadableStream:nO,TextEncoder:oO}=Be.global,sO=(e,...t)=>{try{return!!e(...t)}catch{return!1}},FJ=e=>{e=Be.merge.call({skipUndefined:!0},xJ,e);const{fetch:t,Request:n,Response:o}=e,s=t?ov(t):typeof fetch=="function",r=ov(n),i=ov(o);if(!s)return!1;const a=s&&ov(nO),l=s&&(typeof oO=="function"?(p=>g=>p.encode(g))(new oO):async p=>new Uint8Array(await new n(p).arrayBuffer())),c=r&&a&&sO(()=>{let p=!1;const g=new n(zo.origin,{body:new nO,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),u=i&&a&&sO(()=>Be.isReadableStream(new o("").body)),d={stream:u&&(p=>p.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(g,v)=>{let w=g&&g[p];if(w)return w.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(zo.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:w,signal:S,cancelToken:b,timeout:C,onDownloadProgress:_,onUploadProgress:E,responseType:I,headers:T,withCredentials:P="same-origin",fetchOptions:M}=QA(p),D=t||fetch;I=I?(I+"").toLowerCase():"text";let F=RJ([S,b&&b.toAbortSignal()],C),O=null;const k=F&&F.unsubscribe&&(()=>{F.unsubscribe()});let x;try{if(E&&c&&v!=="get"&&v!=="head"&&(x=await f(T,w))!==0){let X=new n(g,{method:"POST",body:w,duplex:"half"}),N;if(Be.isFormData(w)&&(N=X.headers.get("content-type"))&&T.setContentType(N),X.body){const[z,ne]=YA(x,nv(ZA(E)));w=eO(X.body,tO,z,ne)}}Be.isString(P)||(P=P?"include":"omit");const $=r&&"credentials"in n.prototype,W={...M,signal:F,method:v.toUpperCase(),headers:T.normalize().toJSON(),body:w,duplex:"half",credentials:$?P:void 0};O=r&&new n(g,W);let Q=await(r?D(O,M):D(g,W));const ae=u&&(I==="stream"||I==="response");if(u&&(_||ae&&k)){const X={};["status","statusText","headers"].forEach(pe=>{X[pe]=Q[pe]});const N=Be.toFiniteNumber(Q.headers.get("content-length")),[z,ne]=_&&YA(N,nv(ZA(_),!0))||[];Q=new o(eO(Q.body,tO,z,()=>{ne&&ne(),k&&k()}),X)}I=I||"text";let ee=await d[Be.findKey(d,I)||"text"](Q,p);return!ae&&k&&k(),await new Promise((X,N)=>{qA(X,N,{data:ee,headers:gs.from(Q.headers),status:Q.status,statusText:Q.statusText,config:p,request:O})})}catch($){throw k&&k(),$&&$.name==="TypeError"&&/Load failed|fetch/i.test($.message)?Object.assign(new Zt("Network Error",Zt.ERR_NETWORK,p,O),{cause:$.cause||$}):Zt.from($,$&&$.code,p,O)}}},PJ=new Map,rO=e=>{let t=e&&e.env||{};const{fetch:n,Request:o,Response:s}=t,r=[o,s,n];let i=r.length,a=i,l,c,u=PJ;for(;a--;)l=r[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:FJ(t)),u=c;return c};rO();const AS={http:QX,xhr:_J,fetch:{get:rO}};Be.forEach(AS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const iO=e=>`- ${e}`,kJ=e=>Be.isFunction(e)||e===null||e===!1;function AJ(e,t){e=Be.isArray(e)?e:[e];const{length:n}=e;let o,s;const r={};for(let i=0;i<n;i++){o=e[i];let a;if(s=o,!kJ(o)&&(s=AS[(a=String(o)).toLowerCase()],s===void 0))throw new Zt(`Unknown adapter '${a}'`);if(s&&(Be.isFunction(s)||(s=s.get(t))))break;r[a||"#"+i]=s}if(!s){const i=Object.entries(r).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=n?i.length>1?`since :
149
149
  `+i.map(iO).join(`
@@ -158,7 +158,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
158
158
  * @author RubaXa <trash@rubaxa.org>
159
159
  * @author owenm <owen23355@gmail.com>
160
160
  * @license MIT
161
- */function QO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function hi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QO(Object(n),!0).forEach(function(o){Xee(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QO(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function mv(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?mv=function(t){return typeof t}:mv=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mv(e)}function Xee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sa(){return sa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},sa.apply(this,arguments)}function Jee(e,t){if(e==null)return{};var n={},o=Object.keys(e),s,r;for(r=0;r<o.length;r++)s=o[r],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function Qee(e,t){if(e==null)return{};var n=Jee(e,t),o,s;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var ete="1.14.0";function ra(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var ia=ra(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pf=ra(/Edge/i),eM=ra(/firefox/i),kf=ra(/safari/i)&&!ra(/chrome/i)&&!ra(/android/i),tM=ra(/iP(ad|od|hone)/i),tte=ra(/chrome/i)&&ra(/android/i),nM={capture:!1,passive:!1};function Cn(e,t,n){e.addEventListener(t,n,!ia&&nM)}function pn(e,t,n){e.removeEventListener(t,n,!ia&&nM)}function vv(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function nte(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function fi(e,t,n,o){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&vv(e,t):vv(e,t))||o&&e===n)return e;if(e===n)break}while(e=nte(e))}return null}var oM=/\s+/g;function Ns(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(oM," ").replace(" "+t+" "," ");e.className=(o+(n?" "+t:"")).replace(oM," ")}}function Bt(e,t,n){var o=e&&e.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in o)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),o[t]=n+(typeof n=="string"?"":"px")}}function od(e,t){var n="";if(typeof e=="string")n=e;else do{var o=Bt(e,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!t&&(e=e.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(n)}function sM(e,t,n){if(e){var o=e.getElementsByTagName(t),s=0,r=o.length;if(n)for(;s<r;s++)n(o[s],s);return o}return[]}function pi(){var e=document.scrollingElement;return e||document.documentElement}function bo(e,t,n,o,s){if(!(!e.getBoundingClientRect&&e!==window)){var r,i,a,l,c,u,d;if(e!==window&&e.parentNode&&e!==pi()?(r=e.getBoundingClientRect(),i=r.top,a=r.left,l=r.bottom,c=r.right,u=r.height,d=r.width):(i=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(s=s||e.parentNode,!ia))do if(s&&s.getBoundingClientRect&&(Bt(s,"transform")!=="none"||n&&Bt(s,"position")!=="static")){var h=s.getBoundingClientRect();i-=h.top+parseInt(Bt(s,"border-top-width")),a-=h.left+parseInt(Bt(s,"border-left-width")),l=i+r.height,c=a+r.width;break}while(s=s.parentNode);if(o&&e!==window){var f=od(s||e),p=f&&f.a,g=f&&f.d;f&&(i/=g,a/=p,d/=p,u/=g,l=i+u,c=a+d)}return{top:i,left:a,bottom:l,right:c,width:d,height:u}}}function rM(e,t,n){for(var o=Ja(e,!0),s=bo(e)[t];o;){var r=bo(o)[n],i=void 0;if(i=s>=r,!i)return o;if(o===pi())break;o=Ja(o,!1)}return!1}function sd(e,t,n,o){for(var s=0,r=0,i=e.children;r<i.length;){if(i[r].style.display!=="none"&&i[r]!==$t.ghost&&(o||i[r]!==$t.dragged)&&fi(i[r],n.draggable,e,!1)){if(s===t)return i[r];s++}r++}return null}function eE(e,t){for(var n=e.lastElementChild;n&&(n===$t.ghost||Bt(n,"display")==="none"||t&&!vv(n,t));)n=n.previousElementSibling;return n||null}function rr(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==$t.clone&&(!t||vv(e,t))&&n++;return n}function iM(e){var t=0,n=0,o=pi();if(e)do{var s=od(e),r=s.a,i=s.d;t+=e.scrollLeft*r,n+=e.scrollTop*i}while(e!==o&&(e=e.parentNode));return[t,n]}function ote(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[n][o])return Number(n)}return-1}function Ja(e,t){if(!e||!e.getBoundingClientRect)return pi();var n=e,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var s=Bt(n);if(n.clientWidth<n.scrollWidth&&(s.overflowX=="auto"||s.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(s.overflowY=="auto"||s.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return pi();if(o||t)return n;o=!0}}while(n=n.parentNode);return pi()}function ste(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function tE(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var Af;function aM(e,t){return function(){if(!Af){var n=arguments,o=this;n.length===1?e.call(o,n[0]):e.apply(o,n),Af=setTimeout(function(){Af=void 0},t)}}}function rte(){clearTimeout(Af),Af=void 0}function lM(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function cM(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var Ls="Sortable"+new Date().getTime();function ite(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(s){if(!(Bt(s,"display")==="none"||s===$t.ghost)){e.push({target:s,rect:bo(s)});var r=hi({},e[e.length-1].rect);if(s.thisAnimationDuration){var i=od(s,!0);i&&(r.top-=i.f,r.left-=i.e)}s.fromRect=r}})}},addAnimationState:function(o){e.push(o)},removeAnimationState:function(o){e.splice(ote(e,{target:o}),1)},animateAll:function(o){var s=this;if(!this.options.animation){clearTimeout(t),typeof o=="function"&&o();return}var r=!1,i=0;e.forEach(function(a){var l=0,c=a.target,u=c.fromRect,d=bo(c),h=c.prevFromRect,f=c.prevToRect,p=a.rect,g=od(c,!0);g&&(d.top-=g.f,d.left-=g.e),c.toRect=d,c.thisAnimationDuration&&tE(h,d)&&!tE(u,d)&&(p.top-d.top)/(p.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=lte(p,h,f,s.options)),tE(d,u)||(c.prevFromRect=u,c.prevToRect=d,l||(l=s.options.animation),s.animate(c,p,d,l)),l&&(r=!0,i=Math.max(i,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(t),r?t=setTimeout(function(){typeof o=="function"&&o()},i):typeof o=="function"&&o(),e=[]},animate:function(o,s,r,i){if(i){Bt(o,"transition",""),Bt(o,"transform","");var a=od(this.el),l=a&&a.a,c=a&&a.d,u=(s.left-r.left)/(l||1),d=(s.top-r.top)/(c||1);o.animatingX=!!u,o.animatingY=!!d,Bt(o,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=ate(o),Bt(o,"transition","transform "+i+"ms"+(this.options.easing?" "+this.options.easing:"")),Bt(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){Bt(o,"transition",""),Bt(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},i)}}}}function ate(e){return e.offsetWidth}function lte(e,t,n,o){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*o.animation}var rd=[],nE={initializeByDefault:!0},Of={mount:function(t){for(var n in nE)nE.hasOwnProperty(n)&&!(n in t)&&(t[n]=nE[n]);rd.forEach(function(o){if(o.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),rd.push(t)},pluginEvent:function(t,n,o){var s=this;this.eventCanceled=!1,o.cancel=function(){s.eventCanceled=!0};var r=t+"Global";rd.forEach(function(i){n[i.pluginName]&&(n[i.pluginName][r]&&n[i.pluginName][r](hi({sortable:n},o)),n.options[i.pluginName]&&n[i.pluginName][t]&&n[i.pluginName][t](hi({sortable:n},o)))})},initializePlugins:function(t,n,o,s){rd.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var c=new a(t,n,t.options);c.sortable=t,c.options=t.options,t[l]=c,sa(o,c.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var i=this.modifyOption(t,r,t.options[r]);typeof i<"u"&&(t.options[r]=i)}},getEventProperties:function(t,n){var o={};return rd.forEach(function(s){typeof s.eventProperties=="function"&&sa(o,s.eventProperties.call(n[s.pluginName],t))}),o},modifyOption:function(t,n,o){var s;return rd.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(s=r.optionListeners[n].call(t[r.pluginName],o))}),s}};function cte(e){var t=e.sortable,n=e.rootEl,o=e.name,s=e.targetEl,r=e.cloneEl,i=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,h=e.originalEvent,f=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[Ls],!!t){var g,v=t.options,w="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!ia&&!Pf?g=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(o,!0,!0)),g.to=i||n,g.from=a||n,g.item=s||n,g.clone=r,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=u,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=f?f.lastPutMode:void 0;var S=hi(hi({},p),Of.getEventProperties(o,t));for(var b in S)g[b]=S[b];n&&n.dispatchEvent(g),v[w]&&v[w].call(t,g)}}var ute=["evt"],ms=function(t,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=o.evt,r=Qee(o,ute);Of.pluginEvent.bind($t)(t,n,hi({dragEl:gt,parentEl:eo,ghostEl:Xt,rootEl:Gn,nextEl:hc,lastDownEl:yv,cloneEl:to,cloneHidden:Qa,dragStarted:Nf,putSortable:Oo,activeSortable:$t.active,originalEvent:s,oldIndex:id,oldDraggableIndex:Mf,newIndex:Vs,newDraggableIndex:el,hideGhostForTarget:mM,unhideGhostForTarget:vM,cloneNowHidden:function(){Qa=!0},cloneNowShown:function(){Qa=!1},dispatchSortableEvent:function(a){os({sortable:n,name:a,originalEvent:s})}},r))};function os(e){cte(hi({putSortable:Oo,cloneEl:to,targetEl:gt,rootEl:Gn,oldIndex:id,oldDraggableIndex:Mf,newIndex:Vs,newDraggableIndex:el},e))}var gt,eo,Xt,Gn,hc,yv,to,Qa,id,Vs,Mf,el,wv,Oo,ad=!1,Cv=!1,bv=[],fc,Nr,oE,sE,uM,dM,Nf,ld,Lf,Vf=!1,Sv=!1,Ev,jo,rE=[],iE=!1,_v=[],Rv=typeof document<"u",Dv=tM,hM=Pf||ia?"cssFloat":"float",dte=Rv&&!tte&&!tM&&"draggable"in document.createElement("div"),fM=function(){if(Rv){if(ia)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),pM=function(t,n){var o=Bt(t),s=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=sd(t,0,n),i=sd(t,1,n),a=r&&Bt(r),l=i&&Bt(i),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+bo(r).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+bo(i).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return i&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return r&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=s&&o[hM]==="none"||i&&o[hM]==="none"&&c+u>s)?"vertical":"horizontal"},hte=function(t,n,o){var s=o?t.left:t.top,r=o?t.right:t.bottom,i=o?t.width:t.height,a=o?n.left:n.top,l=o?n.right:n.bottom,c=o?n.width:n.height;return s===a||r===l||s+i/2===a+c/2},fte=function(t,n){var o;return bv.some(function(s){var r=s[Ls].options.emptyInsertThreshold;if(!(!r||eE(s))){var i=bo(s),a=t>=i.left-r&&t<=i.right+r,l=n>=i.top-r&&n<=i.bottom+r;if(a&&l)return o=s}}),o},gM=function(t){function n(r,i){return function(a,l,c,u){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(r==null&&(i||d))return!0;if(r==null||r===!1)return!1;if(i&&r==="clone")return r;if(typeof r=="function")return n(r(a,l,c,u),i)(a,l,c,u);var h=(i?a:l).options.group.name;return r===!0||typeof r=="string"&&r===h||r.join&&r.indexOf(h)>-1}}var o={},s=t.group;(!s||mv(s)!="object")&&(s={name:s}),o.name=s.name,o.checkPull=n(s.pull,!0),o.checkPut=n(s.put),o.revertClone=s.revertClone,t.group=o},mM=function(){!fM&&Xt&&Bt(Xt,"display","none")},vM=function(){!fM&&Xt&&Bt(Xt,"display","")};Rv&&document.addEventListener("click",function(e){if(Cv)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Cv=!1,!1},!0);var pc=function(t){if(gt){t=t.touches?t.touches[0]:t;var n=fte(t.clientX,t.clientY);if(n){var o={};for(var s in t)t.hasOwnProperty(s)&&(o[s]=t[s]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[Ls]._onDragOver(o)}}},pte=function(t){gt&&gt.parentNode[Ls]._isOutsideThisEl(t.target)};function $t(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=sa({},t),e[Ls]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return pM(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(i,a){i.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:$t.supportPointer!==!1&&"PointerEvent"in window&&!kf,emptyInsertThreshold:5};Of.initializePlugins(this,e,n);for(var o in n)!(o in t)&&(t[o]=n[o]);gM(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:dte,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Cn(e,"pointerdown",this._onTapStart):(Cn(e,"mousedown",this._onTapStart),Cn(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Cn(e,"dragover",this),Cn(e,"dragenter",this)),bv.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),sa(this,ite())}$t.prototype={constructor:$t,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(ld=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,gt):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,o=this.el,s=this.options,r=s.preventOnFilter,i=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,u=s.filter;if(Ste(o),!gt&&!(/mousedown|pointerdown/.test(i)&&t.button!==0||s.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&kf&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=fi(l,s.draggable,o,!1),!(l&&l.animated)&&yv!==l)){if(id=rr(l),Mf=rr(l,s.draggable),typeof u=="function"){if(u.call(this,t,l,this)){os({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:o,fromEl:o}),ms("filter",n,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=fi(c,d.trim(),o,!1),d)return os({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:o,toEl:o}),ms("filter",n,{evt:t}),!0}),u)){r&&t.cancelable&&t.preventDefault();return}s.handle&&!fi(c,s.handle,o,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,o){var s=this,r=s.el,i=s.options,a=r.ownerDocument,l;if(o&&!gt&&o.parentNode===r){var c=bo(o);if(Gn=r,gt=o,eo=gt.parentNode,hc=gt.nextSibling,yv=o,wv=i.group,$t.dragged=gt,fc={target:gt,clientX:(n||t).clientX,clientY:(n||t).clientY},uM=fc.clientX-c.left,dM=fc.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,gt.style["will-change"]="all",l=function(){if(ms("delayEnded",s,{evt:t}),$t.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!eM&&s.nativeDraggable&&(gt.draggable=!0),s._triggerDragStart(t,n),os({sortable:s,name:"choose",originalEvent:t}),Ns(gt,i.chosenClass,!0)},i.ignore.split(",").forEach(function(u){sM(gt,u.trim(),aE)}),Cn(a,"dragover",pc),Cn(a,"mousemove",pc),Cn(a,"touchmove",pc),Cn(a,"mouseup",s._onDrop),Cn(a,"touchend",s._onDrop),Cn(a,"touchcancel",s._onDrop),eM&&this.nativeDraggable&&(this.options.touchStartThreshold=4,gt.draggable=!0),ms("delayStart",this,{evt:t}),i.delay&&(!i.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Pf||ia))){if($t.eventCanceled){this._onDrop();return}Cn(a,"mouseup",s._disableDelayedDrag),Cn(a,"touchend",s._disableDelayedDrag),Cn(a,"touchcancel",s._disableDelayedDrag),Cn(a,"mousemove",s._delayedDragTouchMoveHandler),Cn(a,"touchmove",s._delayedDragTouchMoveHandler),i.supportPointer&&Cn(a,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(l,i.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){gt&&aE(gt),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;pn(t,"mouseup",this._disableDelayedDrag),pn(t,"touchend",this._disableDelayedDrag),pn(t,"touchcancel",this._disableDelayedDrag),pn(t,"mousemove",this._delayedDragTouchMoveHandler),pn(t,"touchmove",this._delayedDragTouchMoveHandler),pn(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?Cn(document,"pointermove",this._onTouchMove):n?Cn(document,"touchmove",this._onTouchMove):Cn(document,"mousemove",this._onTouchMove):(Cn(gt,"dragend",this),Cn(Gn,"dragstart",this._onDragStart));try{document.selection?Iv(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(ad=!1,Gn&&gt){ms("dragStarted",this,{evt:n}),this.nativeDraggable&&Cn(document,"dragover",pte);var o=this.options;!t&&Ns(gt,o.dragClass,!1),Ns(gt,o.ghostClass,!0),$t.active=this,t&&this._appendGhost(),os({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Nr){this._lastX=Nr.clientX,this._lastY=Nr.clientY,mM();for(var t=document.elementFromPoint(Nr.clientX,Nr.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Nr.clientX,Nr.clientY),t!==n);)n=t;if(gt.parentNode[Ls]._isOutsideThisEl(t),n)do{if(n[Ls]){var o=void 0;if(o=n[Ls]._onDragOver({clientX:Nr.clientX,clientY:Nr.clientY,target:t,rootEl:n}),o&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);vM()}},_onTouchMove:function(t){if(fc){var n=this.options,o=n.fallbackTolerance,s=n.fallbackOffset,r=t.touches?t.touches[0]:t,i=Xt&&od(Xt,!0),a=Xt&&i&&i.a,l=Xt&&i&&i.d,c=Dv&&jo&&iM(jo),u=(r.clientX-fc.clientX+s.x)/(a||1)+(c?c[0]-rE[0]:0)/(a||1),d=(r.clientY-fc.clientY+s.y)/(l||1)+(c?c[1]-rE[1]:0)/(l||1);if(!$t.active&&!ad){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(t,!0)}if(Xt){i?(i.e+=u-(oE||0),i.f+=d-(sE||0)):i={a:1,b:0,c:0,d:1,e:u,f:d};var h="matrix(".concat(i.a,",").concat(i.b,",").concat(i.c,",").concat(i.d,",").concat(i.e,",").concat(i.f,")");Bt(Xt,"webkitTransform",h),Bt(Xt,"mozTransform",h),Bt(Xt,"msTransform",h),Bt(Xt,"transform",h),oE=u,sE=d,Nr=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Xt){var t=this.options.fallbackOnBody?document.body:Gn,n=bo(gt,!0,Dv,!0,t),o=this.options;if(Dv){for(jo=t;Bt(jo,"position")==="static"&&Bt(jo,"transform")==="none"&&jo!==document;)jo=jo.parentNode;jo!==document.body&&jo!==document.documentElement?(jo===document&&(jo=pi()),n.top+=jo.scrollTop,n.left+=jo.scrollLeft):jo=pi(),rE=iM(jo)}Xt=gt.cloneNode(!0),Ns(Xt,o.ghostClass,!1),Ns(Xt,o.fallbackClass,!0),Ns(Xt,o.dragClass,!0),Bt(Xt,"transition",""),Bt(Xt,"transform",""),Bt(Xt,"box-sizing","border-box"),Bt(Xt,"margin",0),Bt(Xt,"top",n.top),Bt(Xt,"left",n.left),Bt(Xt,"width",n.width),Bt(Xt,"height",n.height),Bt(Xt,"opacity","0.8"),Bt(Xt,"position",Dv?"absolute":"fixed"),Bt(Xt,"zIndex","100000"),Bt(Xt,"pointerEvents","none"),$t.ghost=Xt,t.appendChild(Xt),Bt(Xt,"transform-origin",uM/parseInt(Xt.style.width)*100+"% "+dM/parseInt(Xt.style.height)*100+"%")}},_onDragStart:function(t,n){var o=this,s=t.dataTransfer,r=o.options;if(ms("dragStart",this,{evt:t}),$t.eventCanceled){this._onDrop();return}ms("setupClone",this),$t.eventCanceled||(to=cM(gt),to.draggable=!1,to.style["will-change"]="",this._hideClone(),Ns(to,this.options.chosenClass,!1),$t.clone=to),o.cloneId=Iv(function(){ms("clone",o),!$t.eventCanceled&&(o.options.removeCloneOnHide||Gn.insertBefore(to,gt),o._hideClone(),os({sortable:o,name:"clone"}))}),!n&&Ns(gt,r.dragClass,!0),n?(Cv=!0,o._loopId=setInterval(o._emulateDragOver,50)):(pn(document,"mouseup",o._onDrop),pn(document,"touchend",o._onDrop),pn(document,"touchcancel",o._onDrop),s&&(s.effectAllowed="move",r.setData&&r.setData.call(o,s,gt)),Cn(document,"drop",o),Bt(gt,"transform","translateZ(0)")),ad=!0,o._dragStartId=Iv(o._dragStarted.bind(o,n,t)),Cn(document,"selectstart",o),Nf=!0,kf&&Bt(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,o=t.target,s,r,i,a=this.options,l=a.group,c=$t.active,u=wv===l,d=a.sort,h=Oo||c,f,p=this,g=!1;if(iE)return;function v(Q,ae){ms(Q,p,hi({evt:t,isOwner:u,axis:f?"vertical":"horizontal",revert:i,dragRect:s,targetRect:r,canSort:d,fromSortable:h,target:o,completed:S,onMove:function(X,N){return Tv(Gn,n,gt,s,X,bo(X),t,N)},changed:b},ae))}function w(){v("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function S(Q){return v("dragOverCompleted",{insertion:Q}),Q&&(u?c._hideClone():c._showClone(p),p!==h&&(Ns(gt,Oo?Oo.options.ghostClass:c.options.ghostClass,!1),Ns(gt,a.ghostClass,!0)),Oo!==p&&p!==$t.active?Oo=p:p===$t.active&&Oo&&(Oo=null),h===p&&(p._ignoreWhileAnimating=o),p.animateAll(function(){v("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===gt&&!gt.animated||o===n&&!o.animated)&&(ld=null),!a.dragoverBubble&&!t.rootEl&&o!==document&&(gt.parentNode[Ls]._isOutsideThisEl(t.target),!Q&&pc(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function b(){Vs=rr(gt),el=rr(gt,a.draggable),os({sortable:p,name:"change",toEl:n,newIndex:Vs,newDraggableIndex:el,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),o=fi(o,a.draggable,n,!0),v("dragOver"),$t.eventCanceled)return g;if(gt.contains(t.target)||o.animated&&o.animatingX&&o.animatingY||p._ignoreWhileAnimating===o)return S(!1);if(Cv=!1,c&&!a.disabled&&(u?d||(i=eo!==Gn):Oo===this||(this.lastPutMode=wv.checkPull(this,c,gt,t))&&l.checkPut(this,c,gt,t))){if(f=this._getDirection(t,o)==="vertical",s=bo(gt),v("dragOverValid"),$t.eventCanceled)return g;if(i)return eo=Gn,w(),this._hideClone(),v("revert"),$t.eventCanceled||(hc?Gn.insertBefore(gt,hc):Gn.appendChild(gt)),S(!0);var C=eE(n,a.draggable);if(!C||yte(t,f,this)&&!C.animated){if(C===gt)return S(!1);if(C&&n===t.target&&(o=C),o&&(r=bo(o)),Tv(Gn,n,gt,s,o,r,t,!!o)!==!1)return w(),n.appendChild(gt),eo=n,b(),S(!0)}else if(C&&vte(t,f,this)){var _=sd(n,0,a,!0);if(_===gt)return S(!1);if(o=_,r=bo(o),Tv(Gn,n,gt,s,o,r,t,!1)!==!1)return w(),n.insertBefore(gt,_),eo=n,b(),S(!0)}else if(o.parentNode===n){r=bo(o);var E=0,I,T=gt.parentNode!==n,P=!hte(gt.animated&&gt.toRect||s,o.animated&&o.toRect||r,f),M=f?"top":"left",D=rM(o,"top","top")||rM(gt,"top","top"),F=D?D.scrollTop:void 0;ld!==o&&(I=r[M],Vf=!1,Sv=!P&&a.invertSwap||T),E=wte(t,o,r,f,P?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Sv,ld===o);var O;if(E!==0){var k=rr(gt);do k-=E,O=eo.children[k];while(O&&(Bt(O,"display")==="none"||O===Xt))}if(E===0||O===o)return S(!1);ld=o,Lf=E;var x=o.nextElementSibling,$=!1;$=E===1;var W=Tv(Gn,n,gt,s,o,r,t,$);if(W!==!1)return(W===1||W===-1)&&($=W===1),iE=!0,setTimeout(mte,30),w(),$&&!x?n.appendChild(gt):o.parentNode.insertBefore(gt,$?x:o),D&&lM(D,0,F-D.scrollTop),eo=gt.parentNode,I!==void 0&&!Sv&&(Ev=Math.abs(I-bo(o)[M])),b(),S(!0)}if(n.contains(gt))return S(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){pn(document,"mousemove",this._onTouchMove),pn(document,"touchmove",this._onTouchMove),pn(document,"pointermove",this._onTouchMove),pn(document,"dragover",pc),pn(document,"mousemove",pc),pn(document,"touchmove",pc)},_offUpEvents:function(){var t=this.el.ownerDocument;pn(t,"mouseup",this._onDrop),pn(t,"touchend",this._onDrop),pn(t,"pointerup",this._onDrop),pn(t,"touchcancel",this._onDrop),pn(document,"selectstart",this)},_onDrop:function(t){var n=this.el,o=this.options;if(Vs=rr(gt),el=rr(gt,o.draggable),ms("drop",this,{evt:t}),eo=gt&&gt.parentNode,Vs=rr(gt),el=rr(gt,o.draggable),$t.eventCanceled){this._nulling();return}ad=!1,Sv=!1,Vf=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),lE(this.cloneId),lE(this._dragStartId),this.nativeDraggable&&(pn(document,"drop",this),pn(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),kf&&Bt(document.body,"user-select",""),Bt(gt,"transform",""),t&&(Nf&&(t.cancelable&&t.preventDefault(),!o.dropBubble&&t.stopPropagation()),Xt&&Xt.parentNode&&Xt.parentNode.removeChild(Xt),(Gn===eo||Oo&&Oo.lastPutMode!=="clone")&&to&&to.parentNode&&to.parentNode.removeChild(to),gt&&(this.nativeDraggable&&pn(gt,"dragend",this),aE(gt),gt.style["will-change"]="",Nf&&!ad&&Ns(gt,Oo?Oo.options.ghostClass:this.options.ghostClass,!1),Ns(gt,this.options.chosenClass,!1),os({sortable:this,name:"unchoose",toEl:eo,newIndex:null,newDraggableIndex:null,originalEvent:t}),Gn!==eo?(Vs>=0&&(os({rootEl:eo,name:"add",toEl:eo,fromEl:Gn,originalEvent:t}),os({sortable:this,name:"remove",toEl:eo,originalEvent:t}),os({rootEl:eo,name:"sort",toEl:eo,fromEl:Gn,originalEvent:t}),os({sortable:this,name:"sort",toEl:eo,originalEvent:t})),Oo&&Oo.save()):Vs!==id&&Vs>=0&&(os({sortable:this,name:"update",toEl:eo,originalEvent:t}),os({sortable:this,name:"sort",toEl:eo,originalEvent:t})),$t.active&&((Vs==null||Vs===-1)&&(Vs=id,el=Mf),os({sortable:this,name:"end",toEl:eo,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){ms("nulling",this),Gn=gt=eo=Xt=hc=to=yv=Qa=fc=Nr=Nf=Vs=el=id=Mf=ld=Lf=Oo=wv=$t.dragged=$t.ghost=$t.clone=$t.active=null,_v.forEach(function(t){t.checked=!0}),_v.length=oE=sE=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":gt&&(this._onDragOver(t),gte(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,o=this.el.children,s=0,r=o.length,i=this.options;s<r;s++)n=o[s],fi(n,i.draggable,this.el,!1)&&t.push(n.getAttribute(i.dataIdAttr)||bte(n));return t},sort:function(t,n){var o={},s=this.el;this.toArray().forEach(function(r,i){var a=s.children[i];fi(a,this.options.draggable,s,!1)&&(o[r]=a)},this),n&&this.captureAnimationState(),t.forEach(function(r){o[r]&&(s.removeChild(o[r]),s.appendChild(o[r]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return fi(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var o=this.options;if(n===void 0)return o[t];var s=Of.modifyOption(this,t,n);typeof s<"u"?o[t]=s:o[t]=n,t==="group"&&gM(o)},destroy:function(){ms("destroy",this);var t=this.el;t[Ls]=null,pn(t,"mousedown",this._onTapStart),pn(t,"touchstart",this._onTapStart),pn(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(pn(t,"dragover",this),pn(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),bv.splice(bv.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Qa){if(ms("hideClone",this),$t.eventCanceled)return;Bt(to,"display","none"),this.options.removeCloneOnHide&&to.parentNode&&to.parentNode.removeChild(to),Qa=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Qa){if(ms("showClone",this),$t.eventCanceled)return;gt.parentNode==Gn&&!this.options.group.revertClone?Gn.insertBefore(to,gt):hc?Gn.insertBefore(to,hc):Gn.appendChild(to),this.options.group.revertClone&&this.animate(gt,to),Bt(to,"display",""),Qa=!1}}};function gte(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Tv(e,t,n,o,s,r,i,a){var l,c=e[Ls],u=c.options.onMove,d;return window.CustomEvent&&!ia&&!Pf?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=n,l.draggedRect=o,l.related=s||t,l.relatedRect=r||bo(t),l.willInsertAfter=a,l.originalEvent=i,e.dispatchEvent(l),u&&(d=u.call(c,l,i)),d}function aE(e){e.draggable=!1}function mte(){iE=!1}function vte(e,t,n){var o=bo(sd(n.el,0,n.options,!0)),s=10;return t?e.clientX<o.left-s||e.clientY<o.top&&e.clientX<o.right:e.clientY<o.top-s||e.clientY<o.bottom&&e.clientX<o.left}function yte(e,t,n){var o=bo(eE(n.el,n.options.draggable)),s=10;return t?e.clientX>o.right+s||e.clientX<=o.right&&e.clientY>o.bottom&&e.clientX>=o.left:e.clientX>o.right&&e.clientY>o.top||e.clientX<=o.right&&e.clientY>o.bottom+s}function wte(e,t,n,o,s,r,i,a){var l=o?e.clientY:e.clientX,c=o?n.height:n.width,u=o?n.top:n.left,d=o?n.bottom:n.right,h=!1;if(!i){if(a&&Ev<c*s){if(!Vf&&(Lf===1?l>u+c*r/2:l<d-c*r/2)&&(Vf=!0),Vf)h=!0;else if(Lf===1?l<u+Ev:l>d-Ev)return-Lf}else if(l>u+c*(1-s)/2&&l<d-c*(1-s)/2)return Cte(t)}return h=h||i,h&&(l<u+c*r/2||l>d-c*r/2)?l>u+c/2?1:-1:0}function Cte(e){return rr(gt)<rr(e)?1:-1}function bte(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,o=0;n--;)o+=t.charCodeAt(n);return o.toString(36)}function Ste(e){_v.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var o=t[n];o.checked&&_v.push(o)}}function Iv(e){return setTimeout(e,0)}function lE(e){return clearTimeout(e)}Rv&&Cn(document,"touchmove",function(e){($t.active||ad)&&e.cancelable&&e.preventDefault()}),$t.utils={on:Cn,off:pn,css:Bt,find:sM,is:function(t,n){return!!fi(t,n,t,!1)},extend:ste,throttle:aM,closest:fi,toggleClass:Ns,clone:cM,index:rr,nextTick:Iv,cancelNextTick:lE,detectDirection:pM,getChild:sd},$t.get=function(e){return e[Ls]},$t.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&($t.utils=hi(hi({},$t.utils),o.utils)),Of.mount(o)})},$t.create=function(e,t){return new $t(e,t)},$t.version=ete;var po=[],Bf,cE,uE=!1,dE,hE,xv,$f;function Ete(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?Cn(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Cn(document,"pointermove",this._handleFallbackAutoScroll):o.touches?Cn(document,"touchmove",this._handleFallbackAutoScroll):Cn(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?pn(document,"dragover",this._handleAutoScroll):(pn(document,"pointermove",this._handleFallbackAutoScroll),pn(document,"touchmove",this._handleFallbackAutoScroll),pn(document,"mousemove",this._handleFallbackAutoScroll)),yM(),Fv(),rte()},nulling:function(){xv=cE=Bf=uE=$f=dE=hE=null,po.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var s=this,r=(n.touches?n.touches[0]:n).clientX,i=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(r,i);if(xv=n,o||this.options.forceAutoScrollFallback||Pf||ia||kf){fE(n,this.options,a,o);var l=Ja(a,!0);uE&&(!$f||r!==dE||i!==hE)&&($f&&yM(),$f=setInterval(function(){var c=Ja(document.elementFromPoint(r,i),!0);c!==l&&(l=c,Fv()),fE(n,s.options,c,o)},10),dE=r,hE=i)}else{if(!this.options.bubbleScroll||Ja(a,!0)===pi()){Fv();return}fE(n,this.options,Ja(a,!1),!1)}}},sa(e,{pluginName:"scroll",initializeByDefault:!0})}function Fv(){po.forEach(function(e){clearInterval(e.pid)}),po=[]}function yM(){clearInterval($f)}var fE=aM(function(e,t,n,o){if(t.scroll){var s=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,i=t.scrollSensitivity,a=t.scrollSpeed,l=pi(),c=!1,u;cE!==n&&(cE=n,Fv(),Bf=t.scroll,u=t.scrollFn,Bf===!0&&(Bf=Ja(n,!0)));var d=0,h=Bf;do{var f=h,p=bo(f),g=p.top,v=p.bottom,w=p.left,S=p.right,b=p.width,C=p.height,_=void 0,E=void 0,I=f.scrollWidth,T=f.scrollHeight,P=Bt(f),M=f.scrollLeft,D=f.scrollTop;f===l?(_=b<I&&(P.overflowX==="auto"||P.overflowX==="scroll"||P.overflowX==="visible"),E=C<T&&(P.overflowY==="auto"||P.overflowY==="scroll"||P.overflowY==="visible")):(_=b<I&&(P.overflowX==="auto"||P.overflowX==="scroll"),E=C<T&&(P.overflowY==="auto"||P.overflowY==="scroll"));var F=_&&(Math.abs(S-s)<=i&&M+b<I)-(Math.abs(w-s)<=i&&!!M),O=E&&(Math.abs(v-r)<=i&&D+C<T)-(Math.abs(g-r)<=i&&!!D);if(!po[d])for(var k=0;k<=d;k++)po[k]||(po[k]={});(po[d].vx!=F||po[d].vy!=O||po[d].el!==f)&&(po[d].el=f,po[d].vx=F,po[d].vy=O,clearInterval(po[d].pid),(F!=0||O!=0)&&(c=!0,po[d].pid=setInterval((function(){o&&this.layer===0&&$t.active._onTouchMove(xv);var x=po[this.layer].vy?po[this.layer].vy*a:0,$=po[this.layer].vx?po[this.layer].vx*a:0;typeof u=="function"&&u.call($t.dragged.parentNode[Ls],$,x,e,xv,po[this.layer].el)!=="continue"||lM(po[this.layer].el,$,x)}).bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==l&&(h=Ja(h,!1)));uE=c}},30),wM=function(t){var n=t.originalEvent,o=t.putSortable,s=t.dragEl,r=t.activeSortable,i=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var c=o||r;a();var u=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(u.clientX,u.clientY);l(),c&&!c.el.contains(d)&&(i("spill"),this.onSpill({dragEl:s,putSortable:o}))}};function pE(){}pE.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,o=t.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var s=sd(this.sortable.el,this.startIndex,this.options);s?this.sortable.el.insertBefore(n,s):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:wM},sa(pE,{pluginName:"revertOnSpill"});function gE(){}gE.prototype={onSpill:function(t){var n=t.dragEl,o=t.putSortable,s=o||this.sortable;s.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),s.animateAll()},drop:wM},sa(gE,{pluginName:"removeOnSpill"}),$t.mount(new Ete),$t.mount(gE,pE);function _te(e,t){return Object.values(e).indexOf(t)}function Rte(e,t,n,o){if(!e)return[];const s=Object.values(e),r=t.length-o;return[...t].map((a,l)=>l>=r?s.length:s.indexOf(a))}function Dte(e){return["transition-group","TransitionGroup"].includes(e)}function CM(e){if(!e||e.length!==1)return!1;const[{type:t}]=e;return t?Dte(t.name):!1}function Tte(e,t){return t?{...t.props,...t.attrs}:e}const mE=["Start","Add","Remove","Update","End"],vE=["Choose","Unchoose","Sort","Filter","Clone"],Ite=["Move",...mE,...vE].map(e=>"on"+e);let yE=null;const xte=st({name:"VueDraggableNext",inheritAttrs:!1,props:{options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:e=>e},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},emits:["update:modelValue","move","change",...mE.map(e=>e.toLowerCase()),...vE.map(e=>e.toLowerCase())],setup(e,{emit:t,slots:n,attrs:o}){const s=V(!1),r=V(!1),i=V(0),a=V(0),l=V([]),c=V(null),u=V(null),d=q(()=>e.list?e.list:e.modelValue),h=oo();function f(){return e.component?GG(e.component):e.tag}function p(z){if(u.value)for(const ne in z){const pe=XO(ne);Ite.indexOf(pe)===-1&&u.value.option(pe,z[ne])}}function g(){var z;return((z=h==null?void 0:h.proxy)==null?void 0:z.$el.children)||[]}async function v(){var z;await vt(),l.value=Rte(g(),((z=h==null?void 0:h.proxy)==null?void 0:z.$el.children)||[],s.value,a.value)}function w(z){const ne=_te(g()||[],z);if(ne===-1)return null;const pe=d.value?d.value[ne]:null;return{index:ne,element:pe}}function S(z){vt(()=>t("change",z))}function b(z){if(e.list){z(e.list);return}const ne=[...e.modelValue||[]];z(ne),t("update:modelValue",ne)}function C(...z){b(pe=>pe.splice(...z))}function _(z,ne){b(ve=>ve.splice(ne,0,ve.splice(z,1)[0]))}function E(z){const ne=l.value,pe=ne.length;return z>pe-1?pe:ne[z]}function I(){var ne,pe;return n.default&&((pe=(ne=n.default()[0])==null?void 0:ne.component)==null?void 0:pe.proxy)||null}function T(z){if(!e.noTransitionOnDrag||!s.value)return;const ne=g();ne[z]&&(ne[z].data=null);const pe=I();pe&&(pe.children=[],pe.kept=void 0)}function P(z){v(),c.value=w(z.item),c.value&&(z.item._underlying_vm_=e.clone(c.value.element),yE=z.item)}function M(z){const ne=z.item._underlying_vm_;if(ne===void 0)return;QS(z.item);const pe=E(z.newIndex);C(pe,0,ne),v(),S({added:{element:ne,newIndex:pe}})}function D(z){var pe;if(JO((pe=h==null?void 0:h.proxy)==null?void 0:pe.$el,z.item,z.oldIndex),z.pullMode==="clone"){QS(z.clone);return}if(!c.value)return;const ne=c.value.index;C(ne,1),T(ne),S({removed:{element:c.value.element,oldIndex:ne}})}function F(z){var ve,we;QS(z.item),JO(z.from,z.item,z.oldIndex);const ne=(ve=c.value)==null?void 0:ve.index,pe=E(z.newIndex);_(ne,pe),S({moved:{element:(we=c.value)==null?void 0:we.element,oldIndex:ne,newIndex:pe}})}function O(z,ne){Object.prototype.hasOwnProperty.call(z,ne)&&(z[ne]+=i.value)}function k(z){return z.__draggable_component__}function x({to:z,related:ne}){const pe=k(z);if(!pe)return{component:pe};const ve=pe.realList,we={list:ve,component:pe};if(z!==ne&&ve&&pe.getUnderlyingVm){const re=pe.getUnderlyingVm(ne);if(re)return Object.assign(re,we)}return we}function $(z,ne){const pe=[...ne.to.children].filter(U=>U.style.display!=="none");if(pe.length===0)return 0;const ve=pe.indexOf(ne.related),we=z.component.getVmIndex(ve);return pe.indexOf(yE)!==-1||!ne.willInsertAfter?we:we+1}const W=()=>{var we,re;const z={};mE.forEach(U=>{z["on"+U]=ae(U)}),vE.forEach(U=>{z["on"+U]=Q.bind(null,U)});const ne=Object.keys(o).reduce((U,ge)=>(U[XO(ge)]=o[ge],U),{}),pe=Object.assign({},ne,z,{onMove:(U,ge)=>ee(U,ge)});"draggable"in pe||(pe.draggable=">*");const ve=((we=h==null?void 0:h.proxy)==null?void 0:we.$el.nodeType)===1?h.proxy.$el:((re=h==null?void 0:h.proxy)==null?void 0:re.$el.parentElement)||null;ve&&(u.value=new $t(ve,pe),ve.__draggable_component__=h==null?void 0:h.proxy,v())};function Q(z,ne){vt(()=>t(z.toLowerCase(),ne))}function ae(z){return ne=>{if(d.value!==null){const pe="onDrag"+z,ve=N[pe];ve&&ve(ne)}Q(z,ne)}}function ee(z,ne){const pe=e.move;if(!pe||!d.value)return!0;const ve=x(z),we=c.value,re=$(ve,z);we&&Object.assign(we,{futureIndex:re});const U=Object.assign({},z,{relatedContext:ve,draggedContext:we});return pe(U,ne)}function X(){v(),yE=null}const N={onDragStart:P,onDragAdd:M,onDragRemove:D,onDragUpdate:F,onDragMove:ee,onDragEnd:X};return Qt(()=>{W()}),e.list!==null&&e.modelValue!==null&&qee.error("list props are mutually exclusive! Please set one."),{getTag:f,realList:d,visibleIndexes:l,noneFunctionalComponentMode:r,headerOffset:i,footerOffset:a,transitionMode:s,computeIndexes:v,updateOptions:p,getChildrenNodes:g,getUnderlyingVm:w,emitChanges:S,alterList:b,spliceList:C,updatePosition:_,getVmIndex:E,getComponent:I,resetTransitionData:T,onDragStart:P,onDragAdd:M,onDragRemove:D,onDragUpdate:F,updateProperty:O,onDragMove:ee,onDragEnd:X,mounted:W,context:c,sortableInstance:u,getRelatedContextFromMoveEvent:x,getTargetedComponent:k,computeFutureIndex:$}},render(){const e=this.getTag(),t=Tte(this.$attrs,this.componentData);if(typeof e=="string"){const o=this.$slots.default&&typeof this.$slots.default=="function"?this.$slots.default():null;return o?(this.transitionMode=CM(o),su(e,t,o)):su(e,t,[])}const n=this.$slots.default?{default:this.$slots.default}:{};if(this.$slots.default){const o=typeof this.$slots.default=="function"?this.$slots.default():null;this.transitionMode=CM(o||[])}return su(e,t,n)}}),Fte=Ct(st({__name:"DragDropList",props:{modelValue:{},groupName:{},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["changed","update:modelValue"],setup(e,{emit:t}){const n=V([]),o=e,s=t,r=V({}),i=()=>{n.value=o.modelValue.map(c=>({id:c.field,name:c.headerName,...c}))||[],o.modelValue.forEach(c=>{r.value[c.field]={...c}})};tt(()=>o.modelValue,c=>{i()},{immediate:!0,deep:!0}),tt(n,c=>{if(c.length===o.modelValue.length&&!c.every((d,h)=>d.id===o.modelValue[h].field)){const d=c.map(h=>r.value[h.id]);s("changed",d),s("update:modelValue",d)}});const a=()=>!(o.readOnly||o.disabled),l=c=>!(o.readOnly||o.disabled);return(c,u)=>(K(),Ue(H(xte),{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=d=>n.value=d),tag:"transition-group",disabled:o.disabled||o.readOnly,onMove:l,onStart:a,"item-key":"id","component-data":{tag:"div",type:"transition",name:"fade"},animation:300,easing:"cubic-bezier(0.4, 0, 0.2, 1)","ghost-class":"ghost","chosen-class":"chosen","drag-class":"drag"},{default:he(()=>[(K(!0),ie(It,null,Fn(n.value,(d,h)=>(K(),ie("div",{key:d.id,class:"fade-item"},[Dt(c.$slots,"item",{item:d,index:h},()=>[Qe(ht(d.name),1)],!0)]))),128))]),_:3},8,["modelValue","disabled"]))}}),[["__scopeId","data-v-2106e8ed"]]),Pte={key:0},kte={key:1,style:{"font-style":"italic"}},Ate={key:2,style:{"font-style":"italic"}},Ote={key:3},Pv=Ct(st({__name:"DragDropItem",props:{item:{},isDisableNewCheck:{type:Boolean,default:!1},disableDrag:{type:Boolean,default:!1},disableCheckbox:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},columnStates:{},disableDragTooltip:{default:""},focusIndex:{}},emits:["toggle-column"],setup(e,{emit:t}){const n=Yt,o=e,s=V(o.columnStates[String(o.item.field)]||!1),r=t,i=h=>{s.value=h},a=q(()=>{var h;return(h=o.item)==null?void 0:h.context}),l=q(()=>{var f,p,g;return(f=a.value)!=null&&f.formula?"formular":((g=(p=a.value)==null?void 0:p.metric_type)==null?void 0:g.code)||"number"}),c=q(()=>{var h,f;return(f=(h=o.item)==null?void 0:h.field)==null?void 0:f.includes("metric")}),u=q(()=>{var h;return c.value&&((h=a.value)==null?void 0:h.is_primary)==1}),d=q(()=>{var h;return c.value&&((h=a.value)==null?void 0:h.is_point_metric)==1});return tt(()=>s.value,()=>{r("toggle-column",o.item.field,o.item.required)}),(h,f)=>(K(),ie("div",{key:e.item.field,class:te([h.$style["column-config__item"],{[h.$style.disabled]:o.readOnly,[h.$style["is-metric"]]:c.value,[h.$style["is-point-metric"]]:d.value,[h.$style["is-woohoo-metric"]]:u.value}])},[ue(LO,{focusIndex:o.focusIndex,id:`col-${e.item.field}`,"model-value":s.value==!0?H(Ft).CHECKED:H(Ft).UNCHECK,"onUpdate:modelValue":i,disabled:o.disableCheckbox||e.isDisableNewCheck&&!s.value,size:"16px"},null,8,["focusIndex","id","model-value","disabled"]),Ke((K(),ie("div",{class:"move-handler",style:cn({cursor:o.disableDrag?"not-allowed":"move"})},[ue(lt,{color:o.disableDrag?"#D7D7D7":"#6B6B6B",source:"remote",src:"GripVertical",class:te(h.$style.handler)},null,8,["color","class"])],4)),[[H(n),o.disableDrag==!0?o.disableDragTooltip:""]]),c.value?(K(),ie("div",{key:0,class:te(h.$style["metric-type"])},[l.value=="rating"?(K(),ie("span",Pte,"★")):l.value=="formular"?(K(),ie("span",kte," ƒx ")):l.value=="number"?(K(),ie("span",Ate," # ")):(K(),ie("span",Ote,ht(l.value),1))],2)):Xe("",!0),me("span",{class:te(h.$style["column-config__item-label"])},[Ke((K(),ie("div",null,[Qe(ht(e.item.headerName),1)])),[[H(n),{content:e.item.headerName}]])],2),d.value?Ke((K(),ie("div",{key:1,class:te(h.$style["metric-icon"])},[ue(lt,{src:"Bullseye",color:"#A6A6A6"})],2)),[[H(n),"Point metric"]]):Xe("",!0),u.value?Ke((K(),ie("div",{key:2,class:te(h.$style["metric-icon"])},[ue(lt,{src:"ChartPie",color:"#A6A6A6"})],2)),[[H(n),"Woohoo metric"]]):Xe("",!0)],2))}}),[["__cssModules",{$style:{"column-config__item":"_column-config__item_1ppdl_1","is-metric":"_is-metric_1ppdl_8","is-woohoo-metric":"_is-woohoo-metric_1ppdl_12","is-point-metric":"_is-point-metric_1ppdl_15","column-config__item-label":"_column-config__item-label_1ppdl_18",disabled:"_disabled_1ppdl_34",readOnly:"_readOnly_1ppdl_38","column-config__item--pinned":"_column-config__item--pinned_1ppdl_41",handler:"_handler_1ppdl_48",badge:"_badge_1ppdl_52","metric-type":"_metric-type_1ppdl_78","metric-icon":"_metric-icon_1ppdl_106"}}]]),Mte=Ct(st({__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 o=e,s=n,{hide:r,triggerRef:i,popupRef:a,isVisible:l,toggle:c}=yo({toggleOnClick:!0,placement:o.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:o.show,maxWidth:o.maxWidth}),u=q(()=>l.value);tt(l,f=>{s(f?"open":"close")});const d=()=>{r()};t({closeDropdown:d,isOpen:u});const h=f=>{f.key==="Escape"&&a.value&&r()};return Qt(()=>{var p;const f=i.value instanceof HTMLElement?i.value:(p=i.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",h)}),qn(()=>{var p;const f=i.value instanceof HTMLElement?i.value:(p=i.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",h)}),(f,p)=>(K(),ie("div",{ref_key:"triggerRef",ref:i,class:te(f.$style["dropdown-wrapper"])},[Dt(f.$slots,"trigger",{open:H(l),toggle:H(c),closeDropdown:d},()=>[me("button",{class:te(f.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),me("div",{ref_key:"popupRef",ref:a,tabindex:"0",class:te(f.$style["dropdown-content"]),style:cn({display:H(l)?"block":"none",maxWidth:o.maxWidth?o.maxWidth+"px":"unset"})},[Dt(f.$slots,"content",{closeDropdown:d,visible:H(l)},()=>[me("div",{class:te(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"}}]]),Nte={class:"reach-limit-icon"},Lte=Ct(st({__name:"TableCustomization",props:{modelValue:{},readOnly:{type:Boolean},disabled:{type:Boolean},checkboxColumn:{},gridApi:{},tableHeight:{}},emits:["update:modelValue","input","change"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=ko,i=n,a=V(""),l=V(),c=q(()=>a.value.trim().length>0),u=V([]),d=V({}),{triggerRef:h,popupRef:f,isVisible:p,hide:g}=yo({toggleOnClick:!0,placement:"bottom-end",trigger:"click",offset:[0,0]});tt(p,k=>{var x;k&&((x=l.value)==null||x.focus())});const v=q(()=>s.disabled||a.value.length>0),w=q(()=>u.value.filter(k=>k.pinned==="left"&&k.field&&k.headerName)),S=q(()=>u.value.filter(k=>k.pinned==="right"&&k.field||k.field==="blank")),b=q({get:()=>u.value.filter(k=>!k.pinned&&k.field&&k.field!=="blank"),set:k=>{u.value=[...w.value,...k,...S.value]}}),C=q(()=>{if(!a.value)return{};const k=a.value.toLowerCase();return[...u.value,...b.value].reduce((x,$)=>{var W;return(W=$.headerName)!=null&&W.toLowerCase().includes(k)&&$.field&&(x[$.field]=!0),x},{})}),_=q(()=>s.modelValue),E=()=>{const k={};u.value.forEach(x=>{x.field&&(k[x.field]=!x.hide)}),d.value=k},I=q(()=>{if(!a.value)return u.value;const k=a.value.toLowerCase();return u.value.filter(x=>{var $;return($=x.headerName)==null?void 0:$.toLowerCase().includes(k)})}),T=()=>{var $;const k=($=s.gridApi)==null?void 0:$.getColumnState().reduce((W,Q)=>(W[Q.colId]=Number(Q.width),W),{}),x=u.value.map(W=>({...W,hide:W.field?!d.value[W.field]:!1,width:W.field?k==null?void 0:k[W.field]:W.width}));i("update:modelValue",x),i("change",x),i("input",x)},P=k=>{const x=[...w.value,...k,...S.value];s.checkboxColumn&&x.unshift(s.checkboxColumn),u.value=x,T()},M=k=>{k&&(d.value[k]=!d.value[k],T())};tt(_,k=>{k&&k.length>0&&(u.value=[...k],E())}),t({updateColumnDefs(k){u.value=[...k],E()}});const D=q(()=>O.value>=5),F=q(()=>s.disabled||a.value.length>0),O=q(()=>u.value.reduce((k,x)=>x.field&&x.field.includes("metric")&&d.value[x.field]===!0?k+1:k,0));return(k,x)=>(K(),ie("div",{class:te(k.$style["table-customization"])},[me("div",{ref_key:"triggerRef",ref:h},[Dt(k.$slots,"trigger",{},()=>[Ke((K(),Ue(at,{variant:["secondary"],disabled:s.disabled,actived:H(p),style:{width:"32px"},onEscape:H(g)},{prefix:he(()=>[ue(lt,{src:"TableColumns"})]),_:1},8,["disabled","actived","onEscape"])),[[H(r),"7"],[H(o),"Columns"]])])],512),me("div",{ref_key:"popupRef",ref:f,class:te(k.$style["tippy-content-wrapper"])},[me("div",{class:te([k.$style["column-config"],D.value?k.$style["has-warning"]:""]),style:cn({"--max-height":s.tableHeight?s.tableHeight:"max(500px, 60vh)"})},[ue(ES,{tabIndex:"7.0",modelValue:a.value,"onUpdate:modelValue":x[0]||(x[0]=$=>a.value=$),ref_key:"searchBoxRef",ref:l},null,8,["modelValue"]),me("div",{class:te(k.$style["column-config__header"])},[...x[2]||(x[2]=[me("span",null,"Manage columns",-1)])],2),D.value?(K(),ie("div",{key:0,class:te(k.$style["reach-limit"])},[me("div",Nte,[ue(lt,{src:"InfoCircle",color:"#F7941D",size:14})]),me("div",{class:te(k.$style["warning-limit-text"])},[...x[3]||(x[3]=[Qe(" You’ve reached the maximum number of metric columns. ",-1),me("br",null,null,-1),Qe(" Deselect one to show another. ",-1)])],2)],2)):Xe("",!0),c.value?(K(),ie(It,{key:1},[I.value.length===0&&c.value?(K(),ie("div",{key:0,class:te(k.$style["no-columns"])},[...x[4]||(x[4]=[Qe(" No results. ",-1),me("br",null,null,-1),Qe(" Try another search. ",-1)])],2)):Xe("",!0),c.value&&I.value.length>0?(K(),ie("div",{key:1,class:te(k.$style["column-config__pinned-section"])},[(K(!0),ie(It,null,Fn(I.value,$=>{var W;return K(),Ue(Pv,{key:$.colId,item:$,columnStates:d.value,disableDrag:F.value,disableDragTooltip:"Reordering is disabled while search is active.",readOnly:s.readOnly,isDisableNewCheck:D.value&&((W=$.colId)==null?void 0:W.includes("metric")),onToggleColumn:M},null,8,["item","columnStates","disableDrag","readOnly","isDisableNewCheck"])}),128))],2)):Xe("",!0)],64)):Xe("",!0),c.value?Xe("",!0):(K(),ie("div",{key:2,class:te(k.$style["column-config__list"])},[(K(!0),ie(It,null,Fn(w.value,$=>Ke((K(),Ue(Pv,{key:$.field,item:$,disabled:!0,readOnly:!0,disableDrag:!0,disableDragTooltip:" ","disable-checkbox":!0,columnStates:d.value},null,8,["item","columnStates"])),[[Ks,C.value[$.field]||!a.value]])),128)),ue(Fte,{modelValue:b.value,"onUpdate:modelValue":x[1]||(x[1]=$=>b.value=$),"group-name":"columns",onChanged:P,disabled:v.value,readOnly:s.readOnly},{item:he(({item:$,index:W})=>[Ke((K(),Ue(Pv,{focusIndex:`7.${W+1}`,key:$.id,item:$,columnStates:d.value,disableDrag:F.value,disableDragTooltip:F.value?"Reordering is disabled while search is active.":void 0,readOnly:s.readOnly,isDisableNewCheck:D.value&&$.id.includes("metric"),onToggleColumn:M},null,8,["focusIndex","item","columnStates","disableDrag","disableDragTooltip","readOnly","isDisableNewCheck"])),[[Ks,C.value[$.field]||!a.value]])]),_:1},8,["modelValue","disabled","readOnly"]),(K(!0),ie(It,null,Fn(S.value.filter($=>{var W;return $.headerName&&((W=$.headerName)==null?void 0:W.length)>0}),$=>Ke((K(),Ue(Pv,{key:$.field,item:$,disabled:s.disabled,readOnly:s.readOnly,columnStates:d.value},null,8,["item","disabled","readOnly","columnStates"])),[[Ks,C.value[$.field]||!a.value]])),128))],2))],6)],2)],2))}}),[["__cssModules",{$style:{"reach-limit":"_reach-limit_1m3bt_1","reach-limit-icon":"_reach-limit-icon_1m3bt_11","warning-limit-text":"_warning-limit-text_1m3bt_18","table-customization":"_table-customization_1m3bt_24","table-customization__trigger":"_table-customization__trigger_1m3bt_30","column-config":"_column-config_1m3bt_46","has-warning":"_has-warning_1m3bt_61","column-config__header":"_column-config__header_1m3bt_64","icon-color":"_icon-color_1m3bt_73","column-config__list":"_column-config__list_1m3bt_76","column-config__section-label":"_column-config__section-label_1m3bt_80","column-config__footer":"_column-config__footer_1m3bt_89","column-config__add-button":"_column-config__add-button_1m3bt_92","cs-icon":"_cs-icon_1m3bt_110","no-columns":"_no-columns_1m3bt_114"}}]]),Vte=["aria-label"],Bte=["aria-disabled","onClick"],$te=Ct(st({__name:"MonthSelection",props:{monthLabels:{default:()=>["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},ariaLabel:{default:"Select month"},selectedYear:{default:null},selectedMonth:{default:null},displayYear:{default:null},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},isMonthSelectable:{type:Function,default:()=>!0}},emits:["select","keydown"],setup(e,{emit:t}){const n=e,o=t,s=a=>{n.disabled||n.readOnly||!n.isMonthSelectable(a)||o("select",a)},r=new Date().getFullYear(),i=new Date().getMonth()+1;return(a,l)=>(K(),ie("div",{class:te([a.$style["month-grid"],n.compact?a.$style.compact:""]),"aria-label":n.ariaLabel,"data-index":"month-selection"},[me("div",{class:te(a.$style.months)},[(K(!0),ie(It,null,Fn(n.monthLabels,(c,u)=>(K(),ie("a",{key:c,tabindex:"0",class:te([a.$style["month-cell"],{[a.$style.selected]:u+1===n.selectedMonth&&n.selectedYear===n.displayYear,[a.$style.current]:u+1===i&&H(r)===n.displayYear,[a.$style.disabled]:n.disabled||n.readOnly||!n.isMonthSelectable(u+1)}]),"aria-disabled":n.disabled||n.readOnly||!n.isMonthSelectable(u+1),onClick:d=>s(u+1),onKeydown:l[0]||(l[0]=d=>o("keydown",d))},ht(c),43,Bte))),128))],2)],10,Vte))}}),[["__cssModules",{$style:{"month-grid":"_month-grid_1t30z_1",months:"_months_1t30z_8","month-cell":"_month-cell_1t30z_22",selected:"_selected_1t30z_36",compact:"_compact_1t30z_40",current:"_current_1t30z_53",disabled:"_disabled_1t30z_61"}}]]),Hte=["data-year","aria-disabled","onClick"],Gte=Ct(st({__name:"YearSelection",props:{years:{},selectedYear:{default:null},disabled:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},isYearSelectable:{type:Function,default:()=>!0}},emits:["select","keydown"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=V(null),i=new Date().getFullYear(),a=l=>{o.disabled||!o.isYearSelectable(l)||s("select",l)};return t({rootEl:r}),Qt(()=>{if(r.value){const l=r.value.querySelector(`[data-year="${o.selectedYear}"]`);l&&l.scrollIntoView({block:"center"})}}),(l,c)=>(K(),ie("div",{ref_key:"rootEl",ref:r,class:te([l.$style["year-grid-body"],o.scrollable?l.$style.scrollable:"",o.compact?l.$style.compact:""]),role:"grid","data-index":"year-selection"},[(K(!0),ie(It,null,Fn(o.years,u=>(K(),ie("a",{key:u,"data-year":u,tabindex:"0",class:te([l.$style["year-cell"],{[l.$style.selected]:u===o.selectedYear,[l.$style.current]:u===H(i),[l.$style.disabled]:o.disabled||!o.isYearSelectable(u)}]),"aria-disabled":o.disabled||!o.isYearSelectable(u),onClick:d=>a(u),onKeydown:c[0]||(c[0]=d=>s("keydown",d))},ht(u),43,Hte))),128))],2))}}),[["__cssModules",{$style:{"year-grid-body":"_year-grid-body_178a1_1",scrollable:"_scrollable_178a1_11","year-cell":"_year-cell_178a1_16",selected:"_selected_178a1_28",current:"_current_178a1_31",compact:"_compact_178a1_35",disabled:"_disabled_178a1_47"}}]]),Ute={class:"navigation"},Wte={class:"picker"},zte={key:0,class:"footer"},jte=Ct(st({__name:"MonthPickerLayout",props:{disableConfirm:{type:Boolean,default:!1}},setup(e){return(t,n)=>(K(),ie("div",{class:te(["month-picker-layout",{"disable-confirm":e.disableConfirm}])},[me("div",Ute,[Dt(t.$slots,"navigation",{},void 0,!0)]),me("div",Wte,[Dt(t.$slots,"picker",{},void 0,!0)]),ue(xT,{name:"fade",mode:"out-in"},{default:he(()=>[e.disableConfirm?Xe("",!0):(K(),ie("div",zte,[Dt(t.$slots,"footer",{},void 0,!0)]))]),_:3})],2))}}),[["__scopeId","data-v-885d09b2"]]),Kte={style:{flex:"1"}},qte=Ct(st({__name:"CalendarFooter",props:{disabled:{type:Boolean},readOnly:{type:Boolean},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Save"},disableConfirm:{type:Boolean,default:!1}},emits:["cancel","confirm","goto-date"],setup(e,{emit:t}){const n=e,o=t,s=()=>{o("cancel")},r=()=>{o("confirm")},i=(l=new Date)=>{o("goto-date")},a=l=>{if(l.key==="Enter"||l.key===" "){l.preventDefault(),l.stopPropagation();const c=l.target;c.dataset.index==="today-btn"?i():c.dataset.index==="cancel-btn"?s():c.dataset.index==="save-btn"&&r()}};return(l,c)=>{const u=eu("tooltip");return n.readOnly?Xe("",!0):(K(),ie("div",{key:0,class:te(l.$style["arbo-calendar-actions"])},[me("div",Kte,[Ke((K(),Ue(H(at),{variant:"secondary",size:"medium",onClick:c[0]||(c[0]=d=>i()),onKeydown:a,"data-index":"today-btn"},{prefix:he(()=>[ue(H(lt),{src:"CalendarDay"})]),_:1})),[[u,"Today"]])]),ue(H(at),{disabled:n.disabled,readOnly:n.readOnly,onKeydown:a,variant:"secondary",size:"medium",onClick:s,"data-index":"cancel-btn"},{default:he(()=>[Qe(ht(n.cancelLabel),1)]),_:1},8,["disabled","readOnly"]),ue(H(at),{disabled:n.disabled||n.disableConfirm,readOnly:n.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:a,onClick:r},{default:he(()=>[Qe(ht(n.confirmLabel),1)]),_:1},8,["disabled","readOnly"])],2))}}}),[["__cssModules",{$style:{"arbo-calendar-actions":"_arbo-calendar-actions_132g0_1"}}]]),Yte=Ct(st({__name:"CalendarNavigation",props:{disabled:{type:Boolean},readOnly:{type:Boolean},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Save"},disableConfirm:{type:Boolean,default:!1},minDate:{},maxDate:{},monthLabels:{},monthLabelStyle:{},locale:{},month:{},year:{},hideMonth:{type:Boolean,default:!1},mode:{}},emits:["cancel","confirm","goto-date","prev","next","toggle-months","toggle-years"],setup(e,{emit:t}){const n=e,o=ds({month:new Date().getMonth()+1,year:new Date().getFullYear()}),s=q(()=>{if(n.minDate){const h=o.month===1?12:o.month-1,f=o.month===1?o.year-1:o.year;return new Date(f,h-1,1)<new Date(n.minDate.getFullYear(),n.minDate.getMonth(),1)}return!1}),r=q(()=>{if(n.maxDate){const h=o.month===12?1:o.month+1,f=o.month===12?o.year+1:o.year;return new Date(f,h-1,1)>new Date(n.maxDate.getFullYear(),n.maxDate.getMonth(),1)}return!1}),i=t,a=()=>{s.value||(n.mode==="month"?o.month=o.month===0?11:o.month-1:n.mode==="year"&&(o.year-=1)),i("prev",{month:o.month,year:o.year})},l=()=>{r.value||(n.mode==="month"?o.month=o.month===11?0:o.month+1:n.mode==="year"&&(o.year+=1)),i("next",{month:o.month,year:o.year})},c=()=>{i("toggle-months")},u=()=>{i("toggle-years")},d=q(()=>{if(n.monthLabels&&n.monthLabels.length===12)return n.monthLabels;const h=n.locale||"en-US",f=n.monthLabelStyle||"short",p=new Intl.DateTimeFormat(h,{month:f,timeZone:"UTC"});return Array.from({length:12},(v,w)=>p.format(new Date(Date.UTC(2020,w,1))))});return(h,f)=>(K(),ie("div",{class:te(h.$style["cal-nav-bar"])},[e.mode!="year"?(K(),Ue(H(at),{key:0,variant:"tertiary",class:te([h.$style["cal-nav-btn"],h.$style.prev]),"aria-label":"Previous",disabled:s.value,label:"",onClick:a,"data-index":"prev-btn",onKeydownCapture:jn(kt(a,["prevent","stop"]),["enter"])},{default:he(({hovered:p})=>[ue(H(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Xe("",!0),me("div",{class:te([h.$style["cal-nav-center"],e.hideMonth?h.$style.single:""])},[e.hideMonth?Xe("",!0):(K(),Ue(H(at),{key:0,"data-index":"month-btn",variant:"secondary",onClick:c},{default:he(()=>[Qe(ht(d.value[n.month-1]),1)]),_:1})),ue(H(at),{variant:"secondary",onClick:u,"data-index":"year-btn"},{default:he(()=>[Qe(ht(n.year),1)]),_:1})],2),e.mode!="year"?(K(),Ue(H(at),{key:1,"data-index":"next-btn",variant:"tertiary",class:te([h.$style["cal-nav-btn"],h.$style.next]),"aria-label":"Next",disabled:r.value,label:"",onClick:l,onKeydownCapture:jn(kt(l,["prevent","stop"]),["enter"])},{default:he(({hovered:p})=>[ue(H(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_1jrqr_1","cal-nav-bar":"_cal-nav-bar_1jrqr_12","cal-nav-btn":"_cal-nav-btn_1jrqr_19",prev:"_prev_1jrqr_32","year-grid-header":"_year-grid-header_1jrqr_36","cal-nav-center":"_cal-nav-center_1jrqr_45",single:"_single_1jrqr_52","cal-nav-label":"_cal-nav-label_1jrqr_56","year-grid":"_year-grid_1jrqr_36",months:"_months_1jrqr_78","month-cell":"_month-cell_1jrqr_85","year-cell":"_year-cell_1jrqr_86","pg-btn":"_pg-btn_1jrqr_108","year-grid-body":"_year-grid-body_1jrqr_121",selected:"_selected_1jrqr_125","days-slot":"_days-slot_1jrqr_131","range-label":"_range-label_1jrqr_135"}}]]),Zte=["aria-label"];new Date().getUTCFullYear()-12,new Date().getUTCFullYear()+12;const bM=Ct(st({__name:"StatusSelect",props:{modelValue:{},getStatusFunc:{},workspaceId:{},id:{},maxWidth:{default:"500px"}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const o={PER_PAGE:20,INITIAL_PAGE:1},s=(F,O=0)=>F?`${parseInt(F,10)+O}px`:"auto",r=(F,O=0)=>F?parseInt(F,10)+O:0,i=e,a=V(i.modelValue),l=n,c=q(()=>p.value.find(F=>F.id===a.value)||null),u=F=>{a.value=F.id,l("update:modelValue",F.id)};q(()=>{if(!a.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const F=p.value.find(k=>k.id===a.value),O=String((F==null?void 0:F.color)||"white");return{backgroundColor:O,border:em(O,"white")?"1px solid #ccc":"1px solid #fff"}});const d=q(()=>{const F=p.value.find(k=>k.id===a.value);return String((F==null?void 0:F.color)||"white")});q(()=>new Pn(d.value).isLight()?"#000":"#fff");const h=V(null),f=()=>{var F;(F=h.value)==null||F.focus()},p=V([]),g=V(!1),v=V(!1),w=V(null),S=V(o.INITIAL_PAGE),b=V(!0),C=V(0),_=V(""),E=q(()=>!!(i.id&&i.workspaceId)),I=F=>{const O=p.value.find(k=>k.id===F.value);O&&u(O)},T=F=>({label:F.name,value:F.id,selected:a.value===F.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:F,id:F.id,color:F.color}),P=async(F=o.INITIAL_PAGE,O="",k=!1)=>{var x;if(!E.value){console.error("Missing required props",i);return}k?v.value=!0:g.value=!0,w.value=null;try{const $={workspaceId:String(i.workspaceId),itemIds:i.id,page:F,perPage:o.PER_PAGE,name_like:O.trim()};if(i.getStatusFunc===void 0)throw new Error("API service getAssignableStatus is undefined");const W=await i.getStatusFunc($);if(!W){k||(p.value=[]),b.value=!1;return}const Q=W.data.map(T);p.value=k?[...p.value,...Q]:Q,C.value=((x=W.meta)==null?void 0:x.total)??W.data.length,b.value=p.value.length<C.value,S.value=F}catch($){console.error("Error fetching statuses:",$),w.value="Failed to load statuses",k||(p.value=[]),b.value=!1,l("error",w.value)}finally{g.value=!1,v.value=!1}},M=async()=>{!b.value||v.value||await P(S.value+1,_.value,!0)};tt([()=>i.id,()=>i.workspaceId],()=>{P()},{deep:!0,immediate:!0});const D=async F=>{_.value=F,S.value=o.INITIAL_PAGE,await P(o.INITIAL_PAGE,F,!1)};return t({focus:f,clear:()=>{a.value=null,l("update:modelValue",null)}}),(F,O)=>(K(),Ue(Mte,{onOpen:f,placement:"bottom-start","max-width":r(i.maxWidth)},{trigger:he(({open:k})=>[ue(VO,{value:c.value,style:{width:"100%"},"read-only":!1},{suffix:he(()=>[ue(lt,{src:"ChevronUp",source:"remote",class:te([[F.$style["dropdown-icon"]],{[F.$style["dropdown-icon-show"]]:!k}])},null,8,["class"])]),_:2},1032,["value"])]),content:he(({closeDropdown:k})=>{var x;return[ue(na,{ref_key:"popupRef",ref:h,"selected-id":(x=c.value)==null?void 0:x.id,options:p.value,loading:g.value,itemWidth:s(i.maxWidth,-10),"loading-more":v.value,"has-more":b.value,error:w.value,onSearch:D,onSelect:$=>{I($),k()},onLoadMore:M,onCancel:O[0]||(O[0]=$=>l("cancel")),style:cn({width:s(i.maxWidth,-10)})},null,8,["selected-id","options","loading","itemWidth","loading-more","has-more","error","onSelect","style"])]}),_:1},8,["max-width"]))}}),[["__cssModules",{$style:{"status-wrapper":"_status-wrapper_149oc_1",status:"_status_149oc_1","color-indicator":"_color-indicator_149oc_13","status-text":"_status-text_149oc_22",empty:"_empty_149oc_29","dropdown-icon":"_dropdown-icon_149oc_33","dropdown-icon-show":"_dropdown-icon-show_149oc_38",options:"_options_149oc_42"}}]]),SM=e=>({updateCellData:({rowId:n,field:o,value:s})=>{if(!e)return;const r=e.getRowNode(n);r&&r.setDataValue(o,s),e.refreshCells({rowNodes:r?[r]:[],columns:[o],force:!0})}}),Xte={key:2},Jte=Ct(st({name:"MetricEditorWrapper",__name:"MetricEditorWrapper",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},emits:["update:value","clear","copy"],setup(e,{emit:t}){var S;const n=e,o=V(n.value),s=V(!0),r=V(""),i=()=>{var M,D,F;const b=(M=u.value)==null?void 0:M.restricted_type.trim(),C=((F=(D=u.value)==null?void 0:D.restricted_value)==null?void 0:F.split(",").map(Number))||[],[_,E]=C,T={range:`Enter a value between ${_} and ${E}`,not:`These values are not allowed: ${C.join(", ")}`,exact:"Value is not allowed"}[b];return s.value?"":T},a=b=>{if(u.value){if(b===null||b===""){s.value=!0;return}if(c.value!=="number"){s.value=!0;return}s.value=Im(u.value,Number(b)),r.value=i()}};q(()=>s.value?{content:"",showOnCreate:!1}:{content:r.value,bypassOverflowCheck:!0,showOnCreate:!0,theme:"error",alwaysShow:!0});const l=V(null),c=q(()=>uP(u.value)),u=q(()=>{var C,_;return((_=(C=n.params)==null?void 0:C.colDef)==null?void 0:_.context)||null}),{apiServices:d}=Zn(!0,n),{updateCellData:h}=SM((S=n.params)==null?void 0:S.api),f=V(!1),p=Yr(n,"id"),g=()=>{var b;(b=n.params)==null||b.api.stopEditing()},v=()=>{g()},w=async b=>{var _,E;if(g(),f.value=!0,o.value=b||null,b===n.value){f.value=!1;return}const C={itemIds:[String(p.value)],metricId:((_=u.value)==null?void 0:_.id)||"",workspaceId:String(n.workspaceId)};b==null?C.clear=1:C.value=b,h({rowId:String(p.value),field:`metric_${C.metricId}`,value:void 0});try{const I=await((E=d.value)==null?void 0:E.bulkUpdateMetric(C));(I==null?void 0:I.message)=="Done"?h({rowId:String(p.value),field:`metric_${C.metricId}`,value:b||null}):(h({rowId:String(p.value),field:`metric_${C.metricId}`,value:n.value}),console.error("Failed to update metric value:",I),o.value=n.value)}catch(I){console.error("Error during bulk metric update:",I),h({rowId:String(p.value),field:`metric_${C.metricId}`,value:n.value})}finally{f.value=!1}};return(b,C)=>(K(),ie("div",{class:"metric-editor-wrapper",ref_key:"metricEditorWrapperRef",ref:l},[c.value=="dropdown"&&u.value?(K(),Ue(RA,{key:0,config:u.value,modelValue:o.value,"onUpdate:modelValue":C[0]||(C[0]=_=>o.value=_),onChange:w,onHandleCancel:v},null,8,["config","modelValue"])):c.value=="number"&&u.value?(K(),Ue(DA,{key:1,showInlineError:!1,autoEmit:!0,config:u.value,modelValue:o.value,"onUpdate:modelValue":C[1]||(C[1]=_=>o.value=_),style:{width:"100%"},onHandleChange:w,onCancel:v,onOnValidation:a},null,8,["config","modelValue"])):(K(),ie("div",Xte,"Metric type:"+ht(c.value),1))],512))}}),[["__scopeId","data-v-519d44e5"]]),Qte=Ct(st({name:"EmptyData",__name:"EmptyData",props:{isSearching:{type:Boolean},isFiltering:{type:Boolean}},setup(e){const t=e,n={noData:"No data available.",noSearchResults:"No results. Try another search.",noFilterResults:"No results. Try another filter.",emptySearchFilter:"No results. Try another search or filter."};q(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate");const o=q(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),s=V(!1);return Qt(()=>{s.value=!0}),(r,i)=>(K(),ie("div",{class:te(r.$style["no-data-item-table"])},[me("div",{class:te(r.$style.visual)},[s.value?(K(),Ue(Ka,{key:0,source:"remote",src:"NoDataGeneral",ratio:"4/3",maxWidth:500,maxHeight:350})):Xe("",!0)],2),me("div",{class:te(r.$style.description)},ht(o.value),3)],2))}}),[["__cssModules",{$style:{"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:"_visual_oh0wi_12",description:"_description_oh0wi_19"}}]]),EM=rc("sortStore",()=>{const e=V({}),t=V(void 0),n={id:"id",name:"name",isStated:"actual_start_date",isCompleted:"actual_due_date",lastUpdated:"updated_at",completedOn:"actual_due_date",status:"template_flow_status",assignees:"assignee"},o={start_asc:{column:"start_date",direction:"asc"},start_desc:{column:"start_date",direction:"desc"},due_asc:{column:"due_date",direction:"asc"},due_desc:{column:"due_date",direction:"desc"}},s=q(()=>{const c=e.value;return Object.values(c).filter(d=>d.sort!=="none"&&!!d.sort).map(d=>{let h;switch(d.colId){case"dateRange":h=o[d.sort];break;default:if(d.colId.includes("metric")){const[f,p]=d.colId.split("_");h={column:f,direction:d.sort,type:p}}else h={column:n[d.colId]||d.colId,direction:d.sort};break}return h})}),r=(c,u)=>{e.value={[c]:{colId:c,sort:u}}},i=()=>{e.value={}},a=V(!1);return{sortingAPIConfiguration:s,sorts:e,setSort:r,clearSorting:i,isSortingRunning:a,defaultSortStorePreferences:t,setDefaultSort:c=>{console.log("Setting default sort:",c),t.value=c}}}),ene=(e,t)=>{var r;const n=sessionStorage.getItem("ws.terminology"),o=n?JSON.parse(n):null;return` ${((r=o==null?void 0:o.find(i=>i.code==="scene"))==null?void 0:r.name)||"Scene"} `.trim()},tne={class:"paragraph"},nne=["href"],one=["checked"],kv="hideDefaultSortingNotification",sne=Ct(st({name:"DefaultSortingNotification",__name:"DefaultSortingNotification",setup(e,{expose:t}){const n=f=>{f.preventDefault(),f.metaKey||f.ctrlKey?window.open(h.value,"_blank"):window.location.href=h.value,u()},o=()=>{s.value=!s.value},s=V(localStorage.getItem(kv)==="true"),r=()=>{s.value=localStorage.getItem(kv)==="true",localStorage.getItem(kv)!=="true"&&l()},i=()=>{localStorage.setItem(kv,String(s.value)),u()},{triggerRef:a,show:l,popupRef:c,hide:u}=yo({toggleOnClick:!1,trigger:"manual",appendTo:()=>document.getElementById("item-table-layout-id")||document.body,zIndex:8,offset:[0,8],showOnInit:!1,interactive:!0,showArrow:!0});t({show:r,hide:u});const d=q(()=>ene()),h=q(()=>{const f=sessionStorage.getItem("BASE_URL")||"",p=sessionStorage.getItem("ws.code")||"";return`${f}/${p}/ac/prf`});return(f,p)=>(K(),ie(It,null,[me("div",{class:"main-trigger",ref_key:"triggerRef",ref:a},[Dt(f.$slots,"default")],512),me("div",{class:"popup",ref_key:"popupRef",ref:c},[me("div",{class:te(f.$style["default-sorting-notification"])},[me("div",tne,[Qe(" This sort only applies to the current list. To change the default sorting for "+ht(d.value)+" lists, go to ",1),me("a",{href:h.value,onClick:n},"My Settings > Preferences",8,nne),p[0]||(p[0]=Qe(" . ",-1))]),me("div",{class:te(f.$style.footer)},[me("label",{class:te(f.$style["checkbox-section"])},[me("input",{type:"checkbox",checked:s.value,onChange:kt(o,["stop"]),style:{"--input-size":"16px"}},null,40,one),p[1]||(p[1]=Qe(" Don't show this tip again ",-1))],2),ue(at,{size:"small",variant:["primary","text"],style:{padding:"0 8px"},onClick:i},{default:he(()=>[...p[2]||(p[2]=[Qe(" Got it ",-1)])]),_:1})],2)],2)],512)],64))}}),[["__cssModules",{$style:{"default-sorting-notification":"_default-sorting-notification_5uy9k_1",footer:"_footer_5uy9k_19","checkbox-section":"_checkbox-section_5uy9k_25"}}]]),gc=st({name:"HeaderSorting",__name:"HeaderWrapper",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean}},setup(e){const t=e,n=EM(),{sorts:o,defaultSortStorePreferences:s}=ns(n),r=q(()=>{var f,p;return((p=(f=t.params)==null?void 0:f.column)==null?void 0:p.getColId())||"template_col_id"}),i=V(null),a={name:"name",template_flow_status:"status"};tt(()=>s.value,f=>{var p;f!=null&&f.field&&a[f==null?void 0:f.field]==r.value&&((p=i.value)==null||p.setDefaultSort(f))});const l=f=>{var p;r.value&&n.setSort(r.value,f),(p=u.value)==null||p.show()},c=q(()=>t.params.headerType||void 0),u=V(null),d=V("none");tt(()=>o.value,xr(()=>{var f;if(r.value){const p=o.value[r.value];d.value=p?p.sort:"none",d.value=="none"&&((f=i.value)==null||f.clear())}},li),{deep:!0,immediate:!0});const h=()=>{var f;(f=u.value)==null||f.hide()};return Qt(()=>{var p;const f=(p=t.params)==null?void 0:p.api;f==null||f.addEventListener("bodyScroll",h)}),Ol(()=>{var p;const f=(p=t.params)==null?void 0:p.api;f==null||f.removeEventListener("bodyScroll",h)}),(f,p)=>(K(),Ue(sne,{ref_key:"sortingNotificationRef",ref:u},{default:he(()=>[r.value?(K(),Ue(mee,Wt({key:0,ref_key:"headerSortingRef",ref:i},t,{"header-type":c.value,modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=g=>d.value=g),onSortChanged:l,onOpen:h}),null,16,["header-type","modelValue"])):Xe("",!0)]),_:1},512))}});function rne(){const e=ds({isCreating:!1,name:"",error:void 0,assignees:null,status:null,start_date:null,due_date:null}),t=()=>{const s=e.name.trim();e.status,s.length===0?e.error="Name cannot be empty":s.length>255?e.error="Name cannot exceed 255 characters":e.error=void 0},n=()=>{e.isCreating=!0,e.name="",e.error=void 0,e.assignees=null,e.status=null,e.start_date=null,e.due_date=null},o=()=>{e.isCreating=!1};return tt(()=>e,()=>{t()},{deep:!0}),{newItemData:e,validateNewItem:t,openNewItemForm:n,closeNewItemForm:o,resetNewItemForm:()=>{e.name="",e.assignees=null,e.start_date=null,e.due_date=null,e.error=void 0}}}const Av=rc("userStore",()=>{const e=V(null),t=V(null);return{user:e,setUser:s=>{e.value=s},setUserRoleId:s=>{t.value=s},workspaceUserRoleId:t}}),ine=["innerHTML"],ane=20,lne=Ct(st({__name:"AddNewAssignee",props:{maxVisible:{default:3}},emits:["updated","cancel","start-update","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const o=e,{triggerRef:s,popupRef:r,isVisible:i,show:a,hide:l}=yo({toggleOnClick:!0,appendTo:"parent",offset:[-15,8]}),c=()=>{a()},u=V(null),d=()=>{M.value=[],pe.value=!1},h=q(()=>i.value),f=q(()=>{var U;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((U=M.value)==null?void 0:U.length)===0,wrapperRef:s,active:h,bordered:!0}}),{argsMain:p}=Co(f),g=Yt,v=n,w=q(()=>{var U;return Math.max(0,(((U=M.value)==null?void 0:U.length)||0)-o.maxVisible)}),S=q(()=>{var U;return w.value<=0?"":((U=M.value)==null?void 0:U.slice(o.maxVisible).map(ge=>ge.name).join(", "))||""}),b=V(!1),C=V(!1),_=V(null),E=V(1),I=V(!0),T=V(0),P=V(""),M=V([]),D=q(()=>{var U;return((U=M.value)==null?void 0:U.map(ge=>ge.id))||[]}),{assigneeList:F,mergedOptions:O}=Om({...o,value:[]}),{apiServices:k}=Zn(!1,o),x=yn("entityId"),$=async(U=1,ge="",oe=!1)=>{var G,Y,de,ke,xe;if(!k.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(oe?C.value=!0:b.value=!0,_.value=null,!((G=k.value)!=null&&G.getAssignableAssignees))throw new Error("API service getAssignableAssignees is undefined");const Re=un.getInstance().getItem("ws.code");try{const Ve=await((Y=k.value)==null?void 0:Y.getAssignableAssignees(String(Re),{entity_ids:(x==null?void 0:x.value)||"",page:U,per_page:ane,display_name_like:ge})),ye=((de=Pu(Ve.data))==null?void 0:de.map(Am))??[];F.value=oe?vu(F.value,ye,"id"):ye,T.value=Ve.meta.total,I.value=(((ke=Ve==null?void 0:Ve.meta)==null?void 0:ke.current_page)||0)<(((xe=Ve==null?void 0:Ve.meta)==null?void 0:xe.last_page)||0),E.value=U}catch(Ve){console.error("Error fetching assignable users:",Ve),_.value="Failed to load assignable users"}finally{b.value=!1,C.value=!1}},W=U=>{var ge,oe,Re;if((ge=M.value)!=null&&ge.some(G=>G.id===U.data.id)){M.value=(oe=M.value)==null?void 0:oe.filter(G=>G.id!==U.data.id);return}M.value=[...M.value||[],U.data],(Re=u.value)==null||Re.focus()},Q=()=>{M.value=[]},ae=()=>{!C.value&&I.value&&$(E.value+1,P.value,!0)},ee=xr(async U=>{P.value=U,await $(1,U,!1)},li);tt(()=>i.value,U=>{var ge;U?($(1,P.value,!1),(ge=u.value)==null||ge.focus(),v("show")):v("hide")});const X=q(()=>{var U;return((U=M.value)==null?void 0:U.slice(0,3))||[]}),N=q(()=>X.value.map(U=>({id:U.id,name:U.name,initial:U.initial,avatarId:U.id,profile_image:U.profile_image,color:U.color,size:24,user:U}))),z=Av(),{user:ne}=ns(z),pe=V(!1);t({getData:()=>M.value,clear:d,setData:U=>{M.value=U},focus:()=>{a(),vt(()=>{var U;(U=u.value)==null||U.focus()})},hide:()=>{l()}}),tt([M,pe],()=>{v("updated",M.value)},{deep:!0});const ve=U=>{var ge;M.value=(ge=M.value)==null?void 0:ge.filter(oe=>oe.id!==U)},we=U=>{var oe;const ge=un.getInstance().getItem("ws.code");return((oe=k.value)==null?void 0:oe.getUserInformation(ge,U))||Promise.resolve(null)},re=V();return(U,ge)=>(K(),ie("div",{class:"new-assignee-wrapper",ref_key:"wrapperRef",ref:re},[ue(_o,Wt(H(p),{style:{"--icon-size":"18px"}}),{prefix:he(()=>[N.value.length==0?(K(),ie("div",{key:0,class:te([U.$style["icon-wrapper"],"wrapper-prefix"]),onClick:kt(c,["stop","prevent"])},[ue(lt,{src:"UserPlus",color:"#A6A6A6"})],2)):Xe("",!0)]),default:he(()=>[me("div",{class:te([U.$style["assignee-row"],U.$style["assignee-selector"]]),ref_key:"triggerRef",ref:s},[me("div",{style:{flex:1},class:te([U.$style["assignee-row"]])},[(K(!0),ie(It,null,Fn(N.value,oe=>(K(),Ue(If,{onClear:Re=>ve(oe.id),key:oe.user.id,"disable-remove":!1},{default:he(()=>[ue(Gu,{user:oe.user,apiUpdateFunction:we,appendTo:re.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),w.value>0?Ke((K(),ie("div",{key:0,class:te(U.$style["extra-avatars"])},[Qe(" +"+ht(w.value),1)],2)),[[H(g),S.value]]):Xe("",!0)],2)],2)]),_:1},16),me("div",{ref_key:"popupRef",ref:r},[ue(na,Wt({"selected-id":D.value},{...o},{options:H(O),loading:b.value,"loading-more":C.value,"has-more":I.value,ref_key:"searchListRef",ref:u,onTab:ge[0]||(ge[0]=oe=>v("tab",oe)),onSelect:ge[1]||(ge[1]=oe=>{W(oe),v("start-update")}),onSearch:H(ee),onClose:ge[2]||(ge[2]=()=>v("close")),onLoadMore:ae}),{"extra-item":he(()=>[ue(_S,{onClick:Q,label:"Unassign",borderLeft:!0},{icon:he(()=>[ue(lt,{src:"UserXMark",source:"remote"})]),_:1})]),item:he(({item:oe,selectedIndex:Re,isSelected:G,handleSelect:Y,handleItemHover:de,getHighlightedLabel:ke,query:xe,idx:Ve})=>[ue(ic,Wt(oe,{hover:Ve===Re,selected:G(oe),type:oe.type,onClick:kt(ye=>Y(oe,ye),["stop","prevent"]),onMouseover:ye=>de(Ve),class:U.$style["item-assignee"]}),{prefix:he(()=>[ue(Gu,{user:oe.data,apiUpdateFunction:we,appendTo:H(r)},null,8,["user","appendTo"])]),label:he(({})=>[xe?Ke((K(),ie("span",{key:0,class:te([U.$style["item-label"],U.$style.match]),style:{flex:"1"},innerHTML:ke(oe.label)},null,10,ine)),[[H(g),{content:oe.label}]]):Ke((K(),ie("span",{key:1,class:te(U.$style["item-label"]),style:{flex:"1"}},[Qe(ht(oe.label),1)],2)),[[H(g),{content:oe.label}]])]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch"])],512)],512))}}),[["__cssModules",{$style:{action:"_action_1xvno_1","item-assignee":"_item-assignee_1xvno_6","item-action":"_item-action_1xvno_6","item-label":"_item-label_1xvno_16","icon-wrapper":"_icon-wrapper_1xvno_25","error-message":"_error-message_1xvno_34","empty-state":"_empty-state_1xvno_44","assignee-row":"_assignee-row_1xvno_57","assignee-selector":"_assignee-selector_1xvno_65",seperator:"_seperator_1xvno_69","extra-avatars":"_extra-avatars_1xvno_77",list:"_list_1xvno_89"}}]]),cne={key:0},une={key:1},dne={key:0},hne={key:1},fne={key:0,class:"wrapper-suffix"},pne={key:0,class:"wrapper-prefix",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"24px",height:"24px"}},gne=Ct(st({__name:"AddNewDate",emits:["updated","tab","show","hide"],setup(e,{expose:t,emit:n}){const o=Yt,{triggerRef:s,popupRef:r,isVisible:i,hide:a,show:l}=yo({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),c=()=>{u.value=[null,null]},u=V([null,null]),d=C=>{const _=Tm();return C?bt.fromJSDate(C,{zone:_}).toFormat("MMM dd"):""},h=q(()=>i.value),f=q(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:u.value[0]===null&&u.value[1]===null,wrapperRef:s,active:h,bordered:!0})),{argsMain:p}=Co(f),g=V(!1),v=C=>{S("tab",C)},w=C=>{"start"in C&&C.start!==void 0&&(u.value[0]=C.start),"end"in C&&C.end!==void 0&&(u.value[1]=C.end)};t({getData:()=>u.value,clear:c,setData:C=>{u.value=C},focus:()=>{l(),vt(()=>{var C;(C=b.value)==null||C.focus()})},hide:()=>{a()}});const S=n;tt(()=>u.value,C=>{S("updated",C)},{deep:!0});const b=V(null);return tt(()=>i.value,C=>{C?(vt(()=>{var _;(_=b.value)==null||_.focus()}),S("show")):S("hide")}),(C,_)=>(K(),ie(It,null,[ue(_o,Wt({ref_key:"triggerRef",ref:s},H(p),{style:{"--icon-size":"18px",cursor:"pointer"}}),{default:he(({focused:E})=>[me("div",{class:te(C.$style["date-time"])},[me("div",{class:te(C.$style.date)},[u.value[0]==null&&(E||H(i))?(K(),ie("span",cne,"MMMDD")):(K(),ie("span",une,ht(d(u.value[0])),1))],2),u.value[0]!==null||u.value[1]!==null||E||H(i)?(K(),ie("div",{key:0,class:te(C.$style.separator)}," → ",2)):Xe("",!0),me("div",{class:te(C.$style.date)},[u.value[1]==null&&(E||H(i))?(K(),ie("span",dne,"MMMDD")):(K(),ie("span",hne,ht(d(u.value[1])),1))],2)],2)]),suffix:he(({hovered:E,focused:I})=>[(u.value[0]!==null||u.value[1]!==null)&&(E||I||H(i))?(K(),ie("div",fne,[Ke((K(),Ue(at,{onClick:kt(c,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:he(()=>[ue(lt,{src:"XMarkSolid",size:"8"})]),_:1})),[[H(o),"Clear"]])])):Xe("",!0)]),prefix:he(()=>[u.value[0]===null&&u.value[1]===null?(K(),ie("div",pne,[ue(lt,{src:"Calendar",color:"#A6A6A6"})])):Xe("",!0)]),_:1},16),me("div",{ref_key:"popupRef",ref:r},[H(i)?(K(),Ue(Ym,{key:0,immediatelyUpdate:!1,value:u.value,onConfirmed:w,ref_key:"calendarRef",ref:b,onClosed:H(a),onStartUpdate:_[0]||(_[0]=E=>g.value=!0),onFinishUpdate:_[1]||(_[1]=E=>g.value=!1),onTab:v},null,8,["value","onClosed"])):Xe("",!0)],512)],64))}}),[["__cssModules",{$style:{"list-item":"_list-item_n9o5g_2","date-time":"_date-time_n9o5g_5",date:"_date_n9o5g_5",separator:"_separator_n9o5g_18"}}]]),mne=Ct(st({__name:"AddNewStatus",props:{entityId:{}},emits:["updated","error","cancel","update:modelValue","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const o=e,s={PER_PAGE:20,INITIAL_PAGE:1},{triggerRef:r,popupRef:i,isVisible:a,show:l,hide:c}=yo({toggleOnClick:!0,appendTo:"parent"}),u=V(null),d=V([]),h=V(!1),f=V(!1),p=V(null),g=V(s.INITIAL_PAGE),v=V(!0),w=V(0),S=V(""),b=n,C=q(()=>a.value),_=q(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:!u.value,wrapperRef:r,active:C,bordered:!0})),E=V(null),{argsMain:I}=Co(_),T=q(()=>u.value?d.value.filter(X=>X.id===u.value):[]),P=q(()=>!u.value||T.value.length===0?"":T.value[0].label),M=q(()=>u.value?[u.value]:[]),D=q(()=>{if(!u.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6",minWidth:"14px"};const X=T.value[0],N=String((X==null?void 0:X.color)||"white");return{backgroundColor:N,border:em(N,"white")?"1px solid #ccc":"1px solid #fff",minWidth:"14px"}}),F=X=>({label:X.name,value:X.id,selected:u.value===X.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:X,id:X.id,color:X.color}),{apiServices:O}=Zn(!1,o),k=async(X=s.INITIAL_PAGE,N="",z=!1)=>{var ne,pe;z?f.value=!0:h.value=!0,p.value=null;try{const ve=un.getInstance().getItem("ws.code"),we=await((ne=O.value)==null?void 0:ne.getAssignableStatuses(ve,{entity_id:o.entityId||"",name_like:N,page:X,per_page:s.PER_PAGE}));if(!we){z||(d.value=[]),v.value=!1;return}const re=we.data.map(F);d.value=z?[...d.value,...re]:re,w.value=((pe=we.meta)==null?void 0:pe.total)??we.data.length,v.value=d.value.length<w.value,g.value=X}catch(ve){console.error("Error fetching statuses:",ve),p.value="Failed to load statuses",z||(d.value=[]),v.value=!1,b("error",p.value)}finally{h.value=!1,f.value=!1}},x=(X,N)=>{var ne;N.stopImmediatePropagation(),N.preventDefault(),N.stopPropagation();const z=X.id;u.value=z,(ne=E.value)==null||ne.focus(),b("update:modelValue",u.value),c()},$=async()=>{!v.value||f.value||await k(g.value+1,S.value,!0)},W=async X=>{S.value=X,g.value=s.INITIAL_PAGE,await k(s.INITIAL_PAGE,X,!1)},Q=()=>{u.value=null,b("update:modelValue",null)},ae=()=>{l(),vt(()=>{var X;(X=E.value)==null||X.focus()})};return tt(()=>a.value,X=>{var N;X?(k(1,S.value,!1),(N=E.value)==null||N.focus(),b("show")):b("hide")}),tt(()=>u.value,X=>{b("updated",X)}),t({focus:ae,clear:Q,getData:()=>u.value,setData:X=>{u.value=X},hide:c,autoFillDefault:async()=>{S.value="",await k(1,S.value,!1),d.value.length>0&&(u.value=d.value[0].id,b("update:modelValue",u.value))}}),(X,N)=>{const z=eu("tooltip");return K(),ie(It,null,[ue(_o,Wt({ref_key:"triggerRef",ref:r},H(I),{style:{"--icon-size":"18px"}}),{default:he(()=>[me("div",{class:te(X.$style.status)},[me("div",{class:te(X.$style["color-indicator"]),style:cn(D.value)},null,6),Ke((K(),ie("span",{class:te({[X.$style.empty]:T.value.length===0,[X.$style["status-text"]]:!0})},[Qe(ht(P.value),1)],2)),[[z,{content:P.value}]])],2)]),_:1},16),me("div",{ref_key:"popupRef",ref:i},[ue(na,{style:{width:"200px"},ref_key:"searchListRef",ref:E,"selected-id":M.value,options:d.value,loading:h.value,"loading-more":f.value,"has-more":v.value,error:p.value,onSearch:W,onSelect:x,onLoadMore:$,onCancel:N[0]||(N[0]=ne=>b("cancel")),onTab:N[1]||(N[1]=ne=>b("tab",ne)),onClose:N[2]||(N[2]=()=>b("close"))},null,8,["selected-id","options","loading","loading-more","has-more","error"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_10pcy_2",status:"_status_10pcy_6","color-indicator":"_color-indicator_10pcy_13","count-badge":"_count-badge_10pcy_26","status-text":"_status-text_10pcy_34",empty:"_empty_10pcy_43"}}],["__scopeId","data-v-5d0d3e7c"]]),vne=Ct(st({__name:"CreateNewScene",emits:["create-new-item","focus-on-id","search-for-code"],setup(e,{expose:t,emit:n}){const o=["name","assignees","status","date","cancel","create-keep","create"],s=Yt,r=kG("target"),i=yn("workspaceId"),a=yn("entityId"),l=n,c=e,{newItemData:u,validateNewItem:d,resetNewItemForm:h,closeNewItemForm:f}=rne(),{apiServices:p}=Zn(!1,c),{openSceneHub:g}=mf(),v=V(!1),w=V(!1),S=V(null),b=V({assignees:!1,status:!1,date:!1}),C={name:V(null),assignees:V(null),status:V(null),date:V(null),cancel:V(null),"create-keep":V(null),create:V(null)},_=C.name,E=C.assignees,I=C.status,T=C.date,P=C.cancel,M=C["create-keep"],D=C.create,F=V(new Map),O=q(()=>!!u.error||!u.name.trim()||w.value),k=(ye,L)=>{ye&&F.value.set(L,ye.$el||ye)},x=(ye,L)=>{if(ye==="date"){const[j,le]=Array.isArray(L)?L:[void 0,void 0];u.start_date=j,u.due_date=le}else u[ye]=L},$=()=>{u.isCreating=!0,S.value="name"},W=()=>{u.isCreating=!1,h()},Q=yn("switchInstance"),{addNotification:ae}=oa(),ee=ye=>{l("focus-on-id",ye)},X=(ye,L,j)=>{const le=dP(void 0,"created");ae({id:String(ye),message:`<div style="display:flex; flex-direction: column; align-items: flex-start;"><b>${le}</b>
161
+ */function QO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function hi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QO(Object(n),!0).forEach(function(o){Xee(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QO(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function mv(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?mv=function(t){return typeof t}:mv=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mv(e)}function Xee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sa(){return sa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},sa.apply(this,arguments)}function Jee(e,t){if(e==null)return{};var n={},o=Object.keys(e),s,r;for(r=0;r<o.length;r++)s=o[r],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function Qee(e,t){if(e==null)return{};var n=Jee(e,t),o,s;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var ete="1.14.0";function ra(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var ia=ra(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pf=ra(/Edge/i),eM=ra(/firefox/i),kf=ra(/safari/i)&&!ra(/chrome/i)&&!ra(/android/i),tM=ra(/iP(ad|od|hone)/i),tte=ra(/chrome/i)&&ra(/android/i),nM={capture:!1,passive:!1};function Cn(e,t,n){e.addEventListener(t,n,!ia&&nM)}function pn(e,t,n){e.removeEventListener(t,n,!ia&&nM)}function vv(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function nte(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function fi(e,t,n,o){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&vv(e,t):vv(e,t))||o&&e===n)return e;if(e===n)break}while(e=nte(e))}return null}var oM=/\s+/g;function Ns(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(oM," ").replace(" "+t+" "," ");e.className=(o+(n?" "+t:"")).replace(oM," ")}}function Bt(e,t,n){var o=e&&e.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in o)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),o[t]=n+(typeof n=="string"?"":"px")}}function od(e,t){var n="";if(typeof e=="string")n=e;else do{var o=Bt(e,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!t&&(e=e.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(n)}function sM(e,t,n){if(e){var o=e.getElementsByTagName(t),s=0,r=o.length;if(n)for(;s<r;s++)n(o[s],s);return o}return[]}function pi(){var e=document.scrollingElement;return e||document.documentElement}function bo(e,t,n,o,s){if(!(!e.getBoundingClientRect&&e!==window)){var r,i,a,l,c,u,d;if(e!==window&&e.parentNode&&e!==pi()?(r=e.getBoundingClientRect(),i=r.top,a=r.left,l=r.bottom,c=r.right,u=r.height,d=r.width):(i=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(s=s||e.parentNode,!ia))do if(s&&s.getBoundingClientRect&&(Bt(s,"transform")!=="none"||n&&Bt(s,"position")!=="static")){var h=s.getBoundingClientRect();i-=h.top+parseInt(Bt(s,"border-top-width")),a-=h.left+parseInt(Bt(s,"border-left-width")),l=i+r.height,c=a+r.width;break}while(s=s.parentNode);if(o&&e!==window){var f=od(s||e),p=f&&f.a,g=f&&f.d;f&&(i/=g,a/=p,d/=p,u/=g,l=i+u,c=a+d)}return{top:i,left:a,bottom:l,right:c,width:d,height:u}}}function rM(e,t,n){for(var o=Ja(e,!0),s=bo(e)[t];o;){var r=bo(o)[n],i=void 0;if(i=s>=r,!i)return o;if(o===pi())break;o=Ja(o,!1)}return!1}function sd(e,t,n,o){for(var s=0,r=0,i=e.children;r<i.length;){if(i[r].style.display!=="none"&&i[r]!==$t.ghost&&(o||i[r]!==$t.dragged)&&fi(i[r],n.draggable,e,!1)){if(s===t)return i[r];s++}r++}return null}function eE(e,t){for(var n=e.lastElementChild;n&&(n===$t.ghost||Bt(n,"display")==="none"||t&&!vv(n,t));)n=n.previousElementSibling;return n||null}function rr(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==$t.clone&&(!t||vv(e,t))&&n++;return n}function iM(e){var t=0,n=0,o=pi();if(e)do{var s=od(e),r=s.a,i=s.d;t+=e.scrollLeft*r,n+=e.scrollTop*i}while(e!==o&&(e=e.parentNode));return[t,n]}function ote(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[n][o])return Number(n)}return-1}function Ja(e,t){if(!e||!e.getBoundingClientRect)return pi();var n=e,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var s=Bt(n);if(n.clientWidth<n.scrollWidth&&(s.overflowX=="auto"||s.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(s.overflowY=="auto"||s.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return pi();if(o||t)return n;o=!0}}while(n=n.parentNode);return pi()}function ste(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function tE(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var Af;function aM(e,t){return function(){if(!Af){var n=arguments,o=this;n.length===1?e.call(o,n[0]):e.apply(o,n),Af=setTimeout(function(){Af=void 0},t)}}}function rte(){clearTimeout(Af),Af=void 0}function lM(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function cM(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var Ls="Sortable"+new Date().getTime();function ite(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(s){if(!(Bt(s,"display")==="none"||s===$t.ghost)){e.push({target:s,rect:bo(s)});var r=hi({},e[e.length-1].rect);if(s.thisAnimationDuration){var i=od(s,!0);i&&(r.top-=i.f,r.left-=i.e)}s.fromRect=r}})}},addAnimationState:function(o){e.push(o)},removeAnimationState:function(o){e.splice(ote(e,{target:o}),1)},animateAll:function(o){var s=this;if(!this.options.animation){clearTimeout(t),typeof o=="function"&&o();return}var r=!1,i=0;e.forEach(function(a){var l=0,c=a.target,u=c.fromRect,d=bo(c),h=c.prevFromRect,f=c.prevToRect,p=a.rect,g=od(c,!0);g&&(d.top-=g.f,d.left-=g.e),c.toRect=d,c.thisAnimationDuration&&tE(h,d)&&!tE(u,d)&&(p.top-d.top)/(p.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=lte(p,h,f,s.options)),tE(d,u)||(c.prevFromRect=u,c.prevToRect=d,l||(l=s.options.animation),s.animate(c,p,d,l)),l&&(r=!0,i=Math.max(i,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(t),r?t=setTimeout(function(){typeof o=="function"&&o()},i):typeof o=="function"&&o(),e=[]},animate:function(o,s,r,i){if(i){Bt(o,"transition",""),Bt(o,"transform","");var a=od(this.el),l=a&&a.a,c=a&&a.d,u=(s.left-r.left)/(l||1),d=(s.top-r.top)/(c||1);o.animatingX=!!u,o.animatingY=!!d,Bt(o,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=ate(o),Bt(o,"transition","transform "+i+"ms"+(this.options.easing?" "+this.options.easing:"")),Bt(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){Bt(o,"transition",""),Bt(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},i)}}}}function ate(e){return e.offsetWidth}function lte(e,t,n,o){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*o.animation}var rd=[],nE={initializeByDefault:!0},Of={mount:function(t){for(var n in nE)nE.hasOwnProperty(n)&&!(n in t)&&(t[n]=nE[n]);rd.forEach(function(o){if(o.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),rd.push(t)},pluginEvent:function(t,n,o){var s=this;this.eventCanceled=!1,o.cancel=function(){s.eventCanceled=!0};var r=t+"Global";rd.forEach(function(i){n[i.pluginName]&&(n[i.pluginName][r]&&n[i.pluginName][r](hi({sortable:n},o)),n.options[i.pluginName]&&n[i.pluginName][t]&&n[i.pluginName][t](hi({sortable:n},o)))})},initializePlugins:function(t,n,o,s){rd.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var c=new a(t,n,t.options);c.sortable=t,c.options=t.options,t[l]=c,sa(o,c.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var i=this.modifyOption(t,r,t.options[r]);typeof i<"u"&&(t.options[r]=i)}},getEventProperties:function(t,n){var o={};return rd.forEach(function(s){typeof s.eventProperties=="function"&&sa(o,s.eventProperties.call(n[s.pluginName],t))}),o},modifyOption:function(t,n,o){var s;return rd.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(s=r.optionListeners[n].call(t[r.pluginName],o))}),s}};function cte(e){var t=e.sortable,n=e.rootEl,o=e.name,s=e.targetEl,r=e.cloneEl,i=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,h=e.originalEvent,f=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[Ls],!!t){var g,v=t.options,w="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!ia&&!Pf?g=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(o,!0,!0)),g.to=i||n,g.from=a||n,g.item=s||n,g.clone=r,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=u,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=f?f.lastPutMode:void 0;var S=hi(hi({},p),Of.getEventProperties(o,t));for(var b in S)g[b]=S[b];n&&n.dispatchEvent(g),v[w]&&v[w].call(t,g)}}var ute=["evt"],ms=function(t,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=o.evt,r=Qee(o,ute);Of.pluginEvent.bind($t)(t,n,hi({dragEl:gt,parentEl:eo,ghostEl:Xt,rootEl:Gn,nextEl:hc,lastDownEl:yv,cloneEl:to,cloneHidden:Qa,dragStarted:Nf,putSortable:Oo,activeSortable:$t.active,originalEvent:s,oldIndex:id,oldDraggableIndex:Mf,newIndex:Vs,newDraggableIndex:el,hideGhostForTarget:mM,unhideGhostForTarget:vM,cloneNowHidden:function(){Qa=!0},cloneNowShown:function(){Qa=!1},dispatchSortableEvent:function(a){os({sortable:n,name:a,originalEvent:s})}},r))};function os(e){cte(hi({putSortable:Oo,cloneEl:to,targetEl:gt,rootEl:Gn,oldIndex:id,oldDraggableIndex:Mf,newIndex:Vs,newDraggableIndex:el},e))}var gt,eo,Xt,Gn,hc,yv,to,Qa,id,Vs,Mf,el,wv,Oo,ad=!1,Cv=!1,bv=[],fc,Nr,oE,sE,uM,dM,Nf,ld,Lf,Vf=!1,Sv=!1,Ev,jo,rE=[],iE=!1,_v=[],Rv=typeof document<"u",Dv=tM,hM=Pf||ia?"cssFloat":"float",dte=Rv&&!tte&&!tM&&"draggable"in document.createElement("div"),fM=function(){if(Rv){if(ia)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),pM=function(t,n){var o=Bt(t),s=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=sd(t,0,n),i=sd(t,1,n),a=r&&Bt(r),l=i&&Bt(i),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+bo(r).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+bo(i).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return i&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return r&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=s&&o[hM]==="none"||i&&o[hM]==="none"&&c+u>s)?"vertical":"horizontal"},hte=function(t,n,o){var s=o?t.left:t.top,r=o?t.right:t.bottom,i=o?t.width:t.height,a=o?n.left:n.top,l=o?n.right:n.bottom,c=o?n.width:n.height;return s===a||r===l||s+i/2===a+c/2},fte=function(t,n){var o;return bv.some(function(s){var r=s[Ls].options.emptyInsertThreshold;if(!(!r||eE(s))){var i=bo(s),a=t>=i.left-r&&t<=i.right+r,l=n>=i.top-r&&n<=i.bottom+r;if(a&&l)return o=s}}),o},gM=function(t){function n(r,i){return function(a,l,c,u){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(r==null&&(i||d))return!0;if(r==null||r===!1)return!1;if(i&&r==="clone")return r;if(typeof r=="function")return n(r(a,l,c,u),i)(a,l,c,u);var h=(i?a:l).options.group.name;return r===!0||typeof r=="string"&&r===h||r.join&&r.indexOf(h)>-1}}var o={},s=t.group;(!s||mv(s)!="object")&&(s={name:s}),o.name=s.name,o.checkPull=n(s.pull,!0),o.checkPut=n(s.put),o.revertClone=s.revertClone,t.group=o},mM=function(){!fM&&Xt&&Bt(Xt,"display","none")},vM=function(){!fM&&Xt&&Bt(Xt,"display","")};Rv&&document.addEventListener("click",function(e){if(Cv)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Cv=!1,!1},!0);var pc=function(t){if(gt){t=t.touches?t.touches[0]:t;var n=fte(t.clientX,t.clientY);if(n){var o={};for(var s in t)t.hasOwnProperty(s)&&(o[s]=t[s]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[Ls]._onDragOver(o)}}},pte=function(t){gt&&gt.parentNode[Ls]._isOutsideThisEl(t.target)};function $t(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=sa({},t),e[Ls]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return pM(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(i,a){i.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:$t.supportPointer!==!1&&"PointerEvent"in window&&!kf,emptyInsertThreshold:5};Of.initializePlugins(this,e,n);for(var o in n)!(o in t)&&(t[o]=n[o]);gM(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:dte,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Cn(e,"pointerdown",this._onTapStart):(Cn(e,"mousedown",this._onTapStart),Cn(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Cn(e,"dragover",this),Cn(e,"dragenter",this)),bv.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),sa(this,ite())}$t.prototype={constructor:$t,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(ld=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,gt):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,o=this.el,s=this.options,r=s.preventOnFilter,i=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,u=s.filter;if(Ste(o),!gt&&!(/mousedown|pointerdown/.test(i)&&t.button!==0||s.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&kf&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=fi(l,s.draggable,o,!1),!(l&&l.animated)&&yv!==l)){if(id=rr(l),Mf=rr(l,s.draggable),typeof u=="function"){if(u.call(this,t,l,this)){os({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:o,fromEl:o}),ms("filter",n,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=fi(c,d.trim(),o,!1),d)return os({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:o,toEl:o}),ms("filter",n,{evt:t}),!0}),u)){r&&t.cancelable&&t.preventDefault();return}s.handle&&!fi(c,s.handle,o,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,o){var s=this,r=s.el,i=s.options,a=r.ownerDocument,l;if(o&&!gt&&o.parentNode===r){var c=bo(o);if(Gn=r,gt=o,eo=gt.parentNode,hc=gt.nextSibling,yv=o,wv=i.group,$t.dragged=gt,fc={target:gt,clientX:(n||t).clientX,clientY:(n||t).clientY},uM=fc.clientX-c.left,dM=fc.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,gt.style["will-change"]="all",l=function(){if(ms("delayEnded",s,{evt:t}),$t.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!eM&&s.nativeDraggable&&(gt.draggable=!0),s._triggerDragStart(t,n),os({sortable:s,name:"choose",originalEvent:t}),Ns(gt,i.chosenClass,!0)},i.ignore.split(",").forEach(function(u){sM(gt,u.trim(),aE)}),Cn(a,"dragover",pc),Cn(a,"mousemove",pc),Cn(a,"touchmove",pc),Cn(a,"mouseup",s._onDrop),Cn(a,"touchend",s._onDrop),Cn(a,"touchcancel",s._onDrop),eM&&this.nativeDraggable&&(this.options.touchStartThreshold=4,gt.draggable=!0),ms("delayStart",this,{evt:t}),i.delay&&(!i.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Pf||ia))){if($t.eventCanceled){this._onDrop();return}Cn(a,"mouseup",s._disableDelayedDrag),Cn(a,"touchend",s._disableDelayedDrag),Cn(a,"touchcancel",s._disableDelayedDrag),Cn(a,"mousemove",s._delayedDragTouchMoveHandler),Cn(a,"touchmove",s._delayedDragTouchMoveHandler),i.supportPointer&&Cn(a,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(l,i.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){gt&&aE(gt),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;pn(t,"mouseup",this._disableDelayedDrag),pn(t,"touchend",this._disableDelayedDrag),pn(t,"touchcancel",this._disableDelayedDrag),pn(t,"mousemove",this._delayedDragTouchMoveHandler),pn(t,"touchmove",this._delayedDragTouchMoveHandler),pn(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?Cn(document,"pointermove",this._onTouchMove):n?Cn(document,"touchmove",this._onTouchMove):Cn(document,"mousemove",this._onTouchMove):(Cn(gt,"dragend",this),Cn(Gn,"dragstart",this._onDragStart));try{document.selection?Iv(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(ad=!1,Gn&&gt){ms("dragStarted",this,{evt:n}),this.nativeDraggable&&Cn(document,"dragover",pte);var o=this.options;!t&&Ns(gt,o.dragClass,!1),Ns(gt,o.ghostClass,!0),$t.active=this,t&&this._appendGhost(),os({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Nr){this._lastX=Nr.clientX,this._lastY=Nr.clientY,mM();for(var t=document.elementFromPoint(Nr.clientX,Nr.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Nr.clientX,Nr.clientY),t!==n);)n=t;if(gt.parentNode[Ls]._isOutsideThisEl(t),n)do{if(n[Ls]){var o=void 0;if(o=n[Ls]._onDragOver({clientX:Nr.clientX,clientY:Nr.clientY,target:t,rootEl:n}),o&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);vM()}},_onTouchMove:function(t){if(fc){var n=this.options,o=n.fallbackTolerance,s=n.fallbackOffset,r=t.touches?t.touches[0]:t,i=Xt&&od(Xt,!0),a=Xt&&i&&i.a,l=Xt&&i&&i.d,c=Dv&&jo&&iM(jo),u=(r.clientX-fc.clientX+s.x)/(a||1)+(c?c[0]-rE[0]:0)/(a||1),d=(r.clientY-fc.clientY+s.y)/(l||1)+(c?c[1]-rE[1]:0)/(l||1);if(!$t.active&&!ad){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(t,!0)}if(Xt){i?(i.e+=u-(oE||0),i.f+=d-(sE||0)):i={a:1,b:0,c:0,d:1,e:u,f:d};var h="matrix(".concat(i.a,",").concat(i.b,",").concat(i.c,",").concat(i.d,",").concat(i.e,",").concat(i.f,")");Bt(Xt,"webkitTransform",h),Bt(Xt,"mozTransform",h),Bt(Xt,"msTransform",h),Bt(Xt,"transform",h),oE=u,sE=d,Nr=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Xt){var t=this.options.fallbackOnBody?document.body:Gn,n=bo(gt,!0,Dv,!0,t),o=this.options;if(Dv){for(jo=t;Bt(jo,"position")==="static"&&Bt(jo,"transform")==="none"&&jo!==document;)jo=jo.parentNode;jo!==document.body&&jo!==document.documentElement?(jo===document&&(jo=pi()),n.top+=jo.scrollTop,n.left+=jo.scrollLeft):jo=pi(),rE=iM(jo)}Xt=gt.cloneNode(!0),Ns(Xt,o.ghostClass,!1),Ns(Xt,o.fallbackClass,!0),Ns(Xt,o.dragClass,!0),Bt(Xt,"transition",""),Bt(Xt,"transform",""),Bt(Xt,"box-sizing","border-box"),Bt(Xt,"margin",0),Bt(Xt,"top",n.top),Bt(Xt,"left",n.left),Bt(Xt,"width",n.width),Bt(Xt,"height",n.height),Bt(Xt,"opacity","0.8"),Bt(Xt,"position",Dv?"absolute":"fixed"),Bt(Xt,"zIndex","100000"),Bt(Xt,"pointerEvents","none"),$t.ghost=Xt,t.appendChild(Xt),Bt(Xt,"transform-origin",uM/parseInt(Xt.style.width)*100+"% "+dM/parseInt(Xt.style.height)*100+"%")}},_onDragStart:function(t,n){var o=this,s=t.dataTransfer,r=o.options;if(ms("dragStart",this,{evt:t}),$t.eventCanceled){this._onDrop();return}ms("setupClone",this),$t.eventCanceled||(to=cM(gt),to.draggable=!1,to.style["will-change"]="",this._hideClone(),Ns(to,this.options.chosenClass,!1),$t.clone=to),o.cloneId=Iv(function(){ms("clone",o),!$t.eventCanceled&&(o.options.removeCloneOnHide||Gn.insertBefore(to,gt),o._hideClone(),os({sortable:o,name:"clone"}))}),!n&&Ns(gt,r.dragClass,!0),n?(Cv=!0,o._loopId=setInterval(o._emulateDragOver,50)):(pn(document,"mouseup",o._onDrop),pn(document,"touchend",o._onDrop),pn(document,"touchcancel",o._onDrop),s&&(s.effectAllowed="move",r.setData&&r.setData.call(o,s,gt)),Cn(document,"drop",o),Bt(gt,"transform","translateZ(0)")),ad=!0,o._dragStartId=Iv(o._dragStarted.bind(o,n,t)),Cn(document,"selectstart",o),Nf=!0,kf&&Bt(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,o=t.target,s,r,i,a=this.options,l=a.group,c=$t.active,u=wv===l,d=a.sort,h=Oo||c,f,p=this,g=!1;if(iE)return;function v(Q,ae){ms(Q,p,hi({evt:t,isOwner:u,axis:f?"vertical":"horizontal",revert:i,dragRect:s,targetRect:r,canSort:d,fromSortable:h,target:o,completed:S,onMove:function(X,N){return Tv(Gn,n,gt,s,X,bo(X),t,N)},changed:b},ae))}function w(){v("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function S(Q){return v("dragOverCompleted",{insertion:Q}),Q&&(u?c._hideClone():c._showClone(p),p!==h&&(Ns(gt,Oo?Oo.options.ghostClass:c.options.ghostClass,!1),Ns(gt,a.ghostClass,!0)),Oo!==p&&p!==$t.active?Oo=p:p===$t.active&&Oo&&(Oo=null),h===p&&(p._ignoreWhileAnimating=o),p.animateAll(function(){v("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===gt&&!gt.animated||o===n&&!o.animated)&&(ld=null),!a.dragoverBubble&&!t.rootEl&&o!==document&&(gt.parentNode[Ls]._isOutsideThisEl(t.target),!Q&&pc(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function b(){Vs=rr(gt),el=rr(gt,a.draggable),os({sortable:p,name:"change",toEl:n,newIndex:Vs,newDraggableIndex:el,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),o=fi(o,a.draggable,n,!0),v("dragOver"),$t.eventCanceled)return g;if(gt.contains(t.target)||o.animated&&o.animatingX&&o.animatingY||p._ignoreWhileAnimating===o)return S(!1);if(Cv=!1,c&&!a.disabled&&(u?d||(i=eo!==Gn):Oo===this||(this.lastPutMode=wv.checkPull(this,c,gt,t))&&l.checkPut(this,c,gt,t))){if(f=this._getDirection(t,o)==="vertical",s=bo(gt),v("dragOverValid"),$t.eventCanceled)return g;if(i)return eo=Gn,w(),this._hideClone(),v("revert"),$t.eventCanceled||(hc?Gn.insertBefore(gt,hc):Gn.appendChild(gt)),S(!0);var C=eE(n,a.draggable);if(!C||yte(t,f,this)&&!C.animated){if(C===gt)return S(!1);if(C&&n===t.target&&(o=C),o&&(r=bo(o)),Tv(Gn,n,gt,s,o,r,t,!!o)!==!1)return w(),n.appendChild(gt),eo=n,b(),S(!0)}else if(C&&vte(t,f,this)){var _=sd(n,0,a,!0);if(_===gt)return S(!1);if(o=_,r=bo(o),Tv(Gn,n,gt,s,o,r,t,!1)!==!1)return w(),n.insertBefore(gt,_),eo=n,b(),S(!0)}else if(o.parentNode===n){r=bo(o);var E=0,I,T=gt.parentNode!==n,P=!hte(gt.animated&&gt.toRect||s,o.animated&&o.toRect||r,f),M=f?"top":"left",D=rM(o,"top","top")||rM(gt,"top","top"),F=D?D.scrollTop:void 0;ld!==o&&(I=r[M],Vf=!1,Sv=!P&&a.invertSwap||T),E=wte(t,o,r,f,P?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Sv,ld===o);var O;if(E!==0){var k=rr(gt);do k-=E,O=eo.children[k];while(O&&(Bt(O,"display")==="none"||O===Xt))}if(E===0||O===o)return S(!1);ld=o,Lf=E;var x=o.nextElementSibling,$=!1;$=E===1;var W=Tv(Gn,n,gt,s,o,r,t,$);if(W!==!1)return(W===1||W===-1)&&($=W===1),iE=!0,setTimeout(mte,30),w(),$&&!x?n.appendChild(gt):o.parentNode.insertBefore(gt,$?x:o),D&&lM(D,0,F-D.scrollTop),eo=gt.parentNode,I!==void 0&&!Sv&&(Ev=Math.abs(I-bo(o)[M])),b(),S(!0)}if(n.contains(gt))return S(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){pn(document,"mousemove",this._onTouchMove),pn(document,"touchmove",this._onTouchMove),pn(document,"pointermove",this._onTouchMove),pn(document,"dragover",pc),pn(document,"mousemove",pc),pn(document,"touchmove",pc)},_offUpEvents:function(){var t=this.el.ownerDocument;pn(t,"mouseup",this._onDrop),pn(t,"touchend",this._onDrop),pn(t,"pointerup",this._onDrop),pn(t,"touchcancel",this._onDrop),pn(document,"selectstart",this)},_onDrop:function(t){var n=this.el,o=this.options;if(Vs=rr(gt),el=rr(gt,o.draggable),ms("drop",this,{evt:t}),eo=gt&&gt.parentNode,Vs=rr(gt),el=rr(gt,o.draggable),$t.eventCanceled){this._nulling();return}ad=!1,Sv=!1,Vf=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),lE(this.cloneId),lE(this._dragStartId),this.nativeDraggable&&(pn(document,"drop",this),pn(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),kf&&Bt(document.body,"user-select",""),Bt(gt,"transform",""),t&&(Nf&&(t.cancelable&&t.preventDefault(),!o.dropBubble&&t.stopPropagation()),Xt&&Xt.parentNode&&Xt.parentNode.removeChild(Xt),(Gn===eo||Oo&&Oo.lastPutMode!=="clone")&&to&&to.parentNode&&to.parentNode.removeChild(to),gt&&(this.nativeDraggable&&pn(gt,"dragend",this),aE(gt),gt.style["will-change"]="",Nf&&!ad&&Ns(gt,Oo?Oo.options.ghostClass:this.options.ghostClass,!1),Ns(gt,this.options.chosenClass,!1),os({sortable:this,name:"unchoose",toEl:eo,newIndex:null,newDraggableIndex:null,originalEvent:t}),Gn!==eo?(Vs>=0&&(os({rootEl:eo,name:"add",toEl:eo,fromEl:Gn,originalEvent:t}),os({sortable:this,name:"remove",toEl:eo,originalEvent:t}),os({rootEl:eo,name:"sort",toEl:eo,fromEl:Gn,originalEvent:t}),os({sortable:this,name:"sort",toEl:eo,originalEvent:t})),Oo&&Oo.save()):Vs!==id&&Vs>=0&&(os({sortable:this,name:"update",toEl:eo,originalEvent:t}),os({sortable:this,name:"sort",toEl:eo,originalEvent:t})),$t.active&&((Vs==null||Vs===-1)&&(Vs=id,el=Mf),os({sortable:this,name:"end",toEl:eo,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){ms("nulling",this),Gn=gt=eo=Xt=hc=to=yv=Qa=fc=Nr=Nf=Vs=el=id=Mf=ld=Lf=Oo=wv=$t.dragged=$t.ghost=$t.clone=$t.active=null,_v.forEach(function(t){t.checked=!0}),_v.length=oE=sE=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":gt&&(this._onDragOver(t),gte(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,o=this.el.children,s=0,r=o.length,i=this.options;s<r;s++)n=o[s],fi(n,i.draggable,this.el,!1)&&t.push(n.getAttribute(i.dataIdAttr)||bte(n));return t},sort:function(t,n){var o={},s=this.el;this.toArray().forEach(function(r,i){var a=s.children[i];fi(a,this.options.draggable,s,!1)&&(o[r]=a)},this),n&&this.captureAnimationState(),t.forEach(function(r){o[r]&&(s.removeChild(o[r]),s.appendChild(o[r]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return fi(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var o=this.options;if(n===void 0)return o[t];var s=Of.modifyOption(this,t,n);typeof s<"u"?o[t]=s:o[t]=n,t==="group"&&gM(o)},destroy:function(){ms("destroy",this);var t=this.el;t[Ls]=null,pn(t,"mousedown",this._onTapStart),pn(t,"touchstart",this._onTapStart),pn(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(pn(t,"dragover",this),pn(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),bv.splice(bv.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Qa){if(ms("hideClone",this),$t.eventCanceled)return;Bt(to,"display","none"),this.options.removeCloneOnHide&&to.parentNode&&to.parentNode.removeChild(to),Qa=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Qa){if(ms("showClone",this),$t.eventCanceled)return;gt.parentNode==Gn&&!this.options.group.revertClone?Gn.insertBefore(to,gt):hc?Gn.insertBefore(to,hc):Gn.appendChild(to),this.options.group.revertClone&&this.animate(gt,to),Bt(to,"display",""),Qa=!1}}};function gte(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Tv(e,t,n,o,s,r,i,a){var l,c=e[Ls],u=c.options.onMove,d;return window.CustomEvent&&!ia&&!Pf?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=n,l.draggedRect=o,l.related=s||t,l.relatedRect=r||bo(t),l.willInsertAfter=a,l.originalEvent=i,e.dispatchEvent(l),u&&(d=u.call(c,l,i)),d}function aE(e){e.draggable=!1}function mte(){iE=!1}function vte(e,t,n){var o=bo(sd(n.el,0,n.options,!0)),s=10;return t?e.clientX<o.left-s||e.clientY<o.top&&e.clientX<o.right:e.clientY<o.top-s||e.clientY<o.bottom&&e.clientX<o.left}function yte(e,t,n){var o=bo(eE(n.el,n.options.draggable)),s=10;return t?e.clientX>o.right+s||e.clientX<=o.right&&e.clientY>o.bottom&&e.clientX>=o.left:e.clientX>o.right&&e.clientY>o.top||e.clientX<=o.right&&e.clientY>o.bottom+s}function wte(e,t,n,o,s,r,i,a){var l=o?e.clientY:e.clientX,c=o?n.height:n.width,u=o?n.top:n.left,d=o?n.bottom:n.right,h=!1;if(!i){if(a&&Ev<c*s){if(!Vf&&(Lf===1?l>u+c*r/2:l<d-c*r/2)&&(Vf=!0),Vf)h=!0;else if(Lf===1?l<u+Ev:l>d-Ev)return-Lf}else if(l>u+c*(1-s)/2&&l<d-c*(1-s)/2)return Cte(t)}return h=h||i,h&&(l<u+c*r/2||l>d-c*r/2)?l>u+c/2?1:-1:0}function Cte(e){return rr(gt)<rr(e)?1:-1}function bte(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,o=0;n--;)o+=t.charCodeAt(n);return o.toString(36)}function Ste(e){_v.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var o=t[n];o.checked&&_v.push(o)}}function Iv(e){return setTimeout(e,0)}function lE(e){return clearTimeout(e)}Rv&&Cn(document,"touchmove",function(e){($t.active||ad)&&e.cancelable&&e.preventDefault()}),$t.utils={on:Cn,off:pn,css:Bt,find:sM,is:function(t,n){return!!fi(t,n,t,!1)},extend:ste,throttle:aM,closest:fi,toggleClass:Ns,clone:cM,index:rr,nextTick:Iv,cancelNextTick:lE,detectDirection:pM,getChild:sd},$t.get=function(e){return e[Ls]},$t.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&($t.utils=hi(hi({},$t.utils),o.utils)),Of.mount(o)})},$t.create=function(e,t){return new $t(e,t)},$t.version=ete;var po=[],Bf,cE,uE=!1,dE,hE,xv,$f;function Ete(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?Cn(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Cn(document,"pointermove",this._handleFallbackAutoScroll):o.touches?Cn(document,"touchmove",this._handleFallbackAutoScroll):Cn(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?pn(document,"dragover",this._handleAutoScroll):(pn(document,"pointermove",this._handleFallbackAutoScroll),pn(document,"touchmove",this._handleFallbackAutoScroll),pn(document,"mousemove",this._handleFallbackAutoScroll)),yM(),Fv(),rte()},nulling:function(){xv=cE=Bf=uE=$f=dE=hE=null,po.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var s=this,r=(n.touches?n.touches[0]:n).clientX,i=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(r,i);if(xv=n,o||this.options.forceAutoScrollFallback||Pf||ia||kf){fE(n,this.options,a,o);var l=Ja(a,!0);uE&&(!$f||r!==dE||i!==hE)&&($f&&yM(),$f=setInterval(function(){var c=Ja(document.elementFromPoint(r,i),!0);c!==l&&(l=c,Fv()),fE(n,s.options,c,o)},10),dE=r,hE=i)}else{if(!this.options.bubbleScroll||Ja(a,!0)===pi()){Fv();return}fE(n,this.options,Ja(a,!1),!1)}}},sa(e,{pluginName:"scroll",initializeByDefault:!0})}function Fv(){po.forEach(function(e){clearInterval(e.pid)}),po=[]}function yM(){clearInterval($f)}var fE=aM(function(e,t,n,o){if(t.scroll){var s=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,i=t.scrollSensitivity,a=t.scrollSpeed,l=pi(),c=!1,u;cE!==n&&(cE=n,Fv(),Bf=t.scroll,u=t.scrollFn,Bf===!0&&(Bf=Ja(n,!0)));var d=0,h=Bf;do{var f=h,p=bo(f),g=p.top,v=p.bottom,w=p.left,S=p.right,b=p.width,C=p.height,_=void 0,E=void 0,I=f.scrollWidth,T=f.scrollHeight,P=Bt(f),M=f.scrollLeft,D=f.scrollTop;f===l?(_=b<I&&(P.overflowX==="auto"||P.overflowX==="scroll"||P.overflowX==="visible"),E=C<T&&(P.overflowY==="auto"||P.overflowY==="scroll"||P.overflowY==="visible")):(_=b<I&&(P.overflowX==="auto"||P.overflowX==="scroll"),E=C<T&&(P.overflowY==="auto"||P.overflowY==="scroll"));var F=_&&(Math.abs(S-s)<=i&&M+b<I)-(Math.abs(w-s)<=i&&!!M),O=E&&(Math.abs(v-r)<=i&&D+C<T)-(Math.abs(g-r)<=i&&!!D);if(!po[d])for(var k=0;k<=d;k++)po[k]||(po[k]={});(po[d].vx!=F||po[d].vy!=O||po[d].el!==f)&&(po[d].el=f,po[d].vx=F,po[d].vy=O,clearInterval(po[d].pid),(F!=0||O!=0)&&(c=!0,po[d].pid=setInterval((function(){o&&this.layer===0&&$t.active._onTouchMove(xv);var x=po[this.layer].vy?po[this.layer].vy*a:0,$=po[this.layer].vx?po[this.layer].vx*a:0;typeof u=="function"&&u.call($t.dragged.parentNode[Ls],$,x,e,xv,po[this.layer].el)!=="continue"||lM(po[this.layer].el,$,x)}).bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==l&&(h=Ja(h,!1)));uE=c}},30),wM=function(t){var n=t.originalEvent,o=t.putSortable,s=t.dragEl,r=t.activeSortable,i=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var c=o||r;a();var u=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(u.clientX,u.clientY);l(),c&&!c.el.contains(d)&&(i("spill"),this.onSpill({dragEl:s,putSortable:o}))}};function pE(){}pE.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,o=t.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var s=sd(this.sortable.el,this.startIndex,this.options);s?this.sortable.el.insertBefore(n,s):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:wM},sa(pE,{pluginName:"revertOnSpill"});function gE(){}gE.prototype={onSpill:function(t){var n=t.dragEl,o=t.putSortable,s=o||this.sortable;s.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),s.animateAll()},drop:wM},sa(gE,{pluginName:"removeOnSpill"}),$t.mount(new Ete),$t.mount(gE,pE);function _te(e,t){return Object.values(e).indexOf(t)}function Rte(e,t,n,o){if(!e)return[];const s=Object.values(e),r=t.length-o;return[...t].map((a,l)=>l>=r?s.length:s.indexOf(a))}function Dte(e){return["transition-group","TransitionGroup"].includes(e)}function CM(e){if(!e||e.length!==1)return!1;const[{type:t}]=e;return t?Dte(t.name):!1}function Tte(e,t){return t?{...t.props,...t.attrs}:e}const mE=["Start","Add","Remove","Update","End"],vE=["Choose","Unchoose","Sort","Filter","Clone"],Ite=["Move",...mE,...vE].map(e=>"on"+e);let yE=null;const xte=st({name:"VueDraggableNext",inheritAttrs:!1,props:{options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:e=>e},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},emits:["update:modelValue","move","change",...mE.map(e=>e.toLowerCase()),...vE.map(e=>e.toLowerCase())],setup(e,{emit:t,slots:n,attrs:o}){const s=V(!1),r=V(!1),i=V(0),a=V(0),l=V([]),c=V(null),u=V(null),d=q(()=>e.list?e.list:e.modelValue),h=oo();function f(){return e.component?GG(e.component):e.tag}function p(z){if(u.value)for(const ne in z){const pe=XO(ne);Ite.indexOf(pe)===-1&&u.value.option(pe,z[ne])}}function g(){var z;return((z=h==null?void 0:h.proxy)==null?void 0:z.$el.children)||[]}async function v(){var z;await vt(),l.value=Rte(g(),((z=h==null?void 0:h.proxy)==null?void 0:z.$el.children)||[],s.value,a.value)}function w(z){const ne=_te(g()||[],z);if(ne===-1)return null;const pe=d.value?d.value[ne]:null;return{index:ne,element:pe}}function S(z){vt(()=>t("change",z))}function b(z){if(e.list){z(e.list);return}const ne=[...e.modelValue||[]];z(ne),t("update:modelValue",ne)}function C(...z){b(pe=>pe.splice(...z))}function _(z,ne){b(ve=>ve.splice(ne,0,ve.splice(z,1)[0]))}function E(z){const ne=l.value,pe=ne.length;return z>pe-1?pe:ne[z]}function I(){var ne,pe;return n.default&&((pe=(ne=n.default()[0])==null?void 0:ne.component)==null?void 0:pe.proxy)||null}function T(z){if(!e.noTransitionOnDrag||!s.value)return;const ne=g();ne[z]&&(ne[z].data=null);const pe=I();pe&&(pe.children=[],pe.kept=void 0)}function P(z){v(),c.value=w(z.item),c.value&&(z.item._underlying_vm_=e.clone(c.value.element),yE=z.item)}function M(z){const ne=z.item._underlying_vm_;if(ne===void 0)return;QS(z.item);const pe=E(z.newIndex);C(pe,0,ne),v(),S({added:{element:ne,newIndex:pe}})}function D(z){var pe;if(JO((pe=h==null?void 0:h.proxy)==null?void 0:pe.$el,z.item,z.oldIndex),z.pullMode==="clone"){QS(z.clone);return}if(!c.value)return;const ne=c.value.index;C(ne,1),T(ne),S({removed:{element:c.value.element,oldIndex:ne}})}function F(z){var ve,we;QS(z.item),JO(z.from,z.item,z.oldIndex);const ne=(ve=c.value)==null?void 0:ve.index,pe=E(z.newIndex);_(ne,pe),S({moved:{element:(we=c.value)==null?void 0:we.element,oldIndex:ne,newIndex:pe}})}function O(z,ne){Object.prototype.hasOwnProperty.call(z,ne)&&(z[ne]+=i.value)}function k(z){return z.__draggable_component__}function x({to:z,related:ne}){const pe=k(z);if(!pe)return{component:pe};const ve=pe.realList,we={list:ve,component:pe};if(z!==ne&&ve&&pe.getUnderlyingVm){const re=pe.getUnderlyingVm(ne);if(re)return Object.assign(re,we)}return we}function $(z,ne){const pe=[...ne.to.children].filter(U=>U.style.display!=="none");if(pe.length===0)return 0;const ve=pe.indexOf(ne.related),we=z.component.getVmIndex(ve);return pe.indexOf(yE)!==-1||!ne.willInsertAfter?we:we+1}const W=()=>{var we,re;const z={};mE.forEach(U=>{z["on"+U]=ae(U)}),vE.forEach(U=>{z["on"+U]=Q.bind(null,U)});const ne=Object.keys(o).reduce((U,ge)=>(U[XO(ge)]=o[ge],U),{}),pe=Object.assign({},ne,z,{onMove:(U,ge)=>ee(U,ge)});"draggable"in pe||(pe.draggable=">*");const ve=((we=h==null?void 0:h.proxy)==null?void 0:we.$el.nodeType)===1?h.proxy.$el:((re=h==null?void 0:h.proxy)==null?void 0:re.$el.parentElement)||null;ve&&(u.value=new $t(ve,pe),ve.__draggable_component__=h==null?void 0:h.proxy,v())};function Q(z,ne){vt(()=>t(z.toLowerCase(),ne))}function ae(z){return ne=>{if(d.value!==null){const pe="onDrag"+z,ve=N[pe];ve&&ve(ne)}Q(z,ne)}}function ee(z,ne){const pe=e.move;if(!pe||!d.value)return!0;const ve=x(z),we=c.value,re=$(ve,z);we&&Object.assign(we,{futureIndex:re});const U=Object.assign({},z,{relatedContext:ve,draggedContext:we});return pe(U,ne)}function X(){v(),yE=null}const N={onDragStart:P,onDragAdd:M,onDragRemove:D,onDragUpdate:F,onDragMove:ee,onDragEnd:X};return Qt(()=>{W()}),e.list!==null&&e.modelValue!==null&&qee.error("list props are mutually exclusive! Please set one."),{getTag:f,realList:d,visibleIndexes:l,noneFunctionalComponentMode:r,headerOffset:i,footerOffset:a,transitionMode:s,computeIndexes:v,updateOptions:p,getChildrenNodes:g,getUnderlyingVm:w,emitChanges:S,alterList:b,spliceList:C,updatePosition:_,getVmIndex:E,getComponent:I,resetTransitionData:T,onDragStart:P,onDragAdd:M,onDragRemove:D,onDragUpdate:F,updateProperty:O,onDragMove:ee,onDragEnd:X,mounted:W,context:c,sortableInstance:u,getRelatedContextFromMoveEvent:x,getTargetedComponent:k,computeFutureIndex:$}},render(){const e=this.getTag(),t=Tte(this.$attrs,this.componentData);if(typeof e=="string"){const o=this.$slots.default&&typeof this.$slots.default=="function"?this.$slots.default():null;return o?(this.transitionMode=CM(o),su(e,t,o)):su(e,t,[])}const n=this.$slots.default?{default:this.$slots.default}:{};if(this.$slots.default){const o=typeof this.$slots.default=="function"?this.$slots.default():null;this.transitionMode=CM(o||[])}return su(e,t,n)}}),Fte=Ct(st({__name:"DragDropList",props:{modelValue:{},groupName:{},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["changed","update:modelValue"],setup(e,{emit:t}){const n=V([]),o=e,s=t,r=V({}),i=()=>{n.value=o.modelValue.map(c=>({id:c.field,name:c.headerName,...c}))||[],o.modelValue.forEach(c=>{r.value[c.field]={...c}})};tt(()=>o.modelValue,c=>{i()},{immediate:!0,deep:!0}),tt(n,c=>{if(c.length===o.modelValue.length&&!c.every((d,h)=>d.id===o.modelValue[h].field)){const d=c.map(h=>r.value[h.id]);s("changed",d),s("update:modelValue",d)}});const a=()=>!(o.readOnly||o.disabled),l=c=>!(o.readOnly||o.disabled);return(c,u)=>(K(),Ue(H(xte),{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=d=>n.value=d),tag:"transition-group",disabled:o.disabled||o.readOnly,onMove:l,onStart:a,"item-key":"id","component-data":{tag:"div",type:"transition",name:"fade"},animation:300,easing:"cubic-bezier(0.4, 0, 0.2, 1)","ghost-class":"ghost","chosen-class":"chosen","drag-class":"drag"},{default:he(()=>[(K(!0),ie(It,null,Fn(n.value,(d,h)=>(K(),ie("div",{key:d.id,class:"fade-item"},[Dt(c.$slots,"item",{item:d,index:h},()=>[Qe(ht(d.name),1)],!0)]))),128))]),_:3},8,["modelValue","disabled"]))}}),[["__scopeId","data-v-2106e8ed"]]),Pte={key:0},kte={key:1,style:{"font-style":"italic"}},Ate={key:2,style:{"font-style":"italic"}},Ote={key:3},Pv=Ct(st({__name:"DragDropItem",props:{item:{},isDisableNewCheck:{type:Boolean,default:!1},disableDrag:{type:Boolean,default:!1},disableCheckbox:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},columnStates:{},disableDragTooltip:{default:""},focusIndex:{}},emits:["toggle-column"],setup(e,{emit:t}){const n=Yt,o=e,s=V(o.columnStates[String(o.item.field)]||!1),r=t,i=h=>{s.value=h},a=q(()=>{var h;return(h=o.item)==null?void 0:h.context}),l=q(()=>{var f,p,g;return(f=a.value)!=null&&f.formula?"formular":((g=(p=a.value)==null?void 0:p.metric_type)==null?void 0:g.code)||"number"}),c=q(()=>{var h,f;return(f=(h=o.item)==null?void 0:h.field)==null?void 0:f.includes("metric")}),u=q(()=>{var h;return c.value&&((h=a.value)==null?void 0:h.is_primary)==1}),d=q(()=>{var h;return c.value&&((h=a.value)==null?void 0:h.is_point_metric)==1});return tt(()=>s.value,()=>{r("toggle-column",o.item.field,o.item.required)}),(h,f)=>(K(),ie("div",{key:e.item.field,class:te([h.$style["column-config__item"],{[h.$style.disabled]:o.readOnly,[h.$style["is-metric"]]:c.value,[h.$style["is-point-metric"]]:d.value,[h.$style["is-woohoo-metric"]]:u.value}])},[ue(LO,{focusIndex:o.focusIndex,id:`col-${e.item.field}`,"model-value":s.value==!0?H(Ft).CHECKED:H(Ft).UNCHECK,"onUpdate:modelValue":i,disabled:o.disableCheckbox||e.isDisableNewCheck&&!s.value,size:"16px"},null,8,["focusIndex","id","model-value","disabled"]),Ke((K(),ie("div",{class:"move-handler",style:cn({cursor:o.disableDrag?"not-allowed":"move"})},[ue(lt,{color:o.disableDrag?"#D7D7D7":"#6B6B6B",source:"remote",src:"GripVertical",class:te(h.$style.handler)},null,8,["color","class"])],4)),[[H(n),o.disableDrag==!0?o.disableDragTooltip:""]]),c.value?(K(),ie("div",{key:0,class:te(h.$style["metric-type"])},[l.value=="rating"?(K(),ie("span",Pte,"★")):l.value=="formular"?(K(),ie("span",kte," ƒx ")):l.value=="number"?(K(),ie("span",Ate," # ")):(K(),ie("span",Ote,ht(l.value),1))],2)):Xe("",!0),me("span",{class:te(h.$style["column-config__item-label"])},[Ke((K(),ie("div",null,[Qe(ht(e.item.headerName),1)])),[[H(n),{content:e.item.headerName}]])],2),d.value?Ke((K(),ie("div",{key:1,class:te(h.$style["metric-icon"])},[ue(lt,{src:"Bullseye",color:"#A6A6A6"})],2)),[[H(n),"Point metric"]]):Xe("",!0),u.value?Ke((K(),ie("div",{key:2,class:te(h.$style["metric-icon"])},[ue(lt,{src:"ChartPie",color:"#A6A6A6"})],2)),[[H(n),"Woohoo metric"]]):Xe("",!0)],2))}}),[["__cssModules",{$style:{"column-config__item":"_column-config__item_1ppdl_1","is-metric":"_is-metric_1ppdl_8","is-woohoo-metric":"_is-woohoo-metric_1ppdl_12","is-point-metric":"_is-point-metric_1ppdl_15","column-config__item-label":"_column-config__item-label_1ppdl_18",disabled:"_disabled_1ppdl_34",readOnly:"_readOnly_1ppdl_38","column-config__item--pinned":"_column-config__item--pinned_1ppdl_41",handler:"_handler_1ppdl_48",badge:"_badge_1ppdl_52","metric-type":"_metric-type_1ppdl_78","metric-icon":"_metric-icon_1ppdl_106"}}]]),Mte=Ct(st({__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 o=e,s=n,{hide:r,triggerRef:i,popupRef:a,isVisible:l,toggle:c}=yo({toggleOnClick:!0,placement:o.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:o.show,maxWidth:o.maxWidth}),u=q(()=>l.value);tt(l,f=>{s(f?"open":"close")});const d=()=>{r()};t({closeDropdown:d,isOpen:u});const h=f=>{f.key==="Escape"&&a.value&&r()};return Qt(()=>{var p;const f=i.value instanceof HTMLElement?i.value:(p=i.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",h)}),qn(()=>{var p;const f=i.value instanceof HTMLElement?i.value:(p=i.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",h)}),(f,p)=>(K(),ie("div",{ref_key:"triggerRef",ref:i,class:te(f.$style["dropdown-wrapper"])},[Dt(f.$slots,"trigger",{open:H(l),toggle:H(c),closeDropdown:d},()=>[me("button",{class:te(f.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),me("div",{ref_key:"popupRef",ref:a,tabindex:"0",class:te(f.$style["dropdown-content"]),style:cn({display:H(l)?"block":"none",maxWidth:o.maxWidth?o.maxWidth+"px":"unset"})},[Dt(f.$slots,"content",{closeDropdown:d,visible:H(l)},()=>[me("div",{class:te(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"}}]]),Nte={class:"reach-limit-icon"},Lte=Ct(st({__name:"TableCustomization",props:{modelValue:{},readOnly:{type:Boolean},disabled:{type:Boolean},checkboxColumn:{},gridApi:{},tableHeight:{}},emits:["update:modelValue","input","change"],setup(e,{expose:t,emit:n}){const o=Yt,s=e,r=ko,i=n,a=V(""),l=V(),c=q(()=>a.value.trim().length>0),u=V([]),d=V({}),{triggerRef:h,popupRef:f,isVisible:p,hide:g}=yo({toggleOnClick:!0,placement:"bottom-end",trigger:"click",offset:[0,0]});tt(p,k=>{var x;k&&((x=l.value)==null||x.focus())});const v=q(()=>s.disabled||a.value.length>0),w=q(()=>u.value.filter(k=>k.pinned==="left"&&k.field&&k.headerName)),S=q(()=>u.value.filter(k=>k.pinned==="right"&&k.field||k.field==="blank")),b=q({get:()=>u.value.filter(k=>!k.pinned&&k.field&&k.field!=="blank"),set:k=>{u.value=[...w.value,...k,...S.value]}}),C=q(()=>{if(!a.value)return{};const k=a.value.toLowerCase();return[...u.value,...b.value].reduce((x,$)=>{var W;return(W=$.headerName)!=null&&W.toLowerCase().includes(k)&&$.field&&(x[$.field]=!0),x},{})}),_=q(()=>s.modelValue),E=()=>{const k={};u.value.forEach(x=>{x.field&&(k[x.field]=!x.hide)}),d.value=k},I=q(()=>{if(!a.value)return u.value;const k=a.value.toLowerCase();return u.value.filter(x=>{var $;return($=x.headerName)==null?void 0:$.toLowerCase().includes(k)})}),T=()=>{var $;const k=($=s.gridApi)==null?void 0:$.getColumnState().reduce((W,Q)=>(W[Q.colId]=Number(Q.width),W),{}),x=u.value.map(W=>({...W,hide:W.field?!d.value[W.field]:!1,width:W.field?k==null?void 0:k[W.field]:W.width}));i("update:modelValue",x),i("change",x),i("input",x)},P=k=>{const x=[...w.value,...k,...S.value];s.checkboxColumn&&x.unshift(s.checkboxColumn),u.value=x,T()},M=k=>{k&&(d.value[k]=!d.value[k],T())};tt(_,k=>{k&&k.length>0&&(u.value=[...k],E())}),t({updateColumnDefs(k){u.value=[...k],E()}});const D=q(()=>O.value>=5),F=q(()=>s.disabled||a.value.length>0),O=q(()=>u.value.reduce((k,x)=>x.field&&x.field.includes("metric")&&d.value[x.field]===!0?k+1:k,0));return(k,x)=>(K(),ie("div",{class:te(k.$style["table-customization"])},[me("div",{ref_key:"triggerRef",ref:h},[Dt(k.$slots,"trigger",{},()=>[Ke((K(),Ue(at,{variant:["secondary"],disabled:s.disabled,actived:H(p),style:{width:"32px"},onEscape:H(g)},{prefix:he(()=>[ue(lt,{src:"TableColumns"})]),_:1},8,["disabled","actived","onEscape"])),[[H(r),"7"],[H(o),"Columns"]])])],512),me("div",{ref_key:"popupRef",ref:f,class:te(k.$style["tippy-content-wrapper"])},[me("div",{class:te([k.$style["column-config"],D.value?k.$style["has-warning"]:""]),style:cn({"--max-height":s.tableHeight?s.tableHeight:"max(500px, 60vh)"})},[ue(ES,{tabIndex:"7.0",modelValue:a.value,"onUpdate:modelValue":x[0]||(x[0]=$=>a.value=$),ref_key:"searchBoxRef",ref:l},null,8,["modelValue"]),me("div",{class:te(k.$style["column-config__header"])},[...x[2]||(x[2]=[me("span",null,"Manage columns",-1)])],2),D.value?(K(),ie("div",{key:0,class:te(k.$style["reach-limit"])},[me("div",Nte,[ue(lt,{src:"InfoCircle",color:"#F7941D",size:14})]),me("div",{class:te(k.$style["warning-limit-text"])},[...x[3]||(x[3]=[Qe(" You’ve reached the maximum number of metric columns. ",-1),me("br",null,null,-1),Qe(" Deselect one to show another. ",-1)])],2)],2)):Xe("",!0),c.value?(K(),ie(It,{key:1},[I.value.length===0&&c.value?(K(),ie("div",{key:0,class:te(k.$style["no-columns"])},[...x[4]||(x[4]=[Qe(" No results. ",-1),me("br",null,null,-1),Qe(" Try another search. ",-1)])],2)):Xe("",!0),c.value&&I.value.length>0?(K(),ie("div",{key:1,class:te(k.$style["column-config__pinned-section"])},[(K(!0),ie(It,null,Fn(I.value,$=>{var W;return K(),Ue(Pv,{key:$.colId,item:$,columnStates:d.value,disableDrag:F.value,disableDragTooltip:"Reordering is disabled while search is active.",readOnly:s.readOnly,isDisableNewCheck:D.value&&((W=$.colId)==null?void 0:W.includes("metric")),onToggleColumn:M},null,8,["item","columnStates","disableDrag","readOnly","isDisableNewCheck"])}),128))],2)):Xe("",!0)],64)):Xe("",!0),c.value?Xe("",!0):(K(),ie("div",{key:2,class:te(k.$style["column-config__list"])},[(K(!0),ie(It,null,Fn(w.value,$=>Ke((K(),Ue(Pv,{key:$.field,item:$,disabled:!0,readOnly:!0,disableDrag:!0,disableDragTooltip:" ","disable-checkbox":!0,columnStates:d.value},null,8,["item","columnStates"])),[[Ks,C.value[$.field]||!a.value]])),128)),ue(Fte,{modelValue:b.value,"onUpdate:modelValue":x[1]||(x[1]=$=>b.value=$),"group-name":"columns",onChanged:P,disabled:v.value,readOnly:s.readOnly},{item:he(({item:$,index:W})=>[Ke((K(),Ue(Pv,{focusIndex:`7.${W+1}`,key:$.id,item:$,columnStates:d.value,disableDrag:F.value,disableDragTooltip:F.value?"Reordering is disabled while search is active.":void 0,readOnly:s.readOnly,isDisableNewCheck:D.value&&$.id.includes("metric"),onToggleColumn:M},null,8,["focusIndex","item","columnStates","disableDrag","disableDragTooltip","readOnly","isDisableNewCheck"])),[[Ks,C.value[$.field]||!a.value]])]),_:1},8,["modelValue","disabled","readOnly"]),(K(!0),ie(It,null,Fn(S.value.filter($=>{var W;return $.headerName&&((W=$.headerName)==null?void 0:W.length)>0}),$=>Ke((K(),Ue(Pv,{key:$.field,item:$,disabled:s.disabled,readOnly:s.readOnly,columnStates:d.value},null,8,["item","disabled","readOnly","columnStates"])),[[Ks,C.value[$.field]||!a.value]])),128))],2))],6)],2)],2))}}),[["__cssModules",{$style:{"reach-limit":"_reach-limit_1m3bt_1","reach-limit-icon":"_reach-limit-icon_1m3bt_11","warning-limit-text":"_warning-limit-text_1m3bt_18","table-customization":"_table-customization_1m3bt_24","table-customization__trigger":"_table-customization__trigger_1m3bt_30","column-config":"_column-config_1m3bt_46","has-warning":"_has-warning_1m3bt_61","column-config__header":"_column-config__header_1m3bt_64","icon-color":"_icon-color_1m3bt_73","column-config__list":"_column-config__list_1m3bt_76","column-config__section-label":"_column-config__section-label_1m3bt_80","column-config__footer":"_column-config__footer_1m3bt_89","column-config__add-button":"_column-config__add-button_1m3bt_92","cs-icon":"_cs-icon_1m3bt_110","no-columns":"_no-columns_1m3bt_114"}}]]),Vte=["aria-label"],Bte=["aria-disabled","onClick"],$te=Ct(st({__name:"MonthSelection",props:{monthLabels:{default:()=>["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},ariaLabel:{default:"Select month"},selectedYear:{default:null},selectedMonth:{default:null},displayYear:{default:null},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},isMonthSelectable:{type:Function,default:()=>!0}},emits:["select","keydown"],setup(e,{emit:t}){const n=e,o=t,s=a=>{n.disabled||n.readOnly||!n.isMonthSelectable(a)||o("select",a)},r=new Date().getFullYear(),i=new Date().getMonth()+1;return(a,l)=>(K(),ie("div",{class:te([a.$style["month-grid"],n.compact?a.$style.compact:""]),"aria-label":n.ariaLabel,"data-index":"month-selection"},[me("div",{class:te(a.$style.months)},[(K(!0),ie(It,null,Fn(n.monthLabels,(c,u)=>(K(),ie("a",{key:c,tabindex:"0",class:te([a.$style["month-cell"],{[a.$style.selected]:u+1===n.selectedMonth&&n.selectedYear===n.displayYear,[a.$style.current]:u+1===i&&H(r)===n.displayYear,[a.$style.disabled]:n.disabled||n.readOnly||!n.isMonthSelectable(u+1)}]),"aria-disabled":n.disabled||n.readOnly||!n.isMonthSelectable(u+1),onClick:d=>s(u+1),onKeydown:l[0]||(l[0]=d=>o("keydown",d))},ht(c),43,Bte))),128))],2)],10,Vte))}}),[["__cssModules",{$style:{"month-grid":"_month-grid_1t30z_1",months:"_months_1t30z_8","month-cell":"_month-cell_1t30z_22",selected:"_selected_1t30z_36",compact:"_compact_1t30z_40",current:"_current_1t30z_53",disabled:"_disabled_1t30z_61"}}]]),Hte=["data-year","aria-disabled","onClick"],Gte=Ct(st({__name:"YearSelection",props:{years:{},selectedYear:{default:null},disabled:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},isYearSelectable:{type:Function,default:()=>!0}},emits:["select","keydown"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=V(null),i=new Date().getFullYear(),a=l=>{o.disabled||!o.isYearSelectable(l)||s("select",l)};return t({rootEl:r}),Qt(()=>{if(r.value){const l=r.value.querySelector(`[data-year="${o.selectedYear}"]`);l&&l.scrollIntoView({block:"center"})}}),(l,c)=>(K(),ie("div",{ref_key:"rootEl",ref:r,class:te([l.$style["year-grid-body"],o.scrollable?l.$style.scrollable:"",o.compact?l.$style.compact:""]),role:"grid","data-index":"year-selection"},[(K(!0),ie(It,null,Fn(o.years,u=>(K(),ie("a",{key:u,"data-year":u,tabindex:"0",class:te([l.$style["year-cell"],{[l.$style.selected]:u===o.selectedYear,[l.$style.current]:u===H(i),[l.$style.disabled]:o.disabled||!o.isYearSelectable(u)}]),"aria-disabled":o.disabled||!o.isYearSelectable(u),onClick:d=>a(u),onKeydown:c[0]||(c[0]=d=>s("keydown",d))},ht(u),43,Hte))),128))],2))}}),[["__cssModules",{$style:{"year-grid-body":"_year-grid-body_178a1_1",scrollable:"_scrollable_178a1_11","year-cell":"_year-cell_178a1_16",selected:"_selected_178a1_28",current:"_current_178a1_31",compact:"_compact_178a1_35",disabled:"_disabled_178a1_47"}}]]),Ute={class:"navigation"},Wte={class:"picker"},zte={key:0,class:"footer"},jte=Ct(st({__name:"MonthPickerLayout",props:{disableConfirm:{type:Boolean,default:!1}},setup(e){return(t,n)=>(K(),ie("div",{class:te(["month-picker-layout",{"disable-confirm":e.disableConfirm}])},[me("div",Ute,[Dt(t.$slots,"navigation",{},void 0,!0)]),me("div",Wte,[Dt(t.$slots,"picker",{},void 0,!0)]),ue(xT,{name:"fade",mode:"out-in"},{default:he(()=>[e.disableConfirm?Xe("",!0):(K(),ie("div",zte,[Dt(t.$slots,"footer",{},void 0,!0)]))]),_:3})],2))}}),[["__scopeId","data-v-885d09b2"]]),Kte={style:{flex:"1"}},qte=Ct(st({__name:"CalendarFooter",props:{disabled:{type:Boolean},readOnly:{type:Boolean},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Save"},disableConfirm:{type:Boolean,default:!1}},emits:["cancel","confirm","goto-date"],setup(e,{emit:t}){const n=e,o=t,s=()=>{o("cancel")},r=()=>{o("confirm")},i=(l=new Date)=>{o("goto-date")},a=l=>{if(l.key==="Enter"||l.key===" "){l.preventDefault(),l.stopPropagation();const c=l.target;c.dataset.index==="today-btn"?i():c.dataset.index==="cancel-btn"?s():c.dataset.index==="save-btn"&&r()}};return(l,c)=>{const u=eu("tooltip");return n.readOnly?Xe("",!0):(K(),ie("div",{key:0,class:te(l.$style["arbo-calendar-actions"])},[me("div",Kte,[Ke((K(),Ue(H(at),{variant:"secondary",size:"medium",onClick:c[0]||(c[0]=d=>i()),onKeydown:a,"data-index":"today-btn"},{prefix:he(()=>[ue(H(lt),{src:"CalendarDay"})]),_:1})),[[u,"Today"]])]),ue(H(at),{disabled:n.disabled,readOnly:n.readOnly,onKeydown:a,variant:"secondary",size:"medium",onClick:s,"data-index":"cancel-btn"},{default:he(()=>[Qe(ht(n.cancelLabel),1)]),_:1},8,["disabled","readOnly"]),ue(H(at),{disabled:n.disabled||n.disableConfirm,readOnly:n.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:a,onClick:r},{default:he(()=>[Qe(ht(n.confirmLabel),1)]),_:1},8,["disabled","readOnly"])],2))}}}),[["__cssModules",{$style:{"arbo-calendar-actions":"_arbo-calendar-actions_132g0_1"}}]]),Yte=Ct(st({__name:"CalendarNavigation",props:{disabled:{type:Boolean},readOnly:{type:Boolean},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Save"},disableConfirm:{type:Boolean,default:!1},minDate:{},maxDate:{},monthLabels:{},monthLabelStyle:{},locale:{},month:{},year:{},hideMonth:{type:Boolean,default:!1},mode:{}},emits:["cancel","confirm","goto-date","prev","next","toggle-months","toggle-years"],setup(e,{emit:t}){const n=e,o=ds({month:new Date().getMonth()+1,year:new Date().getFullYear()}),s=q(()=>{if(n.minDate){const h=o.month===1?12:o.month-1,f=o.month===1?o.year-1:o.year;return new Date(f,h-1,1)<new Date(n.minDate.getFullYear(),n.minDate.getMonth(),1)}return!1}),r=q(()=>{if(n.maxDate){const h=o.month===12?1:o.month+1,f=o.month===12?o.year+1:o.year;return new Date(f,h-1,1)>new Date(n.maxDate.getFullYear(),n.maxDate.getMonth(),1)}return!1}),i=t,a=()=>{s.value||(n.mode==="month"?o.month=o.month===0?11:o.month-1:n.mode==="year"&&(o.year-=1)),i("prev",{month:o.month,year:o.year})},l=()=>{r.value||(n.mode==="month"?o.month=o.month===11?0:o.month+1:n.mode==="year"&&(o.year+=1)),i("next",{month:o.month,year:o.year})},c=()=>{i("toggle-months")},u=()=>{i("toggle-years")},d=q(()=>{if(n.monthLabels&&n.monthLabels.length===12)return n.monthLabels;const h=n.locale||"en-US",f=n.monthLabelStyle||"short",p=new Intl.DateTimeFormat(h,{month:f,timeZone:"UTC"});return Array.from({length:12},(v,w)=>p.format(new Date(Date.UTC(2020,w,1))))});return(h,f)=>(K(),ie("div",{class:te(h.$style["cal-nav-bar"])},[e.mode!="year"?(K(),Ue(H(at),{key:0,variant:"tertiary",class:te([h.$style["cal-nav-btn"],h.$style.prev]),"aria-label":"Previous",disabled:s.value,label:"",onClick:a,"data-index":"prev-btn",onKeydownCapture:jn(kt(a,["prevent","stop"]),["enter"])},{default:he(({hovered:p})=>[ue(H(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Xe("",!0),me("div",{class:te([h.$style["cal-nav-center"],e.hideMonth?h.$style.single:""])},[e.hideMonth?Xe("",!0):(K(),Ue(H(at),{key:0,"data-index":"month-btn",variant:"secondary",onClick:c},{default:he(()=>[Qe(ht(d.value[n.month-1]),1)]),_:1})),ue(H(at),{variant:"secondary",onClick:u,"data-index":"year-btn"},{default:he(()=>[Qe(ht(n.year),1)]),_:1})],2),e.mode!="year"?(K(),Ue(H(at),{key:1,"data-index":"next-btn",variant:"tertiary",class:te([h.$style["cal-nav-btn"],h.$style.next]),"aria-label":"Next",disabled:r.value,label:"",onClick:l,onKeydownCapture:jn(kt(l,["prevent","stop"]),["enter"])},{default:he(({hovered:p})=>[ue(H(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_1jrqr_1","cal-nav-bar":"_cal-nav-bar_1jrqr_12","cal-nav-btn":"_cal-nav-btn_1jrqr_19",prev:"_prev_1jrqr_32","year-grid-header":"_year-grid-header_1jrqr_36","cal-nav-center":"_cal-nav-center_1jrqr_45",single:"_single_1jrqr_52","cal-nav-label":"_cal-nav-label_1jrqr_56","year-grid":"_year-grid_1jrqr_36",months:"_months_1jrqr_78","month-cell":"_month-cell_1jrqr_85","year-cell":"_year-cell_1jrqr_86","pg-btn":"_pg-btn_1jrqr_108","year-grid-body":"_year-grid-body_1jrqr_121",selected:"_selected_1jrqr_125","days-slot":"_days-slot_1jrqr_131","range-label":"_range-label_1jrqr_135"}}]]),Zte=["aria-label"];new Date().getUTCFullYear()-12,new Date().getUTCFullYear()+12;const bM=Ct(st({__name:"StatusSelect",props:{modelValue:{},getStatusFunc:{},workspaceId:{},id:{},maxWidth:{default:"500px"}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const o={PER_PAGE:20,INITIAL_PAGE:1},s=(F,O=0)=>F?`${parseInt(F,10)+O}px`:"auto",r=(F,O=0)=>F?parseInt(F,10)+O:0,i=e,a=V(i.modelValue),l=n,c=q(()=>p.value.find(F=>F.id===a.value)||null),u=F=>{a.value=F.id,l("update:modelValue",F.id)};q(()=>{if(!a.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const F=p.value.find(k=>k.id===a.value),O=String((F==null?void 0:F.color)||"white");return{backgroundColor:O,border:em(O,"white")?"1px solid #ccc":"1px solid #fff"}});const d=q(()=>{const F=p.value.find(k=>k.id===a.value);return String((F==null?void 0:F.color)||"white")});q(()=>new Pn(d.value).isLight()?"#000":"#fff");const h=V(null),f=()=>{var F;(F=h.value)==null||F.focus()},p=V([]),g=V(!1),v=V(!1),w=V(null),S=V(o.INITIAL_PAGE),b=V(!0),C=V(0),_=V(""),E=q(()=>!!(i.id&&i.workspaceId)),I=F=>{const O=p.value.find(k=>k.id===F.value);O&&u(O)},T=F=>({label:F.name,value:F.id,selected:a.value===F.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:F,id:F.id,color:F.color}),P=async(F=o.INITIAL_PAGE,O="",k=!1)=>{var x;if(!E.value){console.error("Missing required props",i);return}k?v.value=!0:g.value=!0,w.value=null;try{const $={workspaceId:String(i.workspaceId),itemIds:i.id,page:F,perPage:o.PER_PAGE,name_like:O.trim()};if(i.getStatusFunc===void 0)throw new Error("API service getAssignableStatus is undefined");const W=await i.getStatusFunc($);if(!W){k||(p.value=[]),b.value=!1;return}const Q=W.data.map(T);p.value=k?[...p.value,...Q]:Q,C.value=((x=W.meta)==null?void 0:x.total)??W.data.length,b.value=p.value.length<C.value,S.value=F}catch($){console.error("Error fetching statuses:",$),w.value="Failed to load statuses",k||(p.value=[]),b.value=!1,l("error",w.value)}finally{g.value=!1,v.value=!1}},M=async()=>{!b.value||v.value||await P(S.value+1,_.value,!0)};tt([()=>i.id,()=>i.workspaceId],()=>{P()},{deep:!0,immediate:!0});const D=async F=>{_.value=F,S.value=o.INITIAL_PAGE,await P(o.INITIAL_PAGE,F,!1)};return t({focus:f,clear:()=>{a.value=null,l("update:modelValue",null)}}),(F,O)=>(K(),Ue(Mte,{onOpen:f,placement:"bottom-start","max-width":r(i.maxWidth)},{trigger:he(({open:k})=>[ue(VO,{value:c.value,style:{width:"100%"},"read-only":!1},{suffix:he(()=>[ue(lt,{src:"ChevronUp",source:"remote",class:te([[F.$style["dropdown-icon"]],{[F.$style["dropdown-icon-show"]]:!k}])},null,8,["class"])]),_:2},1032,["value"])]),content:he(({closeDropdown:k})=>{var x;return[ue(na,{ref_key:"popupRef",ref:h,"selected-id":(x=c.value)==null?void 0:x.id,options:p.value,loading:g.value,itemWidth:s(i.maxWidth,-10),"loading-more":v.value,"has-more":b.value,error:w.value,onSearch:D,onSelect:$=>{I($),k()},onLoadMore:M,onCancel:O[0]||(O[0]=$=>l("cancel")),style:cn({width:s(i.maxWidth,-10)})},null,8,["selected-id","options","loading","itemWidth","loading-more","has-more","error","onSelect","style"])]}),_:1},8,["max-width"]))}}),[["__cssModules",{$style:{"status-wrapper":"_status-wrapper_149oc_1",status:"_status_149oc_1","color-indicator":"_color-indicator_149oc_13","status-text":"_status-text_149oc_22",empty:"_empty_149oc_29","dropdown-icon":"_dropdown-icon_149oc_33","dropdown-icon-show":"_dropdown-icon-show_149oc_38",options:"_options_149oc_42"}}]]),SM=e=>({updateCellData:({rowId:n,field:o,value:s})=>{if(!e)return;const r=e.getRowNode(n);r&&r.setDataValue(o,s),e.refreshCells({rowNodes:r?[r]:[],columns:[o],force:!0})}}),Xte={key:2},Jte=Ct(st({name:"MetricEditorWrapper",__name:"MetricEditorWrapper",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},emits:["update:value","clear","copy"],setup(e,{emit:t}){var S;const n=e,o=V(n.value),s=V(!0),r=V(""),i=()=>{var M,D,F;const b=(M=u.value)==null?void 0:M.restricted_type.trim(),C=((F=(D=u.value)==null?void 0:D.restricted_value)==null?void 0:F.split(",").map(Number))||[],[_,E]=C,T={range:`Enter a value between ${_} and ${E}`,not:`These values are not allowed: ${C.join(", ")}`,exact:"Value is not allowed"}[b];return s.value?"":T},a=b=>{if(u.value){if(b===null||b===""){s.value=!0;return}if(c.value!=="number"){s.value=!0;return}s.value=Im(u.value,Number(b)),r.value=i()}};q(()=>s.value?{content:"",showOnCreate:!1}:{content:r.value,bypassOverflowCheck:!0,showOnCreate:!0,theme:"error",alwaysShow:!0});const l=V(null),c=q(()=>uP(u.value)),u=q(()=>{var C,_;return((_=(C=n.params)==null?void 0:C.colDef)==null?void 0:_.context)||null}),{apiServices:d}=Zn(!0,n),{updateCellData:h}=SM((S=n.params)==null?void 0:S.api),f=V(!1),p=Yr(n,"id"),g=()=>{var b;(b=n.params)==null||b.api.stopEditing()},v=()=>{g()},w=async b=>{var _,E;if(g(),f.value=!0,o.value=b||null,b===n.value){f.value=!1;return}const C={itemIds:[String(p.value)],metricId:((_=u.value)==null?void 0:_.id)||"",workspaceId:String(n.workspaceId)};b==null?C.clear=1:C.value=b,h({rowId:String(p.value),field:`metric_${C.metricId}`,value:void 0});try{const I=await((E=d.value)==null?void 0:E.bulkUpdateMetric(C));(I==null?void 0:I.message)=="Done"?h({rowId:String(p.value),field:`metric_${C.metricId}`,value:b||null}):(h({rowId:String(p.value),field:`metric_${C.metricId}`,value:n.value}),console.error("Failed to update metric value:",I),o.value=n.value)}catch(I){console.error("Error during bulk metric update:",I),h({rowId:String(p.value),field:`metric_${C.metricId}`,value:n.value})}finally{f.value=!1}};return(b,C)=>(K(),ie("div",{class:"metric-editor-wrapper",ref_key:"metricEditorWrapperRef",ref:l},[c.value=="dropdown"&&u.value?(K(),Ue(RA,{key:0,config:u.value,modelValue:o.value,"onUpdate:modelValue":C[0]||(C[0]=_=>o.value=_),onChange:w,onHandleCancel:v},null,8,["config","modelValue"])):c.value=="number"&&u.value?(K(),Ue(DA,{key:1,showInlineError:!1,autoEmit:!0,config:u.value,modelValue:o.value,"onUpdate:modelValue":C[1]||(C[1]=_=>o.value=_),style:{width:"100%"},onHandleChange:w,onCancel:v,onOnValidation:a},null,8,["config","modelValue"])):(K(),ie("div",Xte,"Metric type:"+ht(c.value),1))],512))}}),[["__scopeId","data-v-519d44e5"]]),Qte=Ct(st({name:"EmptyData",__name:"EmptyData",props:{isSearching:{type:Boolean},isFiltering:{type:Boolean}},setup(e){const t=e,n={noData:"No data available.",noSearchResults:"No results. Try another search.",noFilterResults:"No results. Try another filter.",emptySearchFilter:"No results. Try another search or filter."};q(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate");const o=q(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),s=V(!1);return Qt(()=>{s.value=!0}),(r,i)=>(K(),ie("div",{class:te(r.$style["no-data-item-table"])},[me("div",{class:te(r.$style.visual)},[s.value?(K(),Ue(Ka,{key:0,source:"remote",src:"NoDataGeneral",ratio:"4/3",maxWidth:500,maxHeight:350})):Xe("",!0)],2),me("div",{class:te(r.$style.description)},ht(o.value),3)],2))}}),[["__cssModules",{$style:{"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:"_visual_oh0wi_12",description:"_description_oh0wi_19"}}]]),EM=rc("sortStore",()=>{const e=V({}),t=V(void 0),n={id:"id",name:"name",isStated:"actual_start_date",isCompleted:"actual_due_date",lastUpdated:"updated_at",completedOn:"actual_due_date",status:"template_flow_status",assignees:"assignee"},o={start_asc:{column:"start_date",direction:"asc"},start_desc:{column:"start_date",direction:"desc"},due_asc:{column:"due_date",direction:"asc"},due_desc:{column:"due_date",direction:"desc"}},s=q(()=>{const c=e.value;return Object.values(c).filter(d=>d.sort!=="none"&&!!d.sort).map(d=>{let h;switch(d.colId){case"dateRange":h=o[d.sort];break;default:if(d.colId.includes("metric")){const[f,p]=d.colId.split("_");h={column:f,direction:d.sort,type:p}}else h={column:n[d.colId]||d.colId,direction:d.sort};break}return h})}),r=(c,u)=>{e.value={[c]:{colId:c,sort:u}}},i=()=>{e.value={}},a=V(!1);return{sortingAPIConfiguration:s,sorts:e,setSort:r,clearSorting:i,isSortingRunning:a,defaultSortStorePreferences:t,setDefaultSort:c=>{console.log("Setting default sort:",c),t.value=c}}}),ene=(e,t)=>{var r;const n=sessionStorage.getItem("ws.terminology"),o=n?JSON.parse(n):null;return` ${((r=o==null?void 0:o.find(i=>i.code==="scene"))==null?void 0:r.name)||"Scene"} `.trim()},tne={class:"paragraph"},nne=["href"],one=["checked"],kv="hideDefaultSortingNotification",sne=Ct(st({name:"DefaultSortingNotification",__name:"DefaultSortingNotification",setup(e,{expose:t}){const n=f=>{f.preventDefault(),f.metaKey||f.ctrlKey?window.open(h.value,"_blank"):window.location.href=h.value,u()},o=()=>{s.value=!s.value},s=V(localStorage.getItem(kv)==="true"),r=()=>{s.value=localStorage.getItem(kv)==="true",localStorage.getItem(kv)!=="true"&&l()},i=()=>{localStorage.setItem(kv,String(s.value)),u()},{triggerRef:a,show:l,popupRef:c,hide:u}=yo({toggleOnClick:!1,trigger:"manual",appendTo:()=>document.getElementById("item-table-layout-id")||document.body,zIndex:8,offset:[0,8],showOnInit:!1,interactive:!0,showArrow:!0});t({show:r,hide:u});const d=q(()=>ene()),h=q(()=>{const f=sessionStorage.getItem("BASE_URL")||"",p=sessionStorage.getItem("ws.code")||"";return`${f}/${p}/ac/prf`});return(f,p)=>(K(),ie(It,null,[me("div",{class:"main-trigger",ref_key:"triggerRef",ref:a},[Dt(f.$slots,"default")],512),me("div",{class:"popup",ref_key:"popupRef",ref:c},[me("div",{class:te(f.$style["default-sorting-notification"])},[me("div",tne,[Qe(" This sort only applies to the current list. To change the default sorting for "+ht(d.value)+" lists, go to ",1),me("a",{href:h.value,onClick:n}," My Settings > Preferences ",8,nne),p[0]||(p[0]=Qe(" . ",-1))]),me("div",{class:te(f.$style.footer)},[me("label",{class:te(f.$style["checkbox-section"])},[me("input",{type:"checkbox",checked:s.value,onChange:kt(o,["stop"]),style:{"--input-size":"16px"}},null,40,one),p[1]||(p[1]=Qe(" Don't show this tip again ",-1))],2),ue(at,{size:"small",variant:["primary","text"],style:{padding:"0 8px"},onClick:i},{default:he(()=>[...p[2]||(p[2]=[Qe(" Got it ",-1)])]),_:1})],2)],2)],512)],64))}}),[["__cssModules",{$style:{"default-sorting-notification":"_default-sorting-notification_5uy9k_1",footer:"_footer_5uy9k_19","checkbox-section":"_checkbox-section_5uy9k_25"}}]]),gc=st({name:"HeaderSorting",__name:"HeaderWrapper",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean}},setup(e){const t=e,n=EM(),{sorts:o,defaultSortStorePreferences:s}=ns(n),r=q(()=>{var f,p;return((p=(f=t.params)==null?void 0:f.column)==null?void 0:p.getColId())||"template_col_id"}),i=V(null),a={name:"name",template_flow_status:"status"};tt(()=>s.value,f=>{var p;f!=null&&f.field&&a[f==null?void 0:f.field]==r.value&&((p=i.value)==null||p.setDefaultSort(f))});const l=f=>{var p;r.value&&n.setSort(r.value,f),(p=u.value)==null||p.show()},c=q(()=>t.params.headerType||void 0),u=V(null),d=V("none");tt(()=>o.value,xr(()=>{var f;if(r.value){const p=o.value[r.value];d.value=p?p.sort:"none",d.value=="none"&&((f=i.value)==null||f.clear())}},li),{deep:!0,immediate:!0});const h=()=>{var f;(f=u.value)==null||f.hide()};return Qt(()=>{var p;const f=(p=t.params)==null?void 0:p.api;f==null||f.addEventListener("bodyScroll",h)}),Ol(()=>{var p;const f=(p=t.params)==null?void 0:p.api;f==null||f.removeEventListener("bodyScroll",h)}),(f,p)=>(K(),Ue(sne,{ref_key:"sortingNotificationRef",ref:u},{default:he(()=>[r.value?(K(),Ue(mee,Wt({key:0,ref_key:"headerSortingRef",ref:i},t,{"header-type":c.value,modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=g=>d.value=g),onSortChanged:l,onOpen:h}),null,16,["header-type","modelValue"])):Xe("",!0)]),_:1},512))}});function rne(){const e=ds({isCreating:!1,name:"",error:void 0,assignees:null,status:null,start_date:null,due_date:null}),t=()=>{const s=e.name.trim();e.status,s.length===0?e.error="Name cannot be empty":s.length>255?e.error="Name cannot exceed 255 characters":e.error=void 0},n=()=>{e.isCreating=!0,e.name="",e.error=void 0,e.assignees=null,e.status=null,e.start_date=null,e.due_date=null},o=()=>{e.isCreating=!1};return tt(()=>e,()=>{t()},{deep:!0}),{newItemData:e,validateNewItem:t,openNewItemForm:n,closeNewItemForm:o,resetNewItemForm:()=>{e.name="",e.assignees=null,e.start_date=null,e.due_date=null,e.error=void 0}}}const Av=rc("userStore",()=>{const e=V(null),t=V(null);return{user:e,setUser:s=>{e.value=s},setUserRoleId:s=>{t.value=s},workspaceUserRoleId:t}}),ine=["innerHTML"],ane=20,lne=Ct(st({__name:"AddNewAssignee",props:{maxVisible:{default:3}},emits:["updated","cancel","start-update","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const o=e,{triggerRef:s,popupRef:r,isVisible:i,show:a,hide:l}=yo({toggleOnClick:!0,appendTo:"parent",offset:[-15,8]}),c=()=>{a()},u=V(null),d=()=>{M.value=[],pe.value=!1},h=q(()=>i.value),f=q(()=>{var U;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((U=M.value)==null?void 0:U.length)===0,wrapperRef:s,active:h,bordered:!0}}),{argsMain:p}=Co(f),g=Yt,v=n,w=q(()=>{var U;return Math.max(0,(((U=M.value)==null?void 0:U.length)||0)-o.maxVisible)}),S=q(()=>{var U;return w.value<=0?"":((U=M.value)==null?void 0:U.slice(o.maxVisible).map(ge=>ge.name).join(", "))||""}),b=V(!1),C=V(!1),_=V(null),E=V(1),I=V(!0),T=V(0),P=V(""),M=V([]),D=q(()=>{var U;return((U=M.value)==null?void 0:U.map(ge=>ge.id))||[]}),{assigneeList:F,mergedOptions:O}=Om({...o,value:[]}),{apiServices:k}=Zn(!1,o),x=yn("entityId"),$=async(U=1,ge="",oe=!1)=>{var G,Y,de,ke,xe;if(!k.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(oe?C.value=!0:b.value=!0,_.value=null,!((G=k.value)!=null&&G.getAssignableAssignees))throw new Error("API service getAssignableAssignees is undefined");const Re=un.getInstance().getItem("ws.code");try{const Ve=await((Y=k.value)==null?void 0:Y.getAssignableAssignees(String(Re),{entity_ids:(x==null?void 0:x.value)||"",page:U,per_page:ane,display_name_like:ge})),ye=((de=Pu(Ve.data))==null?void 0:de.map(Am))??[];F.value=oe?vu(F.value,ye,"id"):ye,T.value=Ve.meta.total,I.value=(((ke=Ve==null?void 0:Ve.meta)==null?void 0:ke.current_page)||0)<(((xe=Ve==null?void 0:Ve.meta)==null?void 0:xe.last_page)||0),E.value=U}catch(Ve){console.error("Error fetching assignable users:",Ve),_.value="Failed to load assignable users"}finally{b.value=!1,C.value=!1}},W=U=>{var ge,oe,Re;if((ge=M.value)!=null&&ge.some(G=>G.id===U.data.id)){M.value=(oe=M.value)==null?void 0:oe.filter(G=>G.id!==U.data.id);return}M.value=[...M.value||[],U.data],(Re=u.value)==null||Re.focus()},Q=()=>{M.value=[]},ae=()=>{!C.value&&I.value&&$(E.value+1,P.value,!0)},ee=xr(async U=>{P.value=U,await $(1,U,!1)},li);tt(()=>i.value,U=>{var ge;U?($(1,P.value,!1),(ge=u.value)==null||ge.focus(),v("show")):v("hide")});const X=q(()=>{var U;return((U=M.value)==null?void 0:U.slice(0,3))||[]}),N=q(()=>X.value.map(U=>({id:U.id,name:U.name,initial:U.initial,avatarId:U.id,profile_image:U.profile_image,color:U.color,size:24,user:U}))),z=Av(),{user:ne}=ns(z),pe=V(!1);t({getData:()=>M.value,clear:d,setData:U=>{M.value=U},focus:()=>{a(),vt(()=>{var U;(U=u.value)==null||U.focus()})},hide:()=>{l()}}),tt([M,pe],()=>{v("updated",M.value)},{deep:!0});const ve=U=>{var ge;M.value=(ge=M.value)==null?void 0:ge.filter(oe=>oe.id!==U)},we=U=>{var oe;const ge=un.getInstance().getItem("ws.code");return((oe=k.value)==null?void 0:oe.getUserInformation(ge,U))||Promise.resolve(null)},re=V();return(U,ge)=>(K(),ie("div",{class:"new-assignee-wrapper",ref_key:"wrapperRef",ref:re},[ue(_o,Wt(H(p),{style:{"--icon-size":"18px"}}),{prefix:he(()=>[N.value.length==0?(K(),ie("div",{key:0,class:te([U.$style["icon-wrapper"],"wrapper-prefix"]),onClick:kt(c,["stop","prevent"])},[ue(lt,{src:"UserPlus",color:"#A6A6A6"})],2)):Xe("",!0)]),default:he(()=>[me("div",{class:te([U.$style["assignee-row"],U.$style["assignee-selector"]]),ref_key:"triggerRef",ref:s},[me("div",{style:{flex:1},class:te([U.$style["assignee-row"]])},[(K(!0),ie(It,null,Fn(N.value,oe=>(K(),Ue(If,{onClear:Re=>ve(oe.id),key:oe.user.id,"disable-remove":!1},{default:he(()=>[ue(Gu,{user:oe.user,apiUpdateFunction:we,appendTo:re.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),w.value>0?Ke((K(),ie("div",{key:0,class:te(U.$style["extra-avatars"])},[Qe(" +"+ht(w.value),1)],2)),[[H(g),S.value]]):Xe("",!0)],2)],2)]),_:1},16),me("div",{ref_key:"popupRef",ref:r},[ue(na,Wt({"selected-id":D.value},{...o},{options:H(O),loading:b.value,"loading-more":C.value,"has-more":I.value,ref_key:"searchListRef",ref:u,onTab:ge[0]||(ge[0]=oe=>v("tab",oe)),onSelect:ge[1]||(ge[1]=oe=>{W(oe),v("start-update")}),onSearch:H(ee),onClose:ge[2]||(ge[2]=()=>v("close")),onLoadMore:ae}),{"extra-item":he(()=>[ue(_S,{onClick:Q,label:"Unassign",borderLeft:!0},{icon:he(()=>[ue(lt,{src:"UserXMark",source:"remote"})]),_:1})]),item:he(({item:oe,selectedIndex:Re,isSelected:G,handleSelect:Y,handleItemHover:de,getHighlightedLabel:ke,query:xe,idx:Ve})=>[ue(ic,Wt(oe,{hover:Ve===Re,selected:G(oe),type:oe.type,onClick:kt(ye=>Y(oe,ye),["stop","prevent"]),onMouseover:ye=>de(Ve),class:U.$style["item-assignee"]}),{prefix:he(()=>[ue(Gu,{user:oe.data,apiUpdateFunction:we,appendTo:H(r)},null,8,["user","appendTo"])]),label:he(({})=>[xe?Ke((K(),ie("span",{key:0,class:te([U.$style["item-label"],U.$style.match]),style:{flex:"1"},innerHTML:ke(oe.label)},null,10,ine)),[[H(g),{content:oe.label}]]):Ke((K(),ie("span",{key:1,class:te(U.$style["item-label"]),style:{flex:"1"}},[Qe(ht(oe.label),1)],2)),[[H(g),{content:oe.label}]])]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch"])],512)],512))}}),[["__cssModules",{$style:{action:"_action_1xvno_1","item-assignee":"_item-assignee_1xvno_6","item-action":"_item-action_1xvno_6","item-label":"_item-label_1xvno_16","icon-wrapper":"_icon-wrapper_1xvno_25","error-message":"_error-message_1xvno_34","empty-state":"_empty-state_1xvno_44","assignee-row":"_assignee-row_1xvno_57","assignee-selector":"_assignee-selector_1xvno_65",seperator:"_seperator_1xvno_69","extra-avatars":"_extra-avatars_1xvno_77",list:"_list_1xvno_89"}}]]),cne={key:0},une={key:1},dne={key:0},hne={key:1},fne={key:0,class:"wrapper-suffix"},pne={key:0,class:"wrapper-prefix",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"24px",height:"24px"}},gne=Ct(st({__name:"AddNewDate",emits:["updated","tab","show","hide"],setup(e,{expose:t,emit:n}){const o=Yt,{triggerRef:s,popupRef:r,isVisible:i,hide:a,show:l}=yo({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),c=()=>{u.value=[null,null]},u=V([null,null]),d=C=>{const _=Tm();return C?bt.fromJSDate(C,{zone:_}).toFormat("MMM dd"):""},h=q(()=>i.value),f=q(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:u.value[0]===null&&u.value[1]===null,wrapperRef:s,active:h,bordered:!0})),{argsMain:p}=Co(f),g=V(!1),v=C=>{S("tab",C)},w=C=>{"start"in C&&C.start!==void 0&&(u.value[0]=C.start),"end"in C&&C.end!==void 0&&(u.value[1]=C.end)};t({getData:()=>u.value,clear:c,setData:C=>{u.value=C},focus:()=>{l(),vt(()=>{var C;(C=b.value)==null||C.focus()})},hide:()=>{a()}});const S=n;tt(()=>u.value,C=>{S("updated",C)},{deep:!0});const b=V(null);return tt(()=>i.value,C=>{C?(vt(()=>{var _;(_=b.value)==null||_.focus()}),S("show")):S("hide")}),(C,_)=>(K(),ie(It,null,[ue(_o,Wt({ref_key:"triggerRef",ref:s},H(p),{style:{"--icon-size":"18px",cursor:"pointer"}}),{default:he(({focused:E})=>[me("div",{class:te(C.$style["date-time"])},[me("div",{class:te(C.$style.date)},[u.value[0]==null&&(E||H(i))?(K(),ie("span",cne,"MMMDD")):(K(),ie("span",une,ht(d(u.value[0])),1))],2),u.value[0]!==null||u.value[1]!==null||E||H(i)?(K(),ie("div",{key:0,class:te(C.$style.separator)}," → ",2)):Xe("",!0),me("div",{class:te(C.$style.date)},[u.value[1]==null&&(E||H(i))?(K(),ie("span",dne,"MMMDD")):(K(),ie("span",hne,ht(d(u.value[1])),1))],2)],2)]),suffix:he(({hovered:E,focused:I})=>[(u.value[0]!==null||u.value[1]!==null)&&(E||I||H(i))?(K(),ie("div",fne,[Ke((K(),Ue(at,{onClick:kt(c,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:he(()=>[ue(lt,{src:"XMarkSolid",size:"8"})]),_:1})),[[H(o),"Clear"]])])):Xe("",!0)]),prefix:he(()=>[u.value[0]===null&&u.value[1]===null?(K(),ie("div",pne,[ue(lt,{src:"Calendar",color:"#A6A6A6"})])):Xe("",!0)]),_:1},16),me("div",{ref_key:"popupRef",ref:r},[H(i)?(K(),Ue(Ym,{key:0,immediatelyUpdate:!1,value:u.value,onConfirmed:w,ref_key:"calendarRef",ref:b,onClosed:H(a),onStartUpdate:_[0]||(_[0]=E=>g.value=!0),onFinishUpdate:_[1]||(_[1]=E=>g.value=!1),onTab:v},null,8,["value","onClosed"])):Xe("",!0)],512)],64))}}),[["__cssModules",{$style:{"list-item":"_list-item_n9o5g_2","date-time":"_date-time_n9o5g_5",date:"_date_n9o5g_5",separator:"_separator_n9o5g_18"}}]]),mne=Ct(st({__name:"AddNewStatus",props:{entityId:{}},emits:["updated","error","cancel","update:modelValue","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const o=e,s={PER_PAGE:20,INITIAL_PAGE:1},{triggerRef:r,popupRef:i,isVisible:a,show:l,hide:c}=yo({toggleOnClick:!0,appendTo:"parent"}),u=V(null),d=V([]),h=V(!1),f=V(!1),p=V(null),g=V(s.INITIAL_PAGE),v=V(!0),w=V(0),S=V(""),b=n,C=q(()=>a.value),_=q(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:!u.value,wrapperRef:r,active:C,bordered:!0})),E=V(null),{argsMain:I}=Co(_),T=q(()=>u.value?d.value.filter(X=>X.id===u.value):[]),P=q(()=>!u.value||T.value.length===0?"":T.value[0].label),M=q(()=>u.value?[u.value]:[]),D=q(()=>{if(!u.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6",minWidth:"14px"};const X=T.value[0],N=String((X==null?void 0:X.color)||"white");return{backgroundColor:N,border:em(N,"white")?"1px solid #ccc":"1px solid #fff",minWidth:"14px"}}),F=X=>({label:X.name,value:X.id,selected:u.value===X.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:X,id:X.id,color:X.color}),{apiServices:O}=Zn(!1,o),k=async(X=s.INITIAL_PAGE,N="",z=!1)=>{var ne,pe;z?f.value=!0:h.value=!0,p.value=null;try{const ve=un.getInstance().getItem("ws.code"),we=await((ne=O.value)==null?void 0:ne.getAssignableStatuses(ve,{entity_id:o.entityId||"",name_like:N,page:X,per_page:s.PER_PAGE}));if(!we){z||(d.value=[]),v.value=!1;return}const re=we.data.map(F);d.value=z?[...d.value,...re]:re,w.value=((pe=we.meta)==null?void 0:pe.total)??we.data.length,v.value=d.value.length<w.value,g.value=X}catch(ve){console.error("Error fetching statuses:",ve),p.value="Failed to load statuses",z||(d.value=[]),v.value=!1,b("error",p.value)}finally{h.value=!1,f.value=!1}},x=(X,N)=>{var ne;N.stopImmediatePropagation(),N.preventDefault(),N.stopPropagation();const z=X.id;u.value=z,(ne=E.value)==null||ne.focus(),b("update:modelValue",u.value),c()},$=async()=>{!v.value||f.value||await k(g.value+1,S.value,!0)},W=async X=>{S.value=X,g.value=s.INITIAL_PAGE,await k(s.INITIAL_PAGE,X,!1)},Q=()=>{u.value=null,b("update:modelValue",null)},ae=()=>{l(),vt(()=>{var X;(X=E.value)==null||X.focus()})};return tt(()=>a.value,X=>{var N;X?(k(1,S.value,!1),(N=E.value)==null||N.focus(),b("show")):b("hide")}),tt(()=>u.value,X=>{b("updated",X)}),t({focus:ae,clear:Q,getData:()=>u.value,setData:X=>{u.value=X},hide:c,autoFillDefault:async()=>{S.value="",await k(1,S.value,!1),d.value.length>0&&(u.value=d.value[0].id,b("update:modelValue",u.value))}}),(X,N)=>{const z=eu("tooltip");return K(),ie(It,null,[ue(_o,Wt({ref_key:"triggerRef",ref:r},H(I),{style:{"--icon-size":"18px"}}),{default:he(()=>[me("div",{class:te(X.$style.status)},[me("div",{class:te(X.$style["color-indicator"]),style:cn(D.value)},null,6),Ke((K(),ie("span",{class:te({[X.$style.empty]:T.value.length===0,[X.$style["status-text"]]:!0})},[Qe(ht(P.value),1)],2)),[[z,{content:P.value}]])],2)]),_:1},16),me("div",{ref_key:"popupRef",ref:i},[ue(na,{style:{width:"200px"},ref_key:"searchListRef",ref:E,"selected-id":M.value,options:d.value,loading:h.value,"loading-more":f.value,"has-more":v.value,error:p.value,onSearch:W,onSelect:x,onLoadMore:$,onCancel:N[0]||(N[0]=ne=>b("cancel")),onTab:N[1]||(N[1]=ne=>b("tab",ne)),onClose:N[2]||(N[2]=()=>b("close"))},null,8,["selected-id","options","loading","loading-more","has-more","error"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_10pcy_2",status:"_status_10pcy_6","color-indicator":"_color-indicator_10pcy_13","count-badge":"_count-badge_10pcy_26","status-text":"_status-text_10pcy_34",empty:"_empty_10pcy_43"}}],["__scopeId","data-v-c2a73a7b"]]),vne=Ct(st({__name:"CreateNewScene",emits:["create-new-item","focus-on-id","search-for-code"],setup(e,{expose:t,emit:n}){const o=["name","assignees","status","date","cancel","create-keep","create"],s=Yt,r=kG("target"),i=yn("workspaceId"),a=yn("entityId"),l=n,c=e,{newItemData:u,validateNewItem:d,resetNewItemForm:h,closeNewItemForm:f}=rne(),{apiServices:p}=Zn(!1,c),{openSceneHub:g}=mf(),v=V(!1),w=V(!1),S=V(null),b=V({assignees:!1,status:!1,date:!1}),C={name:V(null),assignees:V(null),status:V(null),date:V(null),cancel:V(null),"create-keep":V(null),create:V(null)},_=C.name,E=C.assignees,I=C.status,T=C.date,P=C.cancel,M=C["create-keep"],D=C.create,F=V(new Map),O=q(()=>!!u.error||!u.name.trim()||w.value),k=(ye,L)=>{ye&&F.value.set(L,ye.$el||ye)},x=(ye,L)=>{if(ye==="date"){const[j,le]=Array.isArray(L)?L:[void 0,void 0];u.start_date=j,u.due_date=le}else u[ye]=L},$=()=>{u.isCreating=!0,S.value="name"},W=()=>{u.isCreating=!1,h()},Q=yn("switchInstance"),{addNotification:ae}=oa(),ee=ye=>{l("focus-on-id",ye)},X=(ye,L,j)=>{const le=dP(void 0,"created");ae({id:String(ye),message:`<div style="display:flex; flex-direction: column; align-items: flex-start;"><b>${le}</b>
162
162
  <span>${L} </span></div>`,actions:[{label:"Find in table",variant:"secondary",btnIcon:"MagnifyingGlass",action:()=>{l("search-for-code",{code:j,name:L}),ee(String(ye))}},{label:"Full view",btnIcon:"CustomSceneHub",variant:"primary",action:Ge=>{if(Ge.ctrlKey||Ge.metaKey){const be=es({type:"scene_hub",config:{ws_code:i,baseDomain:un.getInstance().getItem("BASE_URL")||"",scene_id:String(ye)}}).url;window.open(be,"_blank");return}else Q("scene_hub",{id:String(ye)},{showLoading:!1})}}],type:"interactive"})},N=ye=>{ye&&vt(()=>{var j;const L=(j=C[ye])==null?void 0:j.value;L&&(typeof L.focus=="function"?L.focus():L.$el&&typeof L.$el.focus=="function"&&L.$el.focus())})},z=ye=>{var L;(L=r.value)==null||L.focus()},ne=ye=>{const L=j=>{var le;return(le=j==null?void 0:j.hide)==null?void 0:le.call(j)};ye!=="assignees"&&L(E.value),ye!=="status"&&L(I.value),ye!=="date"&&L(T.value)},pe=(ye,L)=>{L instanceof KeyboardEvent&&L.key!=="Tab"&&L.preventDefault();const j=S.value?o.indexOf(S.value):-1;if(j===-1){N("name");return}let Ge=(j+(ye==="next"?1:-1)+o.length)%o.length,be=o[Ge];(be==="create"||be==="create-keep")&&O.value&&(Ge=0,be=o[0]),ne(be),N(be)},ve=ye=>{b.value[ye]=!0,S.value=ye},we=ye=>{b.value[ye]=!1,z()},re=ye=>{b.value[ye]||(S.value=null)},U=ye=>{ye.target===r.value&&N("name")},ge=ye=>{var L,j,le;if(ye.key==="Enter"){if(!S.value)return;switch(ye.preventDefault(),ye.stopPropagation(),S.value){case"create":O.value||de("clear");break;case"create-keep":O.value||de("keep");break;case"cancel":f();break;case"assignees":(L=E.value)==null||L.focus();break;case"status":(j=I.value)==null||j.focus();break;case"date":(le=T.value)==null||le.focus();break}return}if(ye.key==="Tab"){ye.preventDefault(),ye.stopImmediatePropagation(),ye.stopPropagation(),S.value!=="name"&&oe(ye);return}if(ye.key==="Escape"){S.value=null,W();return}},oe=ye=>{ye.preventDefault(),ye.stopImmediatePropagation(),ye.stopPropagation();const L=ye.shiftKey?"prev":"next";pe(L,ye)},Re=()=>{var ye;return(ye=E.value)==null?void 0:ye.focus()},G=()=>{var ye;return(ye=I.value)==null?void 0:ye.focus()},Y=()=>{var ye;return(ye=T.value)==null?void 0:ye.focus()},de=async(ye="clear")=>{vt(async()=>{var j,le,Ge,be,ze,qe,Ee,Me,wt,At,Ut;if(O.value||v.value||w.value)return;w.value=!0,v.value=!0;const L={name:u.name,template_flow_status_id:u.status??void 0,ws_user_role_ids:(j=u.assignees)==null?void 0:j.map(tn=>tn.id),start_date:u.start_date?km(u.start_date):void 0,due_date:u.due_date?km(u.due_date):void 0};if(!((le=p.value)!=null&&le.addNewItem)){console.warn("API service unavailable"),v.value=!1;return}try{const tn=await p.value.addNewItem(i,a,L),zt=u.name;if(X(tn.id,tn.name,tn.code),!tn.id)throw new Error("Invalid response from server: missing scene ID");switch(w.value=!1,v.value=!1,ye){case"close":h(),(Ge=E.value)==null||Ge.setData([]),(be=I.value)==null||be.setData(null),(ze=T.value)==null||ze.setData([null,null]),f(),W();break;case"close-open":h(),(qe=E.value)==null||qe.setData([]),(Ee=I.value)==null||Ee.setData(null),(Me=T.value)==null||Me.setData([null,null]),f(),W(),g(tn.id);break;case"clear":l("create-new-item",zt),h(),(wt=E.value)==null||wt.setData([]),(At=I.value)==null||At.setData(null),(Ut=T.value)==null||Ut.setData([null,null]),N("name");break;case"keep":l("create-new-item",zt),u.name="",u.error="",N("name");break}}catch(tn){console.error("Error creating scene:",tn),ye=="close"&&(f(),W())}finally{v.value=!1,w.value=!1}})},ke=(ye,L)=>{O.value||(L.metaKey||L.ctrlKey?de("close-open"):L.shiftKey?de("keep"):de("clear"))},xe=(ye=!1)=>{u.isCreating&&(!O.value&&!u.error?de(ye?"close":"clear"):W())},Ve=()=>{f(),u.name="",vt(()=>{var ye;(ye=_.value)==null||ye.setValue(u.name)})};return bS(r,ye=>{const L=ye.target.closest(".notification-center"),j=ye.target.closest("#people-insight-container");if(L||j)return!1;xe(!0)}),tt(()=>u.isCreating,ye=>{ye&&N("name")}),t({show:$,hide:W}),(ye,L)=>Ke((K(),ie("div",{class:te(ye.$style.newRow),ref_key:"target",ref:r,onKeydown:ge,onClick:U,tabindex:"-1"},[me("div",{ref:j=>k(j,"name"),class:te({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="name"})},[ue(SS,{ref_key:"nameInputRef",ref:_,disabled:v.value||w.value,modelValue:H(u).name,"onUpdate:modelValue":L[0]||(L[0]=j=>H(u).name=j),onChange:H(d),onEnter:ke,onCancel:Ve,onTab:L[1]||(L[1]=(j,le)=>oe(le)),onFocus:L[2]||(L[2]=j=>S.value="name"),placeholder:"Enter name",focused:!0,"max-length":255,type:"text","auto-emit":!0,style:{"--bg-input":"transparent","--border-color":"#f3f5f7"},bordered:!0,class:"border-f3f5f7"},null,8,["disabled","modelValue","onChange"])],2),me("div",{ref:j=>k(j,"assignees"),onEnter:kt(Re,["prevent","stop"]),class:te({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="assignees"})},[ue(lne,{ref_key:"assigneeRef",ref:E,onUpdated:L[3]||(L[3]=j=>x("assignees",j)),onTab:L[4]||(L[4]=j=>oe(j)),onEnter:Re,onFocus:L[5]||(L[5]=j=>S.value="assignees"),onBlur:L[6]||(L[6]=j=>re("assignees")),onShow:L[7]||(L[7]=j=>ve("assignees")),onHide:L[8]||(L[8]=j=>we("assignees"))},null,512)],34),me("div",{ref:j=>k(j,"status"),class:te({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="status"})},[ue(mne,{ref_key:"statusRef",ref:I,"entity-id":H(a),onUpdated:L[9]||(L[9]=j=>x("status",j)),onTab:L[10]||(L[10]=j=>oe(j)),onEnter:G,onFocus:L[11]||(L[11]=j=>S.value="status"),onBlur:L[12]||(L[12]=j=>re("status")),onShow:L[13]||(L[13]=j=>ve("status")),onHide:L[14]||(L[14]=j=>we("status"))},null,8,["entity-id"])],2),me("div",{ref:j=>k(j,"date"),class:te({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="date"})},[ue(gne,{ref_key:"dateRef",ref:T,onUpdated:L[15]||(L[15]=j=>x("date",j)),onTab:L[16]||(L[16]=j=>oe(j)),onEnter:Y,onFocus:L[17]||(L[17]=j=>S.value="date"),onBlur:L[18]||(L[18]=j=>re("date")),onShow:L[19]||(L[19]=j=>ve("date")),onHide:L[20]||(L[20]=j=>we("date"))},null,512)],2),me("div",{class:te(ye.$style["field-actions"])},[me("div",{ref:j=>k(j,"cancel"),class:te({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="cancel",[ye.$style["field-button"]]:!0})},[ue(at,{ref_key:"cancelRef",ref:P,variant:["secondary"],onClick:H(f),onKeydown:[jn(H(f),["enter"]),L[22]||(L[22]=jn(j=>oe(j),["tab"]))],onFocus:L[21]||(L[21]=j=>S.value="cancel"),tabindex:"0"},{default:he(()=>[...L[31]||(L[31]=[Qe(" Cancel ",-1)])]),_:1},8,["onClick","onKeydown"])],2),Ke((K(),ie("div",{ref:j=>k(j,"create-keep"),class:te({[ye.$style["field-wrapper"]]:!0,[ye.$style["field-button"]]:!0,[ye.$style.active]:S.value==="create-keep"})},[ue(at,{ref_key:"createKeepRef",ref:M,onClick:L[23]||(L[23]=()=>de("keep")),onKeydown:[L[24]||(L[24]=jn(j=>!O.value&&de("keep"),["enter"])),L[26]||(L[26]=jn(j=>oe(j),["tab"]))],onFocus:L[25]||(L[25]=j=>S.value="create-keep"),disabled:O.value,variant:["primary"],loading:v.value,tabindex:"0",style:cn([{padding:"4px 8px",width:"100%"},{"letter-spacing":"-0.5px"}])},{default:he(()=>[...L[32]||(L[32]=[Qe(" Create & Keep ",-1)])]),_:1},8,["disabled","loading"])],2)),[[H(s),O.value?"Enter a name and select a status to continue.":"Create and keep field values (⇧↵ Shift+Enter)"]]),Ke((K(),ie("div",{ref:j=>k(j,"create"),class:te({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="create",[ye.$style["field-button"]]:!0})},[ue(at,{ref_key:"createRef",ref:D,onClick:L[27]||(L[27]=()=>de("clear")),onKeydown:[L[28]||(L[28]=jn(j=>!O.value&&de("clear"),["enter"])),L[30]||(L[30]=jn(j=>oe(j),["tab"]))],onFocus:L[29]||(L[29]=j=>S.value="create"),disabled:O.value,variant:["primary"],loading:v.value,tabindex:"0"},{default:he(()=>[...L[33]||(L[33]=[Qe(" Create ",-1)])]),_:1},8,["disabled","loading"])],2)),[[H(s),O.value?"Enter a name and select a status to continue.":"Create and clear the fields (↵ Enter)"]])],2)],34)),[[Ks,H(u).isCreating]])}}),[["__cssModules",{$style:{newRow:"_newRow_nxn1y_1","field-actions":"_field-actions_nxn1y_14","field-wrapper":"_field-wrapper_nxn1y_43",active:"_active_nxn1y_49","field-button":"_field-button_nxn1y_52","warning-text":"_warning-text_nxn1y_55","has-error":"_has-error_nxn1y_60"}}]]),yne=["innerHTML"],wne=["accept"],_M=Ct(st({__name:"FileUploader",props:{modelValue:{},acceptTypes:{default:()=>["xlsx","xls","csv"]}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const o=V(null),s=P=>`<svg xmlns="http://www.w3.org/2000/svg" width="49" height="49" viewBox="0 0 49 49" fill="none">
163
163
  <g clip-path="url(#clip0)">
164
164
  <path d="M9.86719 3.56641C9.86719 2.05448 11.1053 0.816406 12.6172 0.816406H33.5136L45.3672 12.67V45.5664C45.3672 47.0783 44.1291 48.3164 42.6172 48.3164H12.6172C11.1053 48.3164 9.86719 47.0783 9.86719 45.5664V3.56641Z" stroke="#232323" stroke-width="0.5"/>
@@ -259,5 +259,5 @@ If you are trying to annotate ${o} with application data, use the '${o}.context'
259
259
  `)}},Xye={moduleName:"ClientSideRowModelFilter",version:ut,rowModels:["clientSide"],beans:[Jve]},X_={moduleName:"FilterCore",version:ut,beans:[Cye],apiFunctions:{isAnyFilterPresent:yye,onFilterChanged:wye},css:[sye],dependsOn:[Xye]},l$={moduleName:"FilterValue",version:ut,beans:[Sye]},Ky={moduleName:"ColumnFilter",version:ut,beans:[vye,bye],dynamicBeans:{headerFilterCellCtrl:Qve},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:rye,getColumnFilterInstance:iye,destroyFilter:aye,setFilterModel:lye,getFilterModel:cye,getColumnFilterModel:uye,setColumnFilterModel:dye,showColumnFilter:hye,hideColumnFilter:fye,getColumnFilterHandler:pye,doFilterAction:gye},dependsOn:[X_,zy,l$,nye]},Jye={moduleName:"CustomFilter",version:ut,userComponents:{agReadOnlyFloatingFilter:_ye},dependsOn:[Ky]},Qye={moduleName:"TextFilter",version:ut,dependsOn:[Ky],userComponents:{agTextColumnFilter:{classImp:Hye,params:{useForm:!0}},agTextColumnFloatingFilter:jye},dynamicBeans:{agTextColumnFilterHandler:zye}},ewe={moduleName:"NumberFilter",version:ut,dependsOn:[Ky],userComponents:{agNumberColumnFilter:{classImp:Nye,params:{useForm:!0}},agNumberColumnFloatingFilter:$ye},dynamicBeans:{agNumberColumnFilterHandler:Lye}},twe={moduleName:"DateFilter",version:ut,dependsOn:[Ky],userComponents:{agDateColumnFilter:{classImp:Iye,params:{useForm:!0}},agDateInput:Mye,agDateColumnFloatingFilter:Aye},dynamicBeans:{agDateColumnFilterHandler:Pye}},nwe={moduleName:"QuickFilterCore",version:ut,rowModels:["clientSide"],beans:[Zye],dependsOn:[X_,l$]},owe={moduleName:"QuickFilter",version:ut,apiFunctions:{isQuickFilterPresent:Kye,getQuickFilter:qye,resetQuickFilter:Yye},dependsOn:[nwe]},swe={moduleName:"ExternalFilter",version:ut,dependsOn:[X_]},rwe=".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}}",J_=(e,t,n)=>{var a,l,c;const{editModelSvc:o}=e,s=(l=(a=o==null?void 0:o.getCellValidationModel())==null?void 0:a.getCellValidation(t))==null?void 0:l.errorMessages,r=(c=o==null?void 0:o.getRowValidationModel().getRowValidation(t))==null?void 0:c.errorMessages,i=s||r;return i!=null&&i.length?i.join(n("tooltipValidationErrorSeparator",". ")):void 0},iwe=class extends We{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,o){e&&t.destroyBean(e);const s=this.gos,r=H_(s),{column:i,eGui:a}=t,l=i.getColDef();!o&&r&&!l.headerComponent&&(o=Jv(()=>a.querySelector(".ag-header-cell-text")));const c="header",d=this.beans.colNames.getDisplayNameForColumn(i,"header",!0),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Pt(s,{location:c,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:o,getAdditionalParams:()=>({column:i,colDef:i.getColDef()})};let p=this.createTooltipFeature(f);return p&&(p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip())),p}setupHeaderGroupTooltip(e,t,n,o){e&&t.destroyBean(e);const s=this.gos,r=H_(s),{column:i,eGui:a}=t,l=i.getColGroupDef();!o&&r&&!(l!=null&&l.headerGroupComponent)&&(o=Jv(()=>a.querySelector(".ag-header-group-text")));const c="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(i,"header"),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Pt(s,{location:c,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:o,getAdditionalParams:()=>{const g={column:i};return l&&(g.colDef=l),g}},p=this.createTooltipFeature(f);return p&&t.createBean(p)}enableCellTooltipFeature(e,t,n){const{beans:o}=this,{gos:s,editSvc:r}=o,{column:i,rowNode:a}=e;let l="cell";const c=()=>{const f=!!!(r!=null&&r.isEditing(e))&&J_(o,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=i.getColDef(),g=a.data;if(p.tooltipField&&ft(g))return _p(g,p.tooltipField,i.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(Pt(s,{location:"cell",colDef:i.getColDef(),column:i,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},u=H_(s);n||(u&&!e.isCellRenderer()?n=()=>{const h=!!(r!=null&&r.isEditing(e));if(!h&&J_(o,e,this.getLocaleTextFunc()))return!0;if(!i.isTooltipEnabled())return!1;const g=Jv(()=>{const v=e.eGui;return v.children.length===0?v:v.querySelector(".ag-cell-value")});return!h&&g()}:n=()=>!(r!=null&&r.isEditing(e)));const d={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:c,shouldDisplayTooltip:n,getAdditionalParams:()=>({column:i,colDef:i.getColDef(),rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(d,o)}setupFullWidthRowTooltip(e,t,n,o){const s={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>n,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:o},r=this.beans,i=r.context;e&&t.destroyBean(e,i);const a=this.createTooltipFeature(s,r);if(a)return t.createBean(a,i)}setupCellEditorTooltip(e,t){var a,l;const{beans:n}=this,{context:o}=n,s=((a=t.getValidationElement)==null?void 0:a.call(t,!0))||!((l=t.isPopup)!=null&&l.call(t))&&e.eGui;if(!s)return;const r={getGui:()=>s,getTooltipValue:()=>J_(n,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{var p,g;const{editModelSvc:c}=n,u=(p=c==null?void 0:c.getRowValidationModel())==null?void 0:p.getRowValidationMap(),d=(g=c==null?void 0:c.getCellValidationModel())==null?void 0:g.getCellValidationMap(),h=!!u&&u.size>0,f=!!d&&d.size>0;return h||f}},i=this.createTooltipFeature(r,n);if(i)return e.createBean(i,o)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=ft(t.tooltipField)||ft(t.tooltipValueGetter)||ft(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},awe=class extends Pce{createTooltipComp(e,t){const n=Ele(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}},c$={moduleName:"Tooltip",version:ut,beans:[iwe],dynamicBeans:{tooltipFeature:Y2,highlightTooltipFeature:kce,tooltipStateManager:awe},userComponents:{agTooltipComponent:Mce},dependsOn:[zy],css:[rwe]},Hd=class{constructor(e){this.cellValueChanges=e}},Q_=class extends Hd{constructor(e,t,n,o){super(e),this.initialRange=t,this.finalRange=n,this.ranges=o}},lwe=10,u$=class{constructor(e){this.actionStack=[],this.maxStackSize=e||lwe,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}},cwe=class extends We{constructor(){super(...arguments),this.beanName="undoRedo",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.batchEditing=!1,this.bulkEditing=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},n=this.activeCellEdit!==null&&jV(this.activeCellEdit,t),o=this.activeRowEdit!==null&&khe(this.activeRowEdit,t);if(!(n||o||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:i,column:a,oldValue:l,value:c}=e,u={rowPinned:r,rowIndex:i,columnId:a.getColId(),newValue:c,oldValue:l};this.cellValueChanges.push(u)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const n=e.get("undoRedoCellEditingLimit");if(n<=0)return;this.undoStack=new u$(n),this.redoStack=new u$(n),this.addListeners();const o=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:s=>{s.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:o,newColumnsLoaded:o,columnGroupOpened:o,columnRowGroupChanged:o,columnMoved:o,columnPinned:o,columnVisible:o,rowDragEnd:o}),t.whenReady(this,s=>{this.gridBodyCtrl=s.gridBodyCtrl})}getCurrentUndoStackSize(){var e;return((e=this.undoStack)==null?void 0:e.getCurrentStackSize())??0}getCurrentRedoStackSize(){var e;return((e=this.redoStack)==null?void 0:e.getCurrentStackSize())??0}undo(e){const{eventSvc:t,undoStack:n,redoStack:o}=this;t.dispatchEvent({type:"undoStarted",source:e});const s=this.undoRedo(n,o,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:s})}redo(e){const{eventSvc:t,undoStack:n,redoStack:o}=this;t.dispatchEvent({type:"redoStarted",source:e});const s=this.undoRedo(o,n,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:s})}undoRedo(e,t,n,o,s){if(!e)return!1;const r=e.pop();return r!=null&&r.cellValueChanges?(this.processAction(r,i=>i[o],s),r instanceof Q_?this.processRange(r.ranges||[r[n]]):this.processCell(r.cellValueChanges),t.push(r),!0):!1}processAction(e,t,n){for(const o of e.cellValueChanges){const{rowIndex:s,rowPinned:r,columnId:i}=o,a={rowIndex:s,rowPinned:r},l=Ca(this.beans,a);l.displayed&&l.setDataValue(i,t(o),n)}}processRange(e){let t;const n=this.beans.rangeSvc;n.removeAllCellRanges(!0),e.forEach((o,s)=>{if(!o)return;const r=o.startRow,i=o.endRow;s===e.length-1&&(t={rowPinned:r.rowPinned,rowIndex:r.rowIndex,columnId:o.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:i.rowIndex,rowEndPinned:i.rowPinned,columnStart:o.startColumn,columns:o.columns};n.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:n,rowPinned:o}=t,s={rowIndex:n,rowPinned:o},r=Ca(this.beans,s),i={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(i)}setLastFocusedCell(e){const{rowIndex:t,columnId:n,rowPinned:o}=e,{colModel:s,focusSvc:r,rangeSvc:i}=this.beans,a=s.getCol(n);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:o};r.setFocusedCell({...c,forceBrowserFocus:!0}),i==null||i.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Hd(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 Hd(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Hd(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new Q_(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&&ha(n)?e=new Q_(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new Hd(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 Hd(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},uwe=".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}",dwe={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},hwe=class extends Oy{constructor(){super(dwe,[V0]),this.eEditor=dt}initialiseEditor(e){const t=e.value??void 0,n=this.eEditor;n.setValue(t),n.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(n,{fieldValueChanged:s=>this.setAriaLabel(s.selected)})}getValue(){return this.eEditor.getValue()}focusIn(){this.eEditor.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.getLocaleTextFunc(),n=qv(t,e),o=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${o} (${n})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,n=this.getValue();return t?t({value:n,internalErrors:null,cellEditorParams:e}):null}},qy=class extends Oy{constructor(e){super(),this.cellEditorInput=e,this.eEditor=dt}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:n}=this,{cellStartedEdit:o,eventKey:s,suppressPreventDefault:r}=e;n.getInputElement().setAttribute("title",""),t.init(n,e);let i,a=!0;o?(this.focusAfterAttached=!0,s===Oe.BACKSPACE||s===Oe.DELETE?i="":s&&s.length===1?r?a=!1:i=s:(i=t.getStartValue(),s!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,i=t.getStartValue()),a&&i!=null&&n.setStartValue(i),this.addGuiEventListener("keydown",l=>{const{key:c}=l;(c===Oe.PAGE_UP||c===Oe.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){var o,s;const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;hl()||t.getFocusableElement().focus();const n=t.getInputElement();this.highlightAllOnFocus?n.select():(s=(o=this.cellEditorInput).setCaret)==null||s.call(o)}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),n=e.getInputElement();t.focus(),n.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},fwe={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},pwe=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return fwe}getAgComponents(){return[L2]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:o,step:s,colDef:r}=t;n!=null&&e.setMin(n),o!=null&&e.setMax(o),s!=null&&e.setStep(s),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:n}=this,{min:o,max:s,getValidationErrors:r}=n;let i=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(o){const l=o instanceof Date?o:new Date(o);if(t<l){const c=l.toLocaleDateString();i.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(s){const l=s instanceof Date?s:new Date(s);if(t>l){const c=l.toLocaleDateString();i.push(a("maxDateValidation",`Date must be before ${c}`,[c]))}}}return i.length||(i=null),r?r({value:t,cellEditorParams:n,internalErrors:i}):i}getValue(){const{eEditor:e,params:t}=this,n=e.getDate();return!ft(n)&&!ft(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Gs(e,this.includeTime??!1)}},gwe=class extends qy{constructor(){super(new pwe(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},mwe={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},vwe=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return mwe}getAgComponents(){return[L2]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:o,step:s,colDef:r}=t;n!=null&&e.setMin(n),o!=null&&e.setMax(o),s!=null&&e.setStep(s),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,n=e.getInputElement().value,o=this.formatDate(this.parseDate(n??void 0)),{min:s,max:r,getValidationErrors:i}=t;let a=[];if(o){const l=new Date(o),c=this.getLocaleTextFunc();if(s){const u=new Date(s);if(l<u){const d=u.toLocaleDateString();a.push(c("minDateValidation",`Date must be after ${d}`,[d]))}}if(r){const u=new Date(r);if(l>u){const d=u.toLocaleDateString();a.push(c("maxDateValidation",`Date must be before ${d}`,[d]))}}}return a.length||(a=null),i?i({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,n=this.formatDate(t.getDate());return!ft(n)&&!ft(e.value)?e.value:e.parseValue(n??"")}getStartValue(){return Gs(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):ws(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Gs(e??null,this.includeTime??!1)??void 0}},ywe=class extends qy{constructor(){super(new vwe(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},wwe={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},Cwe=class extends Oy{constructor(){super(wwe,[Hle]),this.eEditor=dt}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:n,eventKey:o,maxLength:s,cols:r,rows:i}=e;this.focusAfterAttached=n,t.getInputElement().setAttribute("title",""),t.setMaxLength(s||200).setCols(r||60).setRows(i||10);let a;n?(this.focusAfterAttached=!0,o===Oe.BACKSPACE||o===Oe.DELETE?a="":o&&o.length===1?a=o:(a=this.getStartValue(e),o!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,a=this.getStartValue(e)),a!=null&&t.setValue(a,!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}getStartValue(e){const{value:t}=e;return(t==null?void 0:t.toString())??t}onKeyDown(e){const t=e.key;(t===Oe.LEFT||t===Oe.UP||t===Oe.RIGHT||t===Oe.DOWN||e.shiftKey&&t===Oe.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:n}=this,o=this.getLocaleTextFunc();e.setInputAriaLabel(o("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),n&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:n}=t,o=e.getValue();return!ft(o)&&!ft(n)?n:t.parseValue(o)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,o=this.getLocaleTextFunc(),s=this.getValue();let r=[];return typeof s=="string"&&t!=null&&s.length>t&&r.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:s,internalErrors:r,cellEditorParams:e}):r}},bwe={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},Swe=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return bwe}getAgComponents(){return[Gle]}init(e,t){this.eEditor=e,this.params=t;const{max:n,min:o,precision:s,step:r}=t;n!=null&&e.setMax(n),o!=null&&e.setMin(o),s!=null&&e.setPrecision(s),r!=null&&e.setStep(r);const i=e.getInputElement();t.preventStepping?e.addManagedElementListeners(i,{keydown:this.preventStepping}):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:n,getValidationErrors:o}=e,r=this.eEditor.getInputElement().valueAsNumber,i=this.getLocaleTextFunc();let a=[];return typeof r=="number"&&(t!=null&&r<t&&a.push(i("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),n!=null&&r>n&&a.push(i("maxValueValidation",`Must be less than or equal to ${n}.`,[String(n)]))),a.length||(a=null),o?o({value:r,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===Oe.UP||e.key===Oe.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!ft(n)&&!ft(t.value))return t.value;let o=t.parseValue(n);if(o==null)return o;if(typeof o=="string"){if(o==="")return null;o=Number(o)}return isNaN(o)?null:o}getStartValue(){return this.params.value}setCaret(){hl()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},Ewe=class extends qy{constructor(){super(new Swe(()=>this.getLocaleTextFunc()))}},_we={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},Rwe=class extends Oy{constructor(){super(_we,[Qle]),this.eEditor=dt,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:n,gos:o}=this,{values:s,value:r,eventKey:i}=e;if(Bn(s)){Je(58);return}this.startedByEnter=i!=null?i===Oe.ENTER:!1;let a=!1;s.forEach(d=>{const h={value:d},f=n.formatValue(e.column,null,d),p=f!=null;h.text=p?f:d,t.addOption(h),a=a||r===d}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:u}=e;l!=null&&t.setPickerGap(l),u!=null&&t.setPickerMaxHeight(u),c!=null&&t.setPickerMaxWidth(c),o.get("editType")!=="fullRow"&&this.addManagedListeners(this.eEditor,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eEditor.showPicker()})}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:n}=e,o=this.getValue();let s=[];if(t&&!t.includes(o)){const r=this.getLocaleTextFunc();s.push(r("invalidSelectionValidation","Invalid selection."))}else s=null;return n?n({value:o,internalErrors:s,cellEditorParams:e}):s}},Dwe={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},Twe=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Dwe}getAgComponents(){return[yy]}init(e,t){this.eEditor=e,this.params=t;const n=t.maxLength;n!=null&&e.setMaxLength(n)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,o=this.getValue(),s=this.getLocaleTextFunc();let r=[];return t!=null&&typeof o=="string"&&o.length>t&&r.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:o,cellEditorParams:e,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();return!ft(n)&&!ft(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(){hl()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),n=ft(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},d$=class extends qy{constructor(){super(new Twe(()=>this.getLocaleTextFunc()))}};function Iwe(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function xwe(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function h$(e,t,n="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,n),"ensureVisible")}function f$(e,t,n){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,n),"ensureVisible")}function Fwe(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function Pwe(e){var t;(t=e.undoRedo)==null||t.undo("api")}function kwe(e){var t;(t=e.undoRedo)==null||t.redo("api")}function Awe(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function Owe(e){var o;const t=(o=e.editModelSvc)==null?void 0:o.getEditMap(),n=[];return t==null||t.forEach((s,r)=>{const{rowIndex:i,rowPinned:a}=r;s.forEach((l,c)=>{const{editorValue:u,pendingValue:d,sourceValue:h,state:f}=l,p=ba(l);let g=u??d;g===pr&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:c,colId:c.getColId(),colKey:c.getColId(),rowIndex:i,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function Mwe(e,t=!1){var o;const{editSvc:n}=e;if(n!=null&&n.isBatchEditing()){if(t)for(const s of((o=e.editModelSvc)==null?void 0:o.getEditPositions())??[])s.state==="editing"&&n.revertSingleCellEdit(s);else Lc(e,{persist:!0});Vd(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function Nwe(e,t){var o;const n=zn(e,t);return((o=e.editSvc)==null?void 0:o.isEditing(n))??!1}function Lwe(e,t){const{key:n,colKey:o,rowIndex:s,rowPinned:r}=t,{editSvc:i,colModel:a}=e,l=a.getCol(o);if(!l){Je(12,{colKey:o});return}const u=Ca(e,{rowIndex:s,rowPinned:r||null});if(!u){Je(290,{rowIndex:s,rowPinned:r});return}if(!l.isCellEditable(u))return;r==null&&f$(e,s),h$(e,o),i==null||i.startEditing({rowNode:u,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function Vwe(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function Bwe(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function $we(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var Hwe={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},Gwe=class extends S0{constructor(e){super(Hwe),this.params=e}postConstruct(){Dc(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=o=>{o_(this.gos,o,t.node,t.column,!0)||t.onKeyDown(o)};this.addManagedElementListeners(e,{keydown:n})}};function Uwe(e,{column:t},n,o,s="ui"){var c;if(n instanceof KeyboardEvent&&(n.key===Oe.TAB||n.key===Oe.ENTER||n.key===Oe.F2||n.key===Oe.BACKSPACE&&o))return!0;if((n==null?void 0:n.shiftKey)&&((c=e.rangeSvc)==null?void 0:c.getCellRanges().length)!=0)return!1;const i=t==null?void 0:t.getColDef(),a=Wwe(e.gos,i),l=n==null?void 0:n.type;return l==="click"&&(n==null?void 0:n.detail)===1&&a===1||l==="dblclick"&&(n==null?void 0:n.detail)===2&&a===2?!0:s==="api"?o??!1:!1}function Wwe(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function eR(e,{rowNode:t,column:n},o="ui"){const s=n.getColDef().editable,r=e.editModelSvc;return n.isColumnFunc(t,s)||!!r&&r.hasEdits({rowNode:t,column:n},{withOpenEditor:!0})}function zwe(e,t,n="ui"){const o=eR(e,t,n);return o===!0||n==="ui"?o:e.colModel.getCols().some(r=>eR(e,{rowNode:t.rowNode,column:r},n))}var Yy=(e,t=!1)=>{if(e!==void 0)return ba(e)||t&&e.state==="editing"};function p$(e,t,n=!1){var o;return Yy((o=e.editModelSvc)==null?void 0:o.getEdit(t),n)}var g$=(e,t,n)=>{if(e)for(let o=0,s=e.length;o<s;++o){const r=e[o];if(r.data&&(Yy(t==null?void 0:t.getEdit({rowNode:r,column:n}))||Yy(t==null?void 0:t.getEdit({rowNode:r.pinnedSibling,column:n})))||g$(r.childrenAfterGroup,t,n))return!0}};function m$(e,t){const{column:n,rowNode:o}=t;return e.gos.get("groupTotalRow")&&!(o!=null&&o.footer)?!1:g$(o==null?void 0:o.childrenAfterGroup,e.editModelSvc,n)}function v$(e,{rowNode:t,column:n}){var o;if(t=t.pinnedSibling,!!t)return Yy((o=e.editModelSvc)==null?void 0:o.getEdit({rowNode:t,column:n}))}var jwe=class extends We{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}setComp(e){this.cellComp=e,this.applyCellStyles()}applyCellStyles(){var s;const{cellCtrl:e,editSvc:t,beans:n}=this;if(t!=null&&t.isBatchEditing()&&t.isEditing()){const r=p$(n,e)||m$(n,e)||v$(n,e);this.applyBatchingStyle(r)}else this.applyBatchingStyle(!1);const o=!!((s=this.editModelSvc)!=null&&s.getCellValidationModel().hasCellValidation(this.cellCtrl));this.cellComp.toggleCss("ag-cell-editing-error",o)}applyBatchingStyle(e){var t;this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&((t=this.editSvc)==null?void 0:t.isBatchEditing()))??!1)}},Kwe=class extends We{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){var i;const{rowCtrl:e,editModelSvc:t,beans:n}=this;let o=e.rowNode,s=t==null?void 0:t.getEditRow(o);const r=(i=this.editModelSvc)==null?void 0:i.getRowValidationModel().hasRowValidation({rowNode:o});if(!s&&o.pinnedSibling&&(o=o.pinnedSibling,s=t==null?void 0:t.getEditRow(o)),s){const a=Array.from(s.keys()).some(l=>{const c={rowNode:o,column:l};return p$(n,c,!0)||m$(n,c)||v$(n,c)});this.applyStyle(r,a);return}this.applyStyle(r)}applyStyle(e=!1,t=!1){var s,r;const n=((s=this.editSvc)==null?void 0:s.isBatchEditing())??!1,o=this.gos.get("editType")==="fullRow";(r=this.rowCtrl)==null||r.forEachGui(void 0,({rowComp:i})=>{i.toggleCss("ag-row-editing",o&&t),i.toggleCss("ag-row-batch-edit",o&&t&&n),i.toggleCss("ag-row-inline-editing",t),i.toggleCss("ag-row-not-inline-editing",!t),i.toggleCss("ag-row-editing-invalid",o&&t&&e)})}},qwe=({rowModel:e,pinnedRowModel:t,editModelSvc:n},o)=>{const s=new Set;e.forEachNode(r=>o.has(r)&&s.add(r)),t==null||t.forEachPinnedRow("top",r=>o.has(r)&&s.add(r)),t==null||t.forEachPinnedRow("bottom",r=>o.has(r)&&s.add(r));for(const r of o)s.has(r)||n.removeEdits({rowNode:r});return s},Ywe=({editModelSvc:e},t,n)=>{var o;for(const s of t)(o=e==null?void 0:e.getEditRow(s))==null||o.forEach((r,i)=>!n.has(i)&&e.removeEdits({rowNode:s,column:i}))},Zwe=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),o=new Set(n.keys());Ywe(e,qwe(e,o),t)},Xwe=new Set(["undo","redo","paste","bulk","rangeSvc"]),Jwe=new Set(["ui","api"]),y$={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},Qwe=new Set(Object.keys(y$)),eCe=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Zy={cancel:!0,source:"api"},tCe={cancel:!1,source:"api"},Gd={checkSiblings:!0},Fp={force:!0,suppressFlash:!0},nCe=class extends We{constructor(){super(...arguments),this.beanName="editSvc",this.batch=!1,this.stopping=!1,this.committing=!1}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:o})=>{this.stopEditing(void 0,Zy),this.createStrategy(o)});const t=Zwe(e),n=()=>{const o=this.model.getCellValidationModel().getCellValidationMap().size>0,s=this.model.getRowValidationModel().getRowValidationMap().size>0;return o||s?this.stopEditing(void 0,Zy):this.isEditing()&&(this.isBatchEditing()?Vd(e,this.model.getEditPositions()):this.stopEditing(void 0,tCe)),!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,Zy)):(this.stopEditing(void 0,Zy),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:o}=this,s=w$(n,e);if(o){if(o.beanName===s)return o;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(s,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,n,o="ui"){const s=Uwe(this.beans,e,t,n,o);return s&&(this.strategy??(this.strategy=this.createStrategy())),s}shouldStopEditing(e,t,n="ui"){var o;return((o=this.strategy)==null?void 0:o.shouldStop(e,t,n))??null}shouldCancelEditing(e,t,n="ui"){var o;return((o=this.strategy)==null?void 0:o.shouldCancel(e,t,n))??null}validateEdit(){return vme(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??Gd)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:n=!0,event:o=null,source:s="ui",ignoreEventKey:r=!1,silent:i}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=zn(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,o,n,s);if(l===!1&&s!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,s)&&!t.continueEditing&&this.stopEditing(void 0,{source:s}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:o,source:s,ignoreEventKey:r,startedEdit:n,silent:i})}stopEditing(e,t){var v,w,S;const{event:n,cancel:o,source:s="ui",forceCancel:r,forceStop:i}=t||{},{beans:a,model:l}=this;if(Qwe.has(s)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const c=this.committing?y$[s]:s;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,Gd))||!this.strategy||this.stopping)return!1;this.stopping=!0;const d=zn(a,e);d&&(d.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),f=!1;const p=!o&&(!!this.shouldStopEditing(e,n,c)||this.committing&&!this.batch)||(i??!1),g=o&&!!this.shouldCancelEditing(e,n,c)||(r??!1);if(p||g){Lc(a,{persist:!0,isCancelling:g||o,isStopping:p});const b=l.getEditMap(),C=this.processEdits(b,o,s);(v=this.strategy)==null||v.stop(o,n);for(const _ of C)l.clearEditValue(_);this.bulkRefresh(void 0,h);for(const _ of l.getEditPositions(b)){const E=zn(a,_),I=ba(_);E==null||E.refreshCell({force:!0,suppressFlash:!I})}h=b,f||(f=p)}else if(n instanceof KeyboardEvent&&this.batch&&((w=this.strategy)!=null&&w.midBatchInputsAllowed(e))&&this.isEditing(e,{withOpenEditor:!0})){const{key:b}=n,C=b===Oe.ENTER,_=b===Oe.ESCAPE,E=b===Oe.TAB;(C||E||_)&&(C||E?Lc(a,{persist:!0}):_&&this.revertSingleCellEdit(d),this.isBatchEditing()?(S=this.strategy)==null||S.cleanupEditors():Vd(a,l.getEditPositions(),{event:n,cancel:_}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else Lc(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),A_(a),this.model.hasEdits()||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()),this.bulkRefresh(),g&&this.beans.rowRenderer.refreshRows({rowNodes:Array.from(h.keys())}),this.isBatchEditing()&&(this.beans.rowRenderer.refreshRows({suppressFlash:!0,force:!0}),f&&p&&this.dispatchBatchEvent("batchEditingStopped",h)),this.stopping=!1,f}navigateAfterEdit(e,t){var c;if(!e||!t)return;const{event:n,suppressNavigateAfterEdit:o}=e;if(!(n instanceof KeyboardEvent)||o)return;const{key:r,shiftKey:i}=n,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(r!==Oe.ENTER||!a)return;const l=i?Oe.UP:Oe.DOWN;(c=this.beans.navigation)==null||c.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,n){const o=Array.from(e.keys()),s=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,r=[];for(const i of o){const a=e.get(i);for(const l of a.keys()){const c=a.get(l),u={rowNode:i,column:l},d=ba(c);!t&&d&&!s&&(this.setNodeDataValue(i,l,c.pendingValue,void 0,n)||r.push(u))}}return r}setNodeDataValue(e,t,n,o,s="edit"){const{beans:r}=this,i=zn(r,{rowNode:e,column:t}),a=Jwe.has(s)?"edit":s;i&&(i.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,n,a);return i&&(i.suppressRefreshCell=!1),o&&(i==null||i.refreshCell(Fp)),l}setEditMap(e,t){var o;this.strategy??(this.strategy=this.createStrategy()),(o=this.strategy)==null||o.setEditMap(e,t),this.bulkRefresh();let n=Fp;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...oCe(e),...Fp}),this.beans.rowRenderer.refreshCells(n)}dispatchEditValuesChanged({rowNode:e,column:t},n={}){if(!e||!t||!n)return;const{pendingValue:o,sourceValue:s}=n,{rowIndex:r,rowPinned:i,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:r,rowPinned:i,column:t,source:"api",data:a,newValue:o,oldValue:s,value:o,colDef:t.getColDef()})}bulkRefresh(e={},t,n={}){var a;const{beans:o,gos:s}=this,{editModelSvc:r,rowModel:i}=o;ro(s)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),n):t&&((a=r==null?void 0:r.getEditMap(!1))==null||a.forEach((l,c)=>{for(const u of l.keys())this.refCell({rowNode:c,column:u},l.get(u),n)})))}refCell({rowNode:e,column:t},n,o={}){var d,h,f;const{beans:s,gos:r}=this,i=new Set([e]),a=new Set,l=e.pinnedSibling;l&&i.add(l);const c=e.sibling;c&&a.add(c);let u=e.parent;for(;u;)(d=u.sibling)!=null&&d.footer&&r.get("groupTotalRow")||!u.parent&&u.sibling&&r.get("grandTotalRow")?a.add(u.sibling):a.add(u),u=u.parent;for(const p of i)this.dispatchEditValuesChanged({rowNode:p,column:t},n);for(const p of i)(h=zn(s,{rowNode:p,column:t}))==null||h.refreshCell(o);for(const p of a)(f=zn(s,{rowNode:p,column:t}))==null||f.refreshCell(o)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:n}=e,{gos:o,beans:s}=this;if(n.group){if(o.get("treeData")){if(!n.data&&!o.get("enableGroupEdit"))return!1}else if(!o.get("enableGroupEdit"))return!1}const r=w$(o)==="fullRow"?zwe(s,e,t):eR(s,e,t);return r&&(this.strategy??(this.strategy=this.createStrategy())),r}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,n=!0){var o,s,r,i;if(this.hasValidationErrors(e)){const a=zn(this.beans,e);return this.cellEditingInvalidCommitBlocks()?((o=t==null?void 0:t.preventDefault)==null||o.call(t),n&&(!(a!=null&&a.hasBrowserFocus())&&(a==null||a.focusCell()),(i=(r=(s=a==null?void 0:a.comp)==null?void 0:s.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)),"block-stop"):(a&&this.revertSingleCellEdit(a),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){var o,s,r,i;const n=zn(this.beans,e);(o=n==null?void 0:n.comp)!=null&&o.getCellEditor()&&(Vd(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),Ld(this.beans,e,{silent:!0}),Vc(this.beans),n==null||n.refreshCell(Fp),t&&(n==null||n.focusCell(),(i=(r=(s=n==null?void 0:n.comp)==null?void 0:s.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)))}hasValidationErrors(e){var o;Vc(this.beans);const t=zn(this.beans,e);t&&(t.refreshCell(Fp),(o=t.rowCtrl.rowEditStyleFeature)==null||o.applyRowStyles());let n=!1;return e!=null&&e.rowNode?(n||(n=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(n||(n=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(n||(n=this.model.getCellValidationModel().getCellValidationMap().size>0),n||(n=this.model.getRowValidationModel().getRowValidationMap().size>0)),n}moveToNextCell(e,t,n,o="ui"){var a;let s;const r=this.isEditing(),i=r&&this.checkNavWithValidation(void 0,n)==="block-stop";return e instanceof Bd&&r&&(s=(a=this.strategy)==null?void 0:a.moveToNextEditingCell(e,t,n,o,i)),s===null||(s=s||!!this.beans.focusSvc.focusedHeader,s===!1&&!i&&this.stopEditing()),s}getCellDataValue({rowNode:e,column:t},n=!0){if(!e||!t)return;let o=this.model.getEdit({rowNode:e,column:t});const s=e.pinnedSibling;if(s){const i=this.model.getEdit({rowNode:s,column:t});i&&(o=i)}const r=n?(o==null?void 0:o.editorValue)??(o==null?void 0:o.pendingValue):o==null?void 0:o.pendingValue;return r===pr||!o?(o==null?void 0:o.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):r}addStopEditingWhenGridLosesFocus(e){dme(this,this.beans,e)}createPopupEditorWrapper(e){return new Gwe(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var o;try{if((!this.isEditing()||this.committing)&&!eCe.has(n))return;const{beans:s}=this;this.strategy??(this.strategy=this.createStrategy());const r=this.isBatchEditing()?"ui":this.committing?n??"api":"api";if(!n||Xwe.has(n))return Hy(s,e,t,n,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,n);const i=this.model.getEdit(e);if(i){if(i.pendingValue===t)return!1;if(i.sourceValue!==t)return Hy(s,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0;if(i.sourceValue===t)return(o=s.editModelSvc)==null||o.removeEdits(e),this.dispatchEditValuesChanged(e,{...i,pendingValue:t}),!0}return Hy(s,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){pme(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,Gd))return;const{rowNode:o,column:s}=e,{compDetails:r,valueToDisplay:i}=t;if(r){const{params:l}=r;return l.data=this.model.getEditRowDataValue(o,Gd),{compDetails:r}}const a=this.model.getEditRow(e.rowNode,Gd);if(i!==void 0&&(a!=null&&a.has(s)))return{valueToDisplay:this.valueSvc.getValue(s,o)}}cleanupEditors(){var e;(e=this.strategy)==null||e.cleanupEditors()}dispatchCellEvent(e,t,n,o){var s;(s=this.strategy)==null||s.dispatchCellEvent(e,t,n,o)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return Pt(this.gos,{type:e,...e==="batchEditingStopped"?{changes:this.toEventChangeList(t)}:{}})}toEventChangeList(e){return this.model.getEditPositions(e).map(t=>({rowIndex:t.rowNode.rowIndex,rowPinned:t.rowNode.rowPinned,columnId:t.column.getColId(),newValue:t.pendingValue,oldValue:t.sourceValue}))}applyBulkEdit({rowNode:e,column:t},n){var c,u;if(!n||n.length===0)return;const{beans:o,rangeSvc:s,valueSvc:r}=this;Lc(o,{persist:!0});const i=this.model.getEditMap(!0),a=(u=(c=i.get(e))==null?void 0:c.get(t))==null?void 0:u.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(s==null||s.forEachRowInRange(d,h=>{const f=Ca(o,h);if(f===void 0)return;const p=i.get(f)??new Map;for(const g of d.columns)if(g&&this.isCellEditable({rowNode:f,column:g},"api")){const v=r.getValue(g,f,!0,"api");let w=r.parseValue(g,f??null,a,v);Number.isNaN(w)&&(w=null),p.set(g,{editorValue:void 0,pendingValue:w,sourceValue:v,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}p.size>0&&i.set(f,p)}),this.setEditMap(i),this.batch){this.cleanupEditors(),A_(o),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(i)})}),this.bulkRefresh();const l=zn(o,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new jwe(e,t)}createRowStyleFeature(e,t){return new Kwe(e,t)}setEditingCells(e,t){const{beans:n}=this,{colModel:o,valueSvc:s}=n,r=new Map;for(let{colId:i,column:a,colKey:l,rowIndex:c,rowPinned:u,newValue:d,state:h}of e){const f=i?o.getCol(i):l?o.getCol(l):a;if(!f)continue;const p=Ca(n,{rowIndex:c,rowPinned:u});if(!p)continue;const g=s.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!ba({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=r.get(p);v||(v=new Map,r.set(p,v)),d===void 0&&(d=pr),v.set(f,{editorValue:void 0,pendingValue:d,sourceValue:g,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(r,t)}onCellFocused(e){var r;const t=zn(this.beans,e);if(!t||!this.isEditing(t,Gd))return;const n=this.model.getEdit(t);if(!n||!ba(n))return;const s=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(r=this.beans.ariaAnnounce)==null||r.announceValue(s,"pendingChange")}allowedFocusTargetOnValidation(e){return zn(this.beans,e)}};function oCe(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 w$(e,t){return t??e.get("editType")??"singleCell"}var C$=class extends We{postConstruct(){var e,t;this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:(e=this.onCellFocusChanged)==null?void 0:e.bind(this),cellFocusCleared:(t=this.onCellFocusChanged)==null?void 0:t.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const n=e.previousParams,{editSvc:o,beans:s}=this,r=e.type==="cellFocused"?e.sourceEvent:null;n&&(t=zn(s,n));const{gos:i,editModelSvc:a}=s,l=e.type==="cellFocusCleared";if(o.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:u,rowPinned:d}=e,h={column:c,rowNode:Ca(s,{rowIndex:u,rowPinned:d})},f=i.get("invalidEditValueMode")==="block";if(f)return;const p=!f,g=!!(a!=null&&a.getCellValidationModel().hasCellValidation(h)),v=p&&g;(n||l?o.stopEditing(void 0,{cancel:v,source:l&&p?"api":void 0,event:r}):!0)||(o.isBatchEditing()?o.cleanupEditors():o.stopEditing(void 0,{source:"api"}))}t==null||t.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){var s,r;const n=this.model.getEditPositions(),o={all:[],pass:[],fail:[]};for(const i of n){o.all.push(i);const a=this.model.getCellValidationModel().getCellValidation(i);if((((s=a==null?void 0:a.errorMessages)==null?void 0:s.length)??0)>0){o.fail.push(i);continue}o.pass.push(i)}if(e)for(const i of n)Gy(this.beans,i,{cancel:e}),this.model.stop(i);else{const i=this.processValidationResults(o);if(i.destroy.length>0)for(const a of i.destroy)Gy(this.beans,a,{event:t,cancel:e}),this.model.stop(a);if(i.keep.length>0)for(const a of i.keep){const l=zn(this.beans,a);(r=this.editSvc)!=null&&r.cellEditingInvalidCommitBlocks()||l&&this.editSvc.revertSingleCellEdit(l)}}return!0}cleanupEditors({rowNode:e}={},t){Lc(this.beans,{persist:!1});const n=this.model.getEditPositions(),o=[];if(e)for(const s of n)s.rowNode!==e&&o.push(s);else for(const s of n)o.push(s);Vd(this.beans,o),A_(this.beans,t)}setFocusOutOnEditor(e){var t,n,o;(o=(n=(t=e.comp)==null?void 0:t.getCellEditor())==null?void 0:n.focusOut)==null||o.call(n)}setFocusInOnEditor(e){const t=e.comp,n=t==null?void 0:t.getCellEditor();if(n!=null&&n.focusIn)n.focusIn();else{const o=this.beans.gos.get("editType")==="fullRow";e.focusCell(o),e.onEditorAttachedFuncs.push(()=>{var s,r;return(r=(s=t==null?void 0:t.getCellEditor())==null?void 0:s.focusIn)==null?void 0:r.call(s)})}}setupEditors(e){const{event:t,ignoreEventKey:n=!1,startedEdit:o,position:s,cells:r=this.model.getEditPositions()}=e,i=t instanceof KeyboardEvent&&!n&&t.key||void 0;fme(this.beans,r,s,i,t,o)}dispatchCellEvent(e,t,n,o){const s=zn(this.beans,e);s&&this.eventSvc.dispatchEvent({...s.createEvent(t??null,n),...o})}dispatchRowEvent(e,t,n){if(n)return;const o=P_(this.beans,e);o&&this.eventSvc.dispatchEvent(o.createRowEvent(t))}shouldStop(e,t,n="ui"){const o=this.editSvc.isBatchEditing();return o&&n==="api"?!0:o&&(n==="ui"||n==="edit")?!1:n==="api"?!0:t instanceof KeyboardEvent&&!o?t.key===Oe.ENTER:null}shouldCancel(e,t,n="ui"){const o=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!o&&t.key===Oe.ESCAPE||o&&n==="api"||n==="api")}setEditMap(e,t){var o;t!=null&&t.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const n=[];if(e.forEach((s,r)=>{s.forEach((i,a)=>{i.state==="editing"&&n.push({...i,rowNode:r,column:a})})}),t!=null&&t.update&&(e=new Map([...this.model.getEditMap(),...e])),(o=this.model)==null||o.setEditMap(e),n.length>0){const s=n.at(-1),r=s.pendingValue===pr?void 0:s.pendingValue;this.start({position:s,event:new KeyboardEvent("keydown",{key:r}),source:"api"});const i=zn(this.beans,s);i&&this.setFocusInOnEditor(i)}}destroy(){this.cleanupEditors(),super.destroy()}},sCe=class extends C${constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:o}=e||{};if(!P_(this.beans,{rowNode:this.rowNode}))return!0;const r=super.shouldStop({rowNode:this.rowNode},t,n);return r!==null?r:this.rowNode?o!==this.rowNode:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:n,startedEdit:o,event:s,ignoreEventKey:r}=e,{rowNode:i}=t;this.rowNode!==i&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],c=[];for(const u of a)u.isCellEditable(i)&&c.push(u);if(c.length!=0){this.dispatchRowEvent({rowNode:i},"rowEditingStarted",n),this.startedRows.push(i);for(const u of c){const d={rowNode:i,column:u};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=i,this.setupEditors({cells:l,position:t,startedEdit:o,event:s,ignoreEventKey:r})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){var s;const{rowNode:n}=this;if(n&&!this.model.hasRowEdits(n))return!1;const o=[];if(e||this.model.getEditMap().forEach((r,i)=>{if(!(!r||r.size===0)){for(const a of r.values())if(ba(a)){o.push(i);break}}}),Vc(this.beans),!e&&((s=this.editSvc)==null?void 0:s.checkNavWithValidation({rowNode:n}))==="block-stop")return!1;super.stop(e,t);for(const r of o)this.dispatchRowEvent({rowNode:r},"rowValueChanged");return this.cleanupEditors({rowNode:n},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,n=e.previousParams;if((n==null?void 0:n.rowIndex)===t||e.sourceEvent instanceof KeyboardEvent)return;const o=zn(this.beans,n);this.gos.get("invalidEditValueMode")==="block"&&o&&(this.model.getCellValidationModel().getCellValidation(o)||this.model.getRowValidationModel().getRowValidation(o))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);for(const n of this.startedRows)this.dispatchRowEvent({rowNode:n},"rowEditingStopped");this.startedRows.length=0}moveToNextEditingCell(e,t,n,o="ui",s=!1){var h,f,p,g;const r=e.cellPosition;let i;this.model.suspend(!0);try{i=(h=this.beans.navigation)==null?void 0:h.findNextCellToFocusOn(r,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(i===!1)return null;if(i==null)return!1;const a=i.cellPosition,l=e.isCellEditable(),c=i.isCellEditable(),u=a&&r.rowIndex===a.rowIndex&&r.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return c&&!s?d?i.focusCell(!0,n):((f=i.comp)!=null&&f.getCellEditor()||Ld(this.beans,i,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(i),i.focusCell(!1,n)):(c&&s&&this.setFocusInOnEditor(i),i.focusCell(!0,n)),!u&&!s&&((p=this.editSvc)==null||p.stopEditing({rowNode:e.rowNode},{event:n}),this.cleanupEditors(i,!0),d?i.focusCell(!0,n):this.editSvc.startEditing(i,{startedEdit:!0,event:n,source:o,ignoreEventKey:!0})),(g=e.rowCtrl)==null||g.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:n},o)=>{var r;if(n!=="editing")return;const s=zn(this.beans,{rowNode:t,column:o});s&&!((r=s.comp)!=null&&r.getCellEditor())&&Ld(this.beans,s,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},rCe=class extends C${constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,n="ui"){const o=super.shouldStop(e,t,n);if(o!==null)return o;const{rowNode:s,column:r}=e||{};return(!this.rowNode||!this.column)&&s&&r?null:this.rowNode!==s||this.column!==r}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:n,event:o,ignoreEventKey:s}=e;(this.rowNode!==t.rowNode||this.column!==t.column)&&super.cleanupEditors(),this.rowNode=t.rowNode,this.column=t.column,this.model.start(t),this.setupEditors({cells:[t],position:t,startedEdit:n,event:o,ignoreEventKey:s})}dispatchRowEvent(e,t,n){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){return super.stop(e,t),this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:n}=this.beans,{rowIndex:o,column:s,rowPinned:r}=e,i=Ca(this.beans,{rowIndex:o,rowPinned:r}),a=k_(s),l=t.getCol(a),c=e.previousParams;if(c){const u=k_(c.column);if((c==null?void 0:c.rowIndex)===o&&u===a&&(c==null?void 0:c.rowPinned)===r)return}n!=null&&n.isEditing({rowNode:i,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,n,o="ui",s=!1){var p,g,v,w,S,b;const r=this.beans.focusSvc.getFocusedCell();r&&(e=Md(this.beans,r)??e);const i=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),s||(e.eGui.focus(),(g=this.editSvc)==null||g.stopEditing(e,{source:(p=this.editSvc)!=null&&p.isBatchEditing()?"ui":"api",event:n}));try{a=(v=this.beans.navigation)==null?void 0:v.findNextCellToFocusOn(i,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,u=e.isCellEditable(),d=a.isCellEditable(),h=c&&i.rowIndex===c.rowIndex&&i.rowPinned===c.rowPinned;u&&!s&&this.setFocusOutOnEditor(e);const f=this.gos.get("suppressStartEditOnTab");if(!h&&!s&&(super.cleanupEditors(a,!0),f?a.focusCell(!0,n):this.editSvc.startEditing(a,{startedEdit:!0,event:n,source:o,ignoreEventKey:!0})),d&&!s){if(a.focusCell(!1,n),f)a.focusCell(!0,n);else if(!((w=a.comp)!=null&&w.getCellEditor())){const C=(S=this.editSvc)==null?void 0:S.isEditing(a,{withOpenEditor:!0});Ld(this.beans,a,{event:n,cellStartedEdit:!0,silent:C}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else d&&s&&this.setFocusInOnEditor(a),a.focusCell(!0,n);return(b=e.rowCtrl)==null||b.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},Cl={moduleName:"EditCore",version:ut,beans:[ume,nCe],apiFunctions:{getEditingCells:Owe,getEditRowValues:Awe,getCellEditorInstances:hme,startEditingCell:Lwe,stopEditing:Mwe,isEditing:Nwe,validateEdit:Vwe},dynamicBeans:{singleCell:rCe,fullRow:sCe},dependsOn:[zy,c$],css:[uwe]},iCe={moduleName:"UndoRedoEdit",version:ut,beans:[cwe],apiFunctions:{undoCellEditing:Pwe,redoCellEditing:kwe,getCurrentUndoSize:Bwe,getCurrentRedoSize:$we},dependsOn:[Cl]},aCe={moduleName:"TextEditor",version:ut,userComponents:{agCellEditor:d$,agTextCellEditor:d$},dependsOn:[Cl]},lCe={moduleName:"NumberEditor",version:ut,userComponents:{agNumberCellEditor:{classImp:Ewe}},dependsOn:[Cl]},cCe={moduleName:"DateEditor",version:ut,userComponents:{agDateCellEditor:gwe,agDateStringCellEditor:ywe},dependsOn:[Cl]},uCe={moduleName:"CheckboxEditor",version:ut,userComponents:{agCheckboxCellEditor:hwe},dependsOn:[Cl]},dCe={moduleName:"SelectEditor",version:ut,userComponents:{agSelectCellEditor:Rwe},dependsOn:[Cl]},hCe={moduleName:"LargeTextEditor",version:ut,userComponents:{agLargeTextCellEditor:Cwe},dependsOn:[Cl]},fCe={moduleName:"CustomEditor",version:ut,dependsOn:[Cl]},pCe=class extends We{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,Dd(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),Rae(e))}createColumns(e,t){var h,f;const n=()=>{var p;dy(this.beans,(p=this.columns)==null?void 0:p.tree),this.columns=null},o=e.treeDepth,r=(((h=this.columns)==null?void 0:h.treeDepth)??-1)==o,i=this.generateSelectionCols();if(_ae(i,((f=this.columns)==null?void 0:f.list)??[])&&r)return;n();const{colGroupSvc:l}=this.beans,c=(l==null?void 0:l.findDepth(e.tree))??0,u=(l==null?void 0:l.balanceTreeForAutoCols(i,c))??[];this.columns={list:i,tree:u,treeDepth:c,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!pa(v));return[...i,...g]})}updateColumns(e){var n;const t=Dd(e.source);for(const o of((n=this.columns)==null?void 0:n.list)??[]){const s=this.createSelectionColDef(e.currentValue);o.setColDef(s,null,t),Ur(this.beans,{state:[{...s,colId:o.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>hp(n,e)))??null}getColumns(){var e;return((e=this.columns)==null?void 0:e.list)??null}isSelectionColumnEnabled(){var i,a;const{gos:e,beans:t}=this,n=e.get("rowSelection");if(typeof n!="object"||!_c(e))return!1;const o=(((a=(i=t.autoColSvc)==null?void 0:i.getColumns())==null?void 0:a.length)??0)>0;if(n.checkboxLocation==="autoGroupColumn"&&o)return!1;const s=!!Rd(n),r=ry(n);return s||r}createSelectionColDef(e){const{gos:t}=this,n=e??t.get("selectionColumnDef"),o=t.get("enableRtl"),{rowSpan:s,spanRows:r,...i}=n??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:o?"right":"left",comparator(a,l,c,u){const d=c.isSelected(),h=u.isSelected();return d===h?0:d?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...i,colId:l2,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new Tc(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const o=t&&typeof t!="string"?Rd(t):void 0,s=e&&typeof e!="string"?Rd(e):void 0,r=o!==s,i=t&&typeof t!="string"?ry(t):void 0,a=e&&typeof e!="string"?ry(e):void 0,l=i!==a,c=iy(e),u=iy(t);(r||l||c!==u)&&this.beans.colModel.refreshAll(n)}destroy(){var e;dy(this.beans,(e=this.columns)==null?void 0:e.tree),super.destroy()}refreshVisibility(e,t,n){var l,c;if(!((l=this.columns)!=null&&l.list.length))return;const o=e.length+t.length+n.length;if(o===0)return;const s=this.columns.list[0];if(!s.isVisible())return;const r=()=>{let u;switch(s.pinned){case"left":case!0:u=e;break;case"right":u=n;break;default:u=t}u&&Gr(u,s)};(((c=this.beans.rowNumbersSvc)==null?void 0:c.getColumn(c2))?2:1)===o&&r()}};function gCe(e,t){var i;if(!t.nodes.every(a=>a.rowPinned&&!bp(a)?(Je(59),!1):a.id===void 0?(Je(60),!1):!0))return;const{nodes:o,source:s,newValue:r}=t;(i=e.selectionSvc)==null||i.setNodesSelected({nodes:o,source:s??"api",newValue:r})}function mCe(e,t,n="apiSelectAll"){var o;(o=e.selectionSvc)==null||o.selectAllRowNodes({source:n,selectAll:t})}function vCe(e,t,n="apiSelectAll"){var o;(o=e.selectionSvc)==null||o.deselectAllRowNodes({source:n,selectAll:t})}function yCe(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function wCe(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function CCe(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function bCe(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function SCe(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function ECe(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var _Ce=class extends Lde{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=ay(e),this.groupSelectsDescendants=up(e),this.groupSelectsFiltered=ly(e)==="filteredDescendants",this.masterSelectsDetail=o2(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=up(e),n=ay(e),o=ly(e)==="filteredDescendants";this.masterSelectsDetail=o2(e)==="detail",(t!==this.groupSelectsDescendants||o!==this.groupSelectsFiltered||n!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=o,this.mode=n)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,n){if(this.isRowSelectionBlocked(t))return 0;const o=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,n);if(o==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in o)return o.reset?this.resetNodes():this.selectRange(o.deselect,!1,n),this.selectRange(o.select,!0,n);{const s=o.checkFilteredNodes?S$(o.node):o.newValue;return this.setNodesSelected({nodes:[o.node],newValue:s,clearSelection:o.clearSelection,keepDescendants:o.keepDescendants,event:e,source:n})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:n,nodes:o,event:s,source:r,keepDescendants:i=!1}){var c;if(o.length===0)return 0;const{gos:a}=this;if(!_c(a)&&e)return Je(132),0;if(o.length>1&&!this.isMultiSelect())return Je(130),0;let l=0;for(let u=0;u<o.length;u++){const d=o[u],h=Ud(d);if(h.rowPinned&&!bp(h)){Je(59);continue}if(h.id===void 0){Je(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,s,r)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((c=h.childrenAfterGroup)!=null&&c.length)&&(l+=this.selectChildren(h,e,r))}return n||(o.length===1&&r==="api"&&this.selectionCtx.setRoot(Ud(o[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(Ud(o[0]),i,r)),l>0&&(this.updateGroupsFromChildrenSelections(r),this.dispatchSelectionChanged(r))),l}selectRange(e,t,n){let o=0;return e.forEach(s=>{const r=Ud(s);if(r.group&&this.groupSelectsDescendants)return;this.selectRowNode(r,t,void 0,n)&&o++}),o>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n)),o}selectChildren(e,t,n){const o=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return o?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:n,nodes:o}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((n,o)=>{e(n)&&t.set(o,n)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:n,rowModel:o}=this.beans;if(!ro(n))return!1;const s=o.rootNode;if(!s)return!1;t||(t=new Ep(!0,s),t.active=!1);let r=!1;return t.forEachChangedNodeDepthFirst(i=>{if(i!==s){const a=this.calculateSelectedFromChildren(i);r=this.selectRowNode(i,a===null?!1:a,void 0,e)||r}}),r}clearOtherNodes(e,t,n){const o=new Map;let s=0;return this.selectedNodes.forEach(r=>{const i=r.id==e.id;if((t?!DCe(e,r):!0)&&!i){const l=this.selectedNodes.get(r.id);s+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:n}),this.groupSelectsDescendants&&r.parent&&o.set(r.parent.id,r.parent)}}),o.forEach(r=>{const i=this.calculateSelectedFromChildren(r);this.selectRowNode(r,i===null?!1:i,void 0,n)}),s}onRowSelected(e){const t=e.node;this.groupSelectsDescendants&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}createDaemonNode(e){if(!e.id)return;const t=new pl(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(!ro(e))return;const n=t.getTopLevelNodes();if(n===null)return;const o=[];function s(r){for(let i=0,a=r.length;i<a;i++){const l=r[i];l.isSelected()?o.push(l):l.group&&l.childrenAfterGroup&&s(l.childrenAfterGroup)}}return s(n),o}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const n=ro(this.gos);let o=!1;const s=r=>{const i=this.selectRowNode(Ud(r),!1,void 0,e);o||(o=i)};if(t==="currentPage"||t==="filtered"){if(!n){_n(102);return}this.getNodesToSelect(t).forEach(s)}else this.selectedNodes.forEach(s),this.reset(e);if(this.selectionCtx.selectAll=!1,n&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(e);o||(o=r)}o&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,n=0;return this.getNodesToSelect(e).forEach(o=>{this.groupSelectsDescendants&&o.group||(o.isSelected()?t++:o.selectable&&n++)}),{selectedCount:t,notSelectedCount:n}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:n}=this.getSelectedCounts(e);return b$(t,n)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],n=s=>t.push(s);if(e==="currentPage")return this.forEachNodeOnPage(s=>{if(!s.group){n(s);return}if(!s.expanded&&!s.footer){const r=i=>{var a;n(i),(a=i.childrenAfterFilter)==null||a.forEach(r)};r(s);return}this.groupSelectsDescendants||n(s)}),t;const o=this.beans.rowModel;return e==="filtered"?(o.forEachNodeAfterFilter(n),t):(o.forEachNode(n),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:n}=this.beans,o=t.getFirstRow(),s=t.getLastRow();for(let r=o;r<=s;r++){const i=n.getRow(r);i&&e(i)}}selectAllRowNodes(e){const{gos:t,selectionCtx:n}=this;if(!_c(t)){Je(132);return}if(dae(t)&&!cp(t)){Je(130);return}if(!this.canSelectAll())return;const{source:o,selectAll:s}=e;let r=!1;if(this.getNodesToSelect(s).forEach(i=>{const a=this.selectRowNode(Ud(i),!0,void 0,o);r||(r=a)}),n.selectAll=!0,ro(t)&&this.groupSelectsDescendants){const i=this.updateGroupsFromChildrenSelections(o);r||(r=i)}r&&this.dispatchSelectionChanged(o)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,n){if(e||(e=[]),!Array.isArray(e)){_n(103);return}const o=new Set(e),s=[];this.beans.rowModel.forEachNode(r=>{o.has(r.id)&&s.push(r)}),n&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:s,source:t})}canSelectAll(){return ro(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!_c(t))return;const o="selectableChanged",s=e!==void 0,r=ro(t)&&this.groupSelectsDescendants,i=[],a=c=>{var d;if(s&&!c.group)return;if(r&&c.group){const h=((d=c.childrenAfterGroup)==null?void 0:d.some(f=>f.selectable))??!1;this.setRowSelectable(c,h,!0);return}!this.updateRowSelectable(c,!0)&&c.isSelected()&&i.push(c)};if(r){if(e===void 0){const c=n.rootNode;e=c?new Ep(!1,c):void 0}e==null||e.forEachChangedNodeDepthFirst(a,!s,!s)}else n.forEachNode(a);i.length&&this.setNodesSelected({nodes:i,newValue:!1,source:o}),!s&&r&&((l=this.updateGroupsFromChildrenSelections)==null||l.call(this,o))}updateSelectableAfterGrouping(e){var t;this.updateSelectable(e),this.groupSelectsDescendants&&((t=this.updateGroupsFromChildrenSelections)!=null&&t.call(this,"rowGroupChanged",e))&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){var r,i;if(!this.masterSelectsDetail)return;const n=(i=(r=e.detailNode)==null?void 0:r.detailGridInfo)==null?void 0:i.api;if(!n)return;const o=RCe(n);if(e.isSelected()!==o&&this.selectRowNode(e,o,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!o){const a=this.detailSelection.get(e.id)??new Set;for(const l of n.getSelectedNodes())a.add(l.id);this.detailSelection.set(e.id,a)}}setDetailSelectionState(e,t,n){if(this.masterSelectsDetail){if(!cp(t)){Je(269);return}switch(e.isSelected()){case!0:{n.selectAll();break}case!1:{n.deselectAll();break}case void 0:{const o=this.detailSelection.get(e.id);if(o){const s=[];for(const r of o){const i=n.getRowNode(r);i&&s.push(i)}n.setNodesSelected({nodes:s,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function Ud(e){return bp(e)?e.pinnedSibling:e.footer?e.sibling:e}function RCe(e){let t=0,n=0;return e.forEachNode(o=>{o.isSelected()?t++:o.selectable&&n++}),b$(t,n)}function b$(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function DCe(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function S$(e){var o;const t=e.isSelected()===!1,n=((o=e.childrenAfterFilter)==null?void 0:o.some(S$))??!1;return t||n}var TCe={moduleName:"SharedRowSelection",version:ut,beans:[pCe],apiFunctions:{setNodesSelected:gCe,selectAll:mCe,deselectAll:vCe,selectAllFiltered:yCe,deselectAllFiltered:wCe,selectAllOnCurrentPage:CCe,deselectAllOnCurrentPage:bCe,getSelectedNodes:SCe,getSelectedRows:ECe}},ICe={moduleName:"RowSelection",version:ut,rowModels:["clientSide","infinite","viewport"],beans:[_Ce],dependsOn:[TCe]};function xCe(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function FCe(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function E$(e){var t;(t=e.rowModel)==null||t.onRowHeightChanged()}function _$(e){var t,n;if((t=e.rowAutoHeight)!=null&&t.active){Je(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function PCe(e,t,n){var s,r;const o=kve(e);if(o){if(((s=e.rowGroupColsSvc)==null?void 0:s.columns.length)===0){if(t<0){_n(238);return}o.setRowCount(t,n);return}_n(28);return}(r=Wy(e))==null||r.setRowCount(t,n)}function kCe(e){var t;return Sd(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function ACe(e){return e.rowModel.isLastRowIndexKnown()}var OCe={moduleName:"CsrmSsrmSharedApi",version:ut,apiFunctions:{expandAll:xCe,collapseAll:FCe}},MCe={moduleName:"RowModelSharedApi",version:ut,apiFunctions:{onRowHeightChanged:E$,resetRowHeights:_$}},NCe={moduleName:"SsrmInfiniteSharedApi",version:ut,apiFunctions:{setRowCount:PCe,getCacheBlockState:kCe,isLastRowIndexKnown:ACe}},LCe=class extends We{constructor(){super(...arguments),this.beanName="alignedGridsSvc",this.consuming=!1}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";return typeof e=="function"&&(e=e()),e.map(o=>{var r;if(!o){_n(18),t||_n(20);return}if(this.isGridApi(o))return o;const s=o;return"current"in s?(r=s.current)==null?void 0:r.api:(s.api||_n(19),s.api)}).filter(o=>!!o&&!o.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){if(!this.consuming)for(const t of this.getAlignedGridApis())t.isDestroyed()||t.dispatchEvent(e)}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const n=[];return e.columns?e.columns.forEach(o=>{n.push(t(o))}):e.column&&n.push(t(e.column)),n}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":Je(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const n of e.columnGroups){let o=null;n&&(o=t.getProvidedColGroup(n.getGroupId())),!(n&&!o)&&t.setColumnGroupOpened(o,n.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let n=null;const o=this.beans,{colResize:s,ctrlsSvc:r,colModel:i}=o;if(t&&(n=i.getColDefCol(t.getColId())),t&&!n)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const d=e.api.getColumnState().map(h=>({colId:h.colId}));Ur(o,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));Ur(o,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));Ur(o,{state:d},"alignedGridChanged")}break;case"columnResized":{const u=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of u.flexColumns??[])d[h.getId()]&&delete d[h.getId()];s==null||s.setColumnWidths(Object.values(d),!1,u.finished,"alignedGridChanged");break}}const c=r.getGridBodyCtrl().isVerticalScrollShowing();for(const u of this.getAlignedGridApis())u.setGridOption("alwaysShowVerticalScroll",c)}},VCe={moduleName:"AlignedGrids",version:ut,beans:[LCe],dependsOn:[lB]},BCe=class extends We{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},R$(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:n,groupStage:o}=this.beans;t==null||t.reset("rowDataChanged"),n!=null&&n.isManual()&&n.reset(),this.dispatchRowDataUpdateStarted(e),this.allNodesMap=Object.create(null),this.nextId=0;const s=R$(this.rootNode),r=new Array(e.length);s._leafs=r;let i=0;const a=o==null?void 0:o.getNestedDataGetter(),l=a?new Set:null,c=(u,d)=>{const h=u.level+1;for(let f=0,p=d.length;f<p;++f){const g=d[f];if(!g)continue;const v=this.createRowNode(g,h);if(v.sourceRowIndex=i,r[i++]=v,l&&!l.has(g)){l.add(g),v.treeParent=u;const w=a(g);w&&c(v,w)}}};c(s,e),r.length=i}setImmutableRowData(e,t){var w;const{rootNode:n,gos:o}=this;this.dispatchRowDataUpdateStarted(t);const s=_d(o),r=e.changedRowNodes,{adds:i,updates:a}=r,l=new Set,c=[],u=(w=this.beans.groupStage)==null?void 0:w.getNestedDataGetter();let d=o.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,f=!1;const p=(S,b)=>{if(!d&&d!==void 0){const C=S.sourceRowIndex;d=C<=h,h=C}S.data!==b&&(S.updateData(b),i.has(S)||a.add(S),!S.selectable&&S.isSelected()&&c.push(S))},g=(S,b,C)=>{for(let _=0,E=b.length;_<E;++_){const I=b[_];if(!I)continue;let T=this.getRowNode(s({data:I,level:C}));if(T?(p(T,I),f||(f=!!u&&T.treeParent!==S)):(T=this.createRowNode(I,C),i.add(T)),!u||l.has(T)){l.add(T);continue}l.add(T),T.treeParent=S;const P=u(I);P&&g(T,P,C+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,r,c)||d||i.size>0;if(v){const S=n._leafs??(n._leafs=[]);d===void 0?WCe(S,l,r):UCe(S,l)&&(r.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},n){const o=this.rootNode._leafs;for(let s=0,r=o.length;s<r;s++){const i=o[s];e.has(i)||(t.add(i),i.isSelected()&&n.push(i),this.deleteNode(i))}return t.size>0}updateRowData(e,t){var a;if(this.dispatchRowDataUpdateStarted(e.add),(a=this.beans.groupStage)!=null&&a.getNestedDataGetter())return Je(268),{remove:[],update:[],add:[]};const n=[],o=_d(this.gos),s=this.executeRemove(o,e,t,n),r=this.executeUpdate(o,e,t,n),i=this.executeAdd(e,t);return this.deselect(n),{remove:s,update:r,add:i}}executeRemove(e,{remove:t},{adds:n,updates:o,removals:s},r){const i=this.rootNode._leafs,a=i==null?void 0:i.length,l=t==null?void 0:t.length;if(!l||!a)return[];let c=0,u=a,d=0,h;const f=new Array(l);for(let p=0;p<l;++p){const g=this.lookupNode(e,t[p]);if(!g)continue;const v=g.sourceRowIndex;v<u&&(u=v),v>d&&(d=v),g.isSelected()&&r.push(g),this.deleteNode(g),n.delete(g)?(h??(h=new Set),h.add(g)):(o.delete(g),s.add(g)),f[c++]=g}return f.length=c,c&&GCe(i,u,d,s,h),f}executeUpdate(e,{update:t},{adds:n,updates:o},s){const r=t==null?void 0:t.length;if(!r)return[];const i=new Array(r);let a=0;for(let l=0;l<r;l++){const c=t[l],u=this.lookupNode(e,c);u&&(u.updateData(c),!u.selectable&&u.isSelected()&&s.push(u),i[a++]=u,n.has(u)||o.add(u))}return i.length=a,i}executeAdd(e,t){var n;const o=(n=this.rootNode)._leafs??(n._leafs=[]),s=o.length,r=e.add,i=r==null?void 0:r.length;if(!i)return[];const a=s+i;let l=this.sanitizeAddIndex(o,e.addIndex);if(l<s){for(let d=s-1,h=a-1;d>=l;--d){const f=o[d];f.sourceRowIndex=h,o[h--]=f}t.reordered=!0}o.length=a;const c=new Array(i),u=t.adds;for(let d=0;d<i;d++){const h=this.createRowNode(r[d],0);u.add(h),h.sourceRowIndex=l,o[l]=h,c[d]=h,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}deselect(e){var o;const t="rowDataChanged",n=this.beans.selectionSvc;e.length&&(n==null||n.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t})),(o=n==null?void 0:n.updateGroupsFromChildrenSelections)==null||o.call(n,t),e.length&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t,selectedNodes:(n==null?void 0:n.getSelectedNodes())??null,serverSideState:null})}createRowNode(e,t){const n=new pl(this.beans);n.parent=this.rootNode,n.level=t,n.group=!1,n.expanded=!1,n.setDataAndId(e,String(this.nextId++));const o=n.id,s=this.allNodesMap;return s[o]&&Je(2,{nodeId:o}),s[o]=n,n}deleteNode(e){var s;e.clearRowTopAndRowIndex();const t=e.id,n=this.allNodesMap;n[t]===e&&delete n[t];const o=e.pinnedSibling;o&&((s=this.beans.pinnedRowModel)==null||s.pinRow(o,null))}lookupNode(e,t){if(!e)return HCe(this.rootNode._leafs,t);const n=e({data:t,level:0}),o=this.allNodesMap[n];return o||(_n(4,{id:n}),null)}sanitizeAddIndex(e,t){const n=e.length;if(typeof t!="number"||t<0||t>=n||Number.isNaN(t))return n;t=Math.ceil(t);const o=this.gos;return t>0&&o.get("treeData")&&o.get("getDataPath")&&(t=$Ce(e,t)),t}},$Ce=(e,t)=>{for(let n=0,o=e.length;n<o;n++){const s=e[n];if((s==null?void 0:s.rowIndex)==t-1)return n+1}return t},R$=e=>{var i;e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",((i=e._leafs)==null?void 0:i.length)!==0&&(e._leafs=[]);const t=[],n=[],o=[],s=[];e.childrenAfterGroup=t,e.childrenAfterSort=n,e.childrenAfterAggFilter=o,e.childrenAfterFilter=s;const r=e.sibling;return r&&(r.childrenAfterGroup=t,r.childrenAfterSort=n,r.childrenAfterAggFilter=o,r.childrenAfterFilter=s,r.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},HCe=(e,t)=>{if(e)for(let n=0,o=e.length;n<o;n++){const s=e[n];if(s.data===t)return s}return _n(5,{data:t}),null},GCe=(e,t,n,o,s)=>{t=Math.max(0,t);for(let r=t,i=e.length;r<i;++r){const a=e[r];r<=n&&(o.has(a)||s!=null&&s.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},UCe=(e,t)=>{const n=t.size;e.length=n;let o=0,s=!1,r=!1;for(const i of t){const a=i.sourceRowIndex;a===o?r||(r=s):(a>=0?r=!0:s=!0,i.sourceRowIndex=o,e[o]=i),++o}return r},WCe=(e,t,{removals:n,adds:o})=>{const s=e.length;e.length=t.size;let r=0;for(let i=0;i<s;++i){const a=e[i];n.has(a)||(r!==i&&(a.sourceRowIndex=r,e[r]=a),++r)}for(const i of o)i.sourceRowIndex<0&&(i.sourceRowIndex=r,e[r++]=i);e.length=r},D$=e=>{const t=e.childrenAfterSort,n=e.sibling;if(n&&(n.childrenAfterSort=t),!!t)for(let o=0,s=t.length-1;o<=s;o++){const r=t[o],i=o===0,a=o===s;r.firstChild!==i&&(r.firstChild=i,r.dispatchRowEvent("firstChildChanged")),r.lastChild!==a&&(r.lastChild=a,r.dispatchRowEvent("lastChildChanged")),r.childIndex!==o&&(r.childIndex=o,r.dispatchRowEvent("childIndexChanged"))}},zCe=class extends We{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e){const t=this.beans.sortSvc.getSortOptions(),n=t.length>0&&!!e.changedRowNodes&&this.gos.get("deltaSort");this.sort(t,n,e.changedRowNodes,e.changedPath)}sort(e,t,n,o){const{gos:s,colModel:r,rowGroupColsSvc:i,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,u=s.get("groupMaintainOrder"),d=r.getCols().some(S=>S.isRowGroupActive()),h=i==null?void 0:i.columns,f=r.isPivotMode(),p=s.getCallback("postSortRows");let g=!1,v;const w=S=>{var E,I;const b=f&&S.leafGroup;let C=u&&d&&!S.leafGroup;C&&(v??(v=this.shouldSortContainsGroupCols(e)),C&&(C=!v));let _=null;if(C){let T=!1;if(h){const P=S.level+1;P<h.length&&(T=h[P].getSort()===null)}T||(_=qCe(S))}else!e.length||b||(t&&n?_=jCe(a,S,n,o,e):_=a.doFullSort(S.childrenAfterAggFilter,e));if(_||(_=((E=S.childrenAfterAggFilter)==null?void 0:E.slice(0))??[]),g||(g=((I=S.childrenAfterSort)==null?void 0:I[0])!==_[0]),S.childrenAfterSort=_,D$(S),p){const T={nodes:S.childrenAfterSort};p(T)}};if(o==null||o.forEachChangedNodeDepthFirst(w),g&&s.get("groupHideOpenParents")){const S=c==null?void 0:c.getShowRowGroupCols();S!=null&&S.length&&l.refreshCells({columns:S,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(Si(this.gos)){for(let n=0;n<t;++n){const o=e[n].column;if(o.isPrimary()&&o.isRowGroupActive())return!0}return!1}for(let n=0;n<t;++n)if(e[n].column.getColDef().showRowGroup)return!0;return!1}},jCe=(e,t,n,o,s)=>{const r=t.childrenAfterAggFilter,i=t.childrenAfterSort;if(!i)return e.doFullSort(r,s);const a=new Set,l=[],{updates:c,adds:u}=n;for(let h=0,f=r.length;h<f;++h){const p=r[h];c.has(p)||u.has(p)||o&&!o.canSkip(p)?l.push({currentPos:l.length,rowNode:p}):a.add(p)}const d=i.filter(h=>a.has(h)).map((h,f)=>({currentPos:f,rowNode:h}));return l.sort((h,f)=>e.compareRowNodes(s,h,f)),KCe(e,s,l,d)},KCe=(e,t,n,o)=>{let s=0,r=0;const i=n.length,a=o.length,l=new Array(i+a);let c=0;for(;s<i&&r<a;){const u=n[s],d=o[r];e.compareRowNodes(t,u,d)<0?(l[c++]=u.rowNode,++s):(l[c++]=d.rowNode,++r)}for(;s<i;)l[c++]=n[s++].rowNode;for(;r<a;)l[c++]=o[r++].rowNode;return l},qCe=e=>{const t=e.childrenAfterSort,n=e.childrenAfterAggFilter,o=t==null?void 0:t.length,s=n==null?void 0:n.length;if(!o||!s)return null;const r=new Array(s),i=new Set;for(let l=0;l<s;++l)i.add(n[l]);let a=0;for(let l=0;l<o;++l){const c=t[l];i.delete(c)&&(r[a++]=c)}if(i.size===0&&a===o)return t;for(const l of i)r[a++]=l;return r.length=a,r},YCe=class extends We{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.rowCountReady=!1,this.nodeManager=void 0,this.rowsToDisplay=[],this.rowDataUpdatedPending=!1,this.asyncTransactions=null,this.asyncTransactionsTimer=0,this.started=!1,this.refreshingModel=!1,this.rowNodesCountReady=!1,this.stages=[],this.stagesRefreshProps=new Map,this.onRowHeightChanged_debounced=Lo(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new pl(e);this.rootNode=t,this.nodeManager=this.createBean(new BCe(t));const n=this.refreshModel.bind(this,{step:"group"}),o=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:o,columnRowGroupChanged:n,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:n,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,n=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(o=>!!o);this.stages=n;for(let o=n.length-1;o>=0;--o)for(const s of n[o].refreshProps)t.set(s,o);this.addManagedPropertyListeners([...t.keys()],o=>{var r;const s=(r=o.changeSet)==null?void 0:r.properties;s&&this.onPropChange(s)}),this.addManagedPropertyListener("rowData",()=>this.onPropChange(["rowData"])),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.started=!0,this.rowNodesCountReady?this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0}):this.setInitialData()}setInitialData(){this.gos.get("rowData")&&this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,n,o){let s,r=!1;do{s=!1;const i=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(i,n),c=Math.min(a,o);for(let u=l;u<=c;u++){const d=this.getRow(u);if(d.rowHeightEstimated){const h=cl(this.beans,d);d.setRowHeight(h.height),s=!0,r=!0}}s&&this.setRowTopAndRowIndex()}while(s);return r}onPropChange(e){const{nodeManager:t,gos:n,beans:o}=this,s=o.groupStage;if(!t)return;const r=new Set(e),i=s==null?void 0:s.onPropChange(r);let a;r.has("rowData")?a=n.get("rowData"):i&&(a=s==null?void 0:s.extractData()),a&&!Array.isArray(a)&&(a=null,Je(1));const l={step:"nothing",changedProps:r};a&&(!i&&!this.isEmpty()&&a.length>0&&n.exists("getRowId")&&!n.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!n.get("suppressAnimationFrame"),l.changedRowNodes=new Ny,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const c=l.rowDataUpdated?"group":this.getRefreshedStage(e);c&&(l.step=c,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:n}=this,o=t.length;let s=o;for(let r=0,i=e.length;r<i&&s;++r)s=Math.min(s,n.get(e[r])??s);return s<o?t[s].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:n}=this,o=t.environment.getDefaultRowHeight();let s=0;const r=Vo(this.gos,"normal");for(let i=0,a=n.length;i<a;++i){const l=n[i],c=l.id;if(c!=null&&(e==null||e.add(c)),l.rowHeight==null){const u=cl(t,l,r,o);l.setRowHeight(u.height,u.estimated)}l.setRowTop(s),l.setRowIndex(i),s+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const n=e.active,o=i=>{(i==null?void 0:i.id)!=null&&!t.has(i.id)&&i.clearRowTopAndRowIndex()},s=i=>{o(i),o(i.detailNode),o(i.sibling);const a=i.childrenAfterGroup;if(!i.hasChildren()||!a)return;const l=i.level==-1;if(!(n&&!l&&!i.expanded))for(let u=0,d=a.length;u<d;++u)s(a[u])},r=this.rootNode;r&&s(r)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){var s,r;const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const o=(s=e.sibling)!=null&&s.displayed?1:0;return(((r=e.childrenAfterSort)==null?void 0:r.length)??0)+o}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:n,rowsToDisplay:o}=this;if(!n||!o.length||o[0]===n)return e;const r=n.childrenAfterSort,i=l=>{let c=r[l];if(this.gos.get("groupHideOpenParents"))for(;c.expanded&&c.childrenAfterSort&&c.childrenAfterSort.length>0;)c=c.childrenAfterSort[0];return c.rowIndex},a=t.footerSvc;return a?a==null?void 0:a.getTopDisplayIndex(o,e,r,i):i(e)}getTopLevelIndexFromDisplayedIndex(e){var a;const{rootNode:t,rowsToDisplay:n}=this;if(!t||!n.length||n[0]===t)return e;let s=this.getRow(e);s.footer&&(s=s.sibling);let r=s.parent;for(;r&&r!==t;)s=r,r=s.parent;const i=((a=t.childrenAfterSort)==null?void 0:a.indexOf(s))??-1;return i>=0?i:e}getRowBounds(e){const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:Ed(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const o=t.length===0||t.some(s=>s.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:o,keepRenderedRows:!0,animate:Ed(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:Ed(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new Ep(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:n,rowDataUpdated:o}=e;return!(!t||n||!o||t.removals.size||t.adds.size)}refreshModel(e){var c,u;const{nodeManager:t,beans:n,eventSvc:o,started:s,refreshingModel:r}=this;if(!t)return;const i=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&i));if(s&&i&&o.dispatchEvent({type:"rowDataUpdated"}),!s||r||n.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=i);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,(c=n.masterDetailSvc)==null||c.refreshModel(e),i&&e.step!=="group"&&((u=n.colFilter)==null||u.refreshModel()),e.step){case"group":this.doGrouping(e);case"filter":this.doFilter(a);case"pivot":this.doPivot(a);case"aggregate":this.doAggregate(a);case"filter_aggregates":this.doFilterAggregates(a);case"sort":this.doSort(e.changedRowNodes,a);case"map":this.doRowsToDisplay()}const l=new Set;this.setRowTopAndRowIndex(l),this.clearRowTopAndRowIndex(a,l),this.refreshingModel=!1,o.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}isEmpty(){var e,t,n;return!((t=(e=this.rootNode)==null?void 0:e._leafs)!=null&&t.length)||!((n=this.beans.colModel)!=null&&n.ready)}isRowsToRender(){return this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let n=!1,o=!1;const s=[],r=up(this.gos);return this.forEachNodeAfterFilterAndSort(i=>{if(o)return;if(n&&(i===t||i===e)&&(o=!0,r&&i.group)){T$(s,i);return}if(!n){if(i!==t&&i!==e)return;n=!0,t===e&&(o=!0)}(!i.group||!r)&&s.push(i)}),s}getTopLevelNodes(){var e;return((e=this.rootNode)==null?void 0:e.childrenAfterGroup)??null}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,n=t.length;if(this.isEmpty()||n===0)return-1;let o=0,s=n-1;if(e<=0)return 0;if(t[s].rowTop<=e)return s;let i=-1,a=-1;for(;;){const l=Math.floor((o+s)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTop<e?o=l+1:c.rowTop>e&&(s=l-1),i===o&&a===s))return l;i=o,a=s}}isRowInPixel(e,t){const n=e.rowTop,o=n+e.rowHeight;return n<=t&&o>t}forEachLeafNode(e){var n;const t=(n=this.rootNode)==null?void 0:n._leafs;if(t)for(let o=0,s=t.length;o<s;++o)e(t[o],o)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let n=0,o=t.length;n<o;++n)e(t[n],n)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterSort)}forEachPivotNode(e,t,n){const{colModel:o,rowGroupColsSvc:s}=this.beans;if(!o.isPivotMode())return;if(!(s!=null&&s.columns.length)){e(this.rootNode,0);return}const r=n?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,i=>i.leafGroup?null:i[r])}depthFirstSearchRowNodes(e,t=!1,n=r=>r.childrenAfterGroup,o=this.rootNode,s=0){let r=s;if(!o)return r;const i=o===this.rootNode;if(i||e(o,r++),o.hasChildren()&&!o.footer){const a=n(o);if(a){const l=this.beans.footerSvc;r=(l==null?void 0:l.addTotalRows(r,o,e,t,i,"top"))??r;for(const c of a)r=this.depthFirstSearchRowNodes(e,t,n,c,r);return(l==null?void 0:l.addTotalRows(r,o,e,t,i,"bottom"))??r}}return r}doAggregate(e){var n;const t=this.rootNode;t&&((n=this.beans.aggStage)==null||n.execute({rowNode:t,changedPath:e}))}doFilterAggregates(e){const t=this.rootNode,n=this.beans.filterAggStage;if(n){n.execute({rowNode:t,changedPath:e});return}t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const n=this.beans.sortStage;if(n){n.execute({rowNode:this.rootNode,changedRowNodes:e,changedPath:t});return}t.forEachChangedNodeDepthFirst(o=>{o.childrenAfterSort=o.childrenAfterAggFilter.slice(0),D$(o)})}doGrouping(e){var s;const t=this.rootNode,n=this.beans.groupStage,o=n==null?void 0:n.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(o===void 0){const r=t._leafs;t.childrenAfterGroup=r,t.updateHasChildren();const i=t.sibling;i&&(i.childrenAfterGroup=r)}(o||e.rowDataUpdated)&&((s=this.beans.colFilter)==null||s.refreshModel()),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;if(t){t.execute({rowNode:this.rootNode,changedPath:e});return}e.forEachChangedNodeDepthFirst(n=>{n.childrenAfterFilter=n.childrenAfterGroup,jB(n)},!0)}doPivot(e){var t;(t=this.beans.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getRowNode(e){var o,s;const t=(o=this.nodeManager)==null?void 0:o.getRowNode(e);return typeof t=="object"?t:typeof e=="string"&&e.indexOf(j0)===0?(s=this.beans.groupStage)==null?void 0:s.getNode(e):void 0}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const n=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),n)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var a;const{nodeManager:e,beans:t,eventSvc:n,asyncTransactions:o}=this;if(!e)return;(a=t.valueCache)==null||a.onDataChanged();const s=[],r=[],i=new Ny;for(const{rowDataTransaction:l,callback:c}of o??[]){this.rowNodesCountReady=!0;const u=e.updateRowData(l,i);s.push(u),c&&r.push(c.bind(null,u))}this.commitTransactions(i),r.length>0&&setTimeout(()=>{for(let l=0,c=r.length;l<c;l++)r[l]()},0),s.length>0&&n.dispatchEvent({type:"asyncTransactionsFlushed",results:s}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){var s;const t=this.nodeManager;if(!t)return null;(s=this.beans.valueCache)==null||s.onDataChanged(),this.rowNodesCountReady=!0;const n=new Ny,o=t.updateRowData(e,n);return this.commitTransactions(n),o}commitTransactions(e){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:e,changedPath:this.createChangePath(!0)})}doRowsToDisplay(){const{beans:e,rootNode:t}=this,n=e.flattenStage;if(n){this.rowsToDisplay=n.execute({rowNode:t});return}const o=this.rootNode.childrenAfterSort??[];for(const s of o)s.setUiLevel(0);this.rowsToDisplay=o}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){const e=this.rootNode;if(!e)return;const t=this.resetRowHeightsForAllRowNodes();e.setRowHeight(e.rowHeight,!0);const n=e.sibling;n==null||n.setRowHeight(n.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const n=t.detailNode;n==null||n.setRowHeight(n.rowHeight,!0);const o=t.sibling;o==null||o.setRowHeight(o.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){var t;e.rowHeightChanged&&!((t=this.beans.rowAutoHeight)!=null&&t.active)&&this.resetRowHeights()}onGridReady(){this.started||this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},T$=(e,t)=>{const n=t.childrenAfterGroup;if(n)for(let o=0,s=n.length;o<s;++o){const r=n[o];r.data&&e.push(r),r.group&&T$(e,r)}};function ZCe(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function XCe(e,t){const n=wl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function JCe(e){var t;return((t=wl(e))==null?void 0:t.isEmpty())??!0}function QCe(e,t){var n;(n=wl(e))==null||n.forEachLeafNode(t)}function ebe(e,t){var n;(n=wl(e))==null||n.forEachNodeAfterFilter(t)}function tbe(e,t){var n;(n=wl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function nbe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=wl(e))==null?void 0:n.updateRowData(t)})}function obe(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var o;return(o=wl(e))==null?void 0:o.batchUpdateRowData(t,n)})}function sbe(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=wl(e))==null?void 0:t.flushAsyncTransactions()})}function rbe(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var I$={moduleName:"ClientSideRowModel",version:ut,rowModels:["clientSide"],beans:[YCe,zCe],dependsOn:[LB]},ibe={moduleName:"ClientSideRowModelApi",version:ut,apiFunctions:{onGroupExpandedOrCollapsed:ZCe,refreshClientSideRowModel:XCe,isRowDataEmpty:JCe,forEachLeafNode:QCe,forEachNodeAfterFilter:ebe,forEachNodeAfterFilterAndSort:tbe,applyTransaction:nbe,applyTransactionAsync:obe,flushAsyncTransactions:sbe,getBestCostNodeSelection:rbe,resetRowHeights:_$,onRowHeightChanged:E$},dependsOn:[OCe,MCe]},abe=class extends We{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel}serialize(e,t={}){const{allColumns:n,columnKeys:o,skipRowGroups:s,exportRowNumbers:r}=t,i=this.getColumnsToExport({allColumns:n,skipRowGroups:s,columnKeys:o,exportRowNumbers:r});return[this.prepareSession(i),this.prependContent(t),this.exportColumnGroups(t,i),this.exportHeaders(t,i),this.processPinnedTopRows(t,i),this.processRows(t,i),this.processPinnedBottomRows(t,i),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,n,o){var p;const s=t.shouldRowBeSkipped||(()=>!1),i=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!i,l=this.colModel.isPivotMode()?o.leafGroup:!o.group,c=!!o.footer,u=o.allChildrenCount===1&&((p=o.childrenAfterGroup)==null?void 0:p.length)===1&&cae(this.gos,o);if(!l&&!c&&(t.skipRowGroups||u||a)||t.onlySelected&&!o.isSelected()||t.skipPinnedTop&&o.rowPinned==="top"||t.skipPinnedBottom&&o.rowPinned==="bottom"||o.stub||o.level===-1&&!l&&!c||s(Pt(this.gos,{node:o})))return;const f=e.onNewBodyRow(o);if(n.forEach((g,v)=>{f.onColumn(g,v,o)}),t.getCustomContentBelowRow){const g=t.getCustomContentBelowRow(Pt(this.gos,{node:o}));g&&e.addCustomContent(g)}}appendContent(e){return t=>{const n=e.appendContent;return n&&t.addCustomContent(n),t}}prependContent(e){return t=>{const n=e.prependContent;return n&&t.addCustomContent(n),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return n=>{if(!e.skipColumnGroupHeaders){const o=new C2,{colGroupSvc:s}=this.beans,r=s?s.createColumnGroups({columns:t,idCreator:o,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(r,n,e.processGroupHeaderCallback)}return n}}exportHeaders(e,t){return n=>{if(!e.skipColumnHeaders){const o=n.onNewHeaderRow();t.forEach((s,r)=>{o.onColumn(s,r,void 0)})}return n}}processPinnedTopRows(e,t){return n=>{var s,r;const o=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="top").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedTopRow(i.rowIndex)}).forEach(o):(s=this.pinnedRowModel)!=null&&s.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("top",o),n}}processRows(e,t){return n=>{var c;const o=this.rowModel,s=ro(this.gos),r=Sd(this.gos),i=!s&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(u=>u.rowPinned==null).sort((u,d)=>u.rowIndex-d.rowIndex).map(u=>o.getRow(u.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())s?o.forEachPivotNode(a,!0,l==="filteredAndSorted"):r?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);else if(e.onlySelectedAllPages||i){const u=((c=this.beans.selectionSvc)==null?void 0:c.getSelectedNodes())??[];this.replicateSortedOrder(u),u.forEach(a)}else l==="all"?o.forEachNode(a):s||r?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);return n}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:n}=this.beans;if(!t||!n)return;const o=t.getSortOptions(),s=(r,i)=>{var a,l;return r.rowIndex!=null&&i.rowIndex!=null?r.rowIndex-i.rowIndex:r.level===i.level?((a=r.parent)==null?void 0:a.id)===((l=i.parent)==null?void 0:l.id)?n.compareRowNodes(o,{rowNode:r,currentPos:r.rowIndex??-1},{rowNode:i,currentPos:i.rowIndex??-1}):s(r.parent,i.parent):r.level>i.level?s(r.parent,i):s(r,i.parent)};e.sort(s)}processPinnedBottomRows(e,t){return n=>{var s,r;const o=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="bottom").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedBottomRow(i.rowIndex)}).forEach(o):(s=this.pinnedRowModel)!=null&&s.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("bottom",o),n}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:n=!1,exportRowNumbers:o=!1,columnKeys:s}=e,{colModel:r,gos:i,visibleCols:a}=this,l=r.isPivotMode(),c=h=>pa(h)?!1:!ga(h)||o;if(s!=null&&s.length)return r.getColsForKeys(s).filter(c);const u=i.get("treeData");let d=[];return t&&!l?d=r.getCols():d=a.allCols,d=d.filter(h=>c(h)&&(n&&!u?!y0(h):!0)),d}recursivelyAddHeaderGroups(e,t,n){const o=[];for(const s of e){const r=s;if(r.getChildren)for(const i of r.getChildren()??[])o.push(i)}e.length>0&&io(e[0])&&this.doAddHeaderHeader(t,e,n),o&&o.length>0&&this.recursivelyAddHeaderGroups(o,t,n)}doAddHeaderHeader(e,t,n){const o=e.onNewHeaderGroupingRow();let s=0;for(const r of t){const i=r;let a;n?a=n(Pt(this.gos,{columnGroup:i})):a=this.beans.colNames.getDisplayNameForColumnGroup(i,"header");const c=(i.isExpandable()?i.getLeafColumns():[]).reduce((u,d,h,f)=>{let p=Tn(u);return d.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],u.push(p)):p&&p[1]==null&&(p[1]=h-1),h===f.length-1&&p&&p[1]==null&&(p[1]=h),u},[]);o.onColumn(i,a||"",s++,i.getLeafColumns().length-1,c)}}},lbe={moduleName:"SharedExport",version:ut,beans:[abe]},x$=`\r
260
260
  `,cbe=class extends Vve{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,x$),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,o){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,n){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(o.valueFormatted??o.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(Je(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=x$),this.isFirstLine=!1}},ube=class extends Lve{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){Je(51);return}const t=this.getMergedParams(e),n=this.getData(t),o=new Blob(["\uFEFF",n],{type:"text/plain"}),s=typeof t.fileName=="function"?t.fileName(Pt(this.gos,{})):t.fileName;Bve(this.getFileName(s),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:o,valueSvc:s,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new cbe({colModel:t,colNames:n,valueSvc:s,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function dbe(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function hbe(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var fbe={moduleName:"CsvExport",version:ut,beans:[ube],apiFunctions:{getDataAsCsv:dbe,exportDataAsCsv:hbe},dependsOn:[lbe]},pbe=class extends We{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:o,rowNodes:s}=this;for(let r=0;r<e;r++){const i=n+r,a=new pl(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),s.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:o}}}setDataAndId(e,t,n){ft(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Bn(this.params.datasource.getRows)){Je(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:o,filterModel:s},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:o,filterModel:s,context:Pt(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((o,s)=>{this.startRow+s<n&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((s,r)=>{const i=e.rowData?e.rowData[r]:void 0;!s.id&&s.alreadyRendered&&i&&(t[r]=new pl(n),t[r].setRowIndex(s.rowIndex),t[r].setRowTop(s.rowTop),t[r].setRowHeight(s.rowHeight),s.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const o=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,o)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},gbe=2,mbe=class extends We{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let o=this.blocks[n];if(!o){if(t)return;o=this.createBlock(n)}return o.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new pbe(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()&&(ll(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(i=>i!=e),n=(i,a)=>a.lastAccessed-i.lastAccessed;t.sort(n);const o=this.params.maxBlocksInCache>0,s=o?this.params.maxBlocksInCache-1:null,r=gbe-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,c=o?a>=s:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(i)||this.isBlockFocused(i))return;this.removeBlockFromCache(i)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:o}=e;return t.rowIndex>=n&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:o}=this.params,r=(e.id+1)*n+o;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,ft(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,o)=>n.id-o.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let o=-1,s=!1;const r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(s&&o+1!==l.id){i=!0;continue}o=l.id,l.forEachNode(c=>{const u=c===e||c===t;(s||u)&&n.push(c),u&&(s=!s)},r,this.rowCount)}return i||s?[]:n}},vbe=class extends We{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new pl(e);this.rootNode=t,t.level=-1,this.rowHeight=Rc(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=Rc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Yf(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;_d(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:o,eventSvc:s,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:o,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:Rc(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new mbe(this.cacheParams)),s.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function ybe(e){var t;(t=Wy(e))==null||t.refreshCache()}function wbe(e){var t;(t=Wy(e))==null||t.purgeCache()}function Cbe(e){var t;return(t=Wy(e))==null?void 0:t.getRowCount()}var bbe=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=uae(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Lo(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Gr(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){ll(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:o}=t.getBlockStateJson();e[n]=o}),e}printCacheStatus(){ll(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},Sbe={moduleName:"InfiniteRowModelCore",version:ut,rowModels:["infinite"],beans:[vbe,bbe]},Ebe={moduleName:"InfiniteRowModel",version:ut,apiFunctions:{refreshInfiniteCache:ybe,purgeInfiniteCache:wbe,getInfiniteRowCount:Cbe},dependsOn:[Sbe,NCe]},_be="↑",Rbe="↓",Dbe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},Tbe=class extends bn{constructor(){super(Dbe),this.eValue=dt,this.eDelta=dt,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),o=e.formatValue(n),s=ft(o)?o:n,r=t>=0,i=this.eDelta;r?i.textContent=_be+s:i.textContent=Rbe+s,i.classList.toggle("ag-value-change-delta-up",r),i.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),No(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:o}=e,{eValue:s,lastValue:r,beans:i}=this;if(n===r||(ft(o)?s.textContent=o:ft(n)?s.textContent=n:No(s),(c=i.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=r&&typeof r=="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return r&&s.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},Ibe=".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}",xbe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},Fbe=class extends bn{constructor(){super(xbe),this.eCurrent=dt,this.refreshCount=0,this.registerCSS(Ibe)}init(e){this.refresh(e,!0)}addSlideAnimation(){var s;this.refreshCount++;const e=this.refreshCount;(s=this.ePrevious)==null||s.remove();const{beans:t,eCurrent:n}=this,o=ao({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=n.textContent,this.getGui().insertBefore(o,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var r;e===this.refreshCount&&((r=this.ePrevious)==null||r.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let n=e.value;if(Bn(n)&&(n=""),n===this.lastValue||(s=this.beans.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const o=this.eCurrent;return ft(e.valueFormatted)?o.textContent=e.valueFormatted:ft(e.value)?o.textContent=n:No(o),!0}},Pbe=class extends We{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),o=this.beans.gos.get("cellFadeDuration")){const s=this.animations[t];s.delete(e);const r=Date.now(),i=r+n,a=r+n+o,l={phase:"flash",flashEndTime:i,fadeEndTime:a};s.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&i+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=i)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const o=this.animations[n],s=`ag-cell-${n}`,r=`${s}-animation`;for(const[i,a]of o){if(!i.isAlive()||!i.comp){o.delete(i);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=i;switch(l){case"flash":f.toggleCss(s,!1),f.toggleCss(r,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(s,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),o.delete(i);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=Fhe(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 kbe(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(o,t)})}var Abe={moduleName:"HighlightChanges",version:ut,beans:[Pbe],userComponents:{agAnimateShowChangeCellRenderer:Tbe,agAnimateSlideCellRenderer:Fbe},apiFunctions:{flashCells:kbe}};function Obe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Mbe(e,t,n){var o;return(o=e.stateSvc)==null?void 0:o.setState(t,n)}function F$(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=Nbe(e)),e.version=ut,e}function Nbe(e){return e.cellSelection=Lbe(e,"rangeSelection"),e}function Lbe(e,t){if(e&&typeof e=="object")return e[t]}var Vbe=class extends We{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Lo(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Lo(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=Lo(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=ro(e);const o=F$(e.get("initialState")??{}),s=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(o,!!s),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(o))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=F$(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const o="api",s=t?new Set(t):void 0;this.setGridReadyState(n,o,s),this.setColumnsInitialisedState(n,o,!!s,s),this.setRowCountState(n,o,s),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,o,s),this.stopSuppressEvents(o)})}setGridReadyState(e,t,n){var o,s;t==="api"&&!(n!=null&&n.has("sideBar"))&&((s=(o=this.beans.sideBar)==null?void 0:o.comp)==null||s.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,o){this.setColumnState(e,t,n,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:o,rowGroupExpansion:s,ssrmRowGroupExpansion:r,rowSelection:i,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",s)&&this.setRowGroupExpansionState(r,s,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},o=()=>t("filter",this.getFilterState()),{gos:s,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(s.get("groupDefaultExpanded")!==0||s.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:i=>{(i.newPage||i.newPageSize)&&t("pagination",this.getPaginationState())}}),r&&this.addManagedListeners(r,{filterStateChanged:o})}setFirstDataRenderedState(e,t,n){const{scroll:o,cellSelection:s,focusedCell:r,columnOrder:i,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",s)&&this.setCellSelectionState(s),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:o=>{if(o.finished){const s=this.getRangeSelectionState();t("rangeSelection",s),t("cellSelection",s)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return Ove(fy(e),e.colModel.isPivotMode())}setColumnState(e,t,n,o){const{sort:s,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(D,F)=>{const O=!(o!=null&&o.has(D))&&!!(F||t==="api");return h||(h=O),O},p={},g=D=>{let F=p[D];return F||(F={colId:D},p[D]=F,F)},v={},w=f("sort",s);w&&(s==null||s.sortModel.forEach(({colId:D,sort:F},O)=>{const k=g(D);k.sort=F,k.sortIndex=O})),(w||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((D,F)=>{const O=g(D);O.rowGroup=!0,O.rowGroupIndex=F})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:D,aggFunc:F})=>{g(D).aggFunc=F})),(b||!n)&&(v.aggFunc=null);const C=f("pivot",a);C&&(a==null||a.pivotColIds.forEach((D,F)=>{const O=g(D);O.pivot=!0,O.pivotIndex=F}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(C||!n)&&(v.pivot=null,v.pivotIndex=null);const _=f("columnPinning",l);if(_){for(const D of(l==null?void 0:l.leftColIds)??[])g(D).pinned="left";for(const D of(l==null?void 0:l.rightColIds)??[])g(D).pinned="right"}(_||!n)&&(v.pinned=null);const E=f("columnVisibility",c);if(E)for(const D of(c==null?void 0:c.hiddenColIds)??[])g(D).hide=!0;(E||!n)&&(v.hide=null);const I=f("columnSizing",u);if(I)for(const{colId:D,flex:F,width:O}of(u==null?void 0:u.columnSizingModel)??[]){const k=g(D);k.flex=F??null,k.width=O}(I||!n)&&(v.flex=null);const T=d==null?void 0:d.orderedColIds,P=!!(T!=null&&T.length)&&!(o!=null&&o.has("columnOrder")),M=P?T.map(D=>g(D)):Object.values(p);(M.length||h)&&(this.columnStates=M,Ur(this.beans,{state:M,applyOrder:P,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const s=this.beans,{pivotResultCols:r,colGroupSvc:i}=s;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);Ur(s,{state:a,applyOrder:e},t)}o&&(i==null||i.setColumnGroupState(o,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Mve(t)}setColumnGroupState(e,t,n){var a;const o=this.beans.colGroupSvc;if(!o||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const s=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=o.getColumnGroupState().map(({groupId:l})=>{const c=s.has(l);return c&&s.delete(l),{groupId:l,open:c}});for(const l of s)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),o.setColumnGroupState(i,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),o=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||o||n?{filterModel:t,columnFilterState:n,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:o,advancedFilterModel:s}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||o!==void 0)&&(t==null||t.setFilterState(n??null,o??null,"columnFilter")),s!==void 0&&(t==null||t.setAdvFilterModel(s??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:o,type:s,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:o,type:s,startRow:r,endRow:i,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:o,visibleCols:s}=this.beans;if(!ha(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of i.colIds){const u=o.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=o.getCol(i.startColId);if(!l){const c=s.allCols,u=new Set(a);l=c.find(d=>u.has(d))}r.push({...i,columns:a,startColumn:l})}n.setCellRanges(r)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:s,animationFrameSvc:r,ctrlsSvc:i}=this.beans;o.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),s.redraw({afterScroll:!0}),r==null||r.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:s,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(o),rowIndex:s,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!o))return{page:n,pageSize:o}}setPaginationState(e,t){const{pagination:n,gos:o}=this.beans;if(!n)return;const{pageSize:s,page:r}=e??{page:0,pageSize:o.get("paginationPageSize")},i=t==="gridInitializing";s&&!o.get("paginationAutoPageSize")&&n.setPageSize(s,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var o;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((o=t==null?void 0:t.toggledNodes)!=null&&o.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const o=this.beans.expansionSvc;if(!o)return;const s=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(s,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const o=this.cachedState;for(const s of Object.keys(t)){const r=t[s];Yf(r,o[s])||(n=!0)}this.cachedState={...o,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Yf(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")}},Bbe={moduleName:"GridState",version:ut,beans:[Vbe],apiFunctions:{getState:Obe,setState:Mbe}};function $be(e){return e.rowModel.isLastRowIndexKnown()}function Hbe(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Gbe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function Ube(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function Wbe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function zbe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function jbe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function Kbe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function qbe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Ybe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var Zbe=class extends We{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const o=Math.max(Rc(t),1),s=Math.floor(e/o);t.pagination.setPageSize(s,"autoCalculated")};this.isBodyRendered?Lo(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},Pp="paginationPageSizeSelector",Xbe={tag:"span",cls:"ag-paging-page-size"},Jbe=class extends bn{constructor(){super(Xbe),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(Pp,()=>{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(){No(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(Pp)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const s=this.gos.exists("paginationPageSize"),r=this.gos.get(Pp)!==!0;Je(94,{pageSizeSet:s,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Je(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Pp}),e.unshift("")}const o=String(n?"":t);this.selectPageSizeComp?(dl(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),o=n("pageSizeSelectorLabel","Page Size:"),s=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new $0).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(s).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Pp);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,o)=>n-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},Qbe={selector:"AG-PAGE-SIZE-SELECTOR",component:Jbe},eSe=".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}",tSe=class extends HV{constructor(){super(),this.btFirst=dt,this.btPrevious=dt,this.btNext=dt,this.btLast=dt,this.lbRecordCount=dt,this.lbFirstRowOnPage=dt,this.lbLastRowOnPage=dt,this.lbCurrent=dt,this.lbTotal=dt,this.pageSizeComp=dt,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(eSe)}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(),[Qbe]);const{btFirst:t,btPrevious:n,btNext:o,btLast:s}=this;this.activateTabIndex([t,n,o,s]),t.insertAdjacentElement("afterbegin",hr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",hr(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",hr(e?"previous":"next",this.beans)),s.insertAdjacentElement("afterbegin",hr(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(r):Zue(this.beans,r),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:o=>{(o.key===Oe.ENTER||o.key===Oe.SPACE)&&(o.preventDefault(),n())}})}Yue(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}):Nve(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),s=e===n-1;this.nextButtonDisabled=s||o,this.lastButtonDisabled=!t||o||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){uie(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),o=e?n:null,s=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*s+1,a=i+r-1,e&&a>o&&(a=o));const l=i+r-1,c=!e&&n<l,u=this.formatNumber(i);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?s+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,w;if(e)v=this.formatNumber(t),w=this.formatNumber(o);else{const S=h("more","more");v=S,w=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=w,this.announceAriaStatus(u,d,w,g,v)}announceAriaStatus(e,t,n,o,s){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${i} ${o} ${l} ${s}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},nSe={selector:"AG-PAGINATION",component:tSe},oSe=class extends We{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return nSe}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,o;if(!this.active)return;let t=e;this.paginateChildRows||(t=((o=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:o.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ft(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ft(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ft(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ft(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,o=t-1;this.totalPages=Math.floor(o/n)+1,this.adjustCurrentPageIfInvalid();const s=this.currentPage,r=n*s;let i=n*(s+1)-1;if(i>o&&(i=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>o&&(this.bottomDisplayedRowIndex=o)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:o,keepRenderedRows:t})}},sSe={moduleName:"Pagination",version:ut,beans:[oSe,Zbe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:$be,paginationGetPageSize:Hbe,paginationGetCurrentPage:Gbe,paginationGetTotalPages:Ube,paginationGetRowCount:Wbe,paginationGoToNextPage:zbe,paginationGoToPreviousPage:jbe,paginationGoToFirstPage:Kbe,paginationGoToLastPage:qbe,paginationGoToPage:Ybe},dependsOn:[zy]};function rSe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function P$(e,t,n,o,s){t&&(o&&t.parent&&t.parent.level!==-1&&P$(e,t.parent,n,o,s),t.setExpanded(n,void 0,s))}function iSe(e,t){return e.rowModel.getRowNode(t)}function aSe(e,t,n,o){e.rowRenderer.addRenderedRowListener(t,n,o)}function lSe(e){return e.rowRenderer.getRenderedNodes()}function cSe(e,t,n){e.rowModel.forEachNode(t,n)}function uSe(e){return e.rowRenderer.firstRenderedRow}function dSe(e){return e.rowRenderer.lastRenderedRow}function hSe(e,t){return e.rowModel.getRow(t)}function fSe(e){return e.rowModel.getRowCount()}var pSe={moduleName:"RowApi",version:ut,apiFunctions:{redrawRows:rSe,setRowNodeExpanded:P$,getRowNode:iSe,addRenderedRowListener:aSe,getRenderedNodes:lSe,forEachNode:cSe,getFirstDisplayedRowIndex:uSe,getLastDisplayedRowIndex:dSe,getDisplayedRowAtIndex:hSe,getDisplayedRowCount:fSe}},gSe={moduleName:"ScrollApi",version:ut,apiFunctions:{getVerticalPixelRange:Iwe,getHorizontalPixelRange:xwe,ensureColumnVisible:h$,ensureIndexVisible:f$,ensureNodeVisible:Fwe}};function mSe(e,t,n){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,s=`aria-${t}`;n===null?o.removeAttribute(s):o.setAttribute(s,n)}function vSe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function ySe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function wSe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function CSe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function bSe(e){return{rowHeight:Rc(e),headerHeight:yp(e)}}function SSe(e,t={}){var r;const n=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=i.getCellRenderer();a!=null&&n.push(gp(a))}if((r=t.columns)!=null&&r.length)return n;const o=[],s=L_(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(s&&!V_(i.rowNode,s)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&o.push(gp(c))}}return[...o,...n]}var ESe={moduleName:"RenderApi",version:ut,apiFunctions:{setGridAriaProperty:mSe,refreshCells:vSe,refreshHeader:ySe,isAnimationFrameQueueEmpty:wSe,flushAllAnimationFrames:CSe,getSizesForCurrentTheme:bSe,getCellRendererInstances:SSe}};function _Se(e,t){var n,o;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(o=e.colAutosize)==null||o.sizeColumnsToFitGridBody(t)}function k$({colAutosize:e,visibleCols:t},n,o){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:o,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function RSe(e,t){var n;t&&typeof t=="object"?k$(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var DSe=class extends We{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let o=!1;const s=t.type;if(s==="fitGridWidth"||s==="fitProvidedWidth")o=!0;else if(s==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");o=r!=null&&r.length>0&&ro(e)}o&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(s))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(o=>{var c;const s=u=>Td(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return s(o);const r=A$(this.beans),i=u=>n.leftCols.some(d=>hp(d,u)),a=u=>n.rightCols.some(d=>hp(d,u)),l=e.colKeys.filter(u=>!pa(u)&&!ga(u)&&!i(u)&&!a(u));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),s(o)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:o,skipHeader:s,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let w=-1;const S=Object.fromEntries(c.map(({colId:_,...E})=>[_,E])),b=s??this.gos.get("skipHeaderOnAutoSize"),C=r??b;for(;w!==0;){w=0;const _=[];for(const E of o){if(!E||Eae(E))continue;const I=f.getCol(E);if(!I||v.has(I))continue;const T=p.getPreferredWidthForColumn(I,b);if(T>0){const P=S[I.colId]??{};P.minWidth??(P.minWidth=l),P.maxWidth??(P.maxWidth=a);const M=TSe(I,T,P);I.setActualWidth(M,u),v.add(I),w++}_.push(I)}_.length&&g.refresh(u)}C||this.autoSizeColumnGroupsByColumns(o,u,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:o,ctrlsSvc:s}=this.beans,r=new Set,i=o.getColsForKeys(e);for(const l of i){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||r.add(c),c=c.getParent()}let a;for(const l of r){for(const c of s.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",o);const s=new Mc(e);return s.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),s.destroy()}}addColumnGroupResize(e,t,n){const o=this.gos.get("skipHeaderOnAutoSize"),s=()=>{const r=[],i=t.getDisplayedLeafColumns();for(const a of i)a.getColDef().suppressAutoSize||r.push(a.getColId());r.length>0&&this.autoSizeCols({colKeys:r,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",s),()=>e.removeEventListener("dblclick",s)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=A$(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):Je(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,o){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,o));return}const s={};for(const{key:v,...w}of(o==null?void 0:o.columnLimits)??[])s[typeof v=="string"?v:v.getColId()]=w;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=fa(r);if(o!=null&&o.onlyScaleUp&&i>e||e===i&&r.every(w=>{if(w.colDef.suppressSizeToFit)return!0;const S=s==null?void 0:s[w.getId()],b=(S==null?void 0:S.minWidth)??(o==null?void 0:o.defaultMinWidth),C=(S==null?void 0:S.maxWidth)??(o==null?void 0:o.defaultMaxWidth),_=w.getActualWidth();return(b==null||_>=b)&&(C==null||_<=C)}))return;const l=[],c=[];for(const v of r){const w=((p=o==null?void 0:o.colKeys)==null?void 0:p.some(S=>hp(v,S)))??!0;v.getColDef().suppressSizeToFit||!w?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{Gr(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const w=s==null?void 0:s[v.getId()],S=(w==null?void 0:w.minWidth)??(o==null?void 0:o.defaultMinWidth),b=(w==null?void 0:w.maxWidth)??(o==null?void 0:o.defaultMaxWidth),C=v.getActualWidth();typeof S=="number"&&C<S?v.setActualWidth(S,t,!0):typeof b=="number"&&C>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-fa(c);if(v<=0)for(const w of l){const S=((g=s==null?void 0:s[w.getId()])==null?void 0:g.minWidth)??(o==null?void 0:o.defaultMinWidth)??w.minWidth;w.setActualWidth(S,t,!0)}else{const w=v/fa(l);let S=v;for(let b=l.length-1;b>=0;b--){const C=l[b],_=s==null?void 0:s[C.getId()],E=(_==null?void 0:_.minWidth)??(o==null?void 0:o.defaultMinWidth),I=(_==null?void 0:_.maxWidth)??(o==null?void 0:o.defaultMaxWidth),T=C.getMinWidth(),P=C.getMaxWidth(),M=typeof E=="number"&&E>T?E:T,D=typeof I=="number"&&I<P?I:P;let F=Math.round(C.getActualWidth()*w);F<M?(F=M,h(C),d=!1):F>D?(F=D,h(C),d=!1):b===0&&(F=S),C.setActualWidth(F,t,!0),S-=F}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&Td(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=n.type;if(o==="fitGridWidth"){const{columnLimits:s,defaultMinWidth:r,defaultMaxWidth:i}=n,a=s==null?void 0:s.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var o;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(o=this.beans.colDelayRenderSvc)==null||o.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function TSe(e,t,n={}){const o=n.minWidth??e.getMinWidth();t<o&&(t=o);const s=n.maxWidth??e.getMaxWidth();return t>s&&(t=s),t}function A$({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),s=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return ep(n.eGridBody)-s}var ISe={moduleName:"ColumnAutoSize",version:ut,beans:[DSe],apiFunctions:{sizeColumnsToFit:_Se,autoSizeColumns:k$,autoSizeAllColumns:RSe},dependsOn:[sB]},xSe=".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 FSe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function PSe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function kSe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function ASe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function OSe(e,t,n){var o;return(o=e.pinnedRowModel)==null?void 0:o.forEachPinnedRow(t,n)}var MSe={moduleName:"PinnedRow",version:ut,beans:[kde],css:[xSe],apiFunctions:{getPinnedTopRowCount:FSe,getPinnedBottomRowCount:PSe,getPinnedTopRow:kSe,getPinnedBottomRow:ASe,forEachPinnedRow:OSe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},NSe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const o of this.spannedNodes)o!==this.lastNode&&(t+=o.rowHeight);return e-t}},LSe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:o,rowModel:s,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const w=(C,_)=>{p=C,g=null,v=_},S=C=>{const _=!C.isExpandable()&&!C.group&&!C.detail&&(u?!u({rowNode:C}):!0);if(C.rowIndex==null||!_){w(null,null);return}if(p==null||C.level!==p.level||C.footer||g&&C.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){w(C,r.getValue(t,C));return}const E=r.getValue(t,C);if(f){const I=Pt(n,{valueA:v,nodeA:p,valueB:E,nodeB:C,column:t,colDef:a});if(!h(I)){w(C,E);return}}else if(d?!d(v,E):v!==E){w(C,E);return}if(!g){const I=l==null?void 0:l.get(p);(I==null?void 0:I.firstNode)===p?(I.reset(),g=I):g=new NSe(t,p),c.set(p,g)}g.addSpannedNode(C),c.set(C,g)};switch(e){case"center":(b=s.forEachDisplayedNode)==null||b.call(s,C=>{(!i||i.isRowInPage(C.rowIndex))&&S(C)}),this.centerValueNodeMap=c;break;case"top":o==null||o.forEachPinnedRow("top",S),this.topValueNodeMap=c;break;case"bottom":o==null||o.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},VSe=class extends We{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Lo(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Lo(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 LSe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,o=e.column,s=e.rowIndex,r=this.spanningColumns.get(o);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(s);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(s);break;default:i=n.getRow(s)}if(i)return r.getCellSpan(i)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,o]of this.spanningColumns)if(o.isCellSpanning(e)){const s=o.getCellSpan(e);t(n,s)}}destroy(){super.destroy(),this.spanningColumns.clear()}},BSe=class extends Bd{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,o,s,r,i){this.eWrapper=n,super.setComp(e,t,n,o,s,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||Kv(e,t.rowIndex)}setAriaRowSpan(){gie(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(Ay(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}},$Se=class extends Uy{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new BSe(t,this,this.beans)}isCorrectCtrlForSpan(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},HSe=class extends We{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),o=n.size,s=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of s)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(r.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){r.set(u.firstNode,d),n.delete(u.firstNode);return}i=!0;const h=new $Se(u.firstNode,this.beans,!1,!1,!1);r.set(u.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===o;if(!(!i&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const o=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(o)return o.getAllCellCtrls().find(s=>s.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},GSe={moduleName:"CellSpan",version:ut,beans:[VSe,HSe]},USe=class extends We{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,n=e.colDef,o=n.cellClassRules,s=this.getCellClassParams(e,n);M_(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,s,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let o;if(typeof n=="function"){const s=this.getCellClassParams(e,t);o=n(s)}else o=n;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,o=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const s=this.beans.cellStyles.getStaticCellClasses(n,o);this.staticClasses=s;for(const r of s)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:o}=this.cellCtrl;return Pt(this.beans.gos,{value:n,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},WSe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,o){M_(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,o),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let o;return typeof n=="function"?o=n(t):o=n,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new USe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(s=>{n(s)})}},zSe={moduleName:"CellStyle",version:ut,beans:[WSe]},jSe={moduleName:"RowStyle",version:ut,beans:[kme]};function KSe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var qSe=class extends We{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:o,gos:s,element:r,columns:i}=this,a=o.colHover;if(n??!!s.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},YSe="ag-column-hover",ZSe=class extends We{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const o=()=>{const s=this.isHovered(n);t.toggleCss("ag-column-hover",s)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(YSe,n)}addHeaderFilterColumnHoverListener(e,t,n,o){this.createHoverFeature(e,[n],o);const s=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:s}),s()}createHoverFeature(e,t,n){e.createManagedBean(new qSe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},XSe={moduleName:"ColumnHover",version:ut,beans:[ZSe],apiFunctions:{isColumnHovered:KSe}},JSe=class extends We{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var r;const n=((r=this.wrapSvc)==null?void 0:r.wrap(e,t))??t,o=!$y.has(e),s=o?this.asyncListeners:this.syncListeners;s.has(e)||s.set(e,new Set),s.get(e).add(n),this.eventSvc.addListener(e,n,o)}removeListener(e,t){var r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,o=this.asyncListeners.get(e),s=!!(o!=null&&o.delete(n));s||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,s)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{$y.has(i)&&t(i,a)},o=(i,a)=>{$y.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:o});const s=this.eventSvc;s.addGlobalListener(n,!1),s.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:o}=this,s=(n==null?void 0:n.unwrapGlobal(e))??e;if(o.has(s)){const{syncListener:i,asyncListener:a}=o.get(s);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(s),t.removeGlobalListener(s,!1)}destroyEventListeners(e,t){e.forEach((n,o)=>{n.forEach(s=>this.eventSvc.removeListener(o,s,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:o})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function QSe(e,t,n){var o;(o=e.apiEventSvc)==null||o.addListener(t,n)}function eEe(e,t,n){var o;(o=e.apiEventSvc)==null||o.removeListener(t,n)}function tEe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function nEe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var oEe={moduleName:"EventApi",version:ut,apiFunctions:{addEventListener:QSe,addGlobalListener:tEe,removeEventListener:eEe,removeGlobalListener:nEe},beans:[JSe]},sEe={moduleName:"Locale",version:ut,beans:[Ave]},rEe=class extends We{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Lo(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:o}=this.beans,s=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=cl(this.beans,d).height;for(const g of s){let v=h==null?void 0:h[g.getColId()];const w=n==null?void 0:n.getCellSpan(g,d);if(w){if(w.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),r=!0)};(a=o==null?void 0:o.forEachPinnedRow)==null||a.call(o,"top",i),(l=o==null?void 0:o.forEachPinnedRow)==null||l.call(o,"bottom",i),(c=t.forEachDisplayedNode)==null||c.call(t,i),r&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const o=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:o,visibleCols:s}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=s.getLeftColsForRow(t);break;case"right":r=s.getRightColsForRow(t);break;case null:r=o.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:s,column:r}=e,i=this.beans,a=u=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=Ec(o),g=d+h+f+p,w=t.offsetHeight+g;if(u<5){const b=Io(i),C=!(b!=null&&b.contains(t)),_=w==0;if(C||_){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(s,w,r)},l=()=>a(0);l();const c=il(i,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(s,void 0,r)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(s=>s.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const o of t){const s=n.__autoHeights[o.getColId()];if(!s||n.rowHeight<s)return!1}}return!0}},iEe={moduleName:"RowAutoHeight",version:ut,beans:[rEe]},aEe={moduleName:"AllCommunity",version:ut,dependsOn:[I$,fbe,Ebe,Xve,aCe,lCe,cCe,uCe,dCe,hCe,fCe,iCe,Qye,ewe,twe,Jye,owe,swe,Bbe,VCe,sSe,lB,pSe,gSe,ESe,ISe,jhe,MSe,ICe,pve,zSe,XSe,jSe,oEe,vve,Abe,c$,sEe,iEe,zhe,ibe,GSe]};let O$=!1;O$||(Qie.registerModules([aEe,I$]),O$=!0);class lEe{constructor(t,n){no(this,"gridApi",null);no(this,"container");no(this,"config");no(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:o,onRowSelected:s,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{o&&o(a)},onRowSelected:a=>{s&&s(a)}};return this.gridApi=xve(this.container,i),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const o={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const o={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(o=>{var s;(s=this.gridApi)==null||s.removeEventListener(n,o)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const cEe=pB.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"),uEe=st({__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","on-scroll"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=V(null);bS(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=V(null),a=q(()=>({width:"100%",height:o.height||"500px"})),l=q(()=>({...o,theme:cEe}));function c(){var v;if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:o.height};i.value=new lEe(r.value,g),i.value.init(),(v=i.value.getApi())==null||v.addEventListener("bodyScroll",()=>{s("on-scroll",new Event("scroll"))}),u()}function u(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;s("onGridReady",g)}function d(g){var w,S;if(!g)return;(w=i.value)==null||w.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width,flex:null}:null).filter(b=>b!==null);(S=i.value)==null||S.setColumnWidth(v)}function h(){var g;(g=i.value)==null||g.destroy(),i.value=null}function f(){var g;return((g=i.value)==null?void 0:g.getApi())||void 0}function p(){return i.value||null}return tt(()=>o.columnDefs,(g,v)=>{const w=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");w!==S&&d(g)},{deep:!0}),qn(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),Qt(()=>{c()}),qn(()=>{h()}),(g,v)=>(K(),ie("div",{ref_key:"gridContainerRef",ref:r,style:cn(a.value),class:te(["ag-theme-quartz",["ag-table-container",o.isSorting?"is-sorting":""]])},null,6))}});function Wd(e){return fL(e)}const dEe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:Wd(gc),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!1},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:Wd(gc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:Wd(gc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.completedOn.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>qf.fromType(n))],Xy={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},hEe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:Xy.WIDTH,minWidth:Xy.WIDTH,maxWidth:Xy.WIDTH,cellClass:"ag-checkbox-cell",headerClass:Xy.HEADER_CLASS,headerComponent:jv(yee),suppressMovable:!0}),M$="blank",fEe=[M$,"__checkboxSelection","options"],pEe=["uiColumnResized","uiColumnMoved","api"],gEe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},N$=(e,t)=>t!=null&&t.width?{...e,width:t.width,flex:void 0}:e,mEe=(e,t,n)=>{const{getCachedValue:o,setCachedValue:s}=$h({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const d=await o(t);if(!d||typeof d!="string")return null;try{const h=JSON.parse(d);return Array.isArray(h)?h:null}catch(h){return console.error("Failed to parse cached column config:",h),null}},i=V([]),a=hEe();let l=0;const c=async d=>{const h=++l,f=await r();if(h!==l)return;const p=[];f==null||f.forEach(x=>{const{field:$,hide:W,width:Q,pinned:ae}=x;p.push([$,W])});const g=new Map(p),v=dEe(),w=qf.fromType(gEe),S=!!f,C=((d==null?void 0:d.map(x=>{var $;return{headerName:x.name,field:`metric_${x.id}`,editable:(($=x==null?void 0:x.auth_permission)==null?void 0:$.permission)==2,sortable:!0,filter:!1,flex:1,context:{...x},hide:S?!g.get(`metric_${x.id}`):!(x.is_primary||x.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:jv(gc),headerComponentParams:()=>({headerType:x.metric_type.code=="number"||x.metric_type.code=="formula"?"number":"default"})}}))||[]).map(x=>qf.fromType(x)),_=[a,...v,...C,w],E=[],I=[],T=[];for(const x of _)x.pinned==="left"?E.push(x):x.pinned==="right"||x.field===M$?I.push(x):T.push(x);if(!f||f.length===0){i.value=_;return}const P=new Map(f.map(x=>[x.field,x])),M=new Map(T.map(x=>[x.field,x])),D=[];for(const x of f)if(x.field&&M.has(x.field)){const $=M.get(x.field);D.push({...N$($,x),hide:x.hide}),M.delete(x.field)}const F=Array.from(M.values()),O=[...D,...F].map(x=>({...x,lockPinned:!0})),k=x=>N$(x,P.get(x.field));i.value=[...E.map(k),...O,...I.map(k)]};tt(e,d=>c(d),{immediate:!0});const u=xr((d,h)=>{if((d==null?void 0:d.source)!==void 0&&!pEe.includes(d.source))return;const f=n.value,p=f==null?void 0:f.getColumnDefs(),g=new Map;if(f==null||f.getColumnState().forEach(w=>{w.width&&g.set(w.colId,Number(w.width))}),i.value=p||i.value,!h)return;const v=(p??[]).filter(w=>w.field&&!fEe.includes(w.field)).map(w=>({field:w.field,hide:w.hide,width:g.get(w.field)||w.width,pinned:w.pinned}));s(t,JSON.stringify(v))},li);return HR(()=>u.cancel()),{columnDefs:i,checkboxColumn:a,saveColumnConfig:u}},vEe=()=>{const e=un.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},yEe=e=>{var F,O,k;const{showMessage:t,showErrorNetMessage:n}=oa(),o=oo(),s={domainApi:vEe(),wsCode:un.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(k=(O=(F=o==null?void 0:o.appContext)==null?void 0:F.config)==null?void 0:O.globalProperties)==null?void 0:k.apiConfig;if(!r||s.domainApi===""||s.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new FO(r,s);i.on("call-api",x=>{x.success?t(x.apiCode,"success"):n(x)});const a=ds({}),l=V([]),c=V(!1),u=V(null),d=V(null),h=V(1),f=V(20);let p=Promise.resolve();const{setCachedUsers:g}=H7(),v=x=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:x}),w=50,S=async(x,$,W)=>{if(!x.length)return[];const Q=t8(x,$);return(await Promise.all(Q.map(W))).flat()},b=async x=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:x})).data.map(W=>[W==null?void 0:W.id,W.permission])}catch($){return console.error("Failed to fetch item permissions chunk:",$),[]}},C=async(x,$)=>{try{const W=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:x,per_page:x.length*$.length,metric_ids:$}),Q=W.data.map(ee=>{const X=new Map(ee.item_metrics.map(z=>[z.metric_id,{value:z.value,auth_permission:z==null?void 0:z.auth_permission}])),N=Object.fromEntries($.map(z=>[z,X.get(z)??null]));return[ee==null?void 0:ee.id,N]}),ae=new Set(W.data.map(ee=>ee==null?void 0:ee.id));for(const ee of x)if(!ae.has(ee)){const X=Object.fromEntries($.map(N=>[N,{value:null,auth_permission:void 0}]));Q.push([ee,X])}return Q}catch(W){return console.error("Failed to fetch a chunk of metric values:",W),x.map(ae=>[ae,Object.fromEntries($.map(ee=>[ee,void 0]))])}},_=async x=>{try{const $=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:x,per_page:x.length}),W=$.data.flatMap(Q=>Q.assignees);return g(W),$.data.map(Q=>[Q==null?void 0:Q.id,Q==null?void 0:Q.assignees])}catch($){return console.error("Failed to fetch a chunk of assigned users:",$),[]}},E=async x=>{if(!x.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const $=await S(x,w,b);return Object.fromEntries($)}catch($){return console.error("Failed to fetch item permissions:",$),{}}},I=async(x,$)=>!x.length||!$.length?{}:(p=p.then(async()=>{try{const ae=[];let ee=0;for(let N=0;N<$.length;N+=5){ee++;const z=$.slice(N,N+5),ne=[];for(let ve=0;ve<z.length;ve++){const we=z[ve],re=await S(x,w,U=>C(U,[we]));ne.push(re),await new Promise(U=>setTimeout(U,500))}ae.push(...ne);const pe=N+5>=$.length}const X={};for(const N of ae.flat()){const[z,ne]=N;X[z]||(X[z]={}),Object.assign(X[z],ne)}return X}catch(W){return console.error("Failed to fetch metric values:",W),{}}}),p),T=async x=>{if(!x.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const $=await S(x,w,_);return Object.fromEntries($)}catch($){return console.error("Failed to fetch assigned users:",$),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async x=>{const{cursor:$,offset:W,size:Q,searchQuery:ae}=x;let ee=[];c.value=!0,u.value=null;try{const X=await i.getAllItem_cursor({...x,cursor:$||void 0,offset:W||void 0,pageSize:Q||f.value,...v(ae),sortBy:x.sort_by});return l.value=X.data,d.value=X.meta,h.value=X.meta.current_page||0,ee=X.data.map(N=>N==null?void 0:N.id),X}catch(X){throw u.value=X,console.error("Failed to fetch items (cursor):",X),X}finally{const X=async()=>{try{const[N,z]=await Promise.all([T(ee),E(ee)]);e.value.updateItemData({assignees:N,permission:z},ee);const ne=await I(ee,e.value.metricIds);e.value.setMetricValues(ne,new Set(ee),e.value.metricIds)}catch(N){console.error("Post-fetch processing failed:",N)}};c.value=!1,setTimeout(X)}},getAssignableStatus:async x=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:x})}catch($){throw console.error("Failed to fetch assignable status:",$),$}},getMetricList:async x=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:x})}catch($){throw console.error("Failed to fetch metric list:",$),$}},getMetricValues:I,getAssignedUsers:T}};function wEe(e){return{updateRowData:(o,s)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);s.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(r.push(u),o.assignees){const h=I7((o.assignees[c]||[]).map(rP));u.data.assignees=h,i.add("assignees")}o.permission&&(u.data.permissions=o.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),i.add("description"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(o,s,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(s).map(c=>[c,new Map(r.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(o).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=i.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&i.refreshCells({rowNodes:l,columns:Array.from(r).map(c=>`metric_${c}`),force:!0})}}}function CEe(e,t,n,o,s){let r=!0;return{async getRows(i){try{o(!0),r&&(s(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,u),o(!1),s(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),o(!1),s(!1)}}}}function bEe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:o,gridApi:s,fetcher:r}=e,i=V(!0),a=V(!0),l=V(!1),c=()=>{n.value=!n.value},u=v=>{if(i.value=!1,s.value=v,!v)return null;const{addEventListener:w,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=CEe(r,e.perPage,()=>o.value,C=>{i.value=C},C=>{a.value=C});return S==null||S("datasource",b),w==null||w("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var w,S;if((w=s.value)==null||w.hideOverlay(),v!==void 0&&(o.value=v),(S=s.value)==null||S.deselectAll(),t.value=[],i.value=!0,!s.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,s.value.purgeInfiniteCache(),s.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=s.value)==null||v.deselectAll(),t.value=[]},f=xr(v=>{d(v)},li),p=()=>{s.value},g=V(!1);return{isLoading:i,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const SEe={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."]}}},EEe=e=>{var t;return(t=Object.entries(SEe.changelog).find(([n,o])=>n===e))==null?void 0:t[1].changes},_Ee={key:1},REe=Ct(st({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=V(null),s=e,r=()=>{o.value&&o.value.show()},i=V(""),a=V("idle"),l=V({file:null,format:null}),{apiServices:c}=Zn(!1,{}),u=V(!1),d=async()=>{u.value=!0;const D=s.workspaceId,F=s.entityId;if(!D||!F||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(D,F))throw new Error("No response from downloadTemplate API")}catch(O){console.error("Error downloading template:",O)}u.value=!1},h=n,f=()=>{h("import-success"),S()},p=async D=>{var k,x,$;const F=new FormData,O=((k=D.name.split(".").pop())==null?void 0:k.toString())||"";if(F.append("file",D),F.append("format",O),F.append("entity_id",s.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(s.workspaceId,s.entityId,F),g()}catch(W){throw console.error("Error uploading file:",W),v((($=(x=W.response)==null?void 0:x.data)==null?void 0:$.message)||"An unknown error occurred during file upload."),W}},g=()=>{a.value="success"},v=D=>{i.value=D,a.value="error"},w=async()=>{!l.value||!l.value.file||await p(l.value.file)},S=()=>{var D;E(),(D=o.value)==null||D.hide()};t({close:S,open:r});const b=q(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),C=q(()=>l.value.file?!1:(console.error("No file selected"),!0)),_=V(null),E=()=>{var D;(D=_.value)==null||D.clear(),i.value="",l.value={file:null,format:null},a.value="idle"},I=yn("switchInstance"),T=()=>{I?I("xlsx_toolbox","",{showLoad:!1}):window.appManager.switchInstance("xlsx_toolbox","",{showLoad:!1})},P=(D,F)=>new File([D],F,{type:D.type});let M;return Qt(()=>{const D=sessionStorage.getItem("BASE_URL");M=KE({target:window,allowedOrigins:[D||"https://app.arbocollab.com"],onMessage:(F,O)=>{var x;if(F.type!=="TOOLBOX_EXPORT_DATA")return;const k=P(F.payload.file,F.payload.fileName);(x=_.value)==null||x.setFile(k)},onInvalidMessage:(F,O,k)=>{console.warn("Rejected postMessage:",O,k.origin)}})}),qn(()=>{M==null||M()}),(D,F)=>(K(),Ue(H(KS),{"popup-name":b.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:o,onHidden:E},tu({default:he(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(K(),Ue(sL,{key:0,state:a.value,"error-message":i.value,overwrite:!0},null,8,["state","error-message"])):(K(),ie("div",_Ee,[me("div",{class:te(D.$style["step-section"])},[me("span",{class:te(D.$style["step-title"])},"Step 1: Download current data",2),me("span",{class:te(D.$style["step-description"])},[...F[1]||(F[1]=[Qe(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),me("br",null,null,-1),me("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),me("div",{class:te(D.$style["actions-section"])},[ue(H(at),{class:te(D.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:he(()=>[ue(H(lt),{src:"Download"})]),default:he(()=>[F[2]||(F[2]=Qe(" Download file ",-1))]),_:1},8,["class","disabled"]),ue(H(at),{class:te(D.$style["download-sample-btn"]),size:12,variant:"secondary",onHandleClick:T},{default:he(()=>[...F[3]||(F[3]=[Qe(" Toolbox ",-1)])]),_:1},8,["class"])],2)],2),me("div",{class:te(D.$style["step-section"])},[me("span",{class:te(D.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),ue(H(_M),{modelValue:l.value,"onUpdate:modelValue":F[0]||(F[0]=O=>l.value=O),ref_key:"filUploaderRef",ref:_},null,8,["modelValue"])],2),me("div",{class:te(D.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ue(rL)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"secondary",onClick:S},{default:he(()=>[...F[4]||(F[4]=[Qe(" Cancel ",-1)])]),_:1}),ue(H(at),{disabled:C.value,style:{flex:"1"},variant:"primary",onClick:w},{default:he(()=>[...F[5]||(F[5]=[Qe(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"primary",onClick:f},{default:he(()=>[...F[6]||(F[6]=[Qe(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"primary",onClick:E},{default:he(()=>[...F[7]||(F[7]=[Qe(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_1ji92_1","step-title":"_step-title_1ji92_12","step-title-2":"_step-title-2_1ji92_18","step-description":"_step-description_1ji92_24","date-format-guide":"_date-format-guide_1ji92_29","import-error":"_import-error_1ji92_40","drop-area":"_drop-area_1ji92_50","is-dragging":"_is-dragging_1ji92_50","drop-area-content":"_drop-area-content_1ji92_53",browse:"_browse_1ji92_62","download-sample-btn":"_download-sample-btn_1ji92_66","actions-section":"_actions-section_1ji92_70"}}]]),DEe={class:"visual-btn-visual"},TEe={class:"visual-btn--label"},IEe={key:0,class:"visual-btn--description"},xEe={key:1,class:"visual-btn--description"},L$=Ct(st({__name:"VisualButton",props:{label:{},description:{},disabled:{type:Boolean}},emits:["onClick"],setup(e,{emit:t}){const n=e,o=()=>{n.disabled||s("onClick")},s=t;return(r,i)=>(K(),ie("div",{class:te(["visual-btn",{"visual-btn--disabled":e.disabled}]),onClick:o},[me("div",DEe,[Dt(r.$slots,"visual",{},()=>[i[0]||(i[0]=AU('<svg width="42" height="36" viewBox="0 0 42 36" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-db9bdf1b><g clip-path="url(#clip0_4824_13082)" data-v-db9bdf1b><path d="M5.14286 18V10.2857H18V18H5.14286ZM5.14286 23.1 429H18V30.8571H5.14286V23.1429ZM23.1429 30.8571V23.1429H36V30.8571H23.1429ZM36 18H23.1429V10.2857H36V18ZM5.14286 0C2.30625 0 0 2.30625 0 5.14286V30.8571C0 33.6937 2.30625 36 5.14286 36H36C38.8366 36 41.1429 33.6937 41.1429 30.8571V5.14286C41.1429 2.30625 38.8366 0 36 0H5.14286Z" fill="#D7D7D7" data-v-db9bdf1b></path><path d="M0 5.14286C0 2.30625 2.30625 0 5.14286 0H36C38.8366 0 41.1429 2.30625 41.1429 5.14286V10.318H0V5.14286Z" fill="#A6A6A6" data-v-db9bdf1b></path></g><defs data-v-db9bdf1b><clipPath id="clip0_4824_13082" data-v-db9bdf1b><rect width="41.1429" height="36" fill="white" data-v-db9bdf1b></rect></clipPath></defs></svg>',1))],!0)]),me("div",TEe,ht(n.label),1),n.disabled?(K(),ie("div",IEe," Coming soon ")):(K(),ie("div",xEe,ht(n.description),1))],2))}}),[["__scopeId","data-v-db9bdf1b"]]),kp="xlsx_toolbox",FEe="TOOLBOX_EXPORT_DATA",PEe="https://app.arbocollab.com",kEe=e=>{const t=yn("switchInstance",void 0),n=i=>{const{source:a,template:l}=i??{},c={showLoad:!1};if(t?t(kp,"",c):window.appManager.switchInstance(kp,"",c),!l)throw new Error("template file is missing");setTimeout(()=>{const u=`${sessionStorage.getItem("BASE_URL")}`;window.postMessage({type:"xlsx-mapping:load",payload:{source:a,template:l}},u)},1e3)},o=(i,a)=>{const l={showLoad:!1};if(t?t(kp,"",l):window.appManager.switchInstance(kp,"",l),!i)throw new Error("Error file is missing");setTimeout(()=>{const c=`${sessionStorage.getItem("BASE_URL")}`;window.postMessage({type:"xlsx-mapping:edit",payload:{file:i}},c)},1e3)};let s;const r=i=>{var a;if(((a=i.data)==null?void 0:a.type)===FEe){const{file:l,fileName:c}=i.data.payload;e(new File([l],c,{type:l.type}),c),window.appManager.hide(kp)}};return Qt(()=>{s=KE({target:window,allowedOrigins:[sessionStorage.getItem("BASE_URL")||PEe],onMessage:i=>{r({data:i})},onInvalidMessage:(i,a,l)=>{console.warn("Rejected postMessage:",a,l.origin)}}),window.addEventListener("message",r)}),qn(()=>s==null?void 0:s()),{openToolbox:n,sendBackErrorFile:o}},AEe={class:"header-name"},OEe={class:"modal-body"},MEe={class:"description"},NEe={key:0,class:"error-message"},LEe={class:"dynamic"},VEe={key:1,class:"choose-method-container"},BEe={key:2,class:"select-status-container"},$Ee={key:3,class:"result-container"},HEe={key:4,class:"result-container"},GEe={key:2},V$="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",UEe=20,WEe=Ct(st({__name:"PopupToolboxUploader",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=Yt,s=q(()=>[1,2].includes(f.value)),r=q(()=>dP()),i=q(()=>({1:{title:`Create ${r.value} in bulk`,description:""},2:{title:"Select status",description:"Choose the starting status for the new work."},3:{title:"Import successful",description:"Work will be created in background. Refresh to see updates."},4:{title:"Import failed",description:"Some data doesn't meet the requirements. Review it and try again."},5:{title:"Waiting for Toolbox",description:"Waiting for Toolbox"}})),a={"--popup-pt":"20px","--popup-pb":"20px","--popup-pl":"24px","--popup-pr":"24px"},l=e,c=n,{apiServices:u}=Zn(!1,l),d=1,h=V(),f=V(d),p=V(null),g=V(null),v=V(null),w=V(void 0),S=V(null),b=q(()=>i.value[f.value]),C=V(),_=()=>{var ee;p.value=null,f.value=d,g.value=null,v.value=null,E.value=null,S.value=null,(ee=C.value)==null||ee.clear(),w.value=void 0};tt([g,v],([ee,X])=>{f.value===1&&ee&&X&&(f.value=2)});const E=V(null),I=ee=>{console.error(ee),E.value=ee},T=async(ee,X)=>{var z,ne,pe;if(W.value=!0,!u.value||!l.workspaceId||!l.entityId){console.error("API services not available");return}const N=new FormData;N.append("file",ee),N.append("format",((z=X??ee.name)==null?void 0:z.split(".").pop())??ee.name.split(".").pop()??""),N.append("entity_id",l.entityId),N.append("template_flow_status_id",p.value??"");try{await u.value.addNewSceneViaImportFile(l.workspaceId,l.entityId,N),f.value=3,c("import-success")}catch(ve){console.error("Error uploading file:",ve),I(((pe=(ne=ve.response)==null?void 0:ne.data)==null?void 0:pe.message)||"An unknown error occurred during file upload."),f.value=4}finally{W.value=!1}},{openToolbox:P,sendBackErrorFile:M}=kEe((ee,X)=>{v.value=ee,w.value=X??ee.name,f.value=2}),D=async()=>{const ee=await O();try{P({template:ee})}catch(X){console.error("Error opening toolbox:",X),oa().showErrorNetMessage("Failed to open toolbox.")}},F=V(!1),O=async()=>{F.value=!0;const ee=l.workspaceId,X=l.entityId;if(!ee||!X||!u.value)return console.error("Workspace ID or Entity ID is missing"),Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const N=await u.value.downloadTemplate(ee,X,!1);if(!N)throw new Error("No response from downloadTemplate API");return N}catch(N){return console.error("Error downloading template:",N),Promise.reject(N)}finally{F.value=!1}},k=ee=>{const X=V$.includes(ee.type);return X||(console.error("Invalid file type:",ee.type),oa().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),X},x=async()=>{const ee=document.createElement("input");ee.type="file",ee.accept=V$,ee.onchange=async()=>{var N;const X=(N=ee.files)==null?void 0:N[0];if(X){if(!k(X)){_();return}g.value=rb(X);try{const z=await O();if(!z){oa().addNotification({id:"failed-download-template",message:"Failed to download template file.",type:"error"});return}P({source:X,template:z})}catch(z){console.error("Error opening toolbox:",z),oa().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},ee.click()},$=async ee=>{var X;if(!((X=u.value)!=null&&X.getAssignableStatuses)){console.error("API services not available");return}return u.value.getAssignableStatuses(l.workspaceId,{entity_id:l.entityId,name_like:ee.name_like,page:ee.page,per_page:UEe})},W=V(!1),Q=()=>{p.value=null,v.value&&w.value&&M(v.value,w.value)},ae=()=>{p.value&&v.value&&(W.value=!0,T(v.value,w.value).finally(()=>{W.value=!1}))};return t({open:()=>{var ee;return(ee=h.value)==null?void 0:ee.show()},close:()=>{var ee;return(ee=h.value)==null?void 0:ee.hide()}}),(ee,X)=>(K(),Ue(H(KS),Wt({ref_key:"popupRef",ref:h,style:a,onHidden:_},{popupIndex:10,popupName:b.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0,showCloseBtn:s.value}),tu({header:he(()=>[me("span",AEe,ht(b.value.title),1)]),default:he(()=>[me("div",OEe,[me("div",MEe,ht(b.value.description),1),E.value&&f.value===4?(K(),ie("div",NEe,[X[3]||(X[3]=Qe(" Error code ",-1)),me("span",LEe,ht(E.value),1)])):Xe("",!0),f.value===1?(K(),ie("div",VEe,[ue(L$,{disabled:!1,label:"Start with a blank sheet",description:`Type or paste ${r.value} details
261
261
  into a table.`,onOnClick:D},{visual:he(()=>[ue(H(Ka),{src:"BlankSheet",size:65})]),_:1},8,["description"]),ue(L$,{label:"Import from file",description:`Create ${r.value} from a CSV or
262
- Excel file.`,onOnClick:x},{visual:he(()=>[ue(H(Ka),{src:"UploadFile",size:65,"max-width":"65"})]),_:1},8,["description"])])):f.value===2?(K(),ie("div",BEe,[ue(H(bM),{modelValue:p.value,"onUpdate:modelValue":X[0]||(X[0]=N=>p.value=N),"get-status-func":$,"workspace-id":l.workspaceId,id:l.entityId,style:{width:"100%"},"max-width":"372px",ref_key:"selectStatusRef",ref:C},null,8,["modelValue","workspace-id","id"])])):f.value===3?(K(),ie("div",$Ee,[ue(H(Ka),{src:"Success",width:240,height:180,ratio:"unset"})])):f.value===4?(K(),ie("div",HEe,[ue(H(Ka),{src:"Failed",width:240,height:180,ratio:"unset"})])):Xe("",!0)])]),_:2},[f.value===2||f.value===4||f.value===3?{name:"footer",fn:he(()=>[f.value===4?(K(),Ue(H(at),{key:0,variant:"secondary",onClick:X[1]||(X[1]=()=>{var N;_(),(N=h.value)==null||N.hide()})},{default:he(()=>[...X[4]||(X[4]=[Qe(" Close ",-1)])]),_:1})):f.value===3?(K(),Ue(H(at),{key:1,variant:"secondary",onClick:X[2]||(X[2]=()=>{var N;_(),(N=h.value)==null||N.hide()})},{default:he(()=>[...X[5]||(X[5]=[Qe(" Got it ",-1)])]),_:1})):Xe("",!0),f.value===2?Ke((K(),ie("div",GEe,[ue(H(at),{loading:W.value,disabled:W.value||!p.value,onClick:ae},{default:he(()=>[...X[6]||(X[6]=[Qe(" Import ",-1)])]),_:1},8,["loading","disabled"])])),[[H(o),{content:W.value||!p.value?"Select a status first":void 0,bypassOverflowCheck:!0}]]):Xe("",!0),f.value===4?(K(),Ue(H(at),{key:3,onClick:Q},{default:he(()=>[...X[7]||(X[7]=[Qe(" Try Again ",-1)])]),_:1})):Xe("",!0)]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-474db5c4"]]),zEe=Ct(st({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=Ts,o=vS(),{setUserPermissions:s,setEntityPermissions:r}=o,{entityPermissions:i}=ns(o),a=Yt,l=ko,c=V(null),u={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},d=V(""),h=q(()=>{var Ze;const Ae=((Ze=i.value)==null?void 0:Ze.has_create_item_permission)==1||!1;return[{label:"Create in bulk",value:"import_scenes",type:"text",id:"import_scenes_option",hide:!Ae},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",type:"text",hide:!Ae,id:"overwrite_scenes_option"}]}),f=e;qf.initialize({wrapVueCellRenderer:jv,wrapVueCellEditor:fL});const p=mf(),{switchInstanceFunc:g}=ns(p);Qt(()=>{const Ae=oo();g.value=Ae==null?void 0:Ae.appContext.config.globalProperties.switchInstance;const Ze=new BroadcastChannel("focusable_channel");vt(()=>{setTimeout(()=>{Ze.postMessage("Focusable elements updated")},7e3)})});const v=V(null),w=V([]),S=uv(),{rowCount:b}=ns(S),C=V(!1),_=V(""),E=V(),I=EA(),{metricList:T}=ns(I),P=V(""),M=V(!1),D=V(new Set),F=V(new Map),{apiServices:O}=Zn(!1,f),{columnDefs:k,checkboxColumn:x,saveColumnConfig:$}=mEe(T,f.entityId,v),W=V();tt(()=>k,()=>{var Ae;(Ae=W.value)==null||Ae.updateColumnDefs(k.value)},{deep:!0});const Q=(Ae,Ze)=>{$(Ae,Ze)},{updateRowData:ae,setMetricValues:ee}=wEe(v),X=q(()=>({isSearching:_.value.length>0,isFiltering:!(Object.keys(Ve.value||{}).length==1&&Object.keys(Ve.value)[0]=="preflight_status")&&Object.keys(Ve.value||{}).length>0})),N=q(Tm),z=q(()=>k.value.filter(Ae=>{var Ze;return((Ze=Ae.field)==null?void 0:Ze.startsWith("metric_"))&&!Ae.hide}).map(Ae=>{var Ze;return((Ze=Ae.field)==null?void 0:Ze.replace("metric_",""))||""}));Jr("timezone",N);const ne=q(()=>({autoFetch:!1,workspaceId:f.workspaceId,entityId:f.entityId,metricIds:z.value,updateItemData:ae,setMetricValues:ee})),{fetchItems:pe,getMetricList:ve,cusorMap:we,getMetricValues:re}=yEe(ne),U=q(()=>{if(!v.value)return!1;const Ae=v.value.getSelectedRows().length;return Ae>0&&Ae>=b.value.total}),ge=q(()=>{var Ae;return((Ae=c.value)==null?void 0:Ae.name)||"Items"}),oe=Ae=>{setTimeout(()=>{vt(()=>{var Ze,Kt;v.value&&(Ae?(Ze=v.value)==null||Ze.showNoRowsOverlay():(Kt=v.value)==null||Kt.hideOverlay())})},500)},Re=(Ae,Ze)=>{var Kt;b.value.total=Ae.meta.total??0,(Kt=Ae.meta.next)!=null&&Kt.cursor&&(we[Ze+1]=Ae.meta.next.cursor),P.value=Ae.meta["X-Tsr-signature"]||"",Ae.meta.total===0?oe(!0):oe(!1)},G=EM(),{setDefaultSort:Y}=G,de=V(null),{sortingAPIConfiguration:ke,isSortingRunning:xe}=ns(G),Ve=V({preflight_status:"1"}),ye=q(()=>({...Ve.value,search:_.value}));Jr("filterParams",ye);const L=V([]),j=async({page:Ae,pageSize:Ze,filterText:Kt})=>{var $c,Ea,In;($c=v.value)==null||$c.hideOverlay();const hn=we[Ae],Ni=!hn&&Ae>1?(Ae-1)*Ze:void 0,as=ke.value;as.length>0&&(xe.value=!0);try{const zr={cursor:hn,size:Ze,searchQuery:Kt,offset:Ni,sort_by:as,...Ve.value},Ss=await pe(zr);if(!Ss)return{rows:[],total:0};const Ap=(In=(Ea=Ss.meta)==null?void 0:Ea.extra)==null?void 0:In.default_sort;Ap&&Y(Ap);const Yd=(Op=>{const Zd=Op.data.map(yr=>aP(yr,N.value));return Zd.forEach(yr=>{D.value.add(String(yr.id)),F.value.set(String(yr.id),{})}),Zd})(Ss);return Re(Ss,Ae),{rows:Yd,total:b.value.total}}catch(zr){return console.error("Failed to fetch items:",zr),{rows:[],total:0}}finally{xe.value=!1}},{isLoading:le,toggleSidebar:Ge,onGridReady:be,handleUnSelect:ze,handleSelectAll:qe,onSearch:Ee,firstLoad:Me}=bEe({selectRowData:V([]),isSidebarOpen:C,quickFilterText:_,gridApi:v,perPage:u.ROWS_PER_PAGE,fetcher:j}),wt=V([]),At=()=>{var Ae;wt.value=((Ae=v.value)==null?void 0:Ae.getSelectedRows())||[]},Ut=ds({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),tn=q(()=>({blockLoadDebounceMillis:1e3,columnDefs:k.value,rowModelType:"infinite",cacheBlockSize:u.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:u.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:u.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:zt,noRowsOverlayComponent:jv(Qte),noRowsOverlayComponentParams:()=>X.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Ae=>Ae.data.id,getRowClass:Ae=>{if(!Ae.data)return["row-empty"];const Ze=["row-highlight"];return Ae.data.id||Ze.push("row-inactive"),Ae.data.isDeleted&&Ze.push("row-deleted"),Ae.data.disabled&&Ze.push("row-deleted"),Ae.data.isArchived&&Ze.push("row-archived"),Ae.data.isLocked&&Ze.push("row-locked"),Ze},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:f.workspaceId,entityId:f.entityId,apiServices:O.value,sorting:xe.value},onCellKeyDown:Ae=>{var Ze,Kt,hn;if(Ae.data.isDeleted)return!1;if(((Ze=Ae==null?void 0:Ae.event)==null?void 0:Ze.key)==="Enter"){const{api:Ni,node:as,column:$c}=Ae,Ea=Ni.getCellRendererInstances({rowNodes:[as],columns:[$c]});if(Ea.length>0){const In=Ea[0];In&&typeof((Kt=In.componsenExposed)==null?void 0:Kt.focus)=="function"&&((hn=In.componsenExposed)==null||hn.focus())}}},isRowSelectable:Ae=>!Ae.group,suppressKeyboardEvent:Ae=>{var hn;if((hn=Ae.data)!=null&&hn.isDeleted)return!0;const Ze=Ae.event.key,Kt=Ae.editing;return Kt&&Ze==="Tab"?!0:Kt&&Ze==="Enter"?!1:Ze==="Enter"?(Ae.event.preventDefault(),Ae.event.stopPropagation(),!0):Ze==="ArrowUp"||Ze==="ArrowDown"||Ze==="ArrowLeft"||Ze==="ArrowRight"||Ze==="Tab"||Ze==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Ae=>{const Ze=Ae.api.getFirstDisplayedRowIndex(),Kt=Ae.api.getLastDisplayedRowIndex();Ut.rowsDisplay.fromIndex=Ze,Ut.rowsDisplay.toIndex=Kt,Ut.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(hn=>hn.getColId())},onViewportChanged:Ae=>{Ut.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(Ze=>Ze.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Ae){if(Ae.data.isDeleted&&Ae.api.stopEditing(),Ae.colDef.field=="options"){const Ze=Ae.api.getCellRendererInstances({rowNodes:[Ae.node],columns:[Ae.column]});Ze.length>0&&Ze[0].focusUi()}},tabToNextCell:Ae=>{let Ze=Ae.nextCellPosition;if(Ze&&Ze.column.getColId()==="ag-Grid-SelectionColumn"){const Kt=Ae.api.getAllDisplayedColumns(),hn=Kt.indexOf(Ze.column),Ni=Ae.backwards?-1:1,as=Kt[hn+Ni];if(as)return{rowIndex:Ze.rowIndex,column:as,rowPinned:Ze.rowPinned}}return Ze}}));function zt(){if(!v.value)return;let Ae=0;v.value.forEachNode(Ze=>{Ze.data&&Ae++}),b.value.loaded=Math.min(Ae,b.value.total)}tt(()=>ke,()=>{v.value&&(P.value="",D.value.clear(),v.value.deselectAll(),Object.keys(we).forEach(Ae=>delete we[Number(Ae)]),v.value.purgeInfiniteCache(),v.value.ensureIndexVisible(0))},{deep:!0});const Le=V(),je=V(),_t=V(),Nt=()=>{var Ae;(Ae=_t.value)==null||Ae.open()},jt=()=>{var Ae;(Ae=je.value)==null||Ae.open()},nt=async()=>{Me.value=!0,v.value&&(P.value="",D.value.clear(),Object.keys(we).forEach(Ae=>delete we[Number(Ae)]),await v.value.deselectAll(),await v.value.ensureIndexVisible(0,"top"),await v.value.purgeInfiniteCache(),await v.value.refreshInfiniteCache())},Fo=q(()=>un.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),gr=V();q(()=>{var Ae;return(Ae=EEe(Fo.value))==null?void 0:Ae.map(Ze=>`<div>• ${Ze}</div>`).join(`
263
- `)});function Fi(Ae){var Ze;Ae==="new_scene"?(Ze=gr.value)==null||Ze.show():Ae==="import_scenes"?jt():Ae==="overwrite_scenes"&&Nt()}const mr=Ae=>{w.value=Ae.api.getSelectedRows().map(Ze=>Ze.id)},Sa=Ae=>{const Ze=be(Ae);return Ze&&(Ze.addEventListener("modelUpdated",zt),Ze.addEventListener("bodyScroll",()=>Ze.stopEditing()),Ze.addEventListener("selectionChanged",At),Ze.addEventListener("columnMoved",hn=>Q(hn,!0)),Ze.addEventListener("columnResized",hn=>Q(hn,!0)),Ze.addEventListener("firstDataRendered",()=>{Me.value=!1}),!document.querySelector(".ag-body-viewport"))||Ae==null||Ae.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),Ze},Pi=()=>{var Ae;d.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};Qt(()=>{vt(()=>{Pi()}),window.addEventListener("resize",Pi);function Ae(){requestAnimationFrame(Ae)}Ae()}),qn(()=>{window.removeEventListener("resize",Pi)});const ki=async({code:Ae,name:Ze})=>{await Ee(Ae),setTimeout(()=>{var Kt;(Kt=E.value)==null||Kt.setValue(Ze)},300)},Ai=Ae=>{if(!v.value)return;const Ze=v.value.getRowNode(Ae);Ze?(v.value.ensureIndexVisible(Number(Ze.rowIndex),"middle"),v.value.flashCells({rowNodes:[Ze],flashDuration:3e3,fadeDuration:1e3})):v.value.ensureIndexVisible(b.value.total-1,"bottom")},vr=Ae=>Ae.metric_type.code==="number"?"number":"default",Oi=async()=>{if(f.entityId)try{const Ae=await ve(f.entityId);T.value=Ae.data.map(Ze=>({...Ze,sortType:vr(Ze)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),T.value=[]}},zd=async()=>{if(O.value)try{const Ae=await O.value.getUserPermission(f.workspaceId);s(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},Mn=async()=>{if(O.value)try{const Ae=await O.value.getEntityDetail(f.workspaceId,f.entityId);r(Ae.permission),c.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},lo=Av(),{setUser:nR}=lo,jd=async()=>{if(O.value)try{const Ae=await O.value.getMe();return nR(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},Kd=async()=>{var Ae;if(O.value)try{const Ze=await O.value.getWorkspaces(f.workspaceId),Kt=(Ae=Ze.data[0])==null?void 0:Ae.ws_user_role_id;return Kt&&lo.setUserRoleId(Kt),Ze}catch(Ze){console.error("Failed to fetch workspace details:",Ze)}};tt(()=>[f.entityId,f.workspaceId],async([Ae,Ze])=>{!Ae||!Ze||(jd(),Kd(),Oi(),zd(),Mn())},{immediate:!0,deep:!0}),tt(z,(Ae,Ze)=>{const Kt=Ae.filter(hn=>!(Ze!=null&&Ze.includes(hn)));Kt.length>0&&re(Array.from(D.value),Kt).then(hn=>{ee(hn,D.value,Kt)})},{immediate:!0,deep:!0}),tt(P,(Ae,Ze)=>{M.value=!!(Ze&&Ae&&Ze!==Ae)}),t({refreshTable:nt});const qd=Ae=>{Ve.value=Ae,nt()},oR=Ae=>{L.value=Ae,nt()},Mi=Ae=>{k.value=Ae||[],Q({},!0)},bl=q(()=>{var hn;const Ae=un.getInstance().getItem("ws.terminology"),Ze=Ae?JSON.parse(Ae):null;return`New ${((hn=Ze==null?void 0:Ze.find(Ni=>Ni.code==="scene"))==null?void 0:hn.name)||"Scene"}`});return(Ae,Ze)=>(K(),Ue(H(dee),{"is-sidebar-open":C.value,onCloseSidebar:H(Ge),onSidebarClear:H(Ge),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:H(Ge)},{"header-left":he(()=>{var Kt;return[((Kt=H(i))==null?void 0:Kt.has_create_item_permission)==1?(K(),Ue(H(jS),{key:0,variant:["primary"],options:h.value,onSelect:Fi,onHandleClick:Ze[1]||(Ze[1]=hn=>Fi("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:he(()=>[Ke(ue(H(at),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ze[0]||(Ze[0]=hn=>Fi("new_scene")),label:bl.value},null,8,["label"]),[[H(l),1]])]),_:1},8,["options"])):Xe("",!0)]}),"header-actions":he(()=>[ue(H(Hne),{"onUpdate:assignees":oR,onApplyFilter:qd,loading:H(Me),entityId:f.entityId},null,8,["loading","entityId"]),Ke(ue(H(ES),{focusIndex:"4",modelValue:_.value,"onUpdate:modelValue":Ze[2]||(Ze[2]=Kt=>_.value=Kt),onSearch:H(Ee),class:te(Ae.$style.itemSearchBox),onClear:Ze[3]||(Ze[3]=Kt=>H(Ee)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke((K(),Ue(H(vA),{status:H(le)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":M.value},{default:he(()=>[Ke((K(),Ue(H(at),{variant:["secondary","icon"],disabled:H(le),onClick:nt},{default:he(()=>[ue(H(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[H(l),5],[H(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke(ue(H(Lte),{"model-value":H(k),onChange:Ze[4]||(Ze[4]=Kt=>Mi(Kt)),id:"table_customization",gridApi:v.value,ref_key:"tableCustomizationRef",ref:W,"checkbox-column":H(x),tableHeight:d.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]])]),grid:he(({availableHeight:Kt})=>[ue(H(uEe),Wt({id:"item_table_main",ref_key:"agGrid",ref:de},tn.value,{height:Kt+"px",isSorting:H(xe),onOnGridReady:Sa,onSelectionChanged:mr,onOnScroll:Ae.handleScroll}),null,16,["height","isSorting","onOnScroll"])]),footer:he(()=>[me("div",{class:te(Ae.$style.tableFooter),id:"table_footer"},[me("span",null,[Ze[5]||(Ze[5]=Qe(" Showing ",-1)),me("b",null,ht(H(b).loaded)+" of "+ht(H(b).total),1)])],2)]),"new-row":he(()=>[ue(H(vne),{ref_key:"createNewSceneRef",ref:gr,onSearchForCode:ki,onFocusOnId:Ai},null,512)]),"bulk-update-actions":he(()=>[!C.value&&w.value.length>0?Ke((K(),Ue(H(oee),{key:0,selectRowData:wt.value,"workspace-id":f.workspaceId,"entity-id":f.entityId,"grid-api":v.value,onUnselect:H(ze),onSelectAll:H(qe),"take-name":ge.value,"selected-all":U.value,"total-rows":H(b).total,"visible-rows":H(b).loaded,onUpdated:At,loading:H(le)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ks,!C.value&&w.value.length>0]]):Xe("",!0)]),snackbar:he(()=>[ue(H(jee))]),popup:he(()=>[ue(Ure,{ref_key:"popupCreateSceneRef",ref:Le,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(WEe,{ref_key:"popupToolboxUploaderRef",ref:je,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(REe,{ref_key:"popupOverwriteScenesRef",ref:_t,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},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"}}]]),B$="0.1.179",jEe={key:0},KEe=Ct(st({__name:"app",setup(e){const t=q(()=>n.id.length===0||n.workspaceId.length===0),n=ds({id:"",workspaceId:"",apiConfig:{}}),o=oa(),{showMessage:s,showErrorNetMessage:r}=o,i=["basicInfor","importItems"],a=h=>{h.success?s(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=V(null),c=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};gh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",B$);try{if(l.value=oo(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||un.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:un.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new FO(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=q(()=>n.id),d=q(()=>n.workspaceId);return Jr("workspaceId",d),Jr("entityId",u),(h,f)=>(K(),ie("div",{class:te(h.$style.dashboardPluginWrapper)},[t.value?(K(),ie("span",jEe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(K(),Ue(H(zEe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),tR=async(e={},t={})=>{const n=n1(KEe),o=hZ();n.use(o);const s=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,s.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${B$}`,"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",ko);const i=await Pre();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=tR),Nn.default=tR,Nn.initDashboard=tR,Object.defineProperties(Nn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
262
+ Excel file.`,onOnClick:x},{visual:he(()=>[ue(H(Ka),{src:"UploadFile",size:65,"max-width":"65"})]),_:1},8,["description"])])):f.value===2?(K(),ie("div",BEe,[ue(H(bM),{modelValue:p.value,"onUpdate:modelValue":X[0]||(X[0]=N=>p.value=N),"get-status-func":$,"workspace-id":l.workspaceId,id:l.entityId,style:{width:"100%"},"max-width":"372px",ref_key:"selectStatusRef",ref:C},null,8,["modelValue","workspace-id","id"])])):f.value===3?(K(),ie("div",$Ee,[ue(H(Ka),{src:"Success",width:240,height:180,ratio:"unset"})])):f.value===4?(K(),ie("div",HEe,[ue(H(Ka),{src:"Failed",width:240,height:180,ratio:"unset"})])):Xe("",!0)])]),_:2},[f.value===2||f.value===4||f.value===3?{name:"footer",fn:he(()=>[f.value===4?(K(),Ue(H(at),{key:0,variant:"secondary",onClick:X[1]||(X[1]=()=>{var N;_(),(N=h.value)==null||N.hide()})},{default:he(()=>[...X[4]||(X[4]=[Qe(" Close ",-1)])]),_:1})):f.value===3?(K(),Ue(H(at),{key:1,variant:"secondary",onClick:X[2]||(X[2]=()=>{var N;_(),(N=h.value)==null||N.hide()})},{default:he(()=>[...X[5]||(X[5]=[Qe(" Got it ",-1)])]),_:1})):Xe("",!0),f.value===2?Ke((K(),ie("div",GEe,[ue(H(at),{loading:W.value,disabled:W.value||!p.value,onClick:ae},{default:he(()=>[...X[6]||(X[6]=[Qe(" Import ",-1)])]),_:1},8,["loading","disabled"])])),[[H(o),{content:W.value||!p.value?"Select a status first":void 0,bypassOverflowCheck:!0}]]):Xe("",!0),f.value===4?(K(),Ue(H(at),{key:3,onClick:Q},{default:he(()=>[...X[7]||(X[7]=[Qe(" Try Again ",-1)])]),_:1})):Xe("",!0)]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-07cd96e2"]]),zEe=Ct(st({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=Ts,o=vS(),{setUserPermissions:s,setEntityPermissions:r}=o,{entityPermissions:i}=ns(o),a=Yt,l=ko,c=V(null),u={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},d=V(""),h=q(()=>{var Ze;const Ae=((Ze=i.value)==null?void 0:Ze.has_create_item_permission)==1||!1;return[{label:"Create in bulk",value:"import_scenes",type:"text",id:"import_scenes_option",hide:!Ae},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",type:"text",hide:!Ae,id:"overwrite_scenes_option"}]}),f=e;qf.initialize({wrapVueCellRenderer:jv,wrapVueCellEditor:fL});const p=mf(),{switchInstanceFunc:g}=ns(p);Qt(()=>{const Ae=oo();g.value=Ae==null?void 0:Ae.appContext.config.globalProperties.switchInstance;const Ze=new BroadcastChannel("focusable_channel");vt(()=>{setTimeout(()=>{Ze.postMessage("Focusable elements updated")},7e3)})});const v=V(null),w=V([]),S=uv(),{rowCount:b}=ns(S),C=V(!1),_=V(""),E=V(),I=EA(),{metricList:T}=ns(I),P=V(""),M=V(!1),D=V(new Set),F=V(new Map),{apiServices:O}=Zn(!1,f),{columnDefs:k,checkboxColumn:x,saveColumnConfig:$}=mEe(T,f.entityId,v),W=V();tt(()=>k,()=>{var Ae;(Ae=W.value)==null||Ae.updateColumnDefs(k.value)},{deep:!0});const Q=(Ae,Ze)=>{$(Ae,Ze)},{updateRowData:ae,setMetricValues:ee}=wEe(v),X=q(()=>({isSearching:_.value.length>0,isFiltering:!(Object.keys(Ve.value||{}).length==1&&Object.keys(Ve.value)[0]=="preflight_status")&&Object.keys(Ve.value||{}).length>0})),N=q(Tm),z=q(()=>k.value.filter(Ae=>{var Ze;return((Ze=Ae.field)==null?void 0:Ze.startsWith("metric_"))&&!Ae.hide}).map(Ae=>{var Ze;return((Ze=Ae.field)==null?void 0:Ze.replace("metric_",""))||""}));Jr("timezone",N);const ne=q(()=>({autoFetch:!1,workspaceId:f.workspaceId,entityId:f.entityId,metricIds:z.value,updateItemData:ae,setMetricValues:ee})),{fetchItems:pe,getMetricList:ve,cusorMap:we,getMetricValues:re}=yEe(ne),U=q(()=>{if(!v.value)return!1;const Ae=v.value.getSelectedRows().length;return Ae>0&&Ae>=b.value.total}),ge=q(()=>{var Ae;return((Ae=c.value)==null?void 0:Ae.name)||"Items"}),oe=Ae=>{setTimeout(()=>{vt(()=>{var Ze,Kt;v.value&&(Ae?(Ze=v.value)==null||Ze.showNoRowsOverlay():(Kt=v.value)==null||Kt.hideOverlay())})},500)},Re=(Ae,Ze)=>{var Kt;b.value.total=Ae.meta.total??0,(Kt=Ae.meta.next)!=null&&Kt.cursor&&(we[Ze+1]=Ae.meta.next.cursor),P.value=Ae.meta["X-Tsr-signature"]||"",Ae.meta.total===0?oe(!0):oe(!1)},G=EM(),{setDefaultSort:Y}=G,de=V(null),{sortingAPIConfiguration:ke,isSortingRunning:xe}=ns(G),Ve=V({preflight_status:"1"}),ye=q(()=>({...Ve.value,search:_.value}));Jr("filterParams",ye);const L=V([]),j=async({page:Ae,pageSize:Ze,filterText:Kt})=>{var $c,Ea,In;($c=v.value)==null||$c.hideOverlay();const hn=we[Ae],Ni=!hn&&Ae>1?(Ae-1)*Ze:void 0,as=ke.value;as.length>0&&(xe.value=!0);try{const zr={cursor:hn,size:Ze,searchQuery:Kt,offset:Ni,sort_by:as,...Ve.value},Ss=await pe(zr);if(!Ss)return{rows:[],total:0};const Ap=(In=(Ea=Ss.meta)==null?void 0:Ea.extra)==null?void 0:In.default_sort;Ap&&Y(Ap);const Yd=(Op=>{const Zd=Op.data.map(yr=>aP(yr,N.value));return Zd.forEach(yr=>{D.value.add(String(yr.id)),F.value.set(String(yr.id),{})}),Zd})(Ss);return Re(Ss,Ae),{rows:Yd,total:b.value.total}}catch(zr){return console.error("Failed to fetch items:",zr),{rows:[],total:0}}finally{xe.value=!1}},{isLoading:le,toggleSidebar:Ge,onGridReady:be,handleUnSelect:ze,handleSelectAll:qe,onSearch:Ee,firstLoad:Me}=bEe({selectRowData:V([]),isSidebarOpen:C,quickFilterText:_,gridApi:v,perPage:u.ROWS_PER_PAGE,fetcher:j}),wt=V([]),At=()=>{var Ae;wt.value=((Ae=v.value)==null?void 0:Ae.getSelectedRows())||[]},Ut=ds({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),tn=q(()=>({blockLoadDebounceMillis:1e3,columnDefs:k.value,rowModelType:"infinite",cacheBlockSize:u.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:u.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:u.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:zt,noRowsOverlayComponent:jv(Qte),noRowsOverlayComponentParams:()=>X.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Ae=>Ae.data.id,getRowClass:Ae=>{if(!Ae.data)return["row-empty"];const Ze=["row-highlight"];return Ae.data.id||Ze.push("row-inactive"),Ae.data.isDeleted&&Ze.push("row-deleted"),Ae.data.disabled&&Ze.push("row-deleted"),Ae.data.isArchived&&Ze.push("row-archived"),Ae.data.isLocked&&Ze.push("row-locked"),Ze},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:f.workspaceId,entityId:f.entityId,apiServices:O.value,sorting:xe.value},onCellKeyDown:Ae=>{var Ze,Kt,hn;if(Ae.data.isDeleted)return!1;if(((Ze=Ae==null?void 0:Ae.event)==null?void 0:Ze.key)==="Enter"){const{api:Ni,node:as,column:$c}=Ae,Ea=Ni.getCellRendererInstances({rowNodes:[as],columns:[$c]});if(Ea.length>0){const In=Ea[0];In&&typeof((Kt=In.componsenExposed)==null?void 0:Kt.focus)=="function"&&((hn=In.componsenExposed)==null||hn.focus())}}},isRowSelectable:Ae=>!Ae.group,suppressKeyboardEvent:Ae=>{var hn;if((hn=Ae.data)!=null&&hn.isDeleted)return!0;const Ze=Ae.event.key,Kt=Ae.editing;return Kt&&Ze==="Tab"?!0:Kt&&Ze==="Enter"?!1:Ze==="Enter"?(Ae.event.preventDefault(),Ae.event.stopPropagation(),!0):Ze==="ArrowUp"||Ze==="ArrowDown"||Ze==="ArrowLeft"||Ze==="ArrowRight"||Ze==="Tab"||Ze==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Ae=>{const Ze=Ae.api.getFirstDisplayedRowIndex(),Kt=Ae.api.getLastDisplayedRowIndex();Ut.rowsDisplay.fromIndex=Ze,Ut.rowsDisplay.toIndex=Kt,Ut.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(hn=>hn.getColId())},onViewportChanged:Ae=>{Ut.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(Ze=>Ze.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Ae){if(Ae.data.isDeleted&&Ae.api.stopEditing(),Ae.colDef.field=="options"){const Ze=Ae.api.getCellRendererInstances({rowNodes:[Ae.node],columns:[Ae.column]});Ze.length>0&&Ze[0].focusUi()}},tabToNextCell:Ae=>{let Ze=Ae.nextCellPosition;if(Ze&&Ze.column.getColId()==="ag-Grid-SelectionColumn"){const Kt=Ae.api.getAllDisplayedColumns(),hn=Kt.indexOf(Ze.column),Ni=Ae.backwards?-1:1,as=Kt[hn+Ni];if(as)return{rowIndex:Ze.rowIndex,column:as,rowPinned:Ze.rowPinned}}return Ze}}));function zt(){if(!v.value)return;let Ae=0;v.value.forEachNode(Ze=>{Ze.data&&Ae++}),b.value.loaded=Math.min(Ae,b.value.total)}tt(()=>ke,()=>{v.value&&(P.value="",D.value.clear(),v.value.deselectAll(),Object.keys(we).forEach(Ae=>delete we[Number(Ae)]),v.value.purgeInfiniteCache(),v.value.ensureIndexVisible(0))},{deep:!0});const Le=V(),je=V(),_t=V(),Nt=()=>{var Ae;(Ae=_t.value)==null||Ae.open()},jt=()=>{var Ae;(Ae=je.value)==null||Ae.open()},nt=async()=>{Me.value=!0,v.value&&(P.value="",D.value.clear(),Object.keys(we).forEach(Ae=>delete we[Number(Ae)]),await v.value.deselectAll(),await v.value.ensureIndexVisible(0,"top"),await v.value.purgeInfiniteCache(),await v.value.refreshInfiniteCache())},Fo=q(()=>un.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),gr=V();q(()=>{var Ae;return(Ae=EEe(Fo.value))==null?void 0:Ae.map(Ze=>`<div>• ${Ze}</div>`).join(`
263
+ `)});function Fi(Ae){var Ze;Ae==="new_scene"?(Ze=gr.value)==null||Ze.show():Ae==="import_scenes"?jt():Ae==="overwrite_scenes"&&Nt()}const mr=Ae=>{w.value=Ae.api.getSelectedRows().map(Ze=>Ze.id)},Sa=Ae=>{const Ze=be(Ae);return Ze&&(Ze.addEventListener("modelUpdated",zt),Ze.addEventListener("bodyScroll",()=>Ze.stopEditing()),Ze.addEventListener("selectionChanged",At),Ze.addEventListener("columnMoved",hn=>Q(hn,!0)),Ze.addEventListener("columnResized",hn=>Q(hn,!0)),Ze.addEventListener("firstDataRendered",()=>{Me.value=!1}),!document.querySelector(".ag-body-viewport"))||Ae==null||Ae.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),Ze},Pi=()=>{var Ae;d.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};Qt(()=>{vt(()=>{Pi()}),window.addEventListener("resize",Pi);function Ae(){requestAnimationFrame(Ae)}Ae()}),qn(()=>{window.removeEventListener("resize",Pi)});const ki=async({code:Ae,name:Ze})=>{await Ee(Ae),setTimeout(()=>{var Kt;(Kt=E.value)==null||Kt.setValue(Ze)},300)},Ai=Ae=>{if(!v.value)return;const Ze=v.value.getRowNode(Ae);Ze?(v.value.ensureIndexVisible(Number(Ze.rowIndex),"middle"),v.value.flashCells({rowNodes:[Ze],flashDuration:3e3,fadeDuration:1e3})):v.value.ensureIndexVisible(b.value.total-1,"bottom")},vr=Ae=>Ae.metric_type.code==="number"?"number":"default",Oi=async()=>{if(f.entityId)try{const Ae=await ve(f.entityId);T.value=Ae.data.map(Ze=>({...Ze,sortType:vr(Ze)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),T.value=[]}},zd=async()=>{if(O.value)try{const Ae=await O.value.getUserPermission(f.workspaceId);s(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},Mn=async()=>{if(O.value)try{const Ae=await O.value.getEntityDetail(f.workspaceId,f.entityId);r(Ae.permission),c.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},lo=Av(),{setUser:nR}=lo,jd=async()=>{if(O.value)try{const Ae=await O.value.getMe();return nR(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},Kd=async()=>{var Ae;if(O.value)try{const Ze=await O.value.getWorkspaces(f.workspaceId),Kt=(Ae=Ze.data[0])==null?void 0:Ae.ws_user_role_id;return Kt&&lo.setUserRoleId(Kt),Ze}catch(Ze){console.error("Failed to fetch workspace details:",Ze)}};tt(()=>[f.entityId,f.workspaceId],async([Ae,Ze])=>{!Ae||!Ze||(jd(),Kd(),Oi(),zd(),Mn())},{immediate:!0,deep:!0}),tt(z,(Ae,Ze)=>{const Kt=Ae.filter(hn=>!(Ze!=null&&Ze.includes(hn)));Kt.length>0&&re(Array.from(D.value),Kt).then(hn=>{ee(hn,D.value,Kt)})},{immediate:!0,deep:!0}),tt(P,(Ae,Ze)=>{M.value=!!(Ze&&Ae&&Ze!==Ae)}),t({refreshTable:nt});const qd=Ae=>{Ve.value=Ae,nt()},oR=Ae=>{L.value=Ae,nt()},Mi=Ae=>{k.value=Ae||[],Q({},!0)},bl=q(()=>{var hn;const Ae=un.getInstance().getItem("ws.terminology"),Ze=Ae?JSON.parse(Ae):null;return`New ${((hn=Ze==null?void 0:Ze.find(Ni=>Ni.code==="scene"))==null?void 0:hn.name)||"Scene"}`});return(Ae,Ze)=>(K(),Ue(H(dee),{"is-sidebar-open":C.value,onCloseSidebar:H(Ge),onSidebarClear:H(Ge),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:H(Ge)},{"header-left":he(()=>{var Kt;return[((Kt=H(i))==null?void 0:Kt.has_create_item_permission)==1?(K(),Ue(H(jS),{key:0,variant:["primary"],options:h.value,onSelect:Fi,onHandleClick:Ze[1]||(Ze[1]=hn=>Fi("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:he(()=>[Ke(ue(H(at),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ze[0]||(Ze[0]=hn=>Fi("new_scene")),label:bl.value},null,8,["label"]),[[H(l),1]])]),_:1},8,["options"])):Xe("",!0)]}),"header-actions":he(()=>[ue(H(Hne),{"onUpdate:assignees":oR,onApplyFilter:qd,loading:H(Me),entityId:f.entityId},null,8,["loading","entityId"]),Ke(ue(H(ES),{focusIndex:"4",modelValue:_.value,"onUpdate:modelValue":Ze[2]||(Ze[2]=Kt=>_.value=Kt),onSearch:H(Ee),class:te(Ae.$style.itemSearchBox),onClear:Ze[3]||(Ze[3]=Kt=>H(Ee)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke((K(),Ue(H(vA),{status:H(le)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":M.value},{default:he(()=>[Ke((K(),Ue(H(at),{variant:["secondary","icon"],disabled:H(le),onClick:nt},{default:he(()=>[ue(H(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[H(l),5],[H(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke(ue(H(Lte),{"model-value":H(k),onChange:Ze[4]||(Ze[4]=Kt=>Mi(Kt)),id:"table_customization",gridApi:v.value,ref_key:"tableCustomizationRef",ref:W,"checkbox-column":H(x),tableHeight:d.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]])]),grid:he(({availableHeight:Kt})=>[ue(H(uEe),Wt({id:"item_table_main",ref_key:"agGrid",ref:de},tn.value,{height:Kt+"px",isSorting:H(xe),onOnGridReady:Sa,onSelectionChanged:mr,onOnScroll:Ae.handleScroll}),null,16,["height","isSorting","onOnScroll"])]),footer:he(()=>[me("div",{class:te(Ae.$style.tableFooter),id:"table_footer"},[me("span",null,[Ze[5]||(Ze[5]=Qe(" Showing ",-1)),me("b",null,ht(H(b).loaded)+" of "+ht(H(b).total),1)])],2)]),"new-row":he(()=>[ue(H(vne),{ref_key:"createNewSceneRef",ref:gr,onSearchForCode:ki,onFocusOnId:Ai},null,512)]),"bulk-update-actions":he(()=>[!C.value&&w.value.length>0?Ke((K(),Ue(H(oee),{key:0,selectRowData:wt.value,"workspace-id":f.workspaceId,"entity-id":f.entityId,"grid-api":v.value,onUnselect:H(ze),onSelectAll:H(qe),"take-name":ge.value,"selected-all":U.value,"total-rows":H(b).total,"visible-rows":H(b).loaded,onUpdated:At,loading:H(le)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ks,!C.value&&w.value.length>0]]):Xe("",!0)]),snackbar:he(()=>[ue(H(jee))]),popup:he(()=>[ue(Ure,{ref_key:"popupCreateSceneRef",ref:Le,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(WEe,{ref_key:"popupToolboxUploaderRef",ref:je,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(REe,{ref_key:"popupOverwriteScenesRef",ref:_t,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},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"}}]]),B$="0.1.180",jEe={key:0},KEe=Ct(st({__name:"app",setup(e){const t=q(()=>n.id.length===0||n.workspaceId.length===0),n=ds({id:"",workspaceId:"",apiConfig:{}}),o=oa(),{showMessage:s,showErrorNetMessage:r}=o,i=["basicInfor","importItems"],a=h=>{h.success?s(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=V(null),c=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};gh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",B$);try{if(l.value=oo(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||un.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:un.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new FO(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=q(()=>n.id),d=q(()=>n.workspaceId);return Jr("workspaceId",d),Jr("entityId",u),(h,f)=>(K(),ie("div",{class:te(h.$style.dashboardPluginWrapper)},[t.value?(K(),ie("span",jEe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(K(),Ue(H(zEe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),tR=async(e={},t={})=>{const n=n1(KEe),o=hZ();n.use(o);const s=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,s.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${B$}`,"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",ko);const i=await Pre();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=tR),Nn.default=tR,Nn.initDashboard=tR,Object.defineProperties(Nn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});