@starasia/admin 8.27.0 → 8.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(g,lr){typeof exports=="object"&&typeof module<"u"?lr(exports,require("@starasia/alert"),require("@starasia/badges"),require("@starasia/box"),require("@starasia/breadcrumb"),require("@starasia/button"),require("@starasia/card"),require("@starasia/date"),require("@starasia/dialog"),require("@starasia/drawer"),require("@starasia/dropdown"),require("@starasia/hooks"),require("@starasia/http"),require("@starasia/input"),require("@starasia/menu"),require("@starasia/pagination"),require("@starasia/storage"),require("@starasia/table"),require("@starasia/tabs"),require("@starasia/textarea"),require("@starasia/theme"),require("@starasia/toast"),require("@starasia/toggle"),require("@starasia/tooltip"),require("@starasia/checkbox"),require("@starasia/radio"),require("@starasia/text"),require("@starasia/icon"),require("@starasia/flex"),require("@starasia/grid"),require("@starasia/progress"),require("@starasia/stepper"),require("@starasia/accordion"),require("@starasia/story-record"),require("@starasia/skeleton"),require("@starasia/progress-stepper"),require("react/jsx-runtime"),require("react"),require("react-router"),require("react-dom"),require("react-easy-crop")):typeof define=="function"&&define.amd?define(["exports","@starasia/alert","@starasia/badges","@starasia/box","@starasia/breadcrumb","@starasia/button","@starasia/card","@starasia/date","@starasia/dialog","@starasia/drawer","@starasia/dropdown","@starasia/hooks","@starasia/http","@starasia/input","@starasia/menu","@starasia/pagination","@starasia/storage","@starasia/table","@starasia/tabs","@starasia/textarea","@starasia/theme","@starasia/toast","@starasia/toggle","@starasia/tooltip","@starasia/checkbox","@starasia/radio","@starasia/text","@starasia/icon","@starasia/flex","@starasia/grid","@starasia/progress","@starasia/stepper","@starasia/accordion","@starasia/story-record","@starasia/skeleton","@starasia/progress-stepper","react/jsx-runtime","react","react-router","react-dom","react-easy-crop"],lr):(g=typeof globalThis<"u"?globalThis:g||self,lr(g["@starasia/admin"]={},g.alert,g.badges,g.box,g.breadcrumb,g.button,g.card,g.date,g.dialog,g.drawer,g.dropdown,g.hooks,g.http,g.input,g.menu,g.pagination,g.storage,g.table,g.tabs,g.textarea,g.theme,g.toast,g.toggle,g.tooltip,g.checkbox,g.radio,g.text,g.icon,g.flex,g.grid,g.progress,g.stepper,g.accordion,g.storyRecord,g.skeleton,g.progressStepper,g.jsxRuntime,g.React,g.ReactRouter,g.ReactDOM,g.ReactEasyCrop))})(this,function(g,lr,Ke,u,or,j,It,rr,We,kr,nr,pe,cr,$e,A,gr,ur,q,Ot,Ur,sr,Wt,ir,Be,qe,Jr,k,M,oe,At,zt,Ht,Vt,Pt,Ae,jt,e,h,Ce,Yr,uo){"use strict";const yo={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},Xr=h.createContext(yo),Kr=()=>h.useContext(Xr),Nt=r=>{const[t,l]=h.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:l}},_t=h.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),qt=({children:r})=>{const[t,l]=h.useState({}),n=h.useCallback(s=>{l(a=>typeof s=="function"?s(a):s)},[]),o=h.useCallback((s,a)=>{l(d=>{const y=typeof a=="function"?a(d[s]):a;return{...d,[s]:y}})},[]),c=h.useCallback(s=>{l(a=>{if(!(s in a))return a;const d={...a};return delete d[s],d})},[]),i=h.useMemo(()=>({badges:t,setBadge:o,setBadges:n,clearBadge:c}),[t,o,n,c]);return e.jsx(_t.Provider,{value:i,children:r})},Zt=()=>h.useContext(_t),Br=(r,t)=>{const l=t!==void 0?t:r;return l==null?null:typeof l=="string"||typeof l=="number"?{value:l}:l},Gt=h.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),Qt=({children:r,defaultCollapsed:t=!1})=>{const[l,n]=h.useState(t),[o,c]=h.useState(!1),i=h.useCallback(v=>{n(T=>typeof v=="function"?v(T):v)},[]),s=h.useCallback(()=>n(v=>!v),[]),a=h.useCallback(()=>n(!0),[]),d=h.useCallback(()=>n(!1),[]),y=h.useCallback(v=>{c(T=>typeof v=="function"?v(T):v)},[]),b=h.useCallback(()=>c(!0),[]),p=h.useCallback(()=>c(!1),[]),x=h.useCallback(()=>c(v=>!v),[]),I=h.useMemo(()=>({collapsed:l,setCollapsed:i,toggle:s,collapse:a,expand:d,mobileOpen:o,setMobileOpen:y,openMobile:b,closeMobile:p,toggleMobile:x}),[l,i,s,a,d,o,y,b,p,x]);return e.jsx(Gt.Provider,{value:I,children:r})},Ut=()=>h.useContext(Gt),Jt=({router:r,menus:t=[],menuBottom:l,logo:n,appName:o="Workspace",initialUserData:c,theme:i})=>{const s=Nt({initialUserData:c}),{theme:a}=sr.useTheme();return e.jsx(Xr.Provider,{value:{logo:n,appName:o,menus:t,userData:s.userData,setUserData:s.setUserData,menuBottom:l},children:e.jsx(qt,{children:e.jsx(Qt,{children:i?e.jsx(sr.ThemeProvider,{value:i,children:r}):a?e.jsx(sr.ThemeProvider,{value:a,children:r}):r})})})},po=h.memo(Jt);function Yt({collapsed:r=!1,children:t}){if(!t)return null;const l=typeof t=="function",n=l?t({collapsed:r}):t;return n==null||n===!1?null:e.jsx("div",{style:{position:"sticky",top:"4rem",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:"0.5rem",paddingRight:"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:l?n:e.jsx("div",{style:{opacity:r?0:1,transition:"opacity 0.3s",visibility:r?"hidden":"visible"},children:n})})}const $r=h.createContext(null);function Xt({children:r}){const[t,l]=h.useState(null),[n,o]=h.useState(null),[c,i]=h.useState(null),[s,a]=h.useState(0),d=h.useCallback(()=>(a(y=>y+1),()=>a(y=>y-1)),[]);return e.jsx($r.Provider,{value:{prependNode:t,appendNode:n,replaceNode:c,setPrependNode:l,setAppendNode:o,setReplaceNode:i,replaceCount:s,registerReplace:d},children:r})}function Kt({children:r}){const t=h.useContext($r);return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:t.setPrependNode,style:{display:"contents"}}),t.replaceCount>0?e.jsx("div",{ref:t.setReplaceNode,style:{display:"contents"}}):r,e.jsx("div",{ref:t.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:r})}function bo({children:r,mode:t="append"}){const l=h.useContext($r);if(h.useEffect(()=>{if(!(t!=="replace"||!l))return l.registerReplace()},[t,l]),!l)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const n=t==="prepend"?l.prependNode:t==="replace"?l.replaceNode:l.appendNode;return n?Yr.createPortal(r,n):null}const Rr=h.createContext(null);function $t({children:r}){const[t,l]=h.useState({}),[n,o]=h.useState({}),c=h.useCallback((a,d)=>{l(y=>y[a]===d?y:{...y,[a]:d})},[]),i=h.useCallback(a=>(o(d=>({...d,[a]:(d[a]??0)+1})),()=>o(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),s=h.useMemo(()=>({outletNodes:t,setOutletNode:c,slotCounts:n,registerSlot:i}),[t,c,n,i]);return e.jsx(Rr.Provider,{value:s,children:r})}function Rt({slotKey:r,fallback:t}){const l=h.useContext(Rr),n=l?(l.slotCounts[r]??0)>0:!1,o=h.useRef(l==null?void 0:l.setOutletNode);o.current=l==null?void 0:l.setOutletNode;const c=h.useCallback(i=>{var s;return(s=o.current)==null?void 0:s.call(o,r,i)},[r]);return e.jsx(e.Fragment,{children:n?e.jsx("div",{ref:c,style:{display:"contents"}}):t})}function Co({slotKey:r,children:t}){const l=h.useContext(Rr),n=h.useRef(l==null?void 0:l.registerSlot);if(n.current=l==null?void 0:l.registerSlot,h.useEffect(()=>{var c;return(c=n.current)==null?void 0:c.call(n,r)},[r]),!l)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const o=l.outletNodes[r];return o?Yr.createPortal(t,o):null}const mr="moduleSwitcherGroupId",et="sa-module-switcher-change";function el(){if(typeof window>"u")return null;const r=window.localStorage.getItem(mr);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function rl(r){typeof window>"u"||(r===null?window.localStorage.removeItem(mr):window.localStorage.setItem(mr,String(r)),window.dispatchEvent(new CustomEvent(et,{detail:r})))}function vo(){rl(null)}function rt(){const[r,t]=h.useState(()=>el());return h.useEffect(()=>{const n=()=>{t(el())},o=c=>{c.key===mr&&n()};return window.addEventListener(et,n),window.addEventListener("storage",o),()=>{window.removeEventListener(et,n),window.removeEventListener("storage",o)}},[]),{selectedGroupId:r,setSelectedGroupId:n=>{rl(n),t(n)}}}let Fr=0,tr=!1,tl=new Set;const ll=()=>e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"1.667",y:"1.667",width:"12.667",height:"12.667",rx:"2"}),e.jsx("line",{x1:"6",y1:"1.667",x2:"6",y2:"14.333"})]}),ol={width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",paddingLeft:"0.75rem",paddingRight:"0.75rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",fontSize:"0.875rem",color:"var(--sa-text-subtle, #8c8f97)",background:"transparent",border:"none",borderRadius:"0.375rem",cursor:"pointer",textAlign:"left"};function xo({children:r,headerLeftSlot:t,profile:l,isLoadingProfile:n,onLogout:o,isLoggingOut:c,loadingComponent:i,sidebarHeaderContent:s,headerActions:a,profileRole:d,profileMenuButtons:y,profileMenuItems:b,logoutButton:p}){var Ve,Ue;const[x]=Ce.useSearchParams(),I=x.get("embed")==="true",v=Kr(),{badges:T}=Zt(),F=Ce.useNavigate(),O=Ce.useLocation(),D=!pe.useMediaQuery("md"),[H,z]=h.useState(!1),{collapsed:S,setCollapsed:L,mobileOpen:V,setMobileOpen:P}=Ut(),[Z,Y]=h.useState(!1),[te,fe]=h.useState(()=>new Set(tl)),[de,ee]=h.useState(null),{selectedGroupId:Q,setSelectedGroupId:X}=rt();h.useEffect(()=>{tl=te},[te]);const he=h.useRef(null),Se=h.useRef(null);h.useEffect(()=>{const m=he.current;if(!m)return;const G=()=>{tr||(Fr=m.scrollTop)};return m.addEventListener("scroll",G),()=>m.removeEventListener("scroll",G)},[]);const se=()=>{const m=he.current;m&&Fr>0&&(tr=!0,m.scrollTop=Fr,requestAnimationFrame(()=>{tr=!1}))};h.useLayoutEffect(()=>{tr=!0,se();const m=setTimeout(()=>{tr=!1},300);return()=>clearTimeout(m)},[]),h.useLayoutEffect(()=>{v.menus.length>0&&(Fr>0?se():requestAnimationFrame(()=>{var G;const m=(G=he.current)==null?void 0:G.querySelector("[data-menu-active='true']");m&&m.scrollIntoView({block:"center",behavior:"instant"})}))},[v.menus]),h.useEffect(()=>{tr=!0,se();const m=setTimeout(se,0),G=setTimeout(se,50),$=setTimeout(se,100),W=setTimeout(se,200),U=setTimeout(()=>{tr=!1},300),_=setTimeout(()=>{const J=he.current,N=J==null?void 0:J.querySelector("[data-menu-active='true']");if(J&&N){const ge=J.getBoundingClientRect(),Fe=N.getBoundingClientRect();Fe.top>=ge.top&&Fe.bottom<=ge.bottom||N.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(m),clearTimeout(G),clearTimeout($),clearTimeout(W),clearTimeout(U),clearTimeout(_)}},[O.pathname]),h.useEffect(()=>{Se.current&&(Se.current.scrollTop=0)},[O.pathname]),h.useEffect(()=>{D&&P(!1)},[O.pathname,D]),h.useEffect(()=>{D&&L(!0)},[D]);const ve=()=>{z(!0)},Te=()=>{z(!1)},ke=()=>{z(!1),o()},He=m=>{const G=[m.to];return m.children&&G.push(...m.children.map($=>$.to)),G},Ie=[...v.menus.flatMap(m=>m.items.flatMap(He)),...((Ve=v.menuBottom)==null?void 0:Ve.flatMap(He))??[]],be=m=>{if(!O.pathname.startsWith(m))return!1;const G=Ie.filter($=>O.pathname.startsWith($)).sort(($,W)=>W.length-$.length)[0];return m===G};h.useEffect(()=>{var G;const m=$=>{var W;(W=$.children)!=null&&W.some(U=>O.pathname.startsWith(U.to))&&fe(U=>{const _=new Set(U);return _.add($.id),_})};v.menus.forEach($=>{$.items.forEach(m)}),(G=v.menuBottom)==null||G.forEach(m)},[O.pathname,v.menus,v.menuBottom]);const Ze=m=>{fe(G=>{const $=new Set(G);return $.has(m)?$.delete(m):$.add(m),$})};h.useEffect(()=>{v.menus.length!==0&&Q!==null&&!v.menus.some(m=>m.id===Q)&&X(null)},[v.menus,Q,X]);const xe=h.useMemo(()=>{if(Q!==null)return v.menus.filter($=>$.id===Q||$.parentGroupId===Q);const m=v.menus.filter($=>$.parentGroupId===void 0),G=v.menus.filter($=>$.parentGroupId!==void 0).flatMap($=>$.items);return G.length===0?m:[...m,{id:18,name:"Pengaturan",items:G,parentGroupId:void 0}]},[v.menus,Q]);if(I)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:r||e.jsx(Ce.Outlet,{})});const je=m=>{const G=m.children&&m.children.length>0,$=te.has(m.id),W=G?m.children.some(J=>be(J.to)):be(m.to),U=Br(m.badge,T[m.id]),_=!!U&&S&&!D;return e.jsxs("div",{"data-menu-active":W||void 0,children:[e.jsxs("button",{onClick:J=>{if(G)if(S&&!D){const N=J.currentTarget.getBoundingClientRect();ee({item:m,top:N.top,left:N.right+8})}else Ze(m.id);else F(m.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:S&&!D?"center":void 0,gap:"0.5rem",paddingLeft:S&&!D?"0":"0.5rem",paddingRight:S&&!D?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:W?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:W?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:W?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:S&&!D?m.title:void 0,onMouseEnter:J=>{W||(J.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:J=>{W||(J.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(M.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),_&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:"-2px",right:"-2px",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-error-500, #ff4d6d)",border:"1px solid var(--sa-background-primary, #ffffff)"}})]}),(!S||D)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",transition:"opacity 0.3s",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:m.title}),U&&e.jsx(Ke.Badges,{text:String(U.value),variant:U.variant??"info",size:"xs",border:!0}),G&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:$?"rotate(180deg)":"rotate(0deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),G&&(!S||D)&&(()=>{const J=m.children.findIndex(N=>be(N.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:$?`${m.children.length*36}px`:"0px",opacity:$?1:0,marginTop:$?"0.25rem":"0px"},children:[e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"1.5px",height:"100%",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),J>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${J*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),m.children.map(N=>{const ge=Br(N.badge,T[N.id]);return e.jsxs("button",{onClick:()=>F(N.to),style:{width:"100%",display:"flex",alignItems:"center",gap:"0.5rem",paddingLeft:"0.75rem",paddingRight:"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:be(N.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:be(N.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:be(N.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:be(N.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:Fe=>{be(N.to)||(Fe.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:Fe=>{be(N.to)||(Fe.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(M.Icon,{name:N.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:N.title}),ge&&e.jsx(Ke.Badges,{text:String(ge.value),variant:ge.variant??"info",size:"xs",border:!0})]},N.id)})]})})()]},m.id)};return e.jsx($t,{children:e.jsxs(Xt,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":D?"0px":S?"4.375rem":"16.375rem","--app-footer-zindex":D&&V?"40":"998"},children:[D&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:V?.5:0,pointerEvents:V?"auto":"none",transition:"opacity 0.3s"},onClick:()=>P(!1)}),e.jsxs("aside",{style:{width:D?"16.375rem":S?"4.375rem":"16.375rem",position:D?"fixed":"relative",...D&&{inset:0,zIndex:50,transform:V?"translateX(0)":"translateX(-100%)"},backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",borderRight:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",flexDirection:"column",transition:"all 0.3s ease-in-out",flexShrink:D?void 0:0},children:[e.jsx("div",{onMouseEnter:()=>Y(!0),onMouseLeave:()=>Y(!1),style:{height:"4rem",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",position:"relative"},children:(()=>{const m=!D&&S&&!V,G=m&&Z;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:m?1:void 0,justifyContent:m?"center":void 0,transition:"opacity 0.2s",opacity:G?0:1,pointerEvents:G?"none":"auto"},children:[e.jsx("img",{src:v.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!S||V)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:v.appName})]}),!D&&!S&&e.jsx("button",{type:"button",onClick:()=>L(!0),"aria-label":"Collapse sidebar",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1rem",height:"1rem",padding:0,background:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer",flexShrink:0},children:e.jsx(ll,{})}),m&&e.jsx("button",{type:"button",onClick:()=>L(!1),"aria-label":"Expand sidebar",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2rem",height:"2rem",padding:0,background:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-sm, 0.375rem)",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer",opacity:G?1:0,pointerEvents:G?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(ll,{})})}),D&&e.jsx("button",{onClick:()=>P(!1),"aria-label":"Close menu",style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.25rem",height:"1.25rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})()}),s&&e.jsx(Yt,{collapsed:D?!1:S,children:s}),e.jsx("div",{ref:he,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:xe.map(m=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!S||D?m.name&&e.jsx("div",{style:{paddingLeft:"1.5rem",paddingRight:"1rem",paddingTop:"0rem",paddingBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"400",color:"var(--sa-text-subtlest, #6b6e76)",transition:"opacity 0.3s",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:m.name}):m.name&&e.jsx("div",{"aria-label":m.name,style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"0.75rem",paddingBottom:"0.75rem"},children:e.jsx("span",{style:{display:"block",width:"1rem",height:"2px",borderRadius:"1px",backgroundColor:m.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx("div",{style:{paddingLeft:"1rem",paddingRight:"1rem",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)"},children:m.slotKey?e.jsx(Rt,{slotKey:m.slotKey,fallback:m.items.map(G=>je(G))}):m.items.map(G=>je(G))})]},m.id))}),v.menuBottom&&v.menuBottom.length>0&&e.jsx("div",{style:{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",paddingTop:"0.75rem",paddingBottom:"0.75rem",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)",flexShrink:0},children:v.menuBottom.map(m=>je(m))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("header",{style:{height:"4rem",backgroundColor:"var(--sa-background-primary, #ffffff)",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:D?"1rem":void 0},children:[D&&e.jsx("button",{onClick:()=>P(!0),style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.5rem",height:"1.5rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),e.jsx(Kt,{children:t})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[a,e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[e.jsxs("div",{style:{textAlign:"right",maxWidth:"12.5rem"},children:[e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:500,color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?"Loading...":(l==null?void 0:l.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?"":(l==null?void 0:l.email)||"unknown"})]}),e.jsx("div",{style:{width:"2.5rem",height:"2.5rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"0.875rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",flexShrink:0,backgroundColor:"var(--sa-background-brand, #04254f)"},children:((l==null?void 0:l.name)||"U")[0].toUpperCase()}),e.jsx(M.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(A.MenuLists,{style:{width:"280px",paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(A.MenuHeading,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",paddingBlock:"0.5rem"},children:[e.jsx("div",{style:{width:"4rem",height:"4rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"1.25rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",marginBottom:"0.75rem",backgroundColor:"var(--sa-background-brand, #04254f)"},children:((l==null?void 0:l.name)||"U")[0].toUpperCase()}),e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:600,color:"var(--sa-text-primary, #292a2e)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(l==null?void 0:l.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(l==null?void 0:l.email)||"unknown"}),d&&e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d})]})}),(y&&y.length>0||b)&&e.jsxs(A.MenuBody,{children:[y==null?void 0:y.map((m,G)=>e.jsx(A.MenuButton,{children:e.jsxs("button",{type:"button",onClick:m.onClick,style:ol,onMouseEnter:$=>{$.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:$=>{$.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(M.Icon,{name:m.icon,size:"md"}),e.jsx("span",{children:m.label})]})},`${m.label}-${G}`)),b]}),p??e.jsx(A.MenuFooter,{children:e.jsx(A.MenuButton,{children:e.jsxs("button",{type:"button",onClick:ve,style:{...ol,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(M.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:Se,style:{flex:1,overflowY:"auto"},children:r||e.jsx(Ce.Outlet,{})})]})]}),c&&i&&e.jsx("div",{style:{position:"fixed",inset:0,background:"var(--sa-color-black-alpha-a70, #181a19b8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:i}),e.jsxs(We.Dialog,{isShow:H,onHide:Te,children:[e.jsx(We.DialogTitle,{children:"Confirmation Logout"}),e.jsx(We.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(We.DialogFooter,{children:e.jsx(u.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(oe.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(u.Box,{direction:"column",children:e.jsx(j.Button,{secondary:!0,onClick:Te,children:"Cancel"})}),e.jsx(u.Box,{direction:"column",children:e.jsx(j.Button,{primary:!0,onClick:ke,children:"Yes, Sure"})})]})})})]}),de&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>ee(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":de.item.title,style:{position:"fixed",top:de.top,left:de.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem",backgroundColor:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-md, 0.5rem)",boxShadow:"var(--sa-shadow-lg, 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a)",padding:"0.5rem",display:"flex",flexDirection:"column",gap:"0.125rem"},children:[e.jsx("div",{style:{fontSize:"0.75rem",fontWeight:600,color:"var(--sa-color-gray-500, #8c8f97)",padding:"0.25rem 0.5rem 0.5rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:de.item.title}),(Ue=de.item.children)==null?void 0:Ue.map(m=>{const G=be(m.to),$=Br(m.badge,T[m.id]);return e.jsxs("button",{onClick:()=>{F(m.to),ee(null)},style:{width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.5rem 0.75rem",borderRadius:"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:G?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:G?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:W=>{G||(W.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:W=>{G||(W.currentTarget.style.backgroundColor="transparent")},children:[m.icon&&e.jsx(M.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:m.title}),$&&e.jsx(Ke.Badges,{text:String($.value),variant:$.variant??"info",size:"xs",border:!0})]},m.id)})]})]})]})})}const yr=h.forwardRef(({children:r,...t},l)=>e.jsx(u.Box,{ref:l,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...t,children:r})),nl=({title:r,iconName:t,textColor:l,iconColor:n,hoverTextColor:o,hoverIconColor:c})=>{const[i,s]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=l??"var(--sa-text-subtle, #8c8f97)",y=c??"var(--sa-text-subtle, #8c8f97)",b=o??"var(--sa-text-primary, #292a2e)";return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{cursor:"pointer"},children:[e.jsx(M.Icon,{name:t||"ChevronLeft",size:"xs",style:{color:i?y:a,transition:"color 0.15s ease"}}),e.jsx(k.Text,{variant:"sub-h3",style:{color:i?b:d,transition:"color 0.15s ease"},children:r||"Back"})]})},wo=({items:r,separator:t="/",iconName:l,iconColor:n,hoverIconColor:o})=>{const[c,i]=h.useState(!1),s=n??"var(--sa-text-subtle, #8c8f97)",a=o??"var(--sa-text-subtle, #8c8f97)",d=r.length>1?r[0]:void 0,y=!!(d!=null&&d.to||d!=null&&d.onClick),b=e.jsx(M.Icon,{name:l||"ChevronLeft",size:"xs",onMouseEnter:y?()=>i(!0):void 0,onMouseLeave:y?()=>i(!1):void 0,style:{color:y&&c?a:s,transition:"color 0.15s ease",cursor:y?"pointer":void 0}}),p=d!=null&&d.to?e.jsx(Ce.Link,{to:d.to,replace:!0,style:{textDecoration:"none"},children:b}):d!=null&&d.onClick?e.jsx(yr,{onClick:d.onClick,children:b}):b;return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",children:[p,e.jsx(or.Breadcrumb,{separator:t,size:"md",children:r.map((x,I)=>{const v=I===r.length-1;return x.to&&!v?e.jsx(or.BreadcrumbItem,{children:e.jsx(Ce.Link,{to:x.to,children:x.label})},I):e.jsx(or.BreadcrumbItem,{currentPage:v,children:e.jsx(or.BreadcrumbLink,{onClick:v?void 0:x.onClick,children:x.label})},I)})})]})},Do=r=>{const{items:t,separator:l,onClick:n,navigateTo:o,...c}=r;return t&&t.length>0?e.jsx(wo,{items:t,separator:l,iconName:c.iconName,iconColor:c.iconColor,hoverIconColor:c.hoverIconColor}):o?e.jsx(u.Box,{direction:"row",children:e.jsx(Ce.Link,{to:o,replace:!0,style:{textDecoration:"none"},children:e.jsx(nl,{...c})})}):e.jsx(u.Box,{direction:"row",children:e.jsx(yr,{onClick:n,children:e.jsx(nl,{...c})})})},tt=[{icon:"var(--sa-color-brand-400, #3366b7)",activeBg:"var(--sa-color-brand-50, #e6edf6)",activeBorder:"var(--sa-color-brand-300, #668cc9)",activeShadow:"rgba(51, 102, 183, 0.25)"},{icon:"var(--sa-color-warning-400, #ed9f30)",activeBg:"var(--sa-color-warning-50, #fef2e6)",activeBorder:"var(--sa-color-warning-300, #f1b259)",activeShadow:"rgba(237, 159, 48, 0.25)"},{icon:"var(--sa-color-secondary-300, #5468e1)",activeBg:"var(--sa-color-secondary-50, #e6e9fb)",activeBorder:"var(--sa-color-secondary-200, #8a98ea)",activeShadow:"rgba(84, 104, 225, 0.25)"},{icon:"var(--sa-color-info-500, #00abeb)",activeBg:"var(--sa-color-info-50, #effaff)",activeBorder:"var(--sa-color-info-300, #75dbff)",activeShadow:"rgba(0, 171, 235, 0.25)"},{icon:"var(--sa-color-success-500, #30ce84)",activeBg:"var(--sa-color-success-50, #ecfff6)",activeBorder:"var(--sa-color-success-300, #75dead)",activeShadow:"rgba(48, 206, 132, 0.25)"},{icon:"var(--sa-color-error-400, #ff758f)",activeBg:"var(--sa-color-error-50, #fff0f3)",activeBorder:"var(--sa-color-error-300, #ff8fa3)",activeShadow:"rgba(255, 117, 143, 0.25)"}];function cl(r,t,l){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:r?`2px solid ${l.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:r?l.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:r?t?`0 8px 20px ${l.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${l.activeShadow}`:t?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:t?"translateY(-3px) scale(1.05)":"translateY(0) scale(1)",transition:"box-shadow 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease"}}const sl={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},il={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function al({isShow:r,onHide:t,menus:l,selectedGroupId:n,onSelect:o}){const[c,i]=h.useState(void 0),s=d=>{o(d),t()},a=tt[0];return e.jsx(We.Dialog,{isShow:r,onHide:t,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(We.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>s(null),onMouseEnter:()=>i("all"),onMouseLeave:()=>i(void 0),style:il,children:[e.jsx("div",{style:cl(n===null,c==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(M.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:sl,children:"Semua"})]}),l.map((d,y)=>{var v;const b=n===d.id,p=c===d.id,x=((v=d.items[0])==null?void 0:v.icon)??"Grid",I=tt[(y+1)%tt.length];return e.jsxs("button",{onClick:()=>s(d.id),onMouseEnter:()=>i(d.id),onMouseLeave:()=>i(void 0),style:il,children:[e.jsx("div",{style:cl(b,p,I),children:e.jsx("div",{style:{color:I.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(M.Icon,{name:x,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:sl,children:d.name})]},d.id)})]})})})}function So({onSelect:r,"aria-label":t="Pilih module"}={}){const l=Kr(),n=Ce.useNavigate(),{selectedGroupId:o,setSelectedGroupId:c}=rt(),[i,s]=h.useState(!1),a=d=>{var y;if(c(d),d!==null){const b=l.menus.find(x=>x.id===d),p=(y=b==null?void 0:b.items[0])==null?void 0:y.to;p&&n(p)}r==null||r(d)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>s(!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2.25rem",height:"2.25rem",borderRadius:"var(--sa-radii-sm, 0.25rem)",border:"1px solid var(--sa-border-subtle, #0b120e24)",color:"var(--sa-text-subtle, #8c8f97)",backgroundColor:"transparent",cursor:"pointer"},"aria-label":t,onMouseEnter:d=>{d.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:e.jsx(M.Icon,{name:"GridApplication",size:"sm"})}),o!==null&&e.jsx("span",{style:{position:"absolute",top:"0.25rem",right:"0.25rem",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-brand-500, #1a4fa0)"},"aria-hidden":"true"})]}),e.jsx(al,{isShow:i,onHide:()=>s(!1),menus:l.menus.filter(d=>d.parentGroupId===void 0),selectedGroupId:o,onSelect:a})]})}const ko=(r,t)=>{const l=[];if(t===0)return l.push(r),l;for(let n=0;n<r.length;n+=t){const o=r.slice(n,n+t);l.push(o)}return l},Bo=h.memo(({value:r,label:t,separator:l,labelWidth:n,lastIndex:o,labelAlign:c="top"})=>{const i=h.useMemo(()=>({padding:0,paddingBottom:o?0:12,verticalAlign:c}),[o,c]),s=h.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:o?0:12,verticalAlign:c}),[o,c]),a=()=>typeof t=="string"?e.jsx(k.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,d=()=>typeof r=="string"||typeof r=="number"?e.jsx(k.Text,{color:"primary",fontWeight:"medium",children:r}):r,y=()=>typeof l=="string"||typeof l=="number"?e.jsx(k.Text,{fontWeight:"medium",color:"subtlest",children:l}):l;return e.jsxs(q.Tr,{children:[e.jsx(q.Td,{style:i,width:n,children:a()}),l?e.jsx(q.Td,{style:s,width:24,children:y()}):null,e.jsx(q.Td,{style:i,children:d()})]})}),mo=h.memo(({fields:r,separator:t,labelWidth:l})=>e.jsx(q.Table,{withColumnBorder:!1,withRowBorder:!1,children:r.map((n,o)=>e.jsx(Bo,{separator:t,labelWidth:l,lastIndex:o===r.length-1,...n},`field-group-field-${o}`))})),Fo=h.memo(({maxRow:r=0,maxColumn:t=2,separator:l=":",fields:n=[],labelWidth:o=150,bordered:c=!1})=>{const i=h.useMemo(()=>ko(n,r),[n,r]),s=i.length>2,a=()=>{switch(t){case 1:return"width-full";case 2:return"width-1-2";case 3:return"width-1-3";case 4:return"width-1-4";default:return"width-1-2"}};return e.jsx(u.Box,{gap:s?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:s?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:c?"border":void 0,borderStyle:c?"border-solid":void 0,borderColor:c?"border-subtle":void 0,children:i.map((d,y)=>e.jsx(u.Box,{direction:"column",flex:s?void 0:"1",width:s?a():void 0,marginBottom:s?"lg":void 0,children:e.jsx(mo,{labelWidth:o,fields:d,separator:l})},y))})}),Eo=({backButton:r})=>{const[t,l]=h.useState(!1),n=(r==null?void 0:r.iconColor)??"var(--sa-text-subtle, #8c8f97)",o=(r==null?void 0:r.textColor)??"var(--sa-text-subtle, #8c8f97)",c=(r==null?void 0:r.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",i=(r==null?void 0:r.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{cursor:"pointer"},children:[e.jsx(M.Icon,{name:(r==null?void 0:r.iconName)||"ChevronLeft",size:"xs",style:{color:t?c:n,transition:"color 0.15s ease"}}),e.jsx(k.Text,{variant:"sub-h3",style:{color:t?i:o,textDecoration:t?"underline":"none",transition:"color 0.15s ease"},children:(r==null?void 0:r.title)||"Back"})]})},Mo=({backButton:r,title:t,titleIcon:l,titleTag:n,children:o,header:c=!0,headerBorder:i=!1,subHeaders:s,action:a,titleTagProps:d,containerProps:y,headerProps:b})=>{const p=pe.useMediaQuery("md"),x=Ce.useNavigate(),I=Ce.useLocation(),v=r==null?void 0:r.show,T=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}x(-1,{replace:!0})},F=()=>{if(!a)return null;if(h.isValidElement(a))return a;const S=a.filter(L=>L&&(L.title||L.icon));return S.length===0?null:p?e.jsx(u.Box,{direction:"row",gap:"md",children:S.map(({title:L,icon:V,buttonProps:P,onClick:Z},Y)=>e.jsx(j.Button,{iconLeft:V?e.jsx(M.Icon,{name:V,size:"md"}):void 0,onClick:Z,...P,children:L},`action-${Y}`))}):e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(M.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{minWidth:200},children:S.map(({title:L,icon:V,buttonProps:P,onClick:Z},Y)=>{const te=(P==null?void 0:P.tone)==="error"||(P==null?void 0:P.danger)===!0;return e.jsx(A.MenuItem,{intent:te?"danger":void 0,disabled:P==null?void 0:P.disabled,startIcon:V?e.jsx(M.Icon,{name:V}):void 0,onClick:Z,children:L},`action-${Y}`)})})})]})},O=()=>{const S=e.jsx(Eo,{backButton:r});return r!=null&&r.navigateTo?e.jsx(u.Box,{direction:"row",children:e.jsx(Ce.Link,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:S})}):e.jsx(u.Box,{direction:"row",children:e.jsx(yr,{onClick:T,children:S})})},B=()=>{const S=!!t,L=Array.isArray(a)&&a.length>0,V=h.isValidElement(a)?!0:L;if(!S&&!V&&!v)return null;const Z=p||!p&&L;return e.jsxs(u.Box,{direction:"column",gap:"xs",paddingBlock:(b==null?void 0:b.paddingBlock)??"sm",paddingInline:(b==null?void 0:b.paddingInline)??"md",...b,style:{...i?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...b==null?void 0:b.style},children:[v&&O(),(S||V)&&e.jsxs(u.Box,{direction:Z?"row":"column",gap:"sm",justify:"space-between",align:Z?"center":"flex-start",children:[S?typeof t=="string"?e.jsxs(u.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[l&&e.jsx(M.Icon,{name:l,size:"md",color:"primary"}),e.jsx(k.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:t})]}),n&&e.jsx(Ke.Badge,{border:!0,size:"lg",text:n,...d})]}):t:null,F()]})]})},D=()=>{if(!s||s.length===0)return null;const S=s.filter(P=>P.show!==!1);if(S.length===0)return null;let L=0,V=-1/0;return S.forEach((P,Z)=>{const Y=P.order??0;Y>=V&&(V=Y,L=Z)}),S.map(({content:P,order:Z,borderBottom:Y=!0,keepBottomPadding:te=!1,paddingInline:fe=!0,paddingBlock:de=!0},ee)=>e.jsx(u.Box,{direction:"column",paddingTop:de?"sm":"spacing-0",paddingBottom:de&&(Y||te||ee===L)?"sm":"spacing-0",paddingInline:fe?"md":"spacing-0",style:{...Y?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...Z!==void 0?{order:Z}:{}},children:P},`sub-header-${ee}`))},H=()=>{const S=c?B():null,L=D();return!S&&!L?null:e.jsxs(u.Box,{direction:"column",style:{marginBottom:L?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[S,L]})},z=()=>o;return e.jsxs(u.Box,{direction:"column",as:"main",...y,style:{...(y==null?void 0:y.style)??{},animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"},children:[H(),z()]},I.pathname)},Lo=h.memo(Mo),To={icon:"Cross",title:""},Io="calc(100vw - 16px)",dl=r=>r==null?void 0:`min(${typeof r=="number"?`${r}px`:r}, ${Io})`,hl=h.forwardRef(({onHide:r,show:t,withBlur:l=!1,style:n,children:o,closeButton:c=To,width:i,minWidth:s="357px",maxWidth:a="357px"},d)=>{const y=dl(i??s),b=dl(i??a);return e.jsx(kr.Drawer,{blur:l,isShow:t,position:"right",onHide:r,ref:d,style:{minWidth:y,maxWidth:b,...n},children:e.jsxs(u.Box,{direction:"column",padding:"lg",children:[c?e.jsxs(u.Box,{direction:"row",align:"center",gap:"sm",onClick:r,marginBottom:"lg",cursor:"pointer",children:[e.jsx(M.Icon,{name:c.icon,size:"md",color:"subtle",cursor:"pointer"}),c.title?e.jsx(k.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:c.title}):null]}):null,o]})})}),lt=h.memo(({children:r,borderBottom:t=!0,padding:l=!0})=>{const n=pe.useMediaQuery("lg");return e.jsx(u.Box,{direction:"column",padding:l?"md":"spacing-0",paddingLeft:l?"md":"spacing-0",paddingRight:l?"md":"spacing-0",style:t?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),ot=h.memo(({children:r,borderTop:t=!0,padding:l=!0})=>{const n=pe.useMediaQuery("lg");return e.jsx(u.Box,{direction:"column",padding:l?"md":"spacing-0",paddingLeft:l?"md":"spacing-0",paddingRight:l?"md":"spacing-0",style:t?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),Oo=h.memo(({children:r,...t})=>e.jsx(u.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),Wo=h.memo(({children:r,title:t,titleTag:l,action:n,header:o,footer:c,actionContainer:i,containerProps:s,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:y={borderTop:!0},variantTag:b="info"})=>{const p=pe.useMediaQuery("lg"),x=()=>l?e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(k.Text,{fontWeight:"medium",children:t}),e.jsx(Ke.Badges,{border:!0,text:l,variant:b})]}):e.jsx(k.Text,{fontWeight:"medium",children:t}),I=()=>o||e.jsxs(u.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(u.Box,{direction:"column",children:t?x():null}),e.jsx(u.Box,{direction:"column",style:p?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...i,children:n??null})]}),v=!!(o||t||n);return e.jsxs(u.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...s,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(s==null?void 0:s.style)??{}},children:[o!==null&&v?e.jsx(lt,{...d,children:I()}):null,e.jsx(Oo,{...a,children:r}),c?e.jsx(ot,{...y,children:c}):null]})}),ze={H1:r=>e.jsx(k.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(k.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(k.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(k.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(k.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(k.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(k.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(k.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(k.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(k.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(k.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(k.Text,{variant:"body-3",children:r.children,...r.props})},Ee=()=>{const[r,t]=Ce.useSearchParams(),l=cr.searchParamsToObject(r.toString()),n=Ce.useParams(),o=Ce.useLocation(),c=n.id;return{setSearchParams:t,searchParams:r,searchQueries:l,isHasQuery:(y,b)=>r.has(y)&&r.get(y)===b,getQueryParam:y=>r.get(y),getRouteParam:y=>n[y],params:n,location:o,id:c,hasId:!!c}},fl=r=>JSON.stringify(r),gl=r=>JSON.stringify(r),ul=r=>JSON.stringify(r),yl=r=>JSON.stringify(r),Ao=r=>r,zo=r=>JSON.stringify(r),pr=({value:r,name:t,type:l,withSearchParam:n=!0,setSearchParams:o,searchQueries:c,dropdownSearchKey:i,filterKey:s="filter",pageKey:a="page"})=>{if(n){let d;switch(l){case"search":d=Ao(r);break;case"dropdown":case"dropdown-multiple":d=fl(r);break;case"radio":d=gl(r);break;case"date-range":d=ul(r);break;case"advanced-date-range":d=zo(r);break;case"date":d=yl(r);break;default:d=r;break}if(typeof d<"u"){const b={...c[s]&&typeof c[s]=="string"?JSON.parse(c[s]):void 0,[t]:d},p={...c};i&&typeof i=="string"&&delete p[i],delete p[a];const x={...p,[s]:JSON.stringify(b)},I=new URLSearchParams(c).toString(),v=new URLSearchParams(x).toString();if(I===v)return;o(x)}}},Er=({name:r,filterKey:t="filter",searchParams:l,get:n})=>{const o=l.get(t)||void 0,c=o&&typeof o=="string"?JSON.parse(o):void 0,i=c?c[r]:void 0;return n==="label"&&i?JSON.parse(i)[0].label:n==="value"&&i?JSON.parse(i)[0].value:i},pl=({name:r,filterKey:t="filter",searchParams:l,get:n})=>{const o=l.get(t)||void 0,c=o&&typeof o=="string"?JSON.parse(o):void 0,i=c?c[r]:void 0;return n==="label"&&i?JSON.parse(i).map(s=>s.label):n==="value"&&i?JSON.parse(i).map(s=>s.value):n==="array"&&i?JSON.parse(i):i},Ho=({name:r,filterKey:t="filter",searchParams:l,get:n})=>{const o=l.get(t)||void 0,c=o&&typeof o=="string"?JSON.parse(o):void 0,i=c?c[r]:void 0;return n==="id"&&i?JSON.parse(i).id:n==="label"&&i?JSON.parse(i).label:n==="value"&&i?JSON.parse(i).value:i},Mr=(r,t,l)=>{const n=t.get(l||"filter")||void 0,o=n&&typeof n=="string"?JSON.parse(n):void 0;return o?o[r]:void 0},Vo=({name:r,filterKey:t="filter",searchParams:l})=>{const n=l.get(t||"filter")||void 0,o=n&&typeof n=="string"?JSON.parse(n):void 0,c=o?o[r]:void 0;return{start:c?JSON.parse(c).from:void 0,end:c?JSON.parse(c).to:void 0}},bl=({name:r,filterKey:t="filter",searchParams:l})=>{const n=l.get(t||"filter")||void 0,o=n&&typeof n=="string"?JSON.parse(n):void 0,c=o?o[r]:void 0;return c?JSON.parse(c):void 0},Po=(r,{filterKey:t="filter",perPageKey:l="perPage",pageKey:n="page"})=>{const o=r.get(t)||void 0,c=r.get(l)||void 0,i=r.get(n)||void 0;return!!o||!!c||!!i},Cl=({isOpen:r,onClose:t,filterKey:l,pageKey:n,filters:o})=>{const{searchParams:c,setSearchParams:i,searchQueries:s}=Ee(),[a,d]=h.useState({}),y=()=>{c.delete(l||"filter"),i(c)},b=(p,x)=>{switch(p.type){case"radio":{const{show:I=!0}=p;return I&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},x)}case"dropdown":{const{show:I=!0}=p;return I&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},x)}case"date-range":return e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},x);case"date":return e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},x);case"dropdown-multiple":{const{show:I=!0}=p;return I&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},x)}default:return null}};return e.jsx(hl,{onHide:t,show:r||!1,children:e.jsxs(u.Box,{direction:"column",gap:"md",children:[e.jsxs(oe.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(u.Box,{direction:"column",children:"Filter"}),e.jsx(u.Box,{direction:"column",style:{cursor:"pointer"},onClick:y,children:"Reset"})]}),o==null?void 0:o.map((p,x)=>b(p,x))]})})},vl=({searchKey:r="q",statusKey:t="status",searchPlaceholder:l="Search",searchHighlightPlaceholder:n,extendedFilter:o,showSearchFilter:c=!0,showStatusFilter:i=!0,filterKey:s="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:y,filterConfigs:b,buttonToggleProps:p,position:x="right",titleSearchLabel:I="Work Order",withTitleLabels:v=!1})=>{const F=(p==null?void 0:p.isShowLabel)??!0,[O,B]=h.useState(!1),[D,H]=h.useState(0),z=()=>{H(X=>X+1)},{searchParams:S,setSearchParams:L,getQueryParam:V}=Ee(),P=cr.searchParamsToObject(S.toString()),Z=Mr(r,S,s)||"",[Y,te]=h.useState(Z),fe=V(s),ee=!!(fe&&!(()=>{if(fe)try{const X=JSON.parse(fe);return Object.keys(X).length===1&&X[r]===""}catch(X){console.error("Filter parameter is not a valid JSON:",X)}return!1})()),Q=pe.useMediaQuery("md");return h.useEffect(()=>{te(Z)},[Z]),h.useEffect(()=>{if(Y===Z)return;const X=window.setTimeout(()=>{pr({value:Y,name:r,type:"search",searchQueries:P,setSearchParams:L,filterKey:s,pageKey:a})},350);return()=>{window.clearTimeout(X)}},[Y,Z,r,P,L,s,a]),e.jsxs(oe.Flex,{gap:"md",style:{flexDirection:Q&&x==="left"?"row":Q&&x==="right"?"row-reverse":"column"},align:"flex-end",children:[ee&&e.jsx(u.Box,{direction:"column",justify:"flex-end",children:e.jsx(j.Button,{onClick:()=>{const X=new URLSearchParams(S);X.delete(s),L(X),te(""),z(),y&&y()},variant:"outline",tone:"neutral",children:e.jsx(k.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),o==null?void 0:o.map(({minWidth:X,content:he,title:Se,onClickContainer:se},ve)=>e.jsxs(u.Box,{direction:"column",gap:"sm",onClick:se,style:{minWidth:X},children:[Se&&e.jsx(ze.SubH3,{children:Se}),he]},`extended-filter-${ve}-${D}`)),!!(b!=null&&b.length)&&e.jsx(j.Button,{primary:ee,secondary:!ee,iconLeft:e.jsx(M.Icon,{size:"sm",name:(p==null?void 0:p.icon)||"FilterHorizontal",style:{color:fe?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!Q,onClick:()=>B(!0),children:F?"Filter":void 0}),i&&e.jsxs(u.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[v&&e.jsx(ze.SubH3,{children:"Status"}),e.jsx(nr.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Er({get:"value",name:t,searchParams:S,filterKey:s})?[{label:Er({get:"value",name:t,searchParams:S,filterKey:s})==="active"?"Active":"InActive",value:Er({get:"value",name:t,searchParams:S,filterKey:s})}]:[],onChange:X=>pr({value:X,name:t,type:"dropdown",searchQueries:P,setSearchParams:L,filterKey:s}),placeholder:v?"All":"All Status"},D)]}),c&&e.jsxs(u.Box,{direction:"column",gap:"sm",style:{width:d&&Q?d:Q?"310px":""},children:[v&&e.jsxs(ze.SubH3,{children:["Search for ",I]}),e.jsx($e.Input,{placeholder:l,leftIcon:e.jsx(M.Icon,{name:"Search",width:20,height:20}),onChange:X=>te(X.target.value),value:Y,fullWidth:!0},D+1+s)]}),e.jsx(Cl,{isOpen:O,onClose:()=>B(!1),filterKey:s,filters:b,pageKey:a})]})},jo=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r;function nt({configs:r,filterKey:t="filter",activeFilterKey:l="filters",pageKey:n="page",searchKey:o="q"}){const{searchParams:c,setSearchParams:i,searchQueries:s}=Ee(),a=h.useMemo(()=>Object.fromEntries(r.map(D=>[D.key,D])),[r]),d=h.useMemo(()=>{const D=(c.get(l)||"").split(",").map(z=>z.trim()).filter(Boolean);let H=[];try{const z=c.get(t);z&&(H=Object.keys(JSON.parse(z)).filter(S=>S!==o))}catch{}return r.map(z=>z.key).filter(z=>{const S=a[z];return(S==null?void 0:S.locked)||D.includes(z)||H.includes(z)})},[c,l,t,o,r,a]),y=h.useCallback(D=>{try{return D[t]?JSON.parse(D[t]):{}}catch{return{}}},[t]),b=h.useCallback(D=>{const H={...s};D.length?H[l]=D.join(","):delete H[l],i(H)},[s,l,i]),p=h.useCallback(D=>{d.includes(D)||b([...d,D])},[d,b]),x=h.useCallback(D=>{var L;if((L=a[D])!=null&&L.locked)return;const H={...s},z=d.filter(V=>V!==D);z.length?H[l]=z.join(","):delete H[l];const S=y(H);D in S&&(delete S[D],Object.keys(S).length?H[t]=JSON.stringify(S):delete H[t]),delete H[n],i(H)},[s,d,l,t,n,y,i,a]),I=h.useCallback(D=>d.includes(D)?x(D):p(D),[d,p,x]),v=h.useCallback(D=>{switch(D.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return pl({name:D.key,get:"array",searchParams:c,filterKey:t})||[];case"date":{const H=bl({name:D.key,searchParams:c,filterKey:t});return H?new Date(H):void 0}case"date-compact":{const z=y(Object.fromEntries(c.entries()))[D.key];return z&&typeof z=="object"?z:void 0}default:return}},[c,t,y]),T=h.useCallback((D,H)=>{if(D.type==="date-compact"){const z={...s},S=y(z);H==null?delete S[D.key]:S[D.key]=H,Object.keys(S).length?z[t]=JSON.stringify(S):delete z[t],delete z[n],i(z);return}pr({value:H,name:D.key,type:jo(D.type),searchQueries:s,setSearchParams:i,filterKey:t,pageKey:n})},[s,i,t,n,y]),F=h.useCallback(D=>{const H={...s},z=y(H);D in z&&(delete z[D],Object.keys(z).length?H[t]=JSON.stringify(z):delete H[t]),delete H[n],i(H)},[s,t,n,y,i]),O=h.useCallback(()=>{const D={...s};delete D[t],delete D[l],delete D[n],i(D)},[s,t,l,n,i]),B=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:B,addFilter:p,removeFilter:x,toggleFilter:I,getValue:v,setValue:T,clearValue:F,clearAll:O}}const ct={get(r){return ur.storage.get(r)??null},set(r,t){ur.storage.save(r,t)},remove(r){ur.storage.delete(r)}},ar={columns:r=>`filterbar:colprefs:${r}`,savedViews:r=>`filterbar:views:${r}`,lastState:r=>`filterbar:last:${r}`,perPage:r=>`filterbar:perpage:${r}`,tableSort:r=>`tablelayout:sort:${r}`},Lr=(r,t)=>{const l=new Set(t.map(c=>c.key)),n=r.order.filter(c=>l.has(c));for(const c of t)n.includes(c.key)||n.push(c.key);const o=r.hidden.filter(c=>l.has(c));return{order:n,hidden:o}};function No({columns:r,scopeId:t,storage:l,onColumnsChange:n,value:o}){const c=h.useMemo(()=>({order:r.map(S=>S.key),hidden:[]}),[r]),i=t?ar.columns(t):void 0,s=(S,L)=>Lr({order:S.order??L,hidden:S.hidden??[]},r),[a,d]=h.useState(()=>{if(o&&(o.order||o.hidden))return s(o,r.map(S=>S.key));if(i){const S=l.get(i);if(S&&Array.isArray(S.order))return Lr(S,r)}return c}),y=r.map(S=>S.key).join("|");h.useEffect(()=>d(S=>Lr(S,r)),[y]);const b=h.useRef(a);b.current=a;const p=o?`${(o.order??[]).join("|")}~${(o.hidden??[]).join("|")}`:null,x=h.useRef(p);h.useEffect(()=>{if(p==null||x.current===p)return;x.current=p;const S=b.current,L=s(o,S.order);L.order.join("|")===S.order.join("|")&&L.hidden.join("|")===S.hidden.join("|")||(d(L),i&&l.set(i,L))},[p,y]);const I=h.useRef(!1);h.useEffect(()=>{I.current||(I.current=!0,n==null||n(a))},[]);const v=h.useCallback(S=>{d(S),i&&l.set(i,S),n==null||n(S)},[i,l,n]),T=h.useMemo(()=>{const S=new Map(r.map(L=>[L.key,L]));return a.order.filter(L=>S.has(L)).map(L=>({...S.get(L),visible:!a.hidden.includes(L)}))},[a,r]),F=h.useCallback(S=>{const L=a.hidden.includes(S)?a.hidden.filter(V=>V!==S):[...a.hidden,S];v({...a,hidden:L})},[a,v]),O=h.useCallback((S,L)=>{if(S===L)return;const V=[...a.order],[P]=V.splice(S,1);V.splice(L,0,P),v({...a,order:V})},[a,v]),B=h.useCallback(S=>{v({...a,hidden:S?r.filter(L=>!L.locked).map(L=>L.key):[]})},[a,r,v]),D=h.useCallback(()=>v(c),[v,c]),H=h.useCallback(S=>v(Lr(S,r)),[v,r]),z=a.hidden.length===0;return{state:a,orderedColumns:T,allVisible:z,toggleVisibility:F,reorder:O,setAllHidden:B,reset:D,applyState:H}}function _o({scopeId:r,storage:t,snapshotKeys:l,pageKey:n="page",getColumns:o,applyColumns:c}){const{searchParams:i,setSearchParams:s}=Ee(),a=r?ar.savedViews(r):void 0,[d,y]=h.useState(()=>a?t.get(a)||[]:[]),b=h.useCallback(v=>{y(v),a&&t.set(a,v)},[a]),p=h.useCallback(v=>{const T=v.trim();if(!T)return;const F={};l.forEach(B=>{const D=i.get(B);D!=null&&(F[B]=D)});const O={id:`${Date.now()}`,name:T,query:F,columns:o==null?void 0:o(),createdAt:Date.now()};b([...d,O])},[l,i,o,b,d]),x=h.useCallback(v=>b(d.filter(T=>T.id!==v)),[b,d]),I=h.useCallback(v=>{const T=Object.fromEntries(i.entries());l.forEach(F=>delete T[F]),Object.assign(T,v.query),delete T[n],s(T),v.columns&&(c==null||c(v.columns))},[i,l,n,s,c]);return{enabled:!!a,views:d,saveView:p,deleteView:x,applyView:I}}function qo({scopeId:r,storage:t,snapshotKeys:l,enabled:n=!0}){const{searchParams:o}=Ee(),c=r&&n?ar.lastState(r):void 0,i=h.useRef(c),s=h.useRef(!1);h.useEffect(()=>{if(!c){i.current=c;return}if(i.current!==c){i.current=c,s.current=!1;return}const y={};if(l.forEach(b=>{const p=o.get(b);p!=null&&(y[b]=p)}),Object.keys(y).length===0){s.current&&t.remove(c);return}s.current=!0,t.set(c,y)},[o,c,l,t]);const a=h.useCallback(()=>{if(!c)return null;const y=t.get(c);return y&&Object.keys(y).length>0?y:null},[c,t]),d=h.useCallback(()=>{c&&t.remove(c)},[c,t]);return{enabled:!!c,read:a,clear:d}}function Zo({scopeId:r,storage:t,perPageKey:l,pageSizeOptions:n,enabled:o=!0}){const{searchParams:c}=Ee(),i=r&&o?ar.perPage(r):void 0,s=c.toString(),a=h.useRef(i);h.useEffect(()=>{if(!i){a.current=i;return}if(a.current!==i){a.current=i;return}const b=c.get(l);if(!b)return;const p=Number(b);!Number.isFinite(p)||p<=0||t.set(i,p)},[s,i,l,t]);const d=h.useCallback(()=>{if(!i)return null;const b=t.get(i);if(b==null)return null;const p=Number(b);return!Number.isFinite(p)||p<=0||n&&!n.includes(p)?null:String(p)},[i,t,n]),y=h.useCallback(()=>{i&&t.remove(i)},[i,t]);return{enabled:!!i,read:d,clear:y}}let st={},it=!1,at=null;const Go=(r,t)=>{Object.assign(st,r),at=t,!it&&(it=!0,queueMicrotask(()=>{const l=st,n=at;st={},it=!1,at=null,!(!n||Object.keys(l).length===0)&&n(o=>{const c=new URLSearchParams(o);return Object.entries(l).forEach(([i,s])=>c.set(i,s)),c})}))};function Qo({enabled:r,snapshotKeys:t,perPageKey:l,readSnapshot:n,readPerPage:o}){const{searchParams:c,setSearchParams:i,location:s}=Ee(),a=h.useRef(null);h.useEffect(()=>{if(!r||a.current===s.pathname)return;a.current=s.pathname;const d={};if(!c.has(l)){const y=o();y&&(d[l]=y)}if(!t.some(y=>c.has(y))){const y=n();y&&Object.assign(d,y)}Object.keys(d).length!==0&&Go(d,i)},[s.pathname,r])}const Uo=({configs:r,activeKeys:t,onToggle:l,hasActiveFilter:n,onReset:o})=>r.length?e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:n?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{minWidth:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),n&&o&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"xs",onClick:o,children:"Reset"})]}),children:r.map(c=>e.jsx(A.MenuItem,{selected:c.locked||t.includes(c.key),disabled:c.locked,closeOnSelect:!1,startIcon:c.icon??void 0,onClick:()=>{c.locked||l(c.key)},children:c.label},c.key))})})]}):null,Tr=({onClear:r,onRemove:t})=>e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(M.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(A.MenuLists,{children:e.jsxs(A.MenuBody,{style:{width:180},children:[e.jsx(A.MenuItem,{startIcon:e.jsx(M.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(A.MenuItem,{intent:"danger",startIcon:e.jsx(M.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),Jo=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},xl=(r,t,l)=>{const n=new Date(r);return l==="day"?n.setDate(n.getDate()+t):l==="week"?n.setDate(n.getDate()+t*7):l==="month"?n.setMonth(n.getMonth()+t):n.setFullYear(n.getFullYear()+t),n},wl=r=>{const t=Jo(new Date);if(r.direction==="this"){const n=new Date(t),o=new Date(t);return r.period==="week"?(n.setDate(t.getDate()-t.getDay()),o.setDate(n.getDate()+6)):r.period==="month"?(n.setDate(1),o.setMonth(o.getMonth()+1,0)):r.period==="year"&&(n.setMonth(0,1),o.setMonth(11,31)),{from:n,to:o}}const l=r.count??1;return r.direction==="past"?{from:xl(t,-l,r.period),to:t}:{from:t,to:xl(t,l,r.period)}},Dl=24,Sl=r=>r.length>Dl?`${r.slice(0,Dl)}...`:r,Ir=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),Or={is:"Is","is-before":"Is before","is-after":"Is after","is-on-or-before":"Is on or before","is-on-or-after":"Is on or after","is-between":"Is between","is-relative-to-today":"Is relative to today","is-empty":"Is empty","is-not-empty":"Is not empty"},Yo=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],dt={past:"Past",next:"Next",this:"This"},Xo=["day","week","month","year"],Ko=["past","next","this"],$o=r=>r.field.type==="date-compact"?e.jsx(rn,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(Ro,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),Ro=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=t?Ir(new Date(t)):null,i=!!c,s=i?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Sl(c)})]}):r.label;return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i?e.jsx(M.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:s})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:o})]}),children:e.jsx(rr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:a=>a==null?n():l(a),withPadding:!1})})})]})},en=r=>{switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date?`${Or[r.op]} ${Ir(new Date(r.date))}`:null;case"is-between":return r.from&&r.to?`${Ir(new Date(r.from))} - ${Ir(new Date(r.to))}`:null;case"is-relative-to-today":{const t=r.relative;if(!t)return null;if(t.direction==="this")return`This ${t.period}`;const l=t.count??1,n=l===1?t.period:`${t.period}s`;return`${dt[t.direction]} ${l} ${n}`}case"is-empty":case"is-not-empty":return Or[r.op];default:return null}},rn=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=r.ops&&r.ops.length>0?r.ops:Yo,i=r.defaultOp&&c.includes(r.defaultOp)?r.defaultOp:c[0],s=(t==null?void 0:t.op)??i,a=t?en(t):null,d=!!a,y=d?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Sl(a)})]}):r.label,b=p=>{if(p!==s){if(p==="is-empty"||p==="is-not-empty"){l({op:p});return}if(p==="is-relative-to-today"){l({op:p,relative:(t==null?void 0:t.relative)??{direction:"past",count:1,period:"week"}});return}if(p==="is-between"){l({op:p,from:t==null?void 0:t.from,to:t==null?void 0:t.to});return}l({op:p,date:t==null?void 0:t.date})}};return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:d?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:d?e.jsx(M.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:y})}),e.jsxs(A.MenuLists,{children:[e.jsx(A.MenuBody,{style:{width:320},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(tn,{op:s,ops:c,onChange:b})]}),e.jsx(Tr,{onClear:n,onRemove:o})]}),children:e.jsx(ln,{value:t,op:s,onChange:l})}),s==="is-relative-to-today"&&e.jsx(A.MenuFooter,{children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},tn=({op:r,ops:t,onChange:l})=>e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:Or[r]})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:200},children:t.map(n=>e.jsx(A.MenuItem,{selected:r===n,onClick:()=>l(n),endIcon:r===n?e.jsx(M.Icon,{name:"Check"}):void 0,children:Or[n]},n))})})]}),ln=({value:r,op:t,onChange:l})=>{if(t==="is-empty"||t==="is-not-empty")return e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(t==="is-between"){const n=r!=null&&r.from||r!=null&&r.to?{from:r!=null&&r.from?new Date(r.from):null,to:r!=null&&r.to?new Date(r.to):null}:void 0;return e.jsx(rr.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,value:n,onChange:o=>{if(o==null){l({op:t});return}if(typeof o=="object"&&o!==null&&"from"in o&&"to"in o){let{from:c,to:i}=o;if(!c&&i&&(c=i,i=null),!c&&!i){l({op:t});return}l({op:t,from:c?c.toISOString():void 0,to:i?i.toISOString():void 0})}},withPadding:!1},"range")}return t==="is-relative-to-today"?e.jsx(on,{value:r==null?void 0:r.relative,onChange:n=>l({op:t,relative:n})}):e.jsx(rr.StarasiaDate,{size:"sm",input:!1,clearable:!0,value:r!=null&&r.date?new Date(r.date):void 0,onChange:n=>{if(n==null){l({op:t});return}n instanceof Date&&l({op:t,date:n.toISOString()})},withPadding:!1},"single")},on=({value:r,onChange:t})=>{const l=(r==null?void 0:r.direction)??"past",n=(r==null?void 0:r.count)??1,o=(r==null?void 0:r.period)??"week",c=l!=="this",i=wl({direction:l,count:n,period:o});return e.jsxs(u.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:dt[l]})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:140},children:Ko.map(s=>e.jsx(A.MenuItem,{selected:l===s,endIcon:l===s?e.jsx(M.Icon,{name:"Check"}):void 0,onClick:()=>t(s==="this"?{direction:s,period:o}:{direction:s,count:n,period:o}),children:dt[s]},s))})})]}),c&&e.jsx($e.Input,{type:"number",size:"sm",min:1,clearable:!1,value:n,onChange:s=>{const a=Number(s.target.value);t({direction:l,count:Number.isFinite(a)&&a>0?a:1,period:o})},style:{width:72}}),e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:o})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:140},children:Xo.map(s=>e.jsx(A.MenuItem,{selected:o===s,endIcon:o===s?e.jsx(M.Icon,{name:"Check"}):void 0,onClick:()=>t(l==="this"?{direction:l,period:s}:{direction:l,count:n,period:s}),children:s},s))})})]})]}),e.jsx(rr.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:i,onChange:()=>{},withPadding:!1},"relative-preview")]})},kl=18,nn=r=>r.length>kl?`${r.slice(0,kl)}...`:r,cn=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=r.type==="dropdown-multiple",i=t.length,s=r.searchable!==!1,[a,d]=h.useState(""),y=r.options,b=typeof r.onSearch=="function",p=(()=>{if(b)return y;const F=a.trim().toLowerCase();return F?y.filter(O=>O.label.toLowerCase().includes(F)):y})(),x=F=>t.some(O=>O.value===F.value),I=F=>{if(!c){l([{label:F.label,value:F.value}]),d("");return}l(x(F)?t.filter(O=>O.value!==F.value):[...t,{label:F.label,value:F.value}])},v=F=>{var O;d(F),(O=r.onSearch)==null||O.call(r,F)},T=i===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:i===1?nn(t[0].label):`${i} Selected`})]});return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:i>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i>0?e.jsx(M.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:T})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:o})]}),children:e.jsxs(u.Box,{direction:"column",gap:"sm",children:[s&&e.jsx(nr.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:c,searchAble:!0,searchValue:a,onSearch:v,value:t,onChange:l,placeholder:`Search ${r.label.toLowerCase()}…`}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:r.isLoading?e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):p.length===0?e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):p.map(F=>e.jsx(A.MenuItem,{closeOnSelect:!c,selected:x(F),startIcon:F.avatar,endIcon:x(F)?e.jsx(M.Icon,{name:"Check"}):void 0,description:F.description,onClick:()=>I(F),children:F.label},F.value))})]})})})]})},Bl=18,sn=r=>r.length>Bl?`${r.slice(0,Bl)}...`:r,ml=({checked:r,indeterminate:t})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(qe.Checkbox,{size:"sm",checked:r,readOnly:!0,onChange:()=>{},variant:t?"indeterminate":"select"})}),an=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=new Set(t.map(p=>p.value)),i=t.length,s=r.options.length>0&&r.options.every(p=>c.has(p.value)),a=i>0&&!s,d=p=>{l(c.has(p.value)?t.filter(x=>x.value!==p.value):[...t,{label:p.label,value:p.value}])},y=()=>{l(s?[]:r.options.map(p=>({label:p.label,value:p.value})))},b=i===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs(k.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(k.Text,{as:"span",children:i===1?sn(t[0].label):`${i} Selected`})]});return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:i>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i>0?e.jsx(M.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsx(A.MenuLists,{children:e.jsxs(A.MenuBody,{style:{width:240},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:o})]}),children:[e.jsx(A.MenuItem,{closeOnSelect:!1,selected:s,onClick:y,startIcon:e.jsx(ml,{checked:s||a,indeterminate:a}),children:"Select All"}),r.options.map(p=>e.jsx(A.MenuItem,{closeOnSelect:!1,selected:c.has(p.value),onClick:()=>d(p),startIcon:e.jsx(ml,{checked:c.has(p.value)}),children:p.label},p.value))]})})]})},Fl=({activeKeys:r,configByKey:t,getValue:l,setValue:n,clearValue:o,removeFilter:c})=>e.jsx(e.Fragment,{children:r.map(i=>{const s=t[i];if(!s)return null;const a=l(s),d=s.locked?void 0:()=>c(i);return s.type==="date"||s.type==="date-compact"?e.jsx($o,{field:s,value:a,onChange:y=>n(s,y),onClear:()=>o(i),onRemove:d},i):s.type==="checkbox-multiple"?e.jsx(an,{field:s,value:a||[],onChange:y=>n(s,y),onClear:()=>o(i),onRemove:d},i):e.jsx(cn,{field:s,value:a||[],onChange:y=>n(s,y),onClear:()=>o(i),onRemove:d},i)})}),El=r=>`${r} Rows`,dn=({pagination:r,pageKey:t="page",perPageKey:l="perPage",pageSizeOptions:n=[10,25,50,100],defaultPerPage:o=10,showResultCount:c=!0,showPageSize:i=!0,showPagination:s=!0})=>{var F;const{searchQueries:a,setSearchParams:d,searchParams:y}=Ee(),b=y.get(l),p=b?Number(b):o,x=O=>{d({...a,[t]:String(O)})},I=O=>{d({...a,[l]:O,[t]:"1"})},v=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:0),T=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[c&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${v}-${T} of ${((F=r==null?void 0:r.totalData)==null?void 0:F.toLocaleString())||0}`}),i&&e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:El(p)})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{children:n.map(O=>e.jsx(A.MenuItem,{selected:O===p,onClick:()=>I(String(O)),children:El(O)},O))})})]}),s&&((r==null?void 0:r.totalPage)??0)>1&&e.jsx(u.Box,{direction:"column",display:"flex",align:"center",gap:"sm",paddingRight:"sm",style:{borderRight:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:e.jsx(gr.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:r!=null&&r.currentPage?Number(r.currentPage):1,totalPages:Number(r==null?void 0:r.totalPage),onPageChange:x})})]})};function hn(r,t,l=!0){h.useEffect(()=>{if(!l)return;const n=o=>{var s;if(o.metaKey||o.ctrlKey||o.altKey||o.key!==r)return;const c=o.target,i=(s=c==null?void 0:c.tagName)==null?void 0:s.toLowerCase();i==="input"||i==="textarea"||c!=null&&c.isContentEditable||(o.preventDefault(),t())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[r,t,l])}const fn=240,Ml=({searchKey:r="q",filterKey:t="filter",pageKey:l="page",placeholder:n="Search",shortcut:o="/",collapsible:c=!0})=>{const{searchParams:i,setSearchParams:s,searchQueries:a}=Ee(),d=Mr(r,i,t)||"",[y,b]=h.useState(!c||!!d),[p,x]=h.useState(c&&!d),[I,v]=h.useState(d),T=pe.useDebounce(I,350),F=h.useRef(null);h.useEffect(()=>{v(d),d&&b(!0)},[d]),h.useEffect(()=>{y&&x(!1)},[y]),h.useEffect(()=>{T!==d&&pr({value:T,name:r,type:"search",searchQueries:a,setSearchParams:s,filterKey:t,pageKey:l})},[T]);const O=h.useCallback(()=>{b(!0),requestAnimationFrame(()=>{var z;return(z=F.current)==null?void 0:z.focus()})},[]);hn(o,O);const B=()=>{c&&!I&&b(!1)},D=z=>{var S;c&&z.key==="Escape"&&!I&&(b(!1),(S=F.current)==null||S.blur())},H=()=>{y||x(!0)};return e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[p&&e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:O}),e.jsxs(u.Box,{onTransitionEnd:H,style:{position:"relative",width:y?fn:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx($e.Input,{ref:F,size:"sm",fullWidth:!0,value:I,placeholder:n,leftIcon:e.jsx(M.Icon,{name:"Search",width:16,height:16}),onChange:z=>v(z.target.value),onKeyDown:D,onBlur:B,tabIndex:y?0:-1}),y&&!I&&e.jsx(u.Box,{align:"center",justify:"center",borderColor:"border-subtle",borderWidth:"border",borderStyle:"border-solid",borderRadius:"rounded-xs",paddingInline:"spacing-1",customBackgroundColor:"var(--sa-background-surface-hover, #f1f2f4)",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",minWidth:18,height:18,display:"inline-flex"},children:e.jsx(k.Text,{fontSize:"xs",color:"subtle",children:o})})]})]})},Ll=({columns:r,allVisible:t,onToggle:l,onReorder:n,onSetAllHidden:o})=>{const[c,i]=h.useState(null),[s,a]=h.useState(null),d=()=>{c!==null&&s!==null&&c!==s&&n(c,s),i(null),a(null)},y=(b,p)=>{const x=b+p;x<0||x>=r.length||n(b,x)};return e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{children:e.jsxs(u.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(j.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>o(t),children:t?"Hide All":"Show All"})]}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",children:r.map((b,p)=>{const x=!b.locked,I=s===p&&c!==null&&c!==p;return e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:x,onDragStart:()=>x&&i(p),onDragOver:v=>{v.preventDefault(),a(p)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:I?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(u.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:x?0:-1,"aria-label":`Reorder ${b.title}`,"aria-disabled":!x||void 0,color:"icon-subtlest",onKeyDown:v=>{x&&(v.key==="ArrowUp"?(v.preventDefault(),y(p,-1)):v.key==="ArrowDown"&&(v.preventDefault(),y(p,1)))},style:{display:"inline-flex",cursor:x?"grab":"default",opacity:x?1:.4},children:e.jsx(M.Icon,{name:"DragVertical",width:16,height:16})}),b.icon&&e.jsx(u.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:b.icon}),e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:b.title}),e.jsx(u.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(ir.Toggle,{size:"sm",checked:b.visible,disabled:b.locked,onChange:()=>l(b.key),"aria-label":`Toggle ${b.title} column`})})]},b.key)})})]})})})]})},Tl=({views:r,onApply:t,onDelete:l,onSave:n})=>{const[o,c]=h.useState(""),i=()=>{const s=o.trim();s&&(n(s),c(""))};return e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:r.length>0?"secondary":"outline",tone:(r.length>0,"neutral"),size:"sm",iconLeft:e.jsx(M.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(A.MenuLists,{style:{width:"260px"},children:[e.jsx(A.MenuBody,{children:e.jsxs(u.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",children:r.length===0?e.jsx(u.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(k.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(s=>e.jsx(A.MenuItem,{startIcon:e.jsx(M.Icon,{name:"Bookmark"}),onClick:()=>t(s),endIcon:e.jsx(j.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(M.Icon,{name:"Trash2"}),"aria-label":`Delete ${s.name}`,onClick:a=>{a.stopPropagation(),l(s.id)}}),children:s.name},s.id))})]})}),e.jsx(A.MenuFooter,{children:e.jsxs(u.Box,{direction:"row",gap:"xs",children:[e.jsx(u.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx($e.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:o,onChange:s=>c(s.target.value),onKeyDown:s=>{s.key==="Enter"&&i()}})}),e.jsx(j.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!o.trim(),onClick:i,children:"Save"})]})})]})]})},gn=({isOpen:r,onClose:t,configs:l,activeKeys:n,configByKey:o,hasActiveFilter:c,onToggle:i,onReset:s,getValue:a,setValue:d,clearValue:y,removeFilter:b})=>{const p=n.length;return e.jsx(kr.Drawer,{position:"bottom",isShow:r,onHide:t,children:e.jsxs(u.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingInline:"md",paddingBlock:"sm",style:{borderBottom:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),p>0&&e.jsxs(k.Text,{fontSize:"sm",color:"subtle",children:["(",p,")"]})]}),e.jsx(j.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:t})]}),e.jsxs(u.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[p>0&&e.jsxs(u.Box,{direction:"column",gap:"sm",children:[e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(u.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(Fl,{activeKeys:n,configByKey:o,getValue:a,setValue:d,clearValue:y,removeFilter:b})})]}),l.length>0&&e.jsxs(u.Box,{direction:"column",gap:"sm",children:[e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(u.Box,{direction:"column",children:l.map(x=>{const I=n.includes(x.key),v=!!x.locked;return e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:v?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[x.icon&&e.jsx(u.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:x.icon}),e.jsx(k.Text,{fontSize:"sm",color:"primary",truncate:!0,children:x.label})]}),e.jsx(ir.Toggle,{size:"sm",checked:I||v,disabled:v,onChange:()=>i(x.key),"aria-label":`Toggle ${x.label}`})]},x.key)})})]})]}),e.jsxs(u.Box,{direction:"row",display:"flex",gap:"sm",paddingInline:"md",paddingBlock:"sm",style:{borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsx(u.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!c,onClick:s,children:"Reset"})}),e.jsx(u.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(j.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:t,children:"Selesai"})})]})]})})},un=r=>`${r} Rows`,yn=({perPageKey:r,pageKey:t,pageSizeOptions:l,defaultPerPage:n=10,showPageSize:o})=>{const{searchQueries:c,setSearchParams:i,searchParams:s}=Ee(),a=s.get(r),d=a?Number(a):n,y=b=>{i({...c,[r]:b,[t]:"1"})};return o?e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(A.MenuLists,{children:e.jsxs(A.MenuBody,{style:{minWidth:200},children:[e.jsx(u.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),l.map(b=>e.jsx(A.MenuItem,{selected:b===d,endIcon:b===d?e.jsx(M.Icon,{name:"Check"}):void 0,onClick:()=>y(String(b)),children:un(b)},b))]})})]}):null},pn=r=>{var Ve;const{withPadding:t,configs:l,activeKeys:n,configByKey:o,hasActiveFilter:c,toggleFilter:i,removeFilter:s,getValue:a,setValue:d,clearValue:y,onReset:b,searchable:p,searchKey:x,filterKey:I,pageKey:v,searchPlaceholder:T,searchShortcut:F,searchCollapsible:O,pagination:B,perPageKey:D,pageSizeOptions:H,defaultPerPage:z,showPagination:S,showResultCount:L,showPageSize:V,hasColumns:P,orderedColumns:Z,allVisible:Y,onToggleVisibility:te,onReorder:fe,onSetAllHidden:de,showSavedViews:ee,savedViews:Q,onApplyView:X,onDeleteView:he,onSaveView:Se,leadingActions:se}=r,[ve,Te]=h.useState(!1),{searchQueries:ke,setSearchParams:He}=Ee(),Ie=(B==null?void 0:B.rangeStart)??(((B==null?void 0:B.currentPage)||0)>1?(((B==null?void 0:B.currentPage)||0)-1)*((B==null?void 0:B.perPage)||0)+1:1),be=(B==null?void 0:B.rangeEnd)??((B==null?void 0:B.totalCurrentPage)!==(B==null?void 0:B.perPage)?B==null?void 0:B.totalData:((B==null?void 0:B.currentPage)||1)*((B==null?void 0:B.totalCurrentPage)||0)),Ze=Ue=>{He({...ke,[v]:String(Ue)})},xe=L||S&&!!(B!=null&&B.totalPage),je=()=>{b(),Te(!1)};return e.jsxs(u.Box,{direction:"column",gap:"sm",fullWidth:!0,paddingTop:t?"sm":void 0,paddingBottom:t?"sm":void 0,paddingLeft:t?"md":void 0,paddingRight:t?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[p&&e.jsx(Ml,{searchKey:x,filterKey:I,pageKey:v,placeholder:T,shortcut:F,collapsible:O}),e.jsx(j.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"FilterHorizontal"}),onClick:()=>Te(!0),"aria-label":"Open filters",children:c?`Filter: ${n.length}`:null}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[se,ee&&e.jsx(Tl,{views:Q,onApply:X,onDelete:he,onSave:Se}),P&&e.jsx(Ll,{columns:Z,allVisible:Y,onToggle:te,onReorder:fe,onSetAllHidden:de}),e.jsx(yn,{perPageKey:D,pageKey:v,pageSizeOptions:H,defaultPerPage:z,showPageSize:V})]})]}),xe&&e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[L?e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Ie}-${be} of ${((Ve=B==null?void 0:B.totalData)==null?void 0:Ve.toLocaleString())||0}`}):e.jsx(u.Box,{direction:"column"}),S&&!!(B!=null&&B.totalPage)&&e.jsx(gr.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:B!=null&&B.currentPage?Number(B.currentPage):1,totalPages:Number(B.totalPage),onPageChange:Ze})]}),e.jsx(gn,{isOpen:ve,onClose:()=>Te(!1),configs:l,activeKeys:n,configByKey:o,hasActiveFilter:c,onToggle:i,onReset:je,getValue:a,setValue:d,clearValue:y,removeFilter:s})]})},bn=({withPadding:r=!1,filterConfigs:t=[],filterKey:l="filter",activeFilterKey:n="filters",pageKey:o="page",perPageKey:c="perPage",pageSizeOptions:i=[25,50,100],defaultPerPage:s,showPagination:a=!0,showResultCount:d=!0,showPageSize:y=!0,searchable:b=!1,searchKey:p="q",searchPlaceholder:x="Search",searchShortcut:I="/",searchPosition:v="right",searchCollapsible:T=!0,pagination:F,columns:O=[],onColumnsChange:B,columnsState:D,scopeId:H,savedViews:z,persistLastState:S=!0,storage:L=ct,onReset:V,leadingActions:P})=>{const Z=H??(z==null?void 0:z.scopeId),{activeKeys:Y,configByKey:te,hasActiveFilter:fe,toggleFilter:de,removeFilter:ee,getValue:Q,setValue:X,clearValue:he,clearAll:Se}=nt({configs:t,filterKey:l,activeFilterKey:n,pageKey:o,searchKey:p}),se=No({columns:O,scopeId:Z,storage:L,onColumnsChange:B,value:D}),ve=_o({scopeId:Z,storage:L,snapshotKeys:[n,l,c],pageKey:o,getColumns:()=>se.state,applyColumns:se.applyState}),Te=qo({scopeId:Z,storage:L,snapshotKeys:[n,l,o],enabled:S}),ke=Zo({scopeId:Z,storage:L,perPageKey:c,pageSizeOptions:i,enabled:S});Qo({enabled:S&&!!Z,snapshotKeys:[n,l,o],perPageKey:c,readSnapshot:Te.read,readPerPage:ke.read});const He=s??i[0]??25,Ie=!!(z!=null&&z.enabled)&&ve.enabled,be=()=>{Se(),Te.clear(),V==null||V()},Ze=pe.useMediaQuery("md"),xe=b?e.jsx(Ml,{searchKey:p,filterKey:l,pageKey:o,placeholder:x,shortcut:I,collapsible:T}):null;return Ze?e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",fullWidth:!0,paddingTop:r?"sm":void 0,paddingBottom:r?"sm":void 0,paddingLeft:r?"md":void 0,paddingRight:r?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Uo,{configs:t,activeKeys:Y,onToggle:de,hasActiveFilter:fe,onReset:be}),v==="left"&&xe,e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Fl,{activeKeys:Y,configByKey:te,getValue:Q,setValue:X,clearValue:he,removeFilter:ee}),fe&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"sm",onClick:be,children:"Reset"})]})]}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[P,e.jsx(dn,{pagination:F,pageKey:o,perPageKey:c,pageSizeOptions:i,defaultPerPage:He,showPagination:a,showResultCount:d,showPageSize:y}),v==="right"&&xe,Ie&&e.jsx(Tl,{views:ve.views,onApply:ve.applyView,onDelete:ve.deleteView,onSave:ve.saveView}),O.length>0&&e.jsx(Ll,{columns:se.orderedColumns,allVisible:se.allVisible,onToggle:se.toggleVisibility,onReorder:se.reorder,onSetAllHidden:se.setAllHidden})]})]}):e.jsx(pn,{withPadding:r,configs:t,activeKeys:Y,configByKey:te,hasActiveFilter:fe,toggleFilter:de,removeFilter:ee,getValue:Q,setValue:X,clearValue:he,onReset:be,searchable:b,searchKey:p,filterKey:l,pageKey:o,searchPlaceholder:x,searchShortcut:I,searchCollapsible:T,pagination:F,perPageKey:c,pageSizeOptions:i,defaultPerPage:He,showPagination:a,showResultCount:d,showPageSize:y,hasColumns:O.length>0,orderedColumns:se.orderedColumns,allVisible:se.allVisible,onToggleVisibility:se.toggleVisibility,onReorder:se.reorder,onSetAllHidden:se.setAllHidden,showSavedViews:Ie,savedViews:ve.views,onApplyView:ve.applyView,onDeleteView:ve.deleteView,onSaveView:ve.saveView,leadingActions:P})},Cn=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r[0];return(t==null?void 0:t.value)!=null?String(t.value):void 0},vn=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r.map(l=>(l==null?void 0:l.value)!=null?String(l.value):null).filter(l=>l!=null);return t.length?t:void 0},xn=(r,t)=>{switch(r.type){case"dropdown":case"radio":return Cn(t);case"dropdown-multiple":case"checkbox-multiple":return vn(t);case"date":return t instanceof Date?t.toISOString():void 0;case"date-compact":return t;default:return}},Il=(r,t)=>{if(r==null||r==="")return t;const l=Number(r);return Number.isFinite(l)&&l>0?l:t},wn=r=>{const{filterConfigs:t,filterKey:l="filter",activeFilterKey:n="filters",pageKey:o="page",perPageKey:c="perPage",searchKey:i="q",defaultPage:s=1,defaultPerPage:a=10,paramKeys:d,serialize:y}=r,{activeKeys:b,configByKey:p,hasActiveFilter:x,getValue:I}=nt({configs:t,filterKey:l,activeFilterKey:n,pageKey:o,searchKey:i}),{searchParams:v}=Ee(),T=v.toString();return h.useMemo(()=>{const O={},B={},D=Il(v.get(o),s),H=Il(v.get(c),a);O[(d==null?void 0:d.page)??"page"]=D,O[(d==null?void 0:d.perPage)??"perPage"]=H;const z=Mr(i,v,l)||"";z&&(O[(d==null?void 0:d.search)??"search"]=z);let S=!1;for(const L of b){const V=p[L];if(!V)continue;const P=I(V);B[L]=P;const Z=y==null?void 0:y[L],Y=Z?Z(P):xn(V,P);if(Y==null||Array.isArray(Y)&&Y.length===0)continue;const te=(d==null?void 0:d[L])??L;O[te]=Y,S=!0}return{params:O,raw:B,hasActiveFilter:x||!!z||S}},[T,b.join("|"),l,n,o,c,i,s,a,d,y,p])},Dn=["dropdown","dropdown-multiple","checkbox-multiple","radio"],Sn=({filterConfigs:r,filterKey:t,activeFilterKey:l,pageKey:n,searchKey:o})=>{const{configByKey:c,getValue:i,setValue:s,removeFilter:a,clearAll:d,hasActiveFilter:y}=nt({configs:r,filterKey:t,activeFilterKey:l,pageKey:n,searchKey:o}),b=(F,O)=>{var D;const B=F.options;return((D=B==null?void 0:B.find(H=>H.value===O))==null?void 0:D.label)??O},p=h.useCallback(F=>{const O=c[F];if(!O)return[];const B=i(O);return Array.isArray(B)?B.map(D=>String(D.value)):[]},[c,i]),x=h.useCallback((F,O)=>{const B=c[F];if(!B||!Dn.includes(B.type))return;const D=Array.isArray(O)?O:[O];if(D.length===0){a(F);return}s(B,D.map(H=>({label:b(B,H),value:H})))},[c,s,a]),I=h.useCallback((F,O)=>{const B=p(F);x(F,B.includes(O)?B.filter(D=>D!==O):[...B,O])},[p,x]),v=h.useCallback((F,O)=>p(F).includes(O),[p]),T=h.useCallback(F=>a(F),[a]);return{set:x,toggle:I,clear:T,clearAll:d,isActive:v,values:p,hasActiveFilter:y}},kn=(r,t)=>{if(!r)return{};const{fromKey:l,toKey:n,opKey:o}=t,c={};switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date&&(c[l]=new Date(r.date).toISOString()),o&&(c[o]=r.op),c;case"is-between":return r.from&&(c[l]=new Date(r.from).toISOString()),r.to&&(c[n]=new Date(r.to).toISOString()),c;case"is-relative-to-today":{if(!r.relative)return c;const{from:i,to:s}=wl(r.relative);return c[l]=i.toISOString(),c[n]=s.toISOString(),c}case"is-empty":case"is-not-empty":return o&&(c[o]=r.op==="is-empty"?"empty":"not-empty"),c;default:return c}},Ol=({children:r,borderRadius:t,height:l})=>{const n=h.useRef(null),[o,c]=h.useState("100vh");return h.useEffect(()=>{if(l)return;const i=()=>{if(n.current){const s=n.current.getBoundingClientRect().top;c(`calc(100vh - ${s}px)`)}};return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[l]),e.jsx(u.Box,{ref:n,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:t||"rounded-xs",style:{height:l??o,display:"flex",flexDirection:"column"},children:r})},Wl=({action:r,rightContent:t,leftContent:l,headerSlot:n,advanceFilter:o,showFilter:c=!0})=>{const i=pe.useMediaQuery("md"),s=c?e.jsx(vl,{...o}):null,a=()=>r?h.isValidElement(r)?r:e.jsx(u.Box,{style:{display:"flex",flexDirection:i?"row":"column",gap:"8px",width:i?"auto":"100%",textWrap:"nowrap"},children:r.map(({title:d,icon:y,buttonProps:b,onClick:p},x)=>!d&&!y?null:e.jsx(j.Button,{fullWidth:!i,iconLeft:y?e.jsx(M.Icon,{name:y}):void 0,onClick:p,...b,children:d},`action-${x}`))}):null;return e.jsx(u.Box,{style:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center",paddingLeft:"8px",paddingRight:"8px",paddingTop:"8px",paddingBottom:"8px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0,position:"relative",zIndex:10,flexDirection:i?"row":"column-reverse",gap:"16px"},children:n?n({filter:s}):e.jsxs(e.Fragment,{children:[e.jsxs(u.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[s,l]}),e.jsxs(u.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[t,a()]})]})})},Bn=({totalData:r,withMarginBottom:t=!0,withMarginTop:l=!0})=>e.jsxs(u.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:t?"16px":void 0,marginTop:l?"16px":void 0},children:[e.jsxs(ze.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(ze.Body1,{children:r||0})]}),Al=({pagination:r,pageKey:t="page",perPageKey:l="perPage",defaultPerPage:n=10,showPagination:o=!0,totalData:c})=>{const{searchQueries:i,setSearchParams:s,searchParams:a}=Ee(),d=a.get(l),y=I=>{s({...i,[t]:String(I)})},b=I=>{s({...i,[l]:I,[t]:"1"})},p=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),x=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsx(u.Box,{style:{display:"flex",width:"100%",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0},children:o?e.jsxs(e.Fragment,{children:[e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(k.Text,{children:"Rows Per Page: "}),e.jsx(nr.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:I=>{b(I[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}]}),e.jsx(k.Text,{children:`${p}-${x} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(gr.Pagination,{currentPage:r!=null&&r.currentPage?Number(r==null?void 0:r.currentPage):1,totalPages:r!=null&&r.totalPage?Number(r==null?void 0:r.totalPage):1,onPageChange:y})]}):e.jsx(Bn,{totalData:c,withMarginBottom:!1,withMarginTop:!1})})},zl=({filter:r,columnTitle:t})=>{const[l,n]=h.useState(!1),o=h.useRef(null),c=h.useRef(null),i=h.useRef(null),[s,a]=h.useState(""),[d,y]=h.useState({top:0,left:0}),b=r.selectedValues,p=h.useMemo(()=>s?r.options.filter(v=>v.label.toLowerCase().includes(s.toLowerCase())):r.options,[r.options,s]);h.useEffect(()=>{if(l&&c.current){const v=c.current.getBoundingClientRect(),T=280,F={top:v.bottom+8};r.position==="left"||v.left+T>window.innerWidth?F.right=window.innerWidth-v.right:F.left=v.left,y(F)}},[l,r.position]),h.useEffect(()=>{l&&i.current?setTimeout(()=>{var v;return(v=i.current)==null?void 0:v.focus()},50):a("")},[l]),h.useEffect(()=>{const v=T=>{o.current&&!o.current.contains(T.target)&&c.current&&!c.current.contains(T.target)&&n(!1)};return l&&document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[l]);const x=v=>{const T=b.includes(v)?b.filter(F=>F!==v):[...b,v];r.onFilterChange(T)},I=()=>r.onFilterChange([]);return e.jsxs(u.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(u.Box,{ref:c,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:v=>{var T;v.stopPropagation(),l||(T=r.onOpen)==null||T.call(r),n(F=>!F)},children:e.jsx(M.Icon,{name:l?"ChevronUp":"ChevronDown",size:"sm",style:{color:b.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),l&&e.jsxs(u.Box,{ref:o,style:{position:"fixed",top:`${d.top}px`,...d.left!==void 0?{left:`${d.left}px`}:{right:`${d.right}px`},backgroundColor:"white",borderRadius:"4px",minWidth:"280px",maxHeight:"400px",display:"flex",flexDirection:"column",zIndex:9999,animation:"fadeInDropdown 0.15s ease-out",border:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(k.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",t]}),b.length>0&&e.jsx(u.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(k.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:v=>{v.stopPropagation(),I()},children:"CLEAR"})})]}),!r.hideSearch&&e.jsx(u.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx($e.Input,{ref:i,placeholder:`Search ${t.toLowerCase()}...`,leftIcon:e.jsx(M.Icon,{name:"Search",size:"sm"}),value:s,onChange:v=>a(v.target.value),style:{fontSize:"14px"}})}),e.jsx(u.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:r.isLoadingOptions?e.jsxs(u.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(M.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):p.length>0?e.jsx(u.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:p.map(v=>e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:b.includes(v.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:T=>{T.stopPropagation(),x(v.value)},onMouseEnter:T=>{b.includes(v.value)||(T.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),T.currentTarget.style.transform="translateX(2px)"},onMouseLeave:T=>{T.currentTarget.style.backgroundColor=b.includes(v.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",T.currentTarget.style.transform="translateX(0)"},children:[e.jsx(qe.Checkbox,{checked:b.includes(v.value),onChange:()=>{}}),e.jsx(k.Text,{fontSize:"sm",fontWeight:b.includes(v.value)?"medium":"normal",color:b.includes(v.value)?"primary":"gray-700",children:v.label})]},v.value))}):e.jsxs(u.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(M.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),b.length>0&&e.jsx(u.Box,{direction:"column",style:{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",backgroundColor:"var(--sa-color-brand-50, #e6edf6)",marginTop:"auto"},children:e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(u.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:b.length}),e.jsxs(k.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",b.length>1?"s":""," selected"]})]})})]})]})},mn=({direction:r})=>{const t="var(--sa-text-primary, #292a2e)",l="var(--sa-text-subtle, #8c8f97)",n=r==="asc"?t:l,o=r==="desc"?t:l,c=r==="asc"?1:.45,i=r==="desc"?1:.45;return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:0},"aria-hidden":!0,children:[e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:n,opacity:c,marginBottom:1},children:e.jsx("path",{d:"M4 0 L8 5 L0 5 Z",fill:"currentColor"})}),e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:o,opacity:i},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},Fn=({frozen:r})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:r?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),ht="var(--sa-background-primary, #ffffff)",Hl="var(--sa-background-primary-inverse, #f8f8f8)",Vl=({columns:r,records:t,handleDetail:l,handleUpdate:n,handleDelete:o,isLoading:c,visibleHandleDelete:i,visibleHandleUpdate:s,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:y,frozenCount:b=0,onFrozenCountChange:p,customActions:x,actionsOrder:I=["detail","update","delete","custom"],customEmptyState:v,enableColumnResize:T=!1,defaultColumnWidths:F,onColumnWidthsChange:O,defaultMinColumnWidth:B=60,sort:D,defaultSort:H,onSortChange:z,showActionDivider:S=!1})=>{const L=D!==void 0,[V,P]=h.useState(H??null),Z=L?D??null:V,Y=W=>{if(W.sortKey)return W.sortKey;if(typeof W.accessor=="string")return W.accessor},te=W=>{const U=Y(W);if(!U)return;let _;!Z||Z.key!==U?_={key:U,direction:"asc"}:Z.direction==="asc"?_={key:U,direction:"desc"}:_=null,L||P(_),z==null||z(_)},de=[l,n,o].filter(W=>W!==void 0).length,ee=!!x,Q=!!l||!!n||!!o||ee,X="var(--sa-border-subtle, #0b120e24)",he=`1px solid ${X}`,Se=`inset 1px 0 0 ${X}`,se=`inset -1px 0 0 ${X}`,ve=de===3?ee?"178px":"140px":de===2?ee?"140px":"102px":de===1?ee?"112px":"74px":ee?"74px":"",Te=(W,U)=>{if(!U)return W;if(typeof U=="function")return U(W);if(typeof U=="string")return W[U]},[ke,He]=h.useState(!1);h.useEffect(()=>{if(!(y!=null&&y.current))return;const W=y.current;He(W.scrollHeight>W.clientHeight)},[t,y]);const Ie=h.useRef(null),[be,Ze]=h.useState([]),[xe,je]=h.useState(()=>F??{}),Ve=h.useRef(null);h.useLayoutEffect(()=>{if(!b||!Ie.current){Ze([]);return}const W=Array.from(Ie.current.querySelectorAll("thead tr th")),U=[];let _=0;W.forEach((J,N)=>{U[N]=_,N<b&&(_+=J.offsetWidth)}),Ze(U)},[b,r,t,xe]);const Ue=W=>{p&&p(W<b?W:W+1)},m=(W,U)=>{const _=xe[W];if(_!==void 0){const J=`${_}px`;return{width:J,minWidth:J,maxWidth:J}}return U?{width:U}:{}},G=W=>T&&(W.resizable??!0),$=(W,U)=>{W.preventDefault(),W.stopPropagation();const _=W.currentTarget.closest("th");if(!_)return;const J=Math.round(_.getBoundingClientRect().width);Ve.current={colIndex:U,startX:W.clientX,startWidth:J};const N=document.body.style.userSelect,ge=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Fe=Ne=>{var Re;const Me=Ve.current;if(!Me)return;const Je=((Re=r[Me.colIndex])==null?void 0:Re.minWidth)??B,we=Math.max(Je,Me.startWidth+(Ne.clientX-Me.startX));je(er=>er[Me.colIndex]===we?er:{...er,[Me.colIndex]:we})},Ge=()=>{document.removeEventListener("mousemove",Fe),document.removeEventListener("mouseup",Ge),document.body.style.userSelect=N,document.body.style.cursor=ge,Ve.current=null,O&&je(Ne=>(O(Ne),Ne))};document.addEventListener("mousemove",Fe),document.addEventListener("mouseup",Ge)};return e.jsx("div",{ref:Ie,children:e.jsxs(q.Table,{fullWidth:!0,children:[e.jsx(q.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(q.Tr,{children:[r.map((W,U)=>{var qr,hr;const _=b>0&&U<b,J=be[U]??0,N=G(W),Fe=U===r.length-1&&Q&&S,Ge=Y(W),Ne=!!W.sortable&&!!Ge,Me=Ne&&(Z==null?void 0:Z.key)===Ge?Z.direction:null,Je=W.title||((qr=W.accessor)==null?void 0:qr.toString())||"",we=(hr=W.headerTooltip)!=null&&hr.showIcon?e.jsx(M.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,Re=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Je}),er=Ne?e.jsxs("button",{type:"button",onClick:()=>te(W),title:Me==="asc"?"Sorted ascending — click to sort descending":Me==="desc"?"Sorted descending — click to clear":"Click to sort ascending",style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4,background:"none",border:"none",padding:0,margin:0,font:"inherit",color:"inherit",cursor:"pointer",textAlign:W.textAlign==="text-right"?"right":W.textAlign==="text-center"?"center":"left"},children:[Re,we,e.jsx(mn,{direction:Me})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Re,we]});return e.jsxs(q.Th,{style:{position:"sticky",top:0,left:_?J:void 0,zIndex:_?4:2,paddingLeft:U===0?"12px":"",borderRight:d&&!Fe&&!_?he:void 0,borderBottom:d?he:void 0,boxShadow:d&&_?se:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:W.textAlign==="text-right"?"right":W.textAlign==="text-center"?"center":"left",...m(U,W.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[W.headerTooltip?e.jsx(Be.Tooltip,{label:W.headerTooltip.content,position:"bottom",children:er}):er,W.filter&&e.jsx(zl,{filter:W.filter,columnTitle:W.title}),p&&e.jsx("button",{onClick:()=>Ue(U),title:_?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:_?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:_?1:.45,transition:"opacity 0.15s"},children:e.jsx(Fn,{frozen:_})})]}),N&&e.jsx("div",{onMouseDown:wr=>$(wr,U),onClick:wr=>wr.stopPropagation(),role:"separator","aria-orientation":"vertical",title:"Drag to resize",style:{position:"absolute",top:0,right:-3,width:6,height:"100%",cursor:"col-resize",userSelect:"none",zIndex:5,touchAction:"none"}})]},`table-head-${U}`)}),Q?e.jsx(q.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?he:void 0,boxShadow:d&&S?Se:void 0}}):null]})}),e.jsx(q.Tbody,{children:c?e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:r.length+1,children:e.jsxs(u.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(Ae.Skeleton,{variant:"list"}),e.jsx(Ae.Skeleton,{variant:"list"}),e.jsx(Ae.Skeleton,{variant:"list"}),e.jsx(Ae.Skeleton,{variant:"list"}),e.jsx(Ae.Skeleton,{variant:"list"})]})})}):!(t!=null&&t.length)&&v?e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:r.length+1,children:v})}):t==null?void 0:t.map((W,U)=>e.jsxs(q.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:U===t.length-1&&ke?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:_=>{const J=_.currentTarget;J.style.backgroundColor=Hl,Array.from(J.querySelectorAll("td")).forEach(N=>{N.style.position==="sticky"&&(N.style.backgroundColor=Hl)})},onMouseLeave:_=>{const J=_.currentTarget;J.style.backgroundColor="",Array.from(J.querySelectorAll("td")).forEach(N=>{N.style.position==="sticky"&&(N.style.backgroundColor=ht)})},children:[r.map((_,J)=>{const N=_.render?_.render(W,U,t):Te(W,_.accessor),ge=b>0&&J<b,Fe=be[J]??0,Ge=xe[J]!==void 0,Ne=ge&&J===b-1;return e.jsx(q.Td,{style:{position:ge?"sticky":void 0,left:ge?Fe:void 0,zIndex:ge?1:void 0,backgroundColor:ge?ht:void 0,transition:ge?"background-color 0.3s ease":void 0,paddingLeft:J===0?"12px":"",whiteSpace:"nowrap",overflow:Ge?"hidden":void 0,borderLeft:_.showBorderLeft?he:void 0,borderRight:_.showBorderRight?he:void 0,boxShadow:Ne?se:void 0,textAlign:_.textAlign==="text-right"?"right":_.textAlign==="text-center"?"center":"left",...m(J,_.width)},children:typeof N=="string"?e.jsx(k.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:_.textAlign==="text-right"?"right":_.textAlign==="text-center"?"center":"left"},children:N}):N},`row-${U}-col-${J}`)}),Q?e.jsx(q.Td,{style:{width:ve,position:"sticky",right:0,zIndex:1,backgroundColor:ht,boxShadow:S?Se:void 0,transition:"background-color 0.3s ease"},children:e.jsx(oe.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:I.map(_=>{const J=U===t.length-1?"top":"bottom";return _==="detail"&&l&&(a==null?void 0:a(W))!==!1?e.jsx(Be.Tooltip,{label:"Detail",position:J,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>l(W.id,W),iconLeft:e.jsx(M.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):_==="update"&&n&&(s==null?void 0:s(W))!==!1?e.jsx(Be.Tooltip,{label:"Update",position:J,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(W),iconLeft:e.jsx(M.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):_==="delete"&&o&&(i==null?void 0:i(W))!==!1?e.jsx(Be.Tooltip,{label:"Delete",position:J,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(W.id,W),iconLeft:e.jsx(M.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):_==="custom"?e.jsx(h.Fragment,{children:x==null?void 0:x(W)},"custom"):null})})}):null]},`${W}${U}`))})]})})},En=({wrapperProps:r,dataTableProps:t,headerProps:l,footerProps:n})=>{var b;const o=h.useRef(null),[c,i]=h.useState((t==null?void 0:t.defaultFrozenCount)??0),s=(l==null?void 0:l.show)??!0,a=h.useRef(null),d=(b=t==null?void 0:t.pagination)==null?void 0:b.totalData;typeof d=="number"&&(a.current=d);const y=(n==null?void 0:n.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(Ol,{...r,children:[s&&e.jsx(Wl,{...l}),e.jsx(u.Box,{direction:"column",ref:o,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(Vl,{...t,scrollParentRef:o,frozenCount:t!=null&&t.enableFreezeColumns?c:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?i:void 0}):null}),y&&e.jsx(Al,{pagination:t==null?void 0:t.pagination,pageKey:t==null?void 0:t.pageKey,perPageKey:t==null?void 0:t.perPageKey,defaultPerPage:t==null?void 0:t.defaultPerPage,showPagination:t==null?void 0:t.showPagination,totalData:n==null?void 0:n.totalData})]})};function Mn(r){return h.memo(r)}const Ln=Mn(En),Pl=200,ft="1px solid var(--sa-border-subtle, #0b120e24)",Tn=({sortDir:r,frozen:t})=>r==="asc"?e.jsx(M.Icon,{name:"ChevronSmallUp"}):r==="desc"?e.jsx(M.Icon,{name:"ChevronSmallDown"}):t?e.jsx(M.Icon,{name:"LockOn",size:"xs"}):e.jsx(M.Icon,{name:"Filter",size:"xs"}),Wr=({icon:r,label:t,active:l,danger:n,onClick:o})=>{const c=n?"var(--sa-color-error-600, #c9184a)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:l?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:c,textAlign:"left"},onMouseEnter:i=>{l||(i.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:i=>{i.currentTarget.style.background=l?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(M.Icon,{name:r,size:"sm",style:{color:c,flexShrink:0}}),e.jsx(k.Text,{as:"span",style:{color:c},children:t})]})},jl=({active:r,canSort:t,canHide:l,sortDir:n,frozen:o,onSort:c,onClearSort:i,onToggleFreeze:s,onHide:a})=>{const[d,y]=h.useState(!1),b=h.useRef(null),p=h.useRef(null),[x,I]=h.useState({top:0,left:0});h.useEffect(()=>{if(d&&b.current){const T=b.current.getBoundingClientRect(),F=T.left+Pl>window.innerWidth;I({top:T.bottom+6,...F?{right:window.innerWidth-T.right}:{left:T.left}})}},[d]),h.useEffect(()=>{if(!d)return;const T=F=>{p.current&&!p.current.contains(F.target)&&b.current&&!b.current.contains(F.target)&&y(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[d]);const v=T=>{T(),y(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:b,type:"button",className:"sa-tl-menu-trigger","data-active":r||d?"true":"false",onClick:T=>{T.stopPropagation(),y(F=>!F)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:ft,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(Tn,{sortDir:n,frozen:o})}),d&&e.jsxs(u.Box,{ref:p,onClick:T=>T.stopPropagation(),style:{position:"fixed",top:`${x.top}px`,...x.left!==void 0?{left:`${x.left}px`}:{right:`${x.right}px`},minWidth:Pl,backgroundColor:"var(--sa-background-primary, #ffffff)",border:ft,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"0 6px 24px rgba(0,0,0,0.12)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[t&&e.jsxs(e.Fragment,{children:[e.jsx(Wr,{icon:"ChevronUp",label:"Ascending",active:n==="asc",onClick:()=>v(()=>n==="asc"?i():c("asc"))}),e.jsx(Wr,{icon:"ChevronDown",label:"Descending",active:n==="desc",onClick:()=>v(()=>n==="desc"?i():c("desc"))}),e.jsx("div",{style:{borderTop:ft,margin:"4px 0"}})]}),e.jsx(Wr,{icon:"Pin1",label:o?"Unfreeze":"Freeze",active:o,onClick:()=>v(s)}),l&&e.jsx(Wr,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>v(a)})]})]})},br="1px solid var(--sa-border-subtle, #0b120e24)",In="var(--sa-text-subtle, #8c8f97)",dr="var(--sa-background-neutral, #f0f1f2)",Nl="2px 0 4px -2px rgba(0,0,0,0.15)",Cr=40,gt="var(--sa-background-brand-subtlest)",Ar={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},_l="sa-table-layout-styles",On=()=>{if(typeof document>"u"||document.getElementById(_l))return;const r=document.createElement("style");r.id=_l,r.textContent=`
1
+ (function(g,lr){typeof exports=="object"&&typeof module<"u"?lr(exports,require("@starasia/alert"),require("@starasia/badges"),require("@starasia/box"),require("@starasia/breadcrumb"),require("@starasia/button"),require("@starasia/card"),require("@starasia/date"),require("@starasia/dialog"),require("@starasia/drawer"),require("@starasia/dropdown"),require("@starasia/hooks"),require("@starasia/http"),require("@starasia/input"),require("@starasia/menu"),require("@starasia/pagination"),require("@starasia/storage"),require("@starasia/table"),require("@starasia/tabs"),require("@starasia/textarea"),require("@starasia/theme"),require("@starasia/toast"),require("@starasia/toggle"),require("@starasia/tooltip"),require("@starasia/checkbox"),require("@starasia/radio"),require("@starasia/text"),require("@starasia/icon"),require("@starasia/flex"),require("@starasia/grid"),require("@starasia/progress"),require("@starasia/stepper"),require("@starasia/accordion"),require("@starasia/story-record"),require("@starasia/skeleton"),require("@starasia/progress-stepper"),require("react/jsx-runtime"),require("react"),require("react-router"),require("react-dom"),require("react-easy-crop")):typeof define=="function"&&define.amd?define(["exports","@starasia/alert","@starasia/badges","@starasia/box","@starasia/breadcrumb","@starasia/button","@starasia/card","@starasia/date","@starasia/dialog","@starasia/drawer","@starasia/dropdown","@starasia/hooks","@starasia/http","@starasia/input","@starasia/menu","@starasia/pagination","@starasia/storage","@starasia/table","@starasia/tabs","@starasia/textarea","@starasia/theme","@starasia/toast","@starasia/toggle","@starasia/tooltip","@starasia/checkbox","@starasia/radio","@starasia/text","@starasia/icon","@starasia/flex","@starasia/grid","@starasia/progress","@starasia/stepper","@starasia/accordion","@starasia/story-record","@starasia/skeleton","@starasia/progress-stepper","react/jsx-runtime","react","react-router","react-dom","react-easy-crop"],lr):(g=typeof globalThis<"u"?globalThis:g||self,lr(g["@starasia/admin"]={},g.alert,g.badges,g.box,g.breadcrumb,g.button,g.card,g.date,g.dialog,g.drawer,g.dropdown,g.hooks,g.http,g.input,g.menu,g.pagination,g.storage,g.table,g.tabs,g.textarea,g.theme,g.toast,g.toggle,g.tooltip,g.checkbox,g.radio,g.text,g.icon,g.flex,g.grid,g.progress,g.stepper,g.accordion,g.storyRecord,g.skeleton,g.progressStepper,g.jsxRuntime,g.React,g.ReactRouter,g.ReactDOM,g.ReactEasyCrop))})(this,function(g,lr,$e,u,or,j,It,rr,Ae,kr,nr,pe,cr,Ke,A,gr,ur,q,Ot,Ur,sr,Wt,ir,me,Ze,Jr,k,M,oe,At,zt,Ht,Vt,Pt,ze,jt,e,h,be,Yr,yo){"use strict";const po={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},Xr=h.createContext(po),$r=()=>h.useContext(Xr),Nt=r=>{const[t,l]=h.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:l}},_t=h.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),qt=({children:r})=>{const[t,l]=h.useState({}),n=h.useCallback(s=>{l(a=>typeof s=="function"?s(a):s)},[]),o=h.useCallback((s,a)=>{l(d=>{const y=typeof a=="function"?a(d[s]):a;return{...d,[s]:y}})},[]),c=h.useCallback(s=>{l(a=>{if(!(s in a))return a;const d={...a};return delete d[s],d})},[]),i=h.useMemo(()=>({badges:t,setBadge:o,setBadges:n,clearBadge:c}),[t,o,n,c]);return e.jsx(_t.Provider,{value:i,children:r})},Zt=()=>h.useContext(_t),Br=(r,t)=>{const l=t!==void 0?t:r;return l==null?null:typeof l=="string"||typeof l=="number"?{value:l}:l},Gt=h.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),Qt=({children:r,defaultCollapsed:t=!1})=>{const[l,n]=h.useState(t),[o,c]=h.useState(!1),i=h.useCallback(v=>{n(T=>typeof v=="function"?v(T):v)},[]),s=h.useCallback(()=>n(v=>!v),[]),a=h.useCallback(()=>n(!0),[]),d=h.useCallback(()=>n(!1),[]),y=h.useCallback(v=>{c(T=>typeof v=="function"?v(T):v)},[]),b=h.useCallback(()=>c(!0),[]),p=h.useCallback(()=>c(!1),[]),x=h.useCallback(()=>c(v=>!v),[]),L=h.useMemo(()=>({collapsed:l,setCollapsed:i,toggle:s,collapse:a,expand:d,mobileOpen:o,setMobileOpen:y,openMobile:b,closeMobile:p,toggleMobile:x}),[l,i,s,a,d,o,y,b,p,x]);return e.jsx(Gt.Provider,{value:L,children:r})},Ut=()=>h.useContext(Gt),Jt=({router:r,menus:t=[],menuBottom:l,logo:n,appName:o="Workspace",initialUserData:c,theme:i})=>{const s=Nt({initialUserData:c}),{theme:a}=sr.useTheme();return e.jsx(Xr.Provider,{value:{logo:n,appName:o,menus:t,userData:s.userData,setUserData:s.setUserData,menuBottom:l},children:e.jsx(qt,{children:e.jsx(Qt,{children:i?e.jsx(sr.ThemeProvider,{value:i,children:r}):a?e.jsx(sr.ThemeProvider,{value:a,children:r}):r})})})},bo=h.memo(Jt);function Yt({collapsed:r=!1,children:t}){if(!t)return null;const l=typeof t=="function",n=l?t({collapsed:r}):t;return n==null||n===!1?null:e.jsx("div",{style:{position:"sticky",top:"4rem",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:"0.5rem",paddingRight:"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:l?n:e.jsx("div",{style:{opacity:r?0:1,transition:"opacity 0.3s",visibility:r?"hidden":"visible"},children:n})})}const Kr=h.createContext(null);function Xt({children:r}){const[t,l]=h.useState(null),[n,o]=h.useState(null),[c,i]=h.useState(null),[s,a]=h.useState(0),d=h.useCallback(()=>(a(y=>y+1),()=>a(y=>y-1)),[]);return e.jsx(Kr.Provider,{value:{prependNode:t,appendNode:n,replaceNode:c,setPrependNode:l,setAppendNode:o,setReplaceNode:i,replaceCount:s,registerReplace:d},children:r})}function $t({children:r}){const t=h.useContext(Kr);return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:t.setPrependNode,style:{display:"contents"}}),t.replaceCount>0?e.jsx("div",{ref:t.setReplaceNode,style:{display:"contents"}}):r,e.jsx("div",{ref:t.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:r})}function Co({children:r,mode:t="append"}){const l=h.useContext(Kr);if(h.useEffect(()=>{if(!(t!=="replace"||!l))return l.registerReplace()},[t,l]),!l)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const n=t==="prepend"?l.prependNode:t==="replace"?l.replaceNode:l.appendNode;return n?Yr.createPortal(r,n):null}const Rr=h.createContext(null);function Kt({children:r}){const[t,l]=h.useState({}),[n,o]=h.useState({}),c=h.useCallback((a,d)=>{l(y=>y[a]===d?y:{...y,[a]:d})},[]),i=h.useCallback(a=>(o(d=>({...d,[a]:(d[a]??0)+1})),()=>o(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),s=h.useMemo(()=>({outletNodes:t,setOutletNode:c,slotCounts:n,registerSlot:i}),[t,c,n,i]);return e.jsx(Rr.Provider,{value:s,children:r})}function Rt({slotKey:r,fallback:t}){const l=h.useContext(Rr),n=l?(l.slotCounts[r]??0)>0:!1,o=h.useRef(l==null?void 0:l.setOutletNode);o.current=l==null?void 0:l.setOutletNode;const c=h.useCallback(i=>{var s;return(s=o.current)==null?void 0:s.call(o,r,i)},[r]);return e.jsx(e.Fragment,{children:n?e.jsx("div",{ref:c,style:{display:"contents"}}):t})}function vo({slotKey:r,children:t}){const l=h.useContext(Rr),n=h.useRef(l==null?void 0:l.registerSlot);if(n.current=l==null?void 0:l.registerSlot,h.useEffect(()=>{var c;return(c=n.current)==null?void 0:c.call(n,r)},[r]),!l)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const o=l.outletNodes[r];return o?Yr.createPortal(t,o):null}const mr="moduleSwitcherGroupId",et="sa-module-switcher-change";function el(){if(typeof window>"u")return null;const r=window.localStorage.getItem(mr);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function rl(r){typeof window>"u"||(r===null?window.localStorage.removeItem(mr):window.localStorage.setItem(mr,String(r)),window.dispatchEvent(new CustomEvent(et,{detail:r})))}function xo(){rl(null)}function rt(){const[r,t]=h.useState(()=>el());return h.useEffect(()=>{const n=()=>{t(el())},o=c=>{c.key===mr&&n()};return window.addEventListener(et,n),window.addEventListener("storage",o),()=>{window.removeEventListener(et,n),window.removeEventListener("storage",o)}},[]),{selectedGroupId:r,setSelectedGroupId:n=>{rl(n),t(n)}}}let Fr=0,tr=!1,tl=new Set;const ll=()=>e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"1.667",y:"1.667",width:"12.667",height:"12.667",rx:"2"}),e.jsx("line",{x1:"6",y1:"1.667",x2:"6",y2:"14.333"})]}),ol={width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",paddingLeft:"0.75rem",paddingRight:"0.75rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",fontSize:"0.875rem",color:"var(--sa-text-subtle, #8c8f97)",background:"transparent",border:"none",borderRadius:"0.375rem",cursor:"pointer",textAlign:"left"};function wo({children:r,headerLeftSlot:t,profile:l,isLoadingProfile:n,onLogout:o,isLoggingOut:c,loadingComponent:i,sidebarHeaderContent:s,headerActions:a,profileRole:d,profileMenuButtons:y,profileMenuItems:b,logoutButton:p}){var Pe,Ue;const[x]=be.useSearchParams(),L=x.get("embed")==="true",v=$r(),{badges:T}=Zt(),F=be.useNavigate(),O=be.useLocation(),D=!pe.useMediaQuery("md"),[H,z]=h.useState(!1),{collapsed:S,setCollapsed:I,mobileOpen:V,setMobileOpen:P}=Ut(),[Q,U]=h.useState(!1),[re,fe]=h.useState(()=>new Set(tl)),[se,ee]=h.useState(null),{selectedGroupId:G,setSelectedGroupId:X}=rt();h.useEffect(()=>{tl=re},[re]);const de=h.useRef(null),xe=h.useRef(null);h.useEffect(()=>{const m=de.current;if(!m)return;const Z=()=>{tr||(Fr=m.scrollTop)};return m.addEventListener("scroll",Z),()=>m.removeEventListener("scroll",Z)},[]);const ke=()=>{const m=de.current;m&&Fr>0&&(tr=!0,m.scrollTop=Fr,requestAnimationFrame(()=>{tr=!1}))};h.useLayoutEffect(()=>{tr=!0,ke();const m=setTimeout(()=>{tr=!1},300);return()=>clearTimeout(m)},[]),h.useLayoutEffect(()=>{v.menus.length>0&&(Fr>0?ke():requestAnimationFrame(()=>{var Z;const m=(Z=de.current)==null?void 0:Z.querySelector("[data-menu-active='true']");m&&m.scrollIntoView({block:"center",behavior:"instant"})}))},[v.menus]),h.useEffect(()=>{tr=!0,ke();const m=setTimeout(ke,0),Z=setTimeout(ke,50),K=setTimeout(ke,100),W=setTimeout(ke,200),J=setTimeout(()=>{tr=!1},300),_=setTimeout(()=>{const Y=de.current,N=Y==null?void 0:Y.querySelector("[data-menu-active='true']");if(Y&&N){const he=Y.getBoundingClientRect(),Ee=N.getBoundingClientRect();Ee.top>=he.top&&Ee.bottom<=he.bottom||N.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(m),clearTimeout(Z),clearTimeout(K),clearTimeout(W),clearTimeout(J),clearTimeout(_)}},[O.pathname]),h.useEffect(()=>{xe.current&&(xe.current.scrollTop=0)},[O.pathname]),h.useEffect(()=>{D&&P(!1)},[O.pathname,D]),h.useEffect(()=>{D&&I(!0)},[D]);const ye=()=>{z(!0)},Ce=()=>{z(!1)},we=()=>{z(!1),o()},Ne=m=>{const Z=[m.to];return m.children&&Z.push(...m.children.map(K=>K.to)),Z},Oe=[...v.menus.flatMap(m=>m.items.flatMap(Ne)),...((Pe=v.menuBottom)==null?void 0:Pe.flatMap(Ne))??[]],ve=m=>{if(!O.pathname.startsWith(m))return!1;const Z=Oe.filter(K=>O.pathname.startsWith(K)).sort((K,W)=>W.length-K.length)[0];return m===Z};h.useEffect(()=>{var Z;const m=K=>{var W;(W=K.children)!=null&&W.some(J=>O.pathname.startsWith(J.to))&&fe(J=>{const _=new Set(J);return _.add(K.id),_})};v.menus.forEach(K=>{K.items.forEach(m)}),(Z=v.menuBottom)==null||Z.forEach(m)},[O.pathname,v.menus,v.menuBottom]);const Ve=m=>{fe(Z=>{const K=new Set(Z);return K.has(m)?K.delete(m):K.add(m),K})};h.useEffect(()=>{v.menus.length!==0&&G!==null&&!v.menus.some(m=>m.id===G)&&X(null)},[v.menus,G,X]);const Be=h.useMemo(()=>{if(G!==null)return v.menus.filter(K=>K.id===G||K.parentGroupId===G);const m=v.menus.filter(K=>K.parentGroupId===void 0),Z=v.menus.filter(K=>K.parentGroupId!==void 0).flatMap(K=>K.items);return Z.length===0?m:[...m,{id:18,name:"Pengaturan",items:Z,parentGroupId:void 0}]},[v.menus,G]);if(L)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:r||e.jsx(be.Outlet,{})});const Ie=m=>{const Z=m.children&&m.children.length>0,K=re.has(m.id),W=Z?m.children.some(Y=>ve(Y.to)):ve(m.to),J=Br(m.badge,T[m.id]),_=!!J&&S&&!D;return e.jsxs("div",{"data-menu-active":W||void 0,children:[e.jsxs("button",{onClick:Y=>{if(Z)if(S&&!D){const N=Y.currentTarget.getBoundingClientRect();ee({item:m,top:N.top,left:N.right+8})}else Ve(m.id);else F(m.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:S&&!D?"center":void 0,gap:"0.5rem",paddingLeft:S&&!D?"0":"0.5rem",paddingRight:S&&!D?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:W?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:W?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:W?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:S&&!D?m.title:void 0,onMouseEnter:Y=>{W||(Y.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:Y=>{W||(Y.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(M.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),_&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:"-2px",right:"-2px",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-error-500, #ff4d6d)",border:"1px solid var(--sa-background-primary, #ffffff)"}})]}),(!S||D)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",transition:"opacity 0.3s",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:m.title}),J&&e.jsx($e.Badges,{text:String(J.value),variant:J.variant??"info",size:"xs",border:!0}),Z&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:K?"rotate(180deg)":"rotate(0deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),Z&&(!S||D)&&(()=>{const Y=m.children.findIndex(N=>ve(N.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:K?`${m.children.length*36}px`:"0px",opacity:K?1:0,marginTop:K?"0.25rem":"0px"},children:[e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"1.5px",height:"100%",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),Y>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${Y*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),m.children.map(N=>{const he=Br(N.badge,T[N.id]);return e.jsxs("button",{onClick:()=>F(N.to),style:{width:"100%",display:"flex",alignItems:"center",gap:"0.5rem",paddingLeft:"0.75rem",paddingRight:"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:ve(N.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:ve(N.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:ve(N.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:ve(N.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:Ee=>{ve(N.to)||(Ee.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:Ee=>{ve(N.to)||(Ee.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(M.Icon,{name:N.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:N.title}),he&&e.jsx($e.Badges,{text:String(he.value),variant:he.variant??"info",size:"xs",border:!0})]},N.id)})]})})()]},m.id)};return e.jsx(Kt,{children:e.jsxs(Xt,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":D?"0px":S?"4.375rem":"16.375rem","--app-footer-zindex":D&&V?"40":"998"},children:[D&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:V?.5:0,pointerEvents:V?"auto":"none",transition:"opacity 0.3s"},onClick:()=>P(!1)}),e.jsxs("aside",{style:{width:D?"16.375rem":S?"4.375rem":"16.375rem",position:D?"fixed":"relative",...D&&{inset:0,zIndex:50,transform:V?"translateX(0)":"translateX(-100%)"},backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",borderRight:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",flexDirection:"column",transition:"all 0.3s ease-in-out",flexShrink:D?void 0:0},children:[e.jsx("div",{onMouseEnter:()=>U(!0),onMouseLeave:()=>U(!1),style:{height:"4rem",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",position:"relative"},children:(()=>{const m=!D&&S&&!V,Z=m&&Q;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:m?1:void 0,justifyContent:m?"center":void 0,transition:"opacity 0.2s",opacity:Z?0:1,pointerEvents:Z?"none":"auto"},children:[e.jsx("img",{src:v.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!S||V)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:v.appName})]}),!D&&!S&&e.jsx("button",{type:"button",onClick:()=>I(!0),"aria-label":"Collapse sidebar",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1rem",height:"1rem",padding:0,background:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer",flexShrink:0},children:e.jsx(ll,{})}),m&&e.jsx("button",{type:"button",onClick:()=>I(!1),"aria-label":"Expand sidebar",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2rem",height:"2rem",padding:0,background:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-sm, 0.375rem)",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer",opacity:Z?1:0,pointerEvents:Z?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(ll,{})})}),D&&e.jsx("button",{onClick:()=>P(!1),"aria-label":"Close menu",style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.25rem",height:"1.25rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})()}),s&&e.jsx(Yt,{collapsed:D?!1:S,children:s}),e.jsx("div",{ref:de,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:Be.map(m=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!S||D?m.name&&e.jsx("div",{style:{paddingLeft:"1.5rem",paddingRight:"1rem",paddingTop:"0rem",paddingBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"400",color:"var(--sa-text-subtlest, #6b6e76)",transition:"opacity 0.3s",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:m.name}):m.name&&e.jsx("div",{"aria-label":m.name,style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"0.75rem",paddingBottom:"0.75rem"},children:e.jsx("span",{style:{display:"block",width:"1rem",height:"2px",borderRadius:"1px",backgroundColor:m.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx("div",{style:{paddingLeft:"1rem",paddingRight:"1rem",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)"},children:m.slotKey?e.jsx(Rt,{slotKey:m.slotKey,fallback:m.items.map(Z=>Ie(Z))}):m.items.map(Z=>Ie(Z))})]},m.id))}),v.menuBottom&&v.menuBottom.length>0&&e.jsx("div",{style:{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",paddingTop:"0.75rem",paddingBottom:"0.75rem",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)",flexShrink:0},children:v.menuBottom.map(m=>Ie(m))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("header",{style:{height:"4rem",backgroundColor:"var(--sa-background-primary, #ffffff)",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:D?"1rem":void 0},children:[D&&e.jsx("button",{onClick:()=>P(!0),style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.5rem",height:"1.5rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),e.jsx($t,{children:t})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[a,e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[e.jsxs("div",{style:{textAlign:"right",maxWidth:"12.5rem"},children:[e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:500,color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?"Loading...":(l==null?void 0:l.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?"":(l==null?void 0:l.email)||"unknown"})]}),e.jsx("div",{style:{width:"2.5rem",height:"2.5rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"0.875rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",flexShrink:0,backgroundColor:"var(--sa-background-brand, #04254f)"},children:((l==null?void 0:l.name)||"U")[0].toUpperCase()}),e.jsx(M.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(A.MenuLists,{style:{width:"280px",paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(A.MenuHeading,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",paddingBlock:"0.5rem"},children:[e.jsx("div",{style:{width:"4rem",height:"4rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"1.25rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",marginBottom:"0.75rem",backgroundColor:"var(--sa-background-brand, #04254f)"},children:((l==null?void 0:l.name)||"U")[0].toUpperCase()}),e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:600,color:"var(--sa-text-primary, #292a2e)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(l==null?void 0:l.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(l==null?void 0:l.email)||"unknown"}),d&&e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d})]})}),(y&&y.length>0||b)&&e.jsxs(A.MenuBody,{children:[y==null?void 0:y.map((m,Z)=>e.jsx(A.MenuButton,{children:e.jsxs("button",{type:"button",onClick:m.onClick,style:ol,onMouseEnter:K=>{K.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:K=>{K.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(M.Icon,{name:m.icon,size:"md"}),e.jsx("span",{children:m.label})]})},`${m.label}-${Z}`)),b]}),p??e.jsx(A.MenuFooter,{children:e.jsx(A.MenuButton,{children:e.jsxs("button",{type:"button",onClick:ye,style:{...ol,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(M.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:xe,style:{flex:1,overflowY:"auto"},children:r||e.jsx(be.Outlet,{})})]})]}),c&&i&&e.jsx("div",{style:{position:"fixed",inset:0,background:"var(--sa-color-black-alpha-a70, #181a19b8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:i}),e.jsxs(Ae.Dialog,{isShow:H,onHide:Ce,children:[e.jsx(Ae.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Ae.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Ae.DialogFooter,{children:e.jsx(u.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(oe.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(u.Box,{direction:"column",children:e.jsx(j.Button,{secondary:!0,onClick:Ce,children:"Cancel"})}),e.jsx(u.Box,{direction:"column",children:e.jsx(j.Button,{primary:!0,onClick:we,children:"Yes, Sure"})})]})})})]}),se&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>ee(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":se.item.title,style:{position:"fixed",top:se.top,left:se.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem",backgroundColor:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-md, 0.5rem)",boxShadow:"var(--sa-shadow-lg, 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a)",padding:"0.5rem",display:"flex",flexDirection:"column",gap:"0.125rem"},children:[e.jsx("div",{style:{fontSize:"0.75rem",fontWeight:600,color:"var(--sa-color-gray-500, #8c8f97)",padding:"0.25rem 0.5rem 0.5rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:se.item.title}),(Ue=se.item.children)==null?void 0:Ue.map(m=>{const Z=ve(m.to),K=Br(m.badge,T[m.id]);return e.jsxs("button",{onClick:()=>{F(m.to),ee(null)},style:{width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.5rem 0.75rem",borderRadius:"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:Z?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:Z?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:W=>{Z||(W.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:W=>{Z||(W.currentTarget.style.backgroundColor="transparent")},children:[m.icon&&e.jsx(M.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:m.title}),K&&e.jsx($e.Badges,{text:String(K.value),variant:K.variant??"info",size:"xs",border:!0})]},m.id)})]})]})]})})}const yr=h.forwardRef(({children:r,...t},l)=>e.jsx(u.Box,{ref:l,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...t,children:r})),nl=({title:r,iconName:t,textColor:l,iconColor:n,hoverTextColor:o,hoverIconColor:c})=>{const[i,s]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=l??"var(--sa-text-subtle, #8c8f97)",y=c??"var(--sa-text-subtle, #8c8f97)",b=o??"var(--sa-text-primary, #292a2e)";return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{cursor:"pointer"},children:[e.jsx(M.Icon,{name:t||"ChevronLeft",size:"xs",style:{color:i?y:a,transition:"color 0.15s ease"}}),e.jsx(k.Text,{variant:"sub-h3",style:{color:i?b:d,transition:"color 0.15s ease"},children:r||"Back"})]})},Do=({items:r,separator:t="/",iconName:l,iconColor:n,hoverIconColor:o})=>{const[c,i]=h.useState(!1),s=n??"var(--sa-text-subtle, #8c8f97)",a=o??"var(--sa-text-subtle, #8c8f97)",d=r.length>1?r[0]:void 0,y=!!(d!=null&&d.to||d!=null&&d.onClick),b=e.jsx(M.Icon,{name:l||"ChevronLeft",size:"xs",onMouseEnter:y?()=>i(!0):void 0,onMouseLeave:y?()=>i(!1):void 0,style:{color:y&&c?a:s,transition:"color 0.15s ease",cursor:y?"pointer":void 0}}),p=d!=null&&d.to?e.jsx(be.Link,{to:d.to,replace:!0,style:{textDecoration:"none"},children:b}):d!=null&&d.onClick?e.jsx(yr,{onClick:d.onClick,children:b}):b;return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",children:[p,e.jsx(or.Breadcrumb,{separator:t,size:"md",children:r.map((x,L)=>{const v=L===r.length-1;return x.to&&!v?e.jsx(or.BreadcrumbItem,{children:e.jsx(be.Link,{to:x.to,children:x.label})},L):e.jsx(or.BreadcrumbItem,{currentPage:v,children:e.jsx(or.BreadcrumbLink,{onClick:v?void 0:x.onClick,children:x.label})},L)})})]})},So=r=>{const{items:t,separator:l,onClick:n,navigateTo:o,...c}=r;return t&&t.length>0?e.jsx(Do,{items:t,separator:l,iconName:c.iconName,iconColor:c.iconColor,hoverIconColor:c.hoverIconColor}):o?e.jsx(u.Box,{direction:"row",children:e.jsx(be.Link,{to:o,replace:!0,style:{textDecoration:"none"},children:e.jsx(nl,{...c})})}):e.jsx(u.Box,{direction:"row",children:e.jsx(yr,{onClick:n,children:e.jsx(nl,{...c})})})},tt=[{icon:"var(--sa-color-brand-400, #3366b7)",activeBg:"var(--sa-color-brand-50, #e6edf6)",activeBorder:"var(--sa-color-brand-300, #668cc9)",activeShadow:"rgba(51, 102, 183, 0.25)"},{icon:"var(--sa-color-warning-400, #ed9f30)",activeBg:"var(--sa-color-warning-50, #fef2e6)",activeBorder:"var(--sa-color-warning-300, #f1b259)",activeShadow:"rgba(237, 159, 48, 0.25)"},{icon:"var(--sa-color-secondary-300, #5468e1)",activeBg:"var(--sa-color-secondary-50, #e6e9fb)",activeBorder:"var(--sa-color-secondary-200, #8a98ea)",activeShadow:"rgba(84, 104, 225, 0.25)"},{icon:"var(--sa-color-info-500, #00abeb)",activeBg:"var(--sa-color-info-50, #effaff)",activeBorder:"var(--sa-color-info-300, #75dbff)",activeShadow:"rgba(0, 171, 235, 0.25)"},{icon:"var(--sa-color-success-500, #30ce84)",activeBg:"var(--sa-color-success-50, #ecfff6)",activeBorder:"var(--sa-color-success-300, #75dead)",activeShadow:"rgba(48, 206, 132, 0.25)"},{icon:"var(--sa-color-error-400, #ff758f)",activeBg:"var(--sa-color-error-50, #fff0f3)",activeBorder:"var(--sa-color-error-300, #ff8fa3)",activeShadow:"rgba(255, 117, 143, 0.25)"}];function cl(r,t,l){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:r?`2px solid ${l.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:r?l.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:r?t?`0 8px 20px ${l.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${l.activeShadow}`:t?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:t?"translateY(-3px) scale(1.05)":"translateY(0) scale(1)",transition:"box-shadow 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease"}}const sl={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},il={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function al({isShow:r,onHide:t,menus:l,selectedGroupId:n,onSelect:o}){const[c,i]=h.useState(void 0),s=d=>{o(d),t()},a=tt[0];return e.jsx(Ae.Dialog,{isShow:r,onHide:t,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Ae.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>s(null),onMouseEnter:()=>i("all"),onMouseLeave:()=>i(void 0),style:il,children:[e.jsx("div",{style:cl(n===null,c==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(M.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:sl,children:"Semua"})]}),l.map((d,y)=>{var v;const b=n===d.id,p=c===d.id,x=((v=d.items[0])==null?void 0:v.icon)??"Grid",L=tt[(y+1)%tt.length];return e.jsxs("button",{onClick:()=>s(d.id),onMouseEnter:()=>i(d.id),onMouseLeave:()=>i(void 0),style:il,children:[e.jsx("div",{style:cl(b,p,L),children:e.jsx("div",{style:{color:L.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(M.Icon,{name:x,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:sl,children:d.name})]},d.id)})]})})})}function ko({onSelect:r,"aria-label":t="Pilih module"}={}){const l=$r(),n=be.useNavigate(),{selectedGroupId:o,setSelectedGroupId:c}=rt(),[i,s]=h.useState(!1),a=d=>{var y;if(c(d),d!==null){const b=l.menus.find(x=>x.id===d),p=(y=b==null?void 0:b.items[0])==null?void 0:y.to;p&&n(p)}r==null||r(d)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>s(!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2.25rem",height:"2.25rem",borderRadius:"var(--sa-radii-sm, 0.25rem)",border:"1px solid var(--sa-border-subtle, #0b120e24)",color:"var(--sa-text-subtle, #8c8f97)",backgroundColor:"transparent",cursor:"pointer"},"aria-label":t,onMouseEnter:d=>{d.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:e.jsx(M.Icon,{name:"GridApplication",size:"sm"})}),o!==null&&e.jsx("span",{style:{position:"absolute",top:"0.25rem",right:"0.25rem",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-brand-500, #1a4fa0)"},"aria-hidden":"true"})]}),e.jsx(al,{isShow:i,onHide:()=>s(!1),menus:l.menus.filter(d=>d.parentGroupId===void 0),selectedGroupId:o,onSelect:a})]})}const Bo=(r,t)=>{const l=[];if(t===0)return l.push(r),l;for(let n=0;n<r.length;n+=t){const o=r.slice(n,n+t);l.push(o)}return l},mo=h.memo(({value:r,label:t,separator:l,labelWidth:n,lastIndex:o,labelAlign:c="top"})=>{const i=h.useMemo(()=>({padding:0,paddingBottom:o?0:12,verticalAlign:c}),[o,c]),s=h.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:o?0:12,verticalAlign:c}),[o,c]),a=()=>typeof t=="string"?e.jsx(k.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,d=()=>typeof r=="string"||typeof r=="number"?e.jsx(k.Text,{color:"primary",fontWeight:"medium",children:r}):r,y=()=>typeof l=="string"||typeof l=="number"?e.jsx(k.Text,{fontWeight:"medium",color:"subtlest",children:l}):l;return e.jsxs(q.Tr,{children:[e.jsx(q.Td,{style:i,width:n,children:a()}),l?e.jsx(q.Td,{style:s,width:24,children:y()}):null,e.jsx(q.Td,{style:i,children:d()})]})}),Fo=h.memo(({fields:r,separator:t,labelWidth:l})=>e.jsx(q.Table,{withColumnBorder:!1,withRowBorder:!1,children:r.map((n,o)=>e.jsx(mo,{separator:t,labelWidth:l,lastIndex:o===r.length-1,...n},`field-group-field-${o}`))})),Eo=h.memo(({maxRow:r=0,maxColumn:t=2,separator:l=":",fields:n=[],labelWidth:o=150,bordered:c=!1})=>{const i=h.useMemo(()=>Bo(n,r),[n,r]),s=i.length>2,a=()=>{switch(t){case 1:return"width-full";case 2:return"width-1-2";case 3:return"width-1-3";case 4:return"width-1-4";default:return"width-1-2"}};return e.jsx(u.Box,{gap:s?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:s?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:c?"border":void 0,borderStyle:c?"border-solid":void 0,borderColor:c?"border-subtle":void 0,children:i.map((d,y)=>e.jsx(u.Box,{direction:"column",flex:s?void 0:"1",width:s?a():void 0,marginBottom:s?"lg":void 0,children:e.jsx(Fo,{labelWidth:o,fields:d,separator:l})},y))})}),Mo=({backButton:r})=>{const[t,l]=h.useState(!1),n=(r==null?void 0:r.iconColor)??"var(--sa-text-subtle, #8c8f97)",o=(r==null?void 0:r.textColor)??"var(--sa-text-subtle, #8c8f97)",c=(r==null?void 0:r.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",i=(r==null?void 0:r.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{cursor:"pointer"},children:[e.jsx(M.Icon,{name:(r==null?void 0:r.iconName)||"ChevronLeft",size:"xs",style:{color:t?c:n,transition:"color 0.15s ease"}}),e.jsx(k.Text,{variant:"sub-h3",style:{color:t?i:o,textDecoration:t?"underline":"none",transition:"color 0.15s ease"},children:(r==null?void 0:r.title)||"Back"})]})},Lo=({backButton:r,title:t,titleIcon:l,titleTag:n,children:o,header:c=!0,headerBorder:i=!1,subHeaders:s,action:a,titleTagProps:d,containerProps:y,headerProps:b})=>{const p=pe.useMediaQuery("md"),x=be.useNavigate(),L=be.useLocation(),v=r==null?void 0:r.show,T=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}x(-1,{replace:!0})},F=()=>{if(!a)return null;if(h.isValidElement(a))return a;const S=a.filter(I=>I&&(I.title||I.icon));return S.length===0?null:p?e.jsx(u.Box,{direction:"row",gap:"md",children:S.map(({title:I,icon:V,buttonProps:P,onClick:Q},U)=>e.jsx(j.Button,{iconLeft:V?e.jsx(M.Icon,{name:V,size:"md"}):void 0,onClick:Q,...P,children:I},`action-${U}`))}):e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(M.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{minWidth:200},children:S.map(({title:I,icon:V,buttonProps:P,onClick:Q},U)=>{const re=(P==null?void 0:P.tone)==="error"||(P==null?void 0:P.danger)===!0;return e.jsx(A.MenuItem,{intent:re?"danger":void 0,disabled:P==null?void 0:P.disabled,startIcon:V?e.jsx(M.Icon,{name:V}):void 0,onClick:Q,children:I},`action-${U}`)})})})]})},O=()=>{const S=e.jsx(Mo,{backButton:r});return r!=null&&r.navigateTo?e.jsx(u.Box,{direction:"row",children:e.jsx(be.Link,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:S})}):e.jsx(u.Box,{direction:"row",children:e.jsx(yr,{onClick:T,children:S})})},B=()=>{const S=!!t,I=Array.isArray(a)&&a.length>0,V=h.isValidElement(a)?!0:I;if(!S&&!V&&!v)return null;const Q=p||!p&&I;return e.jsxs(u.Box,{direction:"column",gap:"xs",paddingBlock:(b==null?void 0:b.paddingBlock)??"sm",paddingInline:(b==null?void 0:b.paddingInline)??"md",...b,style:{...i?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...b==null?void 0:b.style},children:[v&&O(),(S||V)&&e.jsxs(u.Box,{direction:Q?"row":"column",gap:"sm",justify:"space-between",align:Q?"center":"flex-start",children:[S?typeof t=="string"?e.jsxs(u.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[l&&e.jsx(M.Icon,{name:l,size:"md",color:"primary"}),e.jsx(k.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:t})]}),n&&e.jsx($e.Badge,{border:!0,size:"lg",text:n,...d})]}):t:null,F()]})]})},D=()=>{if(!s||s.length===0)return null;const S=s.filter(P=>P.show!==!1);if(S.length===0)return null;let I=0,V=-1/0;return S.forEach((P,Q)=>{const U=P.order??0;U>=V&&(V=U,I=Q)}),S.map(({content:P,order:Q,borderBottom:U=!0,keepBottomPadding:re=!1,paddingInline:fe=!0,paddingBlock:se=!0},ee)=>e.jsx(u.Box,{direction:"column",paddingTop:se?"sm":"spacing-0",paddingBottom:se&&(U||re||ee===I)?"sm":"spacing-0",paddingInline:fe?"md":"spacing-0",style:{...U?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...Q!==void 0?{order:Q}:{}},children:P},`sub-header-${ee}`))},H=()=>{const S=c?B():null,I=D();return!S&&!I?null:e.jsxs(u.Box,{direction:"column",style:{marginBottom:I?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[S,I]})},z=()=>o;return e.jsxs(u.Box,{direction:"column",as:"main",...y,style:{...(y==null?void 0:y.style)??{},animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"},children:[H(),z()]},L.pathname)},To=h.memo(Lo),Io={icon:"Cross",title:""},Oo="calc(100vw - 16px)",dl=r=>r==null?void 0:`min(${typeof r=="number"?`${r}px`:r}, ${Oo})`,hl=h.forwardRef(({onHide:r,show:t,withBlur:l=!1,style:n,children:o,closeButton:c=Io,width:i,minWidth:s="357px",maxWidth:a="357px"},d)=>{const y=dl(i??s),b=dl(i??a);return e.jsx(kr.Drawer,{blur:l,isShow:t,position:"right",onHide:r,ref:d,style:{minWidth:y,maxWidth:b,...n},children:e.jsxs(u.Box,{direction:"column",padding:"lg",children:[c?e.jsxs(u.Box,{direction:"row",align:"center",gap:"sm",onClick:r,marginBottom:"lg",cursor:"pointer",children:[e.jsx(M.Icon,{name:c.icon,size:"md",color:"subtle",cursor:"pointer"}),c.title?e.jsx(k.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:c.title}):null]}):null,o]})})}),lt=h.memo(({children:r,borderBottom:t=!0,padding:l=!0})=>{const n=pe.useMediaQuery("lg");return e.jsx(u.Box,{direction:"column",padding:l?"md":"spacing-0",paddingLeft:l?"md":"spacing-0",paddingRight:l?"md":"spacing-0",style:t?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),ot=h.memo(({children:r,borderTop:t=!0,padding:l=!0})=>{const n=pe.useMediaQuery("lg");return e.jsx(u.Box,{direction:"column",padding:l?"md":"spacing-0",paddingLeft:l?"md":"spacing-0",paddingRight:l?"md":"spacing-0",style:t?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),Wo=h.memo(({children:r,...t})=>e.jsx(u.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),Ao=h.memo(({children:r,title:t,titleTag:l,action:n,header:o,footer:c,actionContainer:i,containerProps:s,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:y={borderTop:!0},variantTag:b="info"})=>{const p=pe.useMediaQuery("lg"),x=()=>l?e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(k.Text,{fontWeight:"medium",children:t}),e.jsx($e.Badges,{border:!0,text:l,variant:b})]}):e.jsx(k.Text,{fontWeight:"medium",children:t}),L=()=>o||e.jsxs(u.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(u.Box,{direction:"column",children:t?x():null}),e.jsx(u.Box,{direction:"column",style:p?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...i,children:n??null})]}),v=!!(o||t||n);return e.jsxs(u.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...s,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(s==null?void 0:s.style)??{}},children:[o!==null&&v?e.jsx(lt,{...d,children:L()}):null,e.jsx(Wo,{...a,children:r}),c?e.jsx(ot,{...y,children:c}):null]})}),He={H1:r=>e.jsx(k.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(k.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(k.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(k.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(k.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(k.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(k.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(k.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(k.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(k.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(k.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(k.Text,{variant:"body-3",children:r.children,...r.props})},Me=()=>{const[r,t]=be.useSearchParams(),l=cr.searchParamsToObject(r.toString()),n=be.useParams(),o=be.useLocation(),c=n.id;return{setSearchParams:t,searchParams:r,searchQueries:l,isHasQuery:(y,b)=>r.has(y)&&r.get(y)===b,getQueryParam:y=>r.get(y),getRouteParam:y=>n[y],params:n,location:o,id:c,hasId:!!c}},fl=r=>JSON.stringify(r),gl=r=>JSON.stringify(r),ul=r=>JSON.stringify(r),yl=r=>JSON.stringify(r),zo=r=>r,Ho=r=>JSON.stringify(r),pr=({value:r,name:t,type:l,withSearchParam:n=!0,setSearchParams:o,searchQueries:c,dropdownSearchKey:i,filterKey:s="filter",pageKey:a="page"})=>{if(n){let d;switch(l){case"search":d=zo(r);break;case"dropdown":case"dropdown-multiple":d=fl(r);break;case"radio":d=gl(r);break;case"date-range":d=ul(r);break;case"advanced-date-range":d=Ho(r);break;case"date":d=yl(r);break;default:d=r;break}if(typeof d<"u"){const b={...c[s]&&typeof c[s]=="string"?JSON.parse(c[s]):void 0,[t]:d},p={...c};i&&typeof i=="string"&&delete p[i],delete p[a];const x={...p,[s]:JSON.stringify(b)},L=new URLSearchParams(c).toString(),v=new URLSearchParams(x).toString();if(L===v)return;o(x)}}},Er=({name:r,filterKey:t="filter",searchParams:l,get:n})=>{const o=l.get(t)||void 0,c=o&&typeof o=="string"?JSON.parse(o):void 0,i=c?c[r]:void 0;return n==="label"&&i?JSON.parse(i)[0].label:n==="value"&&i?JSON.parse(i)[0].value:i},pl=({name:r,filterKey:t="filter",searchParams:l,get:n})=>{const o=l.get(t)||void 0,c=o&&typeof o=="string"?JSON.parse(o):void 0,i=c?c[r]:void 0;return n==="label"&&i?JSON.parse(i).map(s=>s.label):n==="value"&&i?JSON.parse(i).map(s=>s.value):n==="array"&&i?JSON.parse(i):i},Vo=({name:r,filterKey:t="filter",searchParams:l,get:n})=>{const o=l.get(t)||void 0,c=o&&typeof o=="string"?JSON.parse(o):void 0,i=c?c[r]:void 0;return n==="id"&&i?JSON.parse(i).id:n==="label"&&i?JSON.parse(i).label:n==="value"&&i?JSON.parse(i).value:i},Mr=(r,t,l)=>{const n=t.get(l||"filter")||void 0,o=n&&typeof n=="string"?JSON.parse(n):void 0;return o?o[r]:void 0},Po=({name:r,filterKey:t="filter",searchParams:l})=>{const n=l.get(t||"filter")||void 0,o=n&&typeof n=="string"?JSON.parse(n):void 0,c=o?o[r]:void 0;return{start:c?JSON.parse(c).from:void 0,end:c?JSON.parse(c).to:void 0}},bl=({name:r,filterKey:t="filter",searchParams:l})=>{const n=l.get(t||"filter")||void 0,o=n&&typeof n=="string"?JSON.parse(n):void 0,c=o?o[r]:void 0;return c?JSON.parse(c):void 0},jo=(r,{filterKey:t="filter",perPageKey:l="perPage",pageKey:n="page"})=>{const o=r.get(t)||void 0,c=r.get(l)||void 0,i=r.get(n)||void 0;return!!o||!!c||!!i},Cl=({isOpen:r,onClose:t,filterKey:l,pageKey:n,filters:o})=>{const{searchParams:c,setSearchParams:i,searchQueries:s}=Me(),[a,d]=h.useState({}),y=()=>{c.delete(l||"filter"),i(c)},b=(p,x)=>{switch(p.type){case"radio":{const{show:L=!0}=p;return L&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},x)}case"dropdown":{const{show:L=!0}=p;return L&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},x)}case"date-range":return e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},x);case"date":return e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},x);case"dropdown-multiple":{const{show:L=!0}=p;return L&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},x)}default:return null}};return e.jsx(hl,{onHide:t,show:r||!1,children:e.jsxs(u.Box,{direction:"column",gap:"md",children:[e.jsxs(oe.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(u.Box,{direction:"column",children:"Filter"}),e.jsx(u.Box,{direction:"column",style:{cursor:"pointer"},onClick:y,children:"Reset"})]}),o==null?void 0:o.map((p,x)=>b(p,x))]})})},vl=({searchKey:r="q",statusKey:t="status",searchPlaceholder:l="Search",searchHighlightPlaceholder:n,extendedFilter:o,showSearchFilter:c=!0,showStatusFilter:i=!0,filterKey:s="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:y,filterConfigs:b,buttonToggleProps:p,position:x="right",titleSearchLabel:L="Work Order",withTitleLabels:v=!1})=>{const F=(p==null?void 0:p.isShowLabel)??!0,[O,B]=h.useState(!1),[D,H]=h.useState(0),z=()=>{H(X=>X+1)},{searchParams:S,setSearchParams:I,getQueryParam:V}=Me(),P=cr.searchParamsToObject(S.toString()),Q=Mr(r,S,s)||"",[U,re]=h.useState(Q),fe=V(s),ee=!!(fe&&!(()=>{if(fe)try{const X=JSON.parse(fe);return Object.keys(X).length===1&&X[r]===""}catch(X){console.error("Filter parameter is not a valid JSON:",X)}return!1})()),G=pe.useMediaQuery("md");return h.useEffect(()=>{re(Q)},[Q]),h.useEffect(()=>{if(U===Q)return;const X=window.setTimeout(()=>{pr({value:U,name:r,type:"search",searchQueries:P,setSearchParams:I,filterKey:s,pageKey:a})},350);return()=>{window.clearTimeout(X)}},[U,Q,r,P,I,s,a]),e.jsxs(oe.Flex,{gap:"md",style:{flexDirection:G&&x==="left"?"row":G&&x==="right"?"row-reverse":"column"},align:"flex-end",children:[ee&&e.jsx(u.Box,{direction:"column",justify:"flex-end",children:e.jsx(j.Button,{onClick:()=>{const X=new URLSearchParams(S);X.delete(s),I(X),re(""),z(),y&&y()},variant:"outline",tone:"neutral",children:e.jsx(k.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),o==null?void 0:o.map(({minWidth:X,content:de,title:xe,onClickContainer:ke},ye)=>e.jsxs(u.Box,{direction:"column",gap:"sm",onClick:ke,style:{minWidth:X},children:[xe&&e.jsx(He.SubH3,{children:xe}),de]},`extended-filter-${ye}-${D}`)),!!(b!=null&&b.length)&&e.jsx(j.Button,{primary:ee,secondary:!ee,iconLeft:e.jsx(M.Icon,{size:"sm",name:(p==null?void 0:p.icon)||"FilterHorizontal",style:{color:fe?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!G,onClick:()=>B(!0),children:F?"Filter":void 0}),i&&e.jsxs(u.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[v&&e.jsx(He.SubH3,{children:"Status"}),e.jsx(nr.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Er({get:"value",name:t,searchParams:S,filterKey:s})?[{label:Er({get:"value",name:t,searchParams:S,filterKey:s})==="active"?"Active":"InActive",value:Er({get:"value",name:t,searchParams:S,filterKey:s})}]:[],onChange:X=>pr({value:X,name:t,type:"dropdown",searchQueries:P,setSearchParams:I,filterKey:s}),placeholder:v?"All":"All Status"},D)]}),c&&e.jsxs(u.Box,{direction:"column",gap:"sm",style:{width:d&&G?d:G?"310px":""},children:[v&&e.jsxs(He.SubH3,{children:["Search for ",L]}),e.jsx(Ke.Input,{placeholder:l,leftIcon:e.jsx(M.Icon,{name:"Search",width:20,height:20}),onChange:X=>re(X.target.value),value:U,fullWidth:!0},D+1+s)]}),e.jsx(Cl,{isOpen:O,onClose:()=>B(!1),filterKey:s,filters:b,pageKey:a})]})},No=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r;function nt({configs:r,filterKey:t="filter",activeFilterKey:l="filters",pageKey:n="page",searchKey:o="q"}){const{searchParams:c,setSearchParams:i,searchQueries:s}=Me(),a=h.useMemo(()=>Object.fromEntries(r.map(D=>[D.key,D])),[r]),d=h.useMemo(()=>{const D=(c.get(l)||"").split(",").map(z=>z.trim()).filter(Boolean);let H=[];try{const z=c.get(t);z&&(H=Object.keys(JSON.parse(z)).filter(S=>S!==o))}catch{}return r.map(z=>z.key).filter(z=>{const S=a[z];return(S==null?void 0:S.locked)||D.includes(z)||H.includes(z)})},[c,l,t,o,r,a]),y=h.useCallback(D=>{try{return D[t]?JSON.parse(D[t]):{}}catch{return{}}},[t]),b=h.useCallback(D=>{const H={...s};D.length?H[l]=D.join(","):delete H[l],i(H)},[s,l,i]),p=h.useCallback(D=>{d.includes(D)||b([...d,D])},[d,b]),x=h.useCallback(D=>{var I;if((I=a[D])!=null&&I.locked)return;const H={...s},z=d.filter(V=>V!==D);z.length?H[l]=z.join(","):delete H[l];const S=y(H);D in S&&(delete S[D],Object.keys(S).length?H[t]=JSON.stringify(S):delete H[t]),delete H[n],i(H)},[s,d,l,t,n,y,i,a]),L=h.useCallback(D=>d.includes(D)?x(D):p(D),[d,p,x]),v=h.useCallback(D=>{switch(D.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return pl({name:D.key,get:"array",searchParams:c,filterKey:t})||[];case"date":{const H=bl({name:D.key,searchParams:c,filterKey:t});return H?new Date(H):void 0}case"date-compact":{const z=y(Object.fromEntries(c.entries()))[D.key];return z&&typeof z=="object"?z:void 0}default:return}},[c,t,y]),T=h.useCallback((D,H)=>{if(D.type==="date-compact"){const z={...s},S=y(z);H==null?delete S[D.key]:S[D.key]=H,Object.keys(S).length?z[t]=JSON.stringify(S):delete z[t],delete z[n],i(z);return}pr({value:H,name:D.key,type:No(D.type),searchQueries:s,setSearchParams:i,filterKey:t,pageKey:n})},[s,i,t,n,y]),F=h.useCallback(D=>{const H={...s},z=y(H);D in z&&(delete z[D],Object.keys(z).length?H[t]=JSON.stringify(z):delete H[t]),delete H[n],i(H)},[s,t,n,y,i]),O=h.useCallback(()=>{const D={...s};delete D[t],delete D[l],delete D[n],i(D)},[s,t,l,n,i]),B=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:B,addFilter:p,removeFilter:x,toggleFilter:L,getValue:v,setValue:T,clearValue:F,clearAll:O}}const ct={get(r){return ur.storage.get(r)??null},set(r,t){ur.storage.save(r,t)},remove(r){ur.storage.delete(r)}},ar={columns:r=>`filterbar:colprefs:${r}`,savedViews:r=>`filterbar:views:${r}`,lastState:r=>`filterbar:last:${r}`,perPage:r=>`filterbar:perpage:${r}`,tableSort:r=>`tablelayout:sort:${r}`},Lr=(r,t)=>{const l=new Set(t.map(c=>c.key)),n=r.order.filter(c=>l.has(c));for(const c of t)n.includes(c.key)||n.push(c.key);const o=r.hidden.filter(c=>l.has(c));return{order:n,hidden:o}};function _o({columns:r,scopeId:t,storage:l,onColumnsChange:n,value:o}){const c=h.useMemo(()=>({order:r.map(S=>S.key),hidden:[]}),[r]),i=t?ar.columns(t):void 0,s=(S,I)=>Lr({order:S.order??I,hidden:S.hidden??[]},r),[a,d]=h.useState(()=>{if(o&&(o.order||o.hidden))return s(o,r.map(S=>S.key));if(i){const S=l.get(i);if(S&&Array.isArray(S.order))return Lr(S,r)}return c}),y=r.map(S=>S.key).join("|");h.useEffect(()=>d(S=>Lr(S,r)),[y]);const b=h.useRef(a);b.current=a;const p=o?`${(o.order??[]).join("|")}~${(o.hidden??[]).join("|")}`:null,x=h.useRef(p);h.useEffect(()=>{if(p==null||x.current===p)return;x.current=p;const S=b.current,I=s(o,S.order);I.order.join("|")===S.order.join("|")&&I.hidden.join("|")===S.hidden.join("|")||(d(I),i&&l.set(i,I))},[p,y]);const L=h.useRef(!1);h.useEffect(()=>{L.current||(L.current=!0,n==null||n(a))},[]);const v=h.useCallback(S=>{d(S),i&&l.set(i,S),n==null||n(S)},[i,l,n]),T=h.useMemo(()=>{const S=new Map(r.map(I=>[I.key,I]));return a.order.filter(I=>S.has(I)).map(I=>({...S.get(I),visible:!a.hidden.includes(I)}))},[a,r]),F=h.useCallback(S=>{const I=a.hidden.includes(S)?a.hidden.filter(V=>V!==S):[...a.hidden,S];v({...a,hidden:I})},[a,v]),O=h.useCallback((S,I)=>{if(S===I)return;const V=[...a.order],[P]=V.splice(S,1);V.splice(I,0,P),v({...a,order:V})},[a,v]),B=h.useCallback(S=>{v({...a,hidden:S?r.filter(I=>!I.locked).map(I=>I.key):[]})},[a,r,v]),D=h.useCallback(()=>v(c),[v,c]),H=h.useCallback(S=>v(Lr(S,r)),[v,r]),z=a.hidden.length===0;return{state:a,orderedColumns:T,allVisible:z,toggleVisibility:F,reorder:O,setAllHidden:B,reset:D,applyState:H}}function qo({scopeId:r,storage:t,snapshotKeys:l,pageKey:n="page",getColumns:o,applyColumns:c}){const{searchParams:i,setSearchParams:s}=Me(),a=r?ar.savedViews(r):void 0,[d,y]=h.useState(()=>a?t.get(a)||[]:[]),b=h.useCallback(v=>{y(v),a&&t.set(a,v)},[a]),p=h.useCallback(v=>{const T=v.trim();if(!T)return;const F={};l.forEach(B=>{const D=i.get(B);D!=null&&(F[B]=D)});const O={id:`${Date.now()}`,name:T,query:F,columns:o==null?void 0:o(),createdAt:Date.now()};b([...d,O])},[l,i,o,b,d]),x=h.useCallback(v=>b(d.filter(T=>T.id!==v)),[b,d]),L=h.useCallback(v=>{const T=Object.fromEntries(i.entries());l.forEach(F=>delete T[F]),Object.assign(T,v.query),delete T[n],s(T),v.columns&&(c==null||c(v.columns))},[i,l,n,s,c]);return{enabled:!!a,views:d,saveView:p,deleteView:x,applyView:L}}function Zo(r,t){let l;try{l=JSON.parse(r)}catch{return r}return!l||typeof l!="object"?r:(delete l[t],Object.keys(l).length>0?JSON.stringify(l):void 0)}function xl(r,t,l){const n=r[t];if(n==null)return;const o=Zo(n,l);o===void 0?delete r[t]:r[t]=o}function Go({scopeId:r,storage:t,snapshotKeys:l,enabled:n=!0,filterKey:o="filter",searchKey:c="q",persistSearch:i=!0}){const{searchParams:s}=Me(),a=r&&n?ar.lastState(r):void 0,d=h.useRef(a),y=h.useRef(!1);h.useEffect(()=>{if(!a){d.current=a;return}if(d.current!==a){d.current=a,y.current=!1;return}const x={};if(l.forEach(L=>{const v=s.get(L);v!=null&&(x[L]=v)}),i||xl(x,o,c),Object.keys(x).length===0){y.current&&t.remove(a);return}y.current=!0,t.set(a,x)},[s,a,l,t,i,o,c]);const b=h.useCallback(()=>{if(!a)return null;const x=t.get(a);return!x||Object.keys(x).length===0||!i&&(xl(x,o,c),Object.keys(x).length===0)?null:x},[a,t,i,o,c]),p=h.useCallback(()=>{a&&t.remove(a)},[a,t]);return{enabled:!!a,read:b,clear:p}}function Qo({scopeId:r,storage:t,perPageKey:l,pageSizeOptions:n,enabled:o=!0}){const{searchParams:c}=Me(),i=r&&o?ar.perPage(r):void 0,s=c.toString(),a=h.useRef(i);h.useEffect(()=>{if(!i){a.current=i;return}if(a.current!==i){a.current=i;return}const b=c.get(l);if(!b)return;const p=Number(b);!Number.isFinite(p)||p<=0||t.set(i,p)},[s,i,l,t]);const d=h.useCallback(()=>{if(!i)return null;const b=t.get(i);if(b==null)return null;const p=Number(b);return!Number.isFinite(p)||p<=0||n&&!n.includes(p)?null:String(p)},[i,t,n]),y=h.useCallback(()=>{i&&t.remove(i)},[i,t]);return{enabled:!!i,read:d,clear:y}}let st={},it=!1,at=null;const Uo=(r,t)=>{Object.assign(st,r),at=t,!it&&(it=!0,queueMicrotask(()=>{const l=st,n=at;st={},it=!1,at=null,!(!n||Object.keys(l).length===0)&&n(o=>{const c=new URLSearchParams(o);return Object.entries(l).forEach(([i,s])=>c.set(i,s)),c})}))};function Jo({enabled:r,snapshotKeys:t,perPageKey:l,readSnapshot:n,readPerPage:o}){const{searchParams:c,setSearchParams:i,location:s}=Me(),a=h.useRef(null);h.useEffect(()=>{if(!r||a.current===s.pathname)return;a.current=s.pathname;const d={};if(!c.has(l)){const y=o();y&&(d[l]=y)}if(!t.some(y=>c.has(y))){const y=n();y&&Object.assign(d,y)}Object.keys(d).length!==0&&Uo(d,i)},[s.pathname,r])}const Yo=({configs:r,activeKeys:t,onToggle:l,hasActiveFilter:n,onReset:o})=>r.length?e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:n?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{minWidth:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),n&&o&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"xs",onClick:o,children:"Reset"})]}),children:r.map(c=>e.jsx(A.MenuItem,{selected:c.locked||t.includes(c.key),disabled:c.locked,closeOnSelect:!1,startIcon:c.icon??void 0,onClick:()=>{c.locked||l(c.key)},children:c.label},c.key))})})]}):null,Tr=({onClear:r,onRemove:t})=>e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(M.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(A.MenuLists,{children:e.jsxs(A.MenuBody,{style:{width:180},children:[e.jsx(A.MenuItem,{startIcon:e.jsx(M.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(A.MenuItem,{intent:"danger",startIcon:e.jsx(M.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),Xo=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},wl=(r,t,l)=>{const n=new Date(r);return l==="day"?n.setDate(n.getDate()+t):l==="week"?n.setDate(n.getDate()+t*7):l==="month"?n.setMonth(n.getMonth()+t):n.setFullYear(n.getFullYear()+t),n},Dl=r=>{const t=Xo(new Date);if(r.direction==="this"){const n=new Date(t),o=new Date(t);return r.period==="week"?(n.setDate(t.getDate()-t.getDay()),o.setDate(n.getDate()+6)):r.period==="month"?(n.setDate(1),o.setMonth(o.getMonth()+1,0)):r.period==="year"&&(n.setMonth(0,1),o.setMonth(11,31)),{from:n,to:o}}const l=r.count??1;return r.direction==="past"?{from:wl(t,-l,r.period),to:t}:{from:t,to:wl(t,l,r.period)}},Sl=24,kl=r=>r.length>Sl?`${r.slice(0,Sl)}...`:r,Ir=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),Or={is:"Is","is-before":"Is before","is-after":"Is after","is-on-or-before":"Is on or before","is-on-or-after":"Is on or after","is-between":"Is between","is-relative-to-today":"Is relative to today","is-empty":"Is empty","is-not-empty":"Is not empty"},$o=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],dt={past:"Past",next:"Next",this:"This"},Ko=["day","week","month","year"],Ro=["past","next","this"],en=r=>r.field.type==="date-compact"?e.jsx(ln,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(rn,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),rn=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=t?Ir(new Date(t)):null,i=!!c,s=i?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:kl(c)})]}):r.label;return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i?e.jsx(M.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:s})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:o})]}),children:e.jsx(rr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:a=>a==null?n():l(a),withPadding:!1})})})]})},tn=r=>{switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date?`${Or[r.op]} ${Ir(new Date(r.date))}`:null;case"is-between":return r.from&&r.to?`${Ir(new Date(r.from))} - ${Ir(new Date(r.to))}`:null;case"is-relative-to-today":{const t=r.relative;if(!t)return null;if(t.direction==="this")return`This ${t.period}`;const l=t.count??1,n=l===1?t.period:`${t.period}s`;return`${dt[t.direction]} ${l} ${n}`}case"is-empty":case"is-not-empty":return Or[r.op];default:return null}},ln=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=r.ops&&r.ops.length>0?r.ops:$o,i=r.defaultOp&&c.includes(r.defaultOp)?r.defaultOp:c[0],s=(t==null?void 0:t.op)??i,a=t?tn(t):null,d=!!a,y=d?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:kl(a)})]}):r.label,b=p=>{if(p!==s){if(p==="is-empty"||p==="is-not-empty"){l({op:p});return}if(p==="is-relative-to-today"){l({op:p,relative:(t==null?void 0:t.relative)??{direction:"past",count:1,period:"week"}});return}if(p==="is-between"){l({op:p,from:t==null?void 0:t.from,to:t==null?void 0:t.to});return}l({op:p,date:t==null?void 0:t.date})}};return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:d?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:d?e.jsx(M.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:y})}),e.jsxs(A.MenuLists,{children:[e.jsx(A.MenuBody,{style:{width:320},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(on,{op:s,ops:c,onChange:b})]}),e.jsx(Tr,{onClear:n,onRemove:o})]}),children:e.jsx(nn,{value:t,op:s,onChange:l})}),s==="is-relative-to-today"&&e.jsx(A.MenuFooter,{children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},on=({op:r,ops:t,onChange:l})=>e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:Or[r]})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:200},children:t.map(n=>e.jsx(A.MenuItem,{selected:r===n,onClick:()=>l(n),endIcon:r===n?e.jsx(M.Icon,{name:"Check"}):void 0,children:Or[n]},n))})})]}),nn=({value:r,op:t,onChange:l})=>{if(t==="is-empty"||t==="is-not-empty")return e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(t==="is-between"){const n=r!=null&&r.from||r!=null&&r.to?{from:r!=null&&r.from?new Date(r.from):null,to:r!=null&&r.to?new Date(r.to):null}:void 0;return e.jsx(rr.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,value:n,onChange:o=>{if(o==null){l({op:t});return}if(typeof o=="object"&&o!==null&&"from"in o&&"to"in o){let{from:c,to:i}=o;if(!c&&i&&(c=i,i=null),!c&&!i){l({op:t});return}l({op:t,from:c?c.toISOString():void 0,to:i?i.toISOString():void 0})}},withPadding:!1},"range")}return t==="is-relative-to-today"?e.jsx(cn,{value:r==null?void 0:r.relative,onChange:n=>l({op:t,relative:n})}):e.jsx(rr.StarasiaDate,{size:"sm",input:!1,clearable:!0,value:r!=null&&r.date?new Date(r.date):void 0,onChange:n=>{if(n==null){l({op:t});return}n instanceof Date&&l({op:t,date:n.toISOString()})},withPadding:!1},"single")},cn=({value:r,onChange:t})=>{const l=(r==null?void 0:r.direction)??"past",n=(r==null?void 0:r.count)??1,o=(r==null?void 0:r.period)??"week",c=l!=="this",i=Dl({direction:l,count:n,period:o});return e.jsxs(u.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:dt[l]})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:140},children:Ro.map(s=>e.jsx(A.MenuItem,{selected:l===s,endIcon:l===s?e.jsx(M.Icon,{name:"Check"}):void 0,onClick:()=>t(s==="this"?{direction:s,period:o}:{direction:s,count:n,period:o}),children:dt[s]},s))})})]}),c&&e.jsx(Ke.Input,{type:"number",size:"sm",min:1,clearable:!1,value:n,onChange:s=>{const a=Number(s.target.value);t({direction:l,count:Number.isFinite(a)&&a>0?a:1,period:o})},style:{width:72}}),e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:o})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:140},children:Ko.map(s=>e.jsx(A.MenuItem,{selected:o===s,endIcon:o===s?e.jsx(M.Icon,{name:"Check"}):void 0,onClick:()=>t(l==="this"?{direction:l,period:s}:{direction:l,count:n,period:s}),children:s},s))})})]})]}),e.jsx(rr.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:i,onChange:()=>{},withPadding:!1},"relative-preview")]})},Bl=18,sn=r=>r.length>Bl?`${r.slice(0,Bl)}...`:r,an=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=r.type==="dropdown-multiple",i=t.length,s=r.searchable!==!1,[a,d]=h.useState(""),y=r.options,b=typeof r.onSearch=="function",p=(()=>{if(b)return y;const F=a.trim().toLowerCase();return F?y.filter(O=>O.label.toLowerCase().includes(F)):y})(),x=F=>t.some(O=>O.value===F.value),L=F=>{if(!c){l([{label:F.label,value:F.value}]),d("");return}l(x(F)?t.filter(O=>O.value!==F.value):[...t,{label:F.label,value:F.value}])},v=F=>{var O;d(F),(O=r.onSearch)==null||O.call(r,F)},T=i===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:i===1?sn(t[0].label):`${i} Selected`})]});return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:i>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i>0?e.jsx(M.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:T})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:o})]}),children:e.jsxs(u.Box,{direction:"column",gap:"sm",children:[s&&e.jsx(nr.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:c,searchAble:!0,searchValue:a,onSearch:v,value:t,onChange:l,placeholder:`Search ${r.label.toLowerCase()}…`}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:r.isLoading?e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):p.length===0?e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):p.map(F=>e.jsx(A.MenuItem,{closeOnSelect:!c,selected:x(F),startIcon:F.avatar,endIcon:x(F)?e.jsx(M.Icon,{name:"Check"}):void 0,description:F.description,onClick:()=>L(F),children:F.label},F.value))})]})})})]})},ml=18,dn=r=>r.length>ml?`${r.slice(0,ml)}...`:r,Fl=({checked:r,indeterminate:t})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(Ze.Checkbox,{size:"sm",checked:r,readOnly:!0,onChange:()=>{},variant:t?"indeterminate":"select"})}),hn=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=new Set(t.map(p=>p.value)),i=t.length,s=r.options.length>0&&r.options.every(p=>c.has(p.value)),a=i>0&&!s,d=p=>{l(c.has(p.value)?t.filter(x=>x.value!==p.value):[...t,{label:p.label,value:p.value}])},y=()=>{l(s?[]:r.options.map(p=>({label:p.label,value:p.value})))},b=i===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs(k.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(k.Text,{as:"span",children:i===1?dn(t[0].label):`${i} Selected`})]});return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:i>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i>0?e.jsx(M.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsx(A.MenuLists,{children:e.jsxs(A.MenuBody,{style:{width:240},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:o})]}),children:[e.jsx(A.MenuItem,{closeOnSelect:!1,selected:s,onClick:y,startIcon:e.jsx(Fl,{checked:s||a,indeterminate:a}),children:"Select All"}),r.options.map(p=>e.jsx(A.MenuItem,{closeOnSelect:!1,selected:c.has(p.value),onClick:()=>d(p),startIcon:e.jsx(Fl,{checked:c.has(p.value)}),children:p.label},p.value))]})})]})},El=({activeKeys:r,configByKey:t,getValue:l,setValue:n,clearValue:o,removeFilter:c})=>e.jsx(e.Fragment,{children:r.map(i=>{const s=t[i];if(!s)return null;const a=l(s),d=s.locked?void 0:()=>c(i);return s.type==="date"||s.type==="date-compact"?e.jsx(en,{field:s,value:a,onChange:y=>n(s,y),onClear:()=>o(i),onRemove:d},i):s.type==="checkbox-multiple"?e.jsx(hn,{field:s,value:a||[],onChange:y=>n(s,y),onClear:()=>o(i),onRemove:d},i):e.jsx(an,{field:s,value:a||[],onChange:y=>n(s,y),onClear:()=>o(i),onRemove:d},i)})}),Ml=r=>`${r} Rows`,fn=({pagination:r,pageKey:t="page",perPageKey:l="perPage",pageSizeOptions:n=[10,25,50,100],defaultPerPage:o=10,showResultCount:c=!0,showPageSize:i=!0,showPagination:s=!0})=>{var F;const{searchQueries:a,setSearchParams:d,searchParams:y}=Me(),b=y.get(l),p=b?Number(b):o,x=O=>{d({...a,[t]:String(O)})},L=O=>{d({...a,[l]:O,[t]:"1"})},v=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:0),T=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[c&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${v}-${T} of ${((F=r==null?void 0:r.totalData)==null?void 0:F.toLocaleString())||0}`}),i&&e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:Ml(p)})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{children:n.map(O=>e.jsx(A.MenuItem,{selected:O===p,onClick:()=>L(String(O)),children:Ml(O)},O))})})]}),s&&((r==null?void 0:r.totalPage)??0)>1&&e.jsx(u.Box,{direction:"column",display:"flex",align:"center",gap:"sm",paddingRight:"sm",style:{borderRight:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:e.jsx(gr.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:r!=null&&r.currentPage?Number(r.currentPage):1,totalPages:Number(r==null?void 0:r.totalPage),onPageChange:x})})]})};function gn(r,t,l=!0){h.useEffect(()=>{if(!l)return;const n=o=>{var s;if(o.metaKey||o.ctrlKey||o.altKey||o.key!==r)return;const c=o.target,i=(s=c==null?void 0:c.tagName)==null?void 0:s.toLowerCase();i==="input"||i==="textarea"||c!=null&&c.isContentEditable||(o.preventDefault(),t())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[r,t,l])}const un=240,Ll=({searchKey:r="q",filterKey:t="filter",pageKey:l="page",placeholder:n="Search",shortcut:o="/",collapsible:c=!0})=>{const{searchParams:i,setSearchParams:s,searchQueries:a}=Me(),d=Mr(r,i,t)||"",[y,b]=h.useState(!c||!!d),[p,x]=h.useState(c&&!d),[L,v]=h.useState(d),T=pe.useDebounce(L,350),F=h.useRef(null);h.useEffect(()=>{v(d),d&&b(!0)},[d]),h.useEffect(()=>{y&&x(!1)},[y]),h.useEffect(()=>{T!==d&&pr({value:T,name:r,type:"search",searchQueries:a,setSearchParams:s,filterKey:t,pageKey:l})},[T]);const O=h.useCallback(()=>{b(!0),requestAnimationFrame(()=>{var z;return(z=F.current)==null?void 0:z.focus()})},[]);gn(o,O);const B=()=>{c&&!L&&b(!1)},D=z=>{var S;c&&z.key==="Escape"&&!L&&(b(!1),(S=F.current)==null||S.blur())},H=()=>{y||x(!0)};return e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[p&&e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:O}),e.jsxs(u.Box,{onTransitionEnd:H,style:{position:"relative",width:y?un:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(Ke.Input,{ref:F,size:"sm",fullWidth:!0,value:L,placeholder:n,leftIcon:e.jsx(M.Icon,{name:"Search",width:16,height:16}),onChange:z=>v(z.target.value),onKeyDown:D,onBlur:B,tabIndex:y?0:-1}),y&&!L&&e.jsx(u.Box,{align:"center",justify:"center",borderColor:"border-subtle",borderWidth:"border",borderStyle:"border-solid",borderRadius:"rounded-xs",paddingInline:"spacing-1",customBackgroundColor:"var(--sa-background-surface-hover, #f1f2f4)",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",minWidth:18,height:18,display:"inline-flex"},children:e.jsx(k.Text,{fontSize:"xs",color:"subtle",children:o})})]})]})},Tl=({columns:r,allVisible:t,onToggle:l,onReorder:n,onSetAllHidden:o})=>{const[c,i]=h.useState(null),[s,a]=h.useState(null),d=()=>{c!==null&&s!==null&&c!==s&&n(c,s),i(null),a(null)},y=(b,p)=>{const x=b+p;x<0||x>=r.length||n(b,x)};return e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{children:e.jsxs(u.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(j.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>o(t),children:t?"Hide All":"Show All"})]}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",children:r.map((b,p)=>{const x=!b.locked,L=s===p&&c!==null&&c!==p;return e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:x,onDragStart:()=>x&&i(p),onDragOver:v=>{v.preventDefault(),a(p)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:L?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(u.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:x?0:-1,"aria-label":`Reorder ${b.title}`,"aria-disabled":!x||void 0,color:"icon-subtlest",onKeyDown:v=>{x&&(v.key==="ArrowUp"?(v.preventDefault(),y(p,-1)):v.key==="ArrowDown"&&(v.preventDefault(),y(p,1)))},style:{display:"inline-flex",cursor:x?"grab":"default",opacity:x?1:.4},children:e.jsx(M.Icon,{name:"DragVertical",width:16,height:16})}),b.icon&&e.jsx(u.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:b.icon}),e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:b.title}),e.jsx(u.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(ir.Toggle,{size:"sm",checked:b.visible,disabled:b.locked,onChange:()=>l(b.key),"aria-label":`Toggle ${b.title} column`})})]},b.key)})})]})})})]})},Il=({views:r,onApply:t,onDelete:l,onSave:n})=>{const[o,c]=h.useState(""),i=()=>{const s=o.trim();s&&(n(s),c(""))};return e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:r.length>0?"secondary":"outline",tone:(r.length>0,"neutral"),size:"sm",iconLeft:e.jsx(M.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(A.MenuLists,{style:{width:"260px"},children:[e.jsx(A.MenuBody,{children:e.jsxs(u.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",children:r.length===0?e.jsx(u.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(k.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(s=>e.jsx(A.MenuItem,{startIcon:e.jsx(M.Icon,{name:"Bookmark"}),onClick:()=>t(s),endIcon:e.jsx(j.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(M.Icon,{name:"Trash2"}),"aria-label":`Delete ${s.name}`,onClick:a=>{a.stopPropagation(),l(s.id)}}),children:s.name},s.id))})]})}),e.jsx(A.MenuFooter,{children:e.jsxs(u.Box,{direction:"row",gap:"xs",children:[e.jsx(u.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(Ke.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:o,onChange:s=>c(s.target.value),onKeyDown:s=>{s.key==="Enter"&&i()}})}),e.jsx(j.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!o.trim(),onClick:i,children:"Save"})]})})]})]})},yn=({isOpen:r,onClose:t,configs:l,activeKeys:n,configByKey:o,hasActiveFilter:c,onToggle:i,onReset:s,getValue:a,setValue:d,clearValue:y,removeFilter:b})=>{const p=n.length;return e.jsx(kr.Drawer,{position:"bottom",isShow:r,onHide:t,children:e.jsxs(u.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingInline:"md",paddingBlock:"sm",style:{borderBottom:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),p>0&&e.jsxs(k.Text,{fontSize:"sm",color:"subtle",children:["(",p,")"]})]}),e.jsx(j.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:t})]}),e.jsxs(u.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[p>0&&e.jsxs(u.Box,{direction:"column",gap:"sm",children:[e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(u.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(El,{activeKeys:n,configByKey:o,getValue:a,setValue:d,clearValue:y,removeFilter:b})})]}),l.length>0&&e.jsxs(u.Box,{direction:"column",gap:"sm",children:[e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(u.Box,{direction:"column",children:l.map(x=>{const L=n.includes(x.key),v=!!x.locked;return e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:v?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[x.icon&&e.jsx(u.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:x.icon}),e.jsx(k.Text,{fontSize:"sm",color:"primary",truncate:!0,children:x.label})]}),e.jsx(ir.Toggle,{size:"sm",checked:L||v,disabled:v,onChange:()=>i(x.key),"aria-label":`Toggle ${x.label}`})]},x.key)})})]})]}),e.jsxs(u.Box,{direction:"row",display:"flex",gap:"sm",paddingInline:"md",paddingBlock:"sm",style:{borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsx(u.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!c,onClick:s,children:"Reset"})}),e.jsx(u.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(j.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:t,children:"Selesai"})})]})]})})},pn=r=>`${r} Rows`,bn=({perPageKey:r,pageKey:t,pageSizeOptions:l,defaultPerPage:n=10,showPageSize:o})=>{const{searchQueries:c,setSearchParams:i,searchParams:s}=Me(),a=s.get(r),d=a?Number(a):n,y=b=>{i({...c,[r]:b,[t]:"1"})};return o?e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(A.MenuLists,{children:e.jsxs(A.MenuBody,{style:{minWidth:200},children:[e.jsx(u.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),l.map(b=>e.jsx(A.MenuItem,{selected:b===d,endIcon:b===d?e.jsx(M.Icon,{name:"Check"}):void 0,onClick:()=>y(String(b)),children:pn(b)},b))]})})]}):null},Cn=r=>{var Pe;const{withPadding:t,configs:l,activeKeys:n,configByKey:o,hasActiveFilter:c,toggleFilter:i,removeFilter:s,getValue:a,setValue:d,clearValue:y,onReset:b,searchable:p,searchKey:x,filterKey:L,pageKey:v,searchPlaceholder:T,searchShortcut:F,searchCollapsible:O,pagination:B,perPageKey:D,pageSizeOptions:H,defaultPerPage:z,showPagination:S,showResultCount:I,showPageSize:V,hasColumns:P,orderedColumns:Q,allVisible:U,onToggleVisibility:re,onReorder:fe,onSetAllHidden:se,showSavedViews:ee,savedViews:G,onApplyView:X,onDeleteView:de,onSaveView:xe,leadingActions:ke}=r,[ye,Ce]=h.useState(!1),{searchQueries:we,setSearchParams:Ne}=Me(),Oe=(B==null?void 0:B.rangeStart)??(((B==null?void 0:B.currentPage)||0)>1?(((B==null?void 0:B.currentPage)||0)-1)*((B==null?void 0:B.perPage)||0)+1:1),ve=(B==null?void 0:B.rangeEnd)??((B==null?void 0:B.totalCurrentPage)!==(B==null?void 0:B.perPage)?B==null?void 0:B.totalData:((B==null?void 0:B.currentPage)||1)*((B==null?void 0:B.totalCurrentPage)||0)),Ve=Ue=>{Ne({...we,[v]:String(Ue)})},Be=I||S&&!!(B!=null&&B.totalPage),Ie=()=>{b(),Ce(!1)};return e.jsxs(u.Box,{direction:"column",gap:"sm",fullWidth:!0,paddingTop:t?"sm":void 0,paddingBottom:t?"sm":void 0,paddingLeft:t?"md":void 0,paddingRight:t?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[p&&e.jsx(Ll,{searchKey:x,filterKey:L,pageKey:v,placeholder:T,shortcut:F,collapsible:O}),e.jsx(j.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"FilterHorizontal"}),onClick:()=>Ce(!0),"aria-label":"Open filters",children:c?`Filter: ${n.length}`:null}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[ke,ee&&e.jsx(Il,{views:G,onApply:X,onDelete:de,onSave:xe}),P&&e.jsx(Tl,{columns:Q,allVisible:U,onToggle:re,onReorder:fe,onSetAllHidden:se}),e.jsx(bn,{perPageKey:D,pageKey:v,pageSizeOptions:H,defaultPerPage:z,showPageSize:V})]})]}),Be&&e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[I?e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Oe}-${ve} of ${((Pe=B==null?void 0:B.totalData)==null?void 0:Pe.toLocaleString())||0}`}):e.jsx(u.Box,{direction:"column"}),S&&!!(B!=null&&B.totalPage)&&e.jsx(gr.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:B!=null&&B.currentPage?Number(B.currentPage):1,totalPages:Number(B.totalPage),onPageChange:Ve})]}),e.jsx(yn,{isOpen:ye,onClose:()=>Ce(!1),configs:l,activeKeys:n,configByKey:o,hasActiveFilter:c,onToggle:i,onReset:Ie,getValue:a,setValue:d,clearValue:y,removeFilter:s})]})},vn=({withPadding:r=!1,filterConfigs:t=[],filterKey:l="filter",activeFilterKey:n="filters",pageKey:o="page",perPageKey:c="perPage",pageSizeOptions:i=[25,50,100],defaultPerPage:s,showPagination:a=!0,showResultCount:d=!0,showPageSize:y=!0,searchable:b=!1,searchKey:p="q",searchPlaceholder:x="Search",searchShortcut:L="/",searchPosition:v="right",searchCollapsible:T=!0,pagination:F,columns:O=[],onColumnsChange:B,columnsState:D,scopeId:H,savedViews:z,persistLastState:S=!0,persistSearch:I=!0,storage:V=ct,onReset:P,leadingActions:Q})=>{const U=H??(z==null?void 0:z.scopeId),{activeKeys:re,configByKey:fe,hasActiveFilter:se,toggleFilter:ee,removeFilter:G,getValue:X,setValue:de,clearValue:xe,clearAll:ke}=nt({configs:t,filterKey:l,activeFilterKey:n,pageKey:o,searchKey:p}),ye=_o({columns:O,scopeId:U,storage:V,onColumnsChange:B,value:D}),Ce=qo({scopeId:U,storage:V,snapshotKeys:[n,l,c],pageKey:o,getColumns:()=>ye.state,applyColumns:ye.applyState}),we=Go({scopeId:U,storage:V,snapshotKeys:[n,l,o],enabled:S,filterKey:l,searchKey:p,persistSearch:I}),Ne=Qo({scopeId:U,storage:V,perPageKey:c,pageSizeOptions:i,enabled:S});Jo({enabled:S&&!!U,snapshotKeys:[n,l,o],perPageKey:c,readSnapshot:we.read,readPerPage:Ne.read});const Oe=s??i[0]??25,ve=!!(z!=null&&z.enabled)&&Ce.enabled,Ve=()=>{ke(),we.clear(),P==null||P()},Be=pe.useMediaQuery("md"),Ie=b?e.jsx(Ll,{searchKey:p,filterKey:l,pageKey:o,placeholder:x,shortcut:L,collapsible:T}):null;return Be?e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",fullWidth:!0,paddingTop:r?"sm":void 0,paddingBottom:r?"sm":void 0,paddingLeft:r?"md":void 0,paddingRight:r?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Yo,{configs:t,activeKeys:re,onToggle:ee,hasActiveFilter:se,onReset:Ve}),v==="left"&&Ie,e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(El,{activeKeys:re,configByKey:fe,getValue:X,setValue:de,clearValue:xe,removeFilter:G}),se&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"sm",onClick:Ve,children:"Reset"})]})]}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[Q,e.jsx(fn,{pagination:F,pageKey:o,perPageKey:c,pageSizeOptions:i,defaultPerPage:Oe,showPagination:a,showResultCount:d,showPageSize:y}),v==="right"&&Ie,ve&&e.jsx(Il,{views:Ce.views,onApply:Ce.applyView,onDelete:Ce.deleteView,onSave:Ce.saveView}),O.length>0&&e.jsx(Tl,{columns:ye.orderedColumns,allVisible:ye.allVisible,onToggle:ye.toggleVisibility,onReorder:ye.reorder,onSetAllHidden:ye.setAllHidden})]})]}):e.jsx(Cn,{withPadding:r,configs:t,activeKeys:re,configByKey:fe,hasActiveFilter:se,toggleFilter:ee,removeFilter:G,getValue:X,setValue:de,clearValue:xe,onReset:Ve,searchable:b,searchKey:p,filterKey:l,pageKey:o,searchPlaceholder:x,searchShortcut:L,searchCollapsible:T,pagination:F,perPageKey:c,pageSizeOptions:i,defaultPerPage:Oe,showPagination:a,showResultCount:d,showPageSize:y,hasColumns:O.length>0,orderedColumns:ye.orderedColumns,allVisible:ye.allVisible,onToggleVisibility:ye.toggleVisibility,onReorder:ye.reorder,onSetAllHidden:ye.setAllHidden,showSavedViews:ve,savedViews:Ce.views,onApplyView:Ce.applyView,onDeleteView:Ce.deleteView,onSaveView:Ce.saveView,leadingActions:Q})},xn=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r[0];return(t==null?void 0:t.value)!=null?String(t.value):void 0},wn=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r.map(l=>(l==null?void 0:l.value)!=null?String(l.value):null).filter(l=>l!=null);return t.length?t:void 0},Dn=(r,t)=>{switch(r.type){case"dropdown":case"radio":return xn(t);case"dropdown-multiple":case"checkbox-multiple":return wn(t);case"date":return t instanceof Date?t.toISOString():void 0;case"date-compact":return t;default:return}},Ol=(r,t)=>{if(r==null||r==="")return t;const l=Number(r);return Number.isFinite(l)&&l>0?l:t},Sn=r=>{const{filterConfigs:t,filterKey:l="filter",activeFilterKey:n="filters",pageKey:o="page",perPageKey:c="perPage",searchKey:i="q",defaultPage:s=1,defaultPerPage:a=10,paramKeys:d,serialize:y}=r,{activeKeys:b,configByKey:p,hasActiveFilter:x,getValue:L}=nt({configs:t,filterKey:l,activeFilterKey:n,pageKey:o,searchKey:i}),{searchParams:v}=Me(),T=v.toString();return h.useMemo(()=>{const O={},B={},D=Ol(v.get(o),s),H=Ol(v.get(c),a);O[(d==null?void 0:d.page)??"page"]=D,O[(d==null?void 0:d.perPage)??"perPage"]=H;const z=Mr(i,v,l)||"";z&&(O[(d==null?void 0:d.search)??"search"]=z);let S=!1;for(const I of b){const V=p[I];if(!V)continue;const P=L(V);B[I]=P;const Q=y==null?void 0:y[I],U=Q?Q(P):Dn(V,P);if(U==null||Array.isArray(U)&&U.length===0)continue;const re=(d==null?void 0:d[I])??I;O[re]=U,S=!0}return{params:O,raw:B,hasActiveFilter:x||!!z||S}},[T,b.join("|"),l,n,o,c,i,s,a,d,y,p])},kn=["dropdown","dropdown-multiple","checkbox-multiple","radio"],Bn=({filterConfigs:r,filterKey:t,activeFilterKey:l,pageKey:n,searchKey:o})=>{const{configByKey:c,getValue:i,setValue:s,removeFilter:a,clearAll:d,hasActiveFilter:y}=nt({configs:r,filterKey:t,activeFilterKey:l,pageKey:n,searchKey:o}),b=(F,O)=>{var D;const B=F.options;return((D=B==null?void 0:B.find(H=>H.value===O))==null?void 0:D.label)??O},p=h.useCallback(F=>{const O=c[F];if(!O)return[];const B=i(O);return Array.isArray(B)?B.map(D=>String(D.value)):[]},[c,i]),x=h.useCallback((F,O)=>{const B=c[F];if(!B||!kn.includes(B.type))return;const D=Array.isArray(O)?O:[O];if(D.length===0){a(F);return}s(B,D.map(H=>({label:b(B,H),value:H})))},[c,s,a]),L=h.useCallback((F,O)=>{const B=p(F);x(F,B.includes(O)?B.filter(D=>D!==O):[...B,O])},[p,x]),v=h.useCallback((F,O)=>p(F).includes(O),[p]),T=h.useCallback(F=>a(F),[a]);return{set:x,toggle:L,clear:T,clearAll:d,isActive:v,values:p,hasActiveFilter:y}},mn=(r,t)=>{if(!r)return{};const{fromKey:l,toKey:n,opKey:o}=t,c={};switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date&&(c[l]=new Date(r.date).toISOString()),o&&(c[o]=r.op),c;case"is-between":return r.from&&(c[l]=new Date(r.from).toISOString()),r.to&&(c[n]=new Date(r.to).toISOString()),c;case"is-relative-to-today":{if(!r.relative)return c;const{from:i,to:s}=Dl(r.relative);return c[l]=i.toISOString(),c[n]=s.toISOString(),c}case"is-empty":case"is-not-empty":return o&&(c[o]=r.op==="is-empty"?"empty":"not-empty"),c;default:return c}},Wl=({children:r,borderRadius:t,height:l})=>{const n=h.useRef(null),[o,c]=h.useState("100vh");return h.useEffect(()=>{if(l)return;const i=()=>{if(n.current){const s=n.current.getBoundingClientRect().top;c(`calc(100vh - ${s}px)`)}};return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[l]),e.jsx(u.Box,{ref:n,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:t||"rounded-xs",style:{height:l??o,display:"flex",flexDirection:"column"},children:r})},Al=({action:r,rightContent:t,leftContent:l,headerSlot:n,advanceFilter:o,showFilter:c=!0})=>{const i=pe.useMediaQuery("md"),s=c?e.jsx(vl,{...o}):null,a=()=>r?h.isValidElement(r)?r:e.jsx(u.Box,{style:{display:"flex",flexDirection:i?"row":"column",gap:"8px",width:i?"auto":"100%",textWrap:"nowrap"},children:r.map(({title:d,icon:y,buttonProps:b,onClick:p},x)=>!d&&!y?null:e.jsx(j.Button,{fullWidth:!i,iconLeft:y?e.jsx(M.Icon,{name:y}):void 0,onClick:p,...b,children:d},`action-${x}`))}):null;return e.jsx(u.Box,{style:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center",paddingLeft:"8px",paddingRight:"8px",paddingTop:"8px",paddingBottom:"8px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0,position:"relative",zIndex:10,flexDirection:i?"row":"column-reverse",gap:"16px"},children:n?n({filter:s}):e.jsxs(e.Fragment,{children:[e.jsxs(u.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[s,l]}),e.jsxs(u.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[t,a()]})]})})},Fn=({totalData:r,withMarginBottom:t=!0,withMarginTop:l=!0})=>e.jsxs(u.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:t?"16px":void 0,marginTop:l?"16px":void 0},children:[e.jsxs(He.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(He.Body1,{children:r||0})]}),zl=({pagination:r,pageKey:t="page",perPageKey:l="perPage",defaultPerPage:n=10,showPagination:o=!0,totalData:c})=>{const{searchQueries:i,setSearchParams:s,searchParams:a}=Me(),d=a.get(l),y=L=>{s({...i,[t]:String(L)})},b=L=>{s({...i,[l]:L,[t]:"1"})},p=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),x=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsx(u.Box,{style:{display:"flex",width:"100%",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0},children:o?e.jsxs(e.Fragment,{children:[e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(k.Text,{children:"Rows Per Page: "}),e.jsx(nr.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:L=>{b(L[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}]}),e.jsx(k.Text,{children:`${p}-${x} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(gr.Pagination,{currentPage:r!=null&&r.currentPage?Number(r==null?void 0:r.currentPage):1,totalPages:r!=null&&r.totalPage?Number(r==null?void 0:r.totalPage):1,onPageChange:y})]}):e.jsx(Fn,{totalData:c,withMarginBottom:!1,withMarginTop:!1})})},Hl=({filter:r,columnTitle:t})=>{const[l,n]=h.useState(!1),o=h.useRef(null),c=h.useRef(null),i=h.useRef(null),[s,a]=h.useState(""),[d,y]=h.useState({top:0,left:0}),b=r.selectedValues,p=h.useMemo(()=>s?r.options.filter(v=>v.label.toLowerCase().includes(s.toLowerCase())):r.options,[r.options,s]);h.useEffect(()=>{if(l&&c.current){const v=c.current.getBoundingClientRect(),T=280,F={top:v.bottom+8};r.position==="left"||v.left+T>window.innerWidth?F.right=window.innerWidth-v.right:F.left=v.left,y(F)}},[l,r.position]),h.useEffect(()=>{l&&i.current?setTimeout(()=>{var v;return(v=i.current)==null?void 0:v.focus()},50):a("")},[l]),h.useEffect(()=>{const v=T=>{o.current&&!o.current.contains(T.target)&&c.current&&!c.current.contains(T.target)&&n(!1)};return l&&document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[l]);const x=v=>{const T=b.includes(v)?b.filter(F=>F!==v):[...b,v];r.onFilterChange(T)},L=()=>r.onFilterChange([]);return e.jsxs(u.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(u.Box,{ref:c,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:v=>{var T;v.stopPropagation(),l||(T=r.onOpen)==null||T.call(r),n(F=>!F)},children:e.jsx(M.Icon,{name:l?"ChevronUp":"ChevronDown",size:"sm",style:{color:b.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),l&&e.jsxs(u.Box,{ref:o,style:{position:"fixed",top:`${d.top}px`,...d.left!==void 0?{left:`${d.left}px`}:{right:`${d.right}px`},backgroundColor:"white",borderRadius:"4px",minWidth:"280px",maxHeight:"400px",display:"flex",flexDirection:"column",zIndex:9999,animation:"fadeInDropdown 0.15s ease-out",border:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(k.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",t]}),b.length>0&&e.jsx(u.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(k.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:v=>{v.stopPropagation(),L()},children:"CLEAR"})})]}),!r.hideSearch&&e.jsx(u.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(Ke.Input,{ref:i,placeholder:`Search ${t.toLowerCase()}...`,leftIcon:e.jsx(M.Icon,{name:"Search",size:"sm"}),value:s,onChange:v=>a(v.target.value),style:{fontSize:"14px"}})}),e.jsx(u.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:r.isLoadingOptions?e.jsxs(u.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(M.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):p.length>0?e.jsx(u.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:p.map(v=>e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:b.includes(v.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:T=>{T.stopPropagation(),x(v.value)},onMouseEnter:T=>{b.includes(v.value)||(T.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),T.currentTarget.style.transform="translateX(2px)"},onMouseLeave:T=>{T.currentTarget.style.backgroundColor=b.includes(v.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",T.currentTarget.style.transform="translateX(0)"},children:[e.jsx(Ze.Checkbox,{checked:b.includes(v.value),onChange:()=>{}}),e.jsx(k.Text,{fontSize:"sm",fontWeight:b.includes(v.value)?"medium":"normal",color:b.includes(v.value)?"primary":"gray-700",children:v.label})]},v.value))}):e.jsxs(u.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(M.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),b.length>0&&e.jsx(u.Box,{direction:"column",style:{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",backgroundColor:"var(--sa-color-brand-50, #e6edf6)",marginTop:"auto"},children:e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(u.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:b.length}),e.jsxs(k.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",b.length>1?"s":""," selected"]})]})})]})]})},En=({direction:r})=>{const t="var(--sa-text-primary, #292a2e)",l="var(--sa-text-subtle, #8c8f97)",n=r==="asc"?t:l,o=r==="desc"?t:l,c=r==="asc"?1:.45,i=r==="desc"?1:.45;return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:0},"aria-hidden":!0,children:[e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:n,opacity:c,marginBottom:1},children:e.jsx("path",{d:"M4 0 L8 5 L0 5 Z",fill:"currentColor"})}),e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:o,opacity:i},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},Mn=({frozen:r})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:r?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),ht="var(--sa-background-primary, #ffffff)",Vl="var(--sa-background-primary-inverse, #f8f8f8)",Pl=({columns:r,records:t,handleDetail:l,handleUpdate:n,handleDelete:o,isLoading:c,visibleHandleDelete:i,visibleHandleUpdate:s,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:y,frozenCount:b=0,onFrozenCountChange:p,customActions:x,actionsOrder:L=["detail","update","delete","custom"],customEmptyState:v,enableColumnResize:T=!1,defaultColumnWidths:F,onColumnWidthsChange:O,defaultMinColumnWidth:B=60,sort:D,defaultSort:H,onSortChange:z,showActionDivider:S=!1})=>{const I=D!==void 0,[V,P]=h.useState(H??null),Q=I?D??null:V,U=W=>{if(W.sortKey)return W.sortKey;if(typeof W.accessor=="string")return W.accessor},re=W=>{const J=U(W);if(!J)return;let _;!Q||Q.key!==J?_={key:J,direction:"asc"}:Q.direction==="asc"?_={key:J,direction:"desc"}:_=null,I||P(_),z==null||z(_)},se=[l,n,o].filter(W=>W!==void 0).length,ee=!!x,G=!!l||!!n||!!o||ee,X="var(--sa-border-subtle, #0b120e24)",de=`1px solid ${X}`,xe=`inset 1px 0 0 ${X}`,ke=`inset -1px 0 0 ${X}`,ye=se===3?ee?"178px":"140px":se===2?ee?"140px":"102px":se===1?ee?"112px":"74px":ee?"74px":"",Ce=(W,J)=>{if(!J)return W;if(typeof J=="function")return J(W);if(typeof J=="string")return W[J]},[we,Ne]=h.useState(!1);h.useEffect(()=>{if(!(y!=null&&y.current))return;const W=y.current;Ne(W.scrollHeight>W.clientHeight)},[t,y]);const Oe=h.useRef(null),[ve,Ve]=h.useState([]),[Be,Ie]=h.useState(()=>F??{}),Pe=h.useRef(null);h.useLayoutEffect(()=>{if(!b||!Oe.current){Ve([]);return}const W=Array.from(Oe.current.querySelectorAll("thead tr th")),J=[];let _=0;W.forEach((Y,N)=>{J[N]=_,N<b&&(_+=Y.offsetWidth)}),Ve(J)},[b,r,t,Be]);const Ue=W=>{p&&p(W<b?W:W+1)},m=(W,J)=>{const _=Be[W];if(_!==void 0){const Y=`${_}px`;return{width:Y,minWidth:Y,maxWidth:Y}}return J?{width:J}:{}},Z=W=>T&&(W.resizable??!0),K=(W,J)=>{W.preventDefault(),W.stopPropagation();const _=W.currentTarget.closest("th");if(!_)return;const Y=Math.round(_.getBoundingClientRect().width);Pe.current={colIndex:J,startX:W.clientX,startWidth:Y};const N=document.body.style.userSelect,he=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Ee=_e=>{var Re;const Le=Pe.current;if(!Le)return;const Je=((Re=r[Le.colIndex])==null?void 0:Re.minWidth)??B,De=Math.max(Je,Le.startWidth+(_e.clientX-Le.startX));Ie(er=>er[Le.colIndex]===De?er:{...er,[Le.colIndex]:De})},Ge=()=>{document.removeEventListener("mousemove",Ee),document.removeEventListener("mouseup",Ge),document.body.style.userSelect=N,document.body.style.cursor=he,Pe.current=null,O&&Ie(_e=>(O(_e),_e))};document.addEventListener("mousemove",Ee),document.addEventListener("mouseup",Ge)};return e.jsx("div",{ref:Oe,children:e.jsxs(q.Table,{fullWidth:!0,children:[e.jsx(q.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(q.Tr,{children:[r.map((W,J)=>{var qr,hr;const _=b>0&&J<b,Y=ve[J]??0,N=Z(W),Ee=J===r.length-1&&G&&S,Ge=U(W),_e=!!W.sortable&&!!Ge,Le=_e&&(Q==null?void 0:Q.key)===Ge?Q.direction:null,Je=W.title||((qr=W.accessor)==null?void 0:qr.toString())||"",De=(hr=W.headerTooltip)!=null&&hr.showIcon?e.jsx(M.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,Re=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Je}),er=_e?e.jsxs("button",{type:"button",onClick:()=>re(W),title:Le==="asc"?"Sorted ascending — click to sort descending":Le==="desc"?"Sorted descending — click to clear":"Click to sort ascending",style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4,background:"none",border:"none",padding:0,margin:0,font:"inherit",color:"inherit",cursor:"pointer",textAlign:W.textAlign==="text-right"?"right":W.textAlign==="text-center"?"center":"left"},children:[Re,De,e.jsx(En,{direction:Le})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Re,De]});return e.jsxs(q.Th,{style:{position:"sticky",top:0,left:_?Y:void 0,zIndex:_?4:2,paddingLeft:J===0?"12px":"",borderRight:d&&!Ee&&!_?de:void 0,borderBottom:d?de:void 0,boxShadow:d&&_?ke:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:W.textAlign==="text-right"?"right":W.textAlign==="text-center"?"center":"left",...m(J,W.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[W.headerTooltip?e.jsx(me.Tooltip,{label:W.headerTooltip.content,position:"bottom",children:er}):er,W.filter&&e.jsx(Hl,{filter:W.filter,columnTitle:W.title}),p&&e.jsx("button",{onClick:()=>Ue(J),title:_?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:_?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:_?1:.45,transition:"opacity 0.15s"},children:e.jsx(Mn,{frozen:_})})]}),N&&e.jsx("div",{onMouseDown:wr=>K(wr,J),onClick:wr=>wr.stopPropagation(),role:"separator","aria-orientation":"vertical",title:"Drag to resize",style:{position:"absolute",top:0,right:-3,width:6,height:"100%",cursor:"col-resize",userSelect:"none",zIndex:5,touchAction:"none"}})]},`table-head-${J}`)}),G?e.jsx(q.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?de:void 0,boxShadow:d&&S?xe:void 0}}):null]})}),e.jsx(q.Tbody,{children:c?e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:r.length+1,children:e.jsxs(u.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"})]})})}):!(t!=null&&t.length)&&v?e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:r.length+1,children:v})}):t==null?void 0:t.map((W,J)=>e.jsxs(q.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:J===t.length-1&&we?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:_=>{const Y=_.currentTarget;Y.style.backgroundColor=Vl,Array.from(Y.querySelectorAll("td")).forEach(N=>{N.style.position==="sticky"&&(N.style.backgroundColor=Vl)})},onMouseLeave:_=>{const Y=_.currentTarget;Y.style.backgroundColor="",Array.from(Y.querySelectorAll("td")).forEach(N=>{N.style.position==="sticky"&&(N.style.backgroundColor=ht)})},children:[r.map((_,Y)=>{const N=_.render?_.render(W,J,t):Ce(W,_.accessor),he=b>0&&Y<b,Ee=ve[Y]??0,Ge=Be[Y]!==void 0,_e=he&&Y===b-1;return e.jsx(q.Td,{style:{position:he?"sticky":void 0,left:he?Ee:void 0,zIndex:he?1:void 0,backgroundColor:he?ht:void 0,transition:he?"background-color 0.3s ease":void 0,paddingLeft:Y===0?"12px":"",whiteSpace:"nowrap",overflow:Ge?"hidden":void 0,borderLeft:_.showBorderLeft?de:void 0,borderRight:_.showBorderRight?de:void 0,boxShadow:_e?ke:void 0,textAlign:_.textAlign==="text-right"?"right":_.textAlign==="text-center"?"center":"left",...m(Y,_.width)},children:typeof N=="string"?e.jsx(k.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:_.textAlign==="text-right"?"right":_.textAlign==="text-center"?"center":"left"},children:N}):N},`row-${J}-col-${Y}`)}),G?e.jsx(q.Td,{style:{width:ye,position:"sticky",right:0,zIndex:1,backgroundColor:ht,boxShadow:S?xe:void 0,transition:"background-color 0.3s ease"},children:e.jsx(oe.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:L.map(_=>{const Y=J===t.length-1?"top":"bottom";return _==="detail"&&l&&(a==null?void 0:a(W))!==!1?e.jsx(me.Tooltip,{label:"Detail",position:Y,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>l(W.id,W),iconLeft:e.jsx(M.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):_==="update"&&n&&(s==null?void 0:s(W))!==!1?e.jsx(me.Tooltip,{label:"Update",position:Y,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(W),iconLeft:e.jsx(M.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):_==="delete"&&o&&(i==null?void 0:i(W))!==!1?e.jsx(me.Tooltip,{label:"Delete",position:Y,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(W.id,W),iconLeft:e.jsx(M.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):_==="custom"?e.jsx(h.Fragment,{children:x==null?void 0:x(W)},"custom"):null})})}):null]},`${W}${J}`))})]})})},Ln=({wrapperProps:r,dataTableProps:t,headerProps:l,footerProps:n})=>{var b;const o=h.useRef(null),[c,i]=h.useState((t==null?void 0:t.defaultFrozenCount)??0),s=(l==null?void 0:l.show)??!0,a=h.useRef(null),d=(b=t==null?void 0:t.pagination)==null?void 0:b.totalData;typeof d=="number"&&(a.current=d);const y=(n==null?void 0:n.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(Wl,{...r,children:[s&&e.jsx(Al,{...l}),e.jsx(u.Box,{direction:"column",ref:o,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(Pl,{...t,scrollParentRef:o,frozenCount:t!=null&&t.enableFreezeColumns?c:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?i:void 0}):null}),y&&e.jsx(zl,{pagination:t==null?void 0:t.pagination,pageKey:t==null?void 0:t.pageKey,perPageKey:t==null?void 0:t.perPageKey,defaultPerPage:t==null?void 0:t.defaultPerPage,showPagination:t==null?void 0:t.showPagination,totalData:n==null?void 0:n.totalData})]})};function Tn(r){return h.memo(r)}const In=Tn(Ln),jl=200,ft="1px solid var(--sa-border-subtle, #0b120e24)",On=({sortDir:r,frozen:t})=>r==="asc"?e.jsx(M.Icon,{name:"ChevronSmallUp"}):r==="desc"?e.jsx(M.Icon,{name:"ChevronSmallDown"}):t?e.jsx(M.Icon,{name:"LockOn",size:"xs"}):e.jsx(M.Icon,{name:"Filter",size:"xs"}),Wr=({icon:r,label:t,active:l,danger:n,onClick:o})=>{const c=n?"var(--sa-color-error-600, #c9184a)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:l?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:c,textAlign:"left"},onMouseEnter:i=>{l||(i.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:i=>{i.currentTarget.style.background=l?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(M.Icon,{name:r,size:"sm",style:{color:c,flexShrink:0}}),e.jsx(k.Text,{as:"span",style:{color:c},children:t})]})},Nl=({active:r,canSort:t,canHide:l,sortDir:n,frozen:o,onSort:c,onClearSort:i,onToggleFreeze:s,onHide:a})=>{const[d,y]=h.useState(!1),b=h.useRef(null),p=h.useRef(null),[x,L]=h.useState({top:0,left:0});h.useEffect(()=>{if(d&&b.current){const T=b.current.getBoundingClientRect(),F=T.left+jl>window.innerWidth;L({top:T.bottom+6,...F?{right:window.innerWidth-T.right}:{left:T.left}})}},[d]),h.useEffect(()=>{if(!d)return;const T=F=>{p.current&&!p.current.contains(F.target)&&b.current&&!b.current.contains(F.target)&&y(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[d]);const v=T=>{T(),y(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:b,type:"button",className:"sa-tl-menu-trigger","data-active":r||d?"true":"false",onClick:T=>{T.stopPropagation(),y(F=>!F)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:ft,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(On,{sortDir:n,frozen:o})}),d&&e.jsxs(u.Box,{ref:p,onClick:T=>T.stopPropagation(),style:{position:"fixed",top:`${x.top}px`,...x.left!==void 0?{left:`${x.left}px`}:{right:`${x.right}px`},minWidth:jl,backgroundColor:"var(--sa-background-primary, #ffffff)",border:ft,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"0 6px 24px rgba(0,0,0,0.12)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[t&&e.jsxs(e.Fragment,{children:[e.jsx(Wr,{icon:"ChevronUp",label:"Ascending",active:n==="asc",onClick:()=>v(()=>n==="asc"?i():c("asc"))}),e.jsx(Wr,{icon:"ChevronDown",label:"Descending",active:n==="desc",onClick:()=>v(()=>n==="desc"?i():c("desc"))}),e.jsx("div",{style:{borderTop:ft,margin:"4px 0"}})]}),e.jsx(Wr,{icon:"Pin1",label:o?"Unfreeze":"Freeze",active:o,onClick:()=>v(s)}),l&&e.jsx(Wr,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>v(a)})]})]})},br="1px solid var(--sa-border-subtle, #0b120e24)",Wn="var(--sa-text-subtle, #8c8f97)",dr="var(--sa-background-neutral, #f0f1f2)",_l="2px 0 4px -2px rgba(0,0,0,0.15)",Cr=40,gt="var(--sa-background-brand-subtlest)",Ar={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},ql="sa-table-layout-styles",An=()=>{if(typeof document>"u"||document.getElementById(ql))return;const r=document.createElement("style");r.id=ql,r.textContent=`
2
2
  .sa-table-layout tbody td {
3
3
  transition: background-color 0.15s ease;
4
4
  background-color: var(--sa-tl-bg, transparent);
@@ -54,8 +54,8 @@
54
54
  .sa-table-layout tfoot.sa-tl-sticky-foot > tr:first-child > th {
55
55
  box-shadow: 0 -2px 4px -2px rgba(0,0,0,0.15);
56
56
  }
57
- `,document.head.appendChild(r)},vr=r=>r==="right"?"right":r==="center"?"center":"left",Wn=/^(#|rgb|hsl|var\()/,zr=r=>r?Wn.test(r)?r:`var(--sa-background-${r})`:void 0,An=(r,t)=>{if(t)return r[t]},zn=(r,t)=>r==null&&t==null?0:r==null?-1:t==null?1:typeof r=="number"&&typeof t=="number"?r-t:String(r).localeCompare(String(t)),Hn=({columns:r,data:t,getRowKey:l,rowBg:n,size:o="md",resizable:c=!1,layout:i="auto",widthStorageKey:s,columnState:a,onColumnStateChange:d,columnMenu:y=!1,sort:b,defaultSort:p,onSortChange:x,height:I,mobileLayout:v="cards",mobileBreakpoint:T="md",groupSeparator:F,summary:O,footer:B,stickyFooter:D=!1,emptyState:H,loading:z=!1,loadingRows:S=8,rowActions:L,selectable:V=!1,selectedKeys:P,defaultSelectedKeys:Z,onSelectionChange:Y,isRowSelectable:te})=>{On();const de=!pe.useMediaQuery(T)&&v!=="scroll",ee=!!(L!=null&&L.length),[Q,X]=h.useState(null);h.useEffect(()=>{if(!Q)return;const C=()=>X(null),w=setTimeout(()=>document.addEventListener("click",C),0);return()=>{clearTimeout(w),document.removeEventListener("click",C)}},[Q]);const[he,Se]=h.useState(()=>new Set),se=a!==void 0,[ve,Te]=h.useState({}),ke=a??ve,He=C=>{d==null||d(C),se||Te(C)},Ie=b!==void 0,[be,Ze]=h.useState(p??null),xe=Ie?b??null:be,je=!x,Ve=C=>{x==null||x(C),Ie||Ze(C)},{headerGroups:Ue,leafColumns:m,hasGroups:G}=h.useMemo(()=>{var ie;const C=new Set(ke.hidden??[]),w=(ce,ue)=>ce.key??(typeof ce.accessor=="string"?ce.accessor:`col-${ue}`),E=r.map((ce,ue)=>{var Oe;if((Oe=ce.children)!=null&&Oe.length){const Dr=ce.children.map((_e,Sr)=>({col:_e,key:w(_e,`${ue}-${Sr}`)})).filter(_e=>!C.has(_e.key));return{col:ce,key:ce.key??`group-${ue}`,isGroup:!0,leaves:Dr}}const ye={col:ce,key:w(ce,`${ue}`)};return{col:ce,key:ye.key,isGroup:!1,leaves:C.has(ye.key)?[]:[ye]}}).filter(ce=>ce.leaves.length>0),K=E.some(ce=>ce.isGroup);let le=E.flatMap(ce=>ce.leaves);if(!K&&((ie=ke.order)!=null&&ie.length)){const ce=new Map(ke.order.map((ue,ye)=>[ue,ye]));le=[...le].sort((ue,ye)=>(ce.get(ue.key)??1/0)-(ce.get(ye.key)??1/0))}return{headerGroups:E,leafColumns:le,hasGroups:K}},[r,ke]),$=h.useMemo(()=>new Map(m.map((C,w)=>[C.key,w])),[m]),W=!G&&m.some(C=>(C.col.headerColSpan??1)>1),U=m.map(C=>C.key).join("|"),_=(C,w)=>{const E=C.sortKey??(typeof C.accessor=="string"?C.accessor:void 0);return E?w[E]:void 0},J=C=>C.sortable??(!!C.sortKey||typeof C.accessor=="string"),N=h.useMemo(()=>{if(!je||!xe)return t;const C=m.find(E=>E.key===xe.key);if(!C)return t;const w=xe.direction==="asc"?1:-1;return[...t].sort((E,K)=>zn(_(C.col,E),_(C.col,K))*w)},[t,je,xe,m]),ge=!G&&!W,Fe=!!s&&ge,[Ge,Ne]=q.useColumnWidths(s??""),Me=Fe?Ge:void 0,Je=h.useRef(null),[we,Re]=h.useState();h.useLayoutEffect(()=>{Re(void 0)},[U]),h.useLayoutEffect(()=>{if(!ge||we||!Je.current)return;const C=Je.current.querySelectorAll("th.sa-tl-leaf");Re(Array.from(C).map(w=>w.offsetWidth))},[we,ge]);const[er,qr]=h.useState(0);h.useLayoutEffect(()=>{if(!G||!Je.current)return;const C=Je.current.querySelector(":scope > tr");C&&qr(C.offsetHeight)},[G,U]);const hr=(C,w)=>{if((Me==null?void 0:Me[w])!=null)return Me[w];if(C.width!=null)return C.width;if((we==null?void 0:we[w])!=null)return we[w]},wr=(C,w)=>typeof C.width=="number"?C.width:we==null?void 0:we[w],Ct=ke.frozenKey&&!G&&!W?m.findIndex(C=>C.key===ke.frozenKey):-1,$l=C=>C<=Ct,Rl=V?Cr:0,eo=C=>{if(!we)return Rl;let w=Rl;for(let E=0;E<C;E++)w+=we[E]??0;return w},vt=h.useRef(null),[os,ns]=h.useState("100vh");h.useLayoutEffect(()=>{if(I!==void 0)return;const C=()=>{if(vt.current){const w=vt.current.getBoundingClientRect().top;ns(`calc(100vh - ${w}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return C(),window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[I]);const Ye=(C,w)=>l?l(C,w):w,xt=P!==void 0,[ro,cs]=h.useState(()=>new Set(Z??[])),Xe=h.useMemo(()=>xt?new Set(P):ro,[xt,P,ro]);h.useEffect(()=>{V&&!l&&process.env.NODE_ENV!=="production"&&console.warn("[@starasia/admin] TableLayout: `selectable` tanpa `getRowKey` — key default (index) membuat seleksi menempel ke POSISI baris, bukan datanya. Beri `getRowKey` yang stabil (mis. r => r.id).")},[V,!l]);const to=C=>{if(xt||cs(C),Y){const w=N.filter((E,K)=>C.has(Ye(E,K)));Y(Array.from(C),w)}},wt=(C,w)=>V&&(te?te(C,w):!0),Dt=C=>{const w=new Set(Xe);w.has(C)?w.delete(C):w.add(C),to(w)},fr=h.useMemo(()=>V?N.map((C,w)=>({row:C,i:w,key:Ye(C,w)})).filter(({row:C,i:w})=>te?te(C,w):!0).map(({key:C})=>C):[],[V,N,te,l]),lo=fr.filter(C=>Xe.has(C)),St=fr.length>0&&lo.length===fr.length,oo=lo.length>0&&!St,ss=()=>{const C=new Set(Xe);St?fr.forEach(w=>C.delete(w)):fr.forEach(w=>C.add(w)),to(C)},kt=(C,w,E)=>C.render?C.render(w,E,N):An(w,C.accessor),Bt=m.length+(V?1:0)+(ee?1:0),no=["80%","55%","70%","45%","90%","60%"],is=(C,w)=>no[(C*7+w*3)%no.length],as=(C,w)=>e.jsx(Ae.Skeleton,{height:14,width:is(C,w),borderRadius:"rounded-sm"}),ds=Array.from({length:S},(C,w)=>e.jsxs(q.Tr,{children:[V&&e.jsx(q.Td,{style:{width:Cr,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(Ae.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),m.map(({col:E,key:K},le)=>e.jsx(q.Td,{style:{textAlign:vr(E.align)},children:as(w,le)},`sa-tl-sk-${w}-${K}`)),ee&&e.jsx(q.Td,{style:{width:1,padding:0,border:"none"}})]},`sa-tl-sk-${w}`)),hs=(C,w)=>{w||He({...ke,hidden:[...ke.hidden??[],C]})},fs=C=>He({...ke,frozenKey:ke.frozenKey===C?void 0:C}),Zr=C=>(L??[]).filter(w=>{var E;return!((E=w.hidden)!=null&&E.call(w,C))}),co={position:"absolute",right:0,top:0,bottom:0,display:"flex",alignItems:"center",gap:4,paddingRight:16,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},Gr=(C,w,E,K)=>{var Oe;const le=(Oe=C.disabled)==null?void 0:Oe.call(C,w),ie=(K==null?void 0:K.showLabel)??C.showLabel,ce=(K==null?void 0:K.size)??"xs",ue=e.jsx(j.Button,{size:ce,variant:C.variant??"tertiary",tone:C.tone??"neutral",disabled:le,onClick:()=>C.onClick(w,E),iconLeft:C.icon?e.jsx(M.Icon,{name:C.icon,size:"sm"}):void 0,children:ie&&C.label}),ye=C.tooltip;return ye?e.jsx(Be.Tooltip,{label:ye,position:"top-end",children:ue}):ue},gs=(C,w)=>{const E=Zr(C);if(!E.length)return null;if(E.length>5){const le=Ye(C,w),ie=(Q==null?void 0:Q.rowKey)===le;return e.jsx("div",{className:"sa-tl-row-actions",style:co,onClick:ce=>ce.stopPropagation(),children:e.jsx(Be.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(j.Button,{size:"xs",variant:"tertiary",onClick:ce=>{const ue=ce.currentTarget.getBoundingClientRect();X(ie?null:{rowKey:le,top:ue.bottom+4,right:window.innerWidth-ue.right})},children:e.jsx(M.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:co,children:E.map(le=>e.jsx(h.Fragment,{children:Gr(le,C,w)},le.key))})},us=(C,w)=>{const E=Zr(C);return E.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:br},children:E.map(K=>e.jsx(h.Fragment,{children:Gr(K,C,w,{showLabel:!0,size:"sm"})},K.key))}):null},ys=(C,w)=>{const E=Zr(C);return E.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:E.map(K=>e.jsx(h.Fragment,{children:Gr(K,C,w,{showLabel:!1})},K.key))}):null},mt=(C,w)=>{const{col:E,key:K}=C,le=$.get(K)??0,ie=$l(le),ce=ie&&le===Ct,ue=(xe==null?void 0:xe.key)===K?xe.direction:null,ye=y&&!E.disableMenu?e.jsx(jl,{active:!!ue||ie,canSort:J(E),canHide:!E.locked,sortDir:ue,frozen:ie,onSort:Sr=>Ve({key:K,direction:Sr}),onClearSort:()=>Ve(null),onToggleFreeze:()=>fs(K),onHide:()=>hs(K,E.locked)}):null,Oe=E.align==="right",Dr=E.align==="right"?"flex-end":E.align==="center"?"center":"flex-start",_e=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:Dr,overflow:"hidden"},children:[E.icon&&e.jsx(M.Icon,{name:E.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:Ar,children:E.title})]});return e.jsx(q.Th,{className:`sa-tl-leaf${ie?" sa-tl-frozen":""}`,rowSpan:w==null?void 0:w.rowSpan,colSpan:w==null?void 0:w.colSpan,minWidth:E.minWidth,resizable:ge?E.resizable:!1,defaultWidth:wr(E,le),style:{textAlign:vr(E.align),width:hr(E,le),position:"sticky",top:(w==null?void 0:w.top)??0,left:ie?eo(le):void 0,zIndex:ie?3:2,backgroundColor:dr,boxShadow:ce?Nl:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:Oe?e.jsxs(e.Fragment,{children:[ye,_e]}):e.jsxs(e.Fragment,{children:[_e,ye]})})},`th-${K}`)},ps=()=>{const C=[];for(let w=0;w<m.length;){const E=m[w],K=E.col.headerColSpan??1,le=Math.max(1,Math.min(K,m.length-w));C.push(mt(E,le>1?{colSpan:le}:void 0)),w+=le}return C},so=C=>e.jsx(q.Th,{rowSpan:C==null?void 0:C.rowSpan,style:{width:Cr,position:"sticky",top:0,left:0,zIndex:4,backgroundColor:dr,padding:0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:w=>w.stopPropagation(),children:e.jsx(qe.Checkbox,{size:"sm",variant:oo?"indeterminate":"select",checked:St||oo,disabled:fr.length===0,onChange:ss,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),bs=(C,w,E)=>{const K=Ye(C,w);return e.jsx(q.Td,{className:"sa-tl-frozen",style:{width:Cr,padding:0,position:"sticky",left:0,zIndex:2,...E?{"--sa-tl-bg":E}:{}},children:wt(C,w)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:le=>le.stopPropagation(),children:e.jsx(qe.Checkbox,{size:"sm",checked:Xe.has(K),onChange:()=>Dt(K),"aria-label":"Pilih baris"})})},`tl-select-${w}`)},Ft=m.filter(C=>!C.col.hideOnMobile),Et=Ft.find(C=>C.col.primary)??Ft[0],Cs=Ft.filter(C=>C!==Et),vs=C=>Se(w=>{const E=new Set(w);return E.has(C)?E.delete(C):E.add(C),E}),io=(C,w)=>Cs.map(({col:E,key:K})=>{const le=kt(E,C,w),ie=typeof le=="string"||typeof le=="number"?e.jsx(k.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:le}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:le});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof E.title=="string"?e.jsx(k.Text,{color:"subtle",fontWeight:"medium",style:{color:In,flexShrink:0},children:E.title}):e.jsx("div",{style:{flexShrink:0},children:E.title}),ie]},K)}),Mt=(C,w)=>{const E=Et?kt(Et.col,C,w):null;return typeof E=="string"||typeof E=="number"?e.jsx(k.Text,{as:"span",style:Ar,children:E}):e.jsx("span",{style:Ar,children:E})},xs=e.jsx(u.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:S},(C,w)=>e.jsxs(u.Box,{style:{border:br,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Ae.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(Ae.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(Ae.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${w}`))}),ao=e.jsx(u.Box,{fullWidth:!0,style:{minHeight:(H==null?void 0:H.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:H==null?void 0:H.content}),ws=z?xs:N.length===0?ao:v==="expand"?e.jsx(u.Box,{style:{display:"flex",flexDirection:"column"},children:N.map((C,w)=>{const E=Ye(C,w),K=he.has(E),ie=V&&Xe.has(E)?gt:zr(n==null?void 0:n(C,w));return e.jsxs("div",{style:{borderBottom:br,backgroundColor:ie},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[wt(C,w)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(qe.Checkbox,{size:"sm",checked:Xe.has(E),onChange:()=>Dt(E),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>vs(E),style:{flex:1,minWidth:0,display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"10px 12px",background:"none",border:"none",font:"inherit",color:"inherit",cursor:"pointer",textAlign:"left"},children:[Mt(C,w),e.jsx(M.Icon,{name:K?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),ee&&ys(C,w)]}),K&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:io(C,w)})]},E)})}):e.jsx(u.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:N.map((C,w)=>{const E=Ye(C,w),K=V&&Xe.has(E);return e.jsxs(u.Box,{style:{border:br,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:K?gt:zr(n==null?void 0:n(C,w))},children:[wt(C,w)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(qe.Checkbox,{size:"sm",checked:Xe.has(E),onChange:()=>Dt(E),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:Mt(C,w)})]}):Mt(C,w),io(C,w),ee&&us(C,w)]},E)})}),Ds=c&&ge&&we!==void 0,ho=i==="fixed"&&!c&&(ge?we!==void 0:!0),Ss=ho&&!ge,Qr=B&&B.length>0?B.map((C,w)=>e.jsx(q.Tr,{children:C.cells.map((E,K)=>e.jsx(q.Td,{colSpan:E.colSpan,rowSpan:E.rowSpan,style:{textAlign:vr(E.align)},children:E.content},`tl-foot-${w}-${K}`))},`tl-foot-${w}`)):null,ks=e.jsxs(q.Table,{className:"sa-table-layout",fullWidth:!0,size:o,resizable:Ds,style:ho?{tableLayout:"fixed"}:void 0,onWidthsChange:Fe?Ne:void 0,children:[Ss&&e.jsxs("colgroup",{children:[V&&e.jsx("col",{style:{width:Cr}}),m.map(({col:C,key:w},E)=>e.jsx("col",{style:{width:hr(C,E)}},`col-${w}`)),ee&&e.jsx("col",{style:{width:1}})]}),e.jsx(q.Thead,{ref:Je,children:G?e.jsxs(e.Fragment,{children:[e.jsxs(q.Tr,{children:[V&&so({rowSpan:2}),Ue.map(C=>C.isGroup?e.jsx(q.Th,{colSpan:C.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:dr},children:e.jsx("span",{style:Ar,children:C.col.title})},`grp-${C.key}`):mt(C.leaves[0],{rowSpan:2})),ee&&e.jsx(q.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:dr}})]}),e.jsx(q.Tr,{children:Ue.flatMap(C=>C.isGroup?C.leaves.map(w=>mt(w,{top:er})):[])})]}):e.jsxs(q.Tr,{children:[V&&so(),ps(),ee&&e.jsx(q.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:dr}})]})}),e.jsx(q.Tbody,{children:z?ds:N.length===0?e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:Bt,children:ao})}):e.jsxs(e.Fragment,{children:[N.map((C,w)=>{const E=F==null?void 0:F(C,w,w>0?N[w-1]:void 0),le=V&&Xe.has(Ye(C,w))?gt:zr(n==null?void 0:n(C,w));return e.jsxs(h.Fragment,{children:[E!=null&&E!==!1&&e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:Bt,style:{backgroundColor:dr},children:E})}),e.jsxs(q.Tr,{children:[V&&bs(C,w,le),m.map(({col:ie,key:ce},ue)=>{var go;const ye=(go=ie.cellProps)==null?void 0:go.call(ie,C,w,N);if(ye!=null&&ye.hidden)return null;const Oe=$l(ue),Dr=Oe&&ue===Ct,_e=kt(ie,C,w),Sr=typeof ie.bg=="function"?ie.bg(C,w,N):ie.bg,fo=zr(Sr)??le;return e.jsx(q.Td,{className:Oe?"sa-tl-frozen":void 0,colSpan:ye==null?void 0:ye.colSpan,rowSpan:ye==null?void 0:ye.rowSpan,style:{textAlign:vr(ie.align),width:hr(ie,ue),minWidth:ie.minWidth,position:Oe?"sticky":void 0,left:Oe?eo(ue):void 0,zIndex:Oe?1:void 0,boxShadow:Dr?Nl:void 0,...fo?{"--sa-tl-bg":fo}:{}},children:typeof _e=="string"?e.jsx(k.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:vr(ie.align)},children:_e}):_e},`tl-cell-${w}-${ce}`)}),ee&&e.jsx(q.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:gs(C,w)})]})]},Ye(C,w))}),O!=null&&e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:Bt,children:O})})]})}),Qr&&e.jsx(q.Tfoot,{className:D?"sa-tl-sticky-foot":void 0,children:Qr})]}),Lt=Q?N.findIndex((C,w)=>Ye(C,w)===Q.rowKey):-1,Tt=Lt>=0?N[Lt]:null;return e.jsxs(e.Fragment,{children:[e.jsx(u.Box,{ref:vt,fullWidth:!0,style:{overflow:"auto",height:I??os},children:de?e.jsxs(e.Fragment,{children:[ws,Qr&&!z&&N.length>0&&e.jsx(u.Box,{style:{borderTop:br},children:e.jsx(q.Table,{fullWidth:!0,size:o,className:"sa-table-layout",children:e.jsx(q.Tbody,{children:Qr})})})]}):ks}),Q&&Tt&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:Q.top,right:Q.right},onClick:C=>C.stopPropagation(),children:Zr(Tt).map(C=>e.jsx("div",{style:{padding:"2px 4px"},children:Gr(C,Tt,Lt,{showLabel:!0,size:"sm"})},C.key))})]})},ut=r=>r==="asc"||r==="desc",Vn=(r={})=>{const{sortKeyParam:t="sortBy",sortOrderParam:l="sortOrder",pageKey:n="page",defaultSort:o=null,paramKeys:c,scopeId:i,storage:s=ct}=r,{searchParams:a,setSearchParams:d,searchQueries:y}=Ee(),b=a.toString(),p=i?ar.tableSort(i):void 0,x=h.useRef(!1);h.useEffect(()=>{if(x.current||(x.current=!0,!p)||a.has(t)||a.has(l))return;const B=s.get(p);!(B!=null&&B.key)||!ut(B.direction)||d({...Object.fromEntries(a.entries()),[t]:B.key,[l]:B.direction})},[]);const I=h.useMemo(()=>{const B=a.get(t),D=a.get(l);return B&&ut(D)?{key:B,direction:D}:o},[b,t,l,o]);h.useEffect(()=>{if(!p)return;const B=a.get(t),D=a.get(l);B&&ut(D)?s.set(p,{key:B,direction:D}):s.remove(p)},[b,p,t,l,s]);const v=(c==null?void 0:c.sortBy)??"sortBy",T=(c==null?void 0:c.sortOrder)??"sortOrder",F=h.useMemo(()=>I?{[v]:I.key,[T]:I.direction}:{},[I,v,T]),O=h.useCallback(B=>{const D={...y};B?(D[t]=B.key,D[l]=B.direction):(delete D[t],delete D[l]),delete D[n],d(D)},[y,t,l,n,d]);return{sort:I,setSort:O,params:F}},Hr=({of:r,render:t})=>h.Children.toArray(r==null?void 0:r.map((l,n,o)=>t(l,n,o))),ne=({condition:r,fallback:t,children:l,loading:n,isLoading:o})=>e.jsx(e.Fragment,{children:o?n:r?l:t}),ae=r=>e.jsx(k.Text,{...r,fontFamily:"Poppins",fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),Qe=r=>e.jsx(k.Text,{color:"red-600",fontSize:"sm",children:r.message}),Pn=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var s,a,d;const c=o.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ae,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:o.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((s=o.tooltip)!=null&&s.label),children:e.jsx(Be.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(u.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx($e.Input,{ref:o.inputRef,size:r,...o.inputProps,status:o.errorMessage?"error":"default",fullWidth:!0}),!c&&o.errorMessage&&e.jsx(Qe,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},jn=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var s,a,d;const c=o.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ae,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:o.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((s=o.tooltip)!=null&&s.label),children:e.jsx(Be.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(u.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(u.Box,{direction:"column",style:{width:o.inputProps.fullWidth?"100%":t==="horizontal"&&o.customWidth?o.customWidth:t==="horizontal"?"343px":""},children:e.jsx(nr.Dropdown,{size:r,...o.inputProps,error:!!o.errorMessage})}),!c&&o.errorMessage&&e.jsx(Qe,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},Nn=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",_n=r=>{var s;const[t,l]=h.useState(!1),n=a=>{a.preventDefault(),a.stopPropagation()},o=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&r.handleOnFileChange(a.dataTransfer.files.item(0))},c=a=>{a.preventDefault(),l(!0)},i=a=>{a.preventDefault(),l(!1)};return e.jsxs(u.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:r.handleOnClick,onDragOver:n,onDrop:o,onDragEnter:c,onDragLeave:i,paddingBlock:"md",borderRadius:"rounded-md",style:{border:t?"1px solid var(--sa-border-info)":`1px solid ${Nn(r.errorMessage,r.status)}`},children:[e.jsx(M.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",children:[e.jsx(k.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(k.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",children:(s=r.fileSupports)==null?void 0:s.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function qn(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const ql=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},Zn=r=>{const t={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},l=r.split(" ");if(l.length!==3)return null;const n=parseInt(l[0],10),o=t[l[1]],c=parseInt(l[2],10);return isNaN(n)||isNaN(o)||isNaN(c)?null:new Date(c,o,n)};function Gn(r,t=!0){if(!r)return"Rp 0";const l=typeof r=="number"?r.toString():r;if(isNaN(Number(l)))return"Rp 0";const n=l.split("."),o=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),c=n.length===2?o+"."+n[1]:o;return t?"Rp"+c:c}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},String.prototype.toNumber=function(){return Number(this)};const Qn=r=>{const t=r.split(" ");let l=t[0].charAt(0);return t.length>1&&(l+=""+t[1].charAt(0)),l.toUpperCase()};function Un(r){const t=typeof r=="string"?new Date(r):r;if(isNaN(t.getTime()))throw new Error("Invalid date format");const l=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return`${l}-${n}-${o}`}const Jn="sa-admin",Pe=r=>`var(--${Jn}-${r})`,Yn={base:{borderColor:Pe("base-border-color"),textColor:Pe("base-text-color"),iconColor:Pe("base-icon-color"),placeholderColor:Pe("base-placeholder-color")},document:{bgColor:Pe("document-bg-color")},sidebar:{bgColor:Pe("sidebar-bg-color"),borderColor:Pe("sidebar-border-color"),maxWidth:Pe("sidebar-max-width"),width:Pe("sidebar-width"),collapseWidth:Pe("sidebar-collapse-width"),collapseV2Width:Pe("sidebar-v2-collapse-width")}},Xn=24*60*60*1e3,Kn=r=>{const t="14px poppins",n=document.createElement("canvas").getContext("2d");n.font=t;const o=n.measureText(r).width;return Number(Math.ceil(o))},$n=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Rn=/--+/,ec=/-$/;function rc(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function tc(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function lc(r){return/^[A-Za-z\s]+$/.test(r)}const oc=r=>{const t=/^[0-9]$/,l=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&(r.key==="a"||r.key==="c"||r.key==="v")||!t.test(r.key)&&!l.includes(r.key)&&r.preventDefault()},nc=r=>{const t=/^[0-9]$/,l=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||t.test(r.key)&&!l.includes(r.key)&&r.preventDefault()},cc=r=>{const t=/^[0-9.]$/,l=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||!t.test(r.key)&&!l.includes(r.key)&&r.preventDefault()},sc=r=>$n.test(r);function ic(r){return!(Rn.test(r)||ec.test(r))}const ac=r=>{const t=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((r.ctrlKey||r.metaKey)&&["a","c","v","x"].includes(r.key.toLowerCase()))return;const l=r.currentTarget.value;/^[0-9]$/.test(r.key)||r.key==="."&&!l.includes(".")||r.key==="-"&&l.length===0&&!l.includes("-")||t.includes(r.key)||r.preventDefault()},dc=r=>{const t=document.getElementById(r);if(t){const l=t.getBoundingClientRect(),n=window.scrollY+l.top-80;window.scrollTo({top:n,behavior:"smooth"})}};function hc(r){const t=r.toLowerCase();if(["kb","mb","gb"].find(c=>t.endsWith(c)))return r;const o=Number(r);if(isNaN(o))throw new Error("Invalid size format");return o>=1e6?`${(o/1e6).toFixed(2)}MB`:o>=1e3?`${(o/1e3).toFixed(2)}KB`:`${o}B`}function fc(r){const t=r.split("/");return t[t.length-1]}const gc=r=>{var t,l;return e.jsxs(u.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:r.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(oe.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(M.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(oe.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(k.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?fc(r.defaultFile.url):(t=r.fileSelected)==null?void 0:t.name}),r.defaultFile?(r.defaultFile.size||r.defaultFile.date)&&e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[r.defaultFile.size&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",children:r.defaultFile.size}),r.defaultFile.size&&r.defaultFile.date&&e.jsx(M.Icon,{name:"Dot",size:"xs"}),r.defaultFile.date&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:r.defaultFile.date})]}):e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",children:hc(((l=r.fileSelected)==null?void 0:l.size.toString())||"100000")}),e.jsx(M.Icon,{name:"Dot",size:"xs"}),e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:ql(new Date)})]})]})]}),e.jsx(j.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:n=>{n.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(M.Icon,{name:"Trash1"})})]})},Zl=({status:r="default",labelPosition:t="outside-top",...l})=>{var p;const n=h.useRef(null),o=()=>{if(l.defaultFile){window.open(l.defaultFile.url);return}n.current&&n.current.click()},c=pe.useMediaQuery("md"),i=r==="error"||typeof l.errorMessage=="string"&&!!l.errorMessage,s=l.label?e.jsxs(oe.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(k.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:l.label}),l.optional&&e.jsx("span",{style:{background:"var(--sa-background-neutral)",border:"1px solid var(--sa-border-subtle)",borderRadius:"4px",padding:"0 8px",fontSize:"10px",fontWeight:500,lineHeight:"18px",color:"var(--sa-text-primary)",display:"inline-flex",alignItems:"center"},children:"Optional"}),l.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=l.description?e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:l.description}):null,d=e.jsxs(e.Fragment,{children:[l.helperText&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:l.helperText}),l.errorText&&r==="error"&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:l.errorText}),l.errorMessage&&!l.errorText&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:l.errorMessage})]}),y=e.jsx("input",{type:"file",style:{display:"none"},ref:n,onChange:x=>{var I;return l.handleOnChangeFile(((I=x.target.files)==null?void 0:I.item(0))||null)},accept:(p=l.fileSupportOption)==null?void 0:p.map(x=>"."+(x==null?void 0:x.toLowerCase())).join(", ")}),b=e.jsxs(u.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...l.containerProps,children:[y,(l.fileSelected||l.defaultFile)&&e.jsx(gc,{fileSelected:l.fileSelected,defaultFile:l.defaultFile,handleOnDeleteFile:l.handleOnDeleteFile,handleOnClickFile:o}),!l.fileSelected&&!l.defaultFile&&e.jsx(_n,{fileSupports:l.fileSupportOption,isDesktop:c,errorMessage:i?l.errorText||l.errorMessage||" ":void 0,status:i?"error":"default",handleOnClick:o,handleOnFileChange:l.handleOnChangeFile})]});return t==="outside-left"?e.jsxs(oe.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(oe.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[s,a]}),e.jsxs(oe.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[b,d]})]}):e.jsxs(oe.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[s,a,b,d]})},uc=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var s,a,d;const c=o.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ae,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:o.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((s=o.tooltip)!=null&&s.label),children:e.jsx(Be.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(Zl,{...o.inputProps,status:o.errorMessage?"error":"default"}),!c&&o.errorMessage&&e.jsx(Qe,{message:o.errorMessage})]})]})},yc=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,required:o=!1,...c})=>{var a,d,y,b;const i=c.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"||t==="horizontal-inline"?"spacing-96":"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(ne,{condition:!!o,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ae,{children:c.title}),e.jsx(ze.Body3,{props:{color:"gray-500"},children:c.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:c.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((a=c.tooltip)!=null&&a.label),children:e.jsx(Be.Tooltip,{label:(d=c.tooltip)==null?void 0:d.label,arrowPosition:(y=c.tooltip)==null?void 0:y.arrowPosition,...c.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!c.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})})]})}),e.jsx(u.Box,{gap:t==="horizontal-inline"?"xl":"md",direction:t==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(Hr,{of:(b=c.checkBoxesList)==null?void 0:b.map(p=>({...p,isChecked:c.checkBoxesAreChecked.includes(p.id)})),render:p=>p.renderBadge?e.jsxs(u.Box,{direction:"row",justify:"space-between",gap:"lg",...c.badgeContainerProps,children:[e.jsx(qe.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:x=>c.onChecked(x.target.value,p),label:p.name,description:p.description}),p.renderBadge]}):e.jsx(qe.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:x=>c.onChecked(x.target.value,p),label:p.name,description:p.description})})}),!i&&c.errorMessage&&e.jsx(Qe,{message:c.errorMessage})]})},pc=({position:r="vertical",size:t="md",fullWidth:l=!1,...n})=>{var c;const o=r==="horizontal-inline"||r==="horizontal-block"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:r==="horizontal-inline"||r==="horizontal-block"?"spacing-96":"sm",direction:r==="horizontal-inline"||r==="horizontal-block"?"row":"column",children:[e.jsx(ne,{condition:!!n.description||!!n.title,children:e.jsxs(u.Box,{direction:"column",customMaxWidth:o,fullWidth:l,children:[n.title&&e.jsx(ae,{children:n.title}),e.jsx(ne,{condition:!!n.description,children:e.jsx(k.Text,{color:"gray-500",children:n.description})})]})}),e.jsx(u.Box,{gap:"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(Hr,{of:(c=n.radioList)==null?void 0:c.map(i=>({...i,isChecked:n.radioIsChecked===i.id})),render:({value:i,id:s,isChecked:a,subInput:d,label:y,description:b})=>e.jsxs(u.Box,{direction:"column",gap:"xs",customMaxWidth:o,children:[e.jsx(Jr.Radio,{id:`${s.toString()}-${i}`,name:n.groupName||y,label:y,value:i,checked:a,onChange:p=>n.onChecked({id:s,label:p.target.name,value:p.target.value}),disabled:n.disableAll},s),b&&e.jsx(k.Text,{color:"gray-500",style:{marginLeft:28},children:b}),d]})})}),n.errorMessage&&e.jsx(Qe,{message:n.errorMessage})]})},bc=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var s,a,d;const c=o.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ae,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:o.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((s=o.tooltip)!=null&&s.label),children:e.jsx(Be.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(Ur.Textarea,{ref:o.inputRef,size:r,...o.inputProps,status:o.errorMessage?"error":"default"}),!c&&o.errorMessage&&e.jsx(Qe,{message:o.errorMessage})]})]})},Cc=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",required:n=!1,fullWidth:o=!1,...c})=>{var s,a,d;const i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(ne,{condition:n,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:o,children:[e.jsx(ae,{children:c.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.titleDescription})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:o,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:c.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((s=c.tooltip)!=null&&s.label),children:e.jsx(Be.Tooltip,{label:(a=c.tooltip)==null?void 0:a.label,arrowPosition:(d=c.tooltip)==null?void 0:d.arrowPosition,...c.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!c.titleDescription,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.titleDescription})})]})}),e.jsx(ir.Toggle,{checked:c.checked,onChange:c.onChange,label:c.label,description:c.description}),c.errorMessage&&e.jsx(Qe,{message:c.errorMessage})]})},vc=({variant:r="primary",size:t="md",...l})=>{const n=sr.useColor(),o=i=>{var a,d,y,b,p,x;if(!i)return;const s=l.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary"?"var(--sa-text-subtle, #8c8f97)":r==="secondary-danger"?(d=(a=n==null?void 0:n.computed)==null?void 0:a.red)==null?void 0:d[600]:r==="secondary-primary"?(b=(y=n==null?void 0:n.computed)==null?void 0:y.blue)==null?void 0:b[700]:(x=(p=n==null?void 0:n.computed)==null?void 0:p.gray)==null?void 0:x[50];return e.jsx(M.Icon,{name:i,size:t,style:{color:s}})},c=()=>{var s,a,d,y;if(r!=="secondary-danger"&&r!=="secondary-primary")return l.title;const i={color:l.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary-danger"?(a=(s=n==null?void 0:n.computed)==null?void 0:s.red)==null?void 0:a[600]:(y=(d=n==null?void 0:n.computed)==null?void 0:d.blue)==null?void 0:y[700]};switch(t){case"xs":return e.jsx(ze.Body2,{props:{style:i},children:l.title});case"sm":case"md":return e.jsx(ze.SubH3,{props:{style:i},children:l.title});case"lg":return e.jsx(ze.SubH2,{props:{style:i},children:l.title});default:return l.title}};return e.jsx(j.Button,{fullWidth:!0,disabled:l.disabled,primary:r==="primary",secondary:r==="secondary"||r==="secondary-danger"||r==="secondary-primary",success:r==="success",onClick:l.onClick,type:l.type,iconLeft:o(l.iconLeft),iconRight:o(l.iconRight),size:t,children:c()})},xc=r=>e.jsx(ze.H5,{props:{...r},children:r.title}),wc=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var s,a,d;const c=o.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ae,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:o.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((s=o.tooltip)!=null&&s.label),children:e.jsx(Be.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(u.Box,{direction:"column",style:{width:t==="horizontal"&&o.customWidth?o.customWidth:t==="horizontal"?"343px":""},children:e.jsx(rr.StarasiaDate,{size:r,...o.inputProps,status:o.errorMessage?"error":void 0})}),!c&&o.errorMessage&&e.jsx(Qe,{message:o.errorMessage})]})]})};async function Dc(r,t){const l=new Image;l.src=r,await new Promise((c,i)=>{l.onload=c,l.onerror=i});const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const o=n.getContext("2d",{alpha:!0});if(!o)throw new Error("No 2D context");return o.drawImage(l,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((c,i)=>{n.toBlob(s=>{if(!s)return i("Canvas is empty");const a=new File([s],"cropped.png",{type:"image/png"});c(a)},"image/png")})}const Gl={"1:1":1,"4:3":4/3,"16:9":16/9,"3:4":3/4,"9:16":9/16,"2:3":2/3,"3:2":3/2,"32:9":32/9},Ql=h.forwardRef(({handleUpload:r,urlImage:t,isUploading:l,croppedImage:n,setCroppedImage:o,size:c="96",aspect:i="1:1",containerProps:s,maxFileSize:a=2,onError:d},y)=>{const b=pe.useMediaQuery("md"),[p,x]=h.useState(!1),[I,v]=h.useState(null),[T,F]=h.useState(!1),[O,B]=h.useState({x:0,y:0}),[D,H]=h.useState(1),[z,S]=h.useState(null);h.useEffect(()=>{t===null&&o(null)},[t]);const L=h.useCallback((Q,X)=>{S(X)},[]),V=Q=>{var Se;const X=(Se=Q.target.files)==null?void 0:Se[0];if(!X)return;const he=new FileReader;he.onload=()=>{v(he.result),F(!0)},he.readAsDataURL(X)},P=async()=>{if(!(!I||!z))try{const Q=await Dc(I,z);if(a&&Q.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}r==null||r(Q);const X=URL.createObjectURL(Q);o(X,Q),F(!1)}catch{d==null||d("Gagal memproses gambar")}},Z=h.useRef(null),Y=()=>{Z.current&&Z.current.click()};h.useImperativeHandle(y,()=>({openFileDialog:()=>{var Q;(Q=Z.current)==null||Q.click()}}));const te=parseInt(c,10),fe=Gl[i];let de,ee;return fe>=1?(ee=te,de=te*fe):(de=te,ee=te/fe),e.jsxs(u.Box,{direction:"column",display:"flex",position:"relative",bg:(s==null?void 0:s.bg)||"gray-200",borderStyle:(s==null?void 0:s.borderStyle)||"border-none",borderColor:(s==null?void 0:s.borderColor)||"gray-200",borderWidth:(s==null?void 0:s.borderWidth)||"border-2",borderRadius:(s==null?void 0:s.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:s!=null&&s.fullWidth?"100%":`${de}px`,height:s!=null&&s.fullWidth?"auto":`${ee}px`,aspectRatio:fe,flexShrink:0},onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:[n||t?e.jsx("img",{src:n||t||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(u.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(M.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(c)/2<40?Number(c)/2:40,height:Number(c)/2<40?Number(c)/2:40}})}),e.jsxs(u.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",cursor:"pointer",style:{inset:0,backgroundColor:"var(--sa-color-black-alpha-a30, #080f214a)",opacity:p?1:0,transition:"opacity 0.3s ease-in-out"},onClick:Y,children:[e.jsx("input",{ref:Z,type:"file",accept:"image/*",onChange:V,disabled:l,style:{display:"none"}}),e.jsxs(u.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(M.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(ne,{condition:c.toNumber()>80,children:e.jsx(k.Text,{color:"gray-50",fontSize:c.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),l&&e.jsx(u.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",style:{inset:0,zIndex:20,backgroundColor:"var(--sa-color-white-alpha-a80, #e5e9f640)"},children:e.jsx(u.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),T&&Yr.createPortal(e.jsx("div",{style:{position:"fixed",inset:0,zIndex:19999,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.6)"},onClick:()=>F(!1),children:e.jsxs("div",{style:{backgroundColor:"var(--sa-background-primary)",borderRadius:"var(--sa-radii-md)",boxShadow:"0 20px 60px rgba(0,0,0,0.3)",overflow:"hidden",width:b?i==="1:1"?"min(90vw, 480px)":`min(90vw, ${de*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:Q=>Q.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:I&&e.jsx(uo,{image:I,crop:O,zoom:D,aspect:i?Gl[i]:void 0,onCropChange:B,onZoomChange:H,onCropComplete:L,objectFit:"contain",minZoom:.5,restrictPosition:!1})}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem",padding:"0.75rem 1rem",borderTop:"1px solid var(--sa-border-subtle)"},children:[e.jsx(j.Button,{size:"sm",secondary:!0,onClick:()=>F(!1),children:"Cancel"}),e.jsx(j.Button,{size:"sm",primary:!0,onClick:P,children:"Crop"})]})]})}),document.body)]})}),Sc=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,required:o=!1,...c})=>{var a,d,y;const i=c.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(ne,{condition:!!o,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ae,{children:c.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:c.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((a=c.tooltip)!=null&&a.label),children:e.jsx(Be.Tooltip,{label:(d=c.tooltip)==null?void 0:d.label,arrowPosition:(y=c.tooltip)==null?void 0:y.arrowPosition,...c.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!c.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(Ql,{...c.inputProps}),!i&&c.errorMessage&&e.jsx(Qe,{message:c.errorMessage})]})]})},kc=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var i,s,a;const c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ae,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:o.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(Be.Tooltip,{label:(s=o.tooltip)==null?void 0:s.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,...o.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),o.inputProps.extended&&o.inputProps.extended]})},Bc=({items:r,id:t,handleOnUpdate:l,width:n,toggleShow:o=!0,disabled:c=!1})=>{var y;const[i,s]=h.useState([]);h.useEffect(()=>{r&&s([...r.map(b=>({id:b.id,isActive:b.isActive}))])},[r]);const a=(y=i.find(b=>b.id===t))==null?void 0:y.isActive,d=h.useCallback(()=>{s(b=>b.map(p=>p.id===t?{...p,isActive:!p.isActive}:p)),l&&l(!a)},[t,l,a]);return e.jsx(u.Box,{direction:"row",gap:"md",style:{width:n},children:o&&e.jsx(ir.Toggle,{disabled:c,checked:a,onChange:d,label:a?"Active":"Inactive"})})},mc={InputText:Pn,InputDropdown:jn,InputSingleFile:uc,CheckBoxOptions:yc,RadioOptions:pc,InputTextArea:bc,ToggleForm:Cc,ActionButton:vc,FormTitle:xc,InputDate:wc,InputImgFile:Sc,Custom:kc},Ul=({customBottom:r})=>{const[t,l]=h.useState(!1),n=()=>{window.scrollY>window.screenY?l(!0):l(!1)},o=()=>{window.scrollTo({top:0,behavior:"smooth"})};return h.useEffect(()=>(window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}),[]),e.jsx(u.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(u.Box,{direction:"column",position:"absolute",style:{bottom:r||"1.6rem",right:"2rem",transform:t?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(j.Button,{secondary:!0,size:"xs",onClick:o,type:"button",iconLeft:e.jsx(M.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},Le="sa-sidepanel-item",Jl="sa-sidepanel-item-styles",Fc=`
58
- .${Le} {
57
+ `,document.head.appendChild(r)},vr=r=>r==="right"?"right":r==="center"?"center":"left",zn=/^(#|rgb|hsl|var\()/,zr=r=>r?zn.test(r)?r:`var(--sa-background-${r})`:void 0,Hn=(r,t)=>{if(t)return r[t]},Vn=(r,t)=>r==null&&t==null?0:r==null?-1:t==null?1:typeof r=="number"&&typeof t=="number"?r-t:String(r).localeCompare(String(t)),Pn=({columns:r,data:t,getRowKey:l,rowBg:n,size:o="md",resizable:c=!1,layout:i="auto",widthStorageKey:s,columnState:a,onColumnStateChange:d,columnMenu:y=!1,sort:b,defaultSort:p,onSortChange:x,height:L,mobileLayout:v="cards",mobileBreakpoint:T="md",groupSeparator:F,summary:O,footer:B,stickyFooter:D=!1,emptyState:H,loading:z=!1,loadingRows:S=8,rowActions:I,selectable:V=!1,selectedKeys:P,defaultSelectedKeys:Q,onSelectionChange:U,isRowSelectable:re})=>{An();const se=!pe.useMediaQuery(T)&&v!=="scroll",ee=!!(I!=null&&I.length),[G,X]=h.useState(null);h.useEffect(()=>{if(!G)return;const C=()=>X(null),w=setTimeout(()=>document.addEventListener("click",C),0);return()=>{clearTimeout(w),document.removeEventListener("click",C)}},[G]);const[de,xe]=h.useState(()=>new Set),ke=a!==void 0,[ye,Ce]=h.useState({}),we=a??ye,Ne=C=>{d==null||d(C),ke||Ce(C)},Oe=b!==void 0,[ve,Ve]=h.useState(p??null),Be=Oe?b??null:ve,Ie=!x,Pe=C=>{x==null||x(C),Oe||Ve(C)},{headerGroups:Ue,leafColumns:m,hasGroups:Z}=h.useMemo(()=>{var ie;const C=new Set(we.hidden??[]),w=(ce,ge)=>ce.key??(typeof ce.accessor=="string"?ce.accessor:`col-${ge}`),E=r.map((ce,ge)=>{var We;if((We=ce.children)!=null&&We.length){const Dr=ce.children.map((qe,Sr)=>({col:qe,key:w(qe,`${ge}-${Sr}`)})).filter(qe=>!C.has(qe.key));return{col:ce,key:ce.key??`group-${ge}`,isGroup:!0,leaves:Dr}}const ue={col:ce,key:w(ce,`${ge}`)};return{col:ce,key:ue.key,isGroup:!1,leaves:C.has(ue.key)?[]:[ue]}}).filter(ce=>ce.leaves.length>0),$=E.some(ce=>ce.isGroup);let le=E.flatMap(ce=>ce.leaves);if(!$&&((ie=we.order)!=null&&ie.length)){const ce=new Map(we.order.map((ge,ue)=>[ge,ue]));le=[...le].sort((ge,ue)=>(ce.get(ge.key)??1/0)-(ce.get(ue.key)??1/0))}return{headerGroups:E,leafColumns:le,hasGroups:$}},[r,we]),K=h.useMemo(()=>new Map(m.map((C,w)=>[C.key,w])),[m]),W=!Z&&m.some(C=>(C.col.headerColSpan??1)>1),J=m.map(C=>C.key).join("|"),_=(C,w)=>{const E=C.sortKey??(typeof C.accessor=="string"?C.accessor:void 0);return E?w[E]:void 0},Y=C=>C.sortable??(!!C.sortKey||typeof C.accessor=="string"),N=h.useMemo(()=>{if(!Ie||!Be)return t;const C=m.find(E=>E.key===Be.key);if(!C)return t;const w=Be.direction==="asc"?1:-1;return[...t].sort((E,$)=>Vn(_(C.col,E),_(C.col,$))*w)},[t,Ie,Be,m]),he=!Z&&!W,Ee=!!s&&he,[Ge,_e]=q.useColumnWidths(s??""),Le=Ee?Ge:void 0,Je=h.useRef(null),[De,Re]=h.useState();h.useLayoutEffect(()=>{Re(void 0)},[J]),h.useLayoutEffect(()=>{if(!he||De||!Je.current)return;const C=Je.current.querySelectorAll("th.sa-tl-leaf");Re(Array.from(C).map(w=>w.offsetWidth))},[De,he]);const[er,qr]=h.useState(0);h.useLayoutEffect(()=>{if(!Z||!Je.current)return;const C=Je.current.querySelector(":scope > tr");C&&qr(C.offsetHeight)},[Z,J]);const hr=(C,w)=>{if((Le==null?void 0:Le[w])!=null)return Le[w];if(C.width!=null)return C.width;if((De==null?void 0:De[w])!=null)return De[w]},wr=(C,w)=>typeof C.width=="number"?C.width:De==null?void 0:De[w],Ct=we.frozenKey&&!Z&&!W?m.findIndex(C=>C.key===we.frozenKey):-1,Rl=C=>C<=Ct,eo=V?Cr:0,ro=C=>{if(!De)return eo;let w=eo;for(let E=0;E<C;E++)w+=De[E]??0;return w},vt=h.useRef(null),[cs,ss]=h.useState("100vh");h.useLayoutEffect(()=>{if(L!==void 0)return;const C=()=>{if(vt.current){const w=vt.current.getBoundingClientRect().top;ss(`calc(100vh - ${w}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return C(),window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[L]);const Ye=(C,w)=>l?l(C,w):w,xt=P!==void 0,[to,is]=h.useState(()=>new Set(Q??[])),Xe=h.useMemo(()=>xt?new Set(P):to,[xt,P,to]);h.useEffect(()=>{V&&!l&&process.env.NODE_ENV!=="production"&&console.warn("[@starasia/admin] TableLayout: `selectable` tanpa `getRowKey` — key default (index) membuat seleksi menempel ke POSISI baris, bukan datanya. Beri `getRowKey` yang stabil (mis. r => r.id).")},[V,!l]);const lo=C=>{if(xt||is(C),U){const w=N.filter((E,$)=>C.has(Ye(E,$)));U(Array.from(C),w)}},wt=(C,w)=>V&&(re?re(C,w):!0),Dt=C=>{const w=new Set(Xe);w.has(C)?w.delete(C):w.add(C),lo(w)},fr=h.useMemo(()=>V?N.map((C,w)=>({row:C,i:w,key:Ye(C,w)})).filter(({row:C,i:w})=>re?re(C,w):!0).map(({key:C})=>C):[],[V,N,re,l]),oo=fr.filter(C=>Xe.has(C)),St=fr.length>0&&oo.length===fr.length,no=oo.length>0&&!St,as=()=>{const C=new Set(Xe);St?fr.forEach(w=>C.delete(w)):fr.forEach(w=>C.add(w)),lo(C)},kt=(C,w,E)=>C.render?C.render(w,E,N):Hn(w,C.accessor),Bt=m.length+(V?1:0)+(ee?1:0),co=["80%","55%","70%","45%","90%","60%"],ds=(C,w)=>co[(C*7+w*3)%co.length],hs=(C,w)=>e.jsx(ze.Skeleton,{height:14,width:ds(C,w),borderRadius:"rounded-sm"}),fs=Array.from({length:S},(C,w)=>e.jsxs(q.Tr,{children:[V&&e.jsx(q.Td,{style:{width:Cr,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(ze.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),m.map(({col:E,key:$},le)=>e.jsx(q.Td,{style:{textAlign:vr(E.align)},children:hs(w,le)},`sa-tl-sk-${w}-${$}`)),ee&&e.jsx(q.Td,{style:{width:1,padding:0,border:"none"}})]},`sa-tl-sk-${w}`)),gs=(C,w)=>{w||Ne({...we,hidden:[...we.hidden??[],C]})},us=C=>Ne({...we,frozenKey:we.frozenKey===C?void 0:C}),Zr=C=>(I??[]).filter(w=>{var E;return!((E=w.hidden)!=null&&E.call(w,C))}),so={position:"absolute",right:0,top:0,bottom:0,display:"flex",alignItems:"center",gap:4,paddingRight:16,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},Gr=(C,w,E,$)=>{var We;const le=(We=C.disabled)==null?void 0:We.call(C,w),ie=($==null?void 0:$.showLabel)??C.showLabel,ce=($==null?void 0:$.size)??"xs",ge=e.jsx(j.Button,{size:ce,variant:C.variant??"tertiary",tone:C.tone??"neutral",disabled:le,onClick:()=>C.onClick(w,E),iconLeft:C.icon?e.jsx(M.Icon,{name:C.icon,size:"sm"}):void 0,children:ie&&C.label}),ue=C.tooltip;return ue?e.jsx(me.Tooltip,{label:ue,position:"top-end",children:ge}):ge},ys=(C,w)=>{const E=Zr(C);if(!E.length)return null;if(E.length>5){const le=Ye(C,w),ie=(G==null?void 0:G.rowKey)===le;return e.jsx("div",{className:"sa-tl-row-actions",style:so,onClick:ce=>ce.stopPropagation(),children:e.jsx(me.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(j.Button,{size:"xs",variant:"tertiary",onClick:ce=>{const ge=ce.currentTarget.getBoundingClientRect();X(ie?null:{rowKey:le,top:ge.bottom+4,right:window.innerWidth-ge.right})},children:e.jsx(M.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:so,children:E.map(le=>e.jsx(h.Fragment,{children:Gr(le,C,w)},le.key))})},ps=(C,w)=>{const E=Zr(C);return E.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:br},children:E.map($=>e.jsx(h.Fragment,{children:Gr($,C,w,{showLabel:!0,size:"sm"})},$.key))}):null},bs=(C,w)=>{const E=Zr(C);return E.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:E.map($=>e.jsx(h.Fragment,{children:Gr($,C,w,{showLabel:!1})},$.key))}):null},mt=(C,w)=>{const{col:E,key:$}=C,le=K.get($)??0,ie=Rl(le),ce=ie&&le===Ct,ge=(Be==null?void 0:Be.key)===$?Be.direction:null,ue=y&&!E.disableMenu?e.jsx(Nl,{active:!!ge||ie,canSort:Y(E),canHide:!E.locked,sortDir:ge,frozen:ie,onSort:Sr=>Pe({key:$,direction:Sr}),onClearSort:()=>Pe(null),onToggleFreeze:()=>us($),onHide:()=>gs($,E.locked)}):null,We=E.align==="right",Dr=E.align==="right"?"flex-end":E.align==="center"?"center":"flex-start",qe=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:Dr,overflow:"hidden"},children:[E.icon&&e.jsx(M.Icon,{name:E.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:Ar,children:E.title})]});return e.jsx(q.Th,{className:`sa-tl-leaf${ie?" sa-tl-frozen":""}`,rowSpan:w==null?void 0:w.rowSpan,colSpan:w==null?void 0:w.colSpan,minWidth:E.minWidth,resizable:he?E.resizable:!1,defaultWidth:wr(E,le),style:{textAlign:vr(E.align),width:hr(E,le),position:"sticky",top:(w==null?void 0:w.top)??0,left:ie?ro(le):void 0,zIndex:ie?3:2,backgroundColor:dr,boxShadow:ce?_l:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:We?e.jsxs(e.Fragment,{children:[ue,qe]}):e.jsxs(e.Fragment,{children:[qe,ue]})})},`th-${$}`)},Cs=()=>{const C=[];for(let w=0;w<m.length;){const E=m[w],$=E.col.headerColSpan??1,le=Math.max(1,Math.min($,m.length-w));C.push(mt(E,le>1?{colSpan:le}:void 0)),w+=le}return C},io=C=>e.jsx(q.Th,{rowSpan:C==null?void 0:C.rowSpan,style:{width:Cr,position:"sticky",top:0,left:0,zIndex:4,backgroundColor:dr,padding:0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:w=>w.stopPropagation(),children:e.jsx(Ze.Checkbox,{size:"sm",variant:no?"indeterminate":"select",checked:St||no,disabled:fr.length===0,onChange:as,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),vs=(C,w,E)=>{const $=Ye(C,w);return e.jsx(q.Td,{className:"sa-tl-frozen",style:{width:Cr,padding:0,position:"sticky",left:0,zIndex:2,...E?{"--sa-tl-bg":E}:{}},children:wt(C,w)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:le=>le.stopPropagation(),children:e.jsx(Ze.Checkbox,{size:"sm",checked:Xe.has($),onChange:()=>Dt($),"aria-label":"Pilih baris"})})},`tl-select-${w}`)},Ft=m.filter(C=>!C.col.hideOnMobile),Et=Ft.find(C=>C.col.primary)??Ft[0],xs=Ft.filter(C=>C!==Et),ws=C=>xe(w=>{const E=new Set(w);return E.has(C)?E.delete(C):E.add(C),E}),ao=(C,w)=>xs.map(({col:E,key:$})=>{const le=kt(E,C,w),ie=typeof le=="string"||typeof le=="number"?e.jsx(k.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:le}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:le});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof E.title=="string"?e.jsx(k.Text,{color:"subtle",fontWeight:"medium",style:{color:Wn,flexShrink:0},children:E.title}):e.jsx("div",{style:{flexShrink:0},children:E.title}),ie]},$)}),Mt=(C,w)=>{const E=Et?kt(Et.col,C,w):null;return typeof E=="string"||typeof E=="number"?e.jsx(k.Text,{as:"span",style:Ar,children:E}):e.jsx("span",{style:Ar,children:E})},Ds=e.jsx(u.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:S},(C,w)=>e.jsxs(u.Box,{style:{border:br,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(ze.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(ze.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(ze.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${w}`))}),ho=e.jsx(u.Box,{fullWidth:!0,style:{minHeight:(H==null?void 0:H.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:H==null?void 0:H.content}),Ss=z?Ds:N.length===0?ho:v==="expand"?e.jsx(u.Box,{style:{display:"flex",flexDirection:"column"},children:N.map((C,w)=>{const E=Ye(C,w),$=de.has(E),ie=V&&Xe.has(E)?gt:zr(n==null?void 0:n(C,w));return e.jsxs("div",{style:{borderBottom:br,backgroundColor:ie},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[wt(C,w)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(Ze.Checkbox,{size:"sm",checked:Xe.has(E),onChange:()=>Dt(E),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>ws(E),style:{flex:1,minWidth:0,display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"10px 12px",background:"none",border:"none",font:"inherit",color:"inherit",cursor:"pointer",textAlign:"left"},children:[Mt(C,w),e.jsx(M.Icon,{name:$?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),ee&&bs(C,w)]}),$&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:ao(C,w)})]},E)})}):e.jsx(u.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:N.map((C,w)=>{const E=Ye(C,w),$=V&&Xe.has(E);return e.jsxs(u.Box,{style:{border:br,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:$?gt:zr(n==null?void 0:n(C,w))},children:[wt(C,w)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(Ze.Checkbox,{size:"sm",checked:Xe.has(E),onChange:()=>Dt(E),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:Mt(C,w)})]}):Mt(C,w),ao(C,w),ee&&ps(C,w)]},E)})}),ks=c&&he&&De!==void 0,fo=i==="fixed"&&!c&&(he?De!==void 0:!0),Bs=fo&&!he,Qr=B&&B.length>0?B.map((C,w)=>e.jsx(q.Tr,{children:C.cells.map((E,$)=>e.jsx(q.Td,{colSpan:E.colSpan,rowSpan:E.rowSpan,style:{textAlign:vr(E.align)},children:E.content},`tl-foot-${w}-${$}`))},`tl-foot-${w}`)):null,ms=e.jsxs(q.Table,{className:"sa-table-layout",fullWidth:!0,size:o,resizable:ks,style:fo?{tableLayout:"fixed"}:void 0,onWidthsChange:Ee?_e:void 0,children:[Bs&&e.jsxs("colgroup",{children:[V&&e.jsx("col",{style:{width:Cr}}),m.map(({col:C,key:w},E)=>e.jsx("col",{style:{width:hr(C,E)}},`col-${w}`)),ee&&e.jsx("col",{style:{width:1}})]}),e.jsx(q.Thead,{ref:Je,children:Z?e.jsxs(e.Fragment,{children:[e.jsxs(q.Tr,{children:[V&&io({rowSpan:2}),Ue.map(C=>C.isGroup?e.jsx(q.Th,{colSpan:C.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:dr},children:e.jsx("span",{style:Ar,children:C.col.title})},`grp-${C.key}`):mt(C.leaves[0],{rowSpan:2})),ee&&e.jsx(q.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:dr}})]}),e.jsx(q.Tr,{children:Ue.flatMap(C=>C.isGroup?C.leaves.map(w=>mt(w,{top:er})):[])})]}):e.jsxs(q.Tr,{children:[V&&io(),Cs(),ee&&e.jsx(q.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:dr}})]})}),e.jsx(q.Tbody,{children:z?fs:N.length===0?e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:Bt,children:ho})}):e.jsxs(e.Fragment,{children:[N.map((C,w)=>{const E=F==null?void 0:F(C,w,w>0?N[w-1]:void 0),le=V&&Xe.has(Ye(C,w))?gt:zr(n==null?void 0:n(C,w));return e.jsxs(h.Fragment,{children:[E!=null&&E!==!1&&e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:Bt,style:{backgroundColor:dr},children:E})}),e.jsxs(q.Tr,{children:[V&&vs(C,w,le),m.map(({col:ie,key:ce},ge)=>{var uo;const ue=(uo=ie.cellProps)==null?void 0:uo.call(ie,C,w,N);if(ue!=null&&ue.hidden)return null;const We=Rl(ge),Dr=We&&ge===Ct,qe=kt(ie,C,w),Sr=typeof ie.bg=="function"?ie.bg(C,w,N):ie.bg,go=zr(Sr)??le;return e.jsx(q.Td,{className:We?"sa-tl-frozen":void 0,colSpan:ue==null?void 0:ue.colSpan,rowSpan:ue==null?void 0:ue.rowSpan,style:{textAlign:vr(ie.align),width:hr(ie,ge),minWidth:ie.minWidth,position:We?"sticky":void 0,left:We?ro(ge):void 0,zIndex:We?1:void 0,boxShadow:Dr?_l:void 0,...go?{"--sa-tl-bg":go}:{}},children:typeof qe=="string"?e.jsx(k.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:vr(ie.align)},children:qe}):qe},`tl-cell-${w}-${ce}`)}),ee&&e.jsx(q.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:ys(C,w)})]})]},Ye(C,w))}),O!=null&&e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:Bt,children:O})})]})}),Qr&&e.jsx(q.Tfoot,{className:D?"sa-tl-sticky-foot":void 0,children:Qr})]}),Lt=G?N.findIndex((C,w)=>Ye(C,w)===G.rowKey):-1,Tt=Lt>=0?N[Lt]:null;return e.jsxs(e.Fragment,{children:[e.jsx(u.Box,{ref:vt,fullWidth:!0,style:{overflow:"auto",height:L??cs},children:se?e.jsxs(e.Fragment,{children:[Ss,Qr&&!z&&N.length>0&&e.jsx(u.Box,{style:{borderTop:br},children:e.jsx(q.Table,{fullWidth:!0,size:o,className:"sa-table-layout",children:e.jsx(q.Tbody,{children:Qr})})})]}):ms}),G&&Tt&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:G.top,right:G.right},onClick:C=>C.stopPropagation(),children:Zr(Tt).map(C=>e.jsx("div",{style:{padding:"2px 4px"},children:Gr(C,Tt,Lt,{showLabel:!0,size:"sm"})},C.key))})]})},ut=r=>r==="asc"||r==="desc",jn=(r={})=>{const{sortKeyParam:t="sortBy",sortOrderParam:l="sortOrder",pageKey:n="page",defaultSort:o=null,paramKeys:c,scopeId:i,storage:s=ct}=r,{searchParams:a,setSearchParams:d,searchQueries:y}=Me(),b=a.toString(),p=i?ar.tableSort(i):void 0,x=h.useRef(!1);h.useEffect(()=>{if(x.current||(x.current=!0,!p)||a.has(t)||a.has(l))return;const B=s.get(p);!(B!=null&&B.key)||!ut(B.direction)||d({...Object.fromEntries(a.entries()),[t]:B.key,[l]:B.direction})},[]);const L=h.useMemo(()=>{const B=a.get(t),D=a.get(l);return B&&ut(D)?{key:B,direction:D}:o},[b,t,l,o]);h.useEffect(()=>{if(!p)return;const B=a.get(t),D=a.get(l);B&&ut(D)?s.set(p,{key:B,direction:D}):s.remove(p)},[b,p,t,l,s]);const v=(c==null?void 0:c.sortBy)??"sortBy",T=(c==null?void 0:c.sortOrder)??"sortOrder",F=h.useMemo(()=>L?{[v]:L.key,[T]:L.direction}:{},[L,v,T]),O=h.useCallback(B=>{const D={...y};B?(D[t]=B.key,D[l]=B.direction):(delete D[t],delete D[l]),delete D[n],d(D)},[y,t,l,n,d]);return{sort:L,setSort:O,params:F}},Hr=({of:r,render:t})=>h.Children.toArray(r==null?void 0:r.map((l,n,o)=>t(l,n,o))),ne=({condition:r,fallback:t,children:l,loading:n,isLoading:o})=>e.jsx(e.Fragment,{children:o?n:r?l:t}),ae=r=>e.jsx(k.Text,{...r,fontFamily:"Poppins",fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),Qe=r=>e.jsx(k.Text,{color:"red-600",fontSize:"sm",children:r.message}),Nn=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var s,a,d;const c=o.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ae,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:o.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((s=o.tooltip)!=null&&s.label),children:e.jsx(me.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(u.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(Ke.Input,{ref:o.inputRef,size:r,...o.inputProps,status:o.errorMessage?"error":"default",fullWidth:!0}),!c&&o.errorMessage&&e.jsx(Qe,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},_n=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var s,a,d;const c=o.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ae,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:o.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((s=o.tooltip)!=null&&s.label),children:e.jsx(me.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(u.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(u.Box,{direction:"column",style:{width:o.inputProps.fullWidth?"100%":t==="horizontal"&&o.customWidth?o.customWidth:t==="horizontal"?"343px":""},children:e.jsx(nr.Dropdown,{size:r,...o.inputProps,error:!!o.errorMessage})}),!c&&o.errorMessage&&e.jsx(Qe,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},qn=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",Zn=r=>{var s;const[t,l]=h.useState(!1),n=a=>{a.preventDefault(),a.stopPropagation()},o=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&r.handleOnFileChange(a.dataTransfer.files.item(0))},c=a=>{a.preventDefault(),l(!0)},i=a=>{a.preventDefault(),l(!1)};return e.jsxs(u.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:r.handleOnClick,onDragOver:n,onDrop:o,onDragEnter:c,onDragLeave:i,paddingBlock:"md",borderRadius:"rounded-md",style:{border:t?"1px solid var(--sa-border-info)":`1px solid ${qn(r.errorMessage,r.status)}`},children:[e.jsx(M.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",children:[e.jsx(k.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(k.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",children:(s=r.fileSupports)==null?void 0:s.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function Gn(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const Zl=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},Qn=r=>{const t={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},l=r.split(" ");if(l.length!==3)return null;const n=parseInt(l[0],10),o=t[l[1]],c=parseInt(l[2],10);return isNaN(n)||isNaN(o)||isNaN(c)?null:new Date(c,o,n)};function Un(r,t=!0){if(!r)return"Rp 0";const l=typeof r=="number"?r.toString():r;if(isNaN(Number(l)))return"Rp 0";const n=l.split("."),o=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),c=n.length===2?o+"."+n[1]:o;return t?"Rp"+c:c}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},String.prototype.toNumber=function(){return Number(this)};const Jn=r=>{const t=r.split(" ");let l=t[0].charAt(0);return t.length>1&&(l+=""+t[1].charAt(0)),l.toUpperCase()};function Yn(r){const t=typeof r=="string"?new Date(r):r;if(isNaN(t.getTime()))throw new Error("Invalid date format");const l=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return`${l}-${n}-${o}`}const Xn="sa-admin",je=r=>`var(--${Xn}-${r})`,$n={base:{borderColor:je("base-border-color"),textColor:je("base-text-color"),iconColor:je("base-icon-color"),placeholderColor:je("base-placeholder-color")},document:{bgColor:je("document-bg-color")},sidebar:{bgColor:je("sidebar-bg-color"),borderColor:je("sidebar-border-color"),maxWidth:je("sidebar-max-width"),width:je("sidebar-width"),collapseWidth:je("sidebar-collapse-width"),collapseV2Width:je("sidebar-v2-collapse-width")}},Kn=24*60*60*1e3,Rn=r=>{const t="14px poppins",n=document.createElement("canvas").getContext("2d");n.font=t;const o=n.measureText(r).width;return Number(Math.ceil(o))},ec=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,rc=/--+/,tc=/-$/;function lc(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function oc(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function nc(r){return/^[A-Za-z\s]+$/.test(r)}const cc=r=>{const t=/^[0-9]$/,l=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&(r.key==="a"||r.key==="c"||r.key==="v")||!t.test(r.key)&&!l.includes(r.key)&&r.preventDefault()},sc=r=>{const t=/^[0-9]$/,l=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||t.test(r.key)&&!l.includes(r.key)&&r.preventDefault()},ic=r=>{const t=/^[0-9.]$/,l=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||!t.test(r.key)&&!l.includes(r.key)&&r.preventDefault()},ac=r=>ec.test(r);function dc(r){return!(rc.test(r)||tc.test(r))}const hc=r=>{const t=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((r.ctrlKey||r.metaKey)&&["a","c","v","x"].includes(r.key.toLowerCase()))return;const l=r.currentTarget.value;/^[0-9]$/.test(r.key)||r.key==="."&&!l.includes(".")||r.key==="-"&&l.length===0&&!l.includes("-")||t.includes(r.key)||r.preventDefault()},fc=r=>{const t=document.getElementById(r);if(t){const l=t.getBoundingClientRect(),n=window.scrollY+l.top-80;window.scrollTo({top:n,behavior:"smooth"})}};function gc(r){const t=r.toLowerCase();if(["kb","mb","gb"].find(c=>t.endsWith(c)))return r;const o=Number(r);if(isNaN(o))throw new Error("Invalid size format");return o>=1e6?`${(o/1e6).toFixed(2)}MB`:o>=1e3?`${(o/1e3).toFixed(2)}KB`:`${o}B`}function uc(r){const t=r.split("/");return t[t.length-1]}const yc=r=>{var t,l;return e.jsxs(u.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:r.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(oe.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(M.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(oe.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(k.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?uc(r.defaultFile.url):(t=r.fileSelected)==null?void 0:t.name}),r.defaultFile?(r.defaultFile.size||r.defaultFile.date)&&e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[r.defaultFile.size&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",children:r.defaultFile.size}),r.defaultFile.size&&r.defaultFile.date&&e.jsx(M.Icon,{name:"Dot",size:"xs"}),r.defaultFile.date&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:r.defaultFile.date})]}):e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",children:gc(((l=r.fileSelected)==null?void 0:l.size.toString())||"100000")}),e.jsx(M.Icon,{name:"Dot",size:"xs"}),e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:Zl(new Date)})]})]})]}),e.jsx(j.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:n=>{n.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(M.Icon,{name:"Trash1"})})]})},Gl=({status:r="default",labelPosition:t="outside-top",...l})=>{var p;const n=h.useRef(null),o=()=>{if(l.defaultFile){window.open(l.defaultFile.url);return}n.current&&n.current.click()},c=pe.useMediaQuery("md"),i=r==="error"||typeof l.errorMessage=="string"&&!!l.errorMessage,s=l.label?e.jsxs(oe.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(k.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:l.label}),l.optional&&e.jsx("span",{style:{background:"var(--sa-background-neutral)",border:"1px solid var(--sa-border-subtle)",borderRadius:"4px",padding:"0 8px",fontSize:"10px",fontWeight:500,lineHeight:"18px",color:"var(--sa-text-primary)",display:"inline-flex",alignItems:"center"},children:"Optional"}),l.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=l.description?e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:l.description}):null,d=e.jsxs(e.Fragment,{children:[l.helperText&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:l.helperText}),l.errorText&&r==="error"&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:l.errorText}),l.errorMessage&&!l.errorText&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:l.errorMessage})]}),y=e.jsx("input",{type:"file",style:{display:"none"},ref:n,onChange:x=>{var L;return l.handleOnChangeFile(((L=x.target.files)==null?void 0:L.item(0))||null)},accept:(p=l.fileSupportOption)==null?void 0:p.map(x=>"."+(x==null?void 0:x.toLowerCase())).join(", ")}),b=e.jsxs(u.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...l.containerProps,children:[y,(l.fileSelected||l.defaultFile)&&e.jsx(yc,{fileSelected:l.fileSelected,defaultFile:l.defaultFile,handleOnDeleteFile:l.handleOnDeleteFile,handleOnClickFile:o}),!l.fileSelected&&!l.defaultFile&&e.jsx(Zn,{fileSupports:l.fileSupportOption,isDesktop:c,errorMessage:i?l.errorText||l.errorMessage||" ":void 0,status:i?"error":"default",handleOnClick:o,handleOnFileChange:l.handleOnChangeFile})]});return t==="outside-left"?e.jsxs(oe.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(oe.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[s,a]}),e.jsxs(oe.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[b,d]})]}):e.jsxs(oe.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[s,a,b,d]})},pc=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var s,a,d;const c=o.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ae,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:o.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((s=o.tooltip)!=null&&s.label),children:e.jsx(me.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(Gl,{...o.inputProps,status:o.errorMessage?"error":"default"}),!c&&o.errorMessage&&e.jsx(Qe,{message:o.errorMessage})]})]})},bc=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,required:o=!1,...c})=>{var a,d,y,b;const i=c.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"||t==="horizontal-inline"?"spacing-96":"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(ne,{condition:!!o,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ae,{children:c.title}),e.jsx(He.Body3,{props:{color:"gray-500"},children:c.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:c.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((a=c.tooltip)!=null&&a.label),children:e.jsx(me.Tooltip,{label:(d=c.tooltip)==null?void 0:d.label,arrowPosition:(y=c.tooltip)==null?void 0:y.arrowPosition,...c.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!c.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})})]})}),e.jsx(u.Box,{gap:t==="horizontal-inline"?"xl":"md",direction:t==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(Hr,{of:(b=c.checkBoxesList)==null?void 0:b.map(p=>({...p,isChecked:c.checkBoxesAreChecked.includes(p.id)})),render:p=>p.renderBadge?e.jsxs(u.Box,{direction:"row",justify:"space-between",gap:"lg",...c.badgeContainerProps,children:[e.jsx(Ze.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:x=>c.onChecked(x.target.value,p),label:p.name,description:p.description}),p.renderBadge]}):e.jsx(Ze.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:x=>c.onChecked(x.target.value,p),label:p.name,description:p.description})})}),!i&&c.errorMessage&&e.jsx(Qe,{message:c.errorMessage})]})},Cc=({position:r="vertical",size:t="md",fullWidth:l=!1,...n})=>{var c;const o=r==="horizontal-inline"||r==="horizontal-block"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:r==="horizontal-inline"||r==="horizontal-block"?"spacing-96":"sm",direction:r==="horizontal-inline"||r==="horizontal-block"?"row":"column",children:[e.jsx(ne,{condition:!!n.description||!!n.title,children:e.jsxs(u.Box,{direction:"column",customMaxWidth:o,fullWidth:l,children:[n.title&&e.jsx(ae,{children:n.title}),e.jsx(ne,{condition:!!n.description,children:e.jsx(k.Text,{color:"gray-500",children:n.description})})]})}),e.jsx(u.Box,{gap:"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(Hr,{of:(c=n.radioList)==null?void 0:c.map(i=>({...i,isChecked:n.radioIsChecked===i.id})),render:({value:i,id:s,isChecked:a,subInput:d,label:y,description:b})=>e.jsxs(u.Box,{direction:"column",gap:"xs",customMaxWidth:o,children:[e.jsx(Jr.Radio,{id:`${s.toString()}-${i}`,name:n.groupName||y,label:y,value:i,checked:a,onChange:p=>n.onChecked({id:s,label:p.target.name,value:p.target.value}),disabled:n.disableAll},s),b&&e.jsx(k.Text,{color:"gray-500",style:{marginLeft:28},children:b}),d]})})}),n.errorMessage&&e.jsx(Qe,{message:n.errorMessage})]})},vc=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var s,a,d;const c=o.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ae,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:o.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((s=o.tooltip)!=null&&s.label),children:e.jsx(me.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(Ur.Textarea,{ref:o.inputRef,size:r,...o.inputProps,status:o.errorMessage?"error":"default"}),!c&&o.errorMessage&&e.jsx(Qe,{message:o.errorMessage})]})]})},xc=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",required:n=!1,fullWidth:o=!1,...c})=>{var s,a,d;const i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(ne,{condition:n,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:o,children:[e.jsx(ae,{children:c.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.titleDescription})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:o,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:c.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((s=c.tooltip)!=null&&s.label),children:e.jsx(me.Tooltip,{label:(a=c.tooltip)==null?void 0:a.label,arrowPosition:(d=c.tooltip)==null?void 0:d.arrowPosition,...c.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!c.titleDescription,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.titleDescription})})]})}),e.jsx(ir.Toggle,{checked:c.checked,onChange:c.onChange,label:c.label,description:c.description}),c.errorMessage&&e.jsx(Qe,{message:c.errorMessage})]})},wc=({variant:r="primary",size:t="md",...l})=>{const n=sr.useColor(),o=i=>{var a,d,y,b,p,x;if(!i)return;const s=l.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary"?"var(--sa-text-subtle, #8c8f97)":r==="secondary-danger"?(d=(a=n==null?void 0:n.computed)==null?void 0:a.red)==null?void 0:d[600]:r==="secondary-primary"?(b=(y=n==null?void 0:n.computed)==null?void 0:y.blue)==null?void 0:b[700]:(x=(p=n==null?void 0:n.computed)==null?void 0:p.gray)==null?void 0:x[50];return e.jsx(M.Icon,{name:i,size:t,style:{color:s}})},c=()=>{var s,a,d,y;if(r!=="secondary-danger"&&r!=="secondary-primary")return l.title;const i={color:l.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary-danger"?(a=(s=n==null?void 0:n.computed)==null?void 0:s.red)==null?void 0:a[600]:(y=(d=n==null?void 0:n.computed)==null?void 0:d.blue)==null?void 0:y[700]};switch(t){case"xs":return e.jsx(He.Body2,{props:{style:i},children:l.title});case"sm":case"md":return e.jsx(He.SubH3,{props:{style:i},children:l.title});case"lg":return e.jsx(He.SubH2,{props:{style:i},children:l.title});default:return l.title}};return e.jsx(j.Button,{fullWidth:!0,disabled:l.disabled,primary:r==="primary",secondary:r==="secondary"||r==="secondary-danger"||r==="secondary-primary",success:r==="success",onClick:l.onClick,type:l.type,iconLeft:o(l.iconLeft),iconRight:o(l.iconRight),size:t,children:c()})},Dc=r=>e.jsx(He.H5,{props:{...r},children:r.title}),Sc=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var s,a,d;const c=o.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ae,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:o.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((s=o.tooltip)!=null&&s.label),children:e.jsx(me.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(u.Box,{direction:"column",style:{width:t==="horizontal"&&o.customWidth?o.customWidth:t==="horizontal"?"343px":""},children:e.jsx(rr.StarasiaDate,{size:r,...o.inputProps,status:o.errorMessage?"error":void 0})}),!c&&o.errorMessage&&e.jsx(Qe,{message:o.errorMessage})]})]})};async function kc(r,t){const l=new Image;l.src=r,await new Promise((c,i)=>{l.onload=c,l.onerror=i});const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const o=n.getContext("2d",{alpha:!0});if(!o)throw new Error("No 2D context");return o.drawImage(l,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((c,i)=>{n.toBlob(s=>{if(!s)return i("Canvas is empty");const a=new File([s],"cropped.png",{type:"image/png"});c(a)},"image/png")})}const Ql={"1:1":1,"4:3":4/3,"16:9":16/9,"3:4":3/4,"9:16":9/16,"2:3":2/3,"3:2":3/2,"32:9":32/9},Ul=h.forwardRef(({handleUpload:r,urlImage:t,isUploading:l,croppedImage:n,setCroppedImage:o,size:c="96",aspect:i="1:1",containerProps:s,maxFileSize:a=2,onError:d},y)=>{const b=pe.useMediaQuery("md"),[p,x]=h.useState(!1),[L,v]=h.useState(null),[T,F]=h.useState(!1),[O,B]=h.useState({x:0,y:0}),[D,H]=h.useState(1),[z,S]=h.useState(null);h.useEffect(()=>{t===null&&o(null)},[t]);const I=h.useCallback((G,X)=>{S(X)},[]),V=G=>{var xe;const X=(xe=G.target.files)==null?void 0:xe[0];if(!X)return;const de=new FileReader;de.onload=()=>{v(de.result),F(!0)},de.readAsDataURL(X)},P=async()=>{if(!(!L||!z))try{const G=await kc(L,z);if(a&&G.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}r==null||r(G);const X=URL.createObjectURL(G);o(X,G),F(!1)}catch{d==null||d("Gagal memproses gambar")}},Q=h.useRef(null),U=()=>{Q.current&&Q.current.click()};h.useImperativeHandle(y,()=>({openFileDialog:()=>{var G;(G=Q.current)==null||G.click()}}));const re=parseInt(c,10),fe=Ql[i];let se,ee;return fe>=1?(ee=re,se=re*fe):(se=re,ee=re/fe),e.jsxs(u.Box,{direction:"column",display:"flex",position:"relative",bg:(s==null?void 0:s.bg)||"gray-200",borderStyle:(s==null?void 0:s.borderStyle)||"border-none",borderColor:(s==null?void 0:s.borderColor)||"gray-200",borderWidth:(s==null?void 0:s.borderWidth)||"border-2",borderRadius:(s==null?void 0:s.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:s!=null&&s.fullWidth?"100%":`${se}px`,height:s!=null&&s.fullWidth?"auto":`${ee}px`,aspectRatio:fe,flexShrink:0},onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:[n||t?e.jsx("img",{src:n||t||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(u.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(M.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(c)/2<40?Number(c)/2:40,height:Number(c)/2<40?Number(c)/2:40}})}),e.jsxs(u.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",cursor:"pointer",style:{inset:0,backgroundColor:"var(--sa-color-black-alpha-a30, #080f214a)",opacity:p?1:0,transition:"opacity 0.3s ease-in-out"},onClick:U,children:[e.jsx("input",{ref:Q,type:"file",accept:"image/*",onChange:V,disabled:l,style:{display:"none"}}),e.jsxs(u.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(M.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(ne,{condition:c.toNumber()>80,children:e.jsx(k.Text,{color:"gray-50",fontSize:c.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),l&&e.jsx(u.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",style:{inset:0,zIndex:20,backgroundColor:"var(--sa-color-white-alpha-a80, #e5e9f640)"},children:e.jsx(u.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),T&&Yr.createPortal(e.jsx("div",{style:{position:"fixed",inset:0,zIndex:19999,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.6)"},onClick:()=>F(!1),children:e.jsxs("div",{style:{backgroundColor:"var(--sa-background-primary)",borderRadius:"var(--sa-radii-md)",boxShadow:"0 20px 60px rgba(0,0,0,0.3)",overflow:"hidden",width:b?i==="1:1"?"min(90vw, 480px)":`min(90vw, ${se*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:G=>G.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:L&&e.jsx(yo,{image:L,crop:O,zoom:D,aspect:i?Ql[i]:void 0,onCropChange:B,onZoomChange:H,onCropComplete:I,objectFit:"contain",minZoom:.5,restrictPosition:!1})}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem",padding:"0.75rem 1rem",borderTop:"1px solid var(--sa-border-subtle)"},children:[e.jsx(j.Button,{size:"sm",secondary:!0,onClick:()=>F(!1),children:"Cancel"}),e.jsx(j.Button,{size:"sm",primary:!0,onClick:P,children:"Crop"})]})]})}),document.body)]})}),Bc=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,required:o=!1,...c})=>{var a,d,y;const i=c.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(ne,{condition:!!o,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ae,{children:c.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:c.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((a=c.tooltip)!=null&&a.label),children:e.jsx(me.Tooltip,{label:(d=c.tooltip)==null?void 0:d.label,arrowPosition:(y=c.tooltip)==null?void 0:y.arrowPosition,...c.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!c.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(Ul,{...c.inputProps}),!i&&c.errorMessage&&e.jsx(Qe,{message:c.errorMessage})]})]})},mc=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var i,s,a;const c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ae,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:o.title}),e.jsx(ae,{color:"error",fontSize:r,children:l}),e.jsx(ne,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(s=o.tooltip)==null?void 0:s.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,...o.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),o.inputProps.extended&&o.inputProps.extended]})},Fc=({items:r,id:t,handleOnUpdate:l,width:n,toggleShow:o=!0,disabled:c=!1})=>{var y;const[i,s]=h.useState([]);h.useEffect(()=>{r&&s([...r.map(b=>({id:b.id,isActive:b.isActive}))])},[r]);const a=(y=i.find(b=>b.id===t))==null?void 0:y.isActive,d=h.useCallback(()=>{s(b=>b.map(p=>p.id===t?{...p,isActive:!p.isActive}:p)),l&&l(!a)},[t,l,a]);return e.jsx(u.Box,{direction:"row",gap:"md",style:{width:n},children:o&&e.jsx(ir.Toggle,{disabled:c,checked:a,onChange:d,label:a?"Active":"Inactive"})})},Ec={InputText:Nn,InputDropdown:_n,InputSingleFile:pc,CheckBoxOptions:bc,RadioOptions:Cc,InputTextArea:vc,ToggleForm:xc,ActionButton:wc,FormTitle:Dc,InputDate:Sc,InputImgFile:Bc,Custom:mc},Jl=({customBottom:r})=>{const[t,l]=h.useState(!1),n=()=>{window.scrollY>window.screenY?l(!0):l(!1)},o=()=>{window.scrollTo({top:0,behavior:"smooth"})};return h.useEffect(()=>(window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}),[]),e.jsx(u.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(u.Box,{direction:"column",position:"absolute",style:{bottom:r||"1.6rem",right:"2rem",transform:t?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(j.Button,{secondary:!0,size:"xs",onClick:o,type:"button",iconLeft:e.jsx(M.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},Te="sa-sidepanel-item",Yl="sa-sidepanel-item-styles",Mc=`
58
+ .${Te} {
59
59
  display: block;
60
60
  box-sizing: border-box;
61
61
  width: 100%;
@@ -70,39 +70,39 @@
70
70
  outline: none;
71
71
  transition: background-color 140ms ease, box-shadow 140ms ease;
72
72
  }
73
- .${Le}[data-divider="true"] {
73
+ .${Te}[data-divider="true"] {
74
74
  border-bottom: 1px solid var(--sa-border-subtle, #0b120e24);
75
75
  }
76
76
  /* The first row also gets a top line so the list is bounded on its own,
77
77
  without relying on a wrapping container's border. Adjacent rows still
78
78
  share a single 1px line (only border-bottom), never a doubled 2px one. */
79
- .${Le}[data-divider="true"]:first-child {
79
+ .${Te}[data-divider="true"]:first-child {
80
80
  border-top: 1px solid var(--sa-border-subtle, #0b120e24);
81
81
  }
82
- .${Le}:hover {
82
+ .${Te}:hover {
83
83
  background: var(--sa-background-neutral, #f0f1f2);
84
84
  }
85
- .${Le}:focus-visible,
86
- .${Le}[data-active="true"] {
85
+ .${Te}:focus-visible,
86
+ .${Te}[data-active="true"] {
87
87
  background: var(--sa-background-brand-subtlest, #e6edf6);
88
88
  }
89
- .${Le}:focus-visible {
89
+ .${Te}:focus-visible {
90
90
  background: var(--sa-background-neutral, #f0f1f2);
91
91
  }
92
92
  /* Accent bar — sign of the offset picks the edge it hugs. */
93
- .${Le}[data-accent="left"]:focus-visible,
94
- .${Le}[data-accent="left"][data-active="true"] {
93
+ .${Te}[data-accent="left"]:focus-visible,
94
+ .${Te}[data-accent="left"][data-active="true"] {
95
95
  box-shadow: inset 3.5px 0 0 0 var(--sa-border-focused, #1a4fa0);
96
96
  }
97
- .${Le}[data-accent="right"]:focus-visible,
98
- .${Le}[data-accent="right"][data-active="true"] {
97
+ .${Te}[data-accent="right"]:focus-visible,
98
+ .${Te}[data-accent="right"][data-active="true"] {
99
99
  box-shadow: inset -3.5px 0 0 0 var(--sa-border-focused, #1a4fa0);
100
100
  }
101
- .${Le}[data-active="true"]:hover {
101
+ .${Te}[data-active="true"]:hover {
102
102
  background: var(--sa-background-brand-subtlest, #e6edf6);
103
103
  }
104
- .${Le}:disabled {
104
+ .${Te}:disabled {
105
105
  cursor: not-allowed;
106
106
  opacity: 0.55;
107
107
  }
108
- `;function Ec(){if(typeof document>"u"||document.getElementById(Jl))return;const r=document.createElement("style");r.id=Jl,r.textContent=Fc,document.head.appendChild(r)}const Mc=({active:r=!1,accentSide:t="left",onClick:l,title:n,badge:o,heading:c,meta:i,children:s,divider:a=!0,disabled:d,className:y,style:b,"aria-label":p})=>(h.useEffect(Ec,[]),e.jsx("button",{type:"button",className:[Le,y].filter(Boolean).join(" "),"data-active":r?"true":"false","data-accent":t,"data-divider":a?"true":"false","aria-current":r?"true":void 0,"aria-label":p,disabled:d,onClick:l,style:b,children:s??e.jsxs(u.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(n||o)&&e.jsxs(oe.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[n?e.jsx(k.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:n}):e.jsx("span",{}),o?e.jsx(u.Box,{style:{flexShrink:0},children:o}):null]}),c?e.jsx(k.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:c}):null,i?e.jsx(k.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:i}):null]})})),yt=18,Lc=40,Yl="280ms cubic-bezier(0.4, 0, 0.2, 1)",Xl="var(--sa-border-subtle, #0b120e24)",Tc=`1px solid ${Xl}`,Kl="var(--sa-background-white, #ffffff)",Ic=({children:r,header:t,collapsed:l,defaultCollapsed:n=!1,onToggle:o,width:c=337,side:i="left",offsetTop:s="4rem",height:a,showToggle:d=!0,togglePosition:y="top",toggleOffset:b=40,toggleLabel:p,style:x,bodyStyle:I,className:v,pageLayout:T,overlay:F="mobile",wrapperProps:O,contentProps:B})=>{const D=pe.useMediaQuery("md"),H=l!==void 0,[z,S]=h.useState(n),L=H?l:z,V=()=>{const he=!L;H||S(he),o==null||o(he)},P=i==="left",Z=typeof s=="number"?`${s}px`:s,Y=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${Z})`,te=p??{collapse:"Collapse panel",expand:"Expand panel"},fe=y==="center"?{top:"50%",transform:"translateY(-50%)"}:y==="bottom"?{bottom:b}:{top:b},de=L?P?"ChevronRight":"ChevronLeft":P?"ChevronLeft":"ChevronRight",ee=T!==void 0&&(F==="mobile"?!D:F),Q=ee?{position:"absolute",top:0,bottom:0,width:c,transform:`translateX(${L?P?"-100%":"100%":"0"})`,transition:`transform ${Yl}`,zIndex:50,...P?{left:0}:{right:0},...x}:{position:"sticky",top:Z,alignSelf:"flex-start",width:L?0:c,flexShrink:0,height:Y,transition:`width ${Yl}`,...x},X=e.jsxs(u.Box,{className:v,style:Q,children:[e.jsx(u.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:L?void 0:P?"border-solid-r":"border-solid-l",borderWidth:L?void 0:P?"border-r":"border-l",style:{backgroundColor:Kl,borderColor:Xl},children:e.jsxs(u.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:c,customMinWidth:c,style:P?void 0:{marginLeft:"auto"},children:[t?e.jsx(u.Box,{padding:"md",style:{flexShrink:0},children:t}):null,e.jsx(u.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...I},children:r})]})}),d&&e.jsx(yr,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:V,"aria-label":L?te.expand:te.collapse,"aria-expanded":!L,"aria-pressed":L,customWidth:yt,customHeight:Lc,style:{...fe,backgroundColor:Kl,border:Tc,zIndex:5,...P?{right:-yt,borderLeft:"none",borderRadius:"0 8px 8px 0"}:{left:-yt,borderRight:"none",borderRadius:"8px 0 0 8px"}},children:e.jsx(M.Icon,{name:de,size:"sm"})})]});return T===void 0?X:e.jsxs(u.Box,{direction:"row",position:"relative",...O,style:{height:`calc(100vh - ${Z})`,overflow:"hidden",...(O==null?void 0:O.style)??{}},children:[!ee&&P?X:null,e.jsx(u.Box,{display:"block",...B,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(B==null?void 0:B.style)??{}},children:T}),!ee&&!P?X:null,ee&&e.jsxs(e.Fragment,{children:[!L&&e.jsx("div",{onClick:V,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),X]})]})},Oc=({pageLayout:r,children:t,wrapperProps:l,containerProps:n})=>{const o=pe.useMediaQuery("md"),c=(n==null?void 0:n.customWidth)??264;return e.jsxs(u.Box,{display:"block",direction:"row",...l,style:{marginRight:o?c:24,...(l==null?void 0:l.style)??{}},children:[r,e.jsx(u.Box,{direction:"column",show:"desktop",as:"aside",position:"fixed",top:"top-0",bottom:"bottom-0",right:"right-0",customWidth:264,borderStyle:"border-solid-l",borderWidth:"border-l",...n,style:{marginTop:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(n==null?void 0:n.style)??{}},children:t})]})},pt="--sa-floating-footer-height",Wc=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:l,containerProps:n})=>{const o=h.useRef(null);return h.useLayoutEffect(()=>{const c=document.documentElement,i=()=>{var d;const a=((d=o.current)==null?void 0:d.getBoundingClientRect().height)??0;c.style.setProperty(pt,`${a}px`)};i();const s=new ResizeObserver(i);return o.current&&s.observe(o.current),()=>{s.disconnect(),c.style.removeProperty(pt)}},[]),e.jsx(u.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 998)"},children:e.jsxs(u.Box,{ref:o,position:"fixed",bottom:"bottom-0",right:"right-0",bg:"white",direction:"row",align:"center",display:"flex",paddingBlock:"sm",paddingInline:"md",borderColor:"border-subtle",style:{left:"var(--app-sidebar-width, 0px)",transition:"left 0.3s ease-in-out"},justify:(n==null?void 0:n.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[t&&e.jsx(Ul,{...l,customBottom:(l==null?void 0:l.customBottom)||"5.7rem"}),r]})})},Ac=({fields:r})=>e.jsx(u.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(Hr,{of:r,render:(t,l)=>e.jsx(zc,{...t},l)})}),zc=({title:r,value:t,icon:l})=>e.jsxs(u.Box,{display:"flex",direction:"column",gap:"sm",children:[l?e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(M.Icon,{name:l,color:"subtle"}),e.jsx(k.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(k.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(k.Text,{variant:"sub-h3",children:t}):t]}),De={silhouette:"#A7B0AC",accent:"#78867F"};function Hc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r||"100",height:t||"90",viewBox:"0 0 102 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M51.0002 16.8145C36.0811 16.8145 24.8296 21.3801 24.8296 27.4328V76.5344C24.8296 82.573 36.0799 87.127 51.0002 87.127C65.9204 87.127 77.1707 82.573 77.1707 76.5344V27.4328C77.1707 21.3801 65.9204 16.8145 51.0002 16.8145ZM51.0002 19.1582C65.0602 19.1582 74.8582 23.5187 74.8582 27.4328C74.8582 30.1363 70.1615 32.9664 63.1708 34.4746C55.861 36.0543 46.1416 36.0543 38.8318 34.4746C31.8399 32.9664 27.1432 30.1363 27.1432 27.4328C27.1432 23.5187 36.9402 19.1582 51.0002 19.1582ZM74.8582 31.9199V43.784C74.8582 46.532 70.3142 49.2941 63.2737 50.8328C63.2391 50.8375 63.2032 50.8434 63.1697 50.8504C57.6867 52.0352 50.8498 52.3305 44.6893 51.7387C42.6358 51.5418 40.6575 51.2453 38.8306 50.8504C38.8029 50.8445 38.7682 50.8387 38.7347 50.8352C32.5707 49.4898 28.318 47.2047 27.3514 44.8141C27.2138 44.4719 27.1421 44.1285 27.1421 43.7852V31.9199C27.1999 31.9715 27.2693 32.0207 27.3294 32.0723C27.5052 32.2246 27.6902 32.3758 27.8844 32.5234C27.9954 32.609 28.1064 32.6934 28.2232 32.7766C28.4371 32.9301 28.6637 33.0801 28.8973 33.2289C29.0083 33.2992 29.1135 33.3719 29.2291 33.441C29.5702 33.6473 29.9275 33.8488 30.3044 34.0434C30.3195 34.0516 30.3333 34.0598 30.3484 34.068C30.7427 34.2707 31.1601 34.4652 31.5925 34.6551C31.7301 34.716 31.8758 34.7734 32.0168 34.832C32.3221 34.9598 32.6331 35.0852 32.9557 35.207C33.1303 35.2727 33.3095 35.3359 33.4887 35.4004C33.8032 35.5117 34.1247 35.6207 34.4542 35.7273C34.6404 35.7871 34.8254 35.8469 35.015 35.9043C35.3734 36.0133 35.7434 36.1164 36.1181 36.2184C36.2915 36.2652 36.4603 36.3145 36.6361 36.3602C37.1911 36.5031 37.7588 36.6402 38.3485 36.7668C42.1595 37.5906 46.5336 38.0254 50.999 38.0254C55.4644 38.0254 59.8397 37.5906 63.6495 36.768C64.2404 36.6402 64.8092 36.5031 65.3666 36.3602C65.5377 36.3156 65.7007 36.2688 65.8684 36.223C66.2499 36.1199 66.6246 36.0145 66.9888 35.9031C67.1749 35.8469 67.3553 35.7883 67.5368 35.7309C67.8745 35.623 68.2028 35.5105 68.5243 35.3969C68.6966 35.3359 68.8677 35.275 69.0353 35.2117C69.3672 35.0863 69.6852 34.9574 69.9985 34.8262C70.1326 34.7699 70.2725 34.7148 70.4032 34.6574C70.8379 34.4664 71.2576 34.2707 71.6542 34.0668C71.66 34.0633 71.6658 34.0609 71.6716 34.0574C72.0589 33.8582 72.4243 33.6508 72.7735 33.441C72.8868 33.3719 72.9909 33.3016 73.1007 33.2313C73.3354 33.0813 73.5632 32.9312 73.7794 32.7766C73.8951 32.6934 74.0049 32.609 74.1159 32.5258C74.3102 32.377 74.4963 32.2258 74.6732 32.0723C74.7322 32.0207 74.8027 31.9727 74.8594 31.9211L74.8582 31.9199ZM74.8582 48.2887V60.1598C74.8582 62.8773 70.3396 65.6359 63.335 67.2004C63.2737 67.2051 63.2136 67.2156 63.1547 67.2285C59.5021 68.016 55.2482 68.4109 50.9955 68.4098C48.8692 68.4098 46.7428 68.3113 44.6917 68.1145C42.6405 67.9176 40.6656 67.6211 38.8399 67.2273C38.7832 67.2133 38.7266 67.2051 38.6699 67.2004C31.663 65.6359 27.1432 62.8785 27.1432 60.1598V48.2887C27.2022 48.3426 27.2739 48.393 27.3352 48.4457C27.5075 48.5945 27.6878 48.7422 27.8763 48.8875C27.9908 48.9754 28.1052 49.0633 28.2255 49.15C28.4348 49.3 28.6568 49.4477 28.8834 49.593C28.999 49.6668 29.1089 49.7418 29.228 49.8145C29.5633 50.0172 29.9136 50.2152 30.2825 50.4074C30.3114 50.4227 30.338 50.4379 30.3669 50.452C30.7507 50.6488 31.1566 50.8398 31.5775 51.0262C31.722 51.0895 31.8746 51.1504 32.0226 51.2125C32.3198 51.3379 32.6227 51.4609 32.9372 51.5793C33.1164 51.6473 33.2991 51.7129 33.4841 51.7785C33.7917 51.8887 34.1073 51.9953 34.4299 52.0996C34.6196 52.1605 34.8092 52.2227 35.0046 52.2812C35.3584 52.3891 35.7238 52.4922 36.0938 52.593C36.2684 52.641 36.4395 52.6902 36.6176 52.7359C37.1714 52.8789 37.738 53.016 38.3253 53.1426C38.3554 53.1496 38.3889 53.1555 38.4236 53.159C42.2161 53.9723 46.5636 54.4023 51.0013 54.4023C55.439 54.4023 59.7784 53.9734 63.5697 53.1613C63.6056 53.1566 63.6414 53.1508 63.6773 53.1426C64.2647 53.0148 64.8312 52.8789 65.3851 52.7359C65.5643 52.6902 65.7342 52.6398 65.9088 52.593C66.2788 52.4922 66.6442 52.3891 66.998 52.2812C67.1934 52.2215 67.3831 52.1605 67.5727 52.0996C67.8953 51.9953 68.2109 51.8887 68.5185 51.7785C68.7023 51.7129 68.8862 51.6473 69.0654 51.5793C69.3799 51.4598 69.6817 51.3367 69.98 51.2125C70.128 51.1504 70.2806 51.0895 70.4252 51.0262C70.846 50.841 71.2507 50.65 71.6357 50.452C71.6646 50.4367 71.6912 50.4215 71.7201 50.4074C72.0901 50.2152 72.4405 50.0172 72.7747 49.8145C72.8949 49.7418 73.0036 49.6668 73.1192 49.593C73.347 49.4477 73.5678 49.3 73.7771 49.15C73.8974 49.0633 74.0118 48.9766 74.1263 48.8875C74.3148 48.7422 74.4952 48.5945 74.6674 48.4457C74.7287 48.393 74.7992 48.3426 74.8582 48.2887ZM74.8582 76.5355C74.8582 80.4367 65.0602 84.7844 51.0002 84.7844C36.9402 84.7844 27.1421 80.4367 27.1421 76.5355V64.6469C27.1987 64.6984 27.2693 64.7477 27.3282 64.7992C27.5028 64.9504 27.6844 65.0992 27.8763 65.2469C27.9873 65.3324 28.0995 65.418 28.2162 65.5023C28.4302 65.6559 28.6568 65.807 28.8892 65.9559C28.9979 66.0262 29.1019 66.0977 29.2152 66.1656C29.5691 66.3801 29.9367 66.591 30.3299 66.7937C30.331 66.7937 30.3322 66.7938 30.3333 66.7961C30.7253 66.9988 31.1404 67.1945 31.5694 67.3855C31.7058 67.4465 31.8515 67.5039 31.9914 67.5637C32.2955 67.6926 32.6054 67.8191 32.928 67.9422C33.1002 68.0078 33.2772 68.0711 33.4541 68.1355C33.7674 68.248 34.0888 68.3582 34.4184 68.466C34.6034 68.5258 34.7872 68.5867 34.9768 68.6453C35.3341 68.7555 35.703 68.8609 36.0764 68.9641C36.2476 69.0109 36.4141 69.0602 36.5887 69.1059C37.1413 69.2512 37.7079 69.3895 38.2941 69.5195C38.3462 69.5312 38.3993 69.5383 38.4514 69.543C42.2369 70.3516 46.5717 70.7793 50.999 70.7793C55.4263 70.7793 59.7599 70.3527 63.5478 69.543C63.5998 69.5383 63.653 69.5312 63.705 69.5195C64.2912 69.3906 64.8578 69.2512 65.4105 69.1059C65.5839 69.0602 65.7493 69.0121 65.9192 68.9652C66.295 68.8621 66.665 68.7555 67.0246 68.6453C67.2131 68.5879 67.3958 68.5281 67.5785 68.4684C67.9092 68.3605 68.2329 68.2492 68.5486 68.1355C68.7231 68.0723 68.8977 68.009 69.0689 67.9445C69.3938 67.8203 69.7071 67.6926 70.0135 67.5625C70.1511 67.5039 70.2933 67.4477 70.4275 67.3879C71.29 67.0047 72.0774 66.5969 72.7851 66.1668C72.8972 66.0988 73.0001 66.0273 73.1088 65.9582C73.3424 65.8082 73.5702 65.657 73.7852 65.5023C73.9008 65.4191 74.0118 65.3336 74.1217 65.2492C74.3148 65.1016 74.4975 64.9516 74.6732 64.7992C74.7322 64.7488 74.8016 64.6996 74.8582 64.648V76.5355Z",fill:De.silhouette}),e.jsx("path",{d:"M33.2089 38.8535C31.3993 38.8535 29.9263 40.3453 29.9263 42.1805C29.9263 44.0156 31.3982 45.5062 33.2089 45.5062C35.0196 45.5062 36.4903 44.0145 36.4903 42.1805C36.4903 40.3465 35.0184 38.8535 33.2089 38.8535ZM33.2089 43.1625C32.6735 43.1625 32.2388 42.7219 32.2388 42.1805C32.2388 41.6391 32.6735 41.1973 33.2089 41.1973C33.7442 41.1973 34.1778 41.6379 34.1778 42.1805C34.1778 42.723 33.7431 43.1625 33.2089 43.1625Z",fill:De.silhouette}),e.jsx("path",{d:"M33.2089 54.6777C31.3993 54.6777 29.9263 56.1695 29.9263 58.0047C29.9263 59.8398 31.3982 61.3316 33.2089 61.3316C35.0196 61.3316 36.4903 59.8398 36.4903 58.0047C36.4903 56.1695 35.0184 54.6777 33.2089 54.6777ZM33.2089 58.9879C32.6735 58.9879 32.2388 58.5473 32.2388 58.0047C32.2388 57.4621 32.6735 57.0215 33.2089 57.0215C33.7442 57.0215 34.1778 57.4621 34.1778 58.0047C34.1778 58.5473 33.7431 58.9879 33.2089 58.9879Z",fill:De.silhouette}),e.jsx("path",{d:"M33.2089 70.5C31.3993 70.5 29.9263 71.9918 29.9263 73.827C29.9263 75.6621 31.3982 77.1539 33.2089 77.1539C35.0196 77.1539 36.4903 75.6621 36.4903 73.827C36.4903 71.9918 35.0184 70.5 33.2089 70.5ZM33.2089 74.8102C32.6735 74.8102 32.2388 74.3695 32.2388 73.827C32.2388 73.2844 32.6735 72.8438 33.2089 72.8438C33.7442 72.8438 34.1778 73.2844 34.1778 73.827C34.1778 74.3695 33.7431 74.8102 33.2089 74.8102Z",fill:De.silhouette}),e.jsx("path",{d:"M70.0215 38.2852C69.3821 38.2852 68.8652 38.809 68.8652 39.457V44.3332C68.8652 44.9812 69.3821 45.5051 70.0215 45.5051C70.6609 45.5051 71.1777 44.9812 71.1777 44.3332V39.457C71.1777 38.809 70.6609 38.2852 70.0215 38.2852Z",fill:De.silhouette}),e.jsx("path",{d:"M70.0215 54.3926C69.3821 54.3926 68.8652 54.9164 68.8652 55.5645V60.4406C68.8652 61.0887 69.3821 61.6125 70.0215 61.6125C70.6609 61.6125 71.1777 61.0887 71.1777 60.4406V55.5645C71.1777 54.9164 70.6609 54.3926 70.0215 54.3926Z",fill:De.silhouette}),e.jsx("path",{d:"M70.0215 70.5C69.3821 70.5 68.8652 71.0238 68.8652 71.6719V76.5492C68.8652 77.1973 69.3821 77.7211 70.0215 77.7211C70.6609 77.7211 71.1777 77.1973 71.1777 76.5492V71.6719C71.1777 71.0238 70.6609 70.5 70.0215 70.5Z",fill:De.silhouette}),e.jsx("path",{d:"M65.77 39.7617C65.1306 39.7617 64.6138 40.2855 64.6138 40.9336V45.8098C64.6138 46.4578 65.1306 46.9816 65.77 46.9816C66.4094 46.9816 66.9263 46.4578 66.9263 45.8098V40.9336C66.9263 40.2855 66.4094 39.7617 65.77 39.7617Z",fill:De.silhouette}),e.jsx("path",{d:"M65.77 55.8691C65.1306 55.8691 64.6138 56.393 64.6138 57.041V61.9172C64.6138 62.5652 65.1306 63.0891 65.77 63.0891C66.4094 63.0891 66.9263 62.5652 66.9263 61.9172V57.041C66.9263 56.393 66.4094 55.8691 65.77 55.8691Z",fill:De.silhouette}),e.jsx("path",{d:"M65.77 71.9766C65.1306 71.9766 64.6138 72.5004 64.6138 73.1484V78.0246C64.6138 78.6727 65.1306 79.1965 65.77 79.1965C66.4094 79.1965 66.9263 78.6727 66.9263 78.0246V73.1484C66.9263 72.5004 66.4094 71.9766 65.77 71.9766Z",fill:De.silhouette}),e.jsx("path",{d:"M61.2939 40.7246C60.6545 40.7246 60.1377 41.2484 60.1377 41.8965V46.7727C60.1377 47.4207 60.6545 47.9445 61.2939 47.9445C61.9334 47.9445 62.4502 47.4207 62.4502 46.7727V41.8965C62.4502 41.2484 61.9334 40.7246 61.2939 40.7246Z",fill:De.silhouette}),e.jsx("path",{d:"M61.2939 56.832C60.6545 56.832 60.1377 57.3559 60.1377 58.0039V62.8801C60.1377 63.5281 60.6545 64.052 61.2939 64.052C61.9334 64.052 62.4502 63.5281 62.4502 62.8801V58.0039C62.4502 57.3559 61.9334 56.832 61.2939 56.832Z",fill:De.silhouette}),e.jsx("path",{d:"M61.2939 72.9395C60.6545 72.9395 60.1377 73.4633 60.1377 74.1113V78.9875C60.1377 79.6355 60.6545 80.1594 61.2939 80.1594C61.9334 80.1594 62.4502 79.6355 62.4502 78.9875V74.1113C62.4502 73.4633 61.9334 72.9395 61.2939 72.9395Z",fill:De.silhouette}),e.jsx("path",{d:"M39.0489 24.4037C39.131 24.4037 39.2154 24.3944 39.2986 24.3768C42.7316 23.6127 46.6755 23.185 51.0207 23.11C51.659 23.0983 52.1677 22.5651 52.1561 21.917C52.1446 21.2701 51.652 20.7451 50.9791 20.7662C46.4813 20.8448 42.3835 21.2889 38.8015 22.0881C38.1782 22.2264 37.7828 22.8522 37.9204 23.4838C38.0395 24.0311 38.5182 24.4037 39.0489 24.4037Z",fill:De.silhouette}),e.jsx("path",{d:"M32.5406 26.6215C32.7407 26.6215 32.9442 26.57 33.128 26.4586C33.1315 26.4563 33.5096 26.2336 34.2889 25.9055C34.8786 25.6582 35.1584 24.9727 34.9144 24.3739C34.6704 23.775 33.9917 23.4926 33.4032 23.7399C32.4632 24.1348 31.9926 24.4149 31.9417 24.4465C31.396 24.7782 31.219 25.4942 31.544 26.0485C31.7613 26.4164 32.1452 26.6204 32.5395 26.6204L32.5406 26.6215Z",fill:De.silhouette}),e.jsx("path",{d:"M92.7251 26.7272L82.3845 29.3124C81.6929 29.4856 80.9911 29.0642 80.8179 28.3727C80.6447 27.6799 81.066 26.978 81.7576 26.8048L92.0982 24.2196C92.791 24.0464 93.4929 24.4678 93.6661 25.1593C93.8393 25.8521 93.4179 26.554 92.7251 26.7272Z",fill:De.accent,fillOpacity:"0.65"}),e.jsx("path",{d:"M94.4649 11.0082L80.2465 21.3488C79.6701 21.7676 78.8609 21.6409 78.4408 21.0632C78.022 20.4867 78.1487 19.6775 78.7265 19.2574L92.9448 8.91682C93.5213 8.49803 94.3305 8.6247 94.7505 9.20248C95.1693 9.77897 95.0414 10.5881 94.4649 11.0082Z",fill:De.accent,fillOpacity:"0.65"}),e.jsx("path",{d:"M78.0091 10.6269L74.1314 17.0898C73.7643 17.7025 72.9706 17.9002 72.358 17.5331C71.7466 17.1673 71.5475 16.3724 71.9146 15.7597L75.7923 9.29684C76.1594 8.68545 76.9544 8.48769 77.5657 8.85349C78.1784 9.22058 78.3762 10.0155 78.0091 10.6269Z",fill:De.accent,fillOpacity:"0.65"})]})})}const Vc=({title:r="create",children:t,onClickAction:l,variant:n="primary",variantTitle:o,leftIcon:c,showButton:i=!0,customHeight:s,childrenButton:a,customIcon:d})=>{const y=()=>{switch(n){case"primary":return e.jsx(e.Fragment,{children:c?e.jsx(j.Button,{primary:!0,iconLeft:c,onClick:l,children:a||r}):e.jsx(j.Button,{primary:!0,onClick:l,children:a||r})});case"secondary":return e.jsx(e.Fragment,{children:c?e.jsx(j.Button,{secondary:!0,iconLeft:c,onClick:l,children:o?e.jsx(k.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||r}):r}):e.jsx(j.Button,{secondary:!0,onClick:l,children:a||r})});case"success":return e.jsx(e.Fragment,{children:c?e.jsx(j.Button,{success:!0,iconLeft:c,onClick:l,children:a||r}):e.jsx(j.Button,{success:!0,onClick:l,children:a||r})});default:return e.jsx(e.Fragment,{children:c?e.jsx(j.Button,{primary:!0,iconLeft:c,onClick:l,children:a||r}):e.jsx(j.Button,{primary:!0,onClick:l,children:a||r})})}};return e.jsxs(u.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:s,children:[d||e.jsx(Hc,{}),e.jsx(u.Box,{direction:"column",children:t.map((b,p)=>e.jsx(ze.Body1,{props:{align:"center",textAlign:"center"},children:p>2?null:b},p))}),i?y():null]})},R={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function Pc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke:R.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("path",{d:"M233.438 165.217C233.438 132.764 239.035 107.198 250.231 88.5189C261.596 69.8396 279.832 60.5 304.938 60.5C330.043 60.5 348.194 69.8396 359.389 88.5189C370.755 107.198 376.438 132.764 376.438 165.217C376.438 198.047 370.755 223.802 359.389 242.481C348.194 261.16 330.043 270.5 304.938 270.5C279.832 270.5 261.596 261.16 250.231 242.481C239.035 223.802 233.438 198.047 233.438 165.217ZM333.69 165.217C333.69 146.16 331.824 131.538 328.092 121.349C324.36 110.972 316.642 105.783 304.938 105.783C293.233 105.783 285.515 110.972 281.783 121.349C278.051 131.538 276.185 146.16 276.185 165.217C276.185 178.047 276.863 188.708 278.22 197.198C279.577 205.5 282.292 212.292 286.363 217.575C290.604 222.67 296.795 225.217 304.938 225.217C313.08 225.217 319.187 222.67 323.258 217.575C327.499 212.292 330.298 205.5 331.655 197.198C333.012 188.708 333.69 178.047 333.69 165.217Z",fill:R.cD0E5F7}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.4375 235.124V194.28L138.96 60.5H192.466V191.32H215.438V235.124H192.466V249.5H144.563V235.124H50.4375ZM100.862 191.32L147.925 116.143V191.32H100.862Z",fill:R.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M394.438 235.124V194.28L482.96 60.5H536.466V191.32H559.438V235.124H536.466V249.5H488.563V235.124H394.438ZM444.862 191.32L491.925 116.143V191.32H444.862Z",fill:R.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:R.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:R.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:R.c98B4CB}),e.jsx("path",{d:"M244.719 200.89V264.5H363.574V200.89M244.719 200.89H233.438L244.719 186.396M244.719 200.89H363.574M363.574 200.89H372.437L363.574 186.396M244.719 186.396L261.64 171.5M244.719 186.396H261.64M363.574 186.396L349.472 171.5M363.574 186.396H349.472M261.64 171.5H349.472M261.64 171.5V186.396M349.472 171.5V186.396M349.472 186.396H261.64",stroke:R.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:R.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:R.cFFFFFF}),e.jsx("path",{d:"M332.438 129.846C332.438 141.175 329.183 152.403 323.949 160.772C318.699 169.168 311.592 174.5 303.938 174.5C296.283 174.5 289.176 169.168 283.926 160.772C278.692 152.403 275.438 141.175 275.438 129.846C275.438 118.458 277.838 109.628 282.543 103.663C287.216 97.7387 294.274 94.5 303.938 94.5C313.601 94.5 320.659 97.7387 325.332 103.663C330.037 109.628 332.438 118.458 332.438 129.846Z",fill:R.cFFFFFF,stroke:R.c000000,strokeWidth:"2"}),e.jsx("path",{d:"M281.438 145.5C284.032 154.136 285.762 158.682 290.951 164.591M292.681 166.409C293.624 167.647 295.708 169.591 297.438 170.5",stroke:R.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.438 175C299.54 176.339 297.208 177.876 293.938 182.5M304.438 175C301.183 178.041 299.537 178.883 299.438 182.5M304.438 175C308.173 177.107 309.635 178.834 311.438 182.5",stroke:R.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.936 175.5C303.438 180 302.529 181.628 304.936 186.5",stroke:R.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.178 120.981C289.969 120.93 290.921 121.313 292.167 122.754",stroke:R.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:R.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:R.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:R.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:R.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:R.c001A72,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M265.437 115.5L260.438 120.5M260.438 115.5L265.438 120.5",stroke:R.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.437 87.5L283.438 92.5M283.438 87.5L288.438 92.5",stroke:R.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M305.437 83.5L298.438 90.5M298.438 83.5L305.438 90.5",stroke:R.c001A72,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M342.437 145.5L337.438 150.5M337.438 145.5L342.438 150.5",stroke:R.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:R.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:R.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:R.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:R.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:R.c001A72})]})})}function jc({onClick:r}){const t=pe.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Pc,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(k.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const re={c46F16B:"#46F16B",c48504C:"#48504C",c64B5F6:"#64B5F6",c67AEE6:"#67AEE6",c86512B:"#86512B",c956847:"#956847",cBBC3F5:"#BBC3F5",cBBDEFB:"#BBDEFB",cC0B2A2:"#C0B2A2",cC8CEF4:"#C8CEF4",cCABEB1:"#CABEB1",cD5C7BD:"#D5C7BD",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cE5EE80:"#E5EE80",cEE8080:"#EE8080",cEFF3F8:"#EFF3F8",cF4F4F4:"#F4F4F4",cFFFFFF:"#FFFFFF"};function Nc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:re.cD6EBFD}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M75 238.124V197.28L163.523 63.5H217.029V194.32H240V238.124H217.029V252.5H169.126V238.124H75ZM125.424 194.32L172.487 119.143V194.32H125.424Z",fill:re.cBBDEFB,fillOpacity:"0.6"}),e.jsxs("g",{clipPath:"url(#clip0_2949_9690)",children:[e.jsx("path",{d:"M334.5 274.5C381.168 274.5 419 227.266 419 169C419 110.734 381.168 63.5 334.5 63.5C287.832 63.5 250 110.734 250 169C250 227.266 287.832 274.5 334.5 274.5Z",fill:re.cEFF3F8,stroke:re.c67AEE6,strokeWidth:"5"}),e.jsx("path",{d:"M413 197.5C411.397 211.835 402.919 230.898 389.361 246.49C375.596 262.32 356.651 274.5 334.496 274.5C311.331 274.5 292.389 261.672 278.878 245.52C265.592 229.638 257.606 210.603 256 197.5H413Z",fill:re.cD5C7BD}),e.jsx("path",{d:"M278.887 211.766H391.104L392.583 222.856C392.687 223.635 392.08 224.328 391.294 224.328H277.961C277.14 224.328 276.525 223.577 276.686 222.773L278.887 211.766Z",fill:re.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:re.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:re.c956847,stroke:re.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:re.c956847,stroke:re.c48504C}),e.jsx("path",{d:"M285.902 212.103L284.935 186.306H279.606C278.151 186.306 277.004 187.542 277.113 188.993L278.673 209.79C278.77 211.095 279.857 212.103 281.166 212.103H285.902Z",fill:re.cC8CEF4,stroke:re.c48504C}),e.jsx("path",{d:"M383.256 212.103L384.638 186.306H389.556C391.007 186.306 392.153 187.537 392.05 188.984L390.564 209.782C390.471 211.09 389.382 212.103 388.07 212.103H383.256Z",fill:re.cC8CEF4,stroke:re.c48504C}),e.jsx("path",{d:"M284.497 178.155C284.455 176.194 286.034 174.581 287.996 174.581H381.904C383.895 174.581 385.485 176.24 385.401 178.23L384.066 209.59C383.987 211.463 382.445 212.941 380.569 212.941H288.663C286.759 212.941 285.205 211.419 285.164 209.515L284.497 178.155Z",fill:re.cC8CEF4,stroke:re.c48504C}),e.jsx("path",{d:"M284.845 181.524C284.792 179.279 286.598 177.431 288.844 177.431H380.687C382.948 177.431 384.76 179.304 384.684 181.565L383.774 208.737C383.701 210.893 381.933 212.603 379.776 212.603H289.48C287.307 212.603 285.532 210.869 285.481 208.697L284.845 181.524Z",fill:re.cBBC3F5}),e.jsx("mask",{id:"mask0_2949_9690",maskUnits:"userSpaceOnUse",x:"301",y:"144",width:"68",height:"17",style:{maskType:"luminance"},children:e.jsx("path",{d:"M301 146.5C301 145.395 301.887 144.5 302.98 144.5H367.02C368.114 144.5 369 145.395 369 146.5V160.411H301V146.5Z",fill:re.cFFFFFF})}),e.jsxs("g",{mask:"url(#mask0_2949_9690)",children:[e.jsx("path",{d:"M301 146.191C301 145.257 301.748 144.5 302.671 144.5H356.701C357.624 144.5 358.372 145.257 358.372 146.191V157.949H301V146.191Z",fill:re.cFFFFFF}),e.jsx("path",{d:"M301.336 146.607C301.336 145.673 302.08 144.916 302.999 144.916H367.01C367.929 144.916 368.673 145.673 368.673 146.607V152.523H301.336V146.607Z",fill:re.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:re.cF4F4F4}),e.jsx("path",{d:"M307.685 150.417C308.607 150.417 309.356 149.66 309.356 148.726C309.356 147.793 308.607 147.036 307.685 147.036C306.762 147.036 306.014 147.793 306.014 148.726C306.014 149.66 306.762 150.417 307.685 150.417Z",fill:re.cEE8080}),e.jsx("path",{d:"M313.532 150.417C314.455 150.417 315.203 149.66 315.203 148.726C315.203 147.793 314.455 147.036 313.532 147.036C312.609 147.036 311.861 147.793 311.861 148.726C311.861 149.66 312.609 150.417 313.532 150.417Z",fill:re.cE5EE80}),e.jsx("path",{d:"M318.546 150.417C319.469 150.417 320.217 149.66 320.217 148.726C320.217 147.793 319.469 147.036 318.546 147.036C317.623 147.036 316.875 147.793 316.875 148.726C316.875 149.66 317.623 150.417 318.546 150.417Z",fill:re.c46F16B})]}),e.jsx("path",{d:"M301.16 146C301.16 145.172 301.832 144.5 302.66 144.5H367.33C368.159 144.5 368.83 145.172 368.83 146V174.419H301.16V146Z",stroke:re.c48504C}),e.jsx("path",{d:"M395.29 207.579H423.344M354.255 236.889H369.329M327.038 222.234H347.556M350.905 222.234H358.024M288.097 230.19H304.846M253.344 210.091H272.605M278.467 246.938H295.216M297.309 246.938H303.59M337.088 252.801H354.255",stroke:re.c86512B,strokeWidth:"2",strokeLinecap:"round"})]}),e.jsx("path",{d:"M430.241 125.78C430.987 105.807 437.521 90.4065 449.841 79.5799C462.161 68.7532 478.867 63.3398 499.961 63.3398C513.961 63.3398 525.907 65.7665 535.801 70.6199C545.881 75.4732 553.441 82.0998 558.481 90.4998C563.707 98.8998 566.321 108.327 566.321 118.78C566.321 131.1 563.241 141.18 557.081 149.02C550.921 156.673 543.734 161.9 535.521 164.7V165.82C546.161 169.367 554.561 175.247 560.721 183.46C566.881 191.673 569.961 202.22 569.961 215.1C569.961 226.673 567.254 236.94 561.841 245.9C560.436 248.258 558.849 250.481 557.081 252.569L443.5 252.662C432.5 241 427.721 230.5 427.721 207.82H474.201C474.387 216.033 476.721 222.567 481.201 227.42C485.681 232.087 492.214 234.42 500.801 234.42C508.081 234.42 513.681 232.367 517.601 228.26C521.707 223.967 523.761 218.367 523.761 211.46C523.761 202.5 520.867 196.06 515.081 192.14C509.481 188.033 500.427 185.98 487.921 185.98H478.961V147.06H487.921C497.441 147.06 505.094 145.473 510.881 142.3C516.854 138.94 519.841 133.06 519.841 124.66C519.841 117.94 517.974 112.713 514.241 108.98C510.507 105.247 505.374 103.38 498.841 103.38C491.747 103.38 486.427 105.527 482.881 109.82C479.521 114.113 477.561 119.433 477.001 125.78H430.241Z",fill:re.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:re.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:re.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:re.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:re.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:re.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:re.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:re.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_2949_9690",children:e.jsx("rect",{width:"179",height:"192",fill:re.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function _c({onClick:r}){const t=pe.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Nc,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const f={c000D58:"#000D58",c001174:"#001174",c28AC6E:"#28AC6E",c48504C:"#48504C",c64B5F6:"#64B5F6",c90CAF9:"#90CAF9",cC9184A:"#C9184A",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cD9D9D9:"#D9D9D9",cDEECF8:"#DEECF8",cE7EAE9:"#E7EAE9",cF3F8FD:"#F3F8FD",cFFE18B:"#FFE18B",cFFFFFF:"#FFFFFF"};function qc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 287",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M406.562 180.997C406.562 148.544 412.16 122.978 423.356 104.299C434.721 85.6199 452.957 76.2803 478.063 76.2803C503.168 76.2803 521.319 85.6199 532.514 104.299C543.88 122.978 549.562 148.544 549.562 180.997C549.562 213.827 543.88 239.582 532.514 258.261C521.319 276.941 503.168 286.28 478.063 286.28C452.957 286.28 434.721 276.941 423.356 258.261C412.16 239.582 406.562 213.827 406.562 180.997ZM506.815 180.997C506.815 161.941 504.949 147.318 501.217 137.129C497.485 126.752 489.767 121.563 478.063 121.563C466.358 121.563 458.64 126.752 454.908 137.129C451.176 147.318 449.31 161.941 449.31 180.997C449.31 193.827 449.988 204.488 451.345 212.978C452.703 221.28 455.417 228.073 459.488 233.356C463.729 238.45 469.92 240.997 478.063 240.997C486.205 240.997 492.312 238.45 496.383 233.356C500.624 228.073 503.423 221.28 504.78 212.978C506.137 204.488 506.815 193.827 506.815 180.997Z",fill:f.cD6EBFD}),e.jsx("path",{d:"M246.562 180.558C246.562 148.105 252.16 122.539 263.356 103.86C274.721 85.1804 292.957 75.8408 318.063 75.8408C343.168 75.8408 361.319 85.1804 372.514 103.86C383.88 122.539 389.562 148.105 389.562 180.558C389.562 213.388 383.88 239.143 372.514 257.822C361.319 276.501 343.168 285.841 318.063 285.841C292.957 285.841 274.721 276.501 263.356 257.822C252.16 239.143 246.562 213.388 246.562 180.558ZM346.815 180.558C346.815 161.501 344.949 146.879 341.217 136.69C337.485 126.313 329.767 121.124 318.063 121.124C306.358 121.124 298.64 126.313 294.908 136.69C291.176 146.879 289.31 161.501 289.31 180.558C289.31 193.388 289.988 204.048 291.345 212.539C292.702 220.841 295.417 227.633 299.488 232.916C303.729 238.011 309.92 240.558 318.063 240.558C326.205 240.558 332.312 238.011 336.383 232.916C340.624 227.633 343.423 220.841 344.78 212.539C346.137 204.048 346.815 193.388 346.815 180.558Z",fill:f.cD6EBFD}),e.jsx("path",{d:"M222.808 118.703H128.062V159.858C132.111 155.484 137.779 151.905 145.067 149.122C152.356 146.338 160.251 144.946 168.754 144.946C183.938 144.946 196.49 148.326 206.41 155.086C216.532 161.846 223.922 170.594 228.578 181.329C233.234 192.065 235.562 203.696 235.562 216.221C235.562 239.483 228.882 257.972 215.52 271.691C202.158 285.21 183.357 282.89 159.062 282.89C142.867 282.89 131.098 284.939 116.826 283.918C104.881 278.351 95.6695 270.697 89.1911 260.955C82.7127 251.213 79.1698 239.98 78.5625 227.256H129.276C130.491 233.419 133.426 238.588 138.083 242.763C142.739 246.739 149.116 248.728 157.214 248.728C166.729 248.728 173.815 245.745 178.472 239.781C183.128 233.817 185.456 225.864 185.456 215.923C185.456 206.181 183.027 198.726 178.168 193.557C173.309 188.387 166.223 185.803 156.911 185.803C150.027 185.803 144.359 187.493 139.905 190.873C135.451 194.054 132.515 198.328 131.098 203.696H80.9919V73.9697H222.808V118.703Z",fill:f.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:f.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 200.539C269.878 200.263 270.101 200.039 270.377 200.039L305.476 199.955C305.753 199.955 305.978 200.179 305.978 200.455V206.461H269.878V200.539Z",stroke:f.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 235.871C269.878 235.595 270.101 235.372 270.377 235.371L305.476 235.288C305.753 235.287 305.978 235.511 305.978 235.788V241.794H269.878V235.871Z",stroke:f.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 272.088C269.878 271.812 270.101 271.589 270.377 271.588L305.476 271.505C305.753 271.504 305.978 271.728 305.978 272.005V278.011H269.878V272.088Z",stroke:f.c001174}),e.jsx("path",{d:"M279.095 176.348H364.373C365.459 176.348 366.125 176.992 366.986 178.252V202.985C366.986 202.985 366.986 203.869 366.545 204.752C366.103 205.635 365.661 206.077 365.661 206.077L306.478 206.163V199.452L279.095 199.518V176.348Z",fill:f.cF3F8FD}),e.jsx("path",{d:"M279.095 211.093H364.373C365.459 211.093 366.125 211.736 366.986 212.997V237.73C366.986 237.73 366.986 238.613 366.545 239.497C366.103 240.38 365.661 240.822 365.661 240.822L306.478 240.908V234.197L279.095 234.262V211.093Z",fill:f.cF3F8FD}),e.jsx("path",{d:"M279.095 248.008H364.373C365.459 248.008 366.125 248.652 366.986 249.912V274.646C366.986 274.646 366.986 275.529 366.545 276.412C366.103 277.296 365.661 277.737 365.661 277.737L306.478 277.824V271.112L279.095 271.178V248.008Z",fill:f.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("path",{d:"M268.053 210.494C268.483 209.112 268.564 208.343 268.053 206.961H362.569C361.955 208.363 361.972 209.136 362.569 210.494H268.053Z",fill:f.c000D58,stroke:f.c001174}),e.jsx("path",{d:"M268.053 246.269C268.483 244.887 268.564 244.118 268.053 242.736H362.569C361.955 244.138 361.972 244.911 362.569 246.269H268.053Z",fill:f.c000D58,stroke:f.c001174}),e.jsx("path",{d:"M283.312 130.775C283.312 129.64 283.987 128.72 284.82 128.72H349.805C350.638 128.72 351.312 129.64 351.312 130.775V169.72H283.312V130.775Z",fill:f.cFFFFFF,stroke:f.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M279.574 171.847C279.381 171.283 279.267 170.624 279.33 169.72H355.195C355.423 170.925 355.287 171.695 355.063 172.241C354.834 172.802 354.506 173.186 354.101 173.66C354.084 173.68 354.067 173.7 354.05 173.72H280.503C280.468 173.658 280.434 173.598 280.4 173.539C280.051 172.922 279.774 172.434 279.574 171.847Z",stroke:f.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M350.312 133.72V129.726L284.812 129.72C284.312 129.726 284.312 129.726 284.312 130.125V133.72H350.312Z",fill:f.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:f.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:f.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:f.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:f.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:f.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Zc({onClick:r}){const t=pe.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(qc,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(k.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const Gc=r=>{var l,n,o,c,i;const t=pe.useMediaQuery("md");return e.jsxs(We.Dialog,{isShow:r.isShow,onHide:r.onHide,style:{...t?{minWidth:r.customMinWidth||"458px"}:{maxWidth:r.customMinWidth||"458px"}},children:[e.jsx(We.DialogTitle,{...r.dialogTitleProps,children:typeof r.title=="string"?e.jsx(k.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(We.DialogBody,{children:typeof r.description=="string"?e.jsx(k.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:r.description}):r.description}),e.jsx(We.DialogFooter,{children:e.jsx(u.Box,{display:"flex",direction:((l=r.containerConfirmBtnProps)==null?void 0:l.direction)||"row",justify:((n=r.containerConfirmBtnProps)==null?void 0:n.justify)||"flex-end",...r.containerConfirmBtnProps,children:e.jsxs(u.Box,{display:"flex",direction:((o=r.wrapperConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((c=r.wrapperConfirmBtnProps)==null?void 0:c.justify)||"flex-end",gap:((i=r.wrapperConfirmBtnProps)==null?void 0:i.gap)||"sm",...r.wrapperConfirmBtnProps,children:[r.onCancel&&e.jsx(j.Button,{secondary:!0,onClick:r.onCancel,size:"md",fullWidth:!0,children:r.titleCancelBtn||"Cancel"}),e.jsx(u.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(j.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},Qc=h.memo(({children:r,height:t,minHeight:l,customHeight:n,paddingInline:o="spacing-0",paddingBlock:c="spacing-0",header:i,footer:s,title:a,titleTag:d,action:y,actionContainer:b,containerProps:p,bodyProps:x,headerProps:I={borderBottom:!0},footerProps:v={borderTop:!0},variantTag:T="info"})=>{const F=h.useRef(null),[O,B]=h.useState("100vh");h.useEffect(()=>{const S=()=>{if(F.current){const L=F.current.getBoundingClientRect().top;B(`calc(100vh - ${L}px)`)}};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const D=()=>d?e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(k.Text,{fontWeight:"medium",children:a}),e.jsx(Ke.Badges,{border:!0,text:d,variant:T})]}):e.jsx(k.Text,{fontWeight:"medium",children:a}),H=()=>i||e.jsxs(u.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(u.Box,{direction:"column",children:a?D():null}),e.jsx(u.Box,{direction:"column",...b,children:y??null})]}),z=!!(i||a||y);return e.jsxs(u.Box,{ref:F,height:t,customMinHeight:l,customHeight:n,paddingBlock:c,paddingInline:o,bg:"white",direction:"column",...p,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:O,...(p==null?void 0:p.style)??{}},children:[i!==null&&z?e.jsx(lt,{...I,children:H()}):null,e.jsx(u.Box,{direction:"column",padding:"spacing-0",...x,style:{flex:1,overflow:"auto",...(x==null?void 0:x.style)??{}},children:r}),s?e.jsx(ot,{...v,children:s}):null]})}),Uc=h.memo(({value:r,options:t=[],onChange:l,multiple:n})=>{const o=(r==null?void 0:r.map(s=>s.value))||[],c=(t==null?void 0:t.filter(s=>o.includes(s.value)))||[],i=s=>{const a=[...c];let d=[];n?d=o.includes(s.value)?a.filter(y=>y.value!==s.value):[...a,s]:d=[s],l==null||l(d)};return e.jsx(u.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:t==null?void 0:t.map((s,a)=>e.jsx(j.Button,{...o.includes(s.value)?{primary:!0}:{secondary:!0},onClick:()=>i(s),children:s.label},a))})});function Vr(r){return null}Vr.displayName="LayoutDialog.Header";function Pr(r){return null}Pr.displayName="LayoutDialog.Body";function jr(r){return null}jr.displayName="LayoutDialog.Aside";function Nr(r){return null}Nr.displayName="LayoutDialog.Footer";const me={"lyd-root":"_lyd-root_14rlp_1","lyd-backdrop":"_lyd-backdrop_14rlp_34","lyd-panel":"_lyd-panel_14rlp_43","lyd-modal":"_lyd-modal_14rlp_54","lyd-fullscreen":"_lyd-fullscreen_14rlp_64","lyd-sidebar":"_lyd-sidebar_14rlp_72","lyd-header":"_lyd-header_14rlp_100","lyd-header-content":"_lyd-header-content_14rlp_111","lyd-header-actions":"_lyd-header-actions_14rlp_119","lyd-main":"_lyd-main_14rlp_126","lyd-body":"_lyd-body_14rlp_133","lyd-aside":"_lyd-aside_14rlp_139","lyd-footer":"_lyd-footer_14rlp_155","lyd-vm-group":"_lyd-vm-group_14rlp_168","lyd-vm-btn":"_lyd-vm-btn_14rlp_176","lyd-close-btn":"_lyd-close-btn_14rlp_199"},Jc=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(Xc,{})},{mode:"modal",label:"Modal",icon:e.jsx(M.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(M.Icon,{name:"Fullscreen",size:"sm"})}];function Yc({value:r,onChange:t}){return e.jsx("div",{className:me["lyd-vm-group"],role:"group","aria-label":"View mode",children:Jc.map(l=>e.jsx("button",{type:"button",className:me["lyd-vm-btn"],"data-active":r===l.mode,"aria-label":`Switch to ${l.label} view`,"aria-pressed":r===l.mode,onClick:()=>t(l.mode),children:l.icon},l.mode))})}function Xc(){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),e.jsx("line",{x1:"15",y1:"4",x2:"15",y2:"20"})]})}const bt={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function Kc(r){return r?r in bt?bt[r]:r:bt.xl}function _r(r,t){let l=null;return h.Children.forEach(r,n=>{h.isValidElement(n)&&n.type===t&&(l=n.props.children??null)}),l}function $c(r){const{isOpen:t,onClose:l,viewMode:n,defaultViewMode:o="modal",onViewModeChange:c,showViewModeToggle:i=!0,showCloseButton:s=!0,size:a,asideWidth:d,disableEscapeClose:y=!1,disableBackdropClose:b=!1,lockBodyScroll:p=!0,children:x}=r,[I,v]=h.useState(o),T=n??I,O=pe.useMediaQuery("md")?T:"fullscreen",B=h.useCallback(Y=>{n===void 0&&v(Y),c==null||c(Y)},[n,c]),D=h.useRef(null);h.useEffect(()=>{if(!(!t||!p))return D.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=D.current??""}},[t,p]),h.useEffect(()=>{if(!t||y)return;const Y=te=>{te.key==="Escape"&&l()};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[t,y,l]);const H=h.useMemo(()=>_r(x,Vr),[x]),z=h.useMemo(()=>_r(x,Pr),[x]),S=h.useMemo(()=>_r(x,jr),[x]),L=h.useMemo(()=>_r(x,Nr),[x]);if(!t)return null;const V=[me["lyd-panel"],O==="modal"&&me["lyd-modal"],O==="fullscreen"&&me["lyd-fullscreen"],O==="sidebar"&&me["lyd-sidebar"]].filter(Boolean).join(" "),P={"--lyd-max-w":Kc(a),...d!==void 0&&{"--lyd-aside-w":d}},Z=()=>{b||l()};return e.jsxs("div",{className:me["lyd-root"],style:P,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:me["lyd-backdrop"],onClick:Z,"aria-hidden":"true"}),e.jsxs("div",{className:V,children:[e.jsxs("div",{className:me["lyd-header"],children:[e.jsx("div",{className:me["lyd-header-content"],children:H}),e.jsxs("div",{className:me["lyd-header-actions"],children:[i&&e.jsx(Yc,{value:T,onChange:B}),s&&e.jsx("button",{type:"button",className:me["lyd-close-btn"],onClick:l,"aria-label":"Close dialog",children:e.jsx(M.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:me["lyd-main"],children:[e.jsx("div",{className:me["lyd-body"],children:z}),S&&e.jsx("aside",{className:me["lyd-aside"],children:S})]}),L&&e.jsx("div",{className:me["lyd-footer"],children:L})]})]})}const xr=$c;xr.Header=Vr,xr.Body=Pr,xr.Aside=jr,xr.Footer=Nr;function Rc({url:r,filename:t,onClose:l}){return h.useEffect(()=>{const n=o=>{o.key==="Escape"&&l()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[l]),e.jsxs("div",{onClick:l,style:{position:"fixed",inset:0,zIndex:9999,backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px"},children:[e.jsxs("div",{onClick:n=>n.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:r,download:t,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.15)",color:"#fff",borderRadius:"var(--sa-radii-sm, 6px)",fontSize:"13px",textDecoration:"none",backdropFilter:"blur(4px)"},children:"Download"}),e.jsx("button",{onClick:l,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",backgroundColor:"rgba(255,255,255,0.15)",border:"none",borderRadius:"var(--sa-radii-sm, 6px)",color:"#fff",cursor:"pointer",backdropFilter:"blur(4px)"},"aria-label":"Close preview",children:"✕"})]}),e.jsx("img",{src:r,alt:t,onClick:n=>n.stopPropagation(),style:{maxWidth:"90vw",maxHeight:"85vh",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-lg, 0 25px 50px rgba(0,0,0,0.5))"}}),e.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:t})]})}const es=r=>{const{defaultTab:t=0,paramKey:l="tab"}=r||{},[n,o]=Ce.useSearchParams(),c=cr.searchParamsToObject(n.toString());return{activeTab:c[l]?parseInt(c[l]):t,handleTabChange:a=>{o({...c,[l]:a.toString()})},searchQueries:c}};function rs({appName:r,menuConfig:t,formatTitle:l}){const n=Ce.useLocation();h.useEffect(()=>{let o=null,c=null;for(const a of t){const d=a.items.find(y=>y.to?y.to==="/"?n.pathname==="/":!!(y.to===n.pathname||n.pathname.startsWith(y.to+"/")):!1);if(d){o=d,c=a;break}}const i=[];o!=null&&o.title&&i.push(o.title),c!=null&&c.name&&i.push(c.name.toTitleCase());const s=(a,d)=>a.length>0?`${a.join(" - ")} | ${d}`:d;document.title=(l||s)(i,r)},[n.pathname])}const ts=()=>{const[r,t]=Ce.useSearchParams(),l=cr.searchParamsToObject(r.toString()),n=Ce.useParams(),o=Ce.useLocation(),c=n.id;return{setSearchParams:t,searchParams:r,searchQueries:l,isHasQuery:(y,b)=>r.has(y)&&r.get(y)===b,getQueryParam:y=>r.get(y),getRouteParam:y=>n[y],params:n,location:o,id:c,hasId:!!c}};function ls(r){var n,o;const t=r.decodedAccessToken;return h.useMemo(()=>{var a,d;const c=((d=(a=t==null?void 0:t.access)==null?void 0:a.role)==null?void 0:d.code)??"",i=Object.keys(r.role).reduce((y,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,x=>x.replace("_","").toUpperCase())}`;return{...y,[p]:!1}},{});return{...Object.keys(r.role).reduce((y,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,x=>x.replace("_","").toUpperCase())}`;return{...y,[p]:c===r.role[b]}},i),hasRole:y=>c===r.role[y],getRoleKey:()=>c}},[(o=(n=t==null?void 0:t.access)==null?void 0:n.role)==null?void 0:o.code,r])}g.AdvanceFilterBar=vl,g.App=po,g.AppComponent=Jt,g.AppContext=Xr,g.AppLayout=xo,g.AsideBar=Oc,g.BackButton=Do,g.ColumnFilterDropdown=zl,g.ColumnMenu=jl,g.ConfirmationDialog=Gc,g.DataTable=Vl,g.DecisionWrapper=ne,g.EachUtils=Hr,g.EmptyStatePage=Vc,g.FLOATING_FOOTER_HEIGHT_VAR=pt,g.FilterBar=bn,g.FilterDrawer=Cl,g.FloatingFooter=Wc,g.ForbiddenPage=_c,g.Form=mc,g.FullSection=Qc,g.HeaderLeftSlot=bo,g.HeaderLeftSlotOutlet=Kt,g.HeaderLeftSlotProvider=Xt,g.HorizontalField=Fo,g.ImagePreview=Rc,g.InputFile=Zl,g.InputImage=Ql,g.LayoutDialog=xr,g.LayoutDialogAside=jr,g.LayoutDialogBody=Pr,g.LayoutDialogFooter=Nr,g.LayoutDialogHeader=Vr,g.ModuleSwitcher=So,g.ModuleSwitcherModal=al,g.NotFoundPage=jc,g.PageLayout=Lo,g.Pressable=yr,g.RightDrawer=hl,g.ScrollToTopButton=Ul,g.Section=Wo,g.SectionFooter=ot,g.SectionHeader=lt,g.SelectButton=Uc,g.ServerErrorPage=Zc,g.SidePanel=Ic,g.SidePanelItem=Mc,g.SidebarBadgesProvider=qt,g.SidebarGroupSlot=Co,g.SidebarGroupSlotOutlet=Rt,g.SidebarGroupSlotProvider=$t,g.SidebarHeaderSlot=Yt,g.SidebarProvider=Qt,g.TableFooter=Al,g.TableHeader=Wl,g.TableLayout=Hn,g.TableSection=Ln,g.TableWrapper=Ol,g.ToggleStatus=Bc,g.Typography=ze,g.VerticalField=Ac,g.clearModuleSelection=vo,g.createInitialFromUserName=qn,g.cssVars=Yn,g.expandDateCompact=kn,g.formHasChanged=rc,g.formatDate=Un,g.formatDateToIndonesian=ql,g.formatRupiah=Gn,g.getDateFilterValue=bl,g.getDateRangeFilterValue=Vo,g.getInitials=Qn,g.getValueDropdownMultipleFilter=pl,g.getValueRadioFilter=Ho,g.getValueSearch=Mr,g.getValuesFilter=Er,g.handleChangeFilter=pr,g.handleOnScroll=dc,g.isEmail=sc,g.isFilterActive=Po,g.isOnlyLettersAndSpaces=lc,g.isPhoneNumber=tc,g.isSlug=ic,g.localStorageAdapter=ct,g.oneDayInMs=Xn,g.parseIndonesianDateToDate=Zn,g.preventNonCoordinateInput=ac,g.preventNonNumberAndDecimalInput=cc,g.preventNonNumberInput=oc,g.preventNumberInput=nc,g.resolveDateRangeValueToString=ul,g.resolveDateValueToString=yl,g.resolveDropdownValueToString=fl,g.resolveRadioValueToString=gl,g.resolveSidebarBadge=Br,g.storageKeys=ar,g.textWidth=Kn,g.useApp=Kr,g.useAppState=Nt,g.useAuthRole=ls,g.useDynamicTitle=rs,g.useFilterBarApiParams=wn,g.useFilterBarControls=Sn,g.useModuleSelection=rt,g.useRouteInfo=Ee,g.useRouteParams=ts,g.useSidebar=Ut,g.useSidebarBadges=Zt,g.useTabState=es,g.useTableSortApiParams=Vn,Object.keys(lr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>lr[r]})}),Object.keys(Ke).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ke[r]})}),Object.keys(u).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>u[r]})}),Object.keys(or).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>or[r]})}),Object.keys(j).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>j[r]})}),Object.keys(It).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>It[r]})}),Object.keys(rr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>rr[r]})}),Object.keys(We).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>We[r]})}),Object.keys(kr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>kr[r]})}),Object.keys(nr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>nr[r]})}),Object.keys(pe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>pe[r]})}),Object.keys(cr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>cr[r]})}),Object.keys($e).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>$e[r]})}),Object.keys(A).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>A[r]})}),Object.keys(gr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>gr[r]})}),Object.keys(ur).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ur[r]})}),Object.keys(q).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>q[r]})}),Object.keys(Ot).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ot[r]})}),Object.keys(Ur).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ur[r]})}),Object.keys(sr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>sr[r]})}),Object.keys(Wt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Wt[r]})}),Object.keys(ir).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ir[r]})}),Object.keys(Be).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Be[r]})}),Object.keys(qe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>qe[r]})}),Object.keys(Jr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Jr[r]})}),Object.keys(k).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>k[r]})}),Object.keys(M).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>M[r]})}),Object.keys(oe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>oe[r]})}),Object.keys(At).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>At[r]})}),Object.keys(zt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>zt[r]})}),Object.keys(Ht).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ht[r]})}),Object.keys(Vt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Vt[r]})}),Object.keys(Pt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Pt[r]})}),Object.keys(Ae).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ae[r]})}),Object.keys(jt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>jt[r]})}),Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
108
+ `;function Lc(){if(typeof document>"u"||document.getElementById(Yl))return;const r=document.createElement("style");r.id=Yl,r.textContent=Mc,document.head.appendChild(r)}const Tc=({active:r=!1,accentSide:t="left",onClick:l,title:n,badge:o,heading:c,meta:i,children:s,divider:a=!0,disabled:d,className:y,style:b,"aria-label":p})=>(h.useEffect(Lc,[]),e.jsx("button",{type:"button",className:[Te,y].filter(Boolean).join(" "),"data-active":r?"true":"false","data-accent":t,"data-divider":a?"true":"false","aria-current":r?"true":void 0,"aria-label":p,disabled:d,onClick:l,style:b,children:s??e.jsxs(u.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(n||o)&&e.jsxs(oe.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[n?e.jsx(k.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:n}):e.jsx("span",{}),o?e.jsx(u.Box,{style:{flexShrink:0},children:o}):null]}),c?e.jsx(k.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:c}):null,i?e.jsx(k.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:i}):null]})})),yt=18,Ic=40,Xl="280ms cubic-bezier(0.4, 0, 0.2, 1)",$l="var(--sa-border-subtle, #0b120e24)",Oc=`1px solid ${$l}`,Kl="var(--sa-background-white, #ffffff)",Wc=({children:r,header:t,collapsed:l,defaultCollapsed:n=!1,onToggle:o,width:c=337,side:i="left",offsetTop:s="4rem",height:a,showToggle:d=!0,togglePosition:y="top",toggleOffset:b=40,toggleLabel:p,style:x,bodyStyle:L,className:v,pageLayout:T,overlay:F="mobile",wrapperProps:O,contentProps:B})=>{const D=pe.useMediaQuery("md"),H=l!==void 0,[z,S]=h.useState(n),I=H?l:z,V=()=>{const de=!I;H||S(de),o==null||o(de)},P=i==="left",Q=typeof s=="number"?`${s}px`:s,U=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${Q})`,re=p??{collapse:"Collapse panel",expand:"Expand panel"},fe=y==="center"?{top:"50%",transform:"translateY(-50%)"}:y==="bottom"?{bottom:b}:{top:b},se=I?P?"ChevronRight":"ChevronLeft":P?"ChevronLeft":"ChevronRight",ee=T!==void 0&&(F==="mobile"?!D:F),G=ee?{position:"absolute",top:0,bottom:0,width:c,transform:`translateX(${I?P?"-100%":"100%":"0"})`,transition:`transform ${Xl}`,zIndex:50,...P?{left:0}:{right:0},...x}:{position:"sticky",top:Q,alignSelf:"flex-start",width:I?0:c,flexShrink:0,height:U,transition:`width ${Xl}`,...x},X=e.jsxs(u.Box,{className:v,style:G,children:[e.jsx(u.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:I?void 0:P?"border-solid-r":"border-solid-l",borderWidth:I?void 0:P?"border-r":"border-l",style:{backgroundColor:Kl,borderColor:$l},children:e.jsxs(u.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:c,customMinWidth:c,style:P?void 0:{marginLeft:"auto"},children:[t?e.jsx(u.Box,{padding:"md",style:{flexShrink:0},children:t}):null,e.jsx(u.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...L},children:r})]})}),d&&e.jsx(yr,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:V,"aria-label":I?re.expand:re.collapse,"aria-expanded":!I,"aria-pressed":I,customWidth:yt,customHeight:Ic,style:{...fe,backgroundColor:Kl,border:Oc,zIndex:5,...P?{right:-yt,borderLeft:"none",borderRadius:"0 8px 8px 0"}:{left:-yt,borderRight:"none",borderRadius:"8px 0 0 8px"}},children:e.jsx(M.Icon,{name:se,size:"sm"})})]});return T===void 0?X:e.jsxs(u.Box,{direction:"row",position:"relative",...O,style:{height:`calc(100vh - ${Q})`,overflow:"hidden",...(O==null?void 0:O.style)??{}},children:[!ee&&P?X:null,e.jsx(u.Box,{display:"block",...B,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(B==null?void 0:B.style)??{}},children:T}),!ee&&!P?X:null,ee&&e.jsxs(e.Fragment,{children:[!I&&e.jsx("div",{onClick:V,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),X]})]})},Ac=({pageLayout:r,children:t,wrapperProps:l,containerProps:n})=>{const o=pe.useMediaQuery("md"),c=(n==null?void 0:n.customWidth)??264;return e.jsxs(u.Box,{display:"block",direction:"row",...l,style:{marginRight:o?c:24,...(l==null?void 0:l.style)??{}},children:[r,e.jsx(u.Box,{direction:"column",show:"desktop",as:"aside",position:"fixed",top:"top-0",bottom:"bottom-0",right:"right-0",customWidth:264,borderStyle:"border-solid-l",borderWidth:"border-l",...n,style:{marginTop:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(n==null?void 0:n.style)??{}},children:t})]})},pt="--sa-floating-footer-height",zc=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:l,containerProps:n})=>{const o=h.useRef(null);return h.useLayoutEffect(()=>{const c=document.documentElement,i=()=>{var d;const a=((d=o.current)==null?void 0:d.getBoundingClientRect().height)??0;c.style.setProperty(pt,`${a}px`)};i();const s=new ResizeObserver(i);return o.current&&s.observe(o.current),()=>{s.disconnect(),c.style.removeProperty(pt)}},[]),e.jsx(u.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 998)"},children:e.jsxs(u.Box,{ref:o,position:"fixed",bottom:"bottom-0",right:"right-0",bg:"white",direction:"row",align:"center",display:"flex",paddingBlock:"sm",paddingInline:"md",borderColor:"border-subtle",style:{left:"var(--app-sidebar-width, 0px)",transition:"left 0.3s ease-in-out"},justify:(n==null?void 0:n.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[t&&e.jsx(Jl,{...l,customBottom:(l==null?void 0:l.customBottom)||"5.7rem"}),r]})})},Hc=({fields:r})=>e.jsx(u.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(Hr,{of:r,render:(t,l)=>e.jsx(Vc,{...t},l)})}),Vc=({title:r,value:t,icon:l})=>e.jsxs(u.Box,{display:"flex",direction:"column",gap:"sm",children:[l?e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(M.Icon,{name:l,color:"subtle"}),e.jsx(k.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(k.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(k.Text,{variant:"sub-h3",children:t}):t]}),Se={silhouette:"#A7B0AC",accent:"#78867F"};function Pc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r||"100",height:t||"90",viewBox:"0 0 102 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M51.0002 16.8145C36.0811 16.8145 24.8296 21.3801 24.8296 27.4328V76.5344C24.8296 82.573 36.0799 87.127 51.0002 87.127C65.9204 87.127 77.1707 82.573 77.1707 76.5344V27.4328C77.1707 21.3801 65.9204 16.8145 51.0002 16.8145ZM51.0002 19.1582C65.0602 19.1582 74.8582 23.5187 74.8582 27.4328C74.8582 30.1363 70.1615 32.9664 63.1708 34.4746C55.861 36.0543 46.1416 36.0543 38.8318 34.4746C31.8399 32.9664 27.1432 30.1363 27.1432 27.4328C27.1432 23.5187 36.9402 19.1582 51.0002 19.1582ZM74.8582 31.9199V43.784C74.8582 46.532 70.3142 49.2941 63.2737 50.8328C63.2391 50.8375 63.2032 50.8434 63.1697 50.8504C57.6867 52.0352 50.8498 52.3305 44.6893 51.7387C42.6358 51.5418 40.6575 51.2453 38.8306 50.8504C38.8029 50.8445 38.7682 50.8387 38.7347 50.8352C32.5707 49.4898 28.318 47.2047 27.3514 44.8141C27.2138 44.4719 27.1421 44.1285 27.1421 43.7852V31.9199C27.1999 31.9715 27.2693 32.0207 27.3294 32.0723C27.5052 32.2246 27.6902 32.3758 27.8844 32.5234C27.9954 32.609 28.1064 32.6934 28.2232 32.7766C28.4371 32.9301 28.6637 33.0801 28.8973 33.2289C29.0083 33.2992 29.1135 33.3719 29.2291 33.441C29.5702 33.6473 29.9275 33.8488 30.3044 34.0434C30.3195 34.0516 30.3333 34.0598 30.3484 34.068C30.7427 34.2707 31.1601 34.4652 31.5925 34.6551C31.7301 34.716 31.8758 34.7734 32.0168 34.832C32.3221 34.9598 32.6331 35.0852 32.9557 35.207C33.1303 35.2727 33.3095 35.3359 33.4887 35.4004C33.8032 35.5117 34.1247 35.6207 34.4542 35.7273C34.6404 35.7871 34.8254 35.8469 35.015 35.9043C35.3734 36.0133 35.7434 36.1164 36.1181 36.2184C36.2915 36.2652 36.4603 36.3145 36.6361 36.3602C37.1911 36.5031 37.7588 36.6402 38.3485 36.7668C42.1595 37.5906 46.5336 38.0254 50.999 38.0254C55.4644 38.0254 59.8397 37.5906 63.6495 36.768C64.2404 36.6402 64.8092 36.5031 65.3666 36.3602C65.5377 36.3156 65.7007 36.2688 65.8684 36.223C66.2499 36.1199 66.6246 36.0145 66.9888 35.9031C67.1749 35.8469 67.3553 35.7883 67.5368 35.7309C67.8745 35.623 68.2028 35.5105 68.5243 35.3969C68.6966 35.3359 68.8677 35.275 69.0353 35.2117C69.3672 35.0863 69.6852 34.9574 69.9985 34.8262C70.1326 34.7699 70.2725 34.7148 70.4032 34.6574C70.8379 34.4664 71.2576 34.2707 71.6542 34.0668C71.66 34.0633 71.6658 34.0609 71.6716 34.0574C72.0589 33.8582 72.4243 33.6508 72.7735 33.441C72.8868 33.3719 72.9909 33.3016 73.1007 33.2313C73.3354 33.0813 73.5632 32.9312 73.7794 32.7766C73.8951 32.6934 74.0049 32.609 74.1159 32.5258C74.3102 32.377 74.4963 32.2258 74.6732 32.0723C74.7322 32.0207 74.8027 31.9727 74.8594 31.9211L74.8582 31.9199ZM74.8582 48.2887V60.1598C74.8582 62.8773 70.3396 65.6359 63.335 67.2004C63.2737 67.2051 63.2136 67.2156 63.1547 67.2285C59.5021 68.016 55.2482 68.4109 50.9955 68.4098C48.8692 68.4098 46.7428 68.3113 44.6917 68.1145C42.6405 67.9176 40.6656 67.6211 38.8399 67.2273C38.7832 67.2133 38.7266 67.2051 38.6699 67.2004C31.663 65.6359 27.1432 62.8785 27.1432 60.1598V48.2887C27.2022 48.3426 27.2739 48.393 27.3352 48.4457C27.5075 48.5945 27.6878 48.7422 27.8763 48.8875C27.9908 48.9754 28.1052 49.0633 28.2255 49.15C28.4348 49.3 28.6568 49.4477 28.8834 49.593C28.999 49.6668 29.1089 49.7418 29.228 49.8145C29.5633 50.0172 29.9136 50.2152 30.2825 50.4074C30.3114 50.4227 30.338 50.4379 30.3669 50.452C30.7507 50.6488 31.1566 50.8398 31.5775 51.0262C31.722 51.0895 31.8746 51.1504 32.0226 51.2125C32.3198 51.3379 32.6227 51.4609 32.9372 51.5793C33.1164 51.6473 33.2991 51.7129 33.4841 51.7785C33.7917 51.8887 34.1073 51.9953 34.4299 52.0996C34.6196 52.1605 34.8092 52.2227 35.0046 52.2812C35.3584 52.3891 35.7238 52.4922 36.0938 52.593C36.2684 52.641 36.4395 52.6902 36.6176 52.7359C37.1714 52.8789 37.738 53.016 38.3253 53.1426C38.3554 53.1496 38.3889 53.1555 38.4236 53.159C42.2161 53.9723 46.5636 54.4023 51.0013 54.4023C55.439 54.4023 59.7784 53.9734 63.5697 53.1613C63.6056 53.1566 63.6414 53.1508 63.6773 53.1426C64.2647 53.0148 64.8312 52.8789 65.3851 52.7359C65.5643 52.6902 65.7342 52.6398 65.9088 52.593C66.2788 52.4922 66.6442 52.3891 66.998 52.2812C67.1934 52.2215 67.3831 52.1605 67.5727 52.0996C67.8953 51.9953 68.2109 51.8887 68.5185 51.7785C68.7023 51.7129 68.8862 51.6473 69.0654 51.5793C69.3799 51.4598 69.6817 51.3367 69.98 51.2125C70.128 51.1504 70.2806 51.0895 70.4252 51.0262C70.846 50.841 71.2507 50.65 71.6357 50.452C71.6646 50.4367 71.6912 50.4215 71.7201 50.4074C72.0901 50.2152 72.4405 50.0172 72.7747 49.8145C72.8949 49.7418 73.0036 49.6668 73.1192 49.593C73.347 49.4477 73.5678 49.3 73.7771 49.15C73.8974 49.0633 74.0118 48.9766 74.1263 48.8875C74.3148 48.7422 74.4952 48.5945 74.6674 48.4457C74.7287 48.393 74.7992 48.3426 74.8582 48.2887ZM74.8582 76.5355C74.8582 80.4367 65.0602 84.7844 51.0002 84.7844C36.9402 84.7844 27.1421 80.4367 27.1421 76.5355V64.6469C27.1987 64.6984 27.2693 64.7477 27.3282 64.7992C27.5028 64.9504 27.6844 65.0992 27.8763 65.2469C27.9873 65.3324 28.0995 65.418 28.2162 65.5023C28.4302 65.6559 28.6568 65.807 28.8892 65.9559C28.9979 66.0262 29.1019 66.0977 29.2152 66.1656C29.5691 66.3801 29.9367 66.591 30.3299 66.7937C30.331 66.7937 30.3322 66.7938 30.3333 66.7961C30.7253 66.9988 31.1404 67.1945 31.5694 67.3855C31.7058 67.4465 31.8515 67.5039 31.9914 67.5637C32.2955 67.6926 32.6054 67.8191 32.928 67.9422C33.1002 68.0078 33.2772 68.0711 33.4541 68.1355C33.7674 68.248 34.0888 68.3582 34.4184 68.466C34.6034 68.5258 34.7872 68.5867 34.9768 68.6453C35.3341 68.7555 35.703 68.8609 36.0764 68.9641C36.2476 69.0109 36.4141 69.0602 36.5887 69.1059C37.1413 69.2512 37.7079 69.3895 38.2941 69.5195C38.3462 69.5312 38.3993 69.5383 38.4514 69.543C42.2369 70.3516 46.5717 70.7793 50.999 70.7793C55.4263 70.7793 59.7599 70.3527 63.5478 69.543C63.5998 69.5383 63.653 69.5312 63.705 69.5195C64.2912 69.3906 64.8578 69.2512 65.4105 69.1059C65.5839 69.0602 65.7493 69.0121 65.9192 68.9652C66.295 68.8621 66.665 68.7555 67.0246 68.6453C67.2131 68.5879 67.3958 68.5281 67.5785 68.4684C67.9092 68.3605 68.2329 68.2492 68.5486 68.1355C68.7231 68.0723 68.8977 68.009 69.0689 67.9445C69.3938 67.8203 69.7071 67.6926 70.0135 67.5625C70.1511 67.5039 70.2933 67.4477 70.4275 67.3879C71.29 67.0047 72.0774 66.5969 72.7851 66.1668C72.8972 66.0988 73.0001 66.0273 73.1088 65.9582C73.3424 65.8082 73.5702 65.657 73.7852 65.5023C73.9008 65.4191 74.0118 65.3336 74.1217 65.2492C74.3148 65.1016 74.4975 64.9516 74.6732 64.7992C74.7322 64.7488 74.8016 64.6996 74.8582 64.648V76.5355Z",fill:Se.silhouette}),e.jsx("path",{d:"M33.2089 38.8535C31.3993 38.8535 29.9263 40.3453 29.9263 42.1805C29.9263 44.0156 31.3982 45.5062 33.2089 45.5062C35.0196 45.5062 36.4903 44.0145 36.4903 42.1805C36.4903 40.3465 35.0184 38.8535 33.2089 38.8535ZM33.2089 43.1625C32.6735 43.1625 32.2388 42.7219 32.2388 42.1805C32.2388 41.6391 32.6735 41.1973 33.2089 41.1973C33.7442 41.1973 34.1778 41.6379 34.1778 42.1805C34.1778 42.723 33.7431 43.1625 33.2089 43.1625Z",fill:Se.silhouette}),e.jsx("path",{d:"M33.2089 54.6777C31.3993 54.6777 29.9263 56.1695 29.9263 58.0047C29.9263 59.8398 31.3982 61.3316 33.2089 61.3316C35.0196 61.3316 36.4903 59.8398 36.4903 58.0047C36.4903 56.1695 35.0184 54.6777 33.2089 54.6777ZM33.2089 58.9879C32.6735 58.9879 32.2388 58.5473 32.2388 58.0047C32.2388 57.4621 32.6735 57.0215 33.2089 57.0215C33.7442 57.0215 34.1778 57.4621 34.1778 58.0047C34.1778 58.5473 33.7431 58.9879 33.2089 58.9879Z",fill:Se.silhouette}),e.jsx("path",{d:"M33.2089 70.5C31.3993 70.5 29.9263 71.9918 29.9263 73.827C29.9263 75.6621 31.3982 77.1539 33.2089 77.1539C35.0196 77.1539 36.4903 75.6621 36.4903 73.827C36.4903 71.9918 35.0184 70.5 33.2089 70.5ZM33.2089 74.8102C32.6735 74.8102 32.2388 74.3695 32.2388 73.827C32.2388 73.2844 32.6735 72.8438 33.2089 72.8438C33.7442 72.8438 34.1778 73.2844 34.1778 73.827C34.1778 74.3695 33.7431 74.8102 33.2089 74.8102Z",fill:Se.silhouette}),e.jsx("path",{d:"M70.0215 38.2852C69.3821 38.2852 68.8652 38.809 68.8652 39.457V44.3332C68.8652 44.9812 69.3821 45.5051 70.0215 45.5051C70.6609 45.5051 71.1777 44.9812 71.1777 44.3332V39.457C71.1777 38.809 70.6609 38.2852 70.0215 38.2852Z",fill:Se.silhouette}),e.jsx("path",{d:"M70.0215 54.3926C69.3821 54.3926 68.8652 54.9164 68.8652 55.5645V60.4406C68.8652 61.0887 69.3821 61.6125 70.0215 61.6125C70.6609 61.6125 71.1777 61.0887 71.1777 60.4406V55.5645C71.1777 54.9164 70.6609 54.3926 70.0215 54.3926Z",fill:Se.silhouette}),e.jsx("path",{d:"M70.0215 70.5C69.3821 70.5 68.8652 71.0238 68.8652 71.6719V76.5492C68.8652 77.1973 69.3821 77.7211 70.0215 77.7211C70.6609 77.7211 71.1777 77.1973 71.1777 76.5492V71.6719C71.1777 71.0238 70.6609 70.5 70.0215 70.5Z",fill:Se.silhouette}),e.jsx("path",{d:"M65.77 39.7617C65.1306 39.7617 64.6138 40.2855 64.6138 40.9336V45.8098C64.6138 46.4578 65.1306 46.9816 65.77 46.9816C66.4094 46.9816 66.9263 46.4578 66.9263 45.8098V40.9336C66.9263 40.2855 66.4094 39.7617 65.77 39.7617Z",fill:Se.silhouette}),e.jsx("path",{d:"M65.77 55.8691C65.1306 55.8691 64.6138 56.393 64.6138 57.041V61.9172C64.6138 62.5652 65.1306 63.0891 65.77 63.0891C66.4094 63.0891 66.9263 62.5652 66.9263 61.9172V57.041C66.9263 56.393 66.4094 55.8691 65.77 55.8691Z",fill:Se.silhouette}),e.jsx("path",{d:"M65.77 71.9766C65.1306 71.9766 64.6138 72.5004 64.6138 73.1484V78.0246C64.6138 78.6727 65.1306 79.1965 65.77 79.1965C66.4094 79.1965 66.9263 78.6727 66.9263 78.0246V73.1484C66.9263 72.5004 66.4094 71.9766 65.77 71.9766Z",fill:Se.silhouette}),e.jsx("path",{d:"M61.2939 40.7246C60.6545 40.7246 60.1377 41.2484 60.1377 41.8965V46.7727C60.1377 47.4207 60.6545 47.9445 61.2939 47.9445C61.9334 47.9445 62.4502 47.4207 62.4502 46.7727V41.8965C62.4502 41.2484 61.9334 40.7246 61.2939 40.7246Z",fill:Se.silhouette}),e.jsx("path",{d:"M61.2939 56.832C60.6545 56.832 60.1377 57.3559 60.1377 58.0039V62.8801C60.1377 63.5281 60.6545 64.052 61.2939 64.052C61.9334 64.052 62.4502 63.5281 62.4502 62.8801V58.0039C62.4502 57.3559 61.9334 56.832 61.2939 56.832Z",fill:Se.silhouette}),e.jsx("path",{d:"M61.2939 72.9395C60.6545 72.9395 60.1377 73.4633 60.1377 74.1113V78.9875C60.1377 79.6355 60.6545 80.1594 61.2939 80.1594C61.9334 80.1594 62.4502 79.6355 62.4502 78.9875V74.1113C62.4502 73.4633 61.9334 72.9395 61.2939 72.9395Z",fill:Se.silhouette}),e.jsx("path",{d:"M39.0489 24.4037C39.131 24.4037 39.2154 24.3944 39.2986 24.3768C42.7316 23.6127 46.6755 23.185 51.0207 23.11C51.659 23.0983 52.1677 22.5651 52.1561 21.917C52.1446 21.2701 51.652 20.7451 50.9791 20.7662C46.4813 20.8448 42.3835 21.2889 38.8015 22.0881C38.1782 22.2264 37.7828 22.8522 37.9204 23.4838C38.0395 24.0311 38.5182 24.4037 39.0489 24.4037Z",fill:Se.silhouette}),e.jsx("path",{d:"M32.5406 26.6215C32.7407 26.6215 32.9442 26.57 33.128 26.4586C33.1315 26.4563 33.5096 26.2336 34.2889 25.9055C34.8786 25.6582 35.1584 24.9727 34.9144 24.3739C34.6704 23.775 33.9917 23.4926 33.4032 23.7399C32.4632 24.1348 31.9926 24.4149 31.9417 24.4465C31.396 24.7782 31.219 25.4942 31.544 26.0485C31.7613 26.4164 32.1452 26.6204 32.5395 26.6204L32.5406 26.6215Z",fill:Se.silhouette}),e.jsx("path",{d:"M92.7251 26.7272L82.3845 29.3124C81.6929 29.4856 80.9911 29.0642 80.8179 28.3727C80.6447 27.6799 81.066 26.978 81.7576 26.8048L92.0982 24.2196C92.791 24.0464 93.4929 24.4678 93.6661 25.1593C93.8393 25.8521 93.4179 26.554 92.7251 26.7272Z",fill:Se.accent,fillOpacity:"0.65"}),e.jsx("path",{d:"M94.4649 11.0082L80.2465 21.3488C79.6701 21.7676 78.8609 21.6409 78.4408 21.0632C78.022 20.4867 78.1487 19.6775 78.7265 19.2574L92.9448 8.91682C93.5213 8.49803 94.3305 8.6247 94.7505 9.20248C95.1693 9.77897 95.0414 10.5881 94.4649 11.0082Z",fill:Se.accent,fillOpacity:"0.65"}),e.jsx("path",{d:"M78.0091 10.6269L74.1314 17.0898C73.7643 17.7025 72.9706 17.9002 72.358 17.5331C71.7466 17.1673 71.5475 16.3724 71.9146 15.7597L75.7923 9.29684C76.1594 8.68545 76.9544 8.48769 77.5657 8.85349C78.1784 9.22058 78.3762 10.0155 78.0091 10.6269Z",fill:Se.accent,fillOpacity:"0.65"})]})})}const jc=({title:r="create",children:t,onClickAction:l,variant:n="primary",variantTitle:o,leftIcon:c,showButton:i=!0,customHeight:s,childrenButton:a,customIcon:d})=>{const y=()=>{switch(n){case"primary":return e.jsx(e.Fragment,{children:c?e.jsx(j.Button,{primary:!0,iconLeft:c,onClick:l,children:a||r}):e.jsx(j.Button,{primary:!0,onClick:l,children:a||r})});case"secondary":return e.jsx(e.Fragment,{children:c?e.jsx(j.Button,{secondary:!0,iconLeft:c,onClick:l,children:o?e.jsx(k.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||r}):r}):e.jsx(j.Button,{secondary:!0,onClick:l,children:a||r})});case"success":return e.jsx(e.Fragment,{children:c?e.jsx(j.Button,{success:!0,iconLeft:c,onClick:l,children:a||r}):e.jsx(j.Button,{success:!0,onClick:l,children:a||r})});default:return e.jsx(e.Fragment,{children:c?e.jsx(j.Button,{primary:!0,iconLeft:c,onClick:l,children:a||r}):e.jsx(j.Button,{primary:!0,onClick:l,children:a||r})})}};return e.jsxs(u.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:s,children:[d||e.jsx(Pc,{}),e.jsx(u.Box,{direction:"column",children:t.map((b,p)=>e.jsx(He.Body1,{props:{align:"center",textAlign:"center"},children:p>2?null:b},p))}),i?y():null]})},R={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function Nc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke:R.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("path",{d:"M233.438 165.217C233.438 132.764 239.035 107.198 250.231 88.5189C261.596 69.8396 279.832 60.5 304.938 60.5C330.043 60.5 348.194 69.8396 359.389 88.5189C370.755 107.198 376.438 132.764 376.438 165.217C376.438 198.047 370.755 223.802 359.389 242.481C348.194 261.16 330.043 270.5 304.938 270.5C279.832 270.5 261.596 261.16 250.231 242.481C239.035 223.802 233.438 198.047 233.438 165.217ZM333.69 165.217C333.69 146.16 331.824 131.538 328.092 121.349C324.36 110.972 316.642 105.783 304.938 105.783C293.233 105.783 285.515 110.972 281.783 121.349C278.051 131.538 276.185 146.16 276.185 165.217C276.185 178.047 276.863 188.708 278.22 197.198C279.577 205.5 282.292 212.292 286.363 217.575C290.604 222.67 296.795 225.217 304.938 225.217C313.08 225.217 319.187 222.67 323.258 217.575C327.499 212.292 330.298 205.5 331.655 197.198C333.012 188.708 333.69 178.047 333.69 165.217Z",fill:R.cD0E5F7}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.4375 235.124V194.28L138.96 60.5H192.466V191.32H215.438V235.124H192.466V249.5H144.563V235.124H50.4375ZM100.862 191.32L147.925 116.143V191.32H100.862Z",fill:R.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M394.438 235.124V194.28L482.96 60.5H536.466V191.32H559.438V235.124H536.466V249.5H488.563V235.124H394.438ZM444.862 191.32L491.925 116.143V191.32H444.862Z",fill:R.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:R.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:R.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:R.c98B4CB}),e.jsx("path",{d:"M244.719 200.89V264.5H363.574V200.89M244.719 200.89H233.438L244.719 186.396M244.719 200.89H363.574M363.574 200.89H372.437L363.574 186.396M244.719 186.396L261.64 171.5M244.719 186.396H261.64M363.574 186.396L349.472 171.5M363.574 186.396H349.472M261.64 171.5H349.472M261.64 171.5V186.396M349.472 171.5V186.396M349.472 186.396H261.64",stroke:R.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:R.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:R.cFFFFFF}),e.jsx("path",{d:"M332.438 129.846C332.438 141.175 329.183 152.403 323.949 160.772C318.699 169.168 311.592 174.5 303.938 174.5C296.283 174.5 289.176 169.168 283.926 160.772C278.692 152.403 275.438 141.175 275.438 129.846C275.438 118.458 277.838 109.628 282.543 103.663C287.216 97.7387 294.274 94.5 303.938 94.5C313.601 94.5 320.659 97.7387 325.332 103.663C330.037 109.628 332.438 118.458 332.438 129.846Z",fill:R.cFFFFFF,stroke:R.c000000,strokeWidth:"2"}),e.jsx("path",{d:"M281.438 145.5C284.032 154.136 285.762 158.682 290.951 164.591M292.681 166.409C293.624 167.647 295.708 169.591 297.438 170.5",stroke:R.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.438 175C299.54 176.339 297.208 177.876 293.938 182.5M304.438 175C301.183 178.041 299.537 178.883 299.438 182.5M304.438 175C308.173 177.107 309.635 178.834 311.438 182.5",stroke:R.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.936 175.5C303.438 180 302.529 181.628 304.936 186.5",stroke:R.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.178 120.981C289.969 120.93 290.921 121.313 292.167 122.754",stroke:R.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:R.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:R.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:R.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:R.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:R.c001A72,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M265.437 115.5L260.438 120.5M260.438 115.5L265.438 120.5",stroke:R.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.437 87.5L283.438 92.5M283.438 87.5L288.438 92.5",stroke:R.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M305.437 83.5L298.438 90.5M298.438 83.5L305.438 90.5",stroke:R.c001A72,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M342.437 145.5L337.438 150.5M337.438 145.5L342.438 150.5",stroke:R.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:R.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:R.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:R.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:R.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:R.c001A72})]})})}function _c({onClick:r}){const t=pe.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Nc,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(k.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const te={c46F16B:"#46F16B",c48504C:"#48504C",c64B5F6:"#64B5F6",c67AEE6:"#67AEE6",c86512B:"#86512B",c956847:"#956847",cBBC3F5:"#BBC3F5",cBBDEFB:"#BBDEFB",cC0B2A2:"#C0B2A2",cC8CEF4:"#C8CEF4",cCABEB1:"#CABEB1",cD5C7BD:"#D5C7BD",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cE5EE80:"#E5EE80",cEE8080:"#EE8080",cEFF3F8:"#EFF3F8",cF4F4F4:"#F4F4F4",cFFFFFF:"#FFFFFF"};function qc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M75 238.124V197.28L163.523 63.5H217.029V194.32H240V238.124H217.029V252.5H169.126V238.124H75ZM125.424 194.32L172.487 119.143V194.32H125.424Z",fill:te.cBBDEFB,fillOpacity:"0.6"}),e.jsxs("g",{clipPath:"url(#clip0_2949_9690)",children:[e.jsx("path",{d:"M334.5 274.5C381.168 274.5 419 227.266 419 169C419 110.734 381.168 63.5 334.5 63.5C287.832 63.5 250 110.734 250 169C250 227.266 287.832 274.5 334.5 274.5Z",fill:te.cEFF3F8,stroke:te.c67AEE6,strokeWidth:"5"}),e.jsx("path",{d:"M413 197.5C411.397 211.835 402.919 230.898 389.361 246.49C375.596 262.32 356.651 274.5 334.496 274.5C311.331 274.5 292.389 261.672 278.878 245.52C265.592 229.638 257.606 210.603 256 197.5H413Z",fill:te.cD5C7BD}),e.jsx("path",{d:"M278.887 211.766H391.104L392.583 222.856C392.687 223.635 392.08 224.328 391.294 224.328H277.961C277.14 224.328 276.525 223.577 276.686 222.773L278.887 211.766Z",fill:te.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:te.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:te.c956847,stroke:te.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:te.c956847,stroke:te.c48504C}),e.jsx("path",{d:"M285.902 212.103L284.935 186.306H279.606C278.151 186.306 277.004 187.542 277.113 188.993L278.673 209.79C278.77 211.095 279.857 212.103 281.166 212.103H285.902Z",fill:te.cC8CEF4,stroke:te.c48504C}),e.jsx("path",{d:"M383.256 212.103L384.638 186.306H389.556C391.007 186.306 392.153 187.537 392.05 188.984L390.564 209.782C390.471 211.09 389.382 212.103 388.07 212.103H383.256Z",fill:te.cC8CEF4,stroke:te.c48504C}),e.jsx("path",{d:"M284.497 178.155C284.455 176.194 286.034 174.581 287.996 174.581H381.904C383.895 174.581 385.485 176.24 385.401 178.23L384.066 209.59C383.987 211.463 382.445 212.941 380.569 212.941H288.663C286.759 212.941 285.205 211.419 285.164 209.515L284.497 178.155Z",fill:te.cC8CEF4,stroke:te.c48504C}),e.jsx("path",{d:"M284.845 181.524C284.792 179.279 286.598 177.431 288.844 177.431H380.687C382.948 177.431 384.76 179.304 384.684 181.565L383.774 208.737C383.701 210.893 381.933 212.603 379.776 212.603H289.48C287.307 212.603 285.532 210.869 285.481 208.697L284.845 181.524Z",fill:te.cBBC3F5}),e.jsx("mask",{id:"mask0_2949_9690",maskUnits:"userSpaceOnUse",x:"301",y:"144",width:"68",height:"17",style:{maskType:"luminance"},children:e.jsx("path",{d:"M301 146.5C301 145.395 301.887 144.5 302.98 144.5H367.02C368.114 144.5 369 145.395 369 146.5V160.411H301V146.5Z",fill:te.cFFFFFF})}),e.jsxs("g",{mask:"url(#mask0_2949_9690)",children:[e.jsx("path",{d:"M301 146.191C301 145.257 301.748 144.5 302.671 144.5H356.701C357.624 144.5 358.372 145.257 358.372 146.191V157.949H301V146.191Z",fill:te.cFFFFFF}),e.jsx("path",{d:"M301.336 146.607C301.336 145.673 302.08 144.916 302.999 144.916H367.01C367.929 144.916 368.673 145.673 368.673 146.607V152.523H301.336V146.607Z",fill:te.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:te.cF4F4F4}),e.jsx("path",{d:"M307.685 150.417C308.607 150.417 309.356 149.66 309.356 148.726C309.356 147.793 308.607 147.036 307.685 147.036C306.762 147.036 306.014 147.793 306.014 148.726C306.014 149.66 306.762 150.417 307.685 150.417Z",fill:te.cEE8080}),e.jsx("path",{d:"M313.532 150.417C314.455 150.417 315.203 149.66 315.203 148.726C315.203 147.793 314.455 147.036 313.532 147.036C312.609 147.036 311.861 147.793 311.861 148.726C311.861 149.66 312.609 150.417 313.532 150.417Z",fill:te.cE5EE80}),e.jsx("path",{d:"M318.546 150.417C319.469 150.417 320.217 149.66 320.217 148.726C320.217 147.793 319.469 147.036 318.546 147.036C317.623 147.036 316.875 147.793 316.875 148.726C316.875 149.66 317.623 150.417 318.546 150.417Z",fill:te.c46F16B})]}),e.jsx("path",{d:"M301.16 146C301.16 145.172 301.832 144.5 302.66 144.5H367.33C368.159 144.5 368.83 145.172 368.83 146V174.419H301.16V146Z",stroke:te.c48504C}),e.jsx("path",{d:"M395.29 207.579H423.344M354.255 236.889H369.329M327.038 222.234H347.556M350.905 222.234H358.024M288.097 230.19H304.846M253.344 210.091H272.605M278.467 246.938H295.216M297.309 246.938H303.59M337.088 252.801H354.255",stroke:te.c86512B,strokeWidth:"2",strokeLinecap:"round"})]}),e.jsx("path",{d:"M430.241 125.78C430.987 105.807 437.521 90.4065 449.841 79.5799C462.161 68.7532 478.867 63.3398 499.961 63.3398C513.961 63.3398 525.907 65.7665 535.801 70.6199C545.881 75.4732 553.441 82.0998 558.481 90.4998C563.707 98.8998 566.321 108.327 566.321 118.78C566.321 131.1 563.241 141.18 557.081 149.02C550.921 156.673 543.734 161.9 535.521 164.7V165.82C546.161 169.367 554.561 175.247 560.721 183.46C566.881 191.673 569.961 202.22 569.961 215.1C569.961 226.673 567.254 236.94 561.841 245.9C560.436 248.258 558.849 250.481 557.081 252.569L443.5 252.662C432.5 241 427.721 230.5 427.721 207.82H474.201C474.387 216.033 476.721 222.567 481.201 227.42C485.681 232.087 492.214 234.42 500.801 234.42C508.081 234.42 513.681 232.367 517.601 228.26C521.707 223.967 523.761 218.367 523.761 211.46C523.761 202.5 520.867 196.06 515.081 192.14C509.481 188.033 500.427 185.98 487.921 185.98H478.961V147.06H487.921C497.441 147.06 505.094 145.473 510.881 142.3C516.854 138.94 519.841 133.06 519.841 124.66C519.841 117.94 517.974 112.713 514.241 108.98C510.507 105.247 505.374 103.38 498.841 103.38C491.747 103.38 486.427 105.527 482.881 109.82C479.521 114.113 477.561 119.433 477.001 125.78H430.241Z",fill:te.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:te.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_2949_9690",children:e.jsx("rect",{width:"179",height:"192",fill:te.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function Zc({onClick:r}){const t=pe.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(qc,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const f={c000D58:"#000D58",c001174:"#001174",c28AC6E:"#28AC6E",c48504C:"#48504C",c64B5F6:"#64B5F6",c90CAF9:"#90CAF9",cC9184A:"#C9184A",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cD9D9D9:"#D9D9D9",cDEECF8:"#DEECF8",cE7EAE9:"#E7EAE9",cF3F8FD:"#F3F8FD",cFFE18B:"#FFE18B",cFFFFFF:"#FFFFFF"};function Gc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 287",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M406.562 180.997C406.562 148.544 412.16 122.978 423.356 104.299C434.721 85.6199 452.957 76.2803 478.063 76.2803C503.168 76.2803 521.319 85.6199 532.514 104.299C543.88 122.978 549.562 148.544 549.562 180.997C549.562 213.827 543.88 239.582 532.514 258.261C521.319 276.941 503.168 286.28 478.063 286.28C452.957 286.28 434.721 276.941 423.356 258.261C412.16 239.582 406.562 213.827 406.562 180.997ZM506.815 180.997C506.815 161.941 504.949 147.318 501.217 137.129C497.485 126.752 489.767 121.563 478.063 121.563C466.358 121.563 458.64 126.752 454.908 137.129C451.176 147.318 449.31 161.941 449.31 180.997C449.31 193.827 449.988 204.488 451.345 212.978C452.703 221.28 455.417 228.073 459.488 233.356C463.729 238.45 469.92 240.997 478.063 240.997C486.205 240.997 492.312 238.45 496.383 233.356C500.624 228.073 503.423 221.28 504.78 212.978C506.137 204.488 506.815 193.827 506.815 180.997Z",fill:f.cD6EBFD}),e.jsx("path",{d:"M246.562 180.558C246.562 148.105 252.16 122.539 263.356 103.86C274.721 85.1804 292.957 75.8408 318.063 75.8408C343.168 75.8408 361.319 85.1804 372.514 103.86C383.88 122.539 389.562 148.105 389.562 180.558C389.562 213.388 383.88 239.143 372.514 257.822C361.319 276.501 343.168 285.841 318.063 285.841C292.957 285.841 274.721 276.501 263.356 257.822C252.16 239.143 246.562 213.388 246.562 180.558ZM346.815 180.558C346.815 161.501 344.949 146.879 341.217 136.69C337.485 126.313 329.767 121.124 318.063 121.124C306.358 121.124 298.64 126.313 294.908 136.69C291.176 146.879 289.31 161.501 289.31 180.558C289.31 193.388 289.988 204.048 291.345 212.539C292.702 220.841 295.417 227.633 299.488 232.916C303.729 238.011 309.92 240.558 318.063 240.558C326.205 240.558 332.312 238.011 336.383 232.916C340.624 227.633 343.423 220.841 344.78 212.539C346.137 204.048 346.815 193.388 346.815 180.558Z",fill:f.cD6EBFD}),e.jsx("path",{d:"M222.808 118.703H128.062V159.858C132.111 155.484 137.779 151.905 145.067 149.122C152.356 146.338 160.251 144.946 168.754 144.946C183.938 144.946 196.49 148.326 206.41 155.086C216.532 161.846 223.922 170.594 228.578 181.329C233.234 192.065 235.562 203.696 235.562 216.221C235.562 239.483 228.882 257.972 215.52 271.691C202.158 285.21 183.357 282.89 159.062 282.89C142.867 282.89 131.098 284.939 116.826 283.918C104.881 278.351 95.6695 270.697 89.1911 260.955C82.7127 251.213 79.1698 239.98 78.5625 227.256H129.276C130.491 233.419 133.426 238.588 138.083 242.763C142.739 246.739 149.116 248.728 157.214 248.728C166.729 248.728 173.815 245.745 178.472 239.781C183.128 233.817 185.456 225.864 185.456 215.923C185.456 206.181 183.027 198.726 178.168 193.557C173.309 188.387 166.223 185.803 156.911 185.803C150.027 185.803 144.359 187.493 139.905 190.873C135.451 194.054 132.515 198.328 131.098 203.696H80.9919V73.9697H222.808V118.703Z",fill:f.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:f.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 200.539C269.878 200.263 270.101 200.039 270.377 200.039L305.476 199.955C305.753 199.955 305.978 200.179 305.978 200.455V206.461H269.878V200.539Z",stroke:f.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 235.871C269.878 235.595 270.101 235.372 270.377 235.371L305.476 235.288C305.753 235.287 305.978 235.511 305.978 235.788V241.794H269.878V235.871Z",stroke:f.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 272.088C269.878 271.812 270.101 271.589 270.377 271.588L305.476 271.505C305.753 271.504 305.978 271.728 305.978 272.005V278.011H269.878V272.088Z",stroke:f.c001174}),e.jsx("path",{d:"M279.095 176.348H364.373C365.459 176.348 366.125 176.992 366.986 178.252V202.985C366.986 202.985 366.986 203.869 366.545 204.752C366.103 205.635 365.661 206.077 365.661 206.077L306.478 206.163V199.452L279.095 199.518V176.348Z",fill:f.cF3F8FD}),e.jsx("path",{d:"M279.095 211.093H364.373C365.459 211.093 366.125 211.736 366.986 212.997V237.73C366.986 237.73 366.986 238.613 366.545 239.497C366.103 240.38 365.661 240.822 365.661 240.822L306.478 240.908V234.197L279.095 234.262V211.093Z",fill:f.cF3F8FD}),e.jsx("path",{d:"M279.095 248.008H364.373C365.459 248.008 366.125 248.652 366.986 249.912V274.646C366.986 274.646 366.986 275.529 366.545 276.412C366.103 277.296 365.661 277.737 365.661 277.737L306.478 277.824V271.112L279.095 271.178V248.008Z",fill:f.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("path",{d:"M268.053 210.494C268.483 209.112 268.564 208.343 268.053 206.961H362.569C361.955 208.363 361.972 209.136 362.569 210.494H268.053Z",fill:f.c000D58,stroke:f.c001174}),e.jsx("path",{d:"M268.053 246.269C268.483 244.887 268.564 244.118 268.053 242.736H362.569C361.955 244.138 361.972 244.911 362.569 246.269H268.053Z",fill:f.c000D58,stroke:f.c001174}),e.jsx("path",{d:"M283.312 130.775C283.312 129.64 283.987 128.72 284.82 128.72H349.805C350.638 128.72 351.312 129.64 351.312 130.775V169.72H283.312V130.775Z",fill:f.cFFFFFF,stroke:f.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M279.574 171.847C279.381 171.283 279.267 170.624 279.33 169.72H355.195C355.423 170.925 355.287 171.695 355.063 172.241C354.834 172.802 354.506 173.186 354.101 173.66C354.084 173.68 354.067 173.7 354.05 173.72H280.503C280.468 173.658 280.434 173.598 280.4 173.539C280.051 172.922 279.774 172.434 279.574 171.847Z",stroke:f.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M350.312 133.72V129.726L284.812 129.72C284.312 129.726 284.312 129.726 284.312 130.125V133.72H350.312Z",fill:f.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:f.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:f.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:f.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:f.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:f.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Qc({onClick:r}){const t=pe.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(Gc,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(k.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const Uc=r=>{var l,n,o,c,i;const t=pe.useMediaQuery("md");return e.jsxs(Ae.Dialog,{isShow:r.isShow,onHide:r.onHide,style:{...t?{minWidth:r.customMinWidth||"458px"}:{maxWidth:r.customMinWidth||"458px"}},children:[e.jsx(Ae.DialogTitle,{...r.dialogTitleProps,children:typeof r.title=="string"?e.jsx(k.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(Ae.DialogBody,{children:typeof r.description=="string"?e.jsx(k.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:r.description}):r.description}),e.jsx(Ae.DialogFooter,{children:e.jsx(u.Box,{display:"flex",direction:((l=r.containerConfirmBtnProps)==null?void 0:l.direction)||"row",justify:((n=r.containerConfirmBtnProps)==null?void 0:n.justify)||"flex-end",...r.containerConfirmBtnProps,children:e.jsxs(u.Box,{display:"flex",direction:((o=r.wrapperConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((c=r.wrapperConfirmBtnProps)==null?void 0:c.justify)||"flex-end",gap:((i=r.wrapperConfirmBtnProps)==null?void 0:i.gap)||"sm",...r.wrapperConfirmBtnProps,children:[r.onCancel&&e.jsx(j.Button,{secondary:!0,onClick:r.onCancel,size:"md",fullWidth:!0,children:r.titleCancelBtn||"Cancel"}),e.jsx(u.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(j.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},Jc=h.memo(({children:r,height:t,minHeight:l,customHeight:n,paddingInline:o="spacing-0",paddingBlock:c="spacing-0",header:i,footer:s,title:a,titleTag:d,action:y,actionContainer:b,containerProps:p,bodyProps:x,headerProps:L={borderBottom:!0},footerProps:v={borderTop:!0},variantTag:T="info"})=>{const F=h.useRef(null),[O,B]=h.useState("100vh");h.useEffect(()=>{const S=()=>{if(F.current){const I=F.current.getBoundingClientRect().top;B(`calc(100vh - ${I}px)`)}};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const D=()=>d?e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(k.Text,{fontWeight:"medium",children:a}),e.jsx($e.Badges,{border:!0,text:d,variant:T})]}):e.jsx(k.Text,{fontWeight:"medium",children:a}),H=()=>i||e.jsxs(u.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(u.Box,{direction:"column",children:a?D():null}),e.jsx(u.Box,{direction:"column",...b,children:y??null})]}),z=!!(i||a||y);return e.jsxs(u.Box,{ref:F,height:t,customMinHeight:l,customHeight:n,paddingBlock:c,paddingInline:o,bg:"white",direction:"column",...p,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:O,...(p==null?void 0:p.style)??{}},children:[i!==null&&z?e.jsx(lt,{...L,children:H()}):null,e.jsx(u.Box,{direction:"column",padding:"spacing-0",...x,style:{flex:1,overflow:"auto",...(x==null?void 0:x.style)??{}},children:r}),s?e.jsx(ot,{...v,children:s}):null]})}),Yc=h.memo(({value:r,options:t=[],onChange:l,multiple:n})=>{const o=(r==null?void 0:r.map(s=>s.value))||[],c=(t==null?void 0:t.filter(s=>o.includes(s.value)))||[],i=s=>{const a=[...c];let d=[];n?d=o.includes(s.value)?a.filter(y=>y.value!==s.value):[...a,s]:d=[s],l==null||l(d)};return e.jsx(u.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:t==null?void 0:t.map((s,a)=>e.jsx(j.Button,{...o.includes(s.value)?{primary:!0}:{secondary:!0},onClick:()=>i(s),children:s.label},a))})});function Vr(r){return null}Vr.displayName="LayoutDialog.Header";function Pr(r){return null}Pr.displayName="LayoutDialog.Body";function jr(r){return null}jr.displayName="LayoutDialog.Aside";function Nr(r){return null}Nr.displayName="LayoutDialog.Footer";const Fe={"lyd-root":"_lyd-root_14rlp_1","lyd-backdrop":"_lyd-backdrop_14rlp_34","lyd-panel":"_lyd-panel_14rlp_43","lyd-modal":"_lyd-modal_14rlp_54","lyd-fullscreen":"_lyd-fullscreen_14rlp_64","lyd-sidebar":"_lyd-sidebar_14rlp_72","lyd-header":"_lyd-header_14rlp_100","lyd-header-content":"_lyd-header-content_14rlp_111","lyd-header-actions":"_lyd-header-actions_14rlp_119","lyd-main":"_lyd-main_14rlp_126","lyd-body":"_lyd-body_14rlp_133","lyd-aside":"_lyd-aside_14rlp_139","lyd-footer":"_lyd-footer_14rlp_155","lyd-vm-group":"_lyd-vm-group_14rlp_168","lyd-vm-btn":"_lyd-vm-btn_14rlp_176","lyd-close-btn":"_lyd-close-btn_14rlp_199"},Xc=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(Kc,{})},{mode:"modal",label:"Modal",icon:e.jsx(M.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(M.Icon,{name:"Fullscreen",size:"sm"})}];function $c({value:r,onChange:t}){return e.jsx("div",{className:Fe["lyd-vm-group"],role:"group","aria-label":"View mode",children:Xc.map(l=>e.jsx("button",{type:"button",className:Fe["lyd-vm-btn"],"data-active":r===l.mode,"aria-label":`Switch to ${l.label} view`,"aria-pressed":r===l.mode,onClick:()=>t(l.mode),children:l.icon},l.mode))})}function Kc(){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),e.jsx("line",{x1:"15",y1:"4",x2:"15",y2:"20"})]})}const bt={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function Rc(r){return r?r in bt?bt[r]:r:bt.xl}function _r(r,t){let l=null;return h.Children.forEach(r,n=>{h.isValidElement(n)&&n.type===t&&(l=n.props.children??null)}),l}function es(r){const{isOpen:t,onClose:l,viewMode:n,defaultViewMode:o="modal",onViewModeChange:c,showViewModeToggle:i=!0,showCloseButton:s=!0,size:a,asideWidth:d,disableEscapeClose:y=!1,disableBackdropClose:b=!1,lockBodyScroll:p=!0,children:x}=r,[L,v]=h.useState(o),T=n??L,O=pe.useMediaQuery("md")?T:"fullscreen",B=h.useCallback(U=>{n===void 0&&v(U),c==null||c(U)},[n,c]),D=h.useRef(null);h.useEffect(()=>{if(!(!t||!p))return D.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=D.current??""}},[t,p]),h.useEffect(()=>{if(!t||y)return;const U=re=>{re.key==="Escape"&&l()};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[t,y,l]);const H=h.useMemo(()=>_r(x,Vr),[x]),z=h.useMemo(()=>_r(x,Pr),[x]),S=h.useMemo(()=>_r(x,jr),[x]),I=h.useMemo(()=>_r(x,Nr),[x]);if(!t)return null;const V=[Fe["lyd-panel"],O==="modal"&&Fe["lyd-modal"],O==="fullscreen"&&Fe["lyd-fullscreen"],O==="sidebar"&&Fe["lyd-sidebar"]].filter(Boolean).join(" "),P={"--lyd-max-w":Rc(a),...d!==void 0&&{"--lyd-aside-w":d}},Q=()=>{b||l()};return e.jsxs("div",{className:Fe["lyd-root"],style:P,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:Fe["lyd-backdrop"],onClick:Q,"aria-hidden":"true"}),e.jsxs("div",{className:V,children:[e.jsxs("div",{className:Fe["lyd-header"],children:[e.jsx("div",{className:Fe["lyd-header-content"],children:H}),e.jsxs("div",{className:Fe["lyd-header-actions"],children:[i&&e.jsx($c,{value:T,onChange:B}),s&&e.jsx("button",{type:"button",className:Fe["lyd-close-btn"],onClick:l,"aria-label":"Close dialog",children:e.jsx(M.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:Fe["lyd-main"],children:[e.jsx("div",{className:Fe["lyd-body"],children:z}),S&&e.jsx("aside",{className:Fe["lyd-aside"],children:S})]}),I&&e.jsx("div",{className:Fe["lyd-footer"],children:I})]})]})}const xr=es;xr.Header=Vr,xr.Body=Pr,xr.Aside=jr,xr.Footer=Nr;function rs({url:r,filename:t,onClose:l}){return h.useEffect(()=>{const n=o=>{o.key==="Escape"&&l()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[l]),e.jsxs("div",{onClick:l,style:{position:"fixed",inset:0,zIndex:9999,backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px"},children:[e.jsxs("div",{onClick:n=>n.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:r,download:t,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.15)",color:"#fff",borderRadius:"var(--sa-radii-sm, 6px)",fontSize:"13px",textDecoration:"none",backdropFilter:"blur(4px)"},children:"Download"}),e.jsx("button",{onClick:l,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",backgroundColor:"rgba(255,255,255,0.15)",border:"none",borderRadius:"var(--sa-radii-sm, 6px)",color:"#fff",cursor:"pointer",backdropFilter:"blur(4px)"},"aria-label":"Close preview",children:"✕"})]}),e.jsx("img",{src:r,alt:t,onClick:n=>n.stopPropagation(),style:{maxWidth:"90vw",maxHeight:"85vh",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-lg, 0 25px 50px rgba(0,0,0,0.5))"}}),e.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:t})]})}const ts=r=>{const{defaultTab:t=0,paramKey:l="tab"}=r||{},[n,o]=be.useSearchParams(),c=cr.searchParamsToObject(n.toString());return{activeTab:c[l]?parseInt(c[l]):t,handleTabChange:a=>{o({...c,[l]:a.toString()})},searchQueries:c}};function ls({appName:r,menuConfig:t,formatTitle:l}){const n=be.useLocation();h.useEffect(()=>{let o=null,c=null;for(const a of t){const d=a.items.find(y=>y.to?y.to==="/"?n.pathname==="/":!!(y.to===n.pathname||n.pathname.startsWith(y.to+"/")):!1);if(d){o=d,c=a;break}}const i=[];o!=null&&o.title&&i.push(o.title),c!=null&&c.name&&i.push(c.name.toTitleCase());const s=(a,d)=>a.length>0?`${a.join(" - ")} | ${d}`:d;document.title=(l||s)(i,r)},[n.pathname])}const os=()=>{const[r,t]=be.useSearchParams(),l=cr.searchParamsToObject(r.toString()),n=be.useParams(),o=be.useLocation(),c=n.id;return{setSearchParams:t,searchParams:r,searchQueries:l,isHasQuery:(y,b)=>r.has(y)&&r.get(y)===b,getQueryParam:y=>r.get(y),getRouteParam:y=>n[y],params:n,location:o,id:c,hasId:!!c}};function ns(r){var n,o;const t=r.decodedAccessToken;return h.useMemo(()=>{var a,d;const c=((d=(a=t==null?void 0:t.access)==null?void 0:a.role)==null?void 0:d.code)??"",i=Object.keys(r.role).reduce((y,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,x=>x.replace("_","").toUpperCase())}`;return{...y,[p]:!1}},{});return{...Object.keys(r.role).reduce((y,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,x=>x.replace("_","").toUpperCase())}`;return{...y,[p]:c===r.role[b]}},i),hasRole:y=>c===r.role[y],getRoleKey:()=>c}},[(o=(n=t==null?void 0:t.access)==null?void 0:n.role)==null?void 0:o.code,r])}g.AdvanceFilterBar=vl,g.App=bo,g.AppComponent=Jt,g.AppContext=Xr,g.AppLayout=wo,g.AsideBar=Ac,g.BackButton=So,g.ColumnFilterDropdown=Hl,g.ColumnMenu=Nl,g.ConfirmationDialog=Uc,g.DataTable=Pl,g.DecisionWrapper=ne,g.EachUtils=Hr,g.EmptyStatePage=jc,g.FLOATING_FOOTER_HEIGHT_VAR=pt,g.FilterBar=vn,g.FilterDrawer=Cl,g.FloatingFooter=zc,g.ForbiddenPage=Zc,g.Form=Ec,g.FullSection=Jc,g.HeaderLeftSlot=Co,g.HeaderLeftSlotOutlet=$t,g.HeaderLeftSlotProvider=Xt,g.HorizontalField=Eo,g.ImagePreview=rs,g.InputFile=Gl,g.InputImage=Ul,g.LayoutDialog=xr,g.LayoutDialogAside=jr,g.LayoutDialogBody=Pr,g.LayoutDialogFooter=Nr,g.LayoutDialogHeader=Vr,g.ModuleSwitcher=ko,g.ModuleSwitcherModal=al,g.NotFoundPage=_c,g.PageLayout=To,g.Pressable=yr,g.RightDrawer=hl,g.ScrollToTopButton=Jl,g.Section=Ao,g.SectionFooter=ot,g.SectionHeader=lt,g.SelectButton=Yc,g.ServerErrorPage=Qc,g.SidePanel=Wc,g.SidePanelItem=Tc,g.SidebarBadgesProvider=qt,g.SidebarGroupSlot=vo,g.SidebarGroupSlotOutlet=Rt,g.SidebarGroupSlotProvider=Kt,g.SidebarHeaderSlot=Yt,g.SidebarProvider=Qt,g.TableFooter=zl,g.TableHeader=Al,g.TableLayout=Pn,g.TableSection=In,g.TableWrapper=Wl,g.ToggleStatus=Fc,g.Typography=He,g.VerticalField=Hc,g.clearModuleSelection=xo,g.createInitialFromUserName=Gn,g.cssVars=$n,g.expandDateCompact=mn,g.formHasChanged=lc,g.formatDate=Yn,g.formatDateToIndonesian=Zl,g.formatRupiah=Un,g.getDateFilterValue=bl,g.getDateRangeFilterValue=Po,g.getInitials=Jn,g.getValueDropdownMultipleFilter=pl,g.getValueRadioFilter=Vo,g.getValueSearch=Mr,g.getValuesFilter=Er,g.handleChangeFilter=pr,g.handleOnScroll=fc,g.isEmail=ac,g.isFilterActive=jo,g.isOnlyLettersAndSpaces=nc,g.isPhoneNumber=oc,g.isSlug=dc,g.localStorageAdapter=ct,g.oneDayInMs=Kn,g.parseIndonesianDateToDate=Qn,g.preventNonCoordinateInput=hc,g.preventNonNumberAndDecimalInput=ic,g.preventNonNumberInput=cc,g.preventNumberInput=sc,g.resolveDateRangeValueToString=ul,g.resolveDateValueToString=yl,g.resolveDropdownValueToString=fl,g.resolveRadioValueToString=gl,g.resolveSidebarBadge=Br,g.storageKeys=ar,g.textWidth=Rn,g.useApp=$r,g.useAppState=Nt,g.useAuthRole=ns,g.useDynamicTitle=ls,g.useFilterBarApiParams=Sn,g.useFilterBarControls=Bn,g.useModuleSelection=rt,g.useRouteInfo=Me,g.useRouteParams=os,g.useSidebar=Ut,g.useSidebarBadges=Zt,g.useTabState=ts,g.useTableSortApiParams=jn,Object.keys(lr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>lr[r]})}),Object.keys($e).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>$e[r]})}),Object.keys(u).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>u[r]})}),Object.keys(or).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>or[r]})}),Object.keys(j).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>j[r]})}),Object.keys(It).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>It[r]})}),Object.keys(rr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>rr[r]})}),Object.keys(Ae).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ae[r]})}),Object.keys(kr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>kr[r]})}),Object.keys(nr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>nr[r]})}),Object.keys(pe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>pe[r]})}),Object.keys(cr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>cr[r]})}),Object.keys(Ke).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ke[r]})}),Object.keys(A).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>A[r]})}),Object.keys(gr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>gr[r]})}),Object.keys(ur).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ur[r]})}),Object.keys(q).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>q[r]})}),Object.keys(Ot).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ot[r]})}),Object.keys(Ur).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ur[r]})}),Object.keys(sr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>sr[r]})}),Object.keys(Wt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Wt[r]})}),Object.keys(ir).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ir[r]})}),Object.keys(me).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>me[r]})}),Object.keys(Ze).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ze[r]})}),Object.keys(Jr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Jr[r]})}),Object.keys(k).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>k[r]})}),Object.keys(M).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>M[r]})}),Object.keys(oe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>oe[r]})}),Object.keys(At).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>At[r]})}),Object.keys(zt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>zt[r]})}),Object.keys(Ht).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ht[r]})}),Object.keys(Vt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Vt[r]})}),Object.keys(Pt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Pt[r]})}),Object.keys(ze).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ze[r]})}),Object.keys(jt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>jt[r]})}),Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});