@starasia/admin 12.39.0 → 12.40.0
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/components/EntityCard/index.d.ts +69 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.cjs.js +5 -5
- package/dist/index.es.js +1434 -1323
- package/dist/index.umd.js +3 -3
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const tn=require("@starasia/alert"),rn=require("@starasia/avatar"),ct=require("@starasia/badges"),f=require("@starasia/box"),pt=require("@starasia/breadcrumb"),H=require("@starasia/button"),nn=require("@starasia/card"),xt=require("@starasia/date"),Re=require("@starasia/dialog"),qt=require("@starasia/drawer"),jt=require("@starasia/dropdown"),we=require("@starasia/hooks"),bt=require("@starasia/http"),at=require("@starasia/input"),I=require("@starasia/menu"),Et=require("@starasia/pagination"),Ft=require("@starasia/storage"),q=require("@starasia/table"),on=require("@starasia/tabs"),Sr=require("@starasia/textarea"),yt=require("@starasia/theme"),sn=require("@starasia/toast"),vt=require("@starasia/toggle"),Be=require("@starasia/tooltip"),rt=require("@starasia/checkbox"),kr=require("@starasia/radio"),D=require("@starasia/text"),E=require("@starasia/icon"),ce=require("@starasia/flex"),ln=require("@starasia/grid"),cn=require("@starasia/progress"),an=require("@starasia/stepper"),dn=require("@starasia/accordion"),un=require("@starasia/story-record"),Ge=require("@starasia/skeleton"),xn=require("@starasia/progress-stepper"),e=require("react/jsx-runtime"),d=require("react"),Ut=require("react-dom"),$o=require("react-easy-crop"),Ko={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},Ir=d.createContext(Ko),Tr=()=>d.useContext(Ir),Vn=t=>{const[r,n]=d.useState((t==null?void 0:t.initialUserData)||null);return{userData:r,setUserData:n}},Pn=d.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),Nn=({children:t})=>{const[r,n]=d.useState({}),s=d.useCallback(c=>{n(a=>typeof c=="function"?c(a):c)},[]),o=d.useCallback((c,a)=>{n(u=>{const h=typeof a=="function"?a(u[c]):a;return{...u,[c]:h}})},[]),i=d.useCallback(c=>{n(a=>{if(!(c in a))return a;const u={...a};return delete u[c],u})},[]),l=d.useMemo(()=>({badges:r,setBadge:o,setBadges:s,clearBadge:i}),[r,o,s,i]);return e.jsx(Pn.Provider,{value:l,children:t})},_n=()=>d.useContext(Pn),Nt=(t,r)=>{const n=r!==void 0?r:t;return n==null?null:typeof n=="string"||typeof n=="number"?{value:n}:n},Jt=262,Or=Jt,Rr=480,es="sa-sidebar-width",Br=(t,r,n)=>Math.min(Math.max(t,r),n),ts=(t,r,n,s)=>{if(typeof window>"u")return r;try{const o=window.localStorage.getItem(t);if(!o)return r;const i=parseInt(o,10);return Number.isFinite(i)?Br(i,n,s):r}catch{return r}},hn=(t,r)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(t,String(r))}catch{}},qn=d.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},width:Jt,setWidth:()=>{},resetWidth:()=>{},minWidth:Or,maxWidth:Rr,mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),Zn=({children:t,defaultCollapsed:r=!1,defaultWidth:n=Jt,minWidth:s=Or,maxWidth:o=Rr,widthStorageKey:i=es})=>{const[l,c]=d.useState(r),[a,u]=d.useState(!1),[h,g]=d.useState(()=>ts(i,n,s,o)),m=d.useCallback(w=>{c(R=>typeof w=="function"?w(R):w)},[]),y=d.useCallback(()=>c(w=>!w),[]),k=d.useCallback(()=>c(!0),[]),b=d.useCallback(()=>c(!1),[]),M=d.useCallback(w=>{g(R=>{const T=typeof w=="function"?w(R):w,J=Br(Math.round(T),s,o);return hn(i,J),J})},[s,o,i]),B=d.useCallback(()=>{const w=Br(n,s,o);hn(i,w),g(w)},[n,s,o,i]),L=d.useCallback(w=>{u(R=>typeof w=="function"?w(R):w)},[]),C=d.useCallback(()=>u(!0),[]),v=d.useCallback(()=>u(!1),[]),W=d.useCallback(()=>u(w=>!w),[]),O=d.useMemo(()=>({collapsed:l,setCollapsed:m,toggle:y,collapse:k,expand:b,width:h,setWidth:M,resetWidth:B,minWidth:s,maxWidth:o,mobileOpen:a,setMobileOpen:L,openMobile:C,closeMobile:v,toggleMobile:W}),[l,m,y,k,b,h,M,B,s,o,a,L,C,v,W]);return e.jsx(qn.Provider,{value:O,children:t})},Gn=()=>d.useContext(qn),Qn=d.createContext(null),Un=({adapter:t,children:r})=>e.jsx(Qn.Provider,{value:t,children:r}),nt=()=>{const t=d.useContext(Qn);if(!t)throw new Error("[@starasia/admin] Router adapter belum dipasang. Bungkus aplikasi dengan <App routerAdapter={...} /> atau <StarasiaRouterProvider adapter={...}>. Import adapter dari '@starasia/admin/adapters/react-router' atau '@starasia/admin/adapters/tanstack'.");return t},Jn=({router:t,routerAdapter:r,menus:n=[],menuBottom:s,logo:o,appName:i="Workspace",initialUserData:l,theme:c})=>{const a=Vn({initialUserData:l}),{theme:u}=yt.useTheme();return e.jsx(Un,{adapter:r,children:e.jsx(Ir.Provider,{value:{logo:o,appName:i,menus:n,userData:a.userData,setUserData:a.setUserData,menuBottom:s},children:e.jsx(Nn,{children:e.jsx(Zn,{children:c?e.jsx(yt.ThemeProvider,{value:c,children:t}):u?e.jsx(yt.ThemeProvider,{value:u,children:t}):t})})})})},rs=d.memo(Jn);function Yn({collapsed:t=!1,children:r}){if(!r)return null;const n=typeof r=="function",s=n?r({collapsed:t}):r;return s==null||s===!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:n?s:e.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.3s",visibility:t?"hidden":"visible"},children:s})})}const Wr=d.createContext(null);function Xn({children:t}){const[r,n]=d.useState(null),[s,o]=d.useState(null),[i,l]=d.useState(null),[c,a]=d.useState(0),u=d.useCallback(()=>(a(h=>h+1),()=>a(h=>h-1)),[]);return e.jsx(Wr.Provider,{value:{prependNode:r,appendNode:s,replaceNode:i,setPrependNode:n,setAppendNode:o,setReplaceNode:l,replaceCount:c,registerReplace:u},children:t})}function $n({children:t}){const r=d.useContext(Wr);return r?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:r.setPrependNode,style:{display:"contents"}}),r.replaceCount>0?e.jsx("div",{ref:r.setReplaceNode,style:{display:"contents"}}):t,e.jsx("div",{ref:r.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:t})}function ns({children:t,mode:r="append"}){const n=d.useContext(Wr);if(d.useEffect(()=>{if(!(r!=="replace"||!n))return n.registerReplace()},[r,n]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const s=r==="prepend"?n.prependNode:r==="replace"?n.replaceNode:n.appendNode;return s?Ut.createPortal(t,s):null}const Ar=d.createContext(null);function Kn({children:t}){const[r,n]=d.useState({}),[s,o]=d.useState({}),i=d.useCallback((a,u)=>{n(h=>h[a]===u?h:{...h,[a]:u})},[]),l=d.useCallback(a=>(o(u=>({...u,[a]:(u[a]??0)+1})),()=>o(u=>({...u,[a]:Math.max(0,(u[a]??0)-1)}))),[]),c=d.useMemo(()=>({outletNodes:r,setOutletNode:i,slotCounts:s,registerSlot:l}),[r,i,s,l]);return e.jsx(Ar.Provider,{value:c,children:t})}function eo({slotKey:t,fallback:r}){const n=d.useContext(Ar),s=n?(n.slotCounts[t]??0)>0:!1,o=d.useRef(n==null?void 0:n.setOutletNode);o.current=n==null?void 0:n.setOutletNode;const i=d.useCallback(l=>{var c;return(c=o.current)==null?void 0:c.call(o,t,l)},[t]);return e.jsx(e.Fragment,{children:s?e.jsx("div",{ref:i,style:{display:"contents"}}):r})}function os({slotKey:t,children:r}){const n=d.useContext(Ar),s=d.useRef(n==null?void 0:n.registerSlot);if(s.current=n==null?void 0:n.registerSlot,d.useEffect(()=>{var i;return(i=s.current)==null?void 0:i.call(s,t)},[t]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const o=n.outletNodes[t];return o?Ut.createPortal(r,o):null}const Zt="moduleSwitcherGroupId",Fr="sa-module-switcher-change";function fn(){if(typeof window>"u")return null;const t=window.localStorage.getItem(Zt);if(t===null)return null;const r=Number(t);return Number.isFinite(r)?r:null}function to(t){typeof window>"u"||(t===null?window.localStorage.removeItem(Zt):window.localStorage.setItem(Zt,String(t)),window.dispatchEvent(new CustomEvent(Fr,{detail:t})))}function ss(){to(null)}function zr(){const[t,r]=d.useState(()=>fn());return d.useEffect(()=>{const s=()=>{r(fn())},o=i=>{i.key===Zt&&s()};return window.addEventListener(Fr,s),window.addEventListener("storage",o),()=>{window.removeEventListener(Fr,s),window.removeEventListener("storage",o)}},[]),{selectedGroupId:t,setSelectedGroupId:s=>{to(s),r(s)}}}let Wt=0,ut=!1,mn=new Set;const gn=()=>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"})]});function is(t){const[r,n]=d.useState(!1),s=d.useRef(null),o=d.useRef(null);return d.useLayoutEffect(()=>{const i=s.current;if(!i)return;let l=0;const c=()=>{l=0;const u=o.current;if(!u)return;const h=u.scrollWidth>i.clientWidth;n(g=>g===h?g:h)},a=new ResizeObserver(()=>{l||(l=requestAnimationFrame(c))});return a.observe(i),c(),()=>{l&&cancelAnimationFrame(l),a.disconnect()}},[t]),{containerRef:s,textRef:o,truncated:r}}function pn({text:t,textStyle:r}){const{containerRef:n,textRef:s,truncated:o}=is(t),i=e.jsx("span",{ref:s,style:{display:"block",fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",...r},children:t});return e.jsx("div",{ref:n,style:{flex:1,minWidth:0},children:o?e.jsx(Be.Tooltip,{fluid:!0,label:t,position:"top",children:i}):i})}const yn={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"},ls=200,jn=16;function cs({children:t,headerLeftSlot:r,profile:n,isLoadingProfile:s,onLogout:o,isLoggingOut:i,loadingComponent:l,sidebarHeaderContent:c,headerActions:a,profileRole:u,profileMenuButtons:h,profileMenuItems:g,logoutButton:m,resizableSidebar:y=!0}){var dt,lt;const{useSearchParams:k,useNavigate:b,useLocation:M,Outlet:B}=nt(),[L]=k(),C=L.get("embed")==="true",v=Tr(),{badges:W}=_n(),O=b(),w=M(),T=!we.useMediaQuery("md"),[J,X]=d.useState(!1),{collapsed:Z,setCollapsed:P,width:$,setWidth:ee,resetWidth:N,minWidth:z,maxWidth:V,mobileOpen:ie,setMobileOpen:je}=Gn(),[Ie,xe]=d.useState(!1),[ve,De]=d.useState(()=>new Set(mn)),[Te,Oe]=d.useState(null),{selectedGroupId:Me,setSelectedGroupId:He}=zr();d.useEffect(()=>{mn=ve},[ve]);const be=d.useRef(null),Ae=d.useRef(null),Ne=d.useRef(null),[Ue,Ce]=d.useState(!1),[Ke,ht]=d.useState(null),A=y&&!T&&!Z,K=S=>Math.min(Math.max(S,z),V),G=Ke??$,le=S=>{var fe,Ye,ke;if(!A)return;S.preventDefault();const Q=S.clientX,U=((fe=Ne.current)==null?void 0:fe.getBoundingClientRect().width)??$;(ke=(Ye=S.currentTarget).setPointerCapture)==null||ke.call(Ye,S.pointerId),Ce(!0),document.body.style.userSelect="none",document.body.style.cursor="col-resize";let he=0,Fe=U;const Ze=ft=>{Fe=U+(ft.clientX-Q),he||(he=requestAnimationFrame(()=>{he=0,ht(K(Fe))}))},ye=()=>{he&&cancelAnimationFrame(he),window.removeEventListener("pointermove",Ze),window.removeEventListener("pointerup",ye),document.body.style.userSelect="",document.body.style.cursor="",ht(null),Ce(!1),Fe<ls?(ee(z),P(!0)):ee(K(Fe))};window.addEventListener("pointermove",Ze),window.addEventListener("pointerup",ye)},oe=S=>{A&&(S.key==="ArrowLeft"?(S.preventDefault(),ee(Q=>Q-jn)):S.key==="ArrowRight"?(S.preventDefault(),ee(Q=>Q+jn)):S.key==="Home"?(S.preventDefault(),ee(z)):S.key==="End"&&(S.preventDefault(),ee(V)))};d.useEffect(()=>{const S=be.current;if(!S)return;const Q=()=>{ut||(Wt=S.scrollTop)};return S.addEventListener("scroll",Q),()=>S.removeEventListener("scroll",Q)},[]);const me=()=>{const S=be.current;S&&Wt>0&&(ut=!0,S.scrollTop=Wt,requestAnimationFrame(()=>{ut=!1}))};d.useLayoutEffect(()=>{ut=!0,me();const S=setTimeout(()=>{ut=!1},300);return()=>clearTimeout(S)},[]),d.useLayoutEffect(()=>{v.menus.length>0&&(Wt>0?me():requestAnimationFrame(()=>{var Q;const S=(Q=be.current)==null?void 0:Q.querySelector("[data-menu-active='true']");S&&S.scrollIntoView({block:"center",behavior:"instant"})}))},[v.menus]),d.useEffect(()=>{ut=!0,me();const S=setTimeout(me,0),Q=setTimeout(me,50),U=setTimeout(me,100),he=setTimeout(me,200),Fe=setTimeout(()=>{ut=!1},300),Ze=setTimeout(()=>{const ye=be.current,fe=ye==null?void 0:ye.querySelector("[data-menu-active='true']");if(ye&&fe){const Ye=ye.getBoundingClientRect(),ke=fe.getBoundingClientRect();ke.top>=Ye.top&&ke.bottom<=Ye.bottom||fe.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(S),clearTimeout(Q),clearTimeout(U),clearTimeout(he),clearTimeout(Fe),clearTimeout(Ze)}},[w.pathname]),d.useEffect(()=>{Ae.current&&(Ae.current.scrollTop=0)},[w.pathname]),d.useEffect(()=>{T&&je(!1)},[w.pathname,T]),d.useEffect(()=>{T&&P(!0)},[T]);const Je=()=>{X(!0)},_e=()=>{X(!1)},Ve=()=>{X(!1),o()},Se=S=>{const Q=[S.to];return S.children&&Q.push(...S.children.map(U=>U.to)),Q},qe=[...v.menus.flatMap(S=>S.items.flatMap(Se)),...((dt=v.menuBottom)==null?void 0:dt.flatMap(Se))??[]],de=S=>{if(!w.pathname.startsWith(S))return!1;const Q=qe.filter(U=>w.pathname.startsWith(U)).sort((U,he)=>he.length-U.length)[0];return S===Q};d.useEffect(()=>{var Q;const S=U=>{var he;(he=U.children)!=null&&he.some(Fe=>w.pathname.startsWith(Fe.to))&&De(Fe=>{const Ze=new Set(Fe);return Ze.add(U.id),Ze})};v.menus.forEach(U=>{U.items.forEach(S)}),(Q=v.menuBottom)==null||Q.forEach(S)},[w.pathname,v.menus,v.menuBottom]);const et=S=>{De(Q=>{const U=new Set(Q);return U.has(S)?U.delete(S):U.add(S),U})};d.useEffect(()=>{v.menus.length!==0&&Me!==null&&!v.menus.some(S=>S.id===Me)&&He(null)},[v.menus,Me,He]);const tt=d.useMemo(()=>{if(Me!==null)return v.menus.filter(U=>U.id===Me||U.parentGroupId===Me);const S=v.menus.filter(U=>U.parentGroupId===void 0),Q=v.menus.filter(U=>U.parentGroupId!==void 0).flatMap(U=>U.items);return Q.length===0?S:[...S,{id:18,name:"Pengaturan",items:Q,parentGroupId:void 0}]},[v.menus,Me]);if(C)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:t||e.jsx(B,{})});const ot=S=>{const Q=S.children&&S.children.length>0,U=ve.has(S.id),he=Q?S.children.some(ye=>de(ye.to)):de(S.to),Fe=Nt(S.badge,W[S.id]),Ze=!!Fe&&Z&&!T;return e.jsxs("div",{"data-menu-active":he||void 0,children:[e.jsxs("button",{onClick:ye=>{if(Q)if(Z&&!T){const fe=ye.currentTarget.getBoundingClientRect();Oe({item:S,top:fe.top,left:fe.right+8})}else et(S.id);else O(S.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:Z&&!T?"center":void 0,gap:"0.5rem",paddingLeft:Z&&!T?"0":"0.5rem",paddingRight:Z&&!T?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:he?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:he?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:he?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:Z&&!T?S.title:void 0,onMouseEnter:ye=>{he||(ye.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:ye=>{he||(ye.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(E.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),Ze&&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)"}})]}),(!Z||T)&&e.jsxs(e.Fragment,{children:[e.jsx(pn,{text:S.title,textStyle:{transition:"opacity 0.3s"}}),Fe&&e.jsx(ct.Badges,{text:String(Fe.value),variant:Fe.variant??"info",size:"xs",border:!0}),Q&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:U?"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"})})]})]}),Q&&(!Z||T)&&(()=>{const ye=S.children.findIndex(fe=>de(fe.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:U?`${S.children.length*36}px`:"0px",opacity:U?1:0,marginTop:U?"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"}}),ye>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${ye*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),S.children.map(fe=>{const Ye=Nt(fe.badge,W[fe.id]);return e.jsxs("button",{onClick:()=>O(fe.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:de(fe.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:de(fe.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:de(fe.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:de(fe.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:ke=>{de(fe.to)||(ke.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:ke=>{de(fe.to)||(ke.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(E.Icon,{name:fe.icon,size:"sm",style:{flexShrink:0}}),e.jsx(pn,{text:fe.title}),Ye&&e.jsx(ct.Badges,{text:String(Ye.value),variant:Ye.variant??"info",size:"xs",border:!0})]},fe.id)})]})})()]},S.id)};return e.jsx(Kn,{children:e.jsxs(Xn,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":T?"0px":Z?"4.375rem":`${G}px`,"--app-footer-zindex":T&&ie?"40":"998"},children:[T&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:ie?.5:0,pointerEvents:ie?"auto":"none",transition:"opacity 0.3s"},onClick:()=>je(!1)}),e.jsxs("aside",{ref:Ne,style:{width:T?"16.375rem":Z?"4.375rem":`${G}px`,position:T?"fixed":"relative",...T&&{inset:0,zIndex:50,transform:ie?"translateX(0)":"translateX(-100%)"},backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",borderRight:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",flexDirection:"column",transition:Ue?"none":"all 0.3s ease-in-out",flexShrink:T?void 0:0,minWidth:0},children:[e.jsx("div",{onMouseEnter:()=>xe(!0),onMouseLeave:()=>xe(!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 S=!T&&Z&&!ie,Q=S&&Ie;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:S?1:void 0,justifyContent:S?"center":void 0,transition:"opacity 0.2s",opacity:Q?0:1,pointerEvents:Q?"none":"auto"},children:[e.jsx("img",{src:v.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!Z||ie)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:v.appName})]}),!T&&!Z&&e.jsx("button",{type:"button",onClick:()=>P(!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(gn,{})}),S&&e.jsx("button",{type:"button",onClick:()=>P(!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:Q?1:0,pointerEvents:Q?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(gn,{})})}),T&&e.jsx("button",{onClick:()=>je(!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"})})})]})})()}),c&&e.jsx(Yn,{collapsed:T?!1:Z,children:c}),e.jsx("div",{ref:be,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:tt.map(S=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!Z||T?S.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:S.name}):S.name&&e.jsx("div",{"aria-label":S.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:S.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:S.slotKey?e.jsx(eo,{slotKey:S.slotKey,fallback:S.items.map(Q=>ot(Q))}):S.items.map(Q=>ot(Q))})]},S.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(S=>ot(S))}),A&&e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":$,"aria-valuemin":z,"aria-valuemax":V,tabIndex:0,onPointerDown:le,onKeyDown:oe,onDoubleClick:N,title:"Drag to resize · double-click to reset",style:{position:"absolute",top:0,right:0,width:"6px",height:"100%",transform:"translateX(50%)",cursor:"col-resize",zIndex:5,touchAction:"none",background:Ue?"var(--sa-background-brand, #04254f)":"transparent",transition:"background 0.15s"},onMouseEnter:S=>{Ue||(S.currentTarget.style.background="var(--sa-border-bold, #0b120e40)")},onMouseLeave:S=>{Ue||(S.currentTarget.style.background="transparent")}})]}),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:T?"1rem":void 0},children:[T&&e.jsx("button",{onClick:()=>je(!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($n,{children:r})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[a,e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.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:s?"Loading...":(n==null?void 0:n.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s?"":(n==null?void 0:n.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:((n==null?void 0:n.name)||"U")[0].toUpperCase()}),e.jsx(E.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(I.MenuLists,{width:280,style:{paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(I.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:((n==null?void 0:n.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:(n==null?void 0:n.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:(n==null?void 0:n.email)||"unknown"}),u&&e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:u})]})}),(h&&h.length>0||g)&&e.jsxs(I.MenuBody,{children:[h==null?void 0:h.map((S,Q)=>e.jsx(I.MenuButton,{children:e.jsxs("button",{type:"button",onClick:S.onClick,style:yn,onMouseEnter:U=>{U.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:U=>{U.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(E.Icon,{name:S.icon,size:"md"}),e.jsx("span",{children:S.label})]})},`${S.label}-${Q}`)),g]}),m??e.jsx(I.MenuFooter,{children:e.jsx(I.MenuButton,{children:e.jsxs("button",{type:"button",onClick:Je,style:{...yn,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:S=>{S.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:S=>{S.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(E.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:Ae,style:{flex:1,overflowY:"auto"},children:t||e.jsx(B,{})})]})]}),i&&l&&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:l}),e.jsxs(Re.Dialog,{isShow:J,onHide:_e,children:[e.jsx(Re.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Re.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Re.DialogFooter,{children:e.jsx(f.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(ce.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(f.Box,{direction:"column",children:e.jsx(H.Button,{secondary:!0,onClick:_e,children:"Cancel"})}),e.jsx(f.Box,{direction:"column",children:e.jsx(H.Button,{primary:!0,onClick:Ve,children:"Yes, Sure"})})]})})})]}),Te&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>Oe(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":Te.item.title,style:{position:"fixed",top:Te.top,left:Te.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:Te.item.title}),(lt=Te.item.children)==null?void 0:lt.map(S=>{const Q=de(S.to),U=Nt(S.badge,W[S.id]);return e.jsxs("button",{onClick:()=>{O(S.to),Oe(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:Q?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:Q?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:he=>{Q||(he.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:he=>{Q||(he.currentTarget.style.backgroundColor="transparent")},children:[S.icon&&e.jsx(E.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:S.title}),U&&e.jsx(ct.Badges,{text:String(U.value),variant:U.variant??"info",size:"xs",border:!0})]},S.id)})]})]})]})})}const Lt=d.forwardRef(({children:t,...r},n)=>e.jsx(f.Box,{ref:n,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...r,children:t})),bn=({title:t,iconName:r,textColor:n,iconColor:s,hoverTextColor:o,hoverIconColor:i})=>{const[l,c]=d.useState(!1),a=s??"var(--sa-text-subtle, #8c8f97)",u=n??"var(--sa-text-subtle, #8c8f97)",h=i??"var(--sa-text-subtle, #8c8f97)",g=o??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{cursor:"pointer"},children:[e.jsx(E.Icon,{name:r||"ChevronLeft",size:"xs",style:{color:l?h:a,transition:"color 0.15s ease"}}),e.jsx(D.Text,{variant:"sub-h3",style:{color:l?g:u,transition:"color 0.15s ease"},children:t||"Back"})]})},as=({items:t,separator:r="/",iconName:n,iconColor:s,hoverIconColor:o})=>{const{Link:i}=nt(),[l,c]=d.useState(!1),a=s??"var(--sa-text-subtle, #8c8f97)",u=o??"var(--sa-text-subtle, #8c8f97)",h=t.length>1?t[0]:void 0,g=!!(h!=null&&h.to||h!=null&&h.onClick),m=e.jsx(E.Icon,{name:n||"ChevronLeft",size:"xs",onMouseEnter:g?()=>c(!0):void 0,onMouseLeave:g?()=>c(!1):void 0,style:{color:g&&l?u:a,transition:"color 0.15s ease",cursor:g?"pointer":void 0}}),y=h!=null&&h.to?e.jsx(i,{to:h.to,replace:!0,style:{textDecoration:"none"},children:m}):h!=null&&h.onClick?e.jsx(Lt,{onClick:h.onClick,children:m}):m;return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",children:[y,e.jsx(pt.Breadcrumb,{separator:r,size:"md",children:t.map((k,b)=>{const M=b===t.length-1;return k.to&&!M?e.jsx(pt.BreadcrumbItem,{children:e.jsx(i,{to:k.to,children:k.label})},b):e.jsx(pt.BreadcrumbItem,{currentPage:M,children:e.jsx(pt.BreadcrumbLink,{onClick:M?void 0:k.onClick,children:k.label})},b)})})]})},ds=t=>{const{Link:r}=nt(),{items:n,separator:s,onClick:o,navigateTo:i,...l}=t;return n&&n.length>0?e.jsx(as,{items:n,separator:s,iconName:l.iconName,iconColor:l.iconColor,hoverIconColor:l.hoverIconColor}):i?e.jsx(f.Box,{direction:"row",children:e.jsx(r,{to:i,replace:!0,style:{textDecoration:"none"},children:e.jsx(bn,{...l})})}):e.jsx(f.Box,{direction:"row",children:e.jsx(Lt,{onClick:o,children:e.jsx(bn,{...l})})})},fr=[{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 vn(t,r,n){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:t?`2px solid ${n.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:t?n.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:t?r?`0 8px 20px ${n.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${n.activeShadow}`:r?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:r?"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 Cn={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},wn={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function ro({isShow:t,onHide:r,menus:n,selectedGroupId:s,onSelect:o}){const[i,l]=d.useState(void 0),c=u=>{o(u),r()},a=fr[0];return e.jsx(Re.Dialog,{isShow:t,onHide:r,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Re.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>c(null),onMouseEnter:()=>l("all"),onMouseLeave:()=>l(void 0),style:wn,children:[e.jsx("div",{style:vn(s===null,i==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(E.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Cn,children:"Semua"})]}),n.map((u,h)=>{var b;const g=s===u.id,m=i===u.id,y=((b=u.items[0])==null?void 0:b.icon)??"Grid",k=fr[(h+1)%fr.length];return e.jsxs("button",{onClick:()=>c(u.id),onMouseEnter:()=>l(u.id),onMouseLeave:()=>l(void 0),style:wn,children:[e.jsx("div",{style:vn(g,m,k),children:e.jsx("div",{style:{color:k.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(E.Icon,{name:y,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Cn,children:u.name})]},u.id)})]})})})}function us({onSelect:t,"aria-label":r="Pilih module"}={}){const n=Tr(),{useNavigate:s}=nt(),o=s(),{selectedGroupId:i,setSelectedGroupId:l}=zr(),[c,a]=d.useState(!1),u=h=>{var g;if(l(h),h!==null){const m=n.menus.find(k=>k.id===h),y=(g=m==null?void 0:m.items[0])==null?void 0:g.to;y&&o(y)}t==null||t(h)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>a(!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":r,onMouseEnter:h=>{h.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="transparent"},children:e.jsx(E.Icon,{name:"GridApplication",size:"sm"})}),i!==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(ro,{isShow:c,onHide:()=>a(!1),menus:n.menus.filter(h=>h.parentGroupId===void 0),selectedGroupId:i,onSelect:u})]})}const xs=(t,r)=>{const n=[];if(r===0)return n.push(t),n;for(let s=0;s<t.length;s+=r){const o=t.slice(s,s+r);n.push(o)}return n},hs=d.memo(({value:t,label:r,separator:n,labelWidth:s,lastIndex:o,labelAlign:i="top"})=>{const l=d.useMemo(()=>({padding:0,paddingBottom:o?0:12,verticalAlign:i}),[o,i]),c=d.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:o?0:12,verticalAlign:i}),[o,i]),a=()=>typeof r=="string"?e.jsx(D.Text,{fontWeight:"medium",color:"subtlest",children:r}):r,u=()=>typeof t=="string"||typeof t=="number"?e.jsx(D.Text,{color:"primary",fontWeight:"medium",children:t}):t,h=()=>typeof n=="string"||typeof n=="number"?e.jsx(D.Text,{fontWeight:"medium",color:"subtlest",children:n}):n;return e.jsxs(q.Tr,{children:[e.jsx(q.Td,{style:l,width:s,children:a()}),n?e.jsx(q.Td,{style:c,width:24,children:h()}):null,e.jsx(q.Td,{style:l,children:u()})]})}),fs=d.memo(({fields:t,separator:r,labelWidth:n})=>e.jsx(q.Table,{withColumnBorder:!1,withRowBorder:!1,children:t.map((s,o)=>e.jsx(hs,{separator:r,labelWidth:n,lastIndex:o===t.length-1,...s},`field-group-field-${o}`))})),ms=d.memo(({maxRow:t=0,maxColumn:r=2,separator:n=":",fields:s=[],labelWidth:o=150,bordered:i=!1})=>{const l=d.useMemo(()=>xs(s,t),[s,t]),c=l.length>2,a=()=>{switch(r){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(f.Box,{gap:c?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:c?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:i?"border":void 0,borderStyle:i?"border-solid":void 0,borderColor:i?"border-subtle":void 0,children:l.map((u,h)=>e.jsx(f.Box,{direction:"column",flex:c?void 0:"1",width:c?a():void 0,marginBottom:c?"lg":void 0,children:e.jsx(fs,{labelWidth:o,fields:u,separator:n})},h))})}),gs=({backButton:t})=>{const[r,n]=d.useState(!1),s=(t==null?void 0:t.iconColor)??"var(--sa-text-subtle, #8c8f97)",o=(t==null?void 0:t.textColor)??"var(--sa-text-subtle, #8c8f97)",i=(t==null?void 0:t.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",l=(t==null?void 0:t.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{cursor:"pointer"},children:[e.jsx(E.Icon,{name:(t==null?void 0:t.iconName)||"ChevronLeft",size:"xs",style:{color:r?i:s,transition:"color 0.15s ease"}}),e.jsx(D.Text,{variant:"sub-h3",style:{color:r?l:o,textDecoration:r?"underline":"none",transition:"color 0.15s ease"},children:(t==null?void 0:t.title)||"Back"})]})},ps=({backButton:t,title:r,titleIcon:n,titleTag:s,children:o,header:i=!0,headerBorder:l=!1,disableAnimation:c=!1,scrollable:a=!1,stickyHeader:u=!1,subHeaders:h,action:g,titleTagProps:m,containerProps:y,headerProps:k})=>{const b=we.useMediaQuery("md"),{Link:M,useNavigate:B,useLocation:L}=nt(),C=B(),v=L(),W=t==null?void 0:t.show,O=()=>{if(typeof(t==null?void 0:t.onClick)=="function"){t.onClick();return}C(-1,{replace:!0})},w=()=>{if(!g)return null;if(d.isValidElement(g))return g;const P=g.filter($=>$&&($.title||$.icon));return P.length===0?null:b?e.jsx(f.Box,{direction:"row",gap:"md",children:P.map(({title:$,icon:ee,buttonProps:N,onClick:z},V)=>e.jsx(H.Button,{iconLeft:ee?e.jsx(E.Icon,{name:ee,size:"md"}):void 0,onClick:z,...N,children:$},`action-${V}`))}):e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(E.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{minWidth:200},children:P.map(({title:$,icon:ee,buttonProps:N,onClick:z},V)=>{const ie=(N==null?void 0:N.tone)==="error"||(N==null?void 0:N.danger)===!0;return e.jsx(I.MenuItem,{intent:ie?"danger":void 0,disabled:N==null?void 0:N.disabled,startIcon:ee?e.jsx(E.Icon,{name:ee}):void 0,onClick:z,children:$},`action-${V}`)})})})]})},R=()=>{const P=e.jsx(gs,{backButton:t});return t!=null&&t.navigateTo?e.jsx(f.Box,{direction:"row",children:e.jsx(M,{to:t.navigateTo,replace:!0,style:{textDecoration:"none"},children:P})}):e.jsx(f.Box,{direction:"row",children:e.jsx(Lt,{onClick:O,children:P})})},T=()=>{const P=!!r,$=Array.isArray(g)&&g.length>0,ee=d.isValidElement(g)?!0:$;if(!P&&!ee&&!W)return null;const z=b||!b&&$;return e.jsxs(f.Box,{direction:"column",gap:"xs",paddingBlock:(k==null?void 0:k.paddingBlock)??"sm",paddingInline:(k==null?void 0:k.paddingInline)??"md",...k,style:{...l?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...k==null?void 0:k.style},children:[W&&R(),(P||ee)&&e.jsxs(f.Box,{direction:z?"row":"column",gap:"sm",justify:"space-between",align:z?"center":"flex-start",children:[P?typeof r=="string"?e.jsxs(f.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[n&&e.jsx(E.Icon,{name:n,size:"md",color:"primary"}),e.jsx(D.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:r})]}),s&&e.jsx(ct.Badge,{border:!0,size:"lg",text:s,...m})]}):r:null,w()]})]})},J=()=>{if(!h||h.length===0)return null;const P=h.filter(N=>N.show!==!1);if(P.length===0)return null;let $=0,ee=-1/0;return P.forEach((N,z)=>{const V=N.order??0;V>=ee&&(ee=V,$=z)}),P.map(({content:N,order:z,borderBottom:V=!0,keepBottomPadding:ie=!1,paddingInline:je=!0,paddingBlock:Ie=!0},xe)=>e.jsx(f.Box,{direction:"column",paddingTop:Ie?"sm":"spacing-0",paddingBottom:Ie&&(V||ie||xe===$)?"sm":"spacing-0",paddingInline:je?"md":"spacing-0",style:{...V?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...z!==void 0?{order:z}:{}},children:N},`sub-header-${xe}`))},X=()=>{const P=i?T():null,$=J();return!P&&!$?null:e.jsxs(f.Box,{direction:"column",style:{...a?{position:"sticky",left:0,...u?{top:0}:{},zIndex:2,background:"var(--sa-background-primary, #ffffff)"}:{},marginBottom:$?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[P,$]})},Z=()=>o;return e.jsxs(f.Box,{direction:"column",as:"main",...y,style:{...a?{height:"100%",minHeight:0,overflow:"auto"}:{},...(y==null?void 0:y.style)??{},...c?{}:{animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"}},children:[X(),Z()]},v.pathname)},ys=d.memo(ps),js={icon:"Cross",title:""},no=d.forwardRef(({onHide:t,show:r,withBlur:n=!1,style:s,children:o,closeButton:i=js,width:l,minWidth:c,maxWidth:a},u)=>{const h=l??a??c??"357px";return e.jsx(qt.Drawer,{blur:n,isShow:r,position:"right",onHide:t,ref:u,size:h,style:s,children:e.jsxs(f.Box,{direction:"column",padding:"lg",children:[i?e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",onClick:t,marginBottom:"lg",cursor:"pointer",children:[e.jsx(E.Icon,{name:i.icon,size:"md",color:"subtle",cursor:"pointer"}),i.title?e.jsx(D.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:i.title}):null]}):null,o]})})}),Hr=d.memo(({children:t,borderBottom:r=!0,padding:n=!0})=>{const s=we.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),Vr=d.memo(({children:t,borderTop:r=!0,padding:n=!0})=>{const s=we.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),bs=d.memo(({children:t,...r})=>e.jsx(f.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...r,children:t})),vs=d.memo(({children:t,title:r,titleTag:n,action:s,header:o,footer:i,actionContainer:l,containerProps:c,bodyProps:a,headerProps:u={borderBottom:!0},footerProps:h={borderTop:!0},variantTag:g="info"})=>{const m=we.useMediaQuery("lg"),y=()=>n?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(D.Text,{fontWeight:"medium",children:r}),e.jsx(ct.Badges,{border:!0,text:n,variant:g})]}):e.jsx(D.Text,{fontWeight:"medium",children:r}),k=()=>o||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:r?y():null}),e.jsx(f.Box,{direction:"column",style:m?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...l,children:s??null})]}),b=!!(o||r||s);return e.jsxs(f.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...c,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(c==null?void 0:c.style)??{}},children:[o!==null&&b?e.jsx(Hr,{...u,children:k()}):null,e.jsx(bs,{...a,children:t}),i?e.jsx(Vr,{...h,children:i}):null]})}),Cs=t=>e.jsx(D.Text,{variant:"h1",children:t.children,...t.props}),ws=t=>e.jsx(D.Text,{variant:"h2",children:t.children,...t.props}),Ds=t=>e.jsx(D.Text,{variant:"h3",children:t.children,...t.props}),Ss=t=>e.jsx(D.Text,{variant:"h4",children:t.children,...t.props}),ks=t=>e.jsx(D.Text,{variant:"h5",children:t.children,...t.props}),Bs=t=>e.jsx(D.Text,{variant:"h6",children:t.children,...t.props}),Fs=t=>e.jsx(D.Text,{variant:"sub-h1",children:t.children,...t.props}),Es=t=>e.jsx(D.Text,{variant:"sub-h2",children:t.children,...t.props}),Ms=t=>e.jsx(D.Text,{variant:"sub-h3",children:t.children,...t.props}),Ls=t=>e.jsx(D.Text,{variant:"body-1",children:t.children,...t.props}),Is=t=>e.jsx(D.Text,{variant:"body-2",children:t.children,...t.props}),Ts=t=>e.jsx(D.Text,{variant:"body-3",children:t.children,...t.props}),Qe={H1:Cs,H2:ws,H3:Ds,H4:Ss,H5:ks,H6:Bs,SubH1:Fs,SubH2:Es,SubH3:Ms,Body1:Ls,Body2:Is,Body3:Ts},We=()=>{const{useSearchParams:t,useParams:r,useLocation:n}=nt(),[s,o]=t(),i=bt.searchParamsToObject(s.toString()),l=r(),c=n(),a=l.id;return{setSearchParams:o,searchParams:s,searchQueries:i,isHasQuery:(y,k)=>s.has(y)&&s.get(y)===k,getQueryParam:y=>s.get(y),getRouteParam:y=>l[y],params:l,location:c,id:a,hasId:!!a}},oo=t=>JSON.stringify(t),so=t=>JSON.stringify(t),io=t=>JSON.stringify(t),lo=t=>JSON.stringify(t),Os=t=>t,Rs=t=>JSON.stringify(t),Mt=({value:t,name:r,type:n,withSearchParam:s=!0,setSearchParams:o,searchQueries:i,dropdownSearchKey:l,filterKey:c="filter",pageKey:a="page"})=>{if(s){let u;switch(n){case"search":u=Os(t);break;case"dropdown":case"dropdown-multiple":u=oo(t);break;case"radio":u=so(t);break;case"date-range":u=io(t);break;case"advanced-date-range":u=Rs(t);break;case"date":u=lo(t);break;default:u=t;break}if(typeof u<"u"){const g={...i[c]&&typeof i[c]=="string"?JSON.parse(i[c]):void 0,[r]:u},m={...i};l&&typeof l=="string"&&delete m[l],delete m[a];const y={...m,[c]:JSON.stringify(g)},k=new URLSearchParams(i).toString(),b=new URLSearchParams(y).toString();if(k===b)return;o(y)}}},_t=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,l=i?i[t]:void 0;return s==="label"&&l?JSON.parse(l)[0].label:s==="value"&&l?JSON.parse(l)[0].value:l},co=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,l=i?i[t]:void 0;return s==="label"&&l?JSON.parse(l).map(c=>c.label):s==="value"&&l?JSON.parse(l).map(c=>c.value):s==="array"&&l?JSON.parse(l):l},Ws=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,l=i?i[t]:void 0;return s==="id"&&l?JSON.parse(l).id:s==="label"&&l?JSON.parse(l).label:s==="value"&&l?JSON.parse(l).value:l},Yt=(t,r,n)=>{const s=r.get(n||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0;return o?o[t]:void 0},As=({name:t,filterKey:r="filter",searchParams:n})=>{const s=n.get(r||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0,i=o?o[t]:void 0;return{start:i?JSON.parse(i).from:void 0,end:i?JSON.parse(i).to:void 0}},ao=({name:t,filterKey:r="filter",searchParams:n})=>{const s=n.get(r||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0,i=o?o[t]:void 0;return i?JSON.parse(i):void 0},zs=(t,{filterKey:r="filter",perPageKey:n="perPage",pageKey:s="page"})=>{const o=t.get(r)||void 0,i=t.get(n)||void 0,l=t.get(s)||void 0;return!!o||!!i||!!l},uo=({isOpen:t,onClose:r,filterKey:n,pageKey:s,filters:o})=>{const{searchParams:i,setSearchParams:l,searchQueries:c}=We(),[a,u]=d.useState({}),h=()=>{i.delete(n||"filter"),l(i)},g=(m,y)=>{switch(m.type){case"radio":{const{show:k=!0}=m;return k&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:m.title})},y)}case"dropdown":{const{show:k=!0}=m;return k&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:m.title})},y)}case"date-range":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:m.title})},y);case"date":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:m.title})},y);case"dropdown-multiple":{const{show:k=!0}=m;return k&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:m.title})},y)}default:return null}};return e.jsx(no,{onHide:r,show:t||!1,children:e.jsxs(f.Box,{direction:"column",gap:"md",children:[e.jsxs(ce.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(f.Box,{direction:"column",children:"Filter"}),e.jsx(f.Box,{direction:"column",style:{cursor:"pointer"},onClick:h,children:"Reset"})]}),o==null?void 0:o.map((m,y)=>g(m,y))]})})},xo=({searchKey:t="q",statusKey:r="status",searchPlaceholder:n="Search",searchHighlightPlaceholder:s,extendedFilter:o,showSearchFilter:i=!0,showStatusFilter:l=!0,filterKey:c="filter",pageKey:a="page",customWidthSearch:u,handleOnReset:h,filterConfigs:g,buttonToggleProps:m,position:y="right",titleSearchLabel:k="Work Order",withTitleLabels:b=!1})=>{const B=(m==null?void 0:m.isShowLabel)??!0,[L,C]=d.useState(!1),[v,W]=d.useState(0),O=()=>{W(V=>V+1)},{searchParams:w,setSearchParams:R,getQueryParam:T}=We(),J=bt.searchParamsToObject(w.toString()),X=Yt(t,w,c)||"",[Z,P]=d.useState(X),$=T(c),N=!!($&&!(()=>{if($)try{const V=JSON.parse($);return Object.keys(V).length===1&&V[t]===""}catch(V){console.error("Filter parameter is not a valid JSON:",V)}return!1})()),z=we.useMediaQuery("md");return d.useEffect(()=>{P(X)},[X]),d.useEffect(()=>{if(Z===X)return;const V=window.setTimeout(()=>{Mt({value:Z,name:t,type:"search",searchQueries:J,setSearchParams:R,filterKey:c,pageKey:a})},350);return()=>{window.clearTimeout(V)}},[Z,X,t,J,R,c,a]),e.jsxs(ce.Flex,{gap:"md",style:{flexDirection:z&&y==="left"?"row":z&&y==="right"?"row-reverse":"column"},align:"flex-end",children:[N&&e.jsx(f.Box,{direction:"column",justify:"flex-end",children:e.jsx(H.Button,{onClick:()=>{const V=new URLSearchParams(w);V.delete(c),R(V),P(""),O(),h&&h()},variant:"outline",tone:"neutral",children:e.jsx(D.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),o==null?void 0:o.map(({minWidth:V,content:ie,title:je,onClickContainer:Ie},xe)=>e.jsxs(f.Box,{direction:"column",gap:"sm",onClick:Ie,style:{minWidth:V},children:[je&&e.jsx(Qe.SubH3,{children:je}),ie]},`extended-filter-${xe}-${v}`)),!!(g!=null&&g.length)&&e.jsx(H.Button,{primary:N,secondary:!N,iconLeft:e.jsx(E.Icon,{size:"sm",name:(m==null?void 0:m.icon)||"FilterHorizontal",style:{color:$?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!z,onClick:()=>C(!0),children:B?"Filter":void 0}),l&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[b&&e.jsx(Qe.SubH3,{children:"Status"}),e.jsx(jt.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:_t({get:"value",name:r,searchParams:w,filterKey:c})?[{label:_t({get:"value",name:r,searchParams:w,filterKey:c})==="active"?"Active":"InActive",value:_t({get:"value",name:r,searchParams:w,filterKey:c})}]:[],onChange:V=>Mt({value:V,name:r,type:"dropdown",searchQueries:J,setSearchParams:R,filterKey:c}),placeholder:b?"All":"All Status"},v)]}),i&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{width:u&&z?u:z?"310px":""},children:[b&&e.jsxs(Qe.SubH3,{children:["Search for ",k]}),e.jsx(at.Input,{placeholder:n,leftIcon:e.jsx(E.Icon,{name:"Search",width:20,height:20}),onChange:V=>P(V.target.value),value:Z,fullWidth:!0},v+1+c)]}),e.jsx(uo,{isOpen:L,onClose:()=>C(!1),filterKey:c,filters:g,pageKey:a})]})},Hs=t=>t==="checkbox-multiple"?"dropdown-multiple":t==="radio"?"dropdown":t==="date-compact"?"date":t;function Pr({configs:t,filterKey:r="filter",activeFilterKey:n="filters",pageKey:s="page",searchKey:o="q"}){const{searchParams:i,setSearchParams:l,searchQueries:c}=We(),a=d.useMemo(()=>Object.fromEntries(t.map(v=>[v.key,v])),[t]),u=d.useMemo(()=>{const v=(i.get(n)||"").split(",").map(O=>O.trim()).filter(Boolean);let W=[];try{const O=i.get(r);O&&(W=Object.keys(JSON.parse(O)).filter(w=>w!==o))}catch{}return t.map(O=>O.key).filter(O=>{const w=a[O];return(w==null?void 0:w.locked)||v.includes(O)||W.includes(O)})},[i,n,r,o,t,a]),h=d.useCallback(v=>{try{return v[r]?JSON.parse(v[r]):{}}catch{return{}}},[r]),g=d.useCallback(v=>{const W={...c};v.length?W[n]=v.join(","):delete W[n],l(W)},[c,n,l]),m=d.useCallback(v=>{u.includes(v)||g([...u,v])},[u,g]),y=d.useCallback(v=>{var R;if((R=a[v])!=null&&R.locked)return;const W={...c},O=u.filter(T=>T!==v);O.length?W[n]=O.join(","):delete W[n];const w=h(W);v in w&&(delete w[v],Object.keys(w).length?W[r]=JSON.stringify(w):delete W[r]),delete W[s],l(W)},[c,u,n,r,s,h,l,a]),k=d.useCallback(v=>u.includes(v)?y(v):m(v),[u,m,y]),b=d.useCallback(v=>{switch(v.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return co({name:v.key,get:"array",searchParams:i,filterKey:r})||[];case"date":{const W=ao({name:v.key,searchParams:i,filterKey:r});return W?new Date(W):void 0}case"date-compact":{const O=h(Object.fromEntries(i.entries()))[v.key];return O&&typeof O=="object"?O:void 0}default:return}},[i,r,h]),M=d.useCallback((v,W)=>{if(v.type==="date-compact"){const O={...c},w=h(O);W==null?delete w[v.key]:w[v.key]=W,Object.keys(w).length?O[r]=JSON.stringify(w):delete O[r],delete O[s],l(O);return}Mt({value:W,name:v.key,type:Hs(v.type),searchQueries:c,setSearchParams:l,filterKey:r,pageKey:s})},[c,l,r,s,h]),B=d.useCallback(v=>{const W={...c},O=h(W);v in O&&(delete O[v],Object.keys(O).length?W[r]=JSON.stringify(O):delete W[r]),delete W[s],l(W)},[c,r,s,h,l]),L=d.useCallback(()=>{const v={...c};delete v[r],delete v[n],delete v[s],l(v)},[c,r,n,s,l]),C=u.length>0;return{activeKeys:u,configByKey:a,hasActiveFilter:C,addFilter:m,removeFilter:y,toggleFilter:k,getValue:b,setValue:M,clearValue:B,clearAll:L}}const Nr={get(t){return Ft.storage.get(t)??null},set(t,r){Ft.storage.save(t,r)},remove(t){Ft.storage.delete(t)}},Ct={columns:t=>`filterbar:colprefs:${t}`,savedViews:t=>`filterbar:views:${t}`,lastState:t=>`filterbar:last:${t}`,perPage:t=>`filterbar:perpage:${t}`,tableSort:t=>`tablelayout:sort:${t}`},At=(t,r)=>{const n=new Set(r.map(i=>i.key)),s=t.order.filter(i=>n.has(i));for(const i of r)s.includes(i.key)||s.push(i.key);const o=t.hidden.filter(i=>n.has(i));return{order:s,hidden:o}};function Vs({columns:t,scopeId:r,storage:n,onColumnsChange:s,value:o}){const i=d.useMemo(()=>({order:t.map(w=>w.key),hidden:[]}),[t]),l=r?Ct.columns(r):void 0,c=(w,R)=>At({order:w.order??R,hidden:w.hidden??[]},t),[a,u]=d.useState(()=>{if(o&&(o.order||o.hidden))return c(o,t.map(w=>w.key));if(l){const w=n.get(l);if(w&&Array.isArray(w.order))return At(w,t)}return i}),h=t.map(w=>w.key).join("|");d.useEffect(()=>u(w=>At(w,t)),[h]);const g=d.useRef(a);g.current=a;const m=o?`${(o.order??[]).join("|")}~${(o.hidden??[]).join("|")}`:null,y=d.useRef(m);d.useEffect(()=>{if(m==null||y.current===m)return;y.current=m;const w=g.current,R=c(o,w.order);R.order.join("|")===w.order.join("|")&&R.hidden.join("|")===w.hidden.join("|")||(u(R),l&&n.set(l,R))},[m,h]);const k=d.useRef(!1);d.useEffect(()=>{k.current||(k.current=!0,s==null||s(a))},[]);const b=d.useCallback(w=>{u(w),l&&n.set(l,w),s==null||s(w)},[l,n,s]),M=d.useMemo(()=>{const w=new Map(t.map(R=>[R.key,R]));return a.order.filter(R=>w.has(R)).map(R=>({...w.get(R),visible:!a.hidden.includes(R)}))},[a,t]),B=d.useCallback(w=>{const R=a.hidden.includes(w)?a.hidden.filter(T=>T!==w):[...a.hidden,w];b({...a,hidden:R})},[a,b]),L=d.useCallback((w,R)=>{if(w===R)return;const T=[...a.order],[J]=T.splice(w,1);T.splice(R,0,J),b({...a,order:T})},[a,b]),C=d.useCallback(w=>{b({...a,hidden:w?t.filter(R=>!R.locked).map(R=>R.key):[]})},[a,t,b]),v=d.useCallback(()=>b(i),[b,i]),W=d.useCallback(w=>b(At(w,t)),[b,t]),O=a.hidden.length===0;return{state:a,orderedColumns:M,allVisible:O,toggleVisibility:B,reorder:L,setAllHidden:C,reset:v,applyState:W}}function Ps({scopeId:t,storage:r,snapshotKeys:n,pageKey:s="page",getColumns:o,applyColumns:i}){const{searchParams:l,setSearchParams:c}=We(),a=t?Ct.savedViews(t):void 0,[u,h]=d.useState(()=>a?r.get(a)||[]:[]),g=d.useCallback(b=>{h(b),a&&r.set(a,b)},[a]),m=d.useCallback(b=>{const M=b.trim();if(!M)return;const B={};n.forEach(C=>{const v=l.get(C);v!=null&&(B[C]=v)});const L={id:`${Date.now()}`,name:M,query:B,columns:o==null?void 0:o(),createdAt:Date.now()};g([...u,L])},[n,l,o,g,u]),y=d.useCallback(b=>g(u.filter(M=>M.id!==b)),[g,u]),k=d.useCallback(b=>{const M=Object.fromEntries(l.entries());n.forEach(B=>delete M[B]),Object.assign(M,b.query),delete M[s],c(M),b.columns&&(i==null||i(b.columns))},[l,n,s,c,i]);return{enabled:!!a,views:u,saveView:m,deleteView:y,applyView:k}}function Ns(t,r){let n;try{n=JSON.parse(t)}catch{return t}return!n||typeof n!="object"?t:(delete n[r],Object.keys(n).length>0?JSON.stringify(n):void 0)}function Dn(t,r,n){const s=t[r];if(s==null)return;const o=Ns(s,n);o===void 0?delete t[r]:t[r]=o}function _s({scopeId:t,storage:r,snapshotKeys:n,enabled:s=!0,filterKey:o="filter",searchKey:i="q",persistSearch:l=!0}){const{searchParams:c}=We(),a=t&&s?Ct.lastState(t):void 0,u=d.useRef(a),h=d.useRef(!1);d.useEffect(()=>{if(!a){u.current=a;return}if(u.current!==a){u.current=a,h.current=!1;return}const y={};if(n.forEach(k=>{const b=c.get(k);b!=null&&(y[k]=b)}),l||Dn(y,o,i),Object.keys(y).length===0){h.current&&r.remove(a);return}h.current=!0,r.set(a,y)},[c,a,n,r,l,o,i]);const g=d.useCallback(()=>{if(!a)return null;const y=r.get(a);return!y||Object.keys(y).length===0||!l&&(Dn(y,o,i),Object.keys(y).length===0)?null:y},[a,r,l,o,i]),m=d.useCallback(()=>{a&&r.remove(a)},[a,r]);return{enabled:!!a,read:g,clear:m}}function qs({scopeId:t,storage:r,perPageKey:n,pageSizeOptions:s,enabled:o=!0}){const{searchParams:i}=We(),l=t&&o?Ct.perPage(t):void 0,c=i.toString(),a=d.useRef(l);d.useEffect(()=>{if(!l){a.current=l;return}if(a.current!==l){a.current=l;return}const g=i.get(n);if(!g)return;const m=Number(g);!Number.isFinite(m)||m<=0||r.set(l,m)},[c,l,n,r]);const u=d.useCallback(()=>{if(!l)return null;const g=r.get(l);if(g==null)return null;const m=Number(g);return!Number.isFinite(m)||m<=0||s&&!s.includes(m)?null:String(m)},[l,r,s]),h=d.useCallback(()=>{l&&r.remove(l)},[l,r]);return{enabled:!!l,read:u,clear:h}}let mr={},gr=!1,pr=null;const Zs=(t,r)=>{Object.assign(mr,t),pr=r,!gr&&(gr=!0,queueMicrotask(()=>{const n=mr,s=pr;mr={},gr=!1,pr=null,!(!s||Object.keys(n).length===0)&&s(o=>{const i=new URLSearchParams(o);return Object.entries(n).forEach(([l,c])=>i.set(l,c)),i})}))};function Gs({enabled:t,snapshotKeys:r,perPageKey:n,readSnapshot:s,readPerPage:o}){const{searchParams:i,setSearchParams:l,location:c}=We(),a=d.useRef(null);d.useEffect(()=>{if(!t||a.current===c.pathname)return;a.current=c.pathname;const u={};if(!i.has(n)){const h=o();h&&(u[n]=h)}if(!r.some(h=>i.has(h))){const h=s();h&&Object.assign(u,h)}Object.keys(u).length!==0&&Zs(u,l)},[c.pathname,t])}const Qs=({configs:t,activeKeys:r,onToggle:n,hasActiveFilter:s,onReset:o})=>t.length?e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{minWidth:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),s&&o&&e.jsx(H.Button,{variant:"link",tone:"brand",size:"xs",onClick:o,children:"Reset"})]}),children:t.map(i=>e.jsx(I.MenuItem,{selected:i.locked||r.includes(i.key),disabled:i.locked,closeOnSelect:!1,startIcon:i.icon??void 0,onClick:()=>{i.locked||n(i.key)},children:i.label},i.key))})})]}):null,Xt=({onClear:t,onRemove:r})=>e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(E.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(I.MenuLists,{children:e.jsxs(I.MenuBody,{style:{width:180},children:[e.jsx(I.MenuItem,{startIcon:e.jsx(E.Icon,{name:"CrossCircle"}),onClick:t,children:"Clear value"}),r&&e.jsx(I.MenuItem,{intent:"danger",startIcon:e.jsx(E.Icon,{name:"Trash1"}),onClick:r,children:"Remove filter"})]})})]}),Us=t=>{const r=new Date(t);return r.setHours(0,0,0,0),r},Sn=(t,r,n)=>{const s=new Date(t);return n==="day"?s.setDate(s.getDate()+r):n==="week"?s.setDate(s.getDate()+r*7):n==="month"?s.setMonth(s.getMonth()+r):s.setFullYear(s.getFullYear()+r),s},ho=t=>{const r=Us(new Date);if(t.direction==="this"){const s=new Date(r),o=new Date(r);return t.period==="week"?(s.setDate(r.getDate()-r.getDay()),o.setDate(s.getDate()+6)):t.period==="month"?(s.setDate(1),o.setMonth(o.getMonth()+1,0)):t.period==="year"&&(s.setMonth(0,1),o.setMonth(11,31)),{from:s,to:o}}const n=t.count??1;return t.direction==="past"?{from:Sn(r,-n,t.period),to:r}:{from:r,to:Sn(r,n,t.period)}},kn=24,fo=t=>t.length>kn?`${t.slice(0,kn)}...`:t,mo=t=>t.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),yr=(t,r="days")=>r==="months"?t.toLocaleDateString(void 0,{month:"short",year:"numeric"}):r==="years"?String(t.getFullYear()):mo(t),Gt={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"},Js=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],Er={past:"Past",next:"Next",this:"This"},Ys=["day","week","month","year"],Xs=["past","next","this"],$s=t=>t.field.type==="date-compact"?e.jsx(ti,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}):e.jsx(Ks,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}),Ks=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=r?mo(new Date(r)):null,l=!!i,c=l?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:fo(i)})]}):t.label;return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:l?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l?e.jsx(E.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:c})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Xt,{onClear:s,onRemove:o})]}),children:e.jsx(xt.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:t.mode,value:r,onChange:a=>a==null?s():n(a),withPadding:!1})})})]})},ei=(t,r="days")=>{switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date?`${Gt[t.op]} ${yr(new Date(t.date),r)}`:null;case"is-between":return t.from&&t.to?`${yr(new Date(t.from),r)} - ${yr(new Date(t.to),r)}`:null;case"is-relative-to-today":{const n=t.relative;if(!n)return null;if(n.direction==="this")return`This ${n.period}`;const s=n.count??1,o=s===1?n.period:`${n.period}s`;return`${Er[n.direction]} ${s} ${o}`}case"is-empty":case"is-not-empty":return Gt[t.op];default:return null}},ti=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=t.ops&&t.ops.length>0?t.ops:Js,l=t.defaultOp&&i.includes(t.defaultOp)?t.defaultOp:i[0],c=t.mode??"days",a=(r==null?void 0:r.op)??l,u=r?ei(r,c):null,h=!!u,g=h?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:fo(u)})]}):t.label,m=y=>{if(y!==a){if(y==="is-empty"||y==="is-not-empty"){n({op:y});return}if(y==="is-relative-to-today"){n({op:y,relative:(r==null?void 0:r.relative)??{direction:"past",count:1,period:"week"}});return}if(y==="is-between"){n({op:y,from:r==null?void 0:r.from,to:r==null?void 0:r.to});return}n({op:y,date:r==null?void 0:r.date})}};return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:h?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:h?e.jsx(E.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:g})}),e.jsxs(I.MenuLists,{children:[e.jsx(I.MenuBody,{style:{width:320},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(ri,{op:a,ops:i,onChange:m})]}),e.jsx(Xt,{onClear:s,onRemove:o})]}),children:e.jsx(ni,{value:r,op:a,mode:c,onChange:n})}),a==="is-relative-to-today"&&e.jsx(I.MenuFooter,{children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},ri=({op:t,ops:r,onChange:n})=>e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:Gt[t]})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:200},children:r.map(s=>e.jsx(I.MenuItem,{selected:t===s,onClick:()=>n(s),endIcon:t===s?e.jsx(E.Icon,{name:"Check"}):void 0,children:Gt[s]},s))})})]}),ni=({value:t,op:r,mode:n="days",onChange:s})=>{if(r==="is-empty"||r==="is-not-empty")return e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(r==="is-between"){const o=t!=null&&t.from||t!=null&&t.to?{from:t!=null&&t.from?new Date(t.from):null,to:t!=null&&t.to?new Date(t.to):null}:void 0;return e.jsx(xt.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,filter:n,value:o,onChange:i=>{if(i==null){s({op:r});return}if(typeof i=="object"&&i!==null&&"from"in i&&"to"in i){let{from:l,to:c}=i;if(!l&&c&&(l=c,c=null),!l&&!c){s({op:r});return}s({op:r,from:l?l.toISOString():void 0,to:c?c.toISOString():void 0})}},withPadding:!1},`range-${n}`)}return r==="is-relative-to-today"?e.jsx(oi,{value:t==null?void 0:t.relative,onChange:o=>s({op:r,relative:o})}):e.jsx(xt.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:n,value:t!=null&&t.date?new Date(t.date):void 0,onChange:o=>{if(o==null){s({op:r});return}o instanceof Date&&s({op:r,date:o.toISOString()})},withPadding:!1},`single-${n}`)},oi=({value:t,onChange:r})=>{const n=(t==null?void 0:t.direction)??"past",s=(t==null?void 0:t.count)??1,o=(t==null?void 0:t.period)??"week",i=n!=="this",l=ho({direction:n,count:s,period:o});return e.jsxs(f.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:Er[n]})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:140},children:Xs.map(c=>e.jsx(I.MenuItem,{selected:n===c,endIcon:n===c?e.jsx(E.Icon,{name:"Check"}):void 0,onClick:()=>r(c==="this"?{direction:c,period:o}:{direction:c,count:s,period:o}),children:Er[c]},c))})})]}),i&&e.jsx(at.Input,{type:"number",size:"sm",min:1,clearable:!1,value:s,onChange:c=>{const a=Number(c.target.value);r({direction:n,count:Number.isFinite(a)&&a>0?a:1,period:o})},style:{width:72}}),e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:o})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:140},children:Ys.map(c=>e.jsx(I.MenuItem,{selected:o===c,endIcon:o===c?e.jsx(E.Icon,{name:"Check"}):void 0,onClick:()=>r(n==="this"?{direction:n,period:c}:{direction:n,count:s,period:c}),children:c},c))})})]})]}),e.jsx(xt.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:l,onChange:()=>{},withPadding:!1},"relative-preview")]})},Bn=18,si=t=>t.length>Bn?`${t.slice(0,Bn)}...`:t,ii=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=t.type==="dropdown-multiple",l=r.length,c=t.searchable!==!1,[a,u]=d.useState(""),h=t.options,g=typeof t.onSearch=="function",m=(()=>{if(g)return h;const B=a.trim().toLowerCase();return B?h.filter(L=>L.label.toLowerCase().includes(B)):h})(),y=B=>r.some(L=>L.value===B.value),k=B=>{if(!i){n([{label:B.label,value:B.value}]),u("");return}n(y(B)?r.filter(L=>L.value!==B.value):[...r,{label:B.label,value:B.value}])},b=B=>{var L;u(B),(L=t.onSearch)==null||L.call(t,B)},M=l===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:l===1?si(r[0].label):`${l} Selected`})]});return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:l>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l>0?e.jsx(E.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:M})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Xt,{onClear:s,onRemove:o})]}),children:e.jsxs(f.Box,{direction:"column",gap:"sm",children:[c&&e.jsx(jt.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:i,searchAble:!0,searchValue:a,onSearch:b,value:r,onChange:n,placeholder:`Search ${t.label.toLowerCase()}…`}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:t.isLoading?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):m.length===0?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):m.map(B=>e.jsx(I.MenuItem,{closeOnSelect:!i,selected:y(B),startIcon:B.avatar,endIcon:y(B)?e.jsx(E.Icon,{name:"Check"}):void 0,description:B.description,onClick:()=>k(B),children:B.label},B.value))})]})})})]})},Fn=18,li=t=>t.length>Fn?`${t.slice(0,Fn)}...`:t,En=({checked:t,indeterminate:r})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(rt.Checkbox,{size:"sm",checked:t,readOnly:!0,onChange:()=>{},variant:r?"indeterminate":"select"})}),ci=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=new Set(r.map(m=>m.value)),l=r.length,c=t.options.length>0&&t.options.every(m=>i.has(m.value)),a=l>0&&!c,u=m=>{n(i.has(m.value)?r.filter(y=>y.value!==m.value):[...r,{label:m.label,value:m.value}])},h=()=>{n(c?[]:t.options.map(m=>({label:m.label,value:m.value})))},g=l===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs(D.Text,{as:"span",fontWeight:"semibold",children:[t.label,":"]})," ",e.jsx(D.Text,{as:"span",children:l===1?li(r[0].label):`${l} Selected`})]});return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:l>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l>0?e.jsx(E.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:g})}),e.jsx(I.MenuLists,{children:e.jsxs(I.MenuBody,{style:{width:240},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Xt,{onClear:s,onRemove:o})]}),children:[e.jsx(I.MenuItem,{closeOnSelect:!1,selected:c,onClick:h,startIcon:e.jsx(En,{checked:c||a,indeterminate:a}),children:"Select All"}),t.options.map(m=>e.jsx(I.MenuItem,{closeOnSelect:!1,selected:i.has(m.value),onClick:()=>u(m),startIcon:e.jsx(En,{checked:i.has(m.value)}),children:m.label},m.value))]})})]})},go=({activeKeys:t,configByKey:r,getValue:n,setValue:s,clearValue:o,removeFilter:i})=>e.jsx(e.Fragment,{children:t.map(l=>{const c=r[l];if(!c)return null;const a=n(c),u=c.locked?void 0:()=>i(l);return c.type==="date"||c.type==="date-compact"?e.jsx($s,{field:c,value:a,onChange:h=>s(c,h),onClear:()=>o(l),onRemove:u},l):c.type==="checkbox-multiple"?e.jsx(ci,{field:c,value:a||[],onChange:h=>s(c,h),onClear:()=>o(l),onRemove:u},l):e.jsx(ii,{field:c,value:a||[],onChange:h=>s(c,h),onClear:()=>o(l),onRemove:u},l)})}),Mn=t=>`${t} Rows`,ai=({pagination:t,pageKey:r="page",perPageKey:n="perPage",pageSizeOptions:s=[10,25,50,100],defaultPerPage:o=10,showResultCount:i=!0,showPageSize:l=!0,showPagination:c=!0})=>{var B;const{searchQueries:a,setSearchParams:u,searchParams:h}=We(),g=h.get(n),m=g?Number(g):o,y=L=>{u({...a,[r]:String(L)})},k=L=>{u({...a,[n]:L,[r]:"1"})},b=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:0),M=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[i&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${b}-${M} of ${((B=t==null?void 0:t.totalData)==null?void 0:B.toLocaleString())||0}`}),l&&e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:Mn(m)})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{children:s.map(L=>e.jsx(I.MenuItem,{selected:L===m,onClick:()=>k(String(L)),children:Mn(L)},L))})})]}),c&&((t==null?void 0:t.totalPage)??0)>1&&e.jsx(f.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(Et.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:t!=null&&t.currentPage?Number(t.currentPage):1,totalPages:Number(t==null?void 0:t.totalPage),onPageChange:y})})]})};function di(t,r,n=!0){d.useEffect(()=>{if(!n)return;const s=o=>{var c;if(o.metaKey||o.ctrlKey||o.altKey||o.key!==t||Re.isOverlayOpen())return;const i=o.target,l=(c=i==null?void 0:i.tagName)==null?void 0:c.toLowerCase();l==="input"||l==="textarea"||i!=null&&i.isContentEditable||(o.preventDefault(),r())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t,r,n])}const ui=240,po=({searchKey:t="q",filterKey:r="filter",pageKey:n="page",placeholder:s="Search",shortcut:o="/",collapsible:i=!0})=>{const{searchParams:l,setSearchParams:c,searchQueries:a}=We(),u=Yt(t,l,r)||"",[h,g]=d.useState(!i||!!u),[m,y]=d.useState(i&&!u),[k,b]=d.useState(u),M=we.useDebounce(k,350),B=d.useRef(null);d.useEffect(()=>{b(u),u&&g(!0)},[u]),d.useEffect(()=>{h&&y(!1)},[h]),d.useEffect(()=>{M!==u&&Mt({value:M,name:t,type:"search",searchQueries:a,setSearchParams:c,filterKey:r,pageKey:n})},[M]);const L=d.useCallback(()=>{g(!0),requestAnimationFrame(()=>{var O;return(O=B.current)==null?void 0:O.focus()})},[]);di(o,L);const C=()=>{i&&!k&&g(!1)},v=O=>{var w;i&&O.key==="Escape"&&!k&&(g(!1),(w=B.current)==null||w.blur())},W=()=>{h||y(!0)};return e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[m&&e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:L}),e.jsxs(f.Box,{onTransitionEnd:W,style:{position:"relative",width:h?ui:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(at.Input,{ref:B,size:"sm",fullWidth:!0,value:k,placeholder:s,leftIcon:e.jsx(E.Icon,{name:"Search",width:16,height:16}),onChange:O=>b(O.target.value),onKeyDown:v,onBlur:C,tabIndex:h?0:-1}),h&&!k&&e.jsx(f.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(D.Text,{fontSize:"xs",color:"subtle",children:o})})]})]})},yo=({columns:t,allVisible:r,onToggle:n,onReorder:s,onSetAllHidden:o})=>{const[i,l]=d.useState(null),[c,a]=d.useState(null),u=()=>{i!==null&&c!==null&&i!==c&&s(i,c),l(null),a(null)},h=(g,m)=>{const y=g+m;y<0||y>=t.length||s(g,y)};return e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:r?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{children:e.jsxs(f.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(H.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>o(r),children:r?"Hide All":"Show All"})]}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:t.map((g,m)=>{const y=!g.locked,k=c===m&&i!==null&&i!==m;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:y,onDragStart:()=>y&&l(m),onDragOver:b=>{b.preventDefault(),a(m)},onDrop:u,onDragEnd:u,style:{minHeight:32,boxShadow:k?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(f.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:y?0:-1,"aria-label":`Reorder ${g.title}`,"aria-disabled":!y||void 0,color:"icon-subtlest",onKeyDown:b=>{y&&(b.key==="ArrowUp"?(b.preventDefault(),h(m,-1)):b.key==="ArrowDown"&&(b.preventDefault(),h(m,1)))},style:{display:"inline-flex",cursor:y?"grab":"default",opacity:y?1:.4},children:e.jsx(E.Icon,{name:"DragVertical",width:16,height:16})}),g.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:g.icon}),e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:g.title}),e.jsx(f.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(vt.Toggle,{size:"sm",checked:g.visible,disabled:g.locked,onChange:()=>n(g.key),"aria-label":`Toggle ${g.title} column`})})]},g.key)})})]})})})]})},jo=({views:t,onApply:r,onDelete:n,onSave:s})=>{const[o,i]=d.useState(""),l=()=>{const c=o.trim();c&&(s(c),i(""))};return e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:t.length>0?"secondary":"outline",tone:(t.length>0,"neutral"),size:"sm",iconLeft:e.jsx(E.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(I.MenuLists,{style:{width:"260px"},children:[e.jsx(I.MenuBody,{children:e.jsxs(f.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:t.length===0?e.jsx(f.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(D.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):t.map(c=>e.jsx(I.MenuItem,{startIcon:e.jsx(E.Icon,{name:"Bookmark"}),onClick:()=>r(c),endIcon:e.jsx(H.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(E.Icon,{name:"Trash2"}),"aria-label":`Delete ${c.name}`,onClick:a=>{a.stopPropagation(),n(c.id)}}),children:c.name},c.id))})]})}),e.jsx(I.MenuFooter,{children:e.jsxs(f.Box,{direction:"row",gap:"xs",children:[e.jsx(f.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(at.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:o,onChange:c=>i(c.target.value),onKeyDown:c=>{c.key==="Enter"&&l()}})}),e.jsx(H.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!o.trim(),onClick:l,children:"Save"})]})})]})]})},xi=({isOpen:t,onClose:r,configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,onToggle:l,onReset:c,getValue:a,setValue:u,clearValue:h,removeFilter:g})=>{const m=s.length;return e.jsx(qt.Drawer,{position:"bottom",isShow:t,onHide:r,children:e.jsxs(f.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(f.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(f.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),m>0&&e.jsxs(D.Text,{fontSize:"sm",color:"subtle",children:["(",m,")"]})]}),e.jsx(H.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:r})]}),e.jsxs(f.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[m>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(D.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(f.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(go,{activeKeys:s,configByKey:o,getValue:a,setValue:u,clearValue:h,removeFilter:g})})]}),n.length>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(D.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(f.Box,{direction:"column",children:n.map(y=>{const k=s.includes(y.key),b=!!y.locked;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:b?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[y.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:y.icon}),e.jsx(D.Text,{fontSize:"sm",color:"primary",truncate:!0,children:y.label})]}),e.jsx(vt.Toggle,{size:"sm",checked:k||b,disabled:b,onChange:()=>l(y.key),"aria-label":`Toggle ${y.label}`})]},y.key)})})]})]}),e.jsxs(f.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(f.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!i,onClick:c,children:"Reset"})}),e.jsx(f.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(H.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:r,children:"Selesai"})})]})]})})},hi=t=>`${t} Rows`,fi=({perPageKey:t,pageKey:r,pageSizeOptions:n,defaultPerPage:s=10,showPageSize:o})=>{const{searchQueries:i,setSearchParams:l,searchParams:c}=We(),a=c.get(t),u=a?Number(a):s,h=g=>{l({...i,[t]:g,[r]:"1"})};return o?e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(I.MenuLists,{children:e.jsxs(I.MenuBody,{style:{minWidth:200},children:[e.jsx(f.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(D.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),n.map(g=>e.jsx(I.MenuItem,{selected:g===u,endIcon:g===u?e.jsx(E.Icon,{name:"Check"}):void 0,onClick:()=>h(String(g)),children:hi(g)},g))]})})]}):null},mi=t=>{var Ne;const{withPadding:r,configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,toggleFilter:l,removeFilter:c,getValue:a,setValue:u,clearValue:h,onReset:g,searchable:m,searchKey:y,filterKey:k,pageKey:b,searchPlaceholder:M,searchShortcut:B,searchCollapsible:L,pagination:C,perPageKey:v,pageSizeOptions:W,defaultPerPage:O,showPagination:w,showResultCount:R,showPageSize:T,hasColumns:J,orderedColumns:X,allVisible:Z,onToggleVisibility:P,onReorder:$,onSetAllHidden:ee,showSavedViews:N,savedViews:z,onApplyView:V,onDeleteView:ie,onSaveView:je,leadingActions:Ie}=t,[xe,ve]=d.useState(!1),{searchQueries:De,setSearchParams:Te}=We(),Oe=(C==null?void 0:C.rangeStart)??(((C==null?void 0:C.currentPage)||0)>1?(((C==null?void 0:C.currentPage)||0)-1)*((C==null?void 0:C.perPage)||0)+1:1),Me=(C==null?void 0:C.rangeEnd)??((C==null?void 0:C.totalCurrentPage)!==(C==null?void 0:C.perPage)?C==null?void 0:C.totalData:((C==null?void 0:C.currentPage)||1)*((C==null?void 0:C.totalCurrentPage)||0)),He=Ue=>{Te({...De,[b]:String(Ue)})},be=R||w&&!!(C!=null&&C.totalPage),Ae=()=>{g(),ve(!1)};return e.jsxs(f.Box,{direction:"column",gap:"sm",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(f.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[m&&e.jsx(po,{searchKey:y,filterKey:k,pageKey:b,placeholder:M,shortcut:B,collapsible:L}),e.jsx(H.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"FilterHorizontal"}),onClick:()=>ve(!0),"aria-label":"Open filters",children:i?`Filter: ${s.length}`:null}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[Ie,N&&e.jsx(jo,{views:z,onApply:V,onDelete:ie,onSave:je}),J&&e.jsx(yo,{columns:X,allVisible:Z,onToggle:P,onReorder:$,onSetAllHidden:ee}),e.jsx(fi,{perPageKey:v,pageKey:b,pageSizeOptions:W,defaultPerPage:O,showPageSize:T})]})]}),be&&e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[R?e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Oe}-${Me} of ${((Ne=C==null?void 0:C.totalData)==null?void 0:Ne.toLocaleString())||0}`}):e.jsx(f.Box,{direction:"column"}),w&&!!(C!=null&&C.totalPage)&&e.jsx(Et.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:C!=null&&C.currentPage?Number(C.currentPage):1,totalPages:Number(C.totalPage),onPageChange:He})]}),e.jsx(xi,{isOpen:xe,onClose:()=>ve(!1),configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,onToggle:l,onReset:Ae,getValue:a,setValue:u,clearValue:h,removeFilter:c})]})},gi=({withPadding:t=!1,filterConfigs:r=[],filterKey:n="filter",activeFilterKey:s="filters",pageKey:o="page",perPageKey:i="perPage",pageSizeOptions:l=[25,50,100],defaultPerPage:c,showPagination:a=!0,showResultCount:u=!0,showPageSize:h=!0,searchable:g=!1,searchKey:m="q",searchPlaceholder:y="Search",searchShortcut:k="/",searchPosition:b="right",searchCollapsible:M=!0,pagination:B,columns:L=[],onColumnsChange:C,columnsState:v,scopeId:W,savedViews:O,persistLastState:w=!0,persistSearch:R=!0,storage:T=Nr,onReset:J,leadingActions:X})=>{const Z=W??(O==null?void 0:O.scopeId),{activeKeys:P,configByKey:$,hasActiveFilter:ee,toggleFilter:N,removeFilter:z,getValue:V,setValue:ie,clearValue:je,clearAll:Ie}=Pr({configs:r,filterKey:n,activeFilterKey:s,pageKey:o,searchKey:m}),xe=Vs({columns:L,scopeId:Z,storage:T,onColumnsChange:C,value:v}),ve=Ps({scopeId:Z,storage:T,snapshotKeys:[s,n,i],pageKey:o,getColumns:()=>xe.state,applyColumns:xe.applyState}),De=_s({scopeId:Z,storage:T,snapshotKeys:[s,n,o],enabled:w,filterKey:n,searchKey:m,persistSearch:R}),Te=qs({scopeId:Z,storage:T,perPageKey:i,pageSizeOptions:l,enabled:w});Gs({enabled:w&&!!Z,snapshotKeys:[s,n,o],perPageKey:i,readSnapshot:De.read,readPerPage:Te.read});const Oe=c??l[0]??25,Me=!!(O!=null&&O.enabled)&&ve.enabled,He=()=>{Ie(),De.clear(),J==null||J()},be=we.useMediaQuery("md"),Ae=g?e.jsx(po,{searchKey:m,filterKey:n,pageKey:o,placeholder:y,shortcut:k,collapsible:M}):null;return be?e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",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(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Qs,{configs:r,activeKeys:P,onToggle:N,hasActiveFilter:ee,onReset:He}),b==="left"&&Ae,e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(go,{activeKeys:P,configByKey:$,getValue:V,setValue:ie,clearValue:je,removeFilter:z}),ee&&e.jsx(H.Button,{variant:"link",tone:"brand",size:"sm",onClick:He,children:"Reset"})]})]}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[X,e.jsx(ai,{pagination:B,pageKey:o,perPageKey:i,pageSizeOptions:l,defaultPerPage:Oe,showPagination:a,showResultCount:u,showPageSize:h}),b==="right"&&Ae,Me&&e.jsx(jo,{views:ve.views,onApply:ve.applyView,onDelete:ve.deleteView,onSave:ve.saveView}),L.length>0&&e.jsx(yo,{columns:xe.orderedColumns,allVisible:xe.allVisible,onToggle:xe.toggleVisibility,onReorder:xe.reorder,onSetAllHidden:xe.setAllHidden})]})]}):e.jsx(mi,{withPadding:t,configs:r,activeKeys:P,configByKey:$,hasActiveFilter:ee,toggleFilter:N,removeFilter:z,getValue:V,setValue:ie,clearValue:je,onReset:He,searchable:g,searchKey:m,filterKey:n,pageKey:o,searchPlaceholder:y,searchShortcut:k,searchCollapsible:M,pagination:B,perPageKey:i,pageSizeOptions:l,defaultPerPage:Oe,showPagination:a,showResultCount:u,showPageSize:h,hasColumns:L.length>0,orderedColumns:xe.orderedColumns,allVisible:xe.allVisible,onToggleVisibility:xe.toggleVisibility,onReorder:xe.reorder,onSetAllHidden:xe.setAllHidden,showSavedViews:Me,savedViews:ve.views,onApplyView:ve.applyView,onDeleteView:ve.deleteView,onSaveView:ve.saveView,leadingActions:X})},pi=t=>{if(!Array.isArray(t)||t.length===0)return;const r=t[0];return(r==null?void 0:r.value)!=null?String(r.value):void 0},yi=t=>{if(!Array.isArray(t)||t.length===0)return;const r=t.map(n=>(n==null?void 0:n.value)!=null?String(n.value):null).filter(n=>n!=null);return r.length?r:void 0},ji=(t,r)=>{switch(t.type){case"dropdown":case"radio":return pi(r);case"dropdown-multiple":case"checkbox-multiple":return yi(r);case"date":return r instanceof Date?r.toISOString():void 0;case"date-compact":return r;default:return}},Ln=(t,r)=>{if(t==null||t==="")return r;const n=Number(t);return Number.isFinite(n)&&n>0?n:r},bi=t=>{const{filterConfigs:r,filterKey:n="filter",activeFilterKey:s="filters",pageKey:o="page",perPageKey:i="perPage",searchKey:l="q",defaultPage:c=1,defaultPerPage:a=10,paramKeys:u,serialize:h}=t,{activeKeys:g,configByKey:m,hasActiveFilter:y,getValue:k}=Pr({configs:r,filterKey:n,activeFilterKey:s,pageKey:o,searchKey:l}),{searchParams:b}=We(),M=b.toString();return d.useMemo(()=>{const L={},C={},v=Ln(b.get(o),c),W=Ln(b.get(i),a);L[(u==null?void 0:u.page)??"page"]=v,L[(u==null?void 0:u.perPage)??"perPage"]=W;const O=Yt(l,b,n)||"";O&&(L[(u==null?void 0:u.search)??"search"]=O);let w=!1;for(const R of g){const T=m[R];if(!T)continue;const J=k(T);C[R]=J;const X=h==null?void 0:h[R],Z=X?X(J):ji(T,J);if(Z==null||Array.isArray(Z)&&Z.length===0)continue;const P=(u==null?void 0:u[R])??R;L[P]=Z,w=!0}return{params:L,raw:C,hasActiveFilter:y||!!O||w}},[M,g.join("|"),n,s,o,i,l,c,a,u,h,m])},vi=["dropdown","dropdown-multiple","checkbox-multiple","radio"],Ci=({filterConfigs:t,filterKey:r,activeFilterKey:n,pageKey:s,searchKey:o})=>{const{configByKey:i,getValue:l,setValue:c,removeFilter:a,clearAll:u,hasActiveFilter:h}=Pr({configs:t,filterKey:r,activeFilterKey:n,pageKey:s,searchKey:o}),g=(B,L)=>{var v;const C=B.options;return((v=C==null?void 0:C.find(W=>W.value===L))==null?void 0:v.label)??L},m=d.useCallback(B=>{const L=i[B];if(!L)return[];const C=l(L);return Array.isArray(C)?C.map(v=>String(v.value)):[]},[i,l]),y=d.useCallback((B,L)=>{const C=i[B];if(!C||!vi.includes(C.type))return;const v=Array.isArray(L)?L:[L];if(v.length===0){a(B);return}c(C,v.map(W=>({label:g(C,W),value:W})))},[i,c,a]),k=d.useCallback((B,L)=>{const C=m(B);y(B,C.includes(L)?C.filter(v=>v!==L):[...C,L])},[m,y]),b=d.useCallback((B,L)=>m(B).includes(L),[m]),M=d.useCallback(B=>a(B),[a]);return{set:y,toggle:k,clear:M,clearAll:u,isActive:b,values:m,hasActiveFilter:h}},wi=(t,r)=>{if(!t)return{};const{fromKey:n,toKey:s,opKey:o}=r,i={};switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date&&(i[n]=new Date(t.date).toISOString()),o&&(i[o]=t.op),i;case"is-between":return t.from&&(i[n]=new Date(t.from).toISOString()),t.to&&(i[s]=new Date(t.to).toISOString()),i;case"is-relative-to-today":{if(!t.relative)return i;const{from:l,to:c}=ho(t.relative);return i[n]=l.toISOString(),i[s]=c.toISOString(),i}case"is-empty":case"is-not-empty":return o&&(i[o]=t.op==="is-empty"?"empty":"not-empty"),i;default:return i}},bo=({children:t,borderRadius:r,height:n})=>{const s=d.useRef(null),[o,i]=d.useState("100vh");return d.useEffect(()=>{if(n)return;const l=()=>{if(s.current){const c=s.current.getBoundingClientRect().top;i(`calc(100vh - ${c}px)`)}};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[n]),e.jsx(f.Box,{ref:s,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:r||"rounded-xs",style:{height:n??o,display:"flex",flexDirection:"column"},children:t})},vo=({action:t,rightContent:r,leftContent:n,headerSlot:s,advanceFilter:o,showFilter:i=!0})=>{const l=we.useMediaQuery("md"),c=i?e.jsx(xo,{...o}):null,a=()=>t?d.isValidElement(t)?t:e.jsx(f.Box,{style:{display:"flex",flexDirection:l?"row":"column",gap:"8px",width:l?"auto":"100%",textWrap:"nowrap"},children:t.map(({title:u,icon:h,buttonProps:g,onClick:m},y)=>!u&&!h?null:e.jsx(H.Button,{fullWidth:!l,iconLeft:h?e.jsx(E.Icon,{name:h}):void 0,onClick:m,...g,children:u},`action-${y}`))}):null;return e.jsx(f.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:l?"row":"column-reverse",gap:"16px"},children:s?s({filter:c}):e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[c,n]}),e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[r,a()]})]})})},Di=({totalData:t,withMarginBottom:r=!0,withMarginTop:n=!0})=>e.jsxs(f.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:r?"16px":void 0,marginTop:n?"16px":void 0},children:[e.jsxs(Qe.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Qe.Body1,{children:t||0})]}),Co=({pagination:t,pageKey:r="page",perPageKey:n="perPage",defaultPerPage:s=10,showPagination:o=!0,totalData:i})=>{const{searchQueries:l,setSearchParams:c,searchParams:a}=We(),u=a.get(n),h=k=>{c({...l,[r]:String(k)})},g=k=>{c({...l,[n]:k,[r]:"1"})},m=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:1),y=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.totalCurrentPage)||0));return e.jsx(f.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(f.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(D.Text,{children:"Rows Per Page: "}),e.jsx(jt.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:k=>{g(k[0].value)},value:u?[{label:`${u} per row`,value:u}]:[{label:`${s} per row`,value:`${s}`}],defaultValue:u?[{label:`${u} per row`,value:u}]:[{label:`${s} per row`,value:`${s}`}]}),e.jsx(D.Text,{children:`${m}-${y} of ${(t==null?void 0:t.totalData)||0}`})]}),e.jsx(Et.Pagination,{currentPage:t!=null&&t.currentPage?Number(t==null?void 0:t.currentPage):1,totalPages:t!=null&&t.totalPage?Number(t==null?void 0:t.totalPage):1,onPageChange:h})]}):e.jsx(Di,{totalData:i,withMarginBottom:!1,withMarginTop:!1})})},wo=({filter:t,columnTitle:r})=>{const[n,s]=d.useState(!1),o=d.useRef(null),i=d.useRef(null),l=d.useRef(null),[c,a]=d.useState(""),[u,h]=d.useState({top:0,left:0}),g=t.selectedValues,m=d.useMemo(()=>c?t.options.filter(b=>b.label.toLowerCase().includes(c.toLowerCase())):t.options,[t.options,c]);d.useEffect(()=>{if(n&&i.current){const b=i.current.getBoundingClientRect(),M=280,B={top:b.bottom+8};t.position==="left"||b.left+M>window.innerWidth?B.right=window.innerWidth-b.right:B.left=b.left,h(B)}},[n,t.position]),d.useEffect(()=>{n&&l.current?setTimeout(()=>{var b;return(b=l.current)==null?void 0:b.focus()},50):a("")},[n]),d.useEffect(()=>{const b=M=>{o.current&&!o.current.contains(M.target)&&i.current&&!i.current.contains(M.target)&&s(!1)};return n&&document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[n]);const y=b=>{const M=g.includes(b)?g.filter(B=>B!==b):[...g,b];t.onFilterChange(M)},k=()=>t.onFilterChange([]);return e.jsxs(f.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(f.Box,{ref:i,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:b=>{var M;b.stopPropagation(),n||(M=t.onOpen)==null||M.call(t),s(B=>!B)},children:e.jsx(E.Icon,{name:n?"ChevronUp":"ChevronDown",size:"sm",style:{color:g.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),n&&e.jsxs(f.Box,{ref:o,style:{position:"fixed",top:`${u.top}px`,...u.left!==void 0?{left:`${u.left}px`}:{right:`${u.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(f.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(D.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",r]}),g.length>0&&e.jsx(f.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(D.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:b=>{b.stopPropagation(),k()},children:"CLEAR"})})]}),!t.hideSearch&&e.jsx(f.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(at.Input,{ref:l,placeholder:`Search ${r.toLowerCase()}...`,leftIcon:e.jsx(E.Icon,{name:"Search",size:"sm"}),value:c,onChange:b=>a(b.target.value),style:{fontSize:"14px"}})}),e.jsx(f.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:t.isLoadingOptions?e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(E.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):m.length>0?e.jsx(f.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:m.map(b=>e.jsxs(f.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:g.includes(b.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:M=>{M.stopPropagation(),y(b.value)},onMouseEnter:M=>{g.includes(b.value)||(M.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),M.currentTarget.style.transform="translateX(2px)"},onMouseLeave:M=>{M.currentTarget.style.backgroundColor=g.includes(b.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",M.currentTarget.style.transform="translateX(0)"},children:[e.jsx(rt.Checkbox,{checked:g.includes(b.value),onChange:()=>{}}),e.jsx(D.Text,{fontSize:"sm",fontWeight:g.includes(b.value)?"medium":"normal",color:g.includes(b.value)?"primary":"gray-700",children:b.label})]},b.value))}):e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(E.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),g.length>0&&e.jsx(f.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(f.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(f.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:g.length}),e.jsxs(D.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",g.length>1?"s":""," selected"]})]})})]})]})},Si=({direction:t})=>{const r="var(--sa-text-primary, #292a2e)",n="var(--sa-text-subtle, #8c8f97)",s=t==="asc"?r:n,o=t==="desc"?r:n,i=t==="asc"?1:.45,l=t==="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:s,opacity:i,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:l},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},ki=({frozen:t})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:t?"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:t?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),jr="var(--sa-background-primary, #ffffff)",In="var(--sa-background-primary-inverse, #f8f8f8)",Do=({columns:t,records:r,handleDetail:n,handleUpdate:s,handleDelete:o,isLoading:i,visibleHandleDelete:l,visibleHandleUpdate:c,visibleHandleDetail:a,showHeadBorder:u=!1,scrollParentRef:h,frozenCount:g=0,onFrozenCountChange:m,customActions:y,actionsOrder:k=["detail","update","delete","custom"],customEmptyState:b,enableColumnResize:M=!1,defaultColumnWidths:B,onColumnWidthsChange:L,defaultMinColumnWidth:C=60,sort:v,defaultSort:W,onSortChange:O,showActionDivider:w=!1})=>{const R=v!==void 0,[T,J]=d.useState(W??null),X=R?v??null:T,Z=A=>{if(A.sortKey)return A.sortKey;if(typeof A.accessor=="string")return A.accessor},P=A=>{const K=Z(A);if(!K)return;let G;!X||X.key!==K?G={key:K,direction:"asc"}:X.direction==="asc"?G={key:K,direction:"desc"}:G=null,R||J(G),O==null||O(G)},ee=[n,s,o].filter(A=>A!==void 0).length,N=!!y,z=!!n||!!s||!!o||N,V="var(--sa-border-subtle, #0b120e24)",ie=`1px solid ${V}`,je=`inset 1px 0 0 ${V}`,Ie=`inset -1px 0 0 ${V}`,xe=ee===3?N?"178px":"140px":ee===2?N?"140px":"102px":ee===1?N?"112px":"74px":N?"74px":"",ve=(A,K)=>{if(!K)return A;if(typeof K=="function")return K(A);if(typeof K=="string")return A[K]},[De,Te]=d.useState(!1);d.useEffect(()=>{if(!(h!=null&&h.current))return;const A=h.current;Te(A.scrollHeight>A.clientHeight)},[r,h]);const Oe=d.useRef(null),[Me,He]=d.useState([]),[be,Ae]=d.useState(()=>B??{}),Ne=d.useRef(null);d.useLayoutEffect(()=>{if(!g||!Oe.current){He([]);return}const A=Array.from(Oe.current.querySelectorAll("thead tr th")),K=[];let G=0;A.forEach((le,oe)=>{K[oe]=G,oe<g&&(G+=le.offsetWidth)}),He(K)},[g,t,r,be]);const Ue=A=>{m&&m(A<g?A:A+1)},Ce=(A,K)=>{const G=be[A];if(G!==void 0){const le=`${G}px`;return{width:le,minWidth:le,maxWidth:le}}return K?{width:K}:{}},Ke=A=>M&&(A.resizable??!0),ht=(A,K)=>{A.preventDefault(),A.stopPropagation();const G=A.currentTarget.closest("th");if(!G)return;const le=Math.round(G.getBoundingClientRect().width);Ne.current={colIndex:K,startX:A.clientX,startWidth:le};const oe=document.body.style.userSelect,me=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Je=Ve=>{var et;const Se=Ne.current;if(!Se)return;const qe=((et=t[Se.colIndex])==null?void 0:et.minWidth)??C,de=Math.max(qe,Se.startWidth+(Ve.clientX-Se.startX));Ae(tt=>tt[Se.colIndex]===de?tt:{...tt,[Se.colIndex]:de})},_e=()=>{document.removeEventListener("mousemove",Je),document.removeEventListener("mouseup",_e),document.body.style.userSelect=oe,document.body.style.cursor=me,Ne.current=null,L&&Ae(Ve=>(L(Ve),Ve))};document.addEventListener("mousemove",Je),document.addEventListener("mouseup",_e)};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:[t.map((A,K)=>{var ot,dt;const G=g>0&&K<g,le=Me[K]??0,oe=Ke(A),Je=K===t.length-1&&z&&w,_e=Z(A),Ve=!!A.sortable&&!!_e,Se=Ve&&(X==null?void 0:X.key)===_e?X.direction:null,qe=A.title||((ot=A.accessor)==null?void 0:ot.toString())||"",de=(dt=A.headerTooltip)!=null&&dt.showIcon?e.jsx(E.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,et=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:qe}),tt=Ve?e.jsxs("button",{type:"button",onClick:()=>P(A),title:Se==="asc"?"Sorted ascending — click to sort descending":Se==="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:A.textAlign==="text-right"?"right":A.textAlign==="text-center"?"center":"left"},children:[et,de,e.jsx(Si,{direction:Se})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[et,de]});return e.jsxs(q.Th,{style:{position:"sticky",top:0,left:G?le:void 0,zIndex:G?4:2,paddingLeft:K===0?"12px":"",borderRight:u&&!Je&&!G?ie:void 0,borderBottom:u?ie:void 0,boxShadow:u&&G?Ie:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:A.textAlign==="text-right"?"right":A.textAlign==="text-center"?"center":"left",...Ce(K,A.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[A.headerTooltip?e.jsx(Be.Tooltip,{label:A.headerTooltip.content,position:"bottom",children:tt}):tt,A.filter&&e.jsx(wo,{filter:A.filter,columnTitle:A.title}),m&&e.jsx("button",{onClick:()=>Ue(K),title:G?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:G?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:G?1:.45,transition:"opacity 0.15s"},children:e.jsx(ki,{frozen:G})})]}),oe&&e.jsx("div",{onMouseDown:lt=>ht(lt,K),onClick:lt=>lt.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-${K}`)}),z?e.jsx(q.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:u?ie:void 0,boxShadow:u&&w?je:void 0}}):null]})}),e.jsx(q.Tbody,{children:i?e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:t.length+1,children:e.jsxs(f.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(Ge.Skeleton,{variant:"list"}),e.jsx(Ge.Skeleton,{variant:"list"}),e.jsx(Ge.Skeleton,{variant:"list"}),e.jsx(Ge.Skeleton,{variant:"list"}),e.jsx(Ge.Skeleton,{variant:"list"})]})})}):!(r!=null&&r.length)&&b?e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:t.length+1,children:b})}):r==null?void 0:r.map((A,K)=>e.jsxs(q.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:K===r.length-1&&De?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:G=>{const le=G.currentTarget;le.style.backgroundColor=In,Array.from(le.querySelectorAll("td")).forEach(oe=>{oe.style.position==="sticky"&&(oe.style.backgroundColor=In)})},onMouseLeave:G=>{const le=G.currentTarget;le.style.backgroundColor="",Array.from(le.querySelectorAll("td")).forEach(oe=>{oe.style.position==="sticky"&&(oe.style.backgroundColor=jr)})},children:[t.map((G,le)=>{const oe=G.render?G.render(A,K,r):ve(A,G.accessor),me=g>0&&le<g,Je=Me[le]??0,_e=be[le]!==void 0,Ve=me&&le===g-1;return e.jsx(q.Td,{style:{position:me?"sticky":void 0,left:me?Je:void 0,zIndex:me?1:void 0,backgroundColor:me?jr:void 0,transition:me?"background-color 0.3s ease":void 0,paddingLeft:le===0?"12px":"",whiteSpace:"nowrap",overflow:_e?"hidden":void 0,borderLeft:G.showBorderLeft?ie:void 0,borderRight:G.showBorderRight?ie:void 0,boxShadow:Ve?Ie:void 0,textAlign:G.textAlign==="text-right"?"right":G.textAlign==="text-center"?"center":"left",...Ce(le,G.width)},children:typeof oe=="string"?e.jsx(D.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:G.textAlign==="text-right"?"right":G.textAlign==="text-center"?"center":"left"},children:oe}):oe},`row-${K}-col-${le}`)}),z?e.jsx(q.Td,{style:{width:xe,position:"sticky",right:0,zIndex:1,backgroundColor:jr,boxShadow:w?je:void 0,transition:"background-color 0.3s ease"},children:e.jsx(ce.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:k.map(G=>{const le=K===r.length-1?"top":"bottom";return G==="detail"&&n&&(a==null?void 0:a(A))!==!1?e.jsx(Be.Tooltip,{label:"Detail",position:le,children:e.jsx(H.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(A.id,A),iconLeft:e.jsx(E.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):G==="update"&&s&&(c==null?void 0:c(A))!==!1?e.jsx(Be.Tooltip,{label:"Update",position:le,children:e.jsx(H.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>s(A),iconLeft:e.jsx(E.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):G==="delete"&&o&&(l==null?void 0:l(A))!==!1?e.jsx(Be.Tooltip,{label:"Delete",position:le,children:e.jsx(H.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(A.id,A),iconLeft:e.jsx(E.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):G==="custom"?e.jsx(d.Fragment,{children:y==null?void 0:y(A)},"custom"):null})})}):null]},`${A}${K}`))})]})})},Bi=({wrapperProps:t,dataTableProps:r,headerProps:n,footerProps:s})=>{var g;const o=d.useRef(null),[i,l]=d.useState((r==null?void 0:r.defaultFrozenCount)??0),c=(n==null?void 0:n.show)??!0,a=d.useRef(null),u=(g=r==null?void 0:r.pagination)==null?void 0:g.totalData;typeof u=="number"&&(a.current=u);const h=(s==null?void 0:s.showFooter)??(u===void 0?a.current!==0:u!==0);return e.jsxs(bo,{...t,children:[c&&e.jsx(vo,{...n}),e.jsx(f.Box,{direction:"column",ref:o,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:r?e.jsx(Do,{...r,scrollParentRef:o,frozenCount:r!=null&&r.enableFreezeColumns?i:0,onFrozenCountChange:r!=null&&r.enableFreezeColumns?l:void 0}):null}),h&&e.jsx(Co,{pagination:r==null?void 0:r.pagination,pageKey:r==null?void 0:r.pageKey,perPageKey:r==null?void 0:r.perPageKey,defaultPerPage:r==null?void 0:r.defaultPerPage,showPagination:r==null?void 0:r.showPagination,totalData:s==null?void 0:s.totalData})]})};function Fi(t){return d.memo(t)}const Ei=Fi(Bi),Tn=200,br="1px solid var(--sa-border-subtle, #0b120e24)",Mi=({sortDir:t,frozen:r})=>t==="asc"?e.jsx(E.Icon,{name:"ChevronSmallUp"}):t==="desc"?e.jsx(E.Icon,{name:"ChevronSmallDown"}):r?e.jsx(E.Icon,{name:"LockOn",size:"xs"}):e.jsx(E.Icon,{name:"Filter",size:"xs"}),zt=({icon:t,label:r,active:n,danger:s,onClick:o})=>{const i=s?"var(--sa-text-error, #a4133c)":"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:n?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:i,textAlign:"left"},onMouseEnter:l=>{n||(l.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:l=>{l.currentTarget.style.background=n?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(E.Icon,{name:t,size:"sm",style:{color:i,flexShrink:0}}),e.jsx(D.Text,{as:"span",style:{color:i},children:r})]})},So=({active:t,canSort:r,canHide:n,sortDir:s,frozen:o,onSort:i,onClearSort:l,onToggleFreeze:c,onHide:a})=>{const[u,h]=d.useState(!1),g=d.useRef(null),m=d.useRef(null),[y,k]=d.useState({top:0,left:0});d.useEffect(()=>{if(u&&g.current){const M=g.current.getBoundingClientRect(),B=M.left+Tn>window.innerWidth;k({top:M.bottom+6,...B?{right:window.innerWidth-M.right}:{left:M.left}})}},[u]),d.useEffect(()=>{if(!u)return;const M=B=>{m.current&&!m.current.contains(B.target)&&g.current&&!g.current.contains(B.target)&&h(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[u]);const b=M=>{M(),h(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:g,type:"button",className:"sa-tl-menu-trigger","data-active":t||u?"true":"false",onClick:M=>{M.stopPropagation(),h(B=>!B)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:br,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(Mi,{sortDir:s,frozen:o})}),u&&e.jsxs(f.Box,{ref:m,onClick:M=>M.stopPropagation(),style:{position:"fixed",top:`${y.top}px`,...y.left!==void 0?{left:`${y.left}px`}:{right:`${y.right}px`},minWidth:Tn,backgroundColor:"var(--sa-background-primary, #ffffff)",border:br,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-xl, 0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(zt,{icon:"ChevronUp",label:"Ascending",active:s==="asc",onClick:()=>b(()=>s==="asc"?l():i("asc"))}),e.jsx(zt,{icon:"ChevronDown",label:"Descending",active:s==="desc",onClick:()=>b(()=>s==="desc"?l():i("desc"))}),e.jsx("div",{style:{borderTop:br,margin:"4px 0"}})]}),e.jsx(zt,{icon:"Pin1",label:o?"Unfreeze":"Freeze",active:o,onClick:()=>b(c)}),n&&e.jsx(zt,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>b(a)})]})]})},St="1px solid var(--sa-border-subtle, #0b120e24)",Li="var(--sa-text-subtle, #8c8f97)",gt="var(--sa-background-neutral, #f0f1f2)",On="2px 0 4px -2px var(--sa-border-subtle, #0b120e24)",kt=40,vr="var(--sa-background-brand-subtlest)",Ht={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Rn="sa-table-layout-styles",Ii=()=>{if(typeof document>"u"||document.getElementById(Rn))return;const t=document.createElement("style");t.id=Rn,t.textContent=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const nn=require("@starasia/alert"),on=require("@starasia/avatar"),ct=require("@starasia/badges"),x=require("@starasia/box"),pt=require("@starasia/breadcrumb"),H=require("@starasia/button"),kr=require("@starasia/card"),xt=require("@starasia/date"),Re=require("@starasia/dialog"),qt=require("@starasia/drawer"),jt=require("@starasia/dropdown"),we=require("@starasia/hooks"),bt=require("@starasia/http"),at=require("@starasia/input"),T=require("@starasia/menu"),Et=require("@starasia/pagination"),Ft=require("@starasia/storage"),q=require("@starasia/table"),sn=require("@starasia/tabs"),Br=require("@starasia/textarea"),yt=require("@starasia/theme"),ln=require("@starasia/toast"),vt=require("@starasia/toggle"),Be=require("@starasia/tooltip"),rt=require("@starasia/checkbox"),Fr=require("@starasia/radio"),D=require("@starasia/text"),E=require("@starasia/icon"),ie=require("@starasia/flex"),cn=require("@starasia/grid"),an=require("@starasia/progress"),dn=require("@starasia/stepper"),un=require("@starasia/accordion"),xn=require("@starasia/story-record"),Ge=require("@starasia/skeleton"),hn=require("@starasia/progress-stepper"),e=require("react/jsx-runtime"),d=require("react"),Ut=require("react-dom"),rs=require("react-easy-crop"),ns={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},Or=d.createContext(ns),Rr=()=>d.useContext(Or),Pn=t=>{const[r,n]=d.useState((t==null?void 0:t.initialUserData)||null);return{userData:r,setUserData:n}},Nn=d.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),_n=({children:t})=>{const[r,n]=d.useState({}),s=d.useCallback(c=>{n(a=>typeof c=="function"?c(a):c)},[]),o=d.useCallback((c,a)=>{n(u=>{const f=typeof a=="function"?a(u[c]):a;return{...u,[c]:f}})},[]),i=d.useCallback(c=>{n(a=>{if(!(c in a))return a;const u={...a};return delete u[c],u})},[]),l=d.useMemo(()=>({badges:r,setBadge:o,setBadges:s,clearBadge:i}),[r,o,s,i]);return e.jsx(Nn.Provider,{value:l,children:t})},qn=()=>d.useContext(Nn),Nt=(t,r)=>{const n=r!==void 0?r:t;return n==null?null:typeof n=="string"||typeof n=="number"?{value:n}:n},Jt=262,Wr=Jt,Ar=480,os="sa-sidebar-width",Er=(t,r,n)=>Math.min(Math.max(t,r),n),ss=(t,r,n,s)=>{if(typeof window>"u")return r;try{const o=window.localStorage.getItem(t);if(!o)return r;const i=parseInt(o,10);return Number.isFinite(i)?Er(i,n,s):r}catch{return r}},fn=(t,r)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(t,String(r))}catch{}},Zn=d.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},width:Jt,setWidth:()=>{},resetWidth:()=>{},minWidth:Wr,maxWidth:Ar,mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),Gn=({children:t,defaultCollapsed:r=!1,defaultWidth:n=Jt,minWidth:s=Wr,maxWidth:o=Ar,widthStorageKey:i=os})=>{const[l,c]=d.useState(r),[a,u]=d.useState(!1),[f,g]=d.useState(()=>ss(i,n,s,o)),m=d.useCallback(w=>{c(R=>typeof w=="function"?w(R):w)},[]),y=d.useCallback(()=>c(w=>!w),[]),k=d.useCallback(()=>c(!0),[]),b=d.useCallback(()=>c(!1),[]),M=d.useCallback(w=>{g(R=>{const I=typeof w=="function"?w(R):w,J=Er(Math.round(I),s,o);return fn(i,J),J})},[s,o,i]),B=d.useCallback(()=>{const w=Er(n,s,o);fn(i,w),g(w)},[n,s,o,i]),L=d.useCallback(w=>{u(R=>typeof w=="function"?w(R):w)},[]),C=d.useCallback(()=>u(!0),[]),v=d.useCallback(()=>u(!1),[]),W=d.useCallback(()=>u(w=>!w),[]),O=d.useMemo(()=>({collapsed:l,setCollapsed:m,toggle:y,collapse:k,expand:b,width:f,setWidth:M,resetWidth:B,minWidth:s,maxWidth:o,mobileOpen:a,setMobileOpen:L,openMobile:C,closeMobile:v,toggleMobile:W}),[l,m,y,k,b,f,M,B,s,o,a,L,C,v,W]);return e.jsx(Zn.Provider,{value:O,children:t})},Qn=()=>d.useContext(Zn),Un=d.createContext(null),Jn=({adapter:t,children:r})=>e.jsx(Un.Provider,{value:t,children:r}),nt=()=>{const t=d.useContext(Un);if(!t)throw new Error("[@starasia/admin] Router adapter belum dipasang. Bungkus aplikasi dengan <App routerAdapter={...} /> atau <StarasiaRouterProvider adapter={...}>. Import adapter dari '@starasia/admin/adapters/react-router' atau '@starasia/admin/adapters/tanstack'.");return t},Yn=({router:t,routerAdapter:r,menus:n=[],menuBottom:s,logo:o,appName:i="Workspace",initialUserData:l,theme:c})=>{const a=Pn({initialUserData:l}),{theme:u}=yt.useTheme();return e.jsx(Jn,{adapter:r,children:e.jsx(Or.Provider,{value:{logo:o,appName:i,menus:n,userData:a.userData,setUserData:a.setUserData,menuBottom:s},children:e.jsx(_n,{children:e.jsx(Gn,{children:c?e.jsx(yt.ThemeProvider,{value:c,children:t}):u?e.jsx(yt.ThemeProvider,{value:u,children:t}):t})})})})},is=d.memo(Yn);function Xn({collapsed:t=!1,children:r}){if(!r)return null;const n=typeof r=="function",s=n?r({collapsed:t}):r;return s==null||s===!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:n?s:e.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.3s",visibility:t?"hidden":"visible"},children:s})})}const zr=d.createContext(null);function $n({children:t}){const[r,n]=d.useState(null),[s,o]=d.useState(null),[i,l]=d.useState(null),[c,a]=d.useState(0),u=d.useCallback(()=>(a(f=>f+1),()=>a(f=>f-1)),[]);return e.jsx(zr.Provider,{value:{prependNode:r,appendNode:s,replaceNode:i,setPrependNode:n,setAppendNode:o,setReplaceNode:l,replaceCount:c,registerReplace:u},children:t})}function Kn({children:t}){const r=d.useContext(zr);return r?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:r.setPrependNode,style:{display:"contents"}}),r.replaceCount>0?e.jsx("div",{ref:r.setReplaceNode,style:{display:"contents"}}):t,e.jsx("div",{ref:r.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:t})}function ls({children:t,mode:r="append"}){const n=d.useContext(zr);if(d.useEffect(()=>{if(!(r!=="replace"||!n))return n.registerReplace()},[r,n]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const s=r==="prepend"?n.prependNode:r==="replace"?n.replaceNode:n.appendNode;return s?Ut.createPortal(t,s):null}const Hr=d.createContext(null);function eo({children:t}){const[r,n]=d.useState({}),[s,o]=d.useState({}),i=d.useCallback((a,u)=>{n(f=>f[a]===u?f:{...f,[a]:u})},[]),l=d.useCallback(a=>(o(u=>({...u,[a]:(u[a]??0)+1})),()=>o(u=>({...u,[a]:Math.max(0,(u[a]??0)-1)}))),[]),c=d.useMemo(()=>({outletNodes:r,setOutletNode:i,slotCounts:s,registerSlot:l}),[r,i,s,l]);return e.jsx(Hr.Provider,{value:c,children:t})}function to({slotKey:t,fallback:r}){const n=d.useContext(Hr),s=n?(n.slotCounts[t]??0)>0:!1,o=d.useRef(n==null?void 0:n.setOutletNode);o.current=n==null?void 0:n.setOutletNode;const i=d.useCallback(l=>{var c;return(c=o.current)==null?void 0:c.call(o,t,l)},[t]);return e.jsx(e.Fragment,{children:s?e.jsx("div",{ref:i,style:{display:"contents"}}):r})}function cs({slotKey:t,children:r}){const n=d.useContext(Hr),s=d.useRef(n==null?void 0:n.registerSlot);if(s.current=n==null?void 0:n.registerSlot,d.useEffect(()=>{var i;return(i=s.current)==null?void 0:i.call(s,t)},[t]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const o=n.outletNodes[t];return o?Ut.createPortal(r,o):null}const Zt="moduleSwitcherGroupId",Mr="sa-module-switcher-change";function mn(){if(typeof window>"u")return null;const t=window.localStorage.getItem(Zt);if(t===null)return null;const r=Number(t);return Number.isFinite(r)?r:null}function ro(t){typeof window>"u"||(t===null?window.localStorage.removeItem(Zt):window.localStorage.setItem(Zt,String(t)),window.dispatchEvent(new CustomEvent(Mr,{detail:t})))}function as(){ro(null)}function Vr(){const[t,r]=d.useState(()=>mn());return d.useEffect(()=>{const s=()=>{r(mn())},o=i=>{i.key===Zt&&s()};return window.addEventListener(Mr,s),window.addEventListener("storage",o),()=>{window.removeEventListener(Mr,s),window.removeEventListener("storage",o)}},[]),{selectedGroupId:t,setSelectedGroupId:s=>{ro(s),r(s)}}}let Wt=0,ut=!1,gn=new Set;const pn=()=>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"})]});function ds(t){const[r,n]=d.useState(!1),s=d.useRef(null),o=d.useRef(null);return d.useLayoutEffect(()=>{const i=s.current;if(!i)return;let l=0;const c=()=>{l=0;const u=o.current;if(!u)return;const f=u.scrollWidth>i.clientWidth;n(g=>g===f?g:f)},a=new ResizeObserver(()=>{l||(l=requestAnimationFrame(c))});return a.observe(i),c(),()=>{l&&cancelAnimationFrame(l),a.disconnect()}},[t]),{containerRef:s,textRef:o,truncated:r}}function yn({text:t,textStyle:r}){const{containerRef:n,textRef:s,truncated:o}=ds(t),i=e.jsx("span",{ref:s,style:{display:"block",fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",...r},children:t});return e.jsx("div",{ref:n,style:{flex:1,minWidth:0},children:o?e.jsx(Be.Tooltip,{fluid:!0,label:t,position:"top",children:i}):i})}const jn={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"},us=200,bn=16;function xs({children:t,headerLeftSlot:r,profile:n,isLoadingProfile:s,onLogout:o,isLoggingOut:i,loadingComponent:l,sidebarHeaderContent:c,headerActions:a,profileRole:u,profileMenuButtons:f,profileMenuItems:g,logoutButton:m,resizableSidebar:y=!0}){var dt,lt;const{useSearchParams:k,useNavigate:b,useLocation:M,Outlet:B}=nt(),[L]=k(),C=L.get("embed")==="true",v=Rr(),{badges:W}=qn(),O=b(),w=M(),I=!we.useMediaQuery("md"),[J,X]=d.useState(!1),{collapsed:Z,setCollapsed:P,width:$,setWidth:ee,resetWidth:N,minWidth:z,maxWidth:V,mobileOpen:le,setMobileOpen:je}=Qn(),[Te,xe]=d.useState(!1),[ve,De]=d.useState(()=>new Set(gn)),[Ie,Oe]=d.useState(null),{selectedGroupId:Me,setSelectedGroupId:He}=Vr();d.useEffect(()=>{gn=ve},[ve]);const be=d.useRef(null),Ae=d.useRef(null),Ne=d.useRef(null),[Ue,Ce]=d.useState(!1),[Ke,ht]=d.useState(null),A=y&&!I&&!Z,K=S=>Math.min(Math.max(S,z),V),G=Ke??$,ce=S=>{var fe,Ye,ke;if(!A)return;S.preventDefault();const Q=S.clientX,U=((fe=Ne.current)==null?void 0:fe.getBoundingClientRect().width)??$;(ke=(Ye=S.currentTarget).setPointerCapture)==null||ke.call(Ye,S.pointerId),Ce(!0),document.body.style.userSelect="none",document.body.style.cursor="col-resize";let he=0,Fe=U;const Ze=ft=>{Fe=U+(ft.clientX-Q),he||(he=requestAnimationFrame(()=>{he=0,ht(K(Fe))}))},ye=()=>{he&&cancelAnimationFrame(he),window.removeEventListener("pointermove",Ze),window.removeEventListener("pointerup",ye),document.body.style.userSelect="",document.body.style.cursor="",ht(null),Ce(!1),Fe<us?(ee(z),P(!0)):ee(K(Fe))};window.addEventListener("pointermove",Ze),window.addEventListener("pointerup",ye)},oe=S=>{A&&(S.key==="ArrowLeft"?(S.preventDefault(),ee(Q=>Q-bn)):S.key==="ArrowRight"?(S.preventDefault(),ee(Q=>Q+bn)):S.key==="Home"?(S.preventDefault(),ee(z)):S.key==="End"&&(S.preventDefault(),ee(V)))};d.useEffect(()=>{const S=be.current;if(!S)return;const Q=()=>{ut||(Wt=S.scrollTop)};return S.addEventListener("scroll",Q),()=>S.removeEventListener("scroll",Q)},[]);const me=()=>{const S=be.current;S&&Wt>0&&(ut=!0,S.scrollTop=Wt,requestAnimationFrame(()=>{ut=!1}))};d.useLayoutEffect(()=>{ut=!0,me();const S=setTimeout(()=>{ut=!1},300);return()=>clearTimeout(S)},[]),d.useLayoutEffect(()=>{v.menus.length>0&&(Wt>0?me():requestAnimationFrame(()=>{var Q;const S=(Q=be.current)==null?void 0:Q.querySelector("[data-menu-active='true']");S&&S.scrollIntoView({block:"center",behavior:"instant"})}))},[v.menus]),d.useEffect(()=>{ut=!0,me();const S=setTimeout(me,0),Q=setTimeout(me,50),U=setTimeout(me,100),he=setTimeout(me,200),Fe=setTimeout(()=>{ut=!1},300),Ze=setTimeout(()=>{const ye=be.current,fe=ye==null?void 0:ye.querySelector("[data-menu-active='true']");if(ye&&fe){const Ye=ye.getBoundingClientRect(),ke=fe.getBoundingClientRect();ke.top>=Ye.top&&ke.bottom<=Ye.bottom||fe.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(S),clearTimeout(Q),clearTimeout(U),clearTimeout(he),clearTimeout(Fe),clearTimeout(Ze)}},[w.pathname]),d.useEffect(()=>{Ae.current&&(Ae.current.scrollTop=0)},[w.pathname]),d.useEffect(()=>{I&&je(!1)},[w.pathname,I]),d.useEffect(()=>{I&&P(!0)},[I]);const Je=()=>{X(!0)},_e=()=>{X(!1)},Ve=()=>{X(!1),o()},Se=S=>{const Q=[S.to];return S.children&&Q.push(...S.children.map(U=>U.to)),Q},qe=[...v.menus.flatMap(S=>S.items.flatMap(Se)),...((dt=v.menuBottom)==null?void 0:dt.flatMap(Se))??[]],de=S=>{if(!w.pathname.startsWith(S))return!1;const Q=qe.filter(U=>w.pathname.startsWith(U)).sort((U,he)=>he.length-U.length)[0];return S===Q};d.useEffect(()=>{var Q;const S=U=>{var he;(he=U.children)!=null&&he.some(Fe=>w.pathname.startsWith(Fe.to))&&De(Fe=>{const Ze=new Set(Fe);return Ze.add(U.id),Ze})};v.menus.forEach(U=>{U.items.forEach(S)}),(Q=v.menuBottom)==null||Q.forEach(S)},[w.pathname,v.menus,v.menuBottom]);const et=S=>{De(Q=>{const U=new Set(Q);return U.has(S)?U.delete(S):U.add(S),U})};d.useEffect(()=>{v.menus.length!==0&&Me!==null&&!v.menus.some(S=>S.id===Me)&&He(null)},[v.menus,Me,He]);const tt=d.useMemo(()=>{if(Me!==null)return v.menus.filter(U=>U.id===Me||U.parentGroupId===Me);const S=v.menus.filter(U=>U.parentGroupId===void 0),Q=v.menus.filter(U=>U.parentGroupId!==void 0).flatMap(U=>U.items);return Q.length===0?S:[...S,{id:18,name:"Pengaturan",items:Q,parentGroupId:void 0}]},[v.menus,Me]);if(C)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:t||e.jsx(B,{})});const ot=S=>{const Q=S.children&&S.children.length>0,U=ve.has(S.id),he=Q?S.children.some(ye=>de(ye.to)):de(S.to),Fe=Nt(S.badge,W[S.id]),Ze=!!Fe&&Z&&!I;return e.jsxs("div",{"data-menu-active":he||void 0,children:[e.jsxs("button",{onClick:ye=>{if(Q)if(Z&&!I){const fe=ye.currentTarget.getBoundingClientRect();Oe({item:S,top:fe.top,left:fe.right+8})}else et(S.id);else O(S.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:Z&&!I?"center":void 0,gap:"0.5rem",paddingLeft:Z&&!I?"0":"0.5rem",paddingRight:Z&&!I?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:he?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:he?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:he?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:Z&&!I?S.title:void 0,onMouseEnter:ye=>{he||(ye.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:ye=>{he||(ye.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(E.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),Ze&&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)"}})]}),(!Z||I)&&e.jsxs(e.Fragment,{children:[e.jsx(yn,{text:S.title,textStyle:{transition:"opacity 0.3s"}}),Fe&&e.jsx(ct.Badges,{text:String(Fe.value),variant:Fe.variant??"info",size:"xs",border:!0}),Q&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:U?"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"})})]})]}),Q&&(!Z||I)&&(()=>{const ye=S.children.findIndex(fe=>de(fe.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:U?`${S.children.length*36}px`:"0px",opacity:U?1:0,marginTop:U?"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"}}),ye>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${ye*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),S.children.map(fe=>{const Ye=Nt(fe.badge,W[fe.id]);return e.jsxs("button",{onClick:()=>O(fe.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:de(fe.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:de(fe.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:de(fe.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:de(fe.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:ke=>{de(fe.to)||(ke.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:ke=>{de(fe.to)||(ke.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(E.Icon,{name:fe.icon,size:"sm",style:{flexShrink:0}}),e.jsx(yn,{text:fe.title}),Ye&&e.jsx(ct.Badges,{text:String(Ye.value),variant:Ye.variant??"info",size:"xs",border:!0})]},fe.id)})]})})()]},S.id)};return e.jsx(eo,{children:e.jsxs($n,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":I?"0px":Z?"4.375rem":`${G}px`,"--app-footer-zindex":I&&le?"40":"998"},children:[I&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:le?.5:0,pointerEvents:le?"auto":"none",transition:"opacity 0.3s"},onClick:()=>je(!1)}),e.jsxs("aside",{ref:Ne,style:{width:I?"16.375rem":Z?"4.375rem":`${G}px`,position:I?"fixed":"relative",...I&&{inset:0,zIndex:50,transform:le?"translateX(0)":"translateX(-100%)"},backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",borderRight:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",flexDirection:"column",transition:Ue?"none":"all 0.3s ease-in-out",flexShrink:I?void 0:0,minWidth:0},children:[e.jsx("div",{onMouseEnter:()=>xe(!0),onMouseLeave:()=>xe(!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 S=!I&&Z&&!le,Q=S&&Te;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:S?1:void 0,justifyContent:S?"center":void 0,transition:"opacity 0.2s",opacity:Q?0:1,pointerEvents:Q?"none":"auto"},children:[e.jsx("img",{src:v.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!Z||le)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:v.appName})]}),!I&&!Z&&e.jsx("button",{type:"button",onClick:()=>P(!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(pn,{})}),S&&e.jsx("button",{type:"button",onClick:()=>P(!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:Q?1:0,pointerEvents:Q?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(pn,{})})}),I&&e.jsx("button",{onClick:()=>je(!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"})})})]})})()}),c&&e.jsx(Xn,{collapsed:I?!1:Z,children:c}),e.jsx("div",{ref:be,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:tt.map(S=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!Z||I?S.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:S.name}):S.name&&e.jsx("div",{"aria-label":S.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:S.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:S.slotKey?e.jsx(to,{slotKey:S.slotKey,fallback:S.items.map(Q=>ot(Q))}):S.items.map(Q=>ot(Q))})]},S.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(S=>ot(S))}),A&&e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":$,"aria-valuemin":z,"aria-valuemax":V,tabIndex:0,onPointerDown:ce,onKeyDown:oe,onDoubleClick:N,title:"Drag to resize · double-click to reset",style:{position:"absolute",top:0,right:0,width:"6px",height:"100%",transform:"translateX(50%)",cursor:"col-resize",zIndex:5,touchAction:"none",background:Ue?"var(--sa-background-brand, #04254f)":"transparent",transition:"background 0.15s"},onMouseEnter:S=>{Ue||(S.currentTarget.style.background="var(--sa-border-bold, #0b120e40)")},onMouseLeave:S=>{Ue||(S.currentTarget.style.background="transparent")}})]}),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:I?"1rem":void 0},children:[I&&e.jsx("button",{onClick:()=>je(!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(Kn,{children:r})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[a,e.jsxs(T.Menu,{position:"bottom-right",children:[e.jsx(T.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:s?"Loading...":(n==null?void 0:n.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s?"":(n==null?void 0:n.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:((n==null?void 0:n.name)||"U")[0].toUpperCase()}),e.jsx(E.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(T.MenuLists,{width:280,style:{paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(T.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:((n==null?void 0:n.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:(n==null?void 0:n.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:(n==null?void 0:n.email)||"unknown"}),u&&e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:u})]})}),(f&&f.length>0||g)&&e.jsxs(T.MenuBody,{children:[f==null?void 0:f.map((S,Q)=>e.jsx(T.MenuButton,{children:e.jsxs("button",{type:"button",onClick:S.onClick,style:jn,onMouseEnter:U=>{U.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:U=>{U.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(E.Icon,{name:S.icon,size:"md"}),e.jsx("span",{children:S.label})]})},`${S.label}-${Q}`)),g]}),m??e.jsx(T.MenuFooter,{children:e.jsx(T.MenuButton,{children:e.jsxs("button",{type:"button",onClick:Je,style:{...jn,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:S=>{S.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:S=>{S.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(E.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:Ae,style:{flex:1,overflowY:"auto"},children:t||e.jsx(B,{})})]})]}),i&&l&&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:l}),e.jsxs(Re.Dialog,{isShow:J,onHide:_e,children:[e.jsx(Re.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Re.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Re.DialogFooter,{children:e.jsx(x.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(ie.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(x.Box,{direction:"column",children:e.jsx(H.Button,{secondary:!0,onClick:_e,children:"Cancel"})}),e.jsx(x.Box,{direction:"column",children:e.jsx(H.Button,{primary:!0,onClick:Ve,children:"Yes, Sure"})})]})})})]}),Ie&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>Oe(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":Ie.item.title,style:{position:"fixed",top:Ie.top,left:Ie.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:Ie.item.title}),(lt=Ie.item.children)==null?void 0:lt.map(S=>{const Q=de(S.to),U=Nt(S.badge,W[S.id]);return e.jsxs("button",{onClick:()=>{O(S.to),Oe(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:Q?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:Q?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:he=>{Q||(he.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:he=>{Q||(he.currentTarget.style.backgroundColor="transparent")},children:[S.icon&&e.jsx(E.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:S.title}),U&&e.jsx(ct.Badges,{text:String(U.value),variant:U.variant??"info",size:"xs",border:!0})]},S.id)})]})]})]})})}const Lt=d.forwardRef(({children:t,...r},n)=>e.jsx(x.Box,{ref:n,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...r,children:t})),vn=({title:t,iconName:r,textColor:n,iconColor:s,hoverTextColor:o,hoverIconColor:i})=>{const[l,c]=d.useState(!1),a=s??"var(--sa-text-subtle, #8c8f97)",u=n??"var(--sa-text-subtle, #8c8f97)",f=i??"var(--sa-text-subtle, #8c8f97)",g=o??"var(--sa-text-primary, #292a2e)";return e.jsxs(x.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{cursor:"pointer"},children:[e.jsx(E.Icon,{name:r||"ChevronLeft",size:"xs",style:{color:l?f:a,transition:"color 0.15s ease"}}),e.jsx(D.Text,{variant:"sub-h3",style:{color:l?g:u,transition:"color 0.15s ease"},children:t||"Back"})]})},hs=({items:t,separator:r="/",iconName:n,iconColor:s,hoverIconColor:o})=>{const{Link:i}=nt(),[l,c]=d.useState(!1),a=s??"var(--sa-text-subtle, #8c8f97)",u=o??"var(--sa-text-subtle, #8c8f97)",f=t.length>1?t[0]:void 0,g=!!(f!=null&&f.to||f!=null&&f.onClick),m=e.jsx(E.Icon,{name:n||"ChevronLeft",size:"xs",onMouseEnter:g?()=>c(!0):void 0,onMouseLeave:g?()=>c(!1):void 0,style:{color:g&&l?u:a,transition:"color 0.15s ease",cursor:g?"pointer":void 0}}),y=f!=null&&f.to?e.jsx(i,{to:f.to,replace:!0,style:{textDecoration:"none"},children:m}):f!=null&&f.onClick?e.jsx(Lt,{onClick:f.onClick,children:m}):m;return e.jsxs(x.Box,{direction:"row",gap:"xs",align:"center",children:[y,e.jsx(pt.Breadcrumb,{separator:r,size:"md",children:t.map((k,b)=>{const M=b===t.length-1;return k.to&&!M?e.jsx(pt.BreadcrumbItem,{children:e.jsx(i,{to:k.to,children:k.label})},b):e.jsx(pt.BreadcrumbItem,{currentPage:M,children:e.jsx(pt.BreadcrumbLink,{onClick:M?void 0:k.onClick,children:k.label})},b)})})]})},fs=t=>{const{Link:r}=nt(),{items:n,separator:s,onClick:o,navigateTo:i,...l}=t;return n&&n.length>0?e.jsx(hs,{items:n,separator:s,iconName:l.iconName,iconColor:l.iconColor,hoverIconColor:l.hoverIconColor}):i?e.jsx(x.Box,{direction:"row",children:e.jsx(r,{to:i,replace:!0,style:{textDecoration:"none"},children:e.jsx(vn,{...l})})}):e.jsx(x.Box,{direction:"row",children:e.jsx(Lt,{onClick:o,children:e.jsx(vn,{...l})})})},mr=[{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 Cn(t,r,n){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:t?`2px solid ${n.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:t?n.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:t?r?`0 8px 20px ${n.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${n.activeShadow}`:r?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:r?"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 wn={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},Dn={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function no({isShow:t,onHide:r,menus:n,selectedGroupId:s,onSelect:o}){const[i,l]=d.useState(void 0),c=u=>{o(u),r()},a=mr[0];return e.jsx(Re.Dialog,{isShow:t,onHide:r,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Re.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>c(null),onMouseEnter:()=>l("all"),onMouseLeave:()=>l(void 0),style:Dn,children:[e.jsx("div",{style:Cn(s===null,i==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(E.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:wn,children:"Semua"})]}),n.map((u,f)=>{var b;const g=s===u.id,m=i===u.id,y=((b=u.items[0])==null?void 0:b.icon)??"Grid",k=mr[(f+1)%mr.length];return e.jsxs("button",{onClick:()=>c(u.id),onMouseEnter:()=>l(u.id),onMouseLeave:()=>l(void 0),style:Dn,children:[e.jsx("div",{style:Cn(g,m,k),children:e.jsx("div",{style:{color:k.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(E.Icon,{name:y,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:wn,children:u.name})]},u.id)})]})})})}function ms({onSelect:t,"aria-label":r="Pilih module"}={}){const n=Rr(),{useNavigate:s}=nt(),o=s(),{selectedGroupId:i,setSelectedGroupId:l}=Vr(),[c,a]=d.useState(!1),u=f=>{var g;if(l(f),f!==null){const m=n.menus.find(k=>k.id===f),y=(g=m==null?void 0:m.items[0])==null?void 0:g.to;y&&o(y)}t==null||t(f)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>a(!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":r,onMouseEnter:f=>{f.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent"},children:e.jsx(E.Icon,{name:"GridApplication",size:"sm"})}),i!==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(no,{isShow:c,onHide:()=>a(!1),menus:n.menus.filter(f=>f.parentGroupId===void 0),selectedGroupId:i,onSelect:u})]})}const gs=(t,r)=>{const n=[];if(r===0)return n.push(t),n;for(let s=0;s<t.length;s+=r){const o=t.slice(s,s+r);n.push(o)}return n},ps=d.memo(({value:t,label:r,separator:n,labelWidth:s,lastIndex:o,labelAlign:i="top"})=>{const l=d.useMemo(()=>({padding:0,paddingBottom:o?0:12,verticalAlign:i}),[o,i]),c=d.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:o?0:12,verticalAlign:i}),[o,i]),a=()=>typeof r=="string"?e.jsx(D.Text,{fontWeight:"medium",color:"subtlest",children:r}):r,u=()=>typeof t=="string"||typeof t=="number"?e.jsx(D.Text,{color:"primary",fontWeight:"medium",children:t}):t,f=()=>typeof n=="string"||typeof n=="number"?e.jsx(D.Text,{fontWeight:"medium",color:"subtlest",children:n}):n;return e.jsxs(q.Tr,{children:[e.jsx(q.Td,{style:l,width:s,children:a()}),n?e.jsx(q.Td,{style:c,width:24,children:f()}):null,e.jsx(q.Td,{style:l,children:u()})]})}),ys=d.memo(({fields:t,separator:r,labelWidth:n})=>e.jsx(q.Table,{withColumnBorder:!1,withRowBorder:!1,children:t.map((s,o)=>e.jsx(ps,{separator:r,labelWidth:n,lastIndex:o===t.length-1,...s},`field-group-field-${o}`))})),js=d.memo(({maxRow:t=0,maxColumn:r=2,separator:n=":",fields:s=[],labelWidth:o=150,bordered:i=!1})=>{const l=d.useMemo(()=>gs(s,t),[s,t]),c=l.length>2,a=()=>{switch(r){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(x.Box,{gap:c?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:c?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:i?"border":void 0,borderStyle:i?"border-solid":void 0,borderColor:i?"border-subtle":void 0,children:l.map((u,f)=>e.jsx(x.Box,{direction:"column",flex:c?void 0:"1",width:c?a():void 0,marginBottom:c?"lg":void 0,children:e.jsx(ys,{labelWidth:o,fields:u,separator:n})},f))})}),bs=({backButton:t})=>{const[r,n]=d.useState(!1),s=(t==null?void 0:t.iconColor)??"var(--sa-text-subtle, #8c8f97)",o=(t==null?void 0:t.textColor)??"var(--sa-text-subtle, #8c8f97)",i=(t==null?void 0:t.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",l=(t==null?void 0:t.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(x.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{cursor:"pointer"},children:[e.jsx(E.Icon,{name:(t==null?void 0:t.iconName)||"ChevronLeft",size:"xs",style:{color:r?i:s,transition:"color 0.15s ease"}}),e.jsx(D.Text,{variant:"sub-h3",style:{color:r?l:o,textDecoration:r?"underline":"none",transition:"color 0.15s ease"},children:(t==null?void 0:t.title)||"Back"})]})},vs=({backButton:t,title:r,titleIcon:n,titleTag:s,children:o,header:i=!0,headerBorder:l=!1,disableAnimation:c=!1,scrollable:a=!1,stickyHeader:u=!1,subHeaders:f,action:g,titleTagProps:m,containerProps:y,headerProps:k})=>{const b=we.useMediaQuery("md"),{Link:M,useNavigate:B,useLocation:L}=nt(),C=B(),v=L(),W=t==null?void 0:t.show,O=()=>{if(typeof(t==null?void 0:t.onClick)=="function"){t.onClick();return}C(-1,{replace:!0})},w=()=>{if(!g)return null;if(d.isValidElement(g))return g;const P=g.filter($=>$&&($.title||$.icon));return P.length===0?null:b?e.jsx(x.Box,{direction:"row",gap:"md",children:P.map(({title:$,icon:ee,buttonProps:N,onClick:z},V)=>e.jsx(H.Button,{iconLeft:ee?e.jsx(E.Icon,{name:ee,size:"md"}):void 0,onClick:z,...N,children:$},`action-${V}`))}):e.jsxs(T.Menu,{position:"bottom-right",children:[e.jsx(T.MenuButton,{children:e.jsx(H.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(E.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(T.MenuLists,{children:e.jsx(T.MenuBody,{style:{minWidth:200},children:P.map(({title:$,icon:ee,buttonProps:N,onClick:z},V)=>{const le=(N==null?void 0:N.tone)==="error"||(N==null?void 0:N.danger)===!0;return e.jsx(T.MenuItem,{intent:le?"danger":void 0,disabled:N==null?void 0:N.disabled,startIcon:ee?e.jsx(E.Icon,{name:ee}):void 0,onClick:z,children:$},`action-${V}`)})})})]})},R=()=>{const P=e.jsx(bs,{backButton:t});return t!=null&&t.navigateTo?e.jsx(x.Box,{direction:"row",children:e.jsx(M,{to:t.navigateTo,replace:!0,style:{textDecoration:"none"},children:P})}):e.jsx(x.Box,{direction:"row",children:e.jsx(Lt,{onClick:O,children:P})})},I=()=>{const P=!!r,$=Array.isArray(g)&&g.length>0,ee=d.isValidElement(g)?!0:$;if(!P&&!ee&&!W)return null;const z=b||!b&&$;return e.jsxs(x.Box,{direction:"column",gap:"xs",paddingBlock:(k==null?void 0:k.paddingBlock)??"sm",paddingInline:(k==null?void 0:k.paddingInline)??"md",...k,style:{...l?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...k==null?void 0:k.style},children:[W&&R(),(P||ee)&&e.jsxs(x.Box,{direction:z?"row":"column",gap:"sm",justify:"space-between",align:z?"center":"flex-start",children:[P?typeof r=="string"?e.jsxs(x.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(x.Box,{direction:"row",gap:"sm",align:"center",children:[n&&e.jsx(E.Icon,{name:n,size:"md",color:"primary"}),e.jsx(D.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:r})]}),s&&e.jsx(ct.Badge,{border:!0,size:"lg",text:s,...m})]}):r:null,w()]})]})},J=()=>{if(!f||f.length===0)return null;const P=f.filter(N=>N.show!==!1);if(P.length===0)return null;let $=0,ee=-1/0;return P.forEach((N,z)=>{const V=N.order??0;V>=ee&&(ee=V,$=z)}),P.map(({content:N,order:z,borderBottom:V=!0,keepBottomPadding:le=!1,paddingInline:je=!0,paddingBlock:Te=!0},xe)=>e.jsx(x.Box,{direction:"column",paddingTop:Te?"sm":"spacing-0",paddingBottom:Te&&(V||le||xe===$)?"sm":"spacing-0",paddingInline:je?"md":"spacing-0",style:{...V?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...z!==void 0?{order:z}:{}},children:N},`sub-header-${xe}`))},X=()=>{const P=i?I():null,$=J();return!P&&!$?null:e.jsxs(x.Box,{direction:"column",style:{...a?{position:"sticky",left:0,...u?{top:0}:{},zIndex:2,background:"var(--sa-background-primary, #ffffff)"}:{},marginBottom:$?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[P,$]})},Z=()=>o;return e.jsxs(x.Box,{direction:"column",as:"main",...y,style:{...a?{height:"100%",minHeight:0,overflow:"auto"}:{},...(y==null?void 0:y.style)??{},...c?{}:{animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"}},children:[X(),Z()]},v.pathname)},Cs=d.memo(vs),ws={icon:"Cross",title:""},oo=d.forwardRef(({onHide:t,show:r,withBlur:n=!1,style:s,children:o,closeButton:i=ws,width:l,minWidth:c,maxWidth:a},u)=>{const f=l??a??c??"357px";return e.jsx(qt.Drawer,{blur:n,isShow:r,position:"right",onHide:t,ref:u,size:f,style:s,children:e.jsxs(x.Box,{direction:"column",padding:"lg",children:[i?e.jsxs(x.Box,{direction:"row",align:"center",gap:"sm",onClick:t,marginBottom:"lg",cursor:"pointer",children:[e.jsx(E.Icon,{name:i.icon,size:"md",color:"subtle",cursor:"pointer"}),i.title?e.jsx(D.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:i.title}):null]}):null,o]})})}),Pr=d.memo(({children:t,borderBottom:r=!0,padding:n=!0})=>{const s=we.useMediaQuery("lg");return e.jsx(x.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),Nr=d.memo(({children:t,borderTop:r=!0,padding:n=!0})=>{const s=we.useMediaQuery("lg");return e.jsx(x.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),Ds=d.memo(({children:t,...r})=>e.jsx(x.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...r,children:t})),Ss=d.memo(({children:t,title:r,titleTag:n,action:s,header:o,footer:i,actionContainer:l,containerProps:c,bodyProps:a,headerProps:u={borderBottom:!0},footerProps:f={borderTop:!0},variantTag:g="info"})=>{const m=we.useMediaQuery("lg"),y=()=>n?e.jsxs(x.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(D.Text,{fontWeight:"medium",children:r}),e.jsx(ct.Badges,{border:!0,text:n,variant:g})]}):e.jsx(D.Text,{fontWeight:"medium",children:r}),k=()=>o||e.jsxs(x.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(x.Box,{direction:"column",children:r?y():null}),e.jsx(x.Box,{direction:"column",style:m?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...l,children:s??null})]}),b=!!(o||r||s);return e.jsxs(x.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...c,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(c==null?void 0:c.style)??{}},children:[o!==null&&b?e.jsx(Pr,{...u,children:k()}):null,e.jsx(Ds,{...a,children:t}),i?e.jsx(Nr,{...f,children:i}):null]})}),ks=t=>e.jsx(D.Text,{variant:"h1",children:t.children,...t.props}),Bs=t=>e.jsx(D.Text,{variant:"h2",children:t.children,...t.props}),Fs=t=>e.jsx(D.Text,{variant:"h3",children:t.children,...t.props}),Es=t=>e.jsx(D.Text,{variant:"h4",children:t.children,...t.props}),Ms=t=>e.jsx(D.Text,{variant:"h5",children:t.children,...t.props}),Ls=t=>e.jsx(D.Text,{variant:"h6",children:t.children,...t.props}),Ts=t=>e.jsx(D.Text,{variant:"sub-h1",children:t.children,...t.props}),Is=t=>e.jsx(D.Text,{variant:"sub-h2",children:t.children,...t.props}),Os=t=>e.jsx(D.Text,{variant:"sub-h3",children:t.children,...t.props}),Rs=t=>e.jsx(D.Text,{variant:"body-1",children:t.children,...t.props}),Ws=t=>e.jsx(D.Text,{variant:"body-2",children:t.children,...t.props}),As=t=>e.jsx(D.Text,{variant:"body-3",children:t.children,...t.props}),Qe={H1:ks,H2:Bs,H3:Fs,H4:Es,H5:Ms,H6:Ls,SubH1:Ts,SubH2:Is,SubH3:Os,Body1:Rs,Body2:Ws,Body3:As},We=()=>{const{useSearchParams:t,useParams:r,useLocation:n}=nt(),[s,o]=t(),i=bt.searchParamsToObject(s.toString()),l=r(),c=n(),a=l.id;return{setSearchParams:o,searchParams:s,searchQueries:i,isHasQuery:(y,k)=>s.has(y)&&s.get(y)===k,getQueryParam:y=>s.get(y),getRouteParam:y=>l[y],params:l,location:c,id:a,hasId:!!a}},so=t=>JSON.stringify(t),io=t=>JSON.stringify(t),lo=t=>JSON.stringify(t),co=t=>JSON.stringify(t),zs=t=>t,Hs=t=>JSON.stringify(t),Mt=({value:t,name:r,type:n,withSearchParam:s=!0,setSearchParams:o,searchQueries:i,dropdownSearchKey:l,filterKey:c="filter",pageKey:a="page"})=>{if(s){let u;switch(n){case"search":u=zs(t);break;case"dropdown":case"dropdown-multiple":u=so(t);break;case"radio":u=io(t);break;case"date-range":u=lo(t);break;case"advanced-date-range":u=Hs(t);break;case"date":u=co(t);break;default:u=t;break}if(typeof u<"u"){const g={...i[c]&&typeof i[c]=="string"?JSON.parse(i[c]):void 0,[r]:u},m={...i};l&&typeof l=="string"&&delete m[l],delete m[a];const y={...m,[c]:JSON.stringify(g)},k=new URLSearchParams(i).toString(),b=new URLSearchParams(y).toString();if(k===b)return;o(y)}}},_t=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,l=i?i[t]:void 0;return s==="label"&&l?JSON.parse(l)[0].label:s==="value"&&l?JSON.parse(l)[0].value:l},ao=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,l=i?i[t]:void 0;return s==="label"&&l?JSON.parse(l).map(c=>c.label):s==="value"&&l?JSON.parse(l).map(c=>c.value):s==="array"&&l?JSON.parse(l):l},Vs=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,l=i?i[t]:void 0;return s==="id"&&l?JSON.parse(l).id:s==="label"&&l?JSON.parse(l).label:s==="value"&&l?JSON.parse(l).value:l},Yt=(t,r,n)=>{const s=r.get(n||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0;return o?o[t]:void 0},Ps=({name:t,filterKey:r="filter",searchParams:n})=>{const s=n.get(r||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0,i=o?o[t]:void 0;return{start:i?JSON.parse(i).from:void 0,end:i?JSON.parse(i).to:void 0}},uo=({name:t,filterKey:r="filter",searchParams:n})=>{const s=n.get(r||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0,i=o?o[t]:void 0;return i?JSON.parse(i):void 0},Ns=(t,{filterKey:r="filter",perPageKey:n="perPage",pageKey:s="page"})=>{const o=t.get(r)||void 0,i=t.get(n)||void 0,l=t.get(s)||void 0;return!!o||!!i||!!l},xo=({isOpen:t,onClose:r,filterKey:n,pageKey:s,filters:o})=>{const{searchParams:i,setSearchParams:l,searchQueries:c}=We(),[a,u]=d.useState({}),f=()=>{i.delete(n||"filter"),l(i)},g=(m,y)=>{switch(m.type){case"radio":{const{show:k=!0}=m;return k&&e.jsx(x.Box,{direction:"column",children:e.jsx(x.Box,{direction:"column",children:m.title})},y)}case"dropdown":{const{show:k=!0}=m;return k&&e.jsx(x.Box,{direction:"column",children:e.jsx(x.Box,{direction:"column",children:m.title})},y)}case"date-range":return e.jsx(x.Box,{direction:"column",children:e.jsx(x.Box,{direction:"column",children:m.title})},y);case"date":return e.jsx(x.Box,{direction:"column",children:e.jsx(x.Box,{direction:"column",children:m.title})},y);case"dropdown-multiple":{const{show:k=!0}=m;return k&&e.jsx(x.Box,{direction:"column",children:e.jsx(x.Box,{direction:"column",children:m.title})},y)}default:return null}};return e.jsx(oo,{onHide:r,show:t||!1,children:e.jsxs(x.Box,{direction:"column",gap:"md",children:[e.jsxs(ie.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(x.Box,{direction:"column",children:"Filter"}),e.jsx(x.Box,{direction:"column",style:{cursor:"pointer"},onClick:f,children:"Reset"})]}),o==null?void 0:o.map((m,y)=>g(m,y))]})})},ho=({searchKey:t="q",statusKey:r="status",searchPlaceholder:n="Search",searchHighlightPlaceholder:s,extendedFilter:o,showSearchFilter:i=!0,showStatusFilter:l=!0,filterKey:c="filter",pageKey:a="page",customWidthSearch:u,handleOnReset:f,filterConfigs:g,buttonToggleProps:m,position:y="right",titleSearchLabel:k="Work Order",withTitleLabels:b=!1})=>{const B=(m==null?void 0:m.isShowLabel)??!0,[L,C]=d.useState(!1),[v,W]=d.useState(0),O=()=>{W(V=>V+1)},{searchParams:w,setSearchParams:R,getQueryParam:I}=We(),J=bt.searchParamsToObject(w.toString()),X=Yt(t,w,c)||"",[Z,P]=d.useState(X),$=I(c),N=!!($&&!(()=>{if($)try{const V=JSON.parse($);return Object.keys(V).length===1&&V[t]===""}catch(V){console.error("Filter parameter is not a valid JSON:",V)}return!1})()),z=we.useMediaQuery("md");return d.useEffect(()=>{P(X)},[X]),d.useEffect(()=>{if(Z===X)return;const V=window.setTimeout(()=>{Mt({value:Z,name:t,type:"search",searchQueries:J,setSearchParams:R,filterKey:c,pageKey:a})},350);return()=>{window.clearTimeout(V)}},[Z,X,t,J,R,c,a]),e.jsxs(ie.Flex,{gap:"md",style:{flexDirection:z&&y==="left"?"row":z&&y==="right"?"row-reverse":"column"},align:"flex-end",children:[N&&e.jsx(x.Box,{direction:"column",justify:"flex-end",children:e.jsx(H.Button,{onClick:()=>{const V=new URLSearchParams(w);V.delete(c),R(V),P(""),O(),f&&f()},variant:"outline",tone:"neutral",children:e.jsx(D.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),o==null?void 0:o.map(({minWidth:V,content:le,title:je,onClickContainer:Te},xe)=>e.jsxs(x.Box,{direction:"column",gap:"sm",onClick:Te,style:{minWidth:V},children:[je&&e.jsx(Qe.SubH3,{children:je}),le]},`extended-filter-${xe}-${v}`)),!!(g!=null&&g.length)&&e.jsx(H.Button,{primary:N,secondary:!N,iconLeft:e.jsx(E.Icon,{size:"sm",name:(m==null?void 0:m.icon)||"FilterHorizontal",style:{color:$?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!z,onClick:()=>C(!0),children:B?"Filter":void 0}),l&&e.jsxs(x.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[b&&e.jsx(Qe.SubH3,{children:"Status"}),e.jsx(jt.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:_t({get:"value",name:r,searchParams:w,filterKey:c})?[{label:_t({get:"value",name:r,searchParams:w,filterKey:c})==="active"?"Active":"InActive",value:_t({get:"value",name:r,searchParams:w,filterKey:c})}]:[],onChange:V=>Mt({value:V,name:r,type:"dropdown",searchQueries:J,setSearchParams:R,filterKey:c}),placeholder:b?"All":"All Status"},v)]}),i&&e.jsxs(x.Box,{direction:"column",gap:"sm",style:{width:u&&z?u:z?"310px":""},children:[b&&e.jsxs(Qe.SubH3,{children:["Search for ",k]}),e.jsx(at.Input,{placeholder:n,leftIcon:e.jsx(E.Icon,{name:"Search",width:20,height:20}),onChange:V=>P(V.target.value),value:Z,fullWidth:!0},v+1+c)]}),e.jsx(xo,{isOpen:L,onClose:()=>C(!1),filterKey:c,filters:g,pageKey:a})]})},_s=t=>t==="checkbox-multiple"?"dropdown-multiple":t==="radio"?"dropdown":t==="date-compact"?"date":t;function _r({configs:t,filterKey:r="filter",activeFilterKey:n="filters",pageKey:s="page",searchKey:o="q"}){const{searchParams:i,setSearchParams:l,searchQueries:c}=We(),a=d.useMemo(()=>Object.fromEntries(t.map(v=>[v.key,v])),[t]),u=d.useMemo(()=>{const v=(i.get(n)||"").split(",").map(O=>O.trim()).filter(Boolean);let W=[];try{const O=i.get(r);O&&(W=Object.keys(JSON.parse(O)).filter(w=>w!==o))}catch{}return t.map(O=>O.key).filter(O=>{const w=a[O];return(w==null?void 0:w.locked)||v.includes(O)||W.includes(O)})},[i,n,r,o,t,a]),f=d.useCallback(v=>{try{return v[r]?JSON.parse(v[r]):{}}catch{return{}}},[r]),g=d.useCallback(v=>{const W={...c};v.length?W[n]=v.join(","):delete W[n],l(W)},[c,n,l]),m=d.useCallback(v=>{u.includes(v)||g([...u,v])},[u,g]),y=d.useCallback(v=>{var R;if((R=a[v])!=null&&R.locked)return;const W={...c},O=u.filter(I=>I!==v);O.length?W[n]=O.join(","):delete W[n];const w=f(W);v in w&&(delete w[v],Object.keys(w).length?W[r]=JSON.stringify(w):delete W[r]),delete W[s],l(W)},[c,u,n,r,s,f,l,a]),k=d.useCallback(v=>u.includes(v)?y(v):m(v),[u,m,y]),b=d.useCallback(v=>{switch(v.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return ao({name:v.key,get:"array",searchParams:i,filterKey:r})||[];case"date":{const W=uo({name:v.key,searchParams:i,filterKey:r});return W?new Date(W):void 0}case"date-compact":{const O=f(Object.fromEntries(i.entries()))[v.key];return O&&typeof O=="object"?O:void 0}default:return}},[i,r,f]),M=d.useCallback((v,W)=>{if(v.type==="date-compact"){const O={...c},w=f(O);W==null?delete w[v.key]:w[v.key]=W,Object.keys(w).length?O[r]=JSON.stringify(w):delete O[r],delete O[s],l(O);return}Mt({value:W,name:v.key,type:_s(v.type),searchQueries:c,setSearchParams:l,filterKey:r,pageKey:s})},[c,l,r,s,f]),B=d.useCallback(v=>{const W={...c},O=f(W);v in O&&(delete O[v],Object.keys(O).length?W[r]=JSON.stringify(O):delete W[r]),delete W[s],l(W)},[c,r,s,f,l]),L=d.useCallback(()=>{const v={...c};delete v[r],delete v[n],delete v[s],l(v)},[c,r,n,s,l]),C=u.length>0;return{activeKeys:u,configByKey:a,hasActiveFilter:C,addFilter:m,removeFilter:y,toggleFilter:k,getValue:b,setValue:M,clearValue:B,clearAll:L}}const qr={get(t){return Ft.storage.get(t)??null},set(t,r){Ft.storage.save(t,r)},remove(t){Ft.storage.delete(t)}},Ct={columns:t=>`filterbar:colprefs:${t}`,savedViews:t=>`filterbar:views:${t}`,lastState:t=>`filterbar:last:${t}`,perPage:t=>`filterbar:perpage:${t}`,tableSort:t=>`tablelayout:sort:${t}`},At=(t,r)=>{const n=new Set(r.map(i=>i.key)),s=t.order.filter(i=>n.has(i));for(const i of r)s.includes(i.key)||s.push(i.key);const o=t.hidden.filter(i=>n.has(i));return{order:s,hidden:o}};function qs({columns:t,scopeId:r,storage:n,onColumnsChange:s,value:o}){const i=d.useMemo(()=>({order:t.map(w=>w.key),hidden:[]}),[t]),l=r?Ct.columns(r):void 0,c=(w,R)=>At({order:w.order??R,hidden:w.hidden??[]},t),[a,u]=d.useState(()=>{if(o&&(o.order||o.hidden))return c(o,t.map(w=>w.key));if(l){const w=n.get(l);if(w&&Array.isArray(w.order))return At(w,t)}return i}),f=t.map(w=>w.key).join("|");d.useEffect(()=>u(w=>At(w,t)),[f]);const g=d.useRef(a);g.current=a;const m=o?`${(o.order??[]).join("|")}~${(o.hidden??[]).join("|")}`:null,y=d.useRef(m);d.useEffect(()=>{if(m==null||y.current===m)return;y.current=m;const w=g.current,R=c(o,w.order);R.order.join("|")===w.order.join("|")&&R.hidden.join("|")===w.hidden.join("|")||(u(R),l&&n.set(l,R))},[m,f]);const k=d.useRef(!1);d.useEffect(()=>{k.current||(k.current=!0,s==null||s(a))},[]);const b=d.useCallback(w=>{u(w),l&&n.set(l,w),s==null||s(w)},[l,n,s]),M=d.useMemo(()=>{const w=new Map(t.map(R=>[R.key,R]));return a.order.filter(R=>w.has(R)).map(R=>({...w.get(R),visible:!a.hidden.includes(R)}))},[a,t]),B=d.useCallback(w=>{const R=a.hidden.includes(w)?a.hidden.filter(I=>I!==w):[...a.hidden,w];b({...a,hidden:R})},[a,b]),L=d.useCallback((w,R)=>{if(w===R)return;const I=[...a.order],[J]=I.splice(w,1);I.splice(R,0,J),b({...a,order:I})},[a,b]),C=d.useCallback(w=>{b({...a,hidden:w?t.filter(R=>!R.locked).map(R=>R.key):[]})},[a,t,b]),v=d.useCallback(()=>b(i),[b,i]),W=d.useCallback(w=>b(At(w,t)),[b,t]),O=a.hidden.length===0;return{state:a,orderedColumns:M,allVisible:O,toggleVisibility:B,reorder:L,setAllHidden:C,reset:v,applyState:W}}function Zs({scopeId:t,storage:r,snapshotKeys:n,pageKey:s="page",getColumns:o,applyColumns:i}){const{searchParams:l,setSearchParams:c}=We(),a=t?Ct.savedViews(t):void 0,[u,f]=d.useState(()=>a?r.get(a)||[]:[]),g=d.useCallback(b=>{f(b),a&&r.set(a,b)},[a]),m=d.useCallback(b=>{const M=b.trim();if(!M)return;const B={};n.forEach(C=>{const v=l.get(C);v!=null&&(B[C]=v)});const L={id:`${Date.now()}`,name:M,query:B,columns:o==null?void 0:o(),createdAt:Date.now()};g([...u,L])},[n,l,o,g,u]),y=d.useCallback(b=>g(u.filter(M=>M.id!==b)),[g,u]),k=d.useCallback(b=>{const M=Object.fromEntries(l.entries());n.forEach(B=>delete M[B]),Object.assign(M,b.query),delete M[s],c(M),b.columns&&(i==null||i(b.columns))},[l,n,s,c,i]);return{enabled:!!a,views:u,saveView:m,deleteView:y,applyView:k}}function Gs(t,r){let n;try{n=JSON.parse(t)}catch{return t}return!n||typeof n!="object"?t:(delete n[r],Object.keys(n).length>0?JSON.stringify(n):void 0)}function Sn(t,r,n){const s=t[r];if(s==null)return;const o=Gs(s,n);o===void 0?delete t[r]:t[r]=o}function Qs({scopeId:t,storage:r,snapshotKeys:n,enabled:s=!0,filterKey:o="filter",searchKey:i="q",persistSearch:l=!0}){const{searchParams:c}=We(),a=t&&s?Ct.lastState(t):void 0,u=d.useRef(a),f=d.useRef(!1);d.useEffect(()=>{if(!a){u.current=a;return}if(u.current!==a){u.current=a,f.current=!1;return}const y={};if(n.forEach(k=>{const b=c.get(k);b!=null&&(y[k]=b)}),l||Sn(y,o,i),Object.keys(y).length===0){f.current&&r.remove(a);return}f.current=!0,r.set(a,y)},[c,a,n,r,l,o,i]);const g=d.useCallback(()=>{if(!a)return null;const y=r.get(a);return!y||Object.keys(y).length===0||!l&&(Sn(y,o,i),Object.keys(y).length===0)?null:y},[a,r,l,o,i]),m=d.useCallback(()=>{a&&r.remove(a)},[a,r]);return{enabled:!!a,read:g,clear:m}}function Us({scopeId:t,storage:r,perPageKey:n,pageSizeOptions:s,enabled:o=!0}){const{searchParams:i}=We(),l=t&&o?Ct.perPage(t):void 0,c=i.toString(),a=d.useRef(l);d.useEffect(()=>{if(!l){a.current=l;return}if(a.current!==l){a.current=l;return}const g=i.get(n);if(!g)return;const m=Number(g);!Number.isFinite(m)||m<=0||r.set(l,m)},[c,l,n,r]);const u=d.useCallback(()=>{if(!l)return null;const g=r.get(l);if(g==null)return null;const m=Number(g);return!Number.isFinite(m)||m<=0||s&&!s.includes(m)?null:String(m)},[l,r,s]),f=d.useCallback(()=>{l&&r.remove(l)},[l,r]);return{enabled:!!l,read:u,clear:f}}let gr={},pr=!1,yr=null;const Js=(t,r)=>{Object.assign(gr,t),yr=r,!pr&&(pr=!0,queueMicrotask(()=>{const n=gr,s=yr;gr={},pr=!1,yr=null,!(!s||Object.keys(n).length===0)&&s(o=>{const i=new URLSearchParams(o);return Object.entries(n).forEach(([l,c])=>i.set(l,c)),i})}))};function Ys({enabled:t,snapshotKeys:r,perPageKey:n,readSnapshot:s,readPerPage:o}){const{searchParams:i,setSearchParams:l,location:c}=We(),a=d.useRef(null);d.useEffect(()=>{if(!t||a.current===c.pathname)return;a.current=c.pathname;const u={};if(!i.has(n)){const f=o();f&&(u[n]=f)}if(!r.some(f=>i.has(f))){const f=s();f&&Object.assign(u,f)}Object.keys(u).length!==0&&Js(u,l)},[c.pathname,t])}const Xs=({configs:t,activeKeys:r,onToggle:n,hasActiveFilter:s,onReset:o})=>t.length?e.jsxs(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(H.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(T.MenuLists,{children:e.jsx(T.MenuBody,{style:{minWidth:260},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),s&&o&&e.jsx(H.Button,{variant:"link",tone:"brand",size:"xs",onClick:o,children:"Reset"})]}),children:t.map(i=>e.jsx(T.MenuItem,{selected:i.locked||r.includes(i.key),disabled:i.locked,closeOnSelect:!1,startIcon:i.icon??void 0,onClick:()=>{i.locked||n(i.key)},children:i.label},i.key))})})]}):null,Xt=({onClear:t,onRemove:r})=>e.jsxs(T.Menu,{position:"bottom-right",children:[e.jsx(T.MenuButton,{children:e.jsx(H.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(E.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(T.MenuLists,{children:e.jsxs(T.MenuBody,{style:{width:180},children:[e.jsx(T.MenuItem,{startIcon:e.jsx(E.Icon,{name:"CrossCircle"}),onClick:t,children:"Clear value"}),r&&e.jsx(T.MenuItem,{intent:"danger",startIcon:e.jsx(E.Icon,{name:"Trash1"}),onClick:r,children:"Remove filter"})]})})]}),$s=t=>{const r=new Date(t);return r.setHours(0,0,0,0),r},kn=(t,r,n)=>{const s=new Date(t);return n==="day"?s.setDate(s.getDate()+r):n==="week"?s.setDate(s.getDate()+r*7):n==="month"?s.setMonth(s.getMonth()+r):s.setFullYear(s.getFullYear()+r),s},fo=t=>{const r=$s(new Date);if(t.direction==="this"){const s=new Date(r),o=new Date(r);return t.period==="week"?(s.setDate(r.getDate()-r.getDay()),o.setDate(s.getDate()+6)):t.period==="month"?(s.setDate(1),o.setMonth(o.getMonth()+1,0)):t.period==="year"&&(s.setMonth(0,1),o.setMonth(11,31)),{from:s,to:o}}const n=t.count??1;return t.direction==="past"?{from:kn(r,-n,t.period),to:r}:{from:r,to:kn(r,n,t.period)}},Bn=24,mo=t=>t.length>Bn?`${t.slice(0,Bn)}...`:t,go=t=>t.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),jr=(t,r="days")=>r==="months"?t.toLocaleDateString(void 0,{month:"short",year:"numeric"}):r==="years"?String(t.getFullYear()):go(t),Gt={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"},Ks=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],Lr={past:"Past",next:"Next",this:"This"},ei=["day","week","month","year"],ti=["past","next","this"],ri=t=>t.field.type==="date-compact"?e.jsx(si,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}):e.jsx(ni,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}),ni=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=r?go(new Date(r)):null,l=!!i,c=l?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:mo(i)})]}):t.label;return e.jsxs(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(H.Button,{variant:l?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l?e.jsx(E.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:c})}),e.jsx(T.MenuLists,{children:e.jsx(T.MenuBody,{style:{width:260},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Xt,{onClear:s,onRemove:o})]}),children:e.jsx(xt.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:t.mode,value:r,onChange:a=>a==null?s():n(a),withPadding:!1})})})]})},oi=(t,r="days")=>{switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date?`${Gt[t.op]} ${jr(new Date(t.date),r)}`:null;case"is-between":return t.from&&t.to?`${jr(new Date(t.from),r)} - ${jr(new Date(t.to),r)}`:null;case"is-relative-to-today":{const n=t.relative;if(!n)return null;if(n.direction==="this")return`This ${n.period}`;const s=n.count??1,o=s===1?n.period:`${n.period}s`;return`${Lr[n.direction]} ${s} ${o}`}case"is-empty":case"is-not-empty":return Gt[t.op];default:return null}},si=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=t.ops&&t.ops.length>0?t.ops:Ks,l=t.defaultOp&&i.includes(t.defaultOp)?t.defaultOp:i[0],c=t.mode??"days",a=(r==null?void 0:r.op)??l,u=r?oi(r,c):null,f=!!u,g=f?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:mo(u)})]}):t.label,m=y=>{if(y!==a){if(y==="is-empty"||y==="is-not-empty"){n({op:y});return}if(y==="is-relative-to-today"){n({op:y,relative:(r==null?void 0:r.relative)??{direction:"past",count:1,period:"week"}});return}if(y==="is-between"){n({op:y,from:r==null?void 0:r.from,to:r==null?void 0:r.to});return}n({op:y,date:r==null?void 0:r.date})}};return e.jsxs(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(H.Button,{variant:f?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:f?e.jsx(E.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:g})}),e.jsxs(T.MenuLists,{children:[e.jsx(T.MenuBody,{style:{width:320},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(ii,{op:a,ops:i,onChange:m})]}),e.jsx(Xt,{onClear:s,onRemove:o})]}),children:e.jsx(li,{value:r,op:a,mode:c,onChange:n})}),a==="is-relative-to-today"&&e.jsx(T.MenuFooter,{children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},ii=({op:t,ops:r,onChange:n})=>e.jsxs(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(H.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:Gt[t]})}),e.jsx(T.MenuLists,{children:e.jsx(T.MenuBody,{style:{width:200},children:r.map(s=>e.jsx(T.MenuItem,{selected:t===s,onClick:()=>n(s),endIcon:t===s?e.jsx(E.Icon,{name:"Check"}):void 0,children:Gt[s]},s))})})]}),li=({value:t,op:r,mode:n="days",onChange:s})=>{if(r==="is-empty"||r==="is-not-empty")return e.jsx(x.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(r==="is-between"){const o=t!=null&&t.from||t!=null&&t.to?{from:t!=null&&t.from?new Date(t.from):null,to:t!=null&&t.to?new Date(t.to):null}:void 0;return e.jsx(xt.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,filter:n,value:o,onChange:i=>{if(i==null){s({op:r});return}if(typeof i=="object"&&i!==null&&"from"in i&&"to"in i){let{from:l,to:c}=i;if(!l&&c&&(l=c,c=null),!l&&!c){s({op:r});return}s({op:r,from:l?l.toISOString():void 0,to:c?c.toISOString():void 0})}},withPadding:!1},`range-${n}`)}return r==="is-relative-to-today"?e.jsx(ci,{value:t==null?void 0:t.relative,onChange:o=>s({op:r,relative:o})}):e.jsx(xt.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:n,value:t!=null&&t.date?new Date(t.date):void 0,onChange:o=>{if(o==null){s({op:r});return}o instanceof Date&&s({op:r,date:o.toISOString()})},withPadding:!1},`single-${n}`)},ci=({value:t,onChange:r})=>{const n=(t==null?void 0:t.direction)??"past",s=(t==null?void 0:t.count)??1,o=(t==null?void 0:t.period)??"week",i=n!=="this",l=fo({direction:n,count:s,period:o});return e.jsxs(x.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:Lr[n]})}),e.jsx(T.MenuLists,{children:e.jsx(T.MenuBody,{style:{width:140},children:ti.map(c=>e.jsx(T.MenuItem,{selected:n===c,endIcon:n===c?e.jsx(E.Icon,{name:"Check"}):void 0,onClick:()=>r(c==="this"?{direction:c,period:o}:{direction:c,count:s,period:o}),children:Lr[c]},c))})})]}),i&&e.jsx(at.Input,{type:"number",size:"sm",min:1,clearable:!1,value:s,onChange:c=>{const a=Number(c.target.value);r({direction:n,count:Number.isFinite(a)&&a>0?a:1,period:o})},style:{width:72}}),e.jsxs(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:o})}),e.jsx(T.MenuLists,{children:e.jsx(T.MenuBody,{style:{width:140},children:ei.map(c=>e.jsx(T.MenuItem,{selected:o===c,endIcon:o===c?e.jsx(E.Icon,{name:"Check"}):void 0,onClick:()=>r(n==="this"?{direction:n,period:c}:{direction:n,count:s,period:c}),children:c},c))})})]})]}),e.jsx(xt.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:l,onChange:()=>{},withPadding:!1},"relative-preview")]})},Fn=18,ai=t=>t.length>Fn?`${t.slice(0,Fn)}...`:t,di=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=t.type==="dropdown-multiple",l=r.length,c=t.searchable!==!1,[a,u]=d.useState(""),f=t.options,g=typeof t.onSearch=="function",m=(()=>{if(g)return f;const B=a.trim().toLowerCase();return B?f.filter(L=>L.label.toLowerCase().includes(B)):f})(),y=B=>r.some(L=>L.value===B.value),k=B=>{if(!i){n([{label:B.label,value:B.value}]),u("");return}n(y(B)?r.filter(L=>L.value!==B.value):[...r,{label:B.label,value:B.value}])},b=B=>{var L;u(B),(L=t.onSearch)==null||L.call(t,B)},M=l===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:l===1?ai(r[0].label):`${l} Selected`})]});return e.jsxs(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(H.Button,{variant:l>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l>0?e.jsx(E.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:M})}),e.jsx(T.MenuLists,{children:e.jsx(T.MenuBody,{style:{width:260},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Xt,{onClear:s,onRemove:o})]}),children:e.jsxs(x.Box,{direction:"column",gap:"sm",children:[c&&e.jsx(jt.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:i,searchAble:!0,searchValue:a,onSearch:b,value:r,onChange:n,placeholder:`Search ${t.label.toLowerCase()}…`}),e.jsx(x.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:t.isLoading?e.jsx(x.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):m.length===0?e.jsx(x.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):m.map(B=>e.jsx(T.MenuItem,{closeOnSelect:!i,selected:y(B),startIcon:B.avatar,endIcon:y(B)?e.jsx(E.Icon,{name:"Check"}):void 0,description:B.description,onClick:()=>k(B),children:B.label},B.value))})]})})})]})},En=18,ui=t=>t.length>En?`${t.slice(0,En)}...`:t,Mn=({checked:t,indeterminate:r})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(rt.Checkbox,{size:"sm",checked:t,readOnly:!0,onChange:()=>{},variant:r?"indeterminate":"select"})}),xi=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=new Set(r.map(m=>m.value)),l=r.length,c=t.options.length>0&&t.options.every(m=>i.has(m.value)),a=l>0&&!c,u=m=>{n(i.has(m.value)?r.filter(y=>y.value!==m.value):[...r,{label:m.label,value:m.value}])},f=()=>{n(c?[]:t.options.map(m=>({label:m.label,value:m.value})))},g=l===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs(D.Text,{as:"span",fontWeight:"semibold",children:[t.label,":"]})," ",e.jsx(D.Text,{as:"span",children:l===1?ui(r[0].label):`${l} Selected`})]});return e.jsxs(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(H.Button,{variant:l>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l>0?e.jsx(E.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:g})}),e.jsx(T.MenuLists,{children:e.jsxs(T.MenuBody,{style:{width:240},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Xt,{onClear:s,onRemove:o})]}),children:[e.jsx(T.MenuItem,{closeOnSelect:!1,selected:c,onClick:f,startIcon:e.jsx(Mn,{checked:c||a,indeterminate:a}),children:"Select All"}),t.options.map(m=>e.jsx(T.MenuItem,{closeOnSelect:!1,selected:i.has(m.value),onClick:()=>u(m),startIcon:e.jsx(Mn,{checked:i.has(m.value)}),children:m.label},m.value))]})})]})},po=({activeKeys:t,configByKey:r,getValue:n,setValue:s,clearValue:o,removeFilter:i})=>e.jsx(e.Fragment,{children:t.map(l=>{const c=r[l];if(!c)return null;const a=n(c),u=c.locked?void 0:()=>i(l);return c.type==="date"||c.type==="date-compact"?e.jsx(ri,{field:c,value:a,onChange:f=>s(c,f),onClear:()=>o(l),onRemove:u},l):c.type==="checkbox-multiple"?e.jsx(xi,{field:c,value:a||[],onChange:f=>s(c,f),onClear:()=>o(l),onRemove:u},l):e.jsx(di,{field:c,value:a||[],onChange:f=>s(c,f),onClear:()=>o(l),onRemove:u},l)})}),Ln=t=>`${t} Rows`,hi=({pagination:t,pageKey:r="page",perPageKey:n="perPage",pageSizeOptions:s=[10,25,50,100],defaultPerPage:o=10,showResultCount:i=!0,showPageSize:l=!0,showPagination:c=!0})=>{var B;const{searchQueries:a,setSearchParams:u,searchParams:f}=We(),g=f.get(n),m=g?Number(g):o,y=L=>{u({...a,[r]:String(L)})},k=L=>{u({...a,[n]:L,[r]:"1"})},b=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:0),M=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[i&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${b}-${M} of ${((B=t==null?void 0:t.totalData)==null?void 0:B.toLocaleString())||0}`}),l&&e.jsxs(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:Ln(m)})}),e.jsx(T.MenuLists,{children:e.jsx(T.MenuBody,{children:s.map(L=>e.jsx(T.MenuItem,{selected:L===m,onClick:()=>k(String(L)),children:Ln(L)},L))})})]}),c&&((t==null?void 0:t.totalPage)??0)>1&&e.jsx(x.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(Et.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:t!=null&&t.currentPage?Number(t.currentPage):1,totalPages:Number(t==null?void 0:t.totalPage),onPageChange:y})})]})};function fi(t,r,n=!0){d.useEffect(()=>{if(!n)return;const s=o=>{var c;if(o.metaKey||o.ctrlKey||o.altKey||o.key!==t||Re.isOverlayOpen())return;const i=o.target,l=(c=i==null?void 0:i.tagName)==null?void 0:c.toLowerCase();l==="input"||l==="textarea"||i!=null&&i.isContentEditable||(o.preventDefault(),r())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t,r,n])}const mi=240,yo=({searchKey:t="q",filterKey:r="filter",pageKey:n="page",placeholder:s="Search",shortcut:o="/",collapsible:i=!0})=>{const{searchParams:l,setSearchParams:c,searchQueries:a}=We(),u=Yt(t,l,r)||"",[f,g]=d.useState(!i||!!u),[m,y]=d.useState(i&&!u),[k,b]=d.useState(u),M=we.useDebounce(k,350),B=d.useRef(null);d.useEffect(()=>{b(u),u&&g(!0)},[u]),d.useEffect(()=>{f&&y(!1)},[f]),d.useEffect(()=>{M!==u&&Mt({value:M,name:t,type:"search",searchQueries:a,setSearchParams:c,filterKey:r,pageKey:n})},[M]);const L=d.useCallback(()=>{g(!0),requestAnimationFrame(()=>{var O;return(O=B.current)==null?void 0:O.focus()})},[]);fi(o,L);const C=()=>{i&&!k&&g(!1)},v=O=>{var w;i&&O.key==="Escape"&&!k&&(g(!1),(w=B.current)==null||w.blur())},W=()=>{f||y(!0)};return e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[m&&e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:L}),e.jsxs(x.Box,{onTransitionEnd:W,style:{position:"relative",width:f?mi:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(at.Input,{ref:B,size:"sm",fullWidth:!0,value:k,placeholder:s,leftIcon:e.jsx(E.Icon,{name:"Search",width:16,height:16}),onChange:O=>b(O.target.value),onKeyDown:v,onBlur:C,tabIndex:f?0:-1}),f&&!k&&e.jsx(x.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(D.Text,{fontSize:"xs",color:"subtle",children:o})})]})]})},jo=({columns:t,allVisible:r,onToggle:n,onReorder:s,onSetAllHidden:o})=>{const[i,l]=d.useState(null),[c,a]=d.useState(null),u=()=>{i!==null&&c!==null&&i!==c&&s(i,c),l(null),a(null)},f=(g,m)=>{const y=g+m;y<0||y>=t.length||s(g,y)};return e.jsxs(T.Menu,{position:"bottom-right",children:[e.jsx(T.MenuButton,{children:e.jsx(H.Button,{variant:r?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(T.MenuLists,{children:e.jsx(T.MenuBody,{children:e.jsxs(x.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(H.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>o(r),children:r?"Hide All":"Show All"})]}),e.jsx(x.Box,{direction:"column",overflow:"overflow-y-auto",children:t.map((g,m)=>{const y=!g.locked,k=c===m&&i!==null&&i!==m;return e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:y,onDragStart:()=>y&&l(m),onDragOver:b=>{b.preventDefault(),a(m)},onDrop:u,onDragEnd:u,style:{minHeight:32,boxShadow:k?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(x.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:y?0:-1,"aria-label":`Reorder ${g.title}`,"aria-disabled":!y||void 0,color:"icon-subtlest",onKeyDown:b=>{y&&(b.key==="ArrowUp"?(b.preventDefault(),f(m,-1)):b.key==="ArrowDown"&&(b.preventDefault(),f(m,1)))},style:{display:"inline-flex",cursor:y?"grab":"default",opacity:y?1:.4},children:e.jsx(E.Icon,{name:"DragVertical",width:16,height:16})}),g.icon&&e.jsx(x.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:g.icon}),e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:g.title}),e.jsx(x.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(vt.Toggle,{size:"sm",checked:g.visible,disabled:g.locked,onChange:()=>n(g.key),"aria-label":`Toggle ${g.title} column`})})]},g.key)})})]})})})]})},bo=({views:t,onApply:r,onDelete:n,onSave:s})=>{const[o,i]=d.useState(""),l=()=>{const c=o.trim();c&&(s(c),i(""))};return e.jsxs(T.Menu,{position:"bottom-right",children:[e.jsx(T.MenuButton,{children:e.jsx(H.Button,{variant:t.length>0?"secondary":"outline",tone:(t.length>0,"neutral"),size:"sm",iconLeft:e.jsx(E.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(T.MenuLists,{style:{width:"260px"},children:[e.jsx(T.MenuBody,{children:e.jsxs(x.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(x.Box,{direction:"column",overflow:"overflow-y-auto",children:t.length===0?e.jsx(x.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(D.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):t.map(c=>e.jsx(T.MenuItem,{startIcon:e.jsx(E.Icon,{name:"Bookmark"}),onClick:()=>r(c),endIcon:e.jsx(H.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(E.Icon,{name:"Trash2"}),"aria-label":`Delete ${c.name}`,onClick:a=>{a.stopPropagation(),n(c.id)}}),children:c.name},c.id))})]})}),e.jsx(T.MenuFooter,{children:e.jsxs(x.Box,{direction:"row",gap:"xs",children:[e.jsx(x.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(at.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:o,onChange:c=>i(c.target.value),onKeyDown:c=>{c.key==="Enter"&&l()}})}),e.jsx(H.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!o.trim(),onClick:l,children:"Save"})]})})]})]})},gi=({isOpen:t,onClose:r,configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,onToggle:l,onReset:c,getValue:a,setValue:u,clearValue:f,removeFilter:g})=>{const m=s.length;return e.jsx(qt.Drawer,{position:"bottom",isShow:t,onHide:r,children:e.jsxs(x.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(x.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(x.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),m>0&&e.jsxs(D.Text,{fontSize:"sm",color:"subtle",children:["(",m,")"]})]}),e.jsx(H.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:r})]}),e.jsxs(x.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[m>0&&e.jsxs(x.Box,{direction:"column",gap:"sm",children:[e.jsx(D.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(x.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(po,{activeKeys:s,configByKey:o,getValue:a,setValue:u,clearValue:f,removeFilter:g})})]}),n.length>0&&e.jsxs(x.Box,{direction:"column",gap:"sm",children:[e.jsx(D.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(x.Box,{direction:"column",children:n.map(y=>{const k=s.includes(y.key),b=!!y.locked;return e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:b?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[y.icon&&e.jsx(x.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:y.icon}),e.jsx(D.Text,{fontSize:"sm",color:"primary",truncate:!0,children:y.label})]}),e.jsx(vt.Toggle,{size:"sm",checked:k||b,disabled:b,onChange:()=>l(y.key),"aria-label":`Toggle ${y.label}`})]},y.key)})})]})]}),e.jsxs(x.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(x.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!i,onClick:c,children:"Reset"})}),e.jsx(x.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(H.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:r,children:"Selesai"})})]})]})})},pi=t=>`${t} Rows`,yi=({perPageKey:t,pageKey:r,pageSizeOptions:n,defaultPerPage:s=10,showPageSize:o})=>{const{searchQueries:i,setSearchParams:l,searchParams:c}=We(),a=c.get(t),u=a?Number(a):s,f=g=>{l({...i,[t]:g,[r]:"1"})};return o?e.jsxs(T.Menu,{position:"bottom-right",children:[e.jsx(T.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(T.MenuLists,{children:e.jsxs(T.MenuBody,{style:{minWidth:200},children:[e.jsx(x.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(D.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),n.map(g=>e.jsx(T.MenuItem,{selected:g===u,endIcon:g===u?e.jsx(E.Icon,{name:"Check"}):void 0,onClick:()=>f(String(g)),children:pi(g)},g))]})})]}):null},ji=t=>{var Ne;const{withPadding:r,configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,toggleFilter:l,removeFilter:c,getValue:a,setValue:u,clearValue:f,onReset:g,searchable:m,searchKey:y,filterKey:k,pageKey:b,searchPlaceholder:M,searchShortcut:B,searchCollapsible:L,pagination:C,perPageKey:v,pageSizeOptions:W,defaultPerPage:O,showPagination:w,showResultCount:R,showPageSize:I,hasColumns:J,orderedColumns:X,allVisible:Z,onToggleVisibility:P,onReorder:$,onSetAllHidden:ee,showSavedViews:N,savedViews:z,onApplyView:V,onDeleteView:le,onSaveView:je,leadingActions:Te}=t,[xe,ve]=d.useState(!1),{searchQueries:De,setSearchParams:Ie}=We(),Oe=(C==null?void 0:C.rangeStart)??(((C==null?void 0:C.currentPage)||0)>1?(((C==null?void 0:C.currentPage)||0)-1)*((C==null?void 0:C.perPage)||0)+1:1),Me=(C==null?void 0:C.rangeEnd)??((C==null?void 0:C.totalCurrentPage)!==(C==null?void 0:C.perPage)?C==null?void 0:C.totalData:((C==null?void 0:C.currentPage)||1)*((C==null?void 0:C.totalCurrentPage)||0)),He=Ue=>{Ie({...De,[b]:String(Ue)})},be=R||w&&!!(C!=null&&C.totalPage),Ae=()=>{g(),ve(!1)};return e.jsxs(x.Box,{direction:"column",gap:"sm",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(x.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[m&&e.jsx(yo,{searchKey:y,filterKey:k,pageKey:b,placeholder:M,shortcut:B,collapsible:L}),e.jsx(H.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"FilterHorizontal"}),onClick:()=>ve(!0),"aria-label":"Open filters",children:i?`Filter: ${s.length}`:null}),e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[Te,N&&e.jsx(bo,{views:z,onApply:V,onDelete:le,onSave:je}),J&&e.jsx(jo,{columns:X,allVisible:Z,onToggle:P,onReorder:$,onSetAllHidden:ee}),e.jsx(yi,{perPageKey:v,pageKey:b,pageSizeOptions:W,defaultPerPage:O,showPageSize:I})]})]}),be&&e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[R?e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Oe}-${Me} of ${((Ne=C==null?void 0:C.totalData)==null?void 0:Ne.toLocaleString())||0}`}):e.jsx(x.Box,{direction:"column"}),w&&!!(C!=null&&C.totalPage)&&e.jsx(Et.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:C!=null&&C.currentPage?Number(C.currentPage):1,totalPages:Number(C.totalPage),onPageChange:He})]}),e.jsx(gi,{isOpen:xe,onClose:()=>ve(!1),configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,onToggle:l,onReset:Ae,getValue:a,setValue:u,clearValue:f,removeFilter:c})]})},bi=({withPadding:t=!1,filterConfigs:r=[],filterKey:n="filter",activeFilterKey:s="filters",pageKey:o="page",perPageKey:i="perPage",pageSizeOptions:l=[25,50,100],defaultPerPage:c,showPagination:a=!0,showResultCount:u=!0,showPageSize:f=!0,searchable:g=!1,searchKey:m="q",searchPlaceholder:y="Search",searchShortcut:k="/",searchPosition:b="right",searchCollapsible:M=!0,pagination:B,columns:L=[],onColumnsChange:C,columnsState:v,scopeId:W,savedViews:O,persistLastState:w=!0,persistSearch:R=!0,storage:I=qr,onReset:J,leadingActions:X})=>{const Z=W??(O==null?void 0:O.scopeId),{activeKeys:P,configByKey:$,hasActiveFilter:ee,toggleFilter:N,removeFilter:z,getValue:V,setValue:le,clearValue:je,clearAll:Te}=_r({configs:r,filterKey:n,activeFilterKey:s,pageKey:o,searchKey:m}),xe=qs({columns:L,scopeId:Z,storage:I,onColumnsChange:C,value:v}),ve=Zs({scopeId:Z,storage:I,snapshotKeys:[s,n,i],pageKey:o,getColumns:()=>xe.state,applyColumns:xe.applyState}),De=Qs({scopeId:Z,storage:I,snapshotKeys:[s,n,o],enabled:w,filterKey:n,searchKey:m,persistSearch:R}),Ie=Us({scopeId:Z,storage:I,perPageKey:i,pageSizeOptions:l,enabled:w});Ys({enabled:w&&!!Z,snapshotKeys:[s,n,o],perPageKey:i,readSnapshot:De.read,readPerPage:Ie.read});const Oe=c??l[0]??25,Me=!!(O!=null&&O.enabled)&&ve.enabled,He=()=>{Te(),De.clear(),J==null||J()},be=we.useMediaQuery("md"),Ae=g?e.jsx(yo,{searchKey:m,filterKey:n,pageKey:o,placeholder:y,shortcut:k,collapsible:M}):null;return be?e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",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(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Xs,{configs:r,activeKeys:P,onToggle:N,hasActiveFilter:ee,onReset:He}),b==="left"&&Ae,e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(po,{activeKeys:P,configByKey:$,getValue:V,setValue:le,clearValue:je,removeFilter:z}),ee&&e.jsx(H.Button,{variant:"link",tone:"brand",size:"sm",onClick:He,children:"Reset"})]})]}),e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[X,e.jsx(hi,{pagination:B,pageKey:o,perPageKey:i,pageSizeOptions:l,defaultPerPage:Oe,showPagination:a,showResultCount:u,showPageSize:f}),b==="right"&&Ae,Me&&e.jsx(bo,{views:ve.views,onApply:ve.applyView,onDelete:ve.deleteView,onSave:ve.saveView}),L.length>0&&e.jsx(jo,{columns:xe.orderedColumns,allVisible:xe.allVisible,onToggle:xe.toggleVisibility,onReorder:xe.reorder,onSetAllHidden:xe.setAllHidden})]})]}):e.jsx(ji,{withPadding:t,configs:r,activeKeys:P,configByKey:$,hasActiveFilter:ee,toggleFilter:N,removeFilter:z,getValue:V,setValue:le,clearValue:je,onReset:He,searchable:g,searchKey:m,filterKey:n,pageKey:o,searchPlaceholder:y,searchShortcut:k,searchCollapsible:M,pagination:B,perPageKey:i,pageSizeOptions:l,defaultPerPage:Oe,showPagination:a,showResultCount:u,showPageSize:f,hasColumns:L.length>0,orderedColumns:xe.orderedColumns,allVisible:xe.allVisible,onToggleVisibility:xe.toggleVisibility,onReorder:xe.reorder,onSetAllHidden:xe.setAllHidden,showSavedViews:Me,savedViews:ve.views,onApplyView:ve.applyView,onDeleteView:ve.deleteView,onSaveView:ve.saveView,leadingActions:X})},vi=t=>{if(!Array.isArray(t)||t.length===0)return;const r=t[0];return(r==null?void 0:r.value)!=null?String(r.value):void 0},Ci=t=>{if(!Array.isArray(t)||t.length===0)return;const r=t.map(n=>(n==null?void 0:n.value)!=null?String(n.value):null).filter(n=>n!=null);return r.length?r:void 0},wi=(t,r)=>{switch(t.type){case"dropdown":case"radio":return vi(r);case"dropdown-multiple":case"checkbox-multiple":return Ci(r);case"date":return r instanceof Date?r.toISOString():void 0;case"date-compact":return r;default:return}},Tn=(t,r)=>{if(t==null||t==="")return r;const n=Number(t);return Number.isFinite(n)&&n>0?n:r},Di=t=>{const{filterConfigs:r,filterKey:n="filter",activeFilterKey:s="filters",pageKey:o="page",perPageKey:i="perPage",searchKey:l="q",defaultPage:c=1,defaultPerPage:a=10,paramKeys:u,serialize:f}=t,{activeKeys:g,configByKey:m,hasActiveFilter:y,getValue:k}=_r({configs:r,filterKey:n,activeFilterKey:s,pageKey:o,searchKey:l}),{searchParams:b}=We(),M=b.toString();return d.useMemo(()=>{const L={},C={},v=Tn(b.get(o),c),W=Tn(b.get(i),a);L[(u==null?void 0:u.page)??"page"]=v,L[(u==null?void 0:u.perPage)??"perPage"]=W;const O=Yt(l,b,n)||"";O&&(L[(u==null?void 0:u.search)??"search"]=O);let w=!1;for(const R of g){const I=m[R];if(!I)continue;const J=k(I);C[R]=J;const X=f==null?void 0:f[R],Z=X?X(J):wi(I,J);if(Z==null||Array.isArray(Z)&&Z.length===0)continue;const P=(u==null?void 0:u[R])??R;L[P]=Z,w=!0}return{params:L,raw:C,hasActiveFilter:y||!!O||w}},[M,g.join("|"),n,s,o,i,l,c,a,u,f,m])},Si=["dropdown","dropdown-multiple","checkbox-multiple","radio"],ki=({filterConfigs:t,filterKey:r,activeFilterKey:n,pageKey:s,searchKey:o})=>{const{configByKey:i,getValue:l,setValue:c,removeFilter:a,clearAll:u,hasActiveFilter:f}=_r({configs:t,filterKey:r,activeFilterKey:n,pageKey:s,searchKey:o}),g=(B,L)=>{var v;const C=B.options;return((v=C==null?void 0:C.find(W=>W.value===L))==null?void 0:v.label)??L},m=d.useCallback(B=>{const L=i[B];if(!L)return[];const C=l(L);return Array.isArray(C)?C.map(v=>String(v.value)):[]},[i,l]),y=d.useCallback((B,L)=>{const C=i[B];if(!C||!Si.includes(C.type))return;const v=Array.isArray(L)?L:[L];if(v.length===0){a(B);return}c(C,v.map(W=>({label:g(C,W),value:W})))},[i,c,a]),k=d.useCallback((B,L)=>{const C=m(B);y(B,C.includes(L)?C.filter(v=>v!==L):[...C,L])},[m,y]),b=d.useCallback((B,L)=>m(B).includes(L),[m]),M=d.useCallback(B=>a(B),[a]);return{set:y,toggle:k,clear:M,clearAll:u,isActive:b,values:m,hasActiveFilter:f}},Bi=(t,r)=>{if(!t)return{};const{fromKey:n,toKey:s,opKey:o}=r,i={};switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date&&(i[n]=new Date(t.date).toISOString()),o&&(i[o]=t.op),i;case"is-between":return t.from&&(i[n]=new Date(t.from).toISOString()),t.to&&(i[s]=new Date(t.to).toISOString()),i;case"is-relative-to-today":{if(!t.relative)return i;const{from:l,to:c}=fo(t.relative);return i[n]=l.toISOString(),i[s]=c.toISOString(),i}case"is-empty":case"is-not-empty":return o&&(i[o]=t.op==="is-empty"?"empty":"not-empty"),i;default:return i}},vo=({children:t,borderRadius:r,height:n})=>{const s=d.useRef(null),[o,i]=d.useState("100vh");return d.useEffect(()=>{if(n)return;const l=()=>{if(s.current){const c=s.current.getBoundingClientRect().top;i(`calc(100vh - ${c}px)`)}};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[n]),e.jsx(x.Box,{ref:s,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:r||"rounded-xs",style:{height:n??o,display:"flex",flexDirection:"column"},children:t})},Co=({action:t,rightContent:r,leftContent:n,headerSlot:s,advanceFilter:o,showFilter:i=!0})=>{const l=we.useMediaQuery("md"),c=i?e.jsx(ho,{...o}):null,a=()=>t?d.isValidElement(t)?t:e.jsx(x.Box,{style:{display:"flex",flexDirection:l?"row":"column",gap:"8px",width:l?"auto":"100%",textWrap:"nowrap"},children:t.map(({title:u,icon:f,buttonProps:g,onClick:m},y)=>!u&&!f?null:e.jsx(H.Button,{fullWidth:!l,iconLeft:f?e.jsx(E.Icon,{name:f}):void 0,onClick:m,...g,children:u},`action-${y}`))}):null;return e.jsx(x.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:l?"row":"column-reverse",gap:"16px"},children:s?s({filter:c}):e.jsxs(e.Fragment,{children:[e.jsxs(x.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[c,n]}),e.jsxs(x.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[r,a()]})]})})},Fi=({totalData:t,withMarginBottom:r=!0,withMarginTop:n=!0})=>e.jsxs(x.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:r?"16px":void 0,marginTop:n?"16px":void 0},children:[e.jsxs(Qe.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Qe.Body1,{children:t||0})]}),wo=({pagination:t,pageKey:r="page",perPageKey:n="perPage",defaultPerPage:s=10,showPagination:o=!0,totalData:i})=>{const{searchQueries:l,setSearchParams:c,searchParams:a}=We(),u=a.get(n),f=k=>{c({...l,[r]:String(k)})},g=k=>{c({...l,[n]:k,[r]:"1"})},m=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:1),y=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.totalCurrentPage)||0));return e.jsx(x.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(x.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(D.Text,{children:"Rows Per Page: "}),e.jsx(jt.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:k=>{g(k[0].value)},value:u?[{label:`${u} per row`,value:u}]:[{label:`${s} per row`,value:`${s}`}],defaultValue:u?[{label:`${u} per row`,value:u}]:[{label:`${s} per row`,value:`${s}`}]}),e.jsx(D.Text,{children:`${m}-${y} of ${(t==null?void 0:t.totalData)||0}`})]}),e.jsx(Et.Pagination,{currentPage:t!=null&&t.currentPage?Number(t==null?void 0:t.currentPage):1,totalPages:t!=null&&t.totalPage?Number(t==null?void 0:t.totalPage):1,onPageChange:f})]}):e.jsx(Fi,{totalData:i,withMarginBottom:!1,withMarginTop:!1})})},Do=({filter:t,columnTitle:r})=>{const[n,s]=d.useState(!1),o=d.useRef(null),i=d.useRef(null),l=d.useRef(null),[c,a]=d.useState(""),[u,f]=d.useState({top:0,left:0}),g=t.selectedValues,m=d.useMemo(()=>c?t.options.filter(b=>b.label.toLowerCase().includes(c.toLowerCase())):t.options,[t.options,c]);d.useEffect(()=>{if(n&&i.current){const b=i.current.getBoundingClientRect(),M=280,B={top:b.bottom+8};t.position==="left"||b.left+M>window.innerWidth?B.right=window.innerWidth-b.right:B.left=b.left,f(B)}},[n,t.position]),d.useEffect(()=>{n&&l.current?setTimeout(()=>{var b;return(b=l.current)==null?void 0:b.focus()},50):a("")},[n]),d.useEffect(()=>{const b=M=>{o.current&&!o.current.contains(M.target)&&i.current&&!i.current.contains(M.target)&&s(!1)};return n&&document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[n]);const y=b=>{const M=g.includes(b)?g.filter(B=>B!==b):[...g,b];t.onFilterChange(M)},k=()=>t.onFilterChange([]);return e.jsxs(x.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(x.Box,{ref:i,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:b=>{var M;b.stopPropagation(),n||(M=t.onOpen)==null||M.call(t),s(B=>!B)},children:e.jsx(E.Icon,{name:n?"ChevronUp":"ChevronDown",size:"sm",style:{color:g.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),n&&e.jsxs(x.Box,{ref:o,style:{position:"fixed",top:`${u.top}px`,...u.left!==void 0?{left:`${u.left}px`}:{right:`${u.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(x.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(D.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",r]}),g.length>0&&e.jsx(x.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(D.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:b=>{b.stopPropagation(),k()},children:"CLEAR"})})]}),!t.hideSearch&&e.jsx(x.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(at.Input,{ref:l,placeholder:`Search ${r.toLowerCase()}...`,leftIcon:e.jsx(E.Icon,{name:"Search",size:"sm"}),value:c,onChange:b=>a(b.target.value),style:{fontSize:"14px"}})}),e.jsx(x.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:t.isLoadingOptions?e.jsxs(x.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(E.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):m.length>0?e.jsx(x.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:m.map(b=>e.jsxs(x.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:g.includes(b.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:M=>{M.stopPropagation(),y(b.value)},onMouseEnter:M=>{g.includes(b.value)||(M.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),M.currentTarget.style.transform="translateX(2px)"},onMouseLeave:M=>{M.currentTarget.style.backgroundColor=g.includes(b.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",M.currentTarget.style.transform="translateX(0)"},children:[e.jsx(rt.Checkbox,{checked:g.includes(b.value),onChange:()=>{}}),e.jsx(D.Text,{fontSize:"sm",fontWeight:g.includes(b.value)?"medium":"normal",color:g.includes(b.value)?"primary":"gray-700",children:b.label})]},b.value))}):e.jsxs(x.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(E.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),g.length>0&&e.jsx(x.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(x.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(x.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:g.length}),e.jsxs(D.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",g.length>1?"s":""," selected"]})]})})]})]})},Ei=({direction:t})=>{const r="var(--sa-text-primary, #292a2e)",n="var(--sa-text-subtle, #8c8f97)",s=t==="asc"?r:n,o=t==="desc"?r:n,i=t==="asc"?1:.45,l=t==="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:s,opacity:i,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:l},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},Mi=({frozen:t})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:t?"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:t?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),br="var(--sa-background-primary, #ffffff)",In="var(--sa-background-primary-inverse, #f8f8f8)",So=({columns:t,records:r,handleDetail:n,handleUpdate:s,handleDelete:o,isLoading:i,visibleHandleDelete:l,visibleHandleUpdate:c,visibleHandleDetail:a,showHeadBorder:u=!1,scrollParentRef:f,frozenCount:g=0,onFrozenCountChange:m,customActions:y,actionsOrder:k=["detail","update","delete","custom"],customEmptyState:b,enableColumnResize:M=!1,defaultColumnWidths:B,onColumnWidthsChange:L,defaultMinColumnWidth:C=60,sort:v,defaultSort:W,onSortChange:O,showActionDivider:w=!1})=>{const R=v!==void 0,[I,J]=d.useState(W??null),X=R?v??null:I,Z=A=>{if(A.sortKey)return A.sortKey;if(typeof A.accessor=="string")return A.accessor},P=A=>{const K=Z(A);if(!K)return;let G;!X||X.key!==K?G={key:K,direction:"asc"}:X.direction==="asc"?G={key:K,direction:"desc"}:G=null,R||J(G),O==null||O(G)},ee=[n,s,o].filter(A=>A!==void 0).length,N=!!y,z=!!n||!!s||!!o||N,V="var(--sa-border-subtle, #0b120e24)",le=`1px solid ${V}`,je=`inset 1px 0 0 ${V}`,Te=`inset -1px 0 0 ${V}`,xe=ee===3?N?"178px":"140px":ee===2?N?"140px":"102px":ee===1?N?"112px":"74px":N?"74px":"",ve=(A,K)=>{if(!K)return A;if(typeof K=="function")return K(A);if(typeof K=="string")return A[K]},[De,Ie]=d.useState(!1);d.useEffect(()=>{if(!(f!=null&&f.current))return;const A=f.current;Ie(A.scrollHeight>A.clientHeight)},[r,f]);const Oe=d.useRef(null),[Me,He]=d.useState([]),[be,Ae]=d.useState(()=>B??{}),Ne=d.useRef(null);d.useLayoutEffect(()=>{if(!g||!Oe.current){He([]);return}const A=Array.from(Oe.current.querySelectorAll("thead tr th")),K=[];let G=0;A.forEach((ce,oe)=>{K[oe]=G,oe<g&&(G+=ce.offsetWidth)}),He(K)},[g,t,r,be]);const Ue=A=>{m&&m(A<g?A:A+1)},Ce=(A,K)=>{const G=be[A];if(G!==void 0){const ce=`${G}px`;return{width:ce,minWidth:ce,maxWidth:ce}}return K?{width:K}:{}},Ke=A=>M&&(A.resizable??!0),ht=(A,K)=>{A.preventDefault(),A.stopPropagation();const G=A.currentTarget.closest("th");if(!G)return;const ce=Math.round(G.getBoundingClientRect().width);Ne.current={colIndex:K,startX:A.clientX,startWidth:ce};const oe=document.body.style.userSelect,me=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Je=Ve=>{var et;const Se=Ne.current;if(!Se)return;const qe=((et=t[Se.colIndex])==null?void 0:et.minWidth)??C,de=Math.max(qe,Se.startWidth+(Ve.clientX-Se.startX));Ae(tt=>tt[Se.colIndex]===de?tt:{...tt,[Se.colIndex]:de})},_e=()=>{document.removeEventListener("mousemove",Je),document.removeEventListener("mouseup",_e),document.body.style.userSelect=oe,document.body.style.cursor=me,Ne.current=null,L&&Ae(Ve=>(L(Ve),Ve))};document.addEventListener("mousemove",Je),document.addEventListener("mouseup",_e)};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:[t.map((A,K)=>{var ot,dt;const G=g>0&&K<g,ce=Me[K]??0,oe=Ke(A),Je=K===t.length-1&&z&&w,_e=Z(A),Ve=!!A.sortable&&!!_e,Se=Ve&&(X==null?void 0:X.key)===_e?X.direction:null,qe=A.title||((ot=A.accessor)==null?void 0:ot.toString())||"",de=(dt=A.headerTooltip)!=null&&dt.showIcon?e.jsx(E.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,et=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:qe}),tt=Ve?e.jsxs("button",{type:"button",onClick:()=>P(A),title:Se==="asc"?"Sorted ascending — click to sort descending":Se==="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:A.textAlign==="text-right"?"right":A.textAlign==="text-center"?"center":"left"},children:[et,de,e.jsx(Ei,{direction:Se})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[et,de]});return e.jsxs(q.Th,{style:{position:"sticky",top:0,left:G?ce:void 0,zIndex:G?4:2,paddingLeft:K===0?"12px":"",borderRight:u&&!Je&&!G?le:void 0,borderBottom:u?le:void 0,boxShadow:u&&G?Te:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:A.textAlign==="text-right"?"right":A.textAlign==="text-center"?"center":"left",...Ce(K,A.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[A.headerTooltip?e.jsx(Be.Tooltip,{label:A.headerTooltip.content,position:"bottom",children:tt}):tt,A.filter&&e.jsx(Do,{filter:A.filter,columnTitle:A.title}),m&&e.jsx("button",{onClick:()=>Ue(K),title:G?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:G?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:G?1:.45,transition:"opacity 0.15s"},children:e.jsx(Mi,{frozen:G})})]}),oe&&e.jsx("div",{onMouseDown:lt=>ht(lt,K),onClick:lt=>lt.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-${K}`)}),z?e.jsx(q.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:u?le:void 0,boxShadow:u&&w?je:void 0}}):null]})}),e.jsx(q.Tbody,{children:i?e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:t.length+1,children:e.jsxs(x.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(Ge.Skeleton,{variant:"list"}),e.jsx(Ge.Skeleton,{variant:"list"}),e.jsx(Ge.Skeleton,{variant:"list"}),e.jsx(Ge.Skeleton,{variant:"list"}),e.jsx(Ge.Skeleton,{variant:"list"})]})})}):!(r!=null&&r.length)&&b?e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:t.length+1,children:b})}):r==null?void 0:r.map((A,K)=>e.jsxs(q.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:K===r.length-1&&De?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:G=>{const ce=G.currentTarget;ce.style.backgroundColor=In,Array.from(ce.querySelectorAll("td")).forEach(oe=>{oe.style.position==="sticky"&&(oe.style.backgroundColor=In)})},onMouseLeave:G=>{const ce=G.currentTarget;ce.style.backgroundColor="",Array.from(ce.querySelectorAll("td")).forEach(oe=>{oe.style.position==="sticky"&&(oe.style.backgroundColor=br)})},children:[t.map((G,ce)=>{const oe=G.render?G.render(A,K,r):ve(A,G.accessor),me=g>0&&ce<g,Je=Me[ce]??0,_e=be[ce]!==void 0,Ve=me&&ce===g-1;return e.jsx(q.Td,{style:{position:me?"sticky":void 0,left:me?Je:void 0,zIndex:me?1:void 0,backgroundColor:me?br:void 0,transition:me?"background-color 0.3s ease":void 0,paddingLeft:ce===0?"12px":"",whiteSpace:"nowrap",overflow:_e?"hidden":void 0,borderLeft:G.showBorderLeft?le:void 0,borderRight:G.showBorderRight?le:void 0,boxShadow:Ve?Te:void 0,textAlign:G.textAlign==="text-right"?"right":G.textAlign==="text-center"?"center":"left",...Ce(ce,G.width)},children:typeof oe=="string"?e.jsx(D.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:G.textAlign==="text-right"?"right":G.textAlign==="text-center"?"center":"left"},children:oe}):oe},`row-${K}-col-${ce}`)}),z?e.jsx(q.Td,{style:{width:xe,position:"sticky",right:0,zIndex:1,backgroundColor:br,boxShadow:w?je:void 0,transition:"background-color 0.3s ease"},children:e.jsx(ie.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:k.map(G=>{const ce=K===r.length-1?"top":"bottom";return G==="detail"&&n&&(a==null?void 0:a(A))!==!1?e.jsx(Be.Tooltip,{label:"Detail",position:ce,children:e.jsx(H.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(A.id,A),iconLeft:e.jsx(E.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):G==="update"&&s&&(c==null?void 0:c(A))!==!1?e.jsx(Be.Tooltip,{label:"Update",position:ce,children:e.jsx(H.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>s(A),iconLeft:e.jsx(E.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):G==="delete"&&o&&(l==null?void 0:l(A))!==!1?e.jsx(Be.Tooltip,{label:"Delete",position:ce,children:e.jsx(H.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(A.id,A),iconLeft:e.jsx(E.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):G==="custom"?e.jsx(d.Fragment,{children:y==null?void 0:y(A)},"custom"):null})})}):null]},`${A}${K}`))})]})})},Li=({wrapperProps:t,dataTableProps:r,headerProps:n,footerProps:s})=>{var g;const o=d.useRef(null),[i,l]=d.useState((r==null?void 0:r.defaultFrozenCount)??0),c=(n==null?void 0:n.show)??!0,a=d.useRef(null),u=(g=r==null?void 0:r.pagination)==null?void 0:g.totalData;typeof u=="number"&&(a.current=u);const f=(s==null?void 0:s.showFooter)??(u===void 0?a.current!==0:u!==0);return e.jsxs(vo,{...t,children:[c&&e.jsx(Co,{...n}),e.jsx(x.Box,{direction:"column",ref:o,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:r?e.jsx(So,{...r,scrollParentRef:o,frozenCount:r!=null&&r.enableFreezeColumns?i:0,onFrozenCountChange:r!=null&&r.enableFreezeColumns?l:void 0}):null}),f&&e.jsx(wo,{pagination:r==null?void 0:r.pagination,pageKey:r==null?void 0:r.pageKey,perPageKey:r==null?void 0:r.perPageKey,defaultPerPage:r==null?void 0:r.defaultPerPage,showPagination:r==null?void 0:r.showPagination,totalData:s==null?void 0:s.totalData})]})};function Ti(t){return d.memo(t)}const Ii=Ti(Li),On=200,vr="1px solid var(--sa-border-subtle, #0b120e24)",Oi=({sortDir:t,frozen:r})=>t==="asc"?e.jsx(E.Icon,{name:"ChevronSmallUp"}):t==="desc"?e.jsx(E.Icon,{name:"ChevronSmallDown"}):r?e.jsx(E.Icon,{name:"LockOn",size:"xs"}):e.jsx(E.Icon,{name:"Filter",size:"xs"}),zt=({icon:t,label:r,active:n,danger:s,onClick:o})=>{const i=s?"var(--sa-text-error, #a4133c)":"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:n?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:i,textAlign:"left"},onMouseEnter:l=>{n||(l.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:l=>{l.currentTarget.style.background=n?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(E.Icon,{name:t,size:"sm",style:{color:i,flexShrink:0}}),e.jsx(D.Text,{as:"span",style:{color:i},children:r})]})},ko=({active:t,canSort:r,canHide:n,sortDir:s,frozen:o,onSort:i,onClearSort:l,onToggleFreeze:c,onHide:a})=>{const[u,f]=d.useState(!1),g=d.useRef(null),m=d.useRef(null),[y,k]=d.useState({top:0,left:0});d.useEffect(()=>{if(u&&g.current){const M=g.current.getBoundingClientRect(),B=M.left+On>window.innerWidth;k({top:M.bottom+6,...B?{right:window.innerWidth-M.right}:{left:M.left}})}},[u]),d.useEffect(()=>{if(!u)return;const M=B=>{m.current&&!m.current.contains(B.target)&&g.current&&!g.current.contains(B.target)&&f(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[u]);const b=M=>{M(),f(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:g,type:"button",className:"sa-tl-menu-trigger","data-active":t||u?"true":"false",onClick:M=>{M.stopPropagation(),f(B=>!B)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:vr,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(Oi,{sortDir:s,frozen:o})}),u&&e.jsxs(x.Box,{ref:m,onClick:M=>M.stopPropagation(),style:{position:"fixed",top:`${y.top}px`,...y.left!==void 0?{left:`${y.left}px`}:{right:`${y.right}px`},minWidth:On,backgroundColor:"var(--sa-background-primary, #ffffff)",border:vr,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-xl, 0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(zt,{icon:"ChevronUp",label:"Ascending",active:s==="asc",onClick:()=>b(()=>s==="asc"?l():i("asc"))}),e.jsx(zt,{icon:"ChevronDown",label:"Descending",active:s==="desc",onClick:()=>b(()=>s==="desc"?l():i("desc"))}),e.jsx("div",{style:{borderTop:vr,margin:"4px 0"}})]}),e.jsx(zt,{icon:"Pin1",label:o?"Unfreeze":"Freeze",active:o,onClick:()=>b(c)}),n&&e.jsx(zt,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>b(a)})]})]})},St="1px solid var(--sa-border-subtle, #0b120e24)",Ri="var(--sa-text-subtle, #8c8f97)",gt="var(--sa-background-neutral, #f0f1f2)",Rn="2px 0 4px -2px var(--sa-border-subtle, #0b120e24)",kt=40,Cr="var(--sa-background-brand-subtlest)",Ht={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Wn="sa-table-layout-styles",Wi=()=>{if(typeof document>"u"||document.getElementById(Wn))return;const t=document.createElement("style");t.id=Wn,t.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,7 +54,7 @@
|
|
|
54
54
|
.sa-table-layout tfoot.sa-tl-sticky-foot > tr:first-child > th {
|
|
55
55
|
box-shadow: 0 -2px 4px -2px var(--sa-border-subtle, #0b120e24);
|
|
56
56
|
}
|
|
57
|
-
`,document.head.appendChild(t)},Bt=t=>t==="right"?"right":t==="center"?"center":"left",Ti=/^(#|rgb|hsl|var\()/,Vt=t=>t?Ti.test(t)?t:`var(--sa-background-${t})`:void 0,Oi=(t,r)=>{if(r)return t[r]},Ri=(t,r)=>t==null&&r==null?0:t==null?-1:r==null?1:typeof t=="number"&&typeof r=="number"?t-r:String(t).localeCompare(String(r)),Wi=({columns:t,data:r,getRowKey:n,rowBg:s,size:o="md",resizable:i=!1,layout:l="auto",widthStorageKey:c,columnState:a,onColumnStateChange:u,columnMenu:h=!1,sort:g,defaultSort:m,onSortChange:y,height:k,mobileLayout:b="cards",mobileBreakpoint:M="md",groupSeparator:B,summary:L,footer:C,stickyFooter:v=!1,emptyState:W,loading:O=!1,loadingRows:w=8,rowActions:R,selectable:T=!1,selectedKeys:J,defaultSelectedKeys:X,onSelectionChange:Z,isRowSelectable:P})=>{Ii();const ee=!we.useMediaQuery(M)&&b!=="scroll",N=!!(R!=null&&R.length),[z,V]=d.useState(null);d.useEffect(()=>{if(!z)return;const p=()=>V(null),j=setTimeout(()=>document.addEventListener("click",p),0);return()=>{clearTimeout(j),document.removeEventListener("click",p)}},[z]);const[ie,je]=d.useState(()=>new Set),Ie=a!==void 0,[xe,ve]=d.useState({}),De=a??xe,Te=p=>{u==null||u(p),Ie||ve(p)},Oe=g!==void 0,[Me,He]=d.useState(m??null),be=Oe?g??null:Me,Ae=!y,Ne=p=>{y==null||y(p),Oe||He(p)},{headerGroups:Ue,leafColumns:Ce,hasGroups:Ke}=d.useMemo(()=>{var se;const p=new Set(De.hidden??[]),j=(re,ge)=>re.key??(typeof re.accessor=="string"?re.accessor:`col-${ge}`),F=t.map((re,ge)=>{var Pe;if((Pe=re.children)!=null&&Pe.length){const wt=re.children.map((Xe,Dt)=>({col:Xe,key:j(Xe,`${ge}-${Dt}`)})).filter(Xe=>!p.has(Xe.key));return{col:re,key:re.key??`group-${ge}`,isGroup:!0,leaves:wt}}const pe={col:re,key:j(re,`${ge}`)};return{col:re,key:pe.key,isGroup:!1,leaves:p.has(pe.key)?[]:[pe]}}).filter(re=>re.leaves.length>0),_=F.some(re=>re.isGroup);let te=F.flatMap(re=>re.leaves);if(!_&&((se=De.order)!=null&&se.length)){const re=new Map(De.order.map((ge,pe)=>[ge,pe]));te=[...te].sort((ge,pe)=>(re.get(ge.key)??1/0)-(re.get(pe.key)??1/0))}return{headerGroups:F,leafColumns:te,hasGroups:_}},[t,De]),ht=d.useMemo(()=>new Map(Ce.map((p,j)=>[p.key,j])),[Ce]),A=!Ke&&Ce.some(p=>(p.col.headerColSpan??1)>1),K=Ce.map(p=>p.key).join("|"),G=(p,j)=>{const F=p.sortKey??(typeof p.accessor=="string"?p.accessor:void 0);return F?j[F]:void 0},le=p=>p.sortable??(!!p.sortKey||typeof p.accessor=="string"),oe=d.useMemo(()=>{if(!Ae||!be)return r;const p=Ce.find(F=>F.key===be.key);if(!p)return r;const j=be.direction==="asc"?1:-1;return[...r].sort((F,_)=>Ri(G(p.col,F),G(p.col,_))*j)},[r,Ae,be,Ce]),me=!Ke&&!A,Je=!!c&&me,[_e,Ve]=q.useColumnWidths(c??""),Se=Je?_e:void 0,qe=d.useRef(null),[de,et]=d.useState();d.useLayoutEffect(()=>{et(void 0)},[K]),d.useLayoutEffect(()=>{if(!me||de||!qe.current)return;const p=qe.current.querySelectorAll("th.sa-tl-leaf");et(Array.from(p).map(j=>j.offsetWidth))},[de,me]);const[tt,ot]=d.useState(),[dt,lt]=d.useState(0);d.useLayoutEffect(()=>{if(!Ke||!qe.current)return;const p=qe.current.querySelector(":scope > tr");p&<(p.offsetHeight)},[Ke,K]);const S=(p,j)=>{if((Se==null?void 0:Se[j])!=null)return Se[j];if(p.width!=null)return p.width;if((de==null?void 0:de[j])!=null)return de[j]},Q=(p,j)=>typeof p.width=="number"?p.width:de==null?void 0:de[j],U=De.frozenKey&&!Ke&&!A?Ce.findIndex(p=>p.key===De.frozenKey):-1,he=p=>p<=U,Fe=T?kt:0,Ze=p=>{const j=tt??de;if(!j)return Fe;let F=Fe;for(let _=0;_<p;_++)F+=j[_]??0;return F};d.useLayoutEffect(()=>{const p=qe.current;if(!p||U<0){ot(void 0);return}let j=0;const F=()=>{j=0;const te=p.querySelectorAll("th.sa-tl-leaf"),se=Array.from(te).map(re=>re.getBoundingClientRect().width);ot(re=>re&&re.length===se.length&&re.every((ge,pe)=>Math.abs(ge-se[pe])<.5)?re:se)},_=new ResizeObserver(()=>{j||(j=requestAnimationFrame(F))});return _.observe(p),p.querySelectorAll("th.sa-tl-leaf").forEach(te=>_.observe(te)),F(),()=>{j&&cancelAnimationFrame(j),_.disconnect()}},[K,U,T,de,Se]);const ye=d.useRef(null),[fe,Ye]=d.useState("100vh");d.useLayoutEffect(()=>{if(k!==void 0)return;const p=()=>{if(ye.current){const j=ye.current.getBoundingClientRect().top;Ye(`calc(100vh - ${j}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[k]);const ke=(p,j)=>n?n(p,j):j,ft=J!==void 0,[_r,To]=d.useState(()=>new Set(X??[])),st=d.useMemo(()=>ft?new Set(J):_r,[ft,J,_r]);d.useEffect(()=>{T&&!n&&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).")},[T,!n]);const qr=p=>{if(ft||To(p),Z){const j=oe.filter((F,_)=>p.has(ke(F,_)));Z(Array.from(p),j)}},nr=(p,j)=>T&&(P?P(p,j):!0),or=p=>{const j=new Set(st);j.has(p)?j.delete(p):j.add(p),qr(j)},mt=d.useMemo(()=>T?oe.map((p,j)=>({row:p,i:j,key:ke(p,j)})).filter(({row:p,i:j})=>P?P(p,j):!0).map(({key:p})=>p):[],[T,oe,P,n]),Zr=mt.filter(p=>st.has(p)),sr=mt.length>0&&Zr.length===mt.length,Gr=Zr.length>0&&!sr,Oo=()=>{const p=new Set(st);sr?mt.forEach(j=>p.delete(j)):mt.forEach(j=>p.add(j)),qr(p)},ir=(p,j,F)=>p.render?p.render(j,F,oe):Oi(j,p.accessor),lr=Ce.length+(T?1:0)+(N?1:0),Qr=["80%","55%","70%","45%","90%","60%"],Ro=(p,j)=>Qr[(p*7+j*3)%Qr.length],Wo=(p,j)=>e.jsx(Ge.Skeleton,{height:14,width:Ro(p,j),borderRadius:"rounded-sm"}),Ao=Array.from({length:w},(p,j)=>e.jsxs(q.Tr,{children:[T&&e.jsx(q.Td,{style:{width:kt,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(Ge.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),Ce.map(({col:F,key:_},te)=>e.jsx(q.Td,{style:{textAlign:Bt(F.align)},children:Wo(j,te)},`sa-tl-sk-${j}-${_}`)),N&&e.jsx(q.Td,{style:{width:1,padding:0,border:"none"}})]},`sa-tl-sk-${j}`)),zo=(p,j)=>{j||Te({...De,hidden:[...De.hidden??[],p]})},Ho=p=>Te({...De,frozenKey:De.frozenKey===p?void 0:p}),Tt=p=>(R??[]).filter(j=>{var F;return!((F=j.hidden)!=null&&F.call(j,p))}),Ur={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)"},Ot=(p,j,F,_)=>{var Pe;const te=(Pe=p.disabled)==null?void 0:Pe.call(p,j),se=(_==null?void 0:_.showLabel)??p.showLabel,re=(_==null?void 0:_.size)??"xs",ge=e.jsx(H.Button,{size:re,variant:p.variant??"tertiary",tone:p.tone??"neutral",disabled:te,onClick:()=>p.onClick(j,F),iconLeft:p.icon?e.jsx(E.Icon,{name:p.icon,size:"sm"}):void 0,children:se&&p.label}),pe=p.tooltip;return pe?e.jsx(Be.Tooltip,{label:pe,position:"top-end",children:ge}):ge},Vo=(p,j)=>{const F=Tt(p);if(!F.length)return null;if(F.length>5){const te=ke(p,j),se=(z==null?void 0:z.rowKey)===te;return e.jsx("div",{className:"sa-tl-row-actions",style:Ur,onClick:re=>re.stopPropagation(),children:e.jsx(Be.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(H.Button,{size:"xs",variant:"tertiary",onClick:re=>{const ge=re.currentTarget.getBoundingClientRect();V(se?null:{rowKey:te,top:ge.bottom+4,right:window.innerWidth-ge.right})},children:e.jsx(E.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:Ur,children:F.map(te=>e.jsx(d.Fragment,{children:Ot(te,p,j)},te.key))})},Po=(p,j)=>{const F=Tt(p);return F.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:St},children:F.map(_=>e.jsx(d.Fragment,{children:Ot(_,p,j,{showLabel:!0,size:"sm"})},_.key))}):null},No=(p,j)=>{const F=Tt(p);return F.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:F.map(_=>e.jsx(d.Fragment,{children:Ot(_,p,j,{showLabel:!1})},_.key))}):null},cr=(p,j)=>{const{col:F,key:_}=p,te=ht.get(_)??0,se=he(te),re=se&&te===U,ge=(be==null?void 0:be.key)===_?be.direction:null,pe=h&&!F.disableMenu?e.jsx(So,{active:!!ge||se,canSort:le(F),canHide:!F.locked,sortDir:ge,frozen:se,onSort:Dt=>Ne({key:_,direction:Dt}),onClearSort:()=>Ne(null),onToggleFreeze:()=>Ho(_),onHide:()=>zo(_,F.locked)}):null,Pe=F.align==="right",wt=F.align==="right"?"flex-end":F.align==="center"?"center":"flex-start",Xe=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:wt,overflow:"hidden"},children:[F.icon&&e.jsx(E.Icon,{name:F.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:Ht,children:F.title})]});return e.jsx(q.Th,{className:`sa-tl-leaf${se?" sa-tl-frozen":""}`,rowSpan:j==null?void 0:j.rowSpan,colSpan:j==null?void 0:j.colSpan,minWidth:F.minWidth,resizable:me?F.resizable:!1,defaultWidth:Q(F,te),style:{textAlign:Bt(F.align),width:S(F,te),position:"sticky",top:(j==null?void 0:j.top)??0,left:se?Ze(te):void 0,zIndex:se?3:2,backgroundColor:gt,boxShadow:re?On:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:Pe?e.jsxs(e.Fragment,{children:[pe,Xe]}):e.jsxs(e.Fragment,{children:[Xe,pe]})})},`th-${_}`)},_o=()=>{const p=[];for(let j=0;j<Ce.length;){const F=Ce[j],_=F.col.headerColSpan??1,te=Math.max(1,Math.min(_,Ce.length-j));p.push(cr(F,te>1?{colSpan:te}:void 0)),j+=te}return p},Jr=p=>e.jsx(q.Th,{rowSpan:p==null?void 0:p.rowSpan,style:{width:kt,position:"sticky",top:0,left:0,zIndex:4,backgroundColor:gt,padding:0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:j=>j.stopPropagation(),children:e.jsx(rt.Checkbox,{size:"sm",variant:Gr?"indeterminate":"select",checked:sr||Gr,disabled:mt.length===0,onChange:Oo,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),qo=(p,j,F)=>{const _=ke(p,j);return e.jsx(q.Td,{className:"sa-tl-frozen",style:{width:kt,padding:0,position:"sticky",left:0,zIndex:2,...F?{"--sa-tl-bg":F}:{}},children:nr(p,j)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:te=>te.stopPropagation(),children:e.jsx(rt.Checkbox,{size:"sm",checked:st.has(_),onChange:()=>or(_),"aria-label":"Pilih baris"})})},`tl-select-${j}`)},ar=Ce.filter(p=>!p.col.hideOnMobile),dr=ar.find(p=>p.col.primary)??ar[0],Zo=ar.filter(p=>p!==dr),Go=p=>je(j=>{const F=new Set(j);return F.has(p)?F.delete(p):F.add(p),F}),Yr=(p,j)=>Zo.map(({col:F,key:_})=>{const te=ir(F,p,j),se=typeof te=="string"||typeof te=="number"?e.jsx(D.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:te}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:te});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof F.title=="string"?e.jsx(D.Text,{color:"subtle",fontWeight:"medium",style:{color:Li,flexShrink:0},children:F.title}):e.jsx("div",{style:{flexShrink:0},children:F.title}),se]},_)}),ur=(p,j)=>{const F=dr?ir(dr.col,p,j):null;return typeof F=="string"||typeof F=="number"?e.jsx(D.Text,{as:"span",style:Ht,children:F}):e.jsx("span",{style:Ht,children:F})},Qo=e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:w},(p,j)=>e.jsxs(f.Box,{style:{border:St,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Ge.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(Ge.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(Ge.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${j}`))}),Xr=e.jsx(f.Box,{fullWidth:!0,style:{minHeight:(W==null?void 0:W.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:W==null?void 0:W.content}),Uo=O?Qo:oe.length===0?Xr:b==="expand"?e.jsx(f.Box,{style:{display:"flex",flexDirection:"column"},children:oe.map((p,j)=>{const F=ke(p,j),_=ie.has(F),se=T&&st.has(F)?vr:Vt(s==null?void 0:s(p,j));return e.jsxs("div",{style:{borderBottom:St,backgroundColor:se},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[nr(p,j)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(rt.Checkbox,{size:"sm",checked:st.has(F),onChange:()=>or(F),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>Go(F),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:[ur(p,j),e.jsx(E.Icon,{name:_?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),N&&No(p,j)]}),_&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:Yr(p,j)})]},F)})}):e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:oe.map((p,j)=>{const F=ke(p,j),_=T&&st.has(F);return e.jsxs(f.Box,{style:{border:St,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:_?vr:Vt(s==null?void 0:s(p,j))},children:[nr(p,j)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(rt.Checkbox,{size:"sm",checked:st.has(F),onChange:()=>or(F),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:ur(p,j)})]}):ur(p,j),Yr(p,j),N&&Po(p,j)]},F)})}),Jo=i&&me&&de!==void 0,$r=l==="fixed"&&!i&&(me?de!==void 0:!0),Yo=$r&&!me,Rt=C&&C.length>0?C.map((p,j)=>e.jsx(q.Tr,{children:p.cells.map((F,_)=>e.jsx(q.Td,{colSpan:F.colSpan,rowSpan:F.rowSpan,style:{textAlign:Bt(F.align)},children:F.content},`tl-foot-${j}-${_}`))},`tl-foot-${j}`)):null,Xo=e.jsxs(q.Table,{className:"sa-table-layout",fullWidth:!0,size:o,resizable:Jo,style:$r?{tableLayout:"fixed"}:void 0,onWidthsChange:Je?Ve:void 0,children:[Yo&&e.jsxs("colgroup",{children:[T&&e.jsx("col",{style:{width:kt}}),Ce.map(({col:p,key:j},F)=>e.jsx("col",{style:{width:S(p,F)}},`col-${j}`)),N&&e.jsx("col",{style:{width:1}})]}),e.jsx(q.Thead,{ref:qe,children:Ke?e.jsxs(e.Fragment,{children:[e.jsxs(q.Tr,{children:[T&&Jr({rowSpan:2}),Ue.map(p=>p.isGroup?e.jsx(q.Th,{colSpan:p.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:gt},children:e.jsx("span",{style:Ht,children:p.col.title})},`grp-${p.key}`):cr(p.leaves[0],{rowSpan:2})),N&&e.jsx(q.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:gt}})]}),e.jsx(q.Tr,{children:Ue.flatMap(p=>p.isGroup?p.leaves.map(j=>cr(j,{top:dt})):[])})]}):e.jsxs(q.Tr,{children:[T&&Jr(),_o(),N&&e.jsx(q.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:gt}})]})}),e.jsx(q.Tbody,{children:O?Ao:oe.length===0?e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:lr,children:Xr})}):e.jsxs(e.Fragment,{children:[oe.map((p,j)=>{const F=B==null?void 0:B(p,j,j>0?oe[j-1]:void 0),te=T&&st.has(ke(p,j))?vr:Vt(s==null?void 0:s(p,j));return e.jsxs(d.Fragment,{children:[F!=null&&F!==!1&&e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:lr,style:{backgroundColor:gt},children:F})}),e.jsxs(q.Tr,{children:[T&&qo(p,j,te),Ce.map(({col:se,key:re},ge)=>{var en;const pe=(en=se.cellProps)==null?void 0:en.call(se,p,j,oe);if(pe!=null&&pe.hidden)return null;const Pe=he(ge),wt=Pe&&ge===U,Xe=ir(se,p,j),Dt=typeof se.bg=="function"?se.bg(p,j,oe):se.bg,Kr=Vt(Dt)??te;return e.jsx(q.Td,{className:Pe?"sa-tl-frozen":void 0,colSpan:pe==null?void 0:pe.colSpan,rowSpan:pe==null?void 0:pe.rowSpan,style:{textAlign:Bt(se.align),width:S(se,ge),minWidth:se.minWidth,position:Pe?"sticky":void 0,left:Pe?Ze(ge):void 0,zIndex:Pe?1:void 0,boxShadow:wt?On:void 0,...Kr?{"--sa-tl-bg":Kr}:{}},children:typeof Xe=="string"?e.jsx(D.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Bt(se.align)},children:Xe}):Xe},`tl-cell-${j}-${re}`)}),N&&e.jsx(q.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:Vo(p,j)})]})]},ke(p,j))}),L!=null&&e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:lr,children:L})})]})}),Rt&&e.jsx(q.Tfoot,{className:v?"sa-tl-sticky-foot":void 0,children:Rt})]}),xr=z?oe.findIndex((p,j)=>ke(p,j)===z.rowKey):-1,hr=xr>=0?oe[xr]:null;return e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{ref:ye,fullWidth:!0,style:{overflow:"auto",height:k??fe},children:ee?e.jsxs(e.Fragment,{children:[Uo,Rt&&!O&&oe.length>0&&e.jsx(f.Box,{style:{borderTop:St},children:e.jsx(q.Table,{fullWidth:!0,size:o,className:"sa-table-layout",children:e.jsx(q.Tbody,{children:Rt})})})]}):Xo}),z&&hr&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:z.top,right:z.right},onClick:p=>p.stopPropagation(),children:Tt(hr).map(p=>e.jsx("div",{style:{padding:"2px 4px"},children:Ot(p,hr,xr,{showLabel:!0,size:"sm"})},p.key))})]})},Cr=t=>t==="asc"||t==="desc",Ai=(t={})=>{const{sortKeyParam:r="sortBy",sortOrderParam:n="sortOrder",pageKey:s="page",defaultSort:o=null,paramKeys:i,scopeId:l,storage:c=Nr}=t,{searchParams:a,setSearchParams:u,searchQueries:h}=We(),g=a.toString(),m=l?Ct.tableSort(l):void 0,y=d.useRef(!1);d.useEffect(()=>{if(y.current||(y.current=!0,!m)||a.has(r)||a.has(n))return;const C=c.get(m);!(C!=null&&C.key)||!Cr(C.direction)||u({...Object.fromEntries(a.entries()),[r]:C.key,[n]:C.direction})},[]);const k=d.useMemo(()=>{const C=a.get(r),v=a.get(n);return C&&Cr(v)?{key:C,direction:v}:o},[g,r,n,o]);d.useEffect(()=>{if(!m)return;const C=a.get(r),v=a.get(n);C&&Cr(v)?c.set(m,{key:C,direction:v}):c.remove(m)},[g,m,r,n,c]);const b=(i==null?void 0:i.sortBy)??"sortBy",M=(i==null?void 0:i.sortOrder)??"sortOrder",B=d.useMemo(()=>k?{[b]:k.key,[M]:k.direction}:{},[k,b,M]),L=d.useCallback(C=>{const v={...h};C?(v[r]=C.key,v[n]=C.direction):(delete v[r],delete v[n]),delete v[s],u(v)},[h,r,n,s,u]);return{sort:k,setSort:L,params:B}},$t=({of:t,render:r})=>d.Children.toArray(t==null?void 0:t.map((n,s,o)=>r(n,s,o))),ae=({condition:t,fallback:r,children:n,loading:s,isLoading:o})=>e.jsx(e.Fragment,{children:o?s:t?n:r}),ue=t=>e.jsx(D.Text,{...t,fontFamily:"Poppins",fontSize:t.fontSize||"md",fontWeight:t.fontWeight||"medium",color:t.color||"gray-700",children:t.children}),it=t=>e.jsx(D.Text,{color:"red-600",fontSize:"sm",children:t.message}),zi=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,u;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ae,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(ue,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:o.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Be.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(u=o.tooltip)==null?void 0:u.arrowPosition,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(at.Input,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default",fullWidth:!0}),!i&&o.errorMessage&&e.jsx(it,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},Hi=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,u;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(ae,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(ue,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:o.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Be.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(u=o.tooltip)==null?void 0:u.arrowPosition,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(f.Box,{direction:"column",style:{width:o.inputProps.fullWidth?"100%":r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(jt.Dropdown,{size:t,...o.inputProps,error:!!o.errorMessage})}),!i&&o.errorMessage&&e.jsx(it,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},Vi=(t,r)=>typeof t=="string"&&t||r==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",Pi=t=>{var c;const[r,n]=d.useState(!1),s=a=>{a.preventDefault(),a.stopPropagation()},o=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&t.handleOnFileChange(a.dataTransfer.files.item(0))},i=a=>{a.preventDefault(),n(!0)},l=a=>{a.preventDefault(),n(!1)};return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:t.handleOnClick,onDragOver:s,onDrop:o,onDragEnter:i,onDragLeave:l,paddingBlock:"md",borderRadius:"rounded-md",style:{border:r?"1px solid var(--sa-border-info)":`1px solid ${Vi(t.errorMessage,t.status)}`},children:[e.jsx(E.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(ce.Flex,{direction:"column",gap:"xs",children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",children:[e.jsx(D.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(D.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",children:(c=t.fileSupports)==null?void 0:c.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function Ni(t){return t.split(" ").map(r=>r[0]).join("").slice(0,2).toUpperCase()}const ko=t=>{const r={day:"2-digit",month:"short",year:"numeric"};return t.toLocaleDateString("id-ID",r)},_i=t=>{const r={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},n=t.split(" ");if(n.length!==3)return null;const s=parseInt(n[0],10),o=r[n[1]],i=parseInt(n[2],10);return isNaN(s)||isNaN(o)||isNaN(i)?null:new Date(i,o,s)};function qi(t,r=!0){if(!t)return"Rp 0";const n=typeof t=="number"?t.toString():t;if(isNaN(Number(n)))return"Rp 0";const s=n.split("."),o=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),i=s.length===2?o+"."+s[1]:o;return r?"Rp"+i:i}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")};String.prototype.toNumber=function(){return Number(this)};const Zi=t=>{const r=t.split(" ");let n=r[0].charAt(0);return r.length>1&&(n+=""+r[1].charAt(0)),n.toUpperCase()};function Gi(t){const r=typeof t=="string"?new Date(t):t;if(isNaN(r.getTime()))throw new Error("Invalid date format");const n=r.getFullYear(),s=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${n}-${s}-${o}`}const Qi="sa-admin",$e=t=>`var(--${Qi}-${t})`,Ui={base:{borderColor:$e("base-border-color"),textColor:$e("base-text-color"),iconColor:$e("base-icon-color"),placeholderColor:$e("base-placeholder-color")},document:{bgColor:$e("document-bg-color")},sidebar:{bgColor:$e("sidebar-bg-color"),borderColor:$e("sidebar-border-color"),maxWidth:$e("sidebar-max-width"),width:$e("sidebar-width"),collapseWidth:$e("sidebar-collapse-width"),collapseV2Width:$e("sidebar-v2-collapse-width")}},Ji=24*60*60*1e3,Yi=t=>{const r="14px poppins",s=document.createElement("canvas").getContext("2d");s.font=r;const o=s.measureText(t).width;return Number(Math.ceil(o))},Xi=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,$i=/--+/,Ki=/-$/;function el(t,r){return JSON.stringify(t)!==JSON.stringify(r)}function tl(t){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(t)}function rl(t){return/^[A-Za-z\s]+$/.test(t)}const nl=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&(t.key==="a"||t.key==="c"||t.key==="v")||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},ol=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},sl=t=>{const r=/^[0-9.]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},il=t=>Xi.test(t);function ll(t){return!($i.test(t)||Ki.test(t))}const cl=t=>{const r=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((t.ctrlKey||t.metaKey)&&["a","c","v","x"].includes(t.key.toLowerCase()))return;const n=t.currentTarget.value;/^[0-9]$/.test(t.key)||t.key==="."&&!n.includes(".")||t.key==="-"&&n.length===0&&!n.includes("-")||r.includes(t.key)||t.preventDefault()},al=t=>{const r=document.getElementById(t);if(r){const n=r.getBoundingClientRect(),s=window.scrollY+n.top-80;window.scrollTo({top:s,behavior:"smooth"})}};function dl(t){const r=t.toLowerCase();if(["kb","mb","gb"].find(i=>r.endsWith(i)))return t;const o=Number(t);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 ul(t){const r=t.split("/");return r[r.length-1]}const xl=t=>{var r,n;return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:t.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(ce.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(E.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(ce.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(D.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:t.defaultFile?ul(t.defaultFile.url):(r=t.fileSelected)==null?void 0:r.name}),t.defaultFile?(t.defaultFile.size||t.defaultFile.date)&&e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[t.defaultFile.size&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",children:t.defaultFile.size}),t.defaultFile.size&&t.defaultFile.date&&e.jsx(E.Icon,{name:"Dot",size:"xs"}),t.defaultFile.date&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:t.defaultFile.date})]}):e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",children:dl(((n=t.fileSelected)==null?void 0:n.size.toString())||"100000")}),e.jsx(E.Icon,{name:"Dot",size:"xs"}),e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:ko(new Date)})]})]})]}),e.jsx(H.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:s=>{s.stopPropagation(),t.handleOnDeleteFile()},iconLeft:e.jsx(E.Icon,{name:"Trash1"})})]})},Bo=({status:t="default",labelPosition:r="outside-top",...n})=>{var m;const s=d.useRef(null),o=()=>{if(n.defaultFile){window.open(n.defaultFile.url);return}s.current&&s.current.click()},i=we.useMediaQuery("md"),l=t==="error"||typeof n.errorMessage=="string"&&!!n.errorMessage,c=n.label?e.jsxs(ce.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(D.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:n.label}),n.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"}),n.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=n.description?e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.description}):null,u=e.jsxs(e.Fragment,{children:[n.helperText&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.helperText}),n.errorText&&t==="error"&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorText}),n.errorMessage&&!n.errorText&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorMessage})]}),h=e.jsx("input",{type:"file",style:{display:"none"},ref:s,onChange:y=>{var k;return n.handleOnChangeFile(((k=y.target.files)==null?void 0:k.item(0))||null)},accept:(m=n.fileSupportOption)==null?void 0:m.map(y=>"."+(y==null?void 0:y.toLowerCase())).join(", ")}),g=e.jsxs(f.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...n.containerProps,children:[h,(n.fileSelected||n.defaultFile)&&e.jsx(xl,{fileSelected:n.fileSelected,defaultFile:n.defaultFile,handleOnDeleteFile:n.handleOnDeleteFile,handleOnClickFile:o}),!n.fileSelected&&!n.defaultFile&&e.jsx(Pi,{fileSupports:n.fileSupportOption,isDesktop:i,errorMessage:l?n.errorText||n.errorMessage||" ":void 0,status:l?"error":"default",handleOnClick:o,handleOnFileChange:n.handleOnChangeFile})]});return r==="outside-left"?e.jsxs(ce.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(ce.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[c,a]}),e.jsxs(ce.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[g,u]})]}):e.jsxs(ce.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[c,a,g,u]})},hl=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,u;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ae,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(ue,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:o.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Be.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(u=o.tooltip)==null?void 0:u.arrowPosition,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ce.Flex,{direction:"column",gap:"xs",children:[e.jsx(Bo,{...o.inputProps,status:o.errorMessage?"error":"default"}),!i&&o.errorMessage&&e.jsx(it,{message:o.errorMessage})]})]})},fl=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,required:o=!1,...i})=>{var a,u,h,g;const l=i.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"||r==="horizontal-inline"?"spacing-96":"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",...i.containerProps,children:[i.title&&e.jsx(ae,{condition:!!o,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(ue,{children:i.title}),e.jsx(Qe.Body3,{props:{color:"gray-500"},children:i.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:i.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((a=i.tooltip)!=null&&a.label),children:e.jsx(Be.Tooltip,{label:(u=i.tooltip)==null?void 0:u.label,arrowPosition:(h=i.tooltip)==null?void 0:h.arrowPosition,...i.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!i.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:i.description})})]})}),e.jsx(f.Box,{gap:r==="horizontal-inline"?"xl":"md",direction:r==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx($t,{of:(g=i.checkBoxesList)==null?void 0:g.map(m=>({...m,isChecked:i.checkBoxesAreChecked.includes(m.id)})),render:m=>m.renderBadge?e.jsxs(f.Box,{direction:"row",justify:"space-between",gap:"lg",...i.badgeContainerProps,children:[e.jsx(rt.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:y=>i.onChecked(y.target.value,m),label:m.name,description:m.description}),m.renderBadge]}):e.jsx(rt.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:y=>i.onChecked(y.target.value,m),label:m.name,description:m.description})})}),!l&&i.errorMessage&&e.jsx(it,{message:i.errorMessage})]})},ml=({position:t="vertical",size:r="md",fullWidth:n=!1,...s})=>{var i;const o=t==="horizontal-inline"||t==="horizontal-block"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal-inline"||t==="horizontal-block"?"spacing-96":"sm",direction:t==="horizontal-inline"||t==="horizontal-block"?"row":"column",children:[e.jsx(ae,{condition:!!s.description||!!s.title,children:e.jsxs(f.Box,{direction:"column",customMaxWidth:o,fullWidth:n,children:[s.title&&e.jsx(ue,{children:s.title}),e.jsx(ae,{condition:!!s.description,children:e.jsx(D.Text,{color:"gray-500",children:s.description})})]})}),e.jsx(f.Box,{gap:"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx($t,{of:(i=s.radioList)==null?void 0:i.map(l=>({...l,isChecked:s.radioIsChecked===l.id})),render:({value:l,id:c,isChecked:a,subInput:u,label:h,description:g})=>e.jsxs(f.Box,{direction:"column",gap:"xs",customMaxWidth:o,children:[e.jsx(kr.Radio,{id:`${c.toString()}-${l}`,name:s.groupName||h,label:h,value:l,checked:a,onChange:m=>s.onChecked({id:c,label:m.target.name,value:m.target.value}),disabled:s.disableAll},c),g&&e.jsx(D.Text,{color:"gray-500",style:{marginLeft:28},children:g}),u]})})}),s.errorMessage&&e.jsx(it,{message:s.errorMessage})]})},gl=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,u;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ae,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(ue,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:o.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Be.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(u=o.tooltip)==null?void 0:u.arrowPosition,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ce.Flex,{direction:"column",gap:"xs",children:[e.jsx(Sr.Textarea,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default"}),!i&&o.errorMessage&&e.jsx(it,{message:o.errorMessage})]})]})},pl=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",required:s=!1,fullWidth:o=!1,...i})=>{var c,a,u;const l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...i.containerProps,children:[i.title&&e.jsx(ae,{condition:s,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[e.jsx(ue,{children:i.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:i.titleDescription})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:i.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((c=i.tooltip)!=null&&c.label),children:e.jsx(Be.Tooltip,{label:(a=i.tooltip)==null?void 0:a.label,arrowPosition:(u=i.tooltip)==null?void 0:u.arrowPosition,...i.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!i.titleDescription,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:i.titleDescription})})]})}),e.jsx(vt.Toggle,{checked:i.checked,onChange:i.onChange,label:i.label,description:i.description}),i.errorMessage&&e.jsx(it,{message:i.errorMessage})]})},yl=({variant:t="primary",size:r="md",...n})=>{const s=yt.useColor(),o=l=>{var a,u,h,g,m,y;if(!l)return;const c=n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary"?"var(--sa-text-subtle, #8c8f97)":t==="secondary-danger"?(u=(a=s==null?void 0:s.computed)==null?void 0:a.red)==null?void 0:u[600]:t==="secondary-primary"?(g=(h=s==null?void 0:s.computed)==null?void 0:h.blue)==null?void 0:g[700]:(y=(m=s==null?void 0:s.computed)==null?void 0:m.gray)==null?void 0:y[50];return e.jsx(E.Icon,{name:l,size:r,style:{color:c}})},i=()=>{var c,a,u,h;if(t!=="secondary-danger"&&t!=="secondary-primary")return n.title;const l={color:n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary-danger"?(a=(c=s==null?void 0:s.computed)==null?void 0:c.red)==null?void 0:a[600]:(h=(u=s==null?void 0:s.computed)==null?void 0:u.blue)==null?void 0:h[700]};switch(r){case"xs":return e.jsx(Qe.Body2,{props:{style:l},children:n.title});case"sm":case"md":return e.jsx(Qe.SubH3,{props:{style:l},children:n.title});case"lg":return e.jsx(Qe.SubH2,{props:{style:l},children:n.title});default:return n.title}};return e.jsx(H.Button,{fullWidth:!0,disabled:n.disabled,primary:t==="primary",secondary:t==="secondary"||t==="secondary-danger"||t==="secondary-primary",success:t==="success",onClick:n.onClick,type:n.type,iconLeft:o(n.iconLeft),iconRight:o(n.iconRight),size:r,children:i()})},jl=t=>e.jsx(Qe.H5,{props:{...t},children:t.title}),bl=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,u;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(ae,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(ue,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:o.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Be.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(u=o.tooltip)==null?void 0:u.arrowPosition,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ce.Flex,{direction:"column",gap:"xs",children:[e.jsx(f.Box,{direction:"column",style:{width:r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(xt.StarasiaDate,{size:t,...o.inputProps,status:o.errorMessage?"error":void 0})}),!i&&o.errorMessage&&e.jsx(it,{message:o.errorMessage})]})]})};async function vl(t,r){const n=new Image;n.src=t,await new Promise((i,l)=>{n.onload=i,n.onerror=l});const s=document.createElement("canvas");s.width=r.width,s.height=r.height;const o=s.getContext("2d",{alpha:!0});if(!o)throw new Error("No 2D context");return o.drawImage(n,r.x,r.y,r.width,r.height,0,0,r.width,r.height),new Promise((i,l)=>{s.toBlob(c=>{if(!c)return l("Canvas is empty");const a=new File([c],"cropped.png",{type:"image/png"});i(a)},"image/png")})}const Wn={"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},Fo=d.forwardRef(({handleUpload:t,urlImage:r,isUploading:n,croppedImage:s,setCroppedImage:o,size:i="96",aspect:l="1:1",containerProps:c,maxFileSize:a=2,onError:u},h)=>{const g=we.useMediaQuery("md"),[m,y]=d.useState(!1),[k,b]=d.useState(null),[M,B]=d.useState(!1),[L,C]=d.useState({x:0,y:0}),[v,W]=d.useState(1),[O,w]=d.useState(null);d.useEffect(()=>{r===null&&o(null)},[r]);const R=d.useCallback((z,V)=>{w(V)},[]),T=z=>{var je;const V=(je=z.target.files)==null?void 0:je[0];if(!V)return;const ie=new FileReader;ie.onload=()=>{b(ie.result),B(!0)},ie.readAsDataURL(V)},J=async()=>{if(!(!k||!O))try{const z=await vl(k,O);if(a&&z.size>a*1024*1024){u==null||u(`Ukuran file maksimal ${a}MB`);return}t==null||t(z);const V=URL.createObjectURL(z);o(V,z),B(!1)}catch{u==null||u("Gagal memproses gambar")}},X=d.useRef(null),Z=()=>{X.current&&X.current.click()};d.useImperativeHandle(h,()=>({openFileDialog:()=>{var z;(z=X.current)==null||z.click()}}));const P=parseInt(i,10),$=Wn[l];let ee,N;return $>=1?(N=P,ee=P*$):(ee=P,N=P/$),e.jsxs(f.Box,{direction:"column",display:"flex",position:"relative",bg:(c==null?void 0:c.bg)||"gray-200",borderStyle:(c==null?void 0:c.borderStyle)||"border-none",borderColor:(c==null?void 0:c.borderColor)||"gray-200",borderWidth:(c==null?void 0:c.borderWidth)||"border-2",borderRadius:(c==null?void 0:c.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:c!=null&&c.fullWidth?"100%":`${ee}px`,height:c!=null&&c.fullWidth?"auto":`${N}px`,aspectRatio:$,flexShrink:0},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[s||r?e.jsx("img",{src:s||r||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(f.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(E.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(i)/2<40?Number(i)/2:40,height:Number(i)/2<40?Number(i)/2:40}})}),e.jsxs(f.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:m?1:0,transition:"opacity 0.3s ease-in-out"},onClick:Z,children:[e.jsx("input",{ref:X,type:"file",accept:"image/*",onChange:T,disabled:n,style:{display:"none"}}),e.jsxs(f.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(E.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(ae,{condition:i.toNumber()>80,children:e.jsx(D.Text,{color:"gray-50",fontSize:i.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),n&&e.jsx(f.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(f.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),M&&Ut.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:()=>B(!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:g?l==="1:1"?"min(90vw, 480px)":`min(90vw, ${ee*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:z=>z.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:k&&e.jsx($o,{image:k,crop:L,zoom:v,aspect:l?Wn[l]:void 0,onCropChange:C,onZoomChange:W,onCropComplete:R,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(H.Button,{size:"sm",secondary:!0,onClick:()=>B(!1),children:"Cancel"}),e.jsx(H.Button,{size:"sm",primary:!0,onClick:J,children:"Crop"})]})]})}),document.body)]})}),Cl=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,required:o=!1,...i})=>{var a,u,h;const l=i.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...i.containerProps,children:[i.title&&e.jsx(ae,{condition:!!o,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(ue,{children:i.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:i.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:i.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((a=i.tooltip)!=null&&a.label),children:e.jsx(Be.Tooltip,{label:(u=i.tooltip)==null?void 0:u.label,arrowPosition:(h=i.tooltip)==null?void 0:h.arrowPosition,...i.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!i.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:i.description})})]})}),e.jsxs(ce.Flex,{direction:"column",gap:"xs",children:[e.jsx(Fo,{...i.inputProps}),!l&&i.errorMessage&&e.jsx(it,{message:i.errorMessage})]})]})},wl=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var l,c,a;const i=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ae,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:s,children:[e.jsx(ue,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:o.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Be.Tooltip,{label:(c=o.tooltip)==null?void 0:c.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),o.inputProps.extended&&o.inputProps.extended]})},Dl=({items:t,id:r,handleOnUpdate:n,width:s,toggleShow:o=!0,disabled:i=!1})=>{var h;const[l,c]=d.useState([]);d.useEffect(()=>{t&&c([...t.map(g=>({id:g.id,isActive:g.isActive}))])},[t]);const a=(h=l.find(g=>g.id===r))==null?void 0:h.isActive,u=d.useCallback(()=>{c(g=>g.map(m=>m.id===r?{...m,isActive:!m.isActive}:m)),n&&n(!a)},[r,n,a]);return e.jsx(f.Box,{direction:"row",gap:"md",style:{width:s},children:o&&e.jsx(vt.Toggle,{disabled:i,checked:a,onChange:u,label:a?"Active":"Inactive"})})},Sl={InputText:zi,InputDropdown:Hi,InputSingleFile:hl,CheckBoxOptions:fl,RadioOptions:ml,InputTextArea:gl,ToggleForm:pl,ActionButton:yl,FormTitle:jl,InputDate:bl,InputImgFile:Cl,Custom:wl},Eo=({customBottom:t})=>{const[r,n]=d.useState(!1),s=()=>{window.scrollY>window.screenY?n(!0):n(!1)},o=()=>{window.scrollTo({top:0,behavior:"smooth"})};return d.useEffect(()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}),[]),e.jsx(f.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(f.Box,{direction:"column",position:"absolute",style:{bottom:t||"1.6rem",right:"2rem",transform:r?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(H.Button,{secondary:!0,size:"xs",onClick:o,type:"button",iconLeft:e.jsx(E.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},ze="sa-sidepanel-item",An="sa-sidepanel-item-styles",kl="inset 3.5px 0 0 0 var(--sa-border-focused, #1a4fa0)",Bl="inset -3.5px 0 0 0 var(--sa-border-focused, #1a4fa0)",Fl=`
|
|
57
|
+
`,document.head.appendChild(t)},Bt=t=>t==="right"?"right":t==="center"?"center":"left",Ai=/^(#|rgb|hsl|var\()/,Vt=t=>t?Ai.test(t)?t:`var(--sa-background-${t})`:void 0,zi=(t,r)=>{if(r)return t[r]},Hi=(t,r)=>t==null&&r==null?0:t==null?-1:r==null?1:typeof t=="number"&&typeof r=="number"?t-r:String(t).localeCompare(String(r)),Vi=({columns:t,data:r,getRowKey:n,rowBg:s,size:o="md",resizable:i=!1,layout:l="auto",widthStorageKey:c,columnState:a,onColumnStateChange:u,columnMenu:f=!1,sort:g,defaultSort:m,onSortChange:y,height:k,mobileLayout:b="cards",mobileBreakpoint:M="md",groupSeparator:B,summary:L,footer:C,stickyFooter:v=!1,emptyState:W,loading:O=!1,loadingRows:w=8,rowActions:R,selectable:I=!1,selectedKeys:J,defaultSelectedKeys:X,onSelectionChange:Z,isRowSelectable:P})=>{Wi();const ee=!we.useMediaQuery(M)&&b!=="scroll",N=!!(R!=null&&R.length),[z,V]=d.useState(null);d.useEffect(()=>{if(!z)return;const p=()=>V(null),j=setTimeout(()=>document.addEventListener("click",p),0);return()=>{clearTimeout(j),document.removeEventListener("click",p)}},[z]);const[le,je]=d.useState(()=>new Set),Te=a!==void 0,[xe,ve]=d.useState({}),De=a??xe,Ie=p=>{u==null||u(p),Te||ve(p)},Oe=g!==void 0,[Me,He]=d.useState(m??null),be=Oe?g??null:Me,Ae=!y,Ne=p=>{y==null||y(p),Oe||He(p)},{headerGroups:Ue,leafColumns:Ce,hasGroups:Ke}=d.useMemo(()=>{var se;const p=new Set(De.hidden??[]),j=(re,ge)=>re.key??(typeof re.accessor=="string"?re.accessor:`col-${ge}`),F=t.map((re,ge)=>{var Pe;if((Pe=re.children)!=null&&Pe.length){const wt=re.children.map((Xe,Dt)=>({col:Xe,key:j(Xe,`${ge}-${Dt}`)})).filter(Xe=>!p.has(Xe.key));return{col:re,key:re.key??`group-${ge}`,isGroup:!0,leaves:wt}}const pe={col:re,key:j(re,`${ge}`)};return{col:re,key:pe.key,isGroup:!1,leaves:p.has(pe.key)?[]:[pe]}}).filter(re=>re.leaves.length>0),_=F.some(re=>re.isGroup);let te=F.flatMap(re=>re.leaves);if(!_&&((se=De.order)!=null&&se.length)){const re=new Map(De.order.map((ge,pe)=>[ge,pe]));te=[...te].sort((ge,pe)=>(re.get(ge.key)??1/0)-(re.get(pe.key)??1/0))}return{headerGroups:F,leafColumns:te,hasGroups:_}},[t,De]),ht=d.useMemo(()=>new Map(Ce.map((p,j)=>[p.key,j])),[Ce]),A=!Ke&&Ce.some(p=>(p.col.headerColSpan??1)>1),K=Ce.map(p=>p.key).join("|"),G=(p,j)=>{const F=p.sortKey??(typeof p.accessor=="string"?p.accessor:void 0);return F?j[F]:void 0},ce=p=>p.sortable??(!!p.sortKey||typeof p.accessor=="string"),oe=d.useMemo(()=>{if(!Ae||!be)return r;const p=Ce.find(F=>F.key===be.key);if(!p)return r;const j=be.direction==="asc"?1:-1;return[...r].sort((F,_)=>Hi(G(p.col,F),G(p.col,_))*j)},[r,Ae,be,Ce]),me=!Ke&&!A,Je=!!c&&me,[_e,Ve]=q.useColumnWidths(c??""),Se=Je?_e:void 0,qe=d.useRef(null),[de,et]=d.useState();d.useLayoutEffect(()=>{et(void 0)},[K]),d.useLayoutEffect(()=>{if(!me||de||!qe.current)return;const p=qe.current.querySelectorAll("th.sa-tl-leaf");et(Array.from(p).map(j=>j.offsetWidth))},[de,me]);const[tt,ot]=d.useState(),[dt,lt]=d.useState(0);d.useLayoutEffect(()=>{if(!Ke||!qe.current)return;const p=qe.current.querySelector(":scope > tr");p&<(p.offsetHeight)},[Ke,K]);const S=(p,j)=>{if((Se==null?void 0:Se[j])!=null)return Se[j];if(p.width!=null)return p.width;if((de==null?void 0:de[j])!=null)return de[j]},Q=(p,j)=>typeof p.width=="number"?p.width:de==null?void 0:de[j],U=De.frozenKey&&!Ke&&!A?Ce.findIndex(p=>p.key===De.frozenKey):-1,he=p=>p<=U,Fe=I?kt:0,Ze=p=>{const j=tt??de;if(!j)return Fe;let F=Fe;for(let _=0;_<p;_++)F+=j[_]??0;return F};d.useLayoutEffect(()=>{const p=qe.current;if(!p||U<0){ot(void 0);return}let j=0;const F=()=>{j=0;const te=p.querySelectorAll("th.sa-tl-leaf"),se=Array.from(te).map(re=>re.getBoundingClientRect().width);ot(re=>re&&re.length===se.length&&re.every((ge,pe)=>Math.abs(ge-se[pe])<.5)?re:se)},_=new ResizeObserver(()=>{j||(j=requestAnimationFrame(F))});return _.observe(p),p.querySelectorAll("th.sa-tl-leaf").forEach(te=>_.observe(te)),F(),()=>{j&&cancelAnimationFrame(j),_.disconnect()}},[K,U,I,de,Se]);const ye=d.useRef(null),[fe,Ye]=d.useState("100vh");d.useLayoutEffect(()=>{if(k!==void 0)return;const p=()=>{if(ye.current){const j=ye.current.getBoundingClientRect().top;Ye(`calc(100vh - ${j}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[k]);const ke=(p,j)=>n?n(p,j):j,ft=J!==void 0,[Zr,Ao]=d.useState(()=>new Set(X??[])),st=d.useMemo(()=>ft?new Set(J):Zr,[ft,J,Zr]);d.useEffect(()=>{I&&!n&&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).")},[I,!n]);const Gr=p=>{if(ft||Ao(p),Z){const j=oe.filter((F,_)=>p.has(ke(F,_)));Z(Array.from(p),j)}},or=(p,j)=>I&&(P?P(p,j):!0),sr=p=>{const j=new Set(st);j.has(p)?j.delete(p):j.add(p),Gr(j)},mt=d.useMemo(()=>I?oe.map((p,j)=>({row:p,i:j,key:ke(p,j)})).filter(({row:p,i:j})=>P?P(p,j):!0).map(({key:p})=>p):[],[I,oe,P,n]),Qr=mt.filter(p=>st.has(p)),ir=mt.length>0&&Qr.length===mt.length,Ur=Qr.length>0&&!ir,zo=()=>{const p=new Set(st);ir?mt.forEach(j=>p.delete(j)):mt.forEach(j=>p.add(j)),Gr(p)},lr=(p,j,F)=>p.render?p.render(j,F,oe):zi(j,p.accessor),cr=Ce.length+(I?1:0)+(N?1:0),Jr=["80%","55%","70%","45%","90%","60%"],Ho=(p,j)=>Jr[(p*7+j*3)%Jr.length],Vo=(p,j)=>e.jsx(Ge.Skeleton,{height:14,width:Ho(p,j),borderRadius:"rounded-sm"}),Po=Array.from({length:w},(p,j)=>e.jsxs(q.Tr,{children:[I&&e.jsx(q.Td,{style:{width:kt,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(Ge.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),Ce.map(({col:F,key:_},te)=>e.jsx(q.Td,{style:{textAlign:Bt(F.align)},children:Vo(j,te)},`sa-tl-sk-${j}-${_}`)),N&&e.jsx(q.Td,{style:{width:1,padding:0,border:"none"}})]},`sa-tl-sk-${j}`)),No=(p,j)=>{j||Ie({...De,hidden:[...De.hidden??[],p]})},_o=p=>Ie({...De,frozenKey:De.frozenKey===p?void 0:p}),It=p=>(R??[]).filter(j=>{var F;return!((F=j.hidden)!=null&&F.call(j,p))}),Yr={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)"},Ot=(p,j,F,_)=>{var Pe;const te=(Pe=p.disabled)==null?void 0:Pe.call(p,j),se=(_==null?void 0:_.showLabel)??p.showLabel,re=(_==null?void 0:_.size)??"xs",ge=e.jsx(H.Button,{size:re,variant:p.variant??"tertiary",tone:p.tone??"neutral",disabled:te,onClick:()=>p.onClick(j,F),iconLeft:p.icon?e.jsx(E.Icon,{name:p.icon,size:"sm"}):void 0,children:se&&p.label}),pe=p.tooltip;return pe?e.jsx(Be.Tooltip,{label:pe,position:"top-end",children:ge}):ge},qo=(p,j)=>{const F=It(p);if(!F.length)return null;if(F.length>5){const te=ke(p,j),se=(z==null?void 0:z.rowKey)===te;return e.jsx("div",{className:"sa-tl-row-actions",style:Yr,onClick:re=>re.stopPropagation(),children:e.jsx(Be.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(H.Button,{size:"xs",variant:"tertiary",onClick:re=>{const ge=re.currentTarget.getBoundingClientRect();V(se?null:{rowKey:te,top:ge.bottom+4,right:window.innerWidth-ge.right})},children:e.jsx(E.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:Yr,children:F.map(te=>e.jsx(d.Fragment,{children:Ot(te,p,j)},te.key))})},Zo=(p,j)=>{const F=It(p);return F.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:St},children:F.map(_=>e.jsx(d.Fragment,{children:Ot(_,p,j,{showLabel:!0,size:"sm"})},_.key))}):null},Go=(p,j)=>{const F=It(p);return F.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:F.map(_=>e.jsx(d.Fragment,{children:Ot(_,p,j,{showLabel:!1})},_.key))}):null},ar=(p,j)=>{const{col:F,key:_}=p,te=ht.get(_)??0,se=he(te),re=se&&te===U,ge=(be==null?void 0:be.key)===_?be.direction:null,pe=f&&!F.disableMenu?e.jsx(ko,{active:!!ge||se,canSort:ce(F),canHide:!F.locked,sortDir:ge,frozen:se,onSort:Dt=>Ne({key:_,direction:Dt}),onClearSort:()=>Ne(null),onToggleFreeze:()=>_o(_),onHide:()=>No(_,F.locked)}):null,Pe=F.align==="right",wt=F.align==="right"?"flex-end":F.align==="center"?"center":"flex-start",Xe=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:wt,overflow:"hidden"},children:[F.icon&&e.jsx(E.Icon,{name:F.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:Ht,children:F.title})]});return e.jsx(q.Th,{className:`sa-tl-leaf${se?" sa-tl-frozen":""}`,rowSpan:j==null?void 0:j.rowSpan,colSpan:j==null?void 0:j.colSpan,minWidth:F.minWidth,resizable:me?F.resizable:!1,defaultWidth:Q(F,te),style:{textAlign:Bt(F.align),width:S(F,te),position:"sticky",top:(j==null?void 0:j.top)??0,left:se?Ze(te):void 0,zIndex:se?3:2,backgroundColor:gt,boxShadow:re?Rn:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:Pe?e.jsxs(e.Fragment,{children:[pe,Xe]}):e.jsxs(e.Fragment,{children:[Xe,pe]})})},`th-${_}`)},Qo=()=>{const p=[];for(let j=0;j<Ce.length;){const F=Ce[j],_=F.col.headerColSpan??1,te=Math.max(1,Math.min(_,Ce.length-j));p.push(ar(F,te>1?{colSpan:te}:void 0)),j+=te}return p},Xr=p=>e.jsx(q.Th,{rowSpan:p==null?void 0:p.rowSpan,style:{width:kt,position:"sticky",top:0,left:0,zIndex:4,backgroundColor:gt,padding:0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:j=>j.stopPropagation(),children:e.jsx(rt.Checkbox,{size:"sm",variant:Ur?"indeterminate":"select",checked:ir||Ur,disabled:mt.length===0,onChange:zo,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),Uo=(p,j,F)=>{const _=ke(p,j);return e.jsx(q.Td,{className:"sa-tl-frozen",style:{width:kt,padding:0,position:"sticky",left:0,zIndex:2,...F?{"--sa-tl-bg":F}:{}},children:or(p,j)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:te=>te.stopPropagation(),children:e.jsx(rt.Checkbox,{size:"sm",checked:st.has(_),onChange:()=>sr(_),"aria-label":"Pilih baris"})})},`tl-select-${j}`)},dr=Ce.filter(p=>!p.col.hideOnMobile),ur=dr.find(p=>p.col.primary)??dr[0],Jo=dr.filter(p=>p!==ur),Yo=p=>je(j=>{const F=new Set(j);return F.has(p)?F.delete(p):F.add(p),F}),$r=(p,j)=>Jo.map(({col:F,key:_})=>{const te=lr(F,p,j),se=typeof te=="string"||typeof te=="number"?e.jsx(D.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:te}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:te});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof F.title=="string"?e.jsx(D.Text,{color:"subtle",fontWeight:"medium",style:{color:Ri,flexShrink:0},children:F.title}):e.jsx("div",{style:{flexShrink:0},children:F.title}),se]},_)}),xr=(p,j)=>{const F=ur?lr(ur.col,p,j):null;return typeof F=="string"||typeof F=="number"?e.jsx(D.Text,{as:"span",style:Ht,children:F}):e.jsx("span",{style:Ht,children:F})},Xo=e.jsx(x.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:w},(p,j)=>e.jsxs(x.Box,{style:{border:St,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Ge.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(Ge.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(Ge.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${j}`))}),Kr=e.jsx(x.Box,{fullWidth:!0,style:{minHeight:(W==null?void 0:W.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:W==null?void 0:W.content}),$o=O?Xo:oe.length===0?Kr:b==="expand"?e.jsx(x.Box,{style:{display:"flex",flexDirection:"column"},children:oe.map((p,j)=>{const F=ke(p,j),_=le.has(F),se=I&&st.has(F)?Cr:Vt(s==null?void 0:s(p,j));return e.jsxs("div",{style:{borderBottom:St,backgroundColor:se},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[or(p,j)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(rt.Checkbox,{size:"sm",checked:st.has(F),onChange:()=>sr(F),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>Yo(F),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:[xr(p,j),e.jsx(E.Icon,{name:_?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),N&&Go(p,j)]}),_&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:$r(p,j)})]},F)})}):e.jsx(x.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:oe.map((p,j)=>{const F=ke(p,j),_=I&&st.has(F);return e.jsxs(x.Box,{style:{border:St,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:_?Cr:Vt(s==null?void 0:s(p,j))},children:[or(p,j)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(rt.Checkbox,{size:"sm",checked:st.has(F),onChange:()=>sr(F),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:xr(p,j)})]}):xr(p,j),$r(p,j),N&&Zo(p,j)]},F)})}),Ko=i&&me&&de!==void 0,en=l==="fixed"&&!i&&(me?de!==void 0:!0),es=en&&!me,Rt=C&&C.length>0?C.map((p,j)=>e.jsx(q.Tr,{children:p.cells.map((F,_)=>e.jsx(q.Td,{colSpan:F.colSpan,rowSpan:F.rowSpan,style:{textAlign:Bt(F.align)},children:F.content},`tl-foot-${j}-${_}`))},`tl-foot-${j}`)):null,ts=e.jsxs(q.Table,{className:"sa-table-layout",fullWidth:!0,size:o,resizable:Ko,style:en?{tableLayout:"fixed"}:void 0,onWidthsChange:Je?Ve:void 0,children:[es&&e.jsxs("colgroup",{children:[I&&e.jsx("col",{style:{width:kt}}),Ce.map(({col:p,key:j},F)=>e.jsx("col",{style:{width:S(p,F)}},`col-${j}`)),N&&e.jsx("col",{style:{width:1}})]}),e.jsx(q.Thead,{ref:qe,children:Ke?e.jsxs(e.Fragment,{children:[e.jsxs(q.Tr,{children:[I&&Xr({rowSpan:2}),Ue.map(p=>p.isGroup?e.jsx(q.Th,{colSpan:p.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:gt},children:e.jsx("span",{style:Ht,children:p.col.title})},`grp-${p.key}`):ar(p.leaves[0],{rowSpan:2})),N&&e.jsx(q.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:gt}})]}),e.jsx(q.Tr,{children:Ue.flatMap(p=>p.isGroup?p.leaves.map(j=>ar(j,{top:dt})):[])})]}):e.jsxs(q.Tr,{children:[I&&Xr(),Qo(),N&&e.jsx(q.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:gt}})]})}),e.jsx(q.Tbody,{children:O?Po:oe.length===0?e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:cr,children:Kr})}):e.jsxs(e.Fragment,{children:[oe.map((p,j)=>{const F=B==null?void 0:B(p,j,j>0?oe[j-1]:void 0),te=I&&st.has(ke(p,j))?Cr:Vt(s==null?void 0:s(p,j));return e.jsxs(d.Fragment,{children:[F!=null&&F!==!1&&e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:cr,style:{backgroundColor:gt},children:F})}),e.jsxs(q.Tr,{children:[I&&Uo(p,j,te),Ce.map(({col:se,key:re},ge)=>{var rn;const pe=(rn=se.cellProps)==null?void 0:rn.call(se,p,j,oe);if(pe!=null&&pe.hidden)return null;const Pe=he(ge),wt=Pe&&ge===U,Xe=lr(se,p,j),Dt=typeof se.bg=="function"?se.bg(p,j,oe):se.bg,tn=Vt(Dt)??te;return e.jsx(q.Td,{className:Pe?"sa-tl-frozen":void 0,colSpan:pe==null?void 0:pe.colSpan,rowSpan:pe==null?void 0:pe.rowSpan,style:{textAlign:Bt(se.align),width:S(se,ge),minWidth:se.minWidth,position:Pe?"sticky":void 0,left:Pe?Ze(ge):void 0,zIndex:Pe?1:void 0,boxShadow:wt?Rn:void 0,...tn?{"--sa-tl-bg":tn}:{}},children:typeof Xe=="string"?e.jsx(D.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Bt(se.align)},children:Xe}):Xe},`tl-cell-${j}-${re}`)}),N&&e.jsx(q.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:qo(p,j)})]})]},ke(p,j))}),L!=null&&e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:cr,children:L})})]})}),Rt&&e.jsx(q.Tfoot,{className:v?"sa-tl-sticky-foot":void 0,children:Rt})]}),hr=z?oe.findIndex((p,j)=>ke(p,j)===z.rowKey):-1,fr=hr>=0?oe[hr]:null;return e.jsxs(e.Fragment,{children:[e.jsx(x.Box,{ref:ye,fullWidth:!0,style:{overflow:"auto",height:k??fe},children:ee?e.jsxs(e.Fragment,{children:[$o,Rt&&!O&&oe.length>0&&e.jsx(x.Box,{style:{borderTop:St},children:e.jsx(q.Table,{fullWidth:!0,size:o,className:"sa-table-layout",children:e.jsx(q.Tbody,{children:Rt})})})]}):ts}),z&&fr&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:z.top,right:z.right},onClick:p=>p.stopPropagation(),children:It(fr).map(p=>e.jsx("div",{style:{padding:"2px 4px"},children:Ot(p,fr,hr,{showLabel:!0,size:"sm"})},p.key))})]})},wr=t=>t==="asc"||t==="desc",Pi=(t={})=>{const{sortKeyParam:r="sortBy",sortOrderParam:n="sortOrder",pageKey:s="page",defaultSort:o=null,paramKeys:i,scopeId:l,storage:c=qr}=t,{searchParams:a,setSearchParams:u,searchQueries:f}=We(),g=a.toString(),m=l?Ct.tableSort(l):void 0,y=d.useRef(!1);d.useEffect(()=>{if(y.current||(y.current=!0,!m)||a.has(r)||a.has(n))return;const C=c.get(m);!(C!=null&&C.key)||!wr(C.direction)||u({...Object.fromEntries(a.entries()),[r]:C.key,[n]:C.direction})},[]);const k=d.useMemo(()=>{const C=a.get(r),v=a.get(n);return C&&wr(v)?{key:C,direction:v}:o},[g,r,n,o]);d.useEffect(()=>{if(!m)return;const C=a.get(r),v=a.get(n);C&&wr(v)?c.set(m,{key:C,direction:v}):c.remove(m)},[g,m,r,n,c]);const b=(i==null?void 0:i.sortBy)??"sortBy",M=(i==null?void 0:i.sortOrder)??"sortOrder",B=d.useMemo(()=>k?{[b]:k.key,[M]:k.direction}:{},[k,b,M]),L=d.useCallback(C=>{const v={...f};C?(v[r]=C.key,v[n]=C.direction):(delete v[r],delete v[n]),delete v[s],u(v)},[f,r,n,s,u]);return{sort:k,setSort:L,params:B}},$t=({of:t,render:r})=>d.Children.toArray(t==null?void 0:t.map((n,s,o)=>r(n,s,o))),ae=({condition:t,fallback:r,children:n,loading:s,isLoading:o})=>e.jsx(e.Fragment,{children:o?s:t?n:r}),ue=t=>e.jsx(D.Text,{...t,fontFamily:"Poppins",fontSize:t.fontSize||"md",fontWeight:t.fontWeight||"medium",color:t.color||"gray-700",children:t.children}),it=t=>e.jsx(D.Text,{color:"red-600",fontSize:"sm",children:t.message}),Ni=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,u;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ae,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(ue,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:o.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Be.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(u=o.tooltip)==null?void 0:u.arrowPosition,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(x.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(at.Input,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default",fullWidth:!0}),!i&&o.errorMessage&&e.jsx(it,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},_i=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,u;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(ae,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(ue,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:o.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Be.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(u=o.tooltip)==null?void 0:u.arrowPosition,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(x.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(x.Box,{direction:"column",style:{width:o.inputProps.fullWidth?"100%":r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(jt.Dropdown,{size:t,...o.inputProps,error:!!o.errorMessage})}),!i&&o.errorMessage&&e.jsx(it,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},qi=(t,r)=>typeof t=="string"&&t||r==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",Zi=t=>{var c;const[r,n]=d.useState(!1),s=a=>{a.preventDefault(),a.stopPropagation()},o=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&t.handleOnFileChange(a.dataTransfer.files.item(0))},i=a=>{a.preventDefault(),n(!0)},l=a=>{a.preventDefault(),n(!1)};return e.jsxs(x.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:t.handleOnClick,onDragOver:s,onDrop:o,onDragEnter:i,onDragLeave:l,paddingBlock:"md",borderRadius:"rounded-md",style:{border:r?"1px solid var(--sa-border-info)":`1px solid ${qi(t.errorMessage,t.status)}`},children:[e.jsx(E.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(ie.Flex,{direction:"column",gap:"xs",children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",children:[e.jsx(D.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(D.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",children:(c=t.fileSupports)==null?void 0:c.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function Gi(t){return t.split(" ").map(r=>r[0]).join("").slice(0,2).toUpperCase()}const Bo=t=>{const r={day:"2-digit",month:"short",year:"numeric"};return t.toLocaleDateString("id-ID",r)},Qi=t=>{const r={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},n=t.split(" ");if(n.length!==3)return null;const s=parseInt(n[0],10),o=r[n[1]],i=parseInt(n[2],10);return isNaN(s)||isNaN(o)||isNaN(i)?null:new Date(i,o,s)};function Ui(t,r=!0){if(!t)return"Rp 0";const n=typeof t=="number"?t.toString():t;if(isNaN(Number(n)))return"Rp 0";const s=n.split("."),o=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),i=s.length===2?o+"."+s[1]:o;return r?"Rp"+i:i}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")};String.prototype.toNumber=function(){return Number(this)};const Ji=t=>{const r=t.split(" ");let n=r[0].charAt(0);return r.length>1&&(n+=""+r[1].charAt(0)),n.toUpperCase()};function Yi(t){const r=typeof t=="string"?new Date(t):t;if(isNaN(r.getTime()))throw new Error("Invalid date format");const n=r.getFullYear(),s=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${n}-${s}-${o}`}const Xi="sa-admin",$e=t=>`var(--${Xi}-${t})`,$i={base:{borderColor:$e("base-border-color"),textColor:$e("base-text-color"),iconColor:$e("base-icon-color"),placeholderColor:$e("base-placeholder-color")},document:{bgColor:$e("document-bg-color")},sidebar:{bgColor:$e("sidebar-bg-color"),borderColor:$e("sidebar-border-color"),maxWidth:$e("sidebar-max-width"),width:$e("sidebar-width"),collapseWidth:$e("sidebar-collapse-width"),collapseV2Width:$e("sidebar-v2-collapse-width")}},Ki=24*60*60*1e3,el=t=>{const r="14px poppins",s=document.createElement("canvas").getContext("2d");s.font=r;const o=s.measureText(t).width;return Number(Math.ceil(o))},tl=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,rl=/--+/,nl=/-$/;function ol(t,r){return JSON.stringify(t)!==JSON.stringify(r)}function sl(t){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(t)}function il(t){return/^[A-Za-z\s]+$/.test(t)}const ll=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&(t.key==="a"||t.key==="c"||t.key==="v")||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},cl=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},al=t=>{const r=/^[0-9.]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},dl=t=>tl.test(t);function ul(t){return!(rl.test(t)||nl.test(t))}const xl=t=>{const r=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((t.ctrlKey||t.metaKey)&&["a","c","v","x"].includes(t.key.toLowerCase()))return;const n=t.currentTarget.value;/^[0-9]$/.test(t.key)||t.key==="."&&!n.includes(".")||t.key==="-"&&n.length===0&&!n.includes("-")||r.includes(t.key)||t.preventDefault()},hl=t=>{const r=document.getElementById(t);if(r){const n=r.getBoundingClientRect(),s=window.scrollY+n.top-80;window.scrollTo({top:s,behavior:"smooth"})}};function fl(t){const r=t.toLowerCase();if(["kb","mb","gb"].find(i=>r.endsWith(i)))return t;const o=Number(t);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 ml(t){const r=t.split("/");return r[r.length-1]}const gl=t=>{var r,n;return e.jsxs(x.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:t.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(ie.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(E.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(ie.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(D.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:t.defaultFile?ml(t.defaultFile.url):(r=t.fileSelected)==null?void 0:r.name}),t.defaultFile?(t.defaultFile.size||t.defaultFile.date)&&e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[t.defaultFile.size&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",children:t.defaultFile.size}),t.defaultFile.size&&t.defaultFile.date&&e.jsx(E.Icon,{name:"Dot",size:"xs"}),t.defaultFile.date&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:t.defaultFile.date})]}):e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",children:fl(((n=t.fileSelected)==null?void 0:n.size.toString())||"100000")}),e.jsx(E.Icon,{name:"Dot",size:"xs"}),e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:Bo(new Date)})]})]})]}),e.jsx(H.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:s=>{s.stopPropagation(),t.handleOnDeleteFile()},iconLeft:e.jsx(E.Icon,{name:"Trash1"})})]})},Fo=({status:t="default",labelPosition:r="outside-top",...n})=>{var m;const s=d.useRef(null),o=()=>{if(n.defaultFile){window.open(n.defaultFile.url);return}s.current&&s.current.click()},i=we.useMediaQuery("md"),l=t==="error"||typeof n.errorMessage=="string"&&!!n.errorMessage,c=n.label?e.jsxs(ie.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(D.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:n.label}),n.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"}),n.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=n.description?e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.description}):null,u=e.jsxs(e.Fragment,{children:[n.helperText&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.helperText}),n.errorText&&t==="error"&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorText}),n.errorMessage&&!n.errorText&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorMessage})]}),f=e.jsx("input",{type:"file",style:{display:"none"},ref:s,onChange:y=>{var k;return n.handleOnChangeFile(((k=y.target.files)==null?void 0:k.item(0))||null)},accept:(m=n.fileSupportOption)==null?void 0:m.map(y=>"."+(y==null?void 0:y.toLowerCase())).join(", ")}),g=e.jsxs(x.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...n.containerProps,children:[f,(n.fileSelected||n.defaultFile)&&e.jsx(gl,{fileSelected:n.fileSelected,defaultFile:n.defaultFile,handleOnDeleteFile:n.handleOnDeleteFile,handleOnClickFile:o}),!n.fileSelected&&!n.defaultFile&&e.jsx(Zi,{fileSupports:n.fileSupportOption,isDesktop:i,errorMessage:l?n.errorText||n.errorMessage||" ":void 0,status:l?"error":"default",handleOnClick:o,handleOnFileChange:n.handleOnChangeFile})]});return r==="outside-left"?e.jsxs(ie.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(ie.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[c,a]}),e.jsxs(ie.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[g,u]})]}):e.jsxs(ie.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[c,a,g,u]})},pl=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,u;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ae,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(ue,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:o.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Be.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(u=o.tooltip)==null?void 0:u.arrowPosition,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ie.Flex,{direction:"column",gap:"xs",children:[e.jsx(Fo,{...o.inputProps,status:o.errorMessage?"error":"default"}),!i&&o.errorMessage&&e.jsx(it,{message:o.errorMessage})]})]})},yl=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,required:o=!1,...i})=>{var a,u,f,g;const l=i.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"||r==="horizontal-inline"?"spacing-96":"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",...i.containerProps,children:[i.title&&e.jsx(ae,{condition:!!o,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(ue,{children:i.title}),e.jsx(Qe.Body3,{props:{color:"gray-500"},children:i.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:i.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((a=i.tooltip)!=null&&a.label),children:e.jsx(Be.Tooltip,{label:(u=i.tooltip)==null?void 0:u.label,arrowPosition:(f=i.tooltip)==null?void 0:f.arrowPosition,...i.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!i.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:i.description})})]})}),e.jsx(x.Box,{gap:r==="horizontal-inline"?"xl":"md",direction:r==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx($t,{of:(g=i.checkBoxesList)==null?void 0:g.map(m=>({...m,isChecked:i.checkBoxesAreChecked.includes(m.id)})),render:m=>m.renderBadge?e.jsxs(x.Box,{direction:"row",justify:"space-between",gap:"lg",...i.badgeContainerProps,children:[e.jsx(rt.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:y=>i.onChecked(y.target.value,m),label:m.name,description:m.description}),m.renderBadge]}):e.jsx(rt.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:y=>i.onChecked(y.target.value,m),label:m.name,description:m.description})})}),!l&&i.errorMessage&&e.jsx(it,{message:i.errorMessage})]})},jl=({position:t="vertical",size:r="md",fullWidth:n=!1,...s})=>{var i;const o=t==="horizontal-inline"||t==="horizontal-block"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:t==="horizontal-inline"||t==="horizontal-block"?"spacing-96":"sm",direction:t==="horizontal-inline"||t==="horizontal-block"?"row":"column",children:[e.jsx(ae,{condition:!!s.description||!!s.title,children:e.jsxs(x.Box,{direction:"column",customMaxWidth:o,fullWidth:n,children:[s.title&&e.jsx(ue,{children:s.title}),e.jsx(ae,{condition:!!s.description,children:e.jsx(D.Text,{color:"gray-500",children:s.description})})]})}),e.jsx(x.Box,{gap:"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx($t,{of:(i=s.radioList)==null?void 0:i.map(l=>({...l,isChecked:s.radioIsChecked===l.id})),render:({value:l,id:c,isChecked:a,subInput:u,label:f,description:g})=>e.jsxs(x.Box,{direction:"column",gap:"xs",customMaxWidth:o,children:[e.jsx(Fr.Radio,{id:`${c.toString()}-${l}`,name:s.groupName||f,label:f,value:l,checked:a,onChange:m=>s.onChecked({id:c,label:m.target.name,value:m.target.value}),disabled:s.disableAll},c),g&&e.jsx(D.Text,{color:"gray-500",style:{marginLeft:28},children:g}),u]})})}),s.errorMessage&&e.jsx(it,{message:s.errorMessage})]})},bl=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,u;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ae,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(ue,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:o.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Be.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(u=o.tooltip)==null?void 0:u.arrowPosition,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ie.Flex,{direction:"column",gap:"xs",children:[e.jsx(Br.Textarea,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default"}),!i&&o.errorMessage&&e.jsx(it,{message:o.errorMessage})]})]})},vl=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",required:s=!1,fullWidth:o=!1,...i})=>{var c,a,u;const l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...i.containerProps,children:[i.title&&e.jsx(ae,{condition:s,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[e.jsx(ue,{children:i.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:i.titleDescription})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:i.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((c=i.tooltip)!=null&&c.label),children:e.jsx(Be.Tooltip,{label:(a=i.tooltip)==null?void 0:a.label,arrowPosition:(u=i.tooltip)==null?void 0:u.arrowPosition,...i.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!i.titleDescription,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:i.titleDescription})})]})}),e.jsx(vt.Toggle,{checked:i.checked,onChange:i.onChange,label:i.label,description:i.description}),i.errorMessage&&e.jsx(it,{message:i.errorMessage})]})},Cl=({variant:t="primary",size:r="md",...n})=>{const s=yt.useColor(),o=l=>{var a,u,f,g,m,y;if(!l)return;const c=n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary"?"var(--sa-text-subtle, #8c8f97)":t==="secondary-danger"?(u=(a=s==null?void 0:s.computed)==null?void 0:a.red)==null?void 0:u[600]:t==="secondary-primary"?(g=(f=s==null?void 0:s.computed)==null?void 0:f.blue)==null?void 0:g[700]:(y=(m=s==null?void 0:s.computed)==null?void 0:m.gray)==null?void 0:y[50];return e.jsx(E.Icon,{name:l,size:r,style:{color:c}})},i=()=>{var c,a,u,f;if(t!=="secondary-danger"&&t!=="secondary-primary")return n.title;const l={color:n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary-danger"?(a=(c=s==null?void 0:s.computed)==null?void 0:c.red)==null?void 0:a[600]:(f=(u=s==null?void 0:s.computed)==null?void 0:u.blue)==null?void 0:f[700]};switch(r){case"xs":return e.jsx(Qe.Body2,{props:{style:l},children:n.title});case"sm":case"md":return e.jsx(Qe.SubH3,{props:{style:l},children:n.title});case"lg":return e.jsx(Qe.SubH2,{props:{style:l},children:n.title});default:return n.title}};return e.jsx(H.Button,{fullWidth:!0,disabled:n.disabled,primary:t==="primary",secondary:t==="secondary"||t==="secondary-danger"||t==="secondary-primary",success:t==="success",onClick:n.onClick,type:n.type,iconLeft:o(n.iconLeft),iconRight:o(n.iconRight),size:r,children:i()})},wl=t=>e.jsx(Qe.H5,{props:{...t},children:t.title}),Dl=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,u;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(ae,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(ue,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:o.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Be.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(u=o.tooltip)==null?void 0:u.arrowPosition,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ie.Flex,{direction:"column",gap:"xs",children:[e.jsx(x.Box,{direction:"column",style:{width:r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(xt.StarasiaDate,{size:t,...o.inputProps,status:o.errorMessage?"error":void 0})}),!i&&o.errorMessage&&e.jsx(it,{message:o.errorMessage})]})]})};async function Sl(t,r){const n=new Image;n.src=t,await new Promise((i,l)=>{n.onload=i,n.onerror=l});const s=document.createElement("canvas");s.width=r.width,s.height=r.height;const o=s.getContext("2d",{alpha:!0});if(!o)throw new Error("No 2D context");return o.drawImage(n,r.x,r.y,r.width,r.height,0,0,r.width,r.height),new Promise((i,l)=>{s.toBlob(c=>{if(!c)return l("Canvas is empty");const a=new File([c],"cropped.png",{type:"image/png"});i(a)},"image/png")})}const An={"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},Eo=d.forwardRef(({handleUpload:t,urlImage:r,isUploading:n,croppedImage:s,setCroppedImage:o,size:i="96",aspect:l="1:1",containerProps:c,maxFileSize:a=2,onError:u},f)=>{const g=we.useMediaQuery("md"),[m,y]=d.useState(!1),[k,b]=d.useState(null),[M,B]=d.useState(!1),[L,C]=d.useState({x:0,y:0}),[v,W]=d.useState(1),[O,w]=d.useState(null);d.useEffect(()=>{r===null&&o(null)},[r]);const R=d.useCallback((z,V)=>{w(V)},[]),I=z=>{var je;const V=(je=z.target.files)==null?void 0:je[0];if(!V)return;const le=new FileReader;le.onload=()=>{b(le.result),B(!0)},le.readAsDataURL(V)},J=async()=>{if(!(!k||!O))try{const z=await Sl(k,O);if(a&&z.size>a*1024*1024){u==null||u(`Ukuran file maksimal ${a}MB`);return}t==null||t(z);const V=URL.createObjectURL(z);o(V,z),B(!1)}catch{u==null||u("Gagal memproses gambar")}},X=d.useRef(null),Z=()=>{X.current&&X.current.click()};d.useImperativeHandle(f,()=>({openFileDialog:()=>{var z;(z=X.current)==null||z.click()}}));const P=parseInt(i,10),$=An[l];let ee,N;return $>=1?(N=P,ee=P*$):(ee=P,N=P/$),e.jsxs(x.Box,{direction:"column",display:"flex",position:"relative",bg:(c==null?void 0:c.bg)||"gray-200",borderStyle:(c==null?void 0:c.borderStyle)||"border-none",borderColor:(c==null?void 0:c.borderColor)||"gray-200",borderWidth:(c==null?void 0:c.borderWidth)||"border-2",borderRadius:(c==null?void 0:c.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:c!=null&&c.fullWidth?"100%":`${ee}px`,height:c!=null&&c.fullWidth?"auto":`${N}px`,aspectRatio:$,flexShrink:0},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[s||r?e.jsx("img",{src:s||r||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(x.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(E.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(i)/2<40?Number(i)/2:40,height:Number(i)/2<40?Number(i)/2:40}})}),e.jsxs(x.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:m?1:0,transition:"opacity 0.3s ease-in-out"},onClick:Z,children:[e.jsx("input",{ref:X,type:"file",accept:"image/*",onChange:I,disabled:n,style:{display:"none"}}),e.jsxs(x.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(E.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(ae,{condition:i.toNumber()>80,children:e.jsx(D.Text,{color:"gray-50",fontSize:i.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),n&&e.jsx(x.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(x.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),M&&Ut.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:()=>B(!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:g?l==="1:1"?"min(90vw, 480px)":`min(90vw, ${ee*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:z=>z.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:k&&e.jsx(rs,{image:k,crop:L,zoom:v,aspect:l?An[l]:void 0,onCropChange:C,onZoomChange:W,onCropComplete:R,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(H.Button,{size:"sm",secondary:!0,onClick:()=>B(!1),children:"Cancel"}),e.jsx(H.Button,{size:"sm",primary:!0,onClick:J,children:"Crop"})]})]})}),document.body)]})}),kl=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,required:o=!1,...i})=>{var a,u,f;const l=i.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...i.containerProps,children:[i.title&&e.jsx(ae,{condition:!!o,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(ue,{children:i.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:i.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:i.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((a=i.tooltip)!=null&&a.label),children:e.jsx(Be.Tooltip,{label:(u=i.tooltip)==null?void 0:u.label,arrowPosition:(f=i.tooltip)==null?void 0:f.arrowPosition,...i.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!i.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:i.description})})]})}),e.jsxs(ie.Flex,{direction:"column",gap:"xs",children:[e.jsx(Eo,{...i.inputProps}),!l&&i.errorMessage&&e.jsx(it,{message:i.errorMessage})]})]})},Bl=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var l,c,a;const i=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ae,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:i,fullWidth:s,children:[e.jsx(ue,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:i,fullWidth:s,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ue,{fontSize:t,children:o.title}),e.jsx(ue,{color:"error",fontSize:t,children:n}),e.jsx(ae,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Be.Tooltip,{label:(c=o.tooltip)==null?void 0:c.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),o.inputProps.extended&&o.inputProps.extended]})},Fl=({items:t,id:r,handleOnUpdate:n,width:s,toggleShow:o=!0,disabled:i=!1})=>{var f;const[l,c]=d.useState([]);d.useEffect(()=>{t&&c([...t.map(g=>({id:g.id,isActive:g.isActive}))])},[t]);const a=(f=l.find(g=>g.id===r))==null?void 0:f.isActive,u=d.useCallback(()=>{c(g=>g.map(m=>m.id===r?{...m,isActive:!m.isActive}:m)),n&&n(!a)},[r,n,a]);return e.jsx(x.Box,{direction:"row",gap:"md",style:{width:s},children:o&&e.jsx(vt.Toggle,{disabled:i,checked:a,onChange:u,label:a?"Active":"Inactive"})})},El={InputText:Ni,InputDropdown:_i,InputSingleFile:pl,CheckBoxOptions:yl,RadioOptions:jl,InputTextArea:bl,ToggleForm:vl,ActionButton:Cl,FormTitle:wl,InputDate:Dl,InputImgFile:kl,Custom:Bl},Mo=({customBottom:t})=>{const[r,n]=d.useState(!1),s=()=>{window.scrollY>window.screenY?n(!0):n(!1)},o=()=>{window.scrollTo({top:0,behavior:"smooth"})};return d.useEffect(()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}),[]),e.jsx(x.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(x.Box,{direction:"column",position:"absolute",style:{bottom:t||"1.6rem",right:"2rem",transform:r?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(H.Button,{secondary:!0,size:"xs",onClick:o,type:"button",iconLeft:e.jsx(E.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},ze="sa-sidepanel-item",zn="sa-sidepanel-item-styles",Ml="inset 3.5px 0 0 0 var(--sa-border-focused, #1a4fa0)",Ll="inset -3.5px 0 0 0 var(--sa-border-focused, #1a4fa0)",Tl=`
|
|
58
58
|
.${ze} {
|
|
59
59
|
display: block;
|
|
60
60
|
box-sizing: border-box;
|
|
@@ -92,11 +92,11 @@
|
|
|
92
92
|
/* Accent bar — sign of the offset picks the edge it hugs. */
|
|
93
93
|
.${ze}[data-accent="left"]:focus-visible,
|
|
94
94
|
.${ze}[data-accent="left"][data-active="true"] {
|
|
95
|
-
box-shadow: ${
|
|
95
|
+
box-shadow: ${Ml};
|
|
96
96
|
}
|
|
97
97
|
.${ze}[data-accent="right"]:focus-visible,
|
|
98
98
|
.${ze}[data-accent="right"][data-active="true"] {
|
|
99
|
-
box-shadow: ${
|
|
99
|
+
box-shadow: ${Ll};
|
|
100
100
|
}
|
|
101
101
|
.${ze}[data-active="true"]:hover {
|
|
102
102
|
background: var(--sa-background-brand-subtlest, #e6edf6);
|
|
@@ -105,4 +105,4 @@
|
|
|
105
105
|
cursor: not-allowed;
|
|
106
106
|
opacity: 0.55;
|
|
107
107
|
}
|
|
108
|
-
`;function El(){if(typeof document>"u"||document.getElementById(An))return;const t=document.createElement("style");t.id=An,t.textContent=Fl,document.head.appendChild(t)}const Ml=({active:t=!1,accentSide:r="left",onClick:n,title:s,badge:o,heading:i,meta:l,children:c,divider:a=!0,disabled:u,className:h,style:g,"aria-label":m})=>(d.useEffect(El,[]),e.jsx("button",{type:"button",className:[ze,h].filter(Boolean).join(" "),"data-active":t?"true":"false","data-accent":r,"data-divider":a?"true":"false","aria-current":t?"true":void 0,"aria-label":m,disabled:u,onClick:n,style:g,children:c??e.jsxs(f.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(s||o)&&e.jsxs(ce.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[s?e.jsx(D.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:s}):e.jsx("span",{}),o?e.jsx(f.Box,{style:{flexShrink:0},children:o}):null]}),i?e.jsx(D.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:i}):null,l?e.jsx(D.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:l}):null]})})),wr=18,Ll=40,zn="280ms cubic-bezier(0.4, 0, 0.2, 1)",Mo="var(--sa-border-subtle, #0b120e24)",Il=`1px solid ${Mo}`,Hn="var(--sa-background-white, #ffffff)",Tl=({children:t,header:r,collapsed:n,defaultCollapsed:s=!1,onToggle:o,width:i=337,side:l="left",offsetTop:c="4rem",height:a,showToggle:u=!0,togglePosition:h="top",toggleOffset:g=40,toggleLabel:m,style:y,bodyStyle:k,className:b,pageLayout:M,overlay:B="mobile",wrapperProps:L,contentProps:C})=>{const v=we.useMediaQuery("md"),W=n!==void 0,[O,w]=d.useState(s),R=W?n:O,T=()=>{const ie=!R;W||w(ie),o==null||o(ie)},J=l==="left",X=typeof c=="number"?`${c}px`:c,Z=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${X})`,P=m??{collapse:"Collapse panel",expand:"Expand panel"},$=h==="center"?{top:"50%",transform:"translateY(-50%)"}:h==="bottom"?{bottom:g}:{top:g},ee=R?J?"ChevronRight":"ChevronLeft":J?"ChevronLeft":"ChevronRight",N=M!==void 0&&(B==="mobile"?!v:B),z=N?{position:"absolute",top:0,bottom:0,width:i,transform:`translateX(${R?J?"-100%":"100%":"0"})`,transition:`transform ${zn}`,zIndex:50,...J?{left:0}:{right:0},...y}:{position:"sticky",top:X,alignSelf:"flex-start",width:R?0:i,flexShrink:0,height:Z,transition:`width ${zn}`,...y},V=e.jsxs(f.Box,{className:b,style:z,children:[e.jsx(f.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:R?void 0:J?"border-solid-r":"border-solid-l",borderWidth:R?void 0:J?"border-r":"border-l",style:{backgroundColor:Hn,borderColor:Mo},children:e.jsxs(f.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:i,customMinWidth:i,style:J?void 0:{marginLeft:"auto"},children:[r?e.jsx(f.Box,{padding:"md",style:{flexShrink:0},children:r}):null,e.jsx(f.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...k},children:t})]})}),u&&e.jsx(Lt,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:T,"aria-label":R?P.expand:P.collapse,"aria-expanded":!R,"aria-pressed":R,customWidth:wr,customHeight:Ll,style:{...$,backgroundColor:Hn,border:Il,zIndex:5,...J?{right:-wr,borderLeft:"none",borderRadius:"0 8px 8px 0"}:{left:-wr,borderRight:"none",borderRadius:"8px 0 0 8px"}},children:e.jsx(E.Icon,{name:ee,size:"sm"})})]});return M===void 0?V:e.jsxs(f.Box,{direction:"row",position:"relative",...L,style:{height:`calc(100vh - ${X})`,overflow:"hidden",...(L==null?void 0:L.style)??{}},children:[!N&&J?V:null,e.jsx(f.Box,{display:"block",...C,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(C==null?void 0:C.style)??{}},children:M}),!N&&!J?V:null,N&&e.jsxs(e.Fragment,{children:[!R&&e.jsx("div",{onClick:T,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),V]})]})},Mr="--app-aside-width",Ol=t=>typeof t=="number"?`${t}px`:t,Rl=({pageLayout:t,children:r,wrapperProps:n,containerProps:s})=>{const o=we.useMediaQuery("md"),i=(s==null?void 0:s.customWidth)??264;return d.useLayoutEffect(()=>{const l=document.documentElement;return l.style.setProperty(Mr,o?Ol(i):"0px"),()=>l.style.removeProperty(Mr)},[o,i]),e.jsxs(f.Box,{display:"block",direction:"row",...n,style:{marginRight:o?i:24,...(n==null?void 0:n.style)??{}},children:[t,e.jsx(f.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",...s,style:{marginTop:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(s==null?void 0:s.style)??{}},children:r})]})},Lr="--sa-floating-footer-height",Wl=t=>typeof t=="number"?`${t}px`:t,Al=({children:t,withScrollToTopButton:r=!1,scrollToTopButtonProps:n,respectAside:s=!1,offsetRight:o,containerProps:i})=>{const l=d.useRef(null),c=o!=null?Wl(o):s?"var(--app-aside-width, 0px)":"0px";return d.useLayoutEffect(()=>{const a=document.documentElement,u=()=>{var m;const g=((m=l.current)==null?void 0:m.getBoundingClientRect().height)??0;a.style.setProperty(Lr,`${g}px`)};u();const h=new ResizeObserver(u);return l.current&&h.observe(l.current),()=>{h.disconnect(),a.style.removeProperty(Lr)}},[]),e.jsx(f.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 998)"},children:e.jsxs(f.Box,{ref:l,position:"fixed",bottom:"bottom-0",bg:"white",direction:"row",align:"center",display:"flex",paddingBlock:"sm",paddingInline:"md",borderColor:"border-subtle",style:{left:"var(--app-sidebar-width, 0px)",right:c,transition:"left 0.3s ease-in-out, right 0.3s ease-in-out"},justify:(i==null?void 0:i.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[r&&e.jsx(Eo,{...n,customBottom:(n==null?void 0:n.customBottom)||"5.7rem"}),t]})})},zl=({fields:t})=>e.jsx(f.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx($t,{of:t,render:(r,n)=>e.jsx(Hl,{...r},n)})}),Hl=({title:t,value:r,icon:n})=>e.jsxs(f.Box,{display:"flex",direction:"column",gap:"sm",children:[n?e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(E.Icon,{name:n,color:"subtle"}),e.jsx(D.Text,{color:"gray-500",variant:"sub-h3",children:t})]}):e.jsx(D.Text,{color:"gray-500",variant:"sub-h3",children:t}),typeof r=="string"?e.jsx(D.Text,{variant:"sub-h3",children:r}):r]}),Ee={silhouette:"#A7B0AC",accent:"#78867F"};function Vl({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t||"100",height:r||"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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.accent,fillOpacity:"0.65"})]})})}const Pl=({title:t="create",children:r,onClickAction:n,variant:s="primary",variantTitle:o,leftIcon:i,showButton:l=!0,customHeight:c,childrenButton:a,customIcon:u})=>{const h=()=>{switch(s){case"primary":return e.jsx(e.Fragment,{children:i?e.jsx(H.Button,{primary:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(H.Button,{primary:!0,onClick:n,children:a||t})});case"secondary":return e.jsx(e.Fragment,{children:i?e.jsx(H.Button,{secondary:!0,iconLeft:i,onClick:n,children:o?e.jsx(D.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||t}):t}):e.jsx(H.Button,{secondary:!0,onClick:n,children:a||t})});case"success":return e.jsx(e.Fragment,{children:i?e.jsx(H.Button,{success:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(H.Button,{success:!0,onClick:n,children:a||t})});default:return e.jsx(e.Fragment,{children:i?e.jsx(H.Button,{primary:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(H.Button,{primary:!0,onClick:n,children:a||t})})}};return e.jsxs(f.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:c,children:[u||e.jsx(Vl,{}),e.jsx(f.Box,{direction:"column",children:r.map((g,m)=>e.jsx(Qe.Body1,{props:{align:"center",textAlign:"center"},children:m>2?null:g},m))}),l?h():null]})},Y={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function Nl({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,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:Y.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:Y.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:Y.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:Y.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:Y.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:Y.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:Y.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:Y.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:Y.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:Y.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:Y.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:Y.cFFFFFF,stroke:Y.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:Y.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:Y.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:Y.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:Y.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:Y.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:Y.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:Y.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:Y.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:Y.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:Y.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:Y.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:Y.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:Y.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:Y.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:Y.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:Y.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:Y.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:Y.c001A72})]})})}function _l({onClick:t}){const r=we.useMediaQuery("md");return e.jsxs(f.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Nl,{width:r?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(D.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),t&&e.jsx(H.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const ne={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 ql({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,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:ne.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:ne.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:ne.cEFF3F8,stroke:ne.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:ne.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:ne.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:ne.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:ne.c956847,stroke:ne.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:ne.c956847,stroke:ne.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:ne.cC8CEF4,stroke:ne.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:ne.cC8CEF4,stroke:ne.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:ne.cC8CEF4,stroke:ne.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:ne.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:ne.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:ne.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:ne.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:ne.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:ne.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:ne.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:ne.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:ne.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:ne.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:ne.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:ne.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:ne.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:ne.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:ne.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:ne.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:ne.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:ne.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:ne.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function Zl({onClick:t}){const r=we.useMediaQuery("md");return e.jsxs(f.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(ql,{width:r?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",children:"We Are Sorry ..."}),t&&e.jsx(H.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const x={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 Gl({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,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:x.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:x.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:x.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:x.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:x.cFFFFFF,stroke:x.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:x.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:x.cFFFFFF,stroke:x.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:x.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:x.cFFFFFF,stroke:x.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:x.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:x.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:x.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:x.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:x.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:x.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:x.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:x.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:x.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:x.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:x.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:x.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:x.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:x.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:x.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:x.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:x.c000D58,stroke:x.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:x.c000D58,stroke:x.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:x.cFFFFFF,stroke:x.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:x.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:x.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:x.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:x.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:x.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:x.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:x.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:x.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:x.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:x.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:x.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:x.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:x.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Ql({onClick:t}){const r=we.useMediaQuery("md");return e.jsxs(f.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(Gl,{width:r?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(D.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),t&&e.jsx(H.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const Ul=t=>{var n,s,o,i,l;const r=we.useMediaQuery("md");return e.jsxs(Re.Dialog,{isShow:t.isShow,onHide:t.onHide,style:{...r?{minWidth:t.customMinWidth||"458px"}:{maxWidth:t.customMinWidth||"458px"}},children:[e.jsx(Re.DialogTitle,{...t.dialogTitleProps,children:typeof t.title=="string"?e.jsx(D.Text,{fontSize:"lg",fontWeight:"medium",children:t.title}):t.title}),e.jsx(Re.DialogBody,{children:typeof t.description=="string"?e.jsx(D.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:t.description}):t.description}),e.jsx(Re.DialogFooter,{children:e.jsx(f.Box,{display:"flex",direction:((n=t.containerConfirmBtnProps)==null?void 0:n.direction)||"row",justify:((s=t.containerConfirmBtnProps)==null?void 0:s.justify)||"flex-end",...t.containerConfirmBtnProps,children:e.jsxs(f.Box,{display:"flex",direction:((o=t.wrapperConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((i=t.wrapperConfirmBtnProps)==null?void 0:i.justify)||"flex-end",gap:((l=t.wrapperConfirmBtnProps)==null?void 0:l.gap)||"sm",...t.wrapperConfirmBtnProps,children:[t.onCancel&&e.jsx(H.Button,{secondary:!0,onClick:t.onCancel,size:"md",fullWidth:!0,children:t.titleCancelBtn||"Cancel"}),e.jsx(f.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(H.Button,{...t.buttonConfirmProps,onClick:t.onConfirm,size:"md",fullWidth:!0,children:t.titleConfirmBtn||"Ok"})})]})})})]},t.key)},Jl=d.memo(({children:t,height:r,minHeight:n,customHeight:s,paddingInline:o="spacing-0",paddingBlock:i="spacing-0",header:l,footer:c,title:a,titleTag:u,action:h,actionContainer:g,containerProps:m,bodyProps:y,headerProps:k={borderBottom:!0},footerProps:b={borderTop:!0},variantTag:M="info"})=>{const B=d.useRef(null),[L,C]=d.useState("100vh");d.useEffect(()=>{const w=()=>{if(B.current){const R=B.current.getBoundingClientRect().top;C(`calc(100vh - ${R}px)`)}};return w(),window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[]);const v=()=>u?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(D.Text,{fontWeight:"medium",children:a}),e.jsx(ct.Badges,{border:!0,text:u,variant:M})]}):e.jsx(D.Text,{fontWeight:"medium",children:a}),W=()=>l||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:a?v():null}),e.jsx(f.Box,{direction:"column",...g,children:h??null})]}),O=!!(l||a||h);return e.jsxs(f.Box,{ref:B,height:r,customMinHeight:n,customHeight:s,paddingBlock:i,paddingInline:o,bg:"white",direction:"column",...m,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:L,...(m==null?void 0:m.style)??{}},children:[l!==null&&O?e.jsx(Hr,{...k,children:W()}):null,e.jsx(f.Box,{direction:"column",padding:"spacing-0",...y,style:{flex:1,overflow:"auto",...(y==null?void 0:y.style)??{}},children:t}),c?e.jsx(Vr,{...b,children:c}):null]})}),Yl=d.memo(({value:t,options:r=[],onChange:n,multiple:s})=>{const o=(t==null?void 0:t.map(c=>c.value))||[],i=(r==null?void 0:r.filter(c=>o.includes(c.value)))||[],l=c=>{const a=[...i];let u=[];s?u=o.includes(c.value)?a.filter(h=>h.value!==c.value):[...a,c]:u=[c],n==null||n(u)};return e.jsx(f.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:r==null?void 0:r.map((c,a)=>e.jsx(H.Button,{...o.includes(c.value)?{primary:!0}:{secondary:!0},onClick:()=>l(c),children:c.label},a))})});function Kt(t){return null}Kt.displayName="LayoutDialog.Header";function er(t){return null}er.displayName="LayoutDialog.Body";function tr(t){return null}tr.displayName="LayoutDialog.Aside";function rr(t){return null}rr.displayName="LayoutDialog.Footer";const Le={"lyd-root":"_lyd-root_1g78i_1","lyd-backdrop":"_lyd-backdrop_1g78i_38","lyd-panel":"_lyd-panel_1g78i_47","lyd-modal":"_lyd-modal_1g78i_58","lyd-fullscreen":"_lyd-fullscreen_1g78i_72","lyd-sidebar":"_lyd-sidebar_1g78i_80","lyd-header":"_lyd-header_1g78i_110","lyd-header-content":"_lyd-header-content_1g78i_121","lyd-header-actions":"_lyd-header-actions_1g78i_129","lyd-main":"_lyd-main_1g78i_136","lyd-body":"_lyd-body_1g78i_143","lyd-aside":"_lyd-aside_1g78i_149","lyd-footer":"_lyd-footer_1g78i_165","lyd-vm-group":"_lyd-vm-group_1g78i_178","lyd-vm-btn":"_lyd-vm-btn_1g78i_186","lyd-close-btn":"_lyd-close-btn_1g78i_209"},Xl=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(Kl,{})},{mode:"modal",label:"Modal",icon:e.jsx(E.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(E.Icon,{name:"Fullscreen",size:"sm"})}];function $l({value:t,onChange:r}){return e.jsx("div",{className:Le["lyd-vm-group"],role:"group","aria-label":"View mode",children:Xl.map(n=>e.jsx("button",{type:"button",className:Le["lyd-vm-btn"],"data-active":t===n.mode,"aria-label":`Switch to ${n.label} view`,"aria-pressed":t===n.mode,onClick:()=>r(n.mode),children:n.icon},n.mode))})}function Kl(){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 Dr={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function ec(t){return t?t in Dr?Dr[t]:t:Dr.xl}function Pt(t,r){let n=null;return d.Children.forEach(t,s=>{d.isValidElement(s)&&s.type===r&&(n=s.props.children??null)}),n}function tc(t){const{isOpen:r,onClose:n,viewMode:s,defaultViewMode:o="modal",onViewModeChange:i,showViewModeToggle:l=!0,showCloseButton:c=!0,size:a,asideWidth:u,disableEscapeClose:h=!1,disableBackdropClose:g=!1,lockBodyScroll:m=!0,children:y}=t,[k,b]=d.useState(o),M=s??k,L=we.useMediaQuery("md")?M:"fullscreen",C=d.useCallback(P=>{s===void 0&&b(P),i==null||i(P)},[s,i]),v=d.useRef(null);d.useEffect(()=>{if(!(!r||!m))return v.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=v.current??""}},[r,m]);const W=d.useRef(n);W.current=n,d.useEffect(()=>{if(r)return Re.registerOverlay({onEscape:h?void 0:()=>W.current()})},[r,h]);const O=d.useMemo(()=>Pt(y,Kt),[y]),w=d.useMemo(()=>Pt(y,er),[y]),R=d.useMemo(()=>Pt(y,tr),[y]),T=d.useMemo(()=>Pt(y,rr),[y]);if(!r)return null;const J=[Le["lyd-panel"],L==="modal"&&Le["lyd-modal"],L==="fullscreen"&&Le["lyd-fullscreen"],L==="sidebar"&&Le["lyd-sidebar"]].filter(Boolean).join(" "),X={"--lyd-max-w":ec(a),...u!==void 0&&{"--lyd-aside-w":u}},Z=()=>{g||n()};return typeof document>"u"?null:Ut.createPortal(e.jsxs("div",{className:Le["lyd-root"],style:X,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:Le["lyd-backdrop"],onClick:Z,"aria-hidden":"true"}),e.jsxs("div",{className:J,children:[e.jsxs("div",{className:Le["lyd-header"],children:[e.jsx("div",{className:Le["lyd-header-content"],children:O}),e.jsxs("div",{className:Le["lyd-header-actions"],children:[l&&e.jsx($l,{value:M,onChange:C}),c&&e.jsx("button",{type:"button",className:Le["lyd-close-btn"],onClick:n,"aria-label":"Close dialog",children:e.jsx(E.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:Le["lyd-main"],children:[e.jsx("div",{className:Le["lyd-body"],children:w}),R&&e.jsx("aside",{className:Le["lyd-aside"],children:R})]}),T&&e.jsx("div",{className:Le["lyd-footer"],children:T})]})]}),document.body)}const It=tc;It.Header=Kt;It.Body=er;It.Aside=tr;It.Footer=rr;function rc({url:t,filename:r,onClose:n}){const s=d.useRef(n);return s.current=n,d.useEffect(()=>Re.registerOverlay({onEscape:()=>s.current()}),[]),e.jsxs("div",{onClick:n,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:o=>o.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:t,download:r,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:n,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:t,alt:r,onClick:o=>o.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:r})]})}const Lo="var(--sa-border-subtle, #e5e7eb)",Qt=()=>e.jsx(f.Box,{style:{width:1,height:22,backgroundColor:Lo}}),nc=t=>typeof t=="number"?`${t}px`:t;function Io({count:t,children:r,label:n,onClear:s,clearLabel:o="Clear selection",clearDisabled:i=!1,bottom:l=20,zIndex:c=50,style:a,className:u}){if(t===0)return null;const h=typeof n=="function"?n(t):n??`${t} selected`;return e.jsx(f.Box,{direction:"row",justify:"center",style:{position:"fixed",bottom:nc(l),left:0,right:0,zIndex:c,pointerEvents:"none"},children:e.jsxs(f.Box,{direction:"row",align:"center",gap:"xs",bg:"white",padding:"spacing-8",className:u,style:{pointerEvents:"auto",borderRadius:10,border:`1px solid ${Lo}`,boxShadow:"var(--sa-shadow-xl, 0 10px 25px -5px rgb(0 0 0/0.15))",...a},children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",whiteSpace:"nowrap",style:{paddingInline:6},children:h}),e.jsx(Qt,{}),r,s&&e.jsxs(e.Fragment,{children:[e.jsx(Qt,{}),e.jsx(Be.Tooltip,{label:o,position:"top",children:e.jsx(H.Button,{variant:"tertiary",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"Cross",size:"xs"}),"aria-label":o,onClick:s,disabled:i})})]})]})})}Io.Divider=Qt;const oc=t=>{const{defaultTab:r=0,paramKey:n="tab"}=t||{},{useSearchParams:s}=nt(),[o,i]=s(),l=bt.searchParamsToObject(o.toString());return{activeTab:l[n]?parseInt(l[n]):r,handleTabChange:u=>{i({...l,[n]:u.toString()})},searchQueries:l}};function sc({appName:t,menuConfig:r,formatTitle:n}){const{useLocation:s}=nt(),o=s();d.useEffect(()=>{let i=null,l=null;for(const u of r){const h=u.items.find(g=>g.to?g.to==="/"?o.pathname==="/":!!(g.to===o.pathname||o.pathname.startsWith(g.to+"/")):!1);if(h){i=h,l=u;break}}const c=[];i!=null&&i.title&&c.push(i.title),l!=null&&l.name&&c.push(l.name.toTitleCase());const a=(u,h)=>u.length>0?`${u.join(" - ")} | ${h}`:h;document.title=(n||a)(c,t)},[o.pathname])}const ic=()=>{const{useSearchParams:t,useParams:r,useLocation:n}=nt(),[s,o]=t(),i=bt.searchParamsToObject(s.toString()),l=r(),c=n(),a=l.id;return{setSearchParams:o,searchParams:s,searchQueries:i,isHasQuery:(y,k)=>s.has(y)&&s.get(y)===k,getQueryParam:y=>s.get(y),getRouteParam:y=>l[y],params:l,location:c,id:a,hasId:!!a}};function lc(t){var s,o;const r=t.decodedAccessToken;return d.useMemo(()=>{var a,u;const i=((u=(a=r==null?void 0:r.access)==null?void 0:a.role)==null?void 0:u.code)??"",l=Object.keys(t.role).reduce((h,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,y=>y.replace("_","").toUpperCase())}`;return{...h,[m]:!1}},{});return{...Object.keys(t.role).reduce((h,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,y=>y.replace("_","").toUpperCase())}`;return{...h,[m]:i===t.role[g]}},l),hasRole:h=>i===t.role[h],getRoleKey:()=>i}},[(o=(s=r==null?void 0:r.access)==null?void 0:s.role)==null?void 0:o.code,t])}exports.ASIDE_WIDTH_VAR=Mr;exports.AdvanceFilterBar=xo;exports.App=rs;exports.AppComponent=Jn;exports.AppContext=Ir;exports.AppLayout=cs;exports.AsideBar=Rl;exports.BackButton=ds;exports.ColumnFilterDropdown=wo;exports.ColumnMenu=So;exports.ConfirmationDialog=Ul;exports.DataTable=Do;exports.DecisionWrapper=ae;exports.EachUtils=$t;exports.EmptyStatePage=Pl;exports.FLOATING_FOOTER_HEIGHT_VAR=Lr;exports.FilterBar=gi;exports.FilterDrawer=uo;exports.FloatingFooter=Al;exports.ForbiddenPage=Zl;exports.Form=Sl;exports.FullSection=Jl;exports.HeaderLeftSlot=ns;exports.HeaderLeftSlotOutlet=$n;exports.HeaderLeftSlotProvider=Xn;exports.HorizontalField=ms;exports.ImagePreview=rc;exports.InputFile=Bo;exports.InputImage=Fo;exports.LayoutDialog=It;exports.LayoutDialogAside=tr;exports.LayoutDialogBody=er;exports.LayoutDialogFooter=rr;exports.LayoutDialogHeader=Kt;exports.ModuleSwitcher=us;exports.ModuleSwitcherModal=ro;exports.NotFoundPage=_l;exports.PageLayout=ys;exports.Pressable=Lt;exports.RightDrawer=no;exports.SIDEBAR_DEFAULT_WIDTH=Jt;exports.SIDEBAR_MAX_WIDTH=Rr;exports.SIDEBAR_MIN_WIDTH=Or;exports.ScrollToTopButton=Eo;exports.Section=vs;exports.SectionFooter=Vr;exports.SectionHeader=Hr;exports.SelectButton=Yl;exports.SelectionActionBar=Io;exports.SelectionActionBarDivider=Qt;exports.ServerErrorPage=Ql;exports.SidePanel=Tl;exports.SidePanelItem=Ml;exports.SidebarBadgesProvider=Nn;exports.SidebarGroupSlot=os;exports.SidebarGroupSlotOutlet=eo;exports.SidebarGroupSlotProvider=Kn;exports.SidebarHeaderSlot=Yn;exports.SidebarProvider=Zn;exports.StarasiaRouterProvider=Un;exports.TableFooter=Co;exports.TableHeader=vo;exports.TableLayout=Wi;exports.TableSection=Ei;exports.TableWrapper=bo;exports.ToggleStatus=Dl;exports.Typography=Qe;exports.VerticalField=zl;exports.clearModuleSelection=ss;exports.createInitialFromUserName=Ni;exports.cssVars=Ui;exports.expandDateCompact=wi;exports.formHasChanged=el;exports.formatDate=Gi;exports.formatDateToIndonesian=ko;exports.formatRupiah=qi;exports.getDateFilterValue=ao;exports.getDateRangeFilterValue=As;exports.getInitials=Zi;exports.getValueDropdownMultipleFilter=co;exports.getValueRadioFilter=Ws;exports.getValueSearch=Yt;exports.getValuesFilter=_t;exports.handleChangeFilter=Mt;exports.handleOnScroll=al;exports.isEmail=il;exports.isFilterActive=zs;exports.isOnlyLettersAndSpaces=rl;exports.isPhoneNumber=tl;exports.isSlug=ll;exports.localStorageAdapter=Nr;exports.oneDayInMs=Ji;exports.parseIndonesianDateToDate=_i;exports.preventNonCoordinateInput=cl;exports.preventNonNumberAndDecimalInput=sl;exports.preventNonNumberInput=nl;exports.preventNumberInput=ol;exports.resolveDateRangeValueToString=io;exports.resolveDateValueToString=lo;exports.resolveDropdownValueToString=oo;exports.resolveRadioValueToString=so;exports.resolveSidebarBadge=Nt;exports.storageKeys=Ct;exports.textWidth=Yi;exports.useApp=Tr;exports.useAppState=Vn;exports.useAuthRole=lc;exports.useDynamicTitle=sc;exports.useFilterBarApiParams=bi;exports.useFilterBarControls=Ci;exports.useModuleSelection=zr;exports.useRouteInfo=We;exports.useRouteParams=ic;exports.useRouterAdapter=nt;exports.useSidebar=Gn;exports.useSidebarBadges=_n;exports.useTabState=oc;exports.useTableSortApiParams=Ai;Object.keys(tn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>tn[t]})});Object.keys(rn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>rn[t]})});Object.keys(ct).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ct[t]})});Object.keys(f).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>f[t]})});Object.keys(pt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>pt[t]})});Object.keys(H).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>H[t]})});Object.keys(nn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>nn[t]})});Object.keys(xt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>xt[t]})});Object.keys(Re).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Re[t]})});Object.keys(qt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>qt[t]})});Object.keys(jt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>jt[t]})});Object.keys(we).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>we[t]})});Object.keys(bt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>bt[t]})});Object.keys(at).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>at[t]})});Object.keys(I).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>I[t]})});Object.keys(Et).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Et[t]})});Object.keys(Ft).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ft[t]})});Object.keys(q).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>q[t]})});Object.keys(on).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>on[t]})});Object.keys(Sr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Sr[t]})});Object.keys(yt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>yt[t]})});Object.keys(sn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>sn[t]})});Object.keys(vt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>vt[t]})});Object.keys(Be).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Be[t]})});Object.keys(rt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>rt[t]})});Object.keys(kr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>kr[t]})});Object.keys(D).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>D[t]})});Object.keys(E).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>E[t]})});Object.keys(ce).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ce[t]})});Object.keys(ln).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ln[t]})});Object.keys(cn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>cn[t]})});Object.keys(an).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>an[t]})});Object.keys(dn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>dn[t]})});Object.keys(un).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>un[t]})});Object.keys(Ge).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ge[t]})});Object.keys(xn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>xn[t]})});
|
|
108
|
+
`;function Il(){if(typeof document>"u"||document.getElementById(zn))return;const t=document.createElement("style");t.id=zn,t.textContent=Tl,document.head.appendChild(t)}const Ol=({active:t=!1,accentSide:r="left",onClick:n,title:s,badge:o,heading:i,meta:l,children:c,divider:a=!0,disabled:u,className:f,style:g,"aria-label":m})=>(d.useEffect(Il,[]),e.jsx("button",{type:"button",className:[ze,f].filter(Boolean).join(" "),"data-active":t?"true":"false","data-accent":r,"data-divider":a?"true":"false","aria-current":t?"true":void 0,"aria-label":m,disabled:u,onClick:n,style:g,children:c??e.jsxs(x.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(s||o)&&e.jsxs(ie.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[s?e.jsx(D.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:s}):e.jsx("span",{}),o?e.jsx(x.Box,{style:{flexShrink:0},children:o}):null]}),i?e.jsx(D.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:i}):null,l?e.jsx(D.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:l}):null]})})),Dr=18,Rl=40,Hn="280ms cubic-bezier(0.4, 0, 0.2, 1)",Lo="var(--sa-border-subtle, #0b120e24)",Wl=`1px solid ${Lo}`,Vn="var(--sa-background-white, #ffffff)",Al=({children:t,header:r,collapsed:n,defaultCollapsed:s=!1,onToggle:o,width:i=337,side:l="left",offsetTop:c="4rem",height:a,showToggle:u=!0,togglePosition:f="top",toggleOffset:g=40,toggleLabel:m,style:y,bodyStyle:k,className:b,pageLayout:M,overlay:B="mobile",wrapperProps:L,contentProps:C})=>{const v=we.useMediaQuery("md"),W=n!==void 0,[O,w]=d.useState(s),R=W?n:O,I=()=>{const le=!R;W||w(le),o==null||o(le)},J=l==="left",X=typeof c=="number"?`${c}px`:c,Z=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${X})`,P=m??{collapse:"Collapse panel",expand:"Expand panel"},$=f==="center"?{top:"50%",transform:"translateY(-50%)"}:f==="bottom"?{bottom:g}:{top:g},ee=R?J?"ChevronRight":"ChevronLeft":J?"ChevronLeft":"ChevronRight",N=M!==void 0&&(B==="mobile"?!v:B),z=N?{position:"absolute",top:0,bottom:0,width:i,transform:`translateX(${R?J?"-100%":"100%":"0"})`,transition:`transform ${Hn}`,zIndex:50,...J?{left:0}:{right:0},...y}:{position:"sticky",top:X,alignSelf:"flex-start",width:R?0:i,flexShrink:0,height:Z,transition:`width ${Hn}`,...y},V=e.jsxs(x.Box,{className:b,style:z,children:[e.jsx(x.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:R?void 0:J?"border-solid-r":"border-solid-l",borderWidth:R?void 0:J?"border-r":"border-l",style:{backgroundColor:Vn,borderColor:Lo},children:e.jsxs(x.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:i,customMinWidth:i,style:J?void 0:{marginLeft:"auto"},children:[r?e.jsx(x.Box,{padding:"md",style:{flexShrink:0},children:r}):null,e.jsx(x.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...k},children:t})]})}),u&&e.jsx(Lt,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:I,"aria-label":R?P.expand:P.collapse,"aria-expanded":!R,"aria-pressed":R,customWidth:Dr,customHeight:Rl,style:{...$,backgroundColor:Vn,border:Wl,zIndex:5,...J?{right:-Dr,borderLeft:"none",borderRadius:"0 8px 8px 0"}:{left:-Dr,borderRight:"none",borderRadius:"8px 0 0 8px"}},children:e.jsx(E.Icon,{name:ee,size:"sm"})})]});return M===void 0?V:e.jsxs(x.Box,{direction:"row",position:"relative",...L,style:{height:`calc(100vh - ${X})`,overflow:"hidden",...(L==null?void 0:L.style)??{}},children:[!N&&J?V:null,e.jsx(x.Box,{display:"block",...C,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(C==null?void 0:C.style)??{}},children:M}),!N&&!J?V:null,N&&e.jsxs(e.Fragment,{children:[!R&&e.jsx("div",{onClick:I,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),V]})]})},Tr="--app-aside-width",zl=t=>typeof t=="number"?`${t}px`:t,Hl=({pageLayout:t,children:r,wrapperProps:n,containerProps:s})=>{const o=we.useMediaQuery("md"),i=(s==null?void 0:s.customWidth)??264;return d.useLayoutEffect(()=>{const l=document.documentElement;return l.style.setProperty(Tr,o?zl(i):"0px"),()=>l.style.removeProperty(Tr)},[o,i]),e.jsxs(x.Box,{display:"block",direction:"row",...n,style:{marginRight:o?i:24,...(n==null?void 0:n.style)??{}},children:[t,e.jsx(x.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",...s,style:{marginTop:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(s==null?void 0:s.style)??{}},children:r})]})},Ir="--sa-floating-footer-height",Vl=t=>typeof t=="number"?`${t}px`:t,Pl=({children:t,withScrollToTopButton:r=!1,scrollToTopButtonProps:n,respectAside:s=!1,offsetRight:o,containerProps:i})=>{const l=d.useRef(null),c=o!=null?Vl(o):s?"var(--app-aside-width, 0px)":"0px";return d.useLayoutEffect(()=>{const a=document.documentElement,u=()=>{var m;const g=((m=l.current)==null?void 0:m.getBoundingClientRect().height)??0;a.style.setProperty(Ir,`${g}px`)};u();const f=new ResizeObserver(u);return l.current&&f.observe(l.current),()=>{f.disconnect(),a.style.removeProperty(Ir)}},[]),e.jsx(x.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 998)"},children:e.jsxs(x.Box,{ref:l,position:"fixed",bottom:"bottom-0",bg:"white",direction:"row",align:"center",display:"flex",paddingBlock:"sm",paddingInline:"md",borderColor:"border-subtle",style:{left:"var(--app-sidebar-width, 0px)",right:c,transition:"left 0.3s ease-in-out, right 0.3s ease-in-out"},justify:(i==null?void 0:i.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[r&&e.jsx(Mo,{...n,customBottom:(n==null?void 0:n.customBottom)||"5.7rem"}),t]})})},Nl=({fields:t})=>e.jsx(x.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx($t,{of:t,render:(r,n)=>e.jsx(_l,{...r},n)})}),_l=({title:t,value:r,icon:n})=>e.jsxs(x.Box,{display:"flex",direction:"column",gap:"sm",children:[n?e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(E.Icon,{name:n,color:"subtle"}),e.jsx(D.Text,{color:"gray-500",variant:"sub-h3",children:t})]}):e.jsx(D.Text,{color:"gray-500",variant:"sub-h3",children:t}),typeof r=="string"?e.jsx(D.Text,{variant:"sub-h3",children:r}):r]}),Ee={silhouette:"#A7B0AC",accent:"#78867F"};function ql({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t||"100",height:r||"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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.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:Ee.accent,fillOpacity:"0.65"})]})})}const Zl=({title:t="create",children:r,onClickAction:n,variant:s="primary",variantTitle:o,leftIcon:i,showButton:l=!0,customHeight:c,childrenButton:a,customIcon:u})=>{const f=()=>{switch(s){case"primary":return e.jsx(e.Fragment,{children:i?e.jsx(H.Button,{primary:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(H.Button,{primary:!0,onClick:n,children:a||t})});case"secondary":return e.jsx(e.Fragment,{children:i?e.jsx(H.Button,{secondary:!0,iconLeft:i,onClick:n,children:o?e.jsx(D.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||t}):t}):e.jsx(H.Button,{secondary:!0,onClick:n,children:a||t})});case"success":return e.jsx(e.Fragment,{children:i?e.jsx(H.Button,{success:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(H.Button,{success:!0,onClick:n,children:a||t})});default:return e.jsx(e.Fragment,{children:i?e.jsx(H.Button,{primary:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(H.Button,{primary:!0,onClick:n,children:a||t})})}};return e.jsxs(x.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:c,children:[u||e.jsx(ql,{}),e.jsx(x.Box,{direction:"column",children:r.map((g,m)=>e.jsx(Qe.Body1,{props:{align:"center",textAlign:"center"},children:m>2?null:g},m))}),l?f():null]})},Y={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function Gl({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,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:Y.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:Y.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:Y.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:Y.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:Y.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:Y.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:Y.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:Y.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:Y.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:Y.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:Y.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:Y.cFFFFFF,stroke:Y.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:Y.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:Y.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:Y.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:Y.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:Y.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:Y.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:Y.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:Y.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:Y.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:Y.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:Y.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:Y.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:Y.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:Y.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:Y.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:Y.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:Y.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:Y.c001A72})]})})}function Ql({onClick:t}){const r=we.useMediaQuery("md");return e.jsxs(x.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Gl,{width:r?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(D.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),t&&e.jsx(H.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const ne={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 Ul({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,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:ne.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:ne.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:ne.cEFF3F8,stroke:ne.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:ne.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:ne.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:ne.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:ne.c956847,stroke:ne.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:ne.c956847,stroke:ne.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:ne.cC8CEF4,stroke:ne.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:ne.cC8CEF4,stroke:ne.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:ne.cC8CEF4,stroke:ne.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:ne.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:ne.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:ne.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:ne.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:ne.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:ne.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:ne.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:ne.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:ne.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:ne.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:ne.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:ne.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:ne.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:ne.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:ne.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:ne.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:ne.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:ne.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:ne.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function Jl({onClick:t}){const r=we.useMediaQuery("md");return e.jsxs(x.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Ul,{width:r?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",children:"We Are Sorry ..."}),t&&e.jsx(H.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const h={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 Yl({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,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:h.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:h.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:h.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:h.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:h.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:h.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:h.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:h.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:h.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:h.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:h.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:h.cFFFFFF,stroke:h.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:h.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:h.cFFFFFF,stroke:h.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:h.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:h.cFFFFFF,stroke:h.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:h.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:h.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:h.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:h.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:h.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:h.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:h.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:h.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:h.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:h.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:h.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:h.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:h.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:h.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:h.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:h.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:h.c000D58,stroke:h.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:h.c000D58,stroke:h.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:h.cFFFFFF,stroke:h.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:h.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:h.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:h.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:h.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:h.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:h.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:h.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:h.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:h.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:h.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:h.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:h.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:h.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Xl({onClick:t}){const r=we.useMediaQuery("md");return e.jsxs(x.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(Yl,{width:r?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(D.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),t&&e.jsx(H.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const $l=t=>{var n,s,o,i,l;const r=we.useMediaQuery("md");return e.jsxs(Re.Dialog,{isShow:t.isShow,onHide:t.onHide,style:{...r?{minWidth:t.customMinWidth||"458px"}:{maxWidth:t.customMinWidth||"458px"}},children:[e.jsx(Re.DialogTitle,{...t.dialogTitleProps,children:typeof t.title=="string"?e.jsx(D.Text,{fontSize:"lg",fontWeight:"medium",children:t.title}):t.title}),e.jsx(Re.DialogBody,{children:typeof t.description=="string"?e.jsx(D.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:t.description}):t.description}),e.jsx(Re.DialogFooter,{children:e.jsx(x.Box,{display:"flex",direction:((n=t.containerConfirmBtnProps)==null?void 0:n.direction)||"row",justify:((s=t.containerConfirmBtnProps)==null?void 0:s.justify)||"flex-end",...t.containerConfirmBtnProps,children:e.jsxs(x.Box,{display:"flex",direction:((o=t.wrapperConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((i=t.wrapperConfirmBtnProps)==null?void 0:i.justify)||"flex-end",gap:((l=t.wrapperConfirmBtnProps)==null?void 0:l.gap)||"sm",...t.wrapperConfirmBtnProps,children:[t.onCancel&&e.jsx(H.Button,{secondary:!0,onClick:t.onCancel,size:"md",fullWidth:!0,children:t.titleCancelBtn||"Cancel"}),e.jsx(x.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(H.Button,{...t.buttonConfirmProps,onClick:t.onConfirm,size:"md",fullWidth:!0,children:t.titleConfirmBtn||"Ok"})})]})})})]},t.key)},Kl=d.memo(({children:t,height:r,minHeight:n,customHeight:s,paddingInline:o="spacing-0",paddingBlock:i="spacing-0",header:l,footer:c,title:a,titleTag:u,action:f,actionContainer:g,containerProps:m,bodyProps:y,headerProps:k={borderBottom:!0},footerProps:b={borderTop:!0},variantTag:M="info"})=>{const B=d.useRef(null),[L,C]=d.useState("100vh");d.useEffect(()=>{const w=()=>{if(B.current){const R=B.current.getBoundingClientRect().top;C(`calc(100vh - ${R}px)`)}};return w(),window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[]);const v=()=>u?e.jsxs(x.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(D.Text,{fontWeight:"medium",children:a}),e.jsx(ct.Badges,{border:!0,text:u,variant:M})]}):e.jsx(D.Text,{fontWeight:"medium",children:a}),W=()=>l||e.jsxs(x.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(x.Box,{direction:"column",children:a?v():null}),e.jsx(x.Box,{direction:"column",...g,children:f??null})]}),O=!!(l||a||f);return e.jsxs(x.Box,{ref:B,height:r,customMinHeight:n,customHeight:s,paddingBlock:i,paddingInline:o,bg:"white",direction:"column",...m,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:L,...(m==null?void 0:m.style)??{}},children:[l!==null&&O?e.jsx(Pr,{...k,children:W()}):null,e.jsx(x.Box,{direction:"column",padding:"spacing-0",...y,style:{flex:1,overflow:"auto",...(y==null?void 0:y.style)??{}},children:t}),c?e.jsx(Nr,{...b,children:c}):null]})}),ec=d.memo(({value:t,options:r=[],onChange:n,multiple:s})=>{const o=(t==null?void 0:t.map(c=>c.value))||[],i=(r==null?void 0:r.filter(c=>o.includes(c.value)))||[],l=c=>{const a=[...i];let u=[];s?u=o.includes(c.value)?a.filter(f=>f.value!==c.value):[...a,c]:u=[c],n==null||n(u)};return e.jsx(x.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:r==null?void 0:r.map((c,a)=>e.jsx(H.Button,{...o.includes(c.value)?{primary:!0}:{secondary:!0},onClick:()=>l(c),children:c.label},a))})});function Kt(t){return null}Kt.displayName="LayoutDialog.Header";function er(t){return null}er.displayName="LayoutDialog.Body";function tr(t){return null}tr.displayName="LayoutDialog.Aside";function rr(t){return null}rr.displayName="LayoutDialog.Footer";const Le={"lyd-root":"_lyd-root_1g78i_1","lyd-backdrop":"_lyd-backdrop_1g78i_38","lyd-panel":"_lyd-panel_1g78i_47","lyd-modal":"_lyd-modal_1g78i_58","lyd-fullscreen":"_lyd-fullscreen_1g78i_72","lyd-sidebar":"_lyd-sidebar_1g78i_80","lyd-header":"_lyd-header_1g78i_110","lyd-header-content":"_lyd-header-content_1g78i_121","lyd-header-actions":"_lyd-header-actions_1g78i_129","lyd-main":"_lyd-main_1g78i_136","lyd-body":"_lyd-body_1g78i_143","lyd-aside":"_lyd-aside_1g78i_149","lyd-footer":"_lyd-footer_1g78i_165","lyd-vm-group":"_lyd-vm-group_1g78i_178","lyd-vm-btn":"_lyd-vm-btn_1g78i_186","lyd-close-btn":"_lyd-close-btn_1g78i_209"},tc=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(nc,{})},{mode:"modal",label:"Modal",icon:e.jsx(E.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(E.Icon,{name:"Fullscreen",size:"sm"})}];function rc({value:t,onChange:r}){return e.jsx("div",{className:Le["lyd-vm-group"],role:"group","aria-label":"View mode",children:tc.map(n=>e.jsx("button",{type:"button",className:Le["lyd-vm-btn"],"data-active":t===n.mode,"aria-label":`Switch to ${n.label} view`,"aria-pressed":t===n.mode,onClick:()=>r(n.mode),children:n.icon},n.mode))})}function nc(){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 Sr={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function oc(t){return t?t in Sr?Sr[t]:t:Sr.xl}function Pt(t,r){let n=null;return d.Children.forEach(t,s=>{d.isValidElement(s)&&s.type===r&&(n=s.props.children??null)}),n}function sc(t){const{isOpen:r,onClose:n,viewMode:s,defaultViewMode:o="modal",onViewModeChange:i,showViewModeToggle:l=!0,showCloseButton:c=!0,size:a,asideWidth:u,disableEscapeClose:f=!1,disableBackdropClose:g=!1,lockBodyScroll:m=!0,children:y}=t,[k,b]=d.useState(o),M=s??k,L=we.useMediaQuery("md")?M:"fullscreen",C=d.useCallback(P=>{s===void 0&&b(P),i==null||i(P)},[s,i]),v=d.useRef(null);d.useEffect(()=>{if(!(!r||!m))return v.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=v.current??""}},[r,m]);const W=d.useRef(n);W.current=n,d.useEffect(()=>{if(r)return Re.registerOverlay({onEscape:f?void 0:()=>W.current()})},[r,f]);const O=d.useMemo(()=>Pt(y,Kt),[y]),w=d.useMemo(()=>Pt(y,er),[y]),R=d.useMemo(()=>Pt(y,tr),[y]),I=d.useMemo(()=>Pt(y,rr),[y]);if(!r)return null;const J=[Le["lyd-panel"],L==="modal"&&Le["lyd-modal"],L==="fullscreen"&&Le["lyd-fullscreen"],L==="sidebar"&&Le["lyd-sidebar"]].filter(Boolean).join(" "),X={"--lyd-max-w":oc(a),...u!==void 0&&{"--lyd-aside-w":u}},Z=()=>{g||n()};return typeof document>"u"?null:Ut.createPortal(e.jsxs("div",{className:Le["lyd-root"],style:X,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:Le["lyd-backdrop"],onClick:Z,"aria-hidden":"true"}),e.jsxs("div",{className:J,children:[e.jsxs("div",{className:Le["lyd-header"],children:[e.jsx("div",{className:Le["lyd-header-content"],children:O}),e.jsxs("div",{className:Le["lyd-header-actions"],children:[l&&e.jsx(rc,{value:M,onChange:C}),c&&e.jsx("button",{type:"button",className:Le["lyd-close-btn"],onClick:n,"aria-label":"Close dialog",children:e.jsx(E.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:Le["lyd-main"],children:[e.jsx("div",{className:Le["lyd-body"],children:w}),R&&e.jsx("aside",{className:Le["lyd-aside"],children:R})]}),I&&e.jsx("div",{className:Le["lyd-footer"],children:I})]})]}),document.body)}const Tt=sc;Tt.Header=Kt;Tt.Body=er;Tt.Aside=tr;Tt.Footer=rr;function ic({url:t,filename:r,onClose:n}){const s=d.useRef(n);return s.current=n,d.useEffect(()=>Re.registerOverlay({onEscape:()=>s.current()}),[]),e.jsxs("div",{onClick:n,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:o=>o.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:t,download:r,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:n,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:t,alt:r,onClick:o=>o.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:r})]})}const To="var(--sa-border-subtle, #e5e7eb)",Qt=()=>e.jsx(x.Box,{style:{width:1,height:22,backgroundColor:To}}),lc=t=>typeof t=="number"?`${t}px`:t;function Io({count:t,children:r,label:n,onClear:s,clearLabel:o="Clear selection",clearDisabled:i=!1,bottom:l=20,zIndex:c=50,style:a,className:u}){if(t===0)return null;const f=typeof n=="function"?n(t):n??`${t} selected`;return e.jsx(x.Box,{direction:"row",justify:"center",style:{position:"fixed",bottom:lc(l),left:0,right:0,zIndex:c,pointerEvents:"none"},children:e.jsxs(x.Box,{direction:"row",align:"center",gap:"xs",bg:"white",padding:"spacing-8",className:u,style:{pointerEvents:"auto",borderRadius:10,border:`1px solid ${To}`,boxShadow:"var(--sa-shadow-xl, 0 10px 25px -5px rgb(0 0 0/0.15))",...a},children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",whiteSpace:"nowrap",style:{paddingInline:6},children:f}),e.jsx(Qt,{}),r,s&&e.jsxs(e.Fragment,{children:[e.jsx(Qt,{}),e.jsx(Be.Tooltip,{label:o,position:"top",children:e.jsx(H.Button,{variant:"tertiary",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"Cross",size:"xs"}),"aria-label":o,onClick:s,disabled:i})})]})]})})}Io.Divider=Qt;const nr=t=>{const{variant:r="outlined",overflow:n="hidden",style:s,children:o,...i}=t;return e.jsx(kr.Card,{variant:r,overflow:n,style:{display:"flex",flexDirection:"column",...s},...i,children:o})},cc=t=>t==null?void 0:typeof t=="number"?`${t}px`:t,Oo=({src:t,alt:r="",height:n=140,bg:s="var(--sa-background-neutral, #f0f1f2)",avatar:o,children:i})=>e.jsxs(x.Box,{style:{position:"relative",marginBottom:o?24:void 0},children:[e.jsx(x.Box,{style:{height:cc(n),background:t?void 0:s,overflow:"hidden"},children:t?e.jsx("img",{src:t,alt:r,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):null}),i?e.jsx(x.Box,{style:{position:"absolute",inset:0,pointerEvents:"none"},children:i}):null,o?e.jsx(x.Box,{style:{position:"absolute",left:16,bottom:0,transform:"translateY(50%)"},children:o}):null]}),Ro=({avatar:t,title:r,subtitle:n,action:s,divided:o=!1,children:i})=>e.jsx(x.Box,{padding:"md",style:{borderBottom:o?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:i??e.jsxs(ie.Flex,{direction:"row",align:"center",gap:"sm",children:[t,e.jsxs(x.Box,{flex:"1",style:{minWidth:0},children:[r!=null&&e.jsx(D.Text,{fontWeight:"semibold",truncate:!0,children:r}),n!=null&&e.jsx(D.Text,{fontSize:"sm",color:"subtlest",truncate:!0,children:n})]}),s!=null&&e.jsx(x.Box,{style:{flexShrink:0},children:s})]})}),Wo=({left:t,right:r,divided:n=!0,children:s})=>e.jsx(x.Box,{padding:"md",style:{marginTop:"auto",borderTop:n?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:s??e.jsxs(ie.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",children:[e.jsx(x.Box,{style:{minWidth:0},children:t}),e.jsx(x.Box,{style:{flexShrink:0},children:r})]})});nr.Media=Oo;nr.Header=Ro;nr.Footer=Wo;const ac=t=>{const{defaultTab:r=0,paramKey:n="tab"}=t||{},{useSearchParams:s}=nt(),[o,i]=s(),l=bt.searchParamsToObject(o.toString());return{activeTab:l[n]?parseInt(l[n]):r,handleTabChange:u=>{i({...l,[n]:u.toString()})},searchQueries:l}};function dc({appName:t,menuConfig:r,formatTitle:n}){const{useLocation:s}=nt(),o=s();d.useEffect(()=>{let i=null,l=null;for(const u of r){const f=u.items.find(g=>g.to?g.to==="/"?o.pathname==="/":!!(g.to===o.pathname||o.pathname.startsWith(g.to+"/")):!1);if(f){i=f,l=u;break}}const c=[];i!=null&&i.title&&c.push(i.title),l!=null&&l.name&&c.push(l.name.toTitleCase());const a=(u,f)=>u.length>0?`${u.join(" - ")} | ${f}`:f;document.title=(n||a)(c,t)},[o.pathname])}const uc=()=>{const{useSearchParams:t,useParams:r,useLocation:n}=nt(),[s,o]=t(),i=bt.searchParamsToObject(s.toString()),l=r(),c=n(),a=l.id;return{setSearchParams:o,searchParams:s,searchQueries:i,isHasQuery:(y,k)=>s.has(y)&&s.get(y)===k,getQueryParam:y=>s.get(y),getRouteParam:y=>l[y],params:l,location:c,id:a,hasId:!!a}};function xc(t){var s,o;const r=t.decodedAccessToken;return d.useMemo(()=>{var a,u;const i=((u=(a=r==null?void 0:r.access)==null?void 0:a.role)==null?void 0:u.code)??"",l=Object.keys(t.role).reduce((f,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,y=>y.replace("_","").toUpperCase())}`;return{...f,[m]:!1}},{});return{...Object.keys(t.role).reduce((f,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,y=>y.replace("_","").toUpperCase())}`;return{...f,[m]:i===t.role[g]}},l),hasRole:f=>i===t.role[f],getRoleKey:()=>i}},[(o=(s=r==null?void 0:r.access)==null?void 0:s.role)==null?void 0:o.code,t])}exports.ASIDE_WIDTH_VAR=Tr;exports.AdvanceFilterBar=ho;exports.App=is;exports.AppComponent=Yn;exports.AppContext=Or;exports.AppLayout=xs;exports.AsideBar=Hl;exports.BackButton=fs;exports.ColumnFilterDropdown=Do;exports.ColumnMenu=ko;exports.ConfirmationDialog=$l;exports.DataTable=So;exports.DecisionWrapper=ae;exports.EachUtils=$t;exports.EmptyStatePage=Zl;exports.EntityCard=nr;exports.EntityCardFooter=Wo;exports.EntityCardHeader=Ro;exports.EntityCardMedia=Oo;exports.FLOATING_FOOTER_HEIGHT_VAR=Ir;exports.FilterBar=bi;exports.FilterDrawer=xo;exports.FloatingFooter=Pl;exports.ForbiddenPage=Jl;exports.Form=El;exports.FullSection=Kl;exports.HeaderLeftSlot=ls;exports.HeaderLeftSlotOutlet=Kn;exports.HeaderLeftSlotProvider=$n;exports.HorizontalField=js;exports.ImagePreview=ic;exports.InputFile=Fo;exports.InputImage=Eo;exports.LayoutDialog=Tt;exports.LayoutDialogAside=tr;exports.LayoutDialogBody=er;exports.LayoutDialogFooter=rr;exports.LayoutDialogHeader=Kt;exports.ModuleSwitcher=ms;exports.ModuleSwitcherModal=no;exports.NotFoundPage=Ql;exports.PageLayout=Cs;exports.Pressable=Lt;exports.RightDrawer=oo;exports.SIDEBAR_DEFAULT_WIDTH=Jt;exports.SIDEBAR_MAX_WIDTH=Ar;exports.SIDEBAR_MIN_WIDTH=Wr;exports.ScrollToTopButton=Mo;exports.Section=Ss;exports.SectionFooter=Nr;exports.SectionHeader=Pr;exports.SelectButton=ec;exports.SelectionActionBar=Io;exports.SelectionActionBarDivider=Qt;exports.ServerErrorPage=Xl;exports.SidePanel=Al;exports.SidePanelItem=Ol;exports.SidebarBadgesProvider=_n;exports.SidebarGroupSlot=cs;exports.SidebarGroupSlotOutlet=to;exports.SidebarGroupSlotProvider=eo;exports.SidebarHeaderSlot=Xn;exports.SidebarProvider=Gn;exports.StarasiaRouterProvider=Jn;exports.TableFooter=wo;exports.TableHeader=Co;exports.TableLayout=Vi;exports.TableSection=Ii;exports.TableWrapper=vo;exports.ToggleStatus=Fl;exports.Typography=Qe;exports.VerticalField=Nl;exports.clearModuleSelection=as;exports.createInitialFromUserName=Gi;exports.cssVars=$i;exports.expandDateCompact=Bi;exports.formHasChanged=ol;exports.formatDate=Yi;exports.formatDateToIndonesian=Bo;exports.formatRupiah=Ui;exports.getDateFilterValue=uo;exports.getDateRangeFilterValue=Ps;exports.getInitials=Ji;exports.getValueDropdownMultipleFilter=ao;exports.getValueRadioFilter=Vs;exports.getValueSearch=Yt;exports.getValuesFilter=_t;exports.handleChangeFilter=Mt;exports.handleOnScroll=hl;exports.isEmail=dl;exports.isFilterActive=Ns;exports.isOnlyLettersAndSpaces=il;exports.isPhoneNumber=sl;exports.isSlug=ul;exports.localStorageAdapter=qr;exports.oneDayInMs=Ki;exports.parseIndonesianDateToDate=Qi;exports.preventNonCoordinateInput=xl;exports.preventNonNumberAndDecimalInput=al;exports.preventNonNumberInput=ll;exports.preventNumberInput=cl;exports.resolveDateRangeValueToString=lo;exports.resolveDateValueToString=co;exports.resolveDropdownValueToString=so;exports.resolveRadioValueToString=io;exports.resolveSidebarBadge=Nt;exports.storageKeys=Ct;exports.textWidth=el;exports.useApp=Rr;exports.useAppState=Pn;exports.useAuthRole=xc;exports.useDynamicTitle=dc;exports.useFilterBarApiParams=Di;exports.useFilterBarControls=ki;exports.useModuleSelection=Vr;exports.useRouteInfo=We;exports.useRouteParams=uc;exports.useRouterAdapter=nt;exports.useSidebar=Qn;exports.useSidebarBadges=qn;exports.useTabState=ac;exports.useTableSortApiParams=Pi;Object.keys(nn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>nn[t]})});Object.keys(on).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>on[t]})});Object.keys(ct).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ct[t]})});Object.keys(x).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>x[t]})});Object.keys(pt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>pt[t]})});Object.keys(H).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>H[t]})});Object.keys(kr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>kr[t]})});Object.keys(xt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>xt[t]})});Object.keys(Re).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Re[t]})});Object.keys(qt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>qt[t]})});Object.keys(jt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>jt[t]})});Object.keys(we).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>we[t]})});Object.keys(bt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>bt[t]})});Object.keys(at).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>at[t]})});Object.keys(T).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>T[t]})});Object.keys(Et).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Et[t]})});Object.keys(Ft).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ft[t]})});Object.keys(q).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>q[t]})});Object.keys(sn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>sn[t]})});Object.keys(Br).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Br[t]})});Object.keys(yt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>yt[t]})});Object.keys(ln).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ln[t]})});Object.keys(vt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>vt[t]})});Object.keys(Be).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Be[t]})});Object.keys(rt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>rt[t]})});Object.keys(Fr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Fr[t]})});Object.keys(D).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>D[t]})});Object.keys(E).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>E[t]})});Object.keys(ie).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ie[t]})});Object.keys(cn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>cn[t]})});Object.keys(an).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>an[t]})});Object.keys(dn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>dn[t]})});Object.keys(un).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>un[t]})});Object.keys(xn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>xn[t]})});Object.keys(Ge).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ge[t]})});Object.keys(hn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>hn[t]})});
|