@starasia/admin 14.12.0 → 14.13.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/index.cjs.js +18 -18
- package/dist/index.es.js +1537 -1528
- package/dist/index.umd.js +16 -16
- package/dist/types/menu.d.ts +17 -0
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(u,gr){typeof exports=="object"&&typeof module<"u"?gr(exports,require("@starasia/alert"),require("@starasia/avatar"),require("@starasia/badges"),require("@starasia/box"),require("@starasia/breadcrumb"),require("@starasia/button"),require("@starasia/card"),require("@starasia/date"),require("@starasia/dialog"),require("@starasia/drawer"),require("@starasia/dropdown"),require("@starasia/hooks"),require("@starasia/http"),require("@starasia/input"),require("@starasia/menu"),require("@starasia/pagination"),require("@starasia/storage"),require("@starasia/table"),require("@starasia/tabs"),require("@starasia/textarea"),require("@starasia/theme"),require("@starasia/toast"),require("@starasia/toggle"),require("@starasia/tooltip"),require("@starasia/checkbox"),require("@starasia/radio"),require("@starasia/text"),require("@starasia/icon"),require("@starasia/flex"),require("@starasia/grid"),require("@starasia/progress"),require("@starasia/stepper"),require("@starasia/accordion"),require("@starasia/story-record"),require("@starasia/skeleton"),require("@starasia/progress-stepper"),require("react/jsx-runtime"),require("react"),require("react-dom"),require("react-easy-crop")):typeof define=="function"&&define.amd?define(["exports","@starasia/alert","@starasia/avatar","@starasia/badges","@starasia/box","@starasia/breadcrumb","@starasia/button","@starasia/card","@starasia/date","@starasia/dialog","@starasia/drawer","@starasia/dropdown","@starasia/hooks","@starasia/http","@starasia/input","@starasia/menu","@starasia/pagination","@starasia/storage","@starasia/table","@starasia/tabs","@starasia/textarea","@starasia/theme","@starasia/toast","@starasia/toggle","@starasia/tooltip","@starasia/checkbox","@starasia/radio","@starasia/text","@starasia/icon","@starasia/flex","@starasia/grid","@starasia/progress","@starasia/stepper","@starasia/accordion","@starasia/story-record","@starasia/skeleton","@starasia/progress-stepper","react/jsx-runtime","react","react-dom","react-easy-crop"],gr):(u=typeof globalThis<"u"?globalThis:u||self,gr(u["@starasia/admin"]={},u.alert,u.avatar,u.badges,u.box,u.breadcrumb,u.button,u.card,u.date,u.dialog,u.drawer,u.dropdown,u.hooks,u.http,u.input,u.menu,u.pagination,u.storage,u.table,u.tabs,u.textarea,u.theme,u.toast,u.toggle,u.tooltip,u.checkbox,u.radio,u.text,u.icon,u.flex,u.grid,u.progress,u.stepper,u.accordion,u.storyRecord,u.skeleton,u.progressStepper,u.jsxRuntime,u.React,u.ReactDOM,u.ReactEasyCrop))})(this,function(u,gr,Hr,cr,f,yr,j,dt,hr,Pe,Pr,pr,Ce,br,lr,A,Er,mr,Q,ro,ht,vr,to,Cr,Ie,nr,ft,S,F,ae,oo,lo,no,so,co,Ye,io,e,h,Vr,$l){"use strict";const Kl={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},ut=h.createContext(Kl),gt=()=>h.useContext(ut),ao=r=>{const[t,o]=h.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:o}},ho=h.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),fo=({children:r})=>{const[t,o]=h.useState({}),n=h.useCallback(i=>{o(a=>typeof i=="function"?i(a):i)},[]),l=h.useCallback((i,a)=>{o(d=>{const g=typeof a=="function"?a(d[i]):a;return{...d,[i]:g}})},[]),s=h.useCallback(i=>{o(a=>{if(!(i in a))return a;const d={...a};return delete d[i],d})},[]),c=h.useMemo(()=>({badges:t,setBadge:l,setBadges:n,clearBadge:s}),[t,l,n,s]);return e.jsx(ho.Provider,{value:c,children:r})},uo=()=>h.useContext(ho),jr=(r,t)=>{const o=t!==void 0?t:r;return o==null?null:typeof o=="string"||typeof o=="number"?{value:o}:o},yt=240,pt=200,bt=480,Rl="sa-sidebar-width",vt=(r,t,o)=>Math.min(Math.max(r,t),o),en=(r,t,o,n)=>{if(typeof window>"u")return t;try{const l=window.localStorage.getItem(r);if(!l)return t;const s=parseInt(l,10);return Number.isFinite(s)?vt(s,o,n):t}catch{return t}},go=(r,t)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(r,String(t))}catch{}},yo=h.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},width:yt,setWidth:()=>{},resetWidth:()=>{},minWidth:pt,maxWidth:bt,mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),po=({children:r,defaultCollapsed:t=!1,defaultWidth:o=yt,minWidth:n=pt,maxWidth:l=bt,widthStorageKey:s=Rl})=>{const[c,i]=h.useState(t),[a,d]=h.useState(!1),[g,b]=h.useState(()=>en(s,o,n,l)),p=h.useCallback(B=>{i(z=>typeof B=="function"?B(z):B)},[]),C=h.useCallback(()=>i(B=>!B),[]),E=h.useCallback(()=>i(!0),[]),w=h.useCallback(()=>i(!1),[]),W=h.useCallback(B=>{b(z=>{const H=typeof B=="function"?B(z):B,N=vt(Math.round(H),n,l);return go(s,N),N})},[n,l,s]),L=h.useCallback(()=>{const B=vt(o,n,l);go(s,B),b(B)},[o,n,l,s]),I=h.useCallback(B=>{d(z=>typeof B=="function"?B(z):B)},[]),k=h.useCallback(()=>d(!0),[]),D=h.useCallback(()=>d(!1),[]),O=h.useCallback(()=>d(B=>!B),[]),T=h.useMemo(()=>({collapsed:c,setCollapsed:p,toggle:C,collapse:E,expand:w,width:g,setWidth:W,resetWidth:L,minWidth:n,maxWidth:l,mobileOpen:a,setMobileOpen:I,openMobile:k,closeMobile:D,toggleMobile:O}),[c,p,C,E,w,g,W,L,n,l,a,I,k,D,O]);return e.jsx(yo.Provider,{value:T,children:r})},bo=()=>h.useContext(yo),vo=h.createContext(null),Co=({adapter:r,children:t})=>e.jsx(vo.Provider,{value:r,children:t}),sr=()=>{const r=h.useContext(vo);if(!r)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 r},xo=({router:r,routerAdapter:t,menus:o=[],menuBottom:n,logo:l,appName:s="Workspace",initialUserData:c,theme:i})=>{const a=ao({initialUserData:c}),{theme:d}=vr.useTheme();return e.jsx(Co,{adapter:t,children:e.jsx(ut.Provider,{value:{logo:l,appName:s,menus:o,userData:a.userData,setUserData:a.setUserData,menuBottom:n},children:e.jsx(fo,{children:e.jsx(po,{children:i?e.jsx(vr.ThemeProvider,{value:i,children:r}):d?e.jsx(vr.ThemeProvider,{value:d,children:r}):r})})})})},rn=h.memo(xo);function wo({collapsed:r=!1,children:t}){if(!t)return null;const o=typeof t=="function",n=o?t({collapsed:r}):t;return n==null||n===!1?null:e.jsx("div",{style:{position:"sticky",top:"var(--app-header-height, 4rem)",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:r?"calc((var(--app-header-height, 4rem) - 2rem) / 2)":"0.5rem",paddingRight:r?"calc((var(--app-header-height, 4rem) - 2rem) / 2)":"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:o?n:e.jsx("div",{style:{opacity:r?0:1,transition:"opacity 0.3s",visibility:r?"hidden":"visible"},children:n})})}const Ct=h.createContext(null);function Do({children:r}){const[t,o]=h.useState(null),[n,l]=h.useState(null),[s,c]=h.useState(null),[i,a]=h.useState(0),d=h.useCallback(()=>(a(g=>g+1),()=>a(g=>g-1)),[]);return e.jsx(Ct.Provider,{value:{prependNode:t,appendNode:n,replaceNode:s,setPrependNode:o,setAppendNode:l,setReplaceNode:c,replaceCount:i,registerReplace:d},children:r})}function So({children:r}){const t=h.useContext(Ct);return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:t.setPrependNode,style:{display:"contents"}}),t.replaceCount>0?e.jsx("div",{ref:t.setReplaceNode,style:{display:"contents"}}):r,e.jsx("div",{ref:t.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:r})}function tn({children:r,mode:t="append"}){const o=h.useContext(Ct);if(h.useEffect(()=>{if(!(t!=="replace"||!o))return o.registerReplace()},[t,o]),!o)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const n=t==="prepend"?o.prependNode:t==="replace"?o.replaceNode:o.appendNode;return n?Vr.createPortal(r,n):null}const xt=h.createContext(null);function ko({children:r}){const[t,o]=h.useState({}),[n,l]=h.useState({}),s=h.useCallback((a,d)=>{o(g=>g[a]===d?g:{...g,[a]:d})},[]),c=h.useCallback(a=>(l(d=>({...d,[a]:(d[a]??0)+1})),()=>l(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),i=h.useMemo(()=>({outletNodes:t,setOutletNode:s,slotCounts:n,registerSlot:c}),[t,s,n,c]);return e.jsx(xt.Provider,{value:i,children:r})}function Bo({slotKey:r,fallback:t}){const o=h.useContext(xt),n=o?(o.slotCounts[r]??0)>0:!1,l=h.useRef(o==null?void 0:o.setOutletNode);l.current=o==null?void 0:o.setOutletNode;const s=h.useCallback(c=>{var i;return(i=l.current)==null?void 0:i.call(l,r,c)},[r]);return e.jsx(e.Fragment,{children:n?e.jsx("div",{ref:s,style:{display:"contents"}}):t})}function on({slotKey:r,children:t}){const o=h.useContext(xt),n=h.useRef(o==null?void 0:o.registerSlot);if(n.current=o==null?void 0:o.registerSlot,h.useEffect(()=>{var s;return(s=n.current)==null?void 0:s.call(n,r)},[r]),!o)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const l=o.outletNodes[r];return l?Vr.createPortal(t,l):null}const Nr="moduleSwitcherGroupId",wt="sa-module-switcher-change";function Eo(){if(typeof window>"u")return null;const r=window.localStorage.getItem(Nr);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function mo(r){typeof window>"u"||(r===null?window.localStorage.removeItem(Nr):window.localStorage.setItem(Nr,String(r)),window.dispatchEvent(new CustomEvent(wt,{detail:r})))}function ln(){mo(null)}function Dt(){const[r,t]=h.useState(()=>Eo());return h.useEffect(()=>{const n=()=>{t(Eo())},l=s=>{s.key===Nr&&n()};return window.addEventListener(wt,n),window.addEventListener("storage",l),()=>{window.removeEventListener(wt,n),window.removeEventListener("storage",l)}},[]),{selectedGroupId:r,setSelectedGroupId:n=>{mo(n),t(n)}}}let _r=0,ur=!1,Fo=new Set;function nn(r,t){const[o,n]=h.useState(!1),l=h.useRef(null),s=h.useRef(null);return h.useLayoutEffect(()=>{const c=l.current;if(!c)return;let i=0;const a=()=>{i=0;const g=s.current;if(!g)return;const b=g.scrollWidth>c.clientWidth;n(p=>p===b?p:b)},d=new ResizeObserver(()=>{i||(i=requestAnimationFrame(a))});return d.observe(c),a(),()=>{i&&cancelAnimationFrame(i),d.disconnect()}},[r,t]),{containerRef:l,textRef:s,truncated:o}}function Mo({text:r,textStyle:t,active:o=!1}){const{containerRef:n,textRef:l,truncated:s}=nn(r,o),c=e.jsx(S.Text,{ref:l,as:"span",fontSize:"md",fontWeight:o?"medium":"normal",truncate:!0,style:{display:"block",...t},children:r});return e.jsx(f.Box,{ref:n,display:"block",style:{flex:1,minWidth:0},children:s?e.jsx(Ie.Tooltip,{fluid:!0,label:r,position:"top",children:c}):c})}const sn=200,St="var(--app-header-height, 4rem)",Io="44px",kt=`calc((${St} - 2rem) / 2)`,To=16;function cn({children:r,headerLeftSlot:t,profile:o,isLoadingProfile:n,onLogout:l,isLoggingOut:s,loadingComponent:c,sidebarHeaderContent:i,headerActions:a,profileRole:d,profileMenuButtons:g,profileMenuItems:b,logoutButton:p,resizableSidebar:C=!0}){var fr,nt;const{useSearchParams:E,useNavigate:w,useLocation:W,Outlet:L}=sr(),[I]=E(),k=I.get("embed")==="true",D=gt(),{badges:O}=uo(),T=w(),B=W(),H=!Ce.useMediaQuery("md"),[N,$]=h.useState(!1),{collapsed:Z,setCollapsed:G,width:X,setWidth:oe,resetWidth:J,minWidth:_,maxWidth:V,mobileOpen:ce,setMobileOpen:xe}=bo(),[me,ue]=h.useState(!1),[we,qe]=h.useState(()=>new Set(Fo)),[fe,We]=h.useState(null),{selectedGroupId:Fe,setSelectedGroupId:je}=Dt(),ne=Z&&!H;h.useEffect(()=>{Fo=we},[we]);const ie=h.useRef(null),ze=h.useRef(null),Ze=h.useRef(null),[Te,De]=h.useState(!1),[Ne,P]=h.useState(null),R=C&&!H&&!Z,U=m=>Math.min(Math.max(m,_),V),de=Ne??X,Me=m=>{var Ee,tr,Be;if(!R)return;m.preventDefault();const Y=m.clientX,K=((Ee=Ze.current)==null?void 0:Ee.getBoundingClientRect().width)??X;(Be=(tr=m.currentTarget).setPointerCapture)==null||Be.call(tr,m.pointerId),De(!0),document.body.style.userSelect="none",document.body.style.cursor="col-resize";let Se=0,Ae=K;const Re=Sr=>{Ae=K+(Sr.clientX-Y),Se||(Se=requestAnimationFrame(()=>{Se=0,P(U(Ae))}))},Le=()=>{Se&&cancelAnimationFrame(Se),window.removeEventListener("pointermove",Re),window.removeEventListener("pointerup",Le),document.body.style.userSelect="",document.body.style.cursor="",P(null),De(!1),Ae<sn?G(!0):oe(U(Ae))};window.addEventListener("pointermove",Re),window.addEventListener("pointerup",Le)},ye=m=>{R&&(m.key==="ArrowLeft"?(m.preventDefault(),oe(Y=>Y-To)):m.key==="ArrowRight"?(m.preventDefault(),oe(Y=>Y+To)):m.key==="Home"?(m.preventDefault(),oe(_)):m.key==="End"&&(m.preventDefault(),oe(V)))};h.useEffect(()=>{const m=ie.current;if(!m)return;const Y=()=>{ur||(_r=m.scrollTop)};return m.addEventListener("scroll",Y),()=>m.removeEventListener("scroll",Y)},[]);const ke=()=>{const m=ie.current;m&&_r>0&&(ur=!0,m.scrollTop=_r,requestAnimationFrame(()=>{ur=!1}))};h.useLayoutEffect(()=>{ur=!0,ke();const m=setTimeout(()=>{ur=!1},300);return()=>clearTimeout(m)},[]),h.useLayoutEffect(()=>{D.menus.length>0&&(_r>0?ke():requestAnimationFrame(()=>{var Y;const m=(Y=ie.current)==null?void 0:Y.querySelector("[data-menu-active='true']");m&&m.scrollIntoView({block:"center",behavior:"instant"})}))},[D.menus]),h.useEffect(()=>{ur=!0,ke();const m=setTimeout(ke,0),Y=setTimeout(ke,50),K=setTimeout(ke,100),Se=setTimeout(ke,200),Ae=setTimeout(()=>{ur=!1},300),Re=setTimeout(()=>{const Le=ie.current,Ee=Le==null?void 0:Le.querySelector("[data-menu-active='true']");if(Le&&Ee){const tr=Le.getBoundingClientRect(),Be=Ee.getBoundingClientRect();Be.top>=tr.top&&Be.bottom<=tr.bottom||Ee.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(m),clearTimeout(Y),clearTimeout(K),clearTimeout(Se),clearTimeout(Ae),clearTimeout(Re)}},[B.pathname]),h.useEffect(()=>{ze.current&&(ze.current.scrollTop=0)},[B.pathname]),h.useEffect(()=>{H&&xe(!1)},[B.pathname,H]),h.useEffect(()=>{H&&G(!0)},[H]),h.useEffect(()=>{const m=document.documentElement;return m.style.setProperty("--app-header-height",Io),()=>{m.style.removeProperty("--app-header-height")}},[]);const $e=()=>{$(!0)},Ge=()=>{$(!1)},Qe=()=>{$(!1),l()},Ke=m=>{const Y=[m.to];return m.children&&Y.push(...m.children.map(K=>K.to)),Y},Ue=[...D.menus.flatMap(m=>m.items.flatMap(Ke)),...((fr=D.menuBottom)==null?void 0:fr.flatMap(Ke))??[]],pe=m=>{if(!B.pathname.startsWith(m))return!1;const Y=Ue.filter(K=>B.pathname.startsWith(K)).sort((K,Se)=>Se.length-K.length)[0];return m===Y};h.useEffect(()=>{var Y;const m=K=>{var Se;(Se=K.children)!=null&&Se.some(Ae=>B.pathname.startsWith(Ae.to))&&qe(Ae=>{const Re=new Set(Ae);return Re.add(K.id),Re})};D.menus.forEach(K=>{K.items.forEach(m)}),(Y=D.menuBottom)==null||Y.forEach(m)},[B.pathname,D.menus,D.menuBottom]);const rr=m=>{qe(Y=>{const K=new Set(Y);return K.has(m)?K.delete(m):K.add(m),K})};h.useEffect(()=>{D.menus.length!==0&&Fe!==null&&!D.menus.some(m=>m.id===Fe)&&je(null)},[D.menus,Fe,je]);const Dr=h.useMemo(()=>{if(Fe!==null)return D.menus.filter(K=>K.id===Fe||K.parentGroupId===Fe);const m=D.menus.filter(K=>K.parentGroupId===void 0),Y=D.menus.filter(K=>K.parentGroupId!==void 0).flatMap(K=>K.items);return Y.length===0?m:[...m,{id:18,name:"Pengaturan",items:Y,parentGroupId:void 0}]},[D.menus,Fe]);if(k)return e.jsx(f.Box,{as:"main",overflow:"overflow-y-auto",bg:"surface-inverse",style:{height:"100vh"},children:r||e.jsx(L,{})});const ar=m=>{const Y=m.children&&m.children.length>0,K=we.has(m.id),Se=Y?m.children.some(Le=>pe(Le.to)):pe(m.to),Ae=jr(m.badge,O[m.id]),Re=!!Ae&&Z&&!H;return e.jsxs(f.Box,{display:"block","data-menu-active":Se||void 0,children:[e.jsxs(f.Box,{as:"button",onClick:Le=>{if(Y)if(Z&&!H){const Ee=Le.currentTarget.getBoundingClientRect();We({item:m,top:Ee.top,left:Ee.right+8})}else rr(m.id);else T(m.to)},fullWidth:!0,direction:"row",align:"center",justify:Z&&!H?"center":void 0,gap:"sm",paddingInline:Z&&!H?void 0:"sm",paddingBlock:"xs",height:"height-32",borderRadius:Se?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:Se?"white":void 0,hover:Se?void 0:{bg:"neutral"},title:Z&&!H?m.title:void 0,style:{textAlign:"left",color:Se?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",borderColor:Se?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsxs(f.Box,{position:"relative",display:"inline-flex",flexShrink:"0",style:{alignItems:"center"},children:[e.jsx(F.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),Re&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",top:"top-n2",right:"right-n2",display:"inline-flex",borderRadius:"rounded-full",style:{boxShadow:"0 0 0 1px var(--sa-background-primary, #ffffff)"},children:e.jsx(cr.BadgeDot,{tone:"error",variant:"solid",size:"xs"})})]}),(!Z||H)&&e.jsxs(e.Fragment,{children:[e.jsx(Mo,{text:m.title,active:Se,textStyle:{transition:"opacity 0.3s"}}),Ae&&e.jsx(cr.Badge,{text:String(Ae.value),variant:Ae.variant??"info",size:"xs",border:!0}),Y&&e.jsx(F.Icon,{name:"ChevronDown",size:"sm",style:{flexShrink:0,transition:"transform 0.2s",transform:K?"rotate(180deg)":"rotate(0deg)"}})]})]}),Y&&(!Z||H)&&(()=>{const Le=m.children.findIndex(Ee=>pe(Ee.to));return e.jsxs(f.Box,{position:"relative",overflow:"overflow-hidden",style:{marginLeft:"1rem",paddingLeft:"0.75rem",transition:"all 0.3s ease-in-out",maxHeight:K?`${m.children.length*36}px`:"0px",opacity:K?1:0,marginTop:K?"0.25rem":"0px"},children:[e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",top:"top-0",fullHeight:!0,style:{width:"1.5px",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),Le>=0&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",height:"height-32",zIndex:"10",style:{top:`${Le*32}px`,width:"1.5px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none"}}),m.children.map(Ee=>{const tr=jr(Ee.badge,O[Ee.id]),Be=pe(Ee.to);return e.jsxs(f.Box,{as:"button",onClick:()=>T(Ee.to),fullWidth:!0,direction:"row",align:"center",gap:"sm",paddingLeft:"sm",paddingRight:"sm",paddingBlock:"xs",height:"height-32",borderRadius:Be?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:Be?"white":void 0,hover:Be?void 0:{bg:"neutral"},style:{textAlign:"left",color:Be?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",borderColor:Be?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsx(F.Icon,{name:Ee.icon,size:"sm",style:{flexShrink:0}}),e.jsx(Mo,{text:Ee.title,active:Be}),tr&&e.jsx(cr.Badge,{text:String(tr.value),variant:tr.variant??"info",size:"xs",border:!0})]},Ee.id)})]})})()]},m.id)};return e.jsx(ko,{children:e.jsxs(Do,{children:[e.jsxs(f.Box,{direction:"row",position:"relative",style:{height:"100vh","--app-header-height":Io,"--app-sidebar-width":H?"0px":Z?St:`${de}px`,"--app-footer-zindex":H&&ce?"40":"998"},children:[H&&e.jsx(f.Box,{position:"fixed",zIndex:"40",bg:"black-alpha-a50",style:{inset:0,opacity:ce?.5:0,pointerEvents:ce?"auto":"none",transition:"opacity 0.3s"},onClick:()=>xe(!1)}),e.jsxs(f.Box,{as:"aside",ref:Ze,bg:"surface-inverse",borderWidth:"border-r",borderStyle:"border-solid-r",borderColor:"border-base",flexShrink:H?void 0:"0",style:{width:H?"16.375rem":Z?St:`${de}px`,position:H?"fixed":"relative",...H&&{inset:0,zIndex:50,transform:ce?"translateX(0)":"translateX(-100%)"},transition:Te?"none":"all 0.3s ease-in-out",minWidth:0},children:[e.jsx(f.Box,{onMouseEnter:()=>ue(!0),onMouseLeave:()=>ue(!1),direction:"row",align:"center",justify:"space-between",paddingInline:ne?void 0:"lg",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",position:"relative",style:{height:"var(--app-header-height, 4rem)",...ne?{paddingInline:kt}:null},children:(()=>{const m=!H&&Z&&!ce,Y=m&&me;return e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flex:m?"1":void 0,justify:m?"center":void 0,style:{transition:"opacity 0.2s",opacity:Y?0:1,pointerEvents:Y?"none":"auto"},children:[e.jsx("img",{src:D.logo,alt:"Logo",style:{width:"1.5rem",height:"1.5rem",flexShrink:0}}),(!Z||ce)&&e.jsx(S.Text,{as:"span",fontSize:"md",fontWeight:"semibold",color:"primary",truncate:!0,style:{transition:"opacity 0.3s"},children:D.appName})]}),!H&&!Z&&e.jsx(f.Box,{as:"button",onClick:()=>G(!0),"aria-label":"Collapse sidebar",display:"inline-flex",align:"center",justify:"center",flexShrink:"0",style:{color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(F.Icon,{name:"LayoutLeft",size:"sm"})}),m&&e.jsx(f.Box,{as:"button",onClick:()=>G(!1),"aria-label":"Expand sidebar",position:"absolute",display:"inline-flex",align:"center",justify:"center",width:"width-32",height:"height-32",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-sm",style:{top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"var(--sa-text-primary, #292a2e)",opacity:Y?1:0,pointerEvents:Y?"auto":"none",transition:"opacity 0.2s"},children:e.jsx(F.Icon,{name:"LayoutLeft",size:"sm"})}),H&&e.jsx(f.Box,{as:"button",onClick:()=>xe(!1),"aria-label":"Close menu",align:"center",justify:"center",borderRadius:"rounded-md",style:{padding:"0.375rem",color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(F.Icon,{name:"Cross",size:"md"})})]})})()}),i&&e.jsx(wo,{collapsed:H?!1:Z,children:i}),e.jsx(f.Box,{ref:ie,flex:"1",overflow:"overflow-y-auto",paddingBlock:"lg",children:Dr.map(m=>e.jsxs(f.Box,{marginBottom:"lg",children:[!Z||H?m.name&&e.jsx(S.Text,{fontSize:"sm",fontWeight:"semibold",color:"subtlest",textTransform:"uppercase",truncate:!0,style:{letterSpacing:"0.06em",paddingLeft:"1.25rem",paddingRight:"0.75rem",paddingBottom:"0.25rem",transition:"opacity 0.3s"},children:m.name}):m.name&&e.jsx(f.Box,{"aria-label":m.name,direction:"row",align:"center",justify:"center",paddingBlock:"md",children:e.jsx(f.Box,{width:"width-16",style:{height:"2px",borderRadius:"1px",backgroundColor:m.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx(f.Box,{paddingInline:ne?void 0:"md",gap:"xs",style:ne?{paddingInline:kt}:void 0,children:m.slotKey?e.jsx(Bo,{slotKey:m.slotKey,fallback:m.items.map(Y=>ar(Y))}):m.items.map(Y=>ar(Y))})]},m.id))}),D.menuBottom&&D.menuBottom.length>0&&e.jsx(f.Box,{borderWidth:"border-t",borderStyle:"border-solid-t",borderColor:"border-base",paddingBlock:"md",paddingInline:ne?void 0:"md",bg:"surface-inverse",gap:"xs",flexShrink:"0",style:ne?{paddingInline:kt}:void 0,children:D.menuBottom.map(m=>ar(m))}),R&&e.jsx(f.Box,{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":X,"aria-valuemin":_,"aria-valuemax":V,tabIndex:0,onPointerDown:Me,onKeyDown:ye,onDoubleClick:J,title:"Drag to resize · double-click to reset",position:"absolute",top:"top-0",right:"right-0",fullHeight:!0,style:{width:"6px",transform:"translateX(50%)",cursor:"col-resize",zIndex:5,touchAction:"none",background:Te?"var(--sa-background-brand, #04254f)":"transparent",transition:"background 0.15s"},onMouseEnter:m=>{Te||(m.currentTarget.style.background="var(--sa-border-bold, #0b120e40)")},onMouseLeave:m=>{Te||(m.currentTarget.style.background="transparent")}})]}),e.jsxs(f.Box,{flex:"1",overflow:"overflow-hidden",children:[e.jsxs(f.Box,{as:"header",bg:"white",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",direction:"row",align:"center",justify:"space-between",paddingInline:"lg",flexShrink:"0",style:{height:"var(--app-header-height, 4rem)"},children:[e.jsxs(f.Box,{direction:"row",align:"center",gap:H?"lg":void 0,children:[H&&e.jsx(f.Box,{as:"button",onClick:()=>xe(!0),align:"center",justify:"center",borderRadius:"rounded-md",style:{padding:"0.375rem",color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(F.Icon,{name:"MenuBurger",size:"lg"})}),e.jsx(So,{children:t})]}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"md",children:[a,e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",cursor:"pointer",children:[!H&&e.jsxs(f.Box,{display:"block",textAlign:"right",customMaxWidth:"12.5rem",children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",textAlign:"right",truncate:!0,lineHeight:"leading-none",children:n?"Loading...":(o==null?void 0:o.name)||"unknown"}),e.jsx(S.Text,{fontSize:"sm",color:"subtle",textAlign:"right",truncate:!0,children:n?"":(o==null?void 0:o.email)||"unknown"})]}),e.jsx(Hr.Avatar,{size:"sm",initials:((o==null?void 0:o.name)||"U")[0].toUpperCase(),bg:"var(--sa-background-brand, #04254f)",color:"var(--sa-background-primary, #ffffff)"}),e.jsx(F.Icon,{name:"ChevronDown",size:"xs",color:"subtle"})]})}),e.jsxs(A.MenuLists,{width:280,style:{paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(A.MenuHeading,{children:e.jsxs(f.Box,{align:"center",textAlign:"center",paddingBlock:"sm",fullWidth:!0,children:[e.jsx(Hr.Avatar,{customSize:64,initials:((o==null?void 0:o.name)||"U")[0].toUpperCase(),bg:"var(--sa-background-brand, #04254f)",color:"var(--sa-background-primary, #ffffff)",style:{fontSize:"1.25rem",marginBottom:"0.75rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)"}}),e.jsx(S.Text,{fontSize:"md",fontWeight:"semibold",color:"primary",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(o==null?void 0:o.name)||"unknown"}),e.jsx(S.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(o==null?void 0:o.email)||"unknown"}),d&&e.jsx(S.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:d})]})}),(g&&g.length>0||b)&&e.jsxs(A.MenuBody,{children:[g==null?void 0:g.map((m,Y)=>e.jsx(A.MenuItem,{onClick:m.onClick,startIcon:e.jsx(F.Icon,{name:m.icon,size:"md"}),children:m.label},`${m.label}-${Y}`)),b]}),p??e.jsx(A.MenuFooter,{children:e.jsx(A.MenuItem,{intent:"danger",onClick:$e,startIcon:e.jsx(F.Icon,{name:"Logout",size:"md"}),children:"Logout"})})]})]})]})]}),e.jsx(f.Box,{as:"main",ref:ze,flex:"1",overflow:"overflow-y-auto",children:r||e.jsx(L,{})})]})]}),s&&c&&e.jsx(f.Box,{position:"fixed",align:"center",justify:"center",bg:"black-alpha-a70",style:{inset:0,zIndex:9999},children:c}),e.jsxs(Pe.Dialog,{isShow:N,onHide:Ge,children:[e.jsx(Pe.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Pe.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Pe.DialogFooter,{children:e.jsx(f.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(ae.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(f.Box,{direction:"column",children:e.jsx(j.Button,{secondary:!0,onClick:Ge,children:"Cancel"})}),e.jsx(f.Box,{direction:"column",children:e.jsx(j.Button,{primary:!0,onClick:Qe,children:"Yes, Sure"})})]})})})]}),fe&&e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{onClick:()=>We(null),position:"fixed",style:{inset:0,zIndex:60}}),e.jsxs(f.Box,{role:"dialog","aria-label":fe.item.title,position:"fixed",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-md",shadow:"shadow-lg",padding:"sm",gap:"spacing-2",style:{top:fe.top,left:fe.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem"},children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-500",textTransform:"uppercase",style:{padding:"0.25rem 0.5rem 0.5rem",letterSpacing:"0.05em"},children:fe.item.title}),(nt=fe.item.children)==null?void 0:nt.map(m=>{const Y=pe(m.to),K=jr(m.badge,O[m.id]);return e.jsxs(f.Box,{as:"button",onClick:()=>{T(m.to),We(null)},fullWidth:!0,direction:"row",align:"center",gap:"md",paddingBlock:"sm",paddingInline:"md",borderRadius:"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:Y?"primary-inverse":void 0,hover:Y?void 0:{bg:"primary-inverse"},style:{textAlign:"left",borderColor:"transparent",color:Y?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)"},children:[m.icon&&e.jsx(F.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),e.jsx(S.Text,{as:"span",fontSize:"md",fontWeight:Y?"medium":"normal",whiteSpace:"nowrap",style:{flex:1},children:m.title}),K&&e.jsx(cr.Badge,{text:String(K.value),variant:K.variant??"info",size:"xs",border:!0})]},m.id)})]})]})]})})}const Fr=h.forwardRef(({children:r,...t},o)=>e.jsx(f.Box,{ref:o,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...t,children:r})),Lo=({title:r,iconName:t,textColor:o,iconColor:n,hoverTextColor:l,hoverIconColor:s})=>{const[c,i]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=o??"var(--sa-text-subtle, #8c8f97)",g=s??"var(--sa-text-subtle, #8c8f97)",b=l??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{cursor:"pointer"},children:[e.jsx(F.Icon,{name:t||"ChevronLeft",size:"xs",style:{color:c?g:a,transition:"color 0.15s ease"}}),e.jsx(S.Text,{variant:"sub-h3",style:{color:c?b:d,transition:"color 0.15s ease"},children:r||"Back"})]})},an=({items:r,separator:t="/",iconName:o,iconColor:n,hoverIconColor:l})=>{const{Link:s}=sr(),[c,i]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=l??"var(--sa-text-subtle, #8c8f97)",g=r.length>1?r[0]:void 0,b=!!(g!=null&&g.to||g!=null&&g.onClick),p=e.jsx(F.Icon,{name:o||"ChevronLeft",size:"xs",onMouseEnter:b?()=>i(!0):void 0,onMouseLeave:b?()=>i(!1):void 0,style:{color:b&&c?d:a,transition:"color 0.15s ease",cursor:b?"pointer":void 0}}),C=g!=null&&g.to?e.jsx(s,{to:g.to,replace:!0,style:{textDecoration:"none"},children:p}):g!=null&&g.onClick?e.jsx(Fr,{onClick:g.onClick,children:p}):p;return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",children:[C,e.jsx(yr.Breadcrumb,{separator:t,size:"md",children:r.map((E,w)=>{const W=w===r.length-1;return E.to&&!W?e.jsx(yr.BreadcrumbItem,{children:e.jsx(s,{to:E.to,children:E.label})},w):e.jsx(yr.BreadcrumbItem,{currentPage:W,children:e.jsx(yr.BreadcrumbLink,{onClick:W?void 0:E.onClick,children:E.label})},w)})})]})},dn=r=>{const{Link:t}=sr(),{items:o,separator:n,onClick:l,navigateTo:s,...c}=r;return o&&o.length>0?e.jsx(an,{items:o,separator:n,iconName:c.iconName,iconColor:c.iconColor,hoverIconColor:c.hoverIconColor}):s?e.jsx(f.Box,{direction:"row",children:e.jsx(t,{to:s,replace:!0,style:{textDecoration:"none"},children:e.jsx(Lo,{...c})})}):e.jsx(f.Box,{direction:"row",children:e.jsx(Fr,{onClick:l,children:e.jsx(Lo,{...c})})})},Bt=[{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 Oo(r,t,o){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:r?`2px solid ${o.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:r?o.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:r?t?`0 8px 20px ${o.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${o.activeShadow}`:t?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:t?"translateY(-3px) scale(1.05)":"translateY(0) scale(1)",transition:"box-shadow 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease"}}const Ao={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},Wo={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function zo({isShow:r,onHide:t,menus:o,selectedGroupId:n,onSelect:l}){const[s,c]=h.useState(void 0),i=d=>{l(d),t()},a=Bt[0];return e.jsx(Pe.Dialog,{isShow:r,onHide:t,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Pe.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>i(null),onMouseEnter:()=>c("all"),onMouseLeave:()=>c(void 0),style:Wo,children:[e.jsx("div",{style:Oo(n===null,s==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(F.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Ao,children:"Semua"})]}),o.map((d,g)=>{var w;const b=n===d.id,p=s===d.id,C=((w=d.items[0])==null?void 0:w.icon)??"Grid",E=Bt[(g+1)%Bt.length];return e.jsxs("button",{onClick:()=>i(d.id),onMouseEnter:()=>c(d.id),onMouseLeave:()=>c(void 0),style:Wo,children:[e.jsx("div",{style:Oo(b,p,E),children:e.jsx("div",{style:{color:E.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(F.Icon,{name:C,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Ao,children:d.name})]},d.id)})]})})})}function hn({onSelect:r,"aria-label":t="Pilih module"}={}){const o=gt(),{useNavigate:n}=sr(),l=n(),{selectedGroupId:s,setSelectedGroupId:c}=Dt(),[i,a]=h.useState(!1),d=g=>{var b;if(c(g),g!==null){const p=o.menus.find(E=>E.id===g),C=(b=p==null?void 0:p.items[0])==null?void 0:b.to;C&&l(C)}r==null||r(g)};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":t,onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent"},children:e.jsx(F.Icon,{name:"GridApplication",size:"sm"})}),s!==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(zo,{isShow:i,onHide:()=>a(!1),menus:o.menus.filter(g=>g.parentGroupId===void 0),selectedGroupId:s,onSelect:d})]})}const fn=(r,t)=>{const o=[];if(t===0)return o.push(r),o;for(let n=0;n<r.length;n+=t){const l=r.slice(n,n+t);o.push(l)}return o},un=h.memo(({value:r,label:t,separator:o,labelWidth:n,lastIndex:l,labelAlign:s="top"})=>{const c=h.useMemo(()=>({padding:0,paddingBottom:l?0:12,verticalAlign:s}),[l,s]),i=h.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:l?0:12,verticalAlign:s}),[l,s]),a=()=>typeof t=="string"?e.jsx(S.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,d=()=>typeof r=="string"||typeof r=="number"?e.jsx(S.Text,{color:"primary",fontWeight:"medium",children:r}):r,g=()=>typeof o=="string"||typeof o=="number"?e.jsx(S.Text,{fontWeight:"medium",color:"subtlest",children:o}):o;return e.jsxs(Q.Tr,{children:[e.jsx(Q.Td,{style:c,width:n,children:a()}),o?e.jsx(Q.Td,{style:i,width:24,children:g()}):null,e.jsx(Q.Td,{style:c,children:d()})]})}),gn=h.memo(({fields:r,separator:t,labelWidth:o})=>e.jsx(Q.Table,{withColumnBorder:!1,withRowBorder:!1,children:r.map((n,l)=>e.jsx(un,{separator:t,labelWidth:o,lastIndex:l===r.length-1,...n},`field-group-field-${l}`))})),yn=h.memo(({maxRow:r=0,maxColumn:t=2,separator:o=":",fields:n=[],labelWidth:l=150,bordered:s=!1})=>{const c=h.useMemo(()=>fn(n,r),[n,r]),i=c.length>2,a=()=>{switch(t){case 1:return"width-full";case 2:return"width-1-2";case 3:return"width-1-3";case 4:return"width-1-4";default:return"width-1-2"}};return e.jsx(f.Box,{gap:i?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:i?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:s?"border":void 0,borderStyle:s?"border-solid":void 0,borderColor:s?"border-subtle":void 0,children:c.map((d,g)=>e.jsx(f.Box,{direction:"column",flex:i?void 0:"1",width:i?a():void 0,marginBottom:i?"lg":void 0,children:e.jsx(gn,{labelWidth:l,fields:d,separator:o})},g))})}),pn=({backButton:r})=>{const[t,o]=h.useState(!1),n=(r==null?void 0:r.iconColor)??"var(--sa-text-subtle, #8c8f97)",l=(r==null?void 0:r.textColor)??"var(--sa-text-subtle, #8c8f97)",s=(r==null?void 0:r.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",c=(r==null?void 0:r.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{cursor:"pointer"},children:[e.jsx(F.Icon,{name:(r==null?void 0:r.iconName)||"ChevronLeft",size:"xs",style:{color:t?s:n,transition:"color 0.15s ease"}}),e.jsx(S.Text,{variant:"sub-h3",style:{color:t?c:l,textDecoration:t?"underline":"none",transition:"color 0.15s ease"},children:(r==null?void 0:r.title)||"Back"})]})},bn=({backButton:r,title:t,titleIcon:o,titleTag:n,children:l,header:s=!0,headerBorder:c=!1,disableAnimation:i=!1,scrollable:a=!1,stickyHeader:d=!1,subHeaders:g,action:b,titleTagProps:p,containerProps:C,headerProps:E})=>{const w=Ce.useMediaQuery("md"),{Link:W,useNavigate:L,useLocation:I}=sr(),k=L(),D=I(),O=r==null?void 0:r.show,T=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}k(-1,{replace:!0})},B=()=>{if(!b)return null;if(h.isValidElement(b))return b;const G=b.filter(X=>X&&(X.title||X.icon));return G.length===0?null:w?e.jsx(f.Box,{direction:"row",gap:"md",children:G.map(({title:X,icon:oe,buttonProps:J,onClick:_},V)=>e.jsx(j.Button,{iconLeft:oe?e.jsx(F.Icon,{name:oe,size:"md"}):void 0,onClick:_,...J,children:X},`action-${V}`))}):e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(F.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{minWidth:200},children:G.map(({title:X,icon:oe,buttonProps:J,onClick:_},V)=>{const ce=(J==null?void 0:J.tone)==="error"||(J==null?void 0:J.danger)===!0;return e.jsx(A.MenuItem,{intent:ce?"danger":void 0,disabled:J==null?void 0:J.disabled,startIcon:oe?e.jsx(F.Icon,{name:oe}):void 0,onClick:_,children:X},`action-${V}`)})})})]})},z=()=>{const G=e.jsx(pn,{backButton:r});return r!=null&&r.navigateTo?e.jsx(f.Box,{direction:"row",children:e.jsx(W,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:G})}):e.jsx(f.Box,{direction:"row",children:e.jsx(Fr,{onClick:T,children:G})})},H=()=>{const G=!!t,X=Array.isArray(b)&&b.length>0,oe=h.isValidElement(b)?!0:X;if(!G&&!oe&&!O)return null;const _=w||!w&&X;return e.jsxs(f.Box,{direction:"column",gap:"xs",paddingBlock:(E==null?void 0:E.paddingBlock)??"sm",paddingInline:(E==null?void 0:E.paddingInline)??"md",...E,style:{...c?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...E==null?void 0:E.style},children:[O&&z(),(G||oe)&&e.jsxs(f.Box,{direction:_?"row":"column",gap:"sm",justify:"space-between",align:_?"center":"flex-start",children:[G?typeof t=="string"?e.jsxs(f.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[o&&e.jsx(F.Icon,{name:o,size:"md",color:"primary"}),e.jsx(S.Text,{variant:"h3",fontWeight:"semibold",children:t})]}),n&&e.jsx(cr.Badge,{border:!0,size:"lg",text:n,...p})]}):t:null,B()]})]})},N=()=>{if(!g||g.length===0)return null;const G=g.filter(J=>J.show!==!1);if(G.length===0)return null;let X=0,oe=-1/0;return G.forEach((J,_)=>{const V=J.order??0;V>=oe&&(oe=V,X=_)}),G.map(({content:J,order:_,borderBottom:V=!0,keepBottomPadding:ce=!1,paddingInline:xe=!0,paddingBlock:me=!0},ue)=>e.jsx(f.Box,{direction:"column",paddingTop:me?"sm":"spacing-0",paddingBottom:me&&(V||ce||ue===X)?"sm":"spacing-0",paddingInline:xe?"md":"spacing-0",style:{...V?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},..._!==void 0?{order:_}:{}},children:J},`sub-header-${ue}`))},$=()=>{const G=s?H():null,X=N();return!G&&!X?null:e.jsxs(f.Box,{direction:"column",style:{...a?{position:"sticky",left:0,...d?{top:0}:{},zIndex:2,background:"var(--sa-background-primary, #ffffff)"}:{},marginBottom:X?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[G,X]})},Z=()=>l;return e.jsxs(f.Box,{direction:"column",as:"main",...C,style:{...a?{height:"100%",minHeight:0,overflow:"auto"}:{},...(C==null?void 0:C.style)??{},...i?{}:{animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"}},children:[$(),Z()]},D.pathname)},vn=h.memo(bn),Cn={icon:"Cross",title:""},xn=320,Ho=16,Po=4,wn=8,Vo=h.forwardRef(({onHide:r,show:t,withBlur:o=!1,style:n,children:l,closeButton:s=Cn,paddingHorizontal:c=!0,width:i,minWidth:a,maxWidth:d,hideBackdrop:g=!1,title:b,headerAction:p,header:C=!0,widthPresets:E,resizable:w=!0,resizeMin:W=xn,resizeMax:L,onWidthChange:I},k)=>{const O=!Ce.useMediaQuery("md"),T=i??d??a??"357px",B=E??[],z=B.length>1,[H,N]=h.useState(()=>{const ne=B.indexOf(T);return ne>=0?ne:0}),[$,Z]=h.useState(null),[G,X]=h.useState(!1),[oe,J]=h.useState(!1),_=h.useRef(null),V=ne=>{_.current=ne,typeof k=="function"?k(ne):k&&(k.current=ne)},ce=z?B[H]:T,xe=$!=null?`${$}px`:ce,me=w&&!O,ue=H===B.length-1,we=()=>{const ne=(H+1)%B.length;Z(null),N(ne),I==null||I(B[ne])},qe=h.useCallback(ne=>{const ie=L??window.innerWidth;return Math.min(Math.max(ne,W),ie)},[W,L]),fe=h.useRef(null),We=ne=>{if(!me)return;ne.preventDefault();const ie=ne.currentTarget;ie.setPointerCapture(ne.pointerId),X(!0);const ze=document.body.style.cursor,Ze=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let Te=null;const De=P=>{const R=qe(window.innerWidth-P.clientX);fe.current=R,Te==null&&(Te=window.requestAnimationFrame(()=>{Te=null,fe.current!=null&&Z(fe.current)}))},Ne=P=>{Te!=null&&window.cancelAnimationFrame(Te),fe.current!=null&&Z(fe.current),ie.releasePointerCapture(P.pointerId),ie.removeEventListener("pointermove",De),ie.removeEventListener("pointerup",Ne),ie.removeEventListener("pointercancel",Ne),document.body.style.cursor=ze,document.body.style.userSelect=Ze,X(!1),fe.current!=null&&(I==null||I(`${fe.current}px`))};ie.addEventListener("pointermove",De),ie.addEventListener("pointerup",Ne),ie.addEventListener("pointercancel",Ne)},Fe=ne=>{var Te;if(!me||ne.key!=="ArrowLeft"&&ne.key!=="ArrowRight")return;ne.preventDefault();const ie=ne.key==="ArrowLeft"?Ho:-Ho,ze=$??((Te=_.current)==null?void 0:Te.offsetWidth)??W,Ze=qe(ze+ie);Z(Ze),I==null||I(`${Ze}px`)},je=()=>{me&&(Z(null),I==null||I(ce))};return e.jsx(Pr.Drawer,{blur:o,isShow:t,position:"right",onHide:r,ref:V,size:xe,style:n,flush:!0,radius:"none",hideBackdrop:g,children:e.jsxs(f.Box,{direction:"column",height:"height-full",children:[me?e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Ubah lebar panel",tabIndex:0,onPointerDown:We,onKeyDown:Fe,onDoubleClick:je,title:"Tarik untuk mengubah lebar — klik dua kali untuk reset",onPointerEnter:()=>J(!0),onPointerLeave:()=>J(!1),style:{position:"absolute",left:0,top:0,bottom:0,width:wn,cursor:"col-resize",zIndex:1,background:G||oe?`linear-gradient(to right, var(--sa-border-brand, var(--sa-border-subtle)) 0 ${Po}px, transparent ${Po}px)`:"transparent",transition:"background 0.15s",touchAction:"none"}}):null,C?e.jsxs(f.Box,{direction:"row",align:"center",justify:"space-between",gap:"sm",paddingInline:"md",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",customHeight:"var(--app-header-height, 44px)",flexShrink:"0",children:[e.jsx(f.Box,{direction:"row",align:"center",gap:"sm",overflow:"overflow-hidden",children:typeof b=="string"?e.jsx(S.Text,{fontSize:"md",fontWeight:"bold",children:b}):b}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flexShrink:"0",children:[p,z?e.jsx(j.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:we,"aria-label":ue?"Kecilkan panel":"Lebarkan panel",iconRight:e.jsx(F.Icon,{name:ue?"ChevronRight":"ChevronLeft"})}):null,s?e.jsx(j.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:r,"aria-label":s.title||"Tutup",iconRight:e.jsx(F.Icon,{name:s.icon}),children:s.title||void 0}):null]})]}):null,e.jsx(f.Box,{direction:"column",paddingBlock:"md",paddingInline:c?"md":"spacing-0",overflow:"overflow-y-auto",style:{flex:1,minHeight:0},children:l})]})})}),Et=h.memo(({children:r,borderBottom:t=!0,padding:o=!0})=>{const n=Ce.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:o?"md":"spacing-0",paddingLeft:o?"md":"spacing-0",paddingRight:o?"md":"spacing-0",style:t?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),mt=h.memo(({children:r,borderTop:t=!0,padding:o=!0})=>{const n=Ce.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:o?"md":"spacing-0",paddingLeft:o?"md":"spacing-0",paddingRight:o?"md":"spacing-0",style:t?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),Dn=h.memo(({children:r,...t})=>e.jsx(f.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),Sn=h.memo(({children:r,title:t,titleTag:o,action:n,header:l,footer:s,actionContainer:c,containerProps:i,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:g={borderTop:!0},variantTag:b="info"})=>{const p=Ce.useMediaQuery("lg"),C=()=>o?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(S.Text,{fontWeight:"medium",children:t}),e.jsx(cr.Badges,{border:!0,text:o,variant:b})]}):e.jsx(S.Text,{fontWeight:"medium",children:t}),E=()=>l||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:t?C():null}),e.jsx(f.Box,{direction:"column",style:p?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...c,children:n??null})]}),w=!!(l||t||n);return e.jsxs(f.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...i,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(i==null?void 0:i.style)??{}},children:[l!==null&&w?e.jsx(Et,{...d,children:E()}):null,e.jsx(Dn,{...a,children:r}),s?e.jsx(mt,{...g,children:s}):null]})}),Xe={H1:r=>e.jsx(S.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(S.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(S.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(S.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(S.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(S.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(S.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(S.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(S.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(S.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(S.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(S.Text,{variant:"body-3",children:r.children,...r.props})},Ve=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=sr(),[n,l]=r(),s=br.searchParamsToObject(n.toString()),c=t(),i=o(),a=c.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,E)=>n.has(C)&&n.get(C)===E,getQueryParam:C=>n.get(C),getRouteParam:C=>c[C],params:c,location:i,id:a,hasId:!!a}},jo=r=>JSON.stringify(r),No=r=>JSON.stringify(r),_o=r=>JSON.stringify(r),qo=r=>JSON.stringify(r),kn=r=>r,Bn=r=>JSON.stringify(r),Mr=r=>{if(typeof r!="string"||r==="")return{};try{const t=JSON.parse(r);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}},Ir=({value:r,name:t,type:o,withSearchParam:n=!0,setSearchParams:l,searchQueries:s,dropdownSearchKey:c,filterKey:i="filter",pageKey:a="page"})=>{if(n){let d;switch(o){case"search":d=kn(r);break;case"dropdown":case"dropdown-multiple":d=jo(r);break;case"radio":d=No(r);break;case"date-range":d=_o(r);break;case"advanced-date-range":d=Bn(r);break;case"date":d=qo(r);break;default:d=r;break}if(typeof d<"u"){const g={...Mr(s[i]),[t]:d},b={...s};c&&typeof c=="string"&&delete b[c],delete b[a];const p={...b,[i]:JSON.stringify(g)},C=new URLSearchParams(s).toString(),E=new URLSearchParams(p).toString();if(C===E)return;l(p)}}},qr=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,s=l&&typeof l=="string"?JSON.parse(l):void 0,c=s?s[r]:void 0;return n==="label"&&c?JSON.parse(c)[0].label:n==="value"&&c?JSON.parse(c)[0].value:c},Zo=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,s=l&&typeof l=="string"?JSON.parse(l):void 0,c=s?s[r]:void 0;return n==="label"&&c?JSON.parse(c).map(i=>i.label):n==="value"&&c?JSON.parse(c).map(i=>i.value):n==="array"&&c?JSON.parse(c):c},En=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,s=l&&typeof l=="string"?JSON.parse(l):void 0,c=s?s[r]:void 0;return n==="id"&&c?JSON.parse(c).id:n==="label"&&c?JSON.parse(c).label:n==="value"&&c?JSON.parse(c).value:c},Zr=(r,t,o)=>{const n=t.get(o||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0;return l?l[r]:void 0},mn=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0,s=l?l[r]:void 0;return{start:s?JSON.parse(s).from:void 0,end:s?JSON.parse(s).to:void 0}},Go=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0,s=l?l[r]:void 0;return s?JSON.parse(s):void 0},Fn=(r,{filterKey:t="filter",perPageKey:o="perPage",pageKey:n="page"})=>{const l=r.get(t)||void 0,s=r.get(o)||void 0,c=r.get(n)||void 0;return!!l||!!s||!!c},Qo=({isOpen:r,onClose:t,filterKey:o,pageKey:n,filters:l})=>{const{searchParams:s,setSearchParams:c,searchQueries:i}=Ve(),[a,d]=h.useState({}),g=()=>{s.delete(o||"filter"),c(s)},b=(p,C)=>{switch(p.type){case"radio":{const{show:E=!0}=p;return E&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}case"dropdown":{const{show:E=!0}=p;return E&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}case"date-range":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C);case"date":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C);case"dropdown-multiple":{const{show:E=!0}=p;return E&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}default:return null}};return e.jsx(Vo,{onHide:t,show:r||!1,children:e.jsxs(f.Box,{direction:"column",gap:"md",children:[e.jsxs(ae.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:g,children:"Reset"})]}),l==null?void 0:l.map((p,C)=>b(p,C))]})})},Uo=({searchKey:r="q",statusKey:t="status",searchPlaceholder:o="Search",searchHighlightPlaceholder:n,extendedFilter:l,showSearchFilter:s=!0,showStatusFilter:c=!0,filterKey:i="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:g,filterConfigs:b,buttonToggleProps:p,position:C="right",titleSearchLabel:E="Work Order",withTitleLabels:w=!1})=>{const L=(p==null?void 0:p.isShowLabel)??!0,[I,k]=h.useState(!1),[D,O]=h.useState(0),T=()=>{O(V=>V+1)},{searchParams:B,setSearchParams:z,getQueryParam:H}=Ve(),N=br.searchParamsToObject(B.toString()),$=Zr(r,B,i)||"",[Z,G]=h.useState($),X=H(i),J=!!(X&&!(()=>{if(X)try{const V=JSON.parse(X);return Object.keys(V).length===1&&V[r]===""}catch(V){console.error("Filter parameter is not a valid JSON:",V)}return!1})()),_=Ce.useMediaQuery("md");return h.useEffect(()=>{G($)},[$]),h.useEffect(()=>{if(Z===$)return;const V=window.setTimeout(()=>{Ir({value:Z,name:r,type:"search",searchQueries:N,setSearchParams:z,filterKey:i,pageKey:a})},350);return()=>{window.clearTimeout(V)}},[Z,$,r,N,z,i,a]),e.jsxs(ae.Flex,{gap:"md",style:{flexDirection:_&&C==="left"?"row":_&&C==="right"?"row-reverse":"column"},align:"flex-end",children:[J&&e.jsx(f.Box,{direction:"column",justify:"flex-end",children:e.jsx(j.Button,{onClick:()=>{const V=new URLSearchParams(B);V.delete(i),z(V),G(""),T(),g&&g()},variant:"outline",tone:"neutral",children:e.jsx(S.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),l==null?void 0:l.map(({minWidth:V,content:ce,title:xe,onClickContainer:me},ue)=>e.jsxs(f.Box,{direction:"column",gap:"sm",onClick:me,style:{minWidth:V},children:[xe&&e.jsx(Xe.SubH3,{children:xe}),ce]},`extended-filter-${ue}-${D}`)),!!(b!=null&&b.length)&&e.jsx(j.Button,{primary:J,secondary:!J,iconLeft:e.jsx(F.Icon,{size:"sm",name:(p==null?void 0:p.icon)||"FilterHorizontal",style:{color:X?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!_,onClick:()=>k(!0),children:L?"Filter":void 0}),c&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[w&&e.jsx(Xe.SubH3,{children:"Status"}),e.jsx(pr.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:qr({get:"value",name:t,searchParams:B,filterKey:i})?[{label:qr({get:"value",name:t,searchParams:B,filterKey:i})==="active"?"Active":"InActive",value:qr({get:"value",name:t,searchParams:B,filterKey:i})}]:[],onChange:V=>Ir({value:V,name:t,type:"dropdown",searchQueries:N,setSearchParams:z,filterKey:i}),placeholder:w?"All":"All Status"},D)]}),s&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{width:d&&_?d:_?"310px":""},children:[w&&e.jsxs(Xe.SubH3,{children:["Search for ",E]}),e.jsx(lr.Input,{placeholder:o,leftIcon:e.jsx(F.Icon,{name:"Search",width:20,height:20}),onChange:V=>G(V.target.value),value:Z,fullWidth:!0},D+1+i)]}),e.jsx(Qo,{isOpen:I,onClose:()=>k(!1),filterKey:i,filters:b,pageKey:a})]})},Mn=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r==="text"?"search":r;function Ft({configs:r,filterKey:t="filter",activeFilterKey:o="filters",pageKey:n="page",searchKey:l="q"}){const{searchParams:s,setSearchParams:c,searchQueries:i}=Ve(),a=h.useMemo(()=>Object.fromEntries(r.map(D=>[D.key,D])),[r]),d=h.useMemo(()=>{const D=(s.get(o)||"").split(",").map(T=>T.trim()).filter(Boolean),O=Object.keys(Mr(s.get(t))).filter(T=>T!==l);return r.map(T=>T.key).filter(T=>{const B=a[T];return(B==null?void 0:B.locked)||D.includes(T)||O.includes(T)})},[s,o,t,l,r,a]),g=h.useCallback(D=>Mr(D[t]),[t]),b=h.useCallback(D=>{const O={...i};D.length?O[o]=D.join(","):delete O[o],c(O)},[i,o,c]),p=h.useCallback(D=>{d.includes(D)||b([...d,D])},[d,b]),C=h.useCallback(D=>{var z;if((z=a[D])!=null&&z.locked)return;const O={...i},T=d.filter(H=>H!==D);T.length?O[o]=T.join(","):delete O[o];const B=g(O);D in B&&(delete B[D],Object.keys(B).length?O[t]=JSON.stringify(B):delete O[t]),delete O[n],c(O)},[i,d,o,t,n,g,c,a]),E=h.useCallback(D=>d.includes(D)?C(D):p(D),[d,p,C]),w=h.useCallback(D=>{switch(D.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return Zo({name:D.key,get:"array",searchParams:s,filterKey:t})||[];case"date":{const O=Go({name:D.key,searchParams:s,filterKey:t});return O?new Date(O):void 0}case"date-compact":{const T=g(Object.fromEntries(s.entries()))[D.key];return T&&typeof T=="object"?T:void 0}case"text":{const T=g(Object.fromEntries(s.entries()))[D.key];return typeof T=="string"?T:void 0}default:return}},[s,t,g]),W=h.useCallback((D,O)=>{if(D.type==="date-compact"||D.type==="text"){const T={...i},B=g(T);O==null||O===""?delete B[D.key]:B[D.key]=O,Object.keys(B).length?T[t]=JSON.stringify(B):delete T[t],delete T[n],c(T);return}Ir({value:O,name:D.key,type:Mn(D.type),searchQueries:i,setSearchParams:c,filterKey:t,pageKey:n})},[i,c,t,n,g]),L=h.useCallback(D=>{const O={...i},T=g(O);D in T&&(delete T[D],Object.keys(T).length?O[t]=JSON.stringify(T):delete O[t]),delete O[n],c(O)},[i,t,n,g,c]),I=h.useCallback(()=>{const D={...i};delete D[t],delete D[o],delete D[n],c(D)},[i,t,o,n,c]),k=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:k,addFilter:p,removeFilter:C,toggleFilter:E,getValue:w,setValue:W,clearValue:L,clearAll:I}}const Mt={get(r){return mr.storage.get(r)??null},set(r,t){mr.storage.save(r,t)},remove(r){mr.storage.delete(r)}},xr={columns:r=>`filterbar:colprefs:${r}`,savedViews:r=>`filterbar:views:${r}`,lastState:r=>`filterbar:last:${r}`,perPage:r=>`filterbar:perpage:${r}`,tableSort:r=>`tablelayout:sort:${r}`},Gr=(r,t)=>{const o=new Set(t.map(s=>s.key)),n=r.order.filter(s=>o.has(s));for(const s of t)n.includes(s.key)||n.push(s.key);const l=r.hidden.filter(s=>o.has(s));return{order:n,hidden:l}};function In({columns:r,scopeId:t,storage:o,onColumnsChange:n,value:l}){const s=h.useMemo(()=>({order:r.map(B=>B.key),hidden:[]}),[r]),c=t?xr.columns(t):void 0,i=(B,z)=>Gr({order:B.order??z,hidden:B.hidden??[]},r),[a,d]=h.useState(()=>{if(l&&(l.order||l.hidden))return i(l,r.map(B=>B.key));if(c){const B=o.get(c);if(B&&Array.isArray(B.order))return Gr(B,r)}return s}),g=r.map(B=>B.key).join("|");h.useEffect(()=>d(B=>Gr(B,r)),[g]);const b=h.useRef(a);b.current=a;const p=l?`${(l.order??[]).join("|")}~${(l.hidden??[]).join("|")}`:null,C=h.useRef(p);h.useEffect(()=>{if(p==null||C.current===p)return;C.current=p;const B=b.current,z=i(l,B.order);z.order.join("|")===B.order.join("|")&&z.hidden.join("|")===B.hidden.join("|")||(d(z),c&&o.set(c,z))},[p,g]);const E=h.useRef(!1);h.useEffect(()=>{E.current||(E.current=!0,n==null||n(a))},[]);const w=h.useCallback(B=>{d(B),c&&o.set(c,B),n==null||n(B)},[c,o,n]),W=h.useMemo(()=>{const B=new Map(r.map(z=>[z.key,z]));return a.order.filter(z=>B.has(z)).map(z=>({...B.get(z),visible:!a.hidden.includes(z)}))},[a,r]),L=h.useCallback(B=>{const z=a.hidden.includes(B)?a.hidden.filter(H=>H!==B):[...a.hidden,B];w({...a,hidden:z})},[a,w]),I=h.useCallback((B,z)=>{if(B===z)return;const H=[...a.order],[N]=H.splice(B,1);H.splice(z,0,N),w({...a,order:H})},[a,w]),k=h.useCallback(B=>{w({...a,hidden:B?r.filter(z=>!z.locked).map(z=>z.key):[]})},[a,r,w]),D=h.useCallback(()=>w(s),[w,s]),O=h.useCallback(B=>w(Gr(B,r)),[w,r]),T=a.hidden.length===0;return{state:a,orderedColumns:W,allVisible:T,toggleVisibility:L,reorder:I,setAllHidden:k,reset:D,applyState:O}}function Tn({scopeId:r,storage:t,snapshotKeys:o,pageKey:n="page",getColumns:l,applyColumns:s}){const{searchParams:c,setSearchParams:i}=Ve(),a=r?xr.savedViews(r):void 0,[d,g]=h.useState(()=>a?t.get(a)||[]:[]),b=h.useCallback(w=>{g(w),a&&t.set(a,w)},[a]),p=h.useCallback(w=>{const W=w.trim();if(!W)return;const L={};o.forEach(k=>{const D=c.get(k);D!=null&&(L[k]=D)});const I={id:`${Date.now()}`,name:W,query:L,columns:l==null?void 0:l(),createdAt:Date.now()};b([...d,I])},[o,c,l,b,d]),C=h.useCallback(w=>b(d.filter(W=>W.id!==w)),[b,d]),E=h.useCallback(w=>{const W=Object.fromEntries(c.entries());o.forEach(L=>delete W[L]),Object.assign(W,w.query),delete W[n],i(W),w.columns&&(s==null||s(w.columns))},[c,o,n,i,s]);return{enabled:!!a,views:d,saveView:p,deleteView:C,applyView:E}}function Ln(r,t){const o=Mr(r);return delete o[t],Object.keys(o).length>0?JSON.stringify(o):void 0}function Jo(r,t,o){const n=r[t];if(n==null)return;const l=Ln(n,o);l===void 0?delete r[t]:r[t]=l}function On({scopeId:r,storage:t,snapshotKeys:o,enabled:n=!0,filterKey:l="filter",searchKey:s="q",persistSearch:c=!0}){const{searchParams:i}=Ve(),a=r&&n?xr.lastState(r):void 0,d=h.useRef(a),g=h.useRef(!1);h.useEffect(()=>{if(!a){d.current=a;return}if(d.current!==a){d.current=a,g.current=!1;return}const C={};if(o.forEach(E=>{const w=i.get(E);w!=null&&(C[E]=w)}),c||Jo(C,l,s),Object.keys(C).length===0){g.current&&t.remove(a);return}g.current=!0,t.set(a,C)},[i,a,o,t,c,l,s]);const b=h.useCallback(()=>{if(!a)return null;const C=t.get(a);if(!C||typeof C!="object"||Array.isArray(C)||Object.keys(C).length===0)return null;const E=C[l];return E!=null&&Object.keys(Mr(E)).length===0&&delete C[l],c||Jo(C,l,s),Object.keys(C).length>0?C:null},[a,t,c,l,s]),p=h.useCallback(()=>{a&&t.remove(a)},[a,t]);return{enabled:!!a,read:b,clear:p}}function An({scopeId:r,storage:t,perPageKey:o,pageSizeOptions:n,enabled:l=!0}){const{searchParams:s}=Ve(),c=r&&l?xr.perPage(r):void 0,i=s.toString(),a=h.useRef(c);h.useEffect(()=>{if(!c){a.current=c;return}if(a.current!==c){a.current=c;return}const b=s.get(o);if(!b)return;const p=Number(b);!Number.isFinite(p)||p<=0||t.set(c,p)},[i,c,o,t]);const d=h.useCallback(()=>{if(!c)return null;const b=t.get(c);if(b==null)return null;const p=Number(b);return!Number.isFinite(p)||p<=0||n&&!n.includes(p)?null:String(p)},[c,t,n]),g=h.useCallback(()=>{c&&t.remove(c)},[c,t]);return{enabled:!!c,read:d,clear:g}}let It={},Tt=!1,Lt=null;const Wn=(r,t)=>{Object.assign(It,r),Lt=t,!Tt&&(Tt=!0,queueMicrotask(()=>{const o=It,n=Lt;It={},Tt=!1,Lt=null,!(!n||Object.keys(o).length===0)&&n(l=>{const s=new URLSearchParams(l);return Object.entries(o).forEach(([c,i])=>s.set(c,i)),s},{replace:!0})}))};function zn({enabled:r,snapshotKeys:t,perPageKey:o,readSnapshot:n,readPerPage:l}){const{searchParams:s,setSearchParams:c,location:i}=Ve(),a=h.useRef(null);h.useEffect(()=>{if(!r||a.current===i.pathname)return;a.current=i.pathname;const d={};if(!s.has(o)){const g=l();g&&(d[o]=g)}if(!t.some(g=>s.has(g))){const g=n();g&&Object.assign(d,g)}Object.keys(d).length!==0&&Wn(d,c)},[i.pathname,r])}const Hn=({configs:r,activeKeys:t,onToggle:o,hasActiveFilter:n,onReset:l})=>r.length?e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:n?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{minWidth:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),n&&l&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"xs",onClick:l,children:"Reset"})]}),children:r.map(s=>e.jsx(A.MenuItem,{selected:s.locked||t.includes(s.key),disabled:s.locked,closeOnSelect:!1,startIcon:s.icon??void 0,onClick:()=>{s.locked||o(s.key)},children:s.label},s.key))})})]}):null,Tr=({onClear:r,onRemove:t})=>e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(F.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(A.MenuLists,{children:e.jsxs(A.MenuBody,{style:{width:180},children:[e.jsx(A.MenuItem,{startIcon:e.jsx(F.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(A.MenuItem,{intent:"danger",startIcon:e.jsx(F.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),Pn=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},Yo=(r,t,o)=>{const n=new Date(r);return o==="day"?n.setDate(n.getDate()+t):o==="week"?n.setDate(n.getDate()+t*7):o==="month"?n.setMonth(n.getMonth()+t):n.setFullYear(n.getFullYear()+t),n},Xo=r=>{const t=Pn(new Date);if(r.direction==="this"){const n=new Date(t),l=new Date(t);return r.period==="week"?(n.setDate(t.getDate()-t.getDay()),l.setDate(n.getDate()+6)):r.period==="month"?(n.setDate(1),l.setMonth(l.getMonth()+1,0)):r.period==="year"&&(n.setMonth(0,1),l.setMonth(11,31)),{from:n,to:l}}const o=r.count??1;return r.direction==="past"?{from:Yo(t,-o,r.period),to:t}:{from:t,to:Yo(t,o,r.period)}},$o=24,Ko=r=>r.length>$o?`${r.slice(0,$o)}...`:r,Ro=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),Ot=(r,t="days")=>t==="months"?r.toLocaleDateString(void 0,{month:"short",year:"numeric"}):t==="years"?String(r.getFullYear()):Ro(r),Qr={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"},el=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],At={past:"Past",next:"Next",this:"This"},Vn=["day","week","month","year"],jn=["past","next","this"],Nn=r=>r.field.type==="date-compact"?e.jsx(Zn,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(_n,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),_n=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=t?Ro(new Date(t)):null,c=!!s,i=c?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Ko(s)})]}):r.label;return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c?e.jsx(F.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:i})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:l})]}),children:e.jsx(hr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:a=>a==null?n():o(a),withPadding:!1})})})]})},qn=(r,t="days")=>{switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date?`${Qr[r.op]} ${Ot(new Date(r.date),t)}`:null;case"is-between":return r.from&&r.to?`${Ot(new Date(r.from),t)} - ${Ot(new Date(r.to),t)}`:null;case"is-relative-to-today":{const o=r.relative;if(!o)return null;if(o.direction==="this")return`This ${o.period}`;const n=o.count??1,l=n===1?o.period:`${o.period}s`;return`${At[o.direction]} ${n} ${l}`}case"is-empty":case"is-not-empty":return Qr[r.op];default:return null}},Zn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=r.ops&&r.ops.length>0?r.ops:el,c=r.defaultOp&&s.includes(r.defaultOp)?r.defaultOp:s[0],i=r.mode??"days",a=(t==null?void 0:t.op)??c,d=t?qn(t,i):null,g=!!d,b=g?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Ko(d)})]}):r.label,p=C=>{if(C!==a){if(C==="is-empty"||C==="is-not-empty"){o({op:C});return}if(C==="is-relative-to-today"){o({op:C,relative:(t==null?void 0:t.relative)??{direction:"past",count:1,period:"week"}});return}if(C==="is-between"){o({op:C,from:t==null?void 0:t.from,to:t==null?void 0:t.to});return}o({op:C,date:t==null?void 0:t.date})}};return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:g?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:g?e.jsx(F.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsxs(A.MenuLists,{children:[e.jsx(A.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(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(rl,{op:a,ops:s,onChange:p})]}),e.jsx(Tr,{onClear:n,onRemove:l})]}),children:e.jsx(tl,{value:t,op:a,mode:i,onChange:o})}),a==="is-relative-to-today"&&e.jsx(A.MenuFooter,{children:e.jsx(S.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},rl=({op:r,ops:t,onChange:o})=>e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:Qr[r]})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:200},children:t.map(n=>e.jsx(A.MenuItem,{selected:r===n,onClick:()=>o(n),endIcon:r===n?e.jsx(F.Icon,{name:"Check"}):void 0,children:Qr[n]},n))})})]}),tl=({value:r,op:t,mode:o="days",onChange:n})=>{if(t==="is-empty"||t==="is-not-empty")return e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(S.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(t==="is-between"){const l=r!=null&&r.from||r!=null&&r.to?{from:r!=null&&r.from?new Date(r.from):null,to:r!=null&&r.to?new Date(r.to):null}:void 0;return e.jsx(hr.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,filter:o,value:l,onChange:s=>{if(s==null){n({op:t});return}if(typeof s=="object"&&s!==null&&"from"in s&&"to"in s){let{from:c,to:i}=s;if(!c&&i&&(c=i,i=null),!c&&!i){n({op:t});return}n({op:t,from:c?c.toISOString():void 0,to:i?i.toISOString():void 0})}},withPadding:!1},`range-${o}`)}return t==="is-relative-to-today"?e.jsx(Gn,{value:r==null?void 0:r.relative,onChange:l=>n({op:t,relative:l})}):e.jsx(hr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:o,value:r!=null&&r.date?new Date(r.date):void 0,onChange:l=>{if(l==null){n({op:t});return}l instanceof Date&&n({op:t,date:l.toISOString()})},withPadding:!1},`single-${o}`)},Gn=({value:r,onChange:t})=>{const o=(r==null?void 0:r.direction)??"past",n=(r==null?void 0:r.count)??1,l=(r==null?void 0:r.period)??"week",s=o!=="this",c=Xo({direction:o,count:n,period:l});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(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:At[o]})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:140},children:jn.map(i=>e.jsx(A.MenuItem,{selected:o===i,endIcon:o===i?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>t(i==="this"?{direction:i,period:l}:{direction:i,count:n,period:l}),children:At[i]},i))})})]}),s&&e.jsx(lr.Input,{type:"number",size:"sm",min:1,clearable:!1,value:n,onChange:i=>{const a=Number(i.target.value);t({direction:o,count:Number.isFinite(a)&&a>0?a:1,period:l})},style:{width:72}}),e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:140},children:Vn.map(i=>e.jsx(A.MenuItem,{selected:l===i,endIcon:l===i?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>t(o==="this"?{direction:o,period:i}:{direction:o,count:n,period:i}),children:i},i))})})]})]}),e.jsx(hr.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:c,onChange:()=>{},withPadding:!1},"relative-preview")]})},ol=18,Qn=r=>r.length>ol?`${r.slice(0,ol)}...`:r,Un=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=r.type==="dropdown-multiple",c=t.length,i=r.searchable!==!1,[a,d]=h.useState(""),g=r.options,b=typeof r.onSearch=="function",p=(()=>{if(b)return g;const L=a.trim().toLowerCase();return L?g.filter(I=>I.label.toLowerCase().includes(L)):g})(),C=L=>t.some(I=>I.value===L.value),E=L=>{if(!s){o([{label:L.label,value:L.value}]),d("");return}o(C(L)?t.filter(I=>I.value!==L.value):[...t,{label:L.label,value:L.value}])},w=L=>{var I;d(L),(I=r.onSearch)==null||I.call(r,L)},W=c===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:c===1?Qn(t[0].label):`${c} Selected`})]});return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(F.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:W})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:l})]}),children:e.jsxs(f.Box,{direction:"column",gap:"sm",children:[i&&e.jsx(pr.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:s,searchAble:!0,searchValue:a,onSearch:w,value:t,onChange:o,placeholder:`Search ${r.label.toLowerCase()}…`}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:r.isLoading?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(S.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):p.length===0?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(S.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):p.map(L=>e.jsx(A.MenuItem,{closeOnSelect:!s,selected:C(L),startIcon:L.avatar,endIcon:C(L)?e.jsx(F.Icon,{name:"Check"}):void 0,description:L.description,onClick:()=>E(L),children:L.label},L.value))})]})})})]})},ll=18,Jn=r=>r.length>ll?`${r.slice(0,ll)}...`:r,nl=({checked:r,indeterminate:t})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(nr.Checkbox,{size:"sm",checked:r,readOnly:!0,onChange:()=>{},variant:t?"indeterminate":"select"})}),Yn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=new Set(t.map(p=>p.value)),c=t.length,i=r.options.length>0&&r.options.every(p=>s.has(p.value)),a=c>0&&!i,d=p=>{o(s.has(p.value)?t.filter(C=>C.value!==p.value):[...t,{label:p.label,value:p.value}])},g=()=>{o(i?[]:r.options.map(p=>({label:p.label,value:p.value})))},b=c===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs(S.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(S.Text,{as:"span",children:c===1?Jn(t[0].label):`${c} Selected`})]});return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(F.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsx(A.MenuLists,{children:e.jsxs(A.MenuBody,{style:{width:240},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:l})]}),children:[e.jsx(A.MenuItem,{closeOnSelect:!1,selected:i,onClick:g,startIcon:e.jsx(nl,{checked:i||a,indeterminate:a}),children:"Select All"}),r.options.map(p=>e.jsx(A.MenuItem,{closeOnSelect:!1,selected:s.has(p.value),onClick:()=>d(p),startIcon:e.jsx(nl,{checked:s.has(p.value)}),children:p.label},p.value))]})})]})},sl=18,Xn=r=>r.length>sl?`${r.slice(0,sl)}...`:r,$n=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const[s,c]=h.useState(t??""),i=Ce.useDebounce(s,r.debounceMs??300);h.useEffect(()=>{i!==(t??"")&&o(i)},[i]),h.useEffect(()=>{c(t??"")},[t]);const a=!!t,d=a?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Xn(t)})]}):r.label;return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:a?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:a?e.jsx(F.Icon,{name:"Search",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:d})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:l})]}),children:e.jsx(lr.Input,{size:"sm",fullWidth:!0,value:s,placeholder:r.placeholder??"Cari…",leftIcon:e.jsx(F.Icon,{name:"Search",width:16,height:16}),onChange:g=>c(g.target.value)})})})]})},cl=({activeKeys:r,configByKey:t,getValue:o,setValue:n,clearValue:l,removeFilter:s})=>e.jsx(e.Fragment,{children:r.map(c=>{const i=t[c];if(!i)return null;const a=o(i),d=i.locked?void 0:()=>s(c);return i.type==="date"||i.type==="date-compact"?e.jsx(Nn,{field:i,value:a,onChange:g=>n(i,g),onClear:()=>l(c),onRemove:d},c):i.type==="text"?e.jsx($n,{field:i,value:a||"",onChange:g=>n(i,g),onClear:()=>l(c),onRemove:d},c):i.type==="checkbox-multiple"?e.jsx(Yn,{field:i,value:a||[],onChange:g=>n(i,g),onClear:()=>l(c),onRemove:d},c):e.jsx(Un,{field:i,value:a||[],onChange:g=>n(i,g),onClear:()=>l(c),onRemove:d},c)})}),il=r=>`${r} Rows`,Kn=({pagination:r,pageKey:t="page",perPageKey:o="perPage",pageSizeOptions:n=[10,25,50,100],defaultPerPage:l=10,showResultCount:s=!0,showPageSize:c=!0,showPagination:i=!0})=>{var L;const{searchQueries:a,setSearchParams:d,searchParams:g}=Ve(),b=g.get(o),p=b?Number(b):l,C=I=>{d({...a,[t]:String(I)})},E=I=>{d({...a,[o]:I,[t]:"1"})},w=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:0),W=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[s&&e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${w}-${W} of ${((L=r==null?void 0:r.totalData)==null?void 0:L.toLocaleString())||0}`}),c&&e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:il(p)})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{children:n.map(I=>e.jsx(A.MenuItem,{selected:I===p,onClick:()=>E(String(I)),children:il(I)},I))})})]}),i&&((r==null?void 0:r.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(Er.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:r!=null&&r.currentPage?Number(r.currentPage):1,totalPages:Number(r==null?void 0:r.totalPage),onPageChange:C})})]})};function Rn(r,t,o=!0){h.useEffect(()=>{if(!o)return;const n=l=>{var i;if(l.metaKey||l.ctrlKey||l.altKey||l.key!==r||Pe.isOverlayOpen())return;const s=l.target,c=(i=s==null?void 0:s.tagName)==null?void 0:i.toLowerCase();c==="input"||c==="textarea"||s!=null&&s.isContentEditable||(l.preventDefault(),t())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[r,t,o])}const es=240,al=({searchKey:r="q",filterKey:t="filter",pageKey:o="page",placeholder:n="Search",shortcut:l="/",collapsible:s=!0})=>{const{searchParams:c,setSearchParams:i,searchQueries:a}=Ve(),d=Zr(r,c,t)||"",[g,b]=h.useState(!s||!!d),[p,C]=h.useState(s&&!d),[E,w]=h.useState(d),W=Ce.useDebounce(E,350),L=h.useRef(null);h.useEffect(()=>{w(d),d&&b(!0)},[d]),h.useEffect(()=>{g&&C(!1)},[g]),h.useEffect(()=>{W!==d&&Ir({value:W,name:r,type:"search",searchQueries:a,setSearchParams:i,filterKey:t,pageKey:o})},[W]);const I=h.useCallback(()=>{b(!0),requestAnimationFrame(()=>{var T;return(T=L.current)==null?void 0:T.focus()})},[]);Rn(l,I);const k=()=>{s&&!E&&b(!1)},D=T=>{var B;s&&T.key==="Escape"&&!E&&(b(!1),(B=L.current)==null||B.blur())},O=()=>{g||C(!0)};return e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[p&&e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:I}),e.jsxs(f.Box,{onTransitionEnd:O,style:{position:"relative",width:g?es:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(lr.Input,{ref:L,size:"sm",fullWidth:!0,value:E,placeholder:n,leftIcon:e.jsx(F.Icon,{name:"Search",width:16,height:16}),onChange:T=>w(T.target.value),onKeyDown:D,onBlur:k,tabIndex:g?0:-1}),g&&!E&&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(S.Text,{fontSize:"xs",color:"subtle",children:l})})]})]})},dl=({columns:r,allVisible:t,onToggle:o,onReorder:n,onSetAllHidden:l})=>{const[s,c]=h.useState(null),[i,a]=h.useState(null),d=()=>{s!==null&&i!==null&&s!==i&&n(s,i),c(null),a(null)},g=(b,p)=>{const C=b+p;C<0||C>=r.length||n(b,C)};return e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{children:e.jsxs(f.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(S.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(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(j.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>l(t),children:t?"Hide All":"Show All"})]}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:r.map((b,p)=>{const C=!b.locked,E=i===p&&s!==null&&s!==p;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:C,onDragStart:()=>C&&c(p),onDragOver:w=>{w.preventDefault(),a(p)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:E?"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:C?0:-1,"aria-label":`Reorder ${b.title}`,"aria-disabled":!C||void 0,color:"icon-subtlest",onKeyDown:w=>{C&&(w.key==="ArrowUp"?(w.preventDefault(),g(p,-1)):w.key==="ArrowDown"&&(w.preventDefault(),g(p,1)))},style:{display:"inline-flex",cursor:C?"grab":"default",opacity:C?1:.4},children:e.jsx(F.Icon,{name:"DragVertical",width:16,height:16})}),b.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:b.icon}),e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:b.title}),e.jsx(f.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(Cr.Toggle,{size:"sm",checked:b.visible,disabled:b.locked,onChange:()=>o(b.key),"aria-label":`Toggle ${b.title} column`})})]},b.key)})})]})})})]})},hl=({views:r,onApply:t,onDelete:o,onSave:n})=>{const[l,s]=h.useState(""),c=()=>{const i=l.trim();i&&(n(i),s(""))};return e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:r.length>0?"secondary":"outline",tone:(r.length>0,"neutral"),size:"sm",iconLeft:e.jsx(F.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(A.MenuLists,{style:{width:"260px"},children:[e.jsx(A.MenuBody,{children:e.jsxs(f.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(S.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:r.length===0?e.jsx(f.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(S.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(i=>e.jsx(A.MenuItem,{startIcon:e.jsx(F.Icon,{name:"Bookmark"}),onClick:()=>t(i),endIcon:e.jsx(j.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Trash2"}),"aria-label":`Delete ${i.name}`,onClick:a=>{a.stopPropagation(),o(i.id)}}),children:i.name},i.id))})]})}),e.jsx(A.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(lr.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:l,onChange:i=>s(i.target.value),onKeyDown:i=>{i.key==="Enter"&&c()}})}),e.jsx(j.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!l.trim(),onClick:c,children:"Save"})]})})]})]})},rs=({isOpen:r,onClose:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,onToggle:c,onReset:i,getValue:a,setValue:d,clearValue:g,removeFilter:b})=>{const p=n.length;return e.jsx(Pr.Drawer,{position:"bottom",isShow:r,onHide:t,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(S.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),p>0&&e.jsxs(S.Text,{fontSize:"sm",color:"subtle",children:["(",p,")"]})]}),e.jsx(j.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:t})]}),e.jsxs(f.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[p>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(S.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(cl,{activeKeys:n,configByKey:l,getValue:a,setValue:d,clearValue:g,removeFilter:b})})]}),o.length>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(S.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(f.Box,{direction:"column",children:o.map(C=>{const E=n.includes(C.key),w=!!C.locked;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:w?.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:[C.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:C.icon}),e.jsx(S.Text,{fontSize:"sm",color:"primary",truncate:!0,children:C.label})]}),e.jsx(Cr.Toggle,{size:"sm",checked:E||w,disabled:w,onChange:()=>c(C.key),"aria-label":`Toggle ${C.label}`})]},C.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(j.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!s,onClick:i,children:"Reset"})}),e.jsx(f.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(j.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:t,children:"Selesai"})})]})]})})},ts=r=>`${r} Rows`,os=({perPageKey:r,pageKey:t,pageSizeOptions:o,defaultPerPage:n=10,showPageSize:l})=>{const{searchQueries:s,setSearchParams:c,searchParams:i}=Ve(),a=i.get(r),d=a?Number(a):n,g=b=>{c({...s,[r]:b,[t]:"1"})};return l?e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(A.MenuLists,{children:e.jsxs(A.MenuBody,{style:{minWidth:200},children:[e.jsx(f.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(S.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),o.map(b=>e.jsx(A.MenuItem,{selected:b===d,endIcon:b===d?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>g(String(b)),children:ts(b)},b))]})})]}):null},ls=r=>{var ze;const{withPadding:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,toggleFilter:c,removeFilter:i,getValue:a,setValue:d,clearValue:g,onReset:b,searchable:p,searchKey:C,filterKey:E,pageKey:w,searchPlaceholder:W,searchShortcut:L,searchCollapsible:I,pagination:k,perPageKey:D,pageSizeOptions:O,defaultPerPage:T,showPagination:B,showResultCount:z,showPageSize:H,hasColumns:N,orderedColumns:$,allVisible:Z,onToggleVisibility:G,onReorder:X,onSetAllHidden:oe,showSavedViews:J,savedViews:_,onApplyView:V,onDeleteView:ce,onSaveView:xe,leadingActions:me}=r,[ue,we]=h.useState(!1),{searchQueries:qe,setSearchParams:fe}=Ve(),We=(k==null?void 0:k.rangeStart)??(((k==null?void 0:k.currentPage)||0)>1?(((k==null?void 0:k.currentPage)||0)-1)*((k==null?void 0:k.perPage)||0)+1:1),Fe=(k==null?void 0:k.rangeEnd)??((k==null?void 0:k.totalCurrentPage)!==(k==null?void 0:k.perPage)?k==null?void 0:k.totalData:((k==null?void 0:k.currentPage)||1)*((k==null?void 0:k.totalCurrentPage)||0)),je=Ze=>{fe({...qe,[w]:String(Ze)})},ne=z||B&&!!(k!=null&&k.totalPage),ie=()=>{b(),we(!1)};return e.jsxs(f.Box,{direction:"column",gap:"sm",fullWidth:!0,paddingTop:t?"sm":void 0,paddingBottom:t?"sm":void 0,paddingLeft:t?"md":void 0,paddingRight:t?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[p&&e.jsx(al,{searchKey:C,filterKey:E,pageKey:w,placeholder:W,shortcut:L,collapsible:I}),e.jsx(j.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"FilterHorizontal"}),onClick:()=>we(!0),"aria-label":"Open filters",children:s?`Filter: ${n.length}`:null}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[me,J&&e.jsx(hl,{views:_,onApply:V,onDelete:ce,onSave:xe}),N&&e.jsx(dl,{columns:$,allVisible:Z,onToggle:G,onReorder:X,onSetAllHidden:oe}),e.jsx(os,{perPageKey:D,pageKey:w,pageSizeOptions:O,defaultPerPage:T,showPageSize:H})]})]}),ne&&e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[z?e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${We}-${Fe} of ${((ze=k==null?void 0:k.totalData)==null?void 0:ze.toLocaleString())||0}`}):e.jsx(f.Box,{direction:"column"}),B&&!!(k!=null&&k.totalPage)&&e.jsx(Er.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:k!=null&&k.currentPage?Number(k.currentPage):1,totalPages:Number(k.totalPage),onPageChange:je})]}),e.jsx(rs,{isOpen:ue,onClose:()=>we(!1),configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,onToggle:c,onReset:ie,getValue:a,setValue:d,clearValue:g,removeFilter:i})]})},ns=({withPadding:r=!1,filterConfigs:t=[],filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:s="perPage",pageSizeOptions:c=[25,50,100],defaultPerPage:i,showPagination:a=!0,showResultCount:d=!0,showPageSize:g=!0,searchable:b=!1,searchKey:p="q",searchPlaceholder:C="Search",searchShortcut:E="/",searchPosition:w="right",searchCollapsible:W=!0,pagination:L,columns:I=[],onColumnsChange:k,columnsState:D,scopeId:O,savedViews:T,persistLastState:B=!0,persistSearch:z=!0,storage:H=Mt,onReset:N,leadingActions:$})=>{const Z=O??(T==null?void 0:T.scopeId),{activeKeys:G,configByKey:X,hasActiveFilter:oe,toggleFilter:J,removeFilter:_,getValue:V,setValue:ce,clearValue:xe,clearAll:me}=Ft({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:p}),ue=In({columns:I,scopeId:Z,storage:H,onColumnsChange:k,value:D}),we=Tn({scopeId:Z,storage:H,snapshotKeys:[n,o,s],pageKey:l,getColumns:()=>ue.state,applyColumns:ue.applyState}),qe=On({scopeId:Z,storage:H,snapshotKeys:[n,o,l],enabled:B,filterKey:o,searchKey:p,persistSearch:z}),fe=An({scopeId:Z,storage:H,perPageKey:s,pageSizeOptions:c,enabled:B});zn({enabled:B&&!!Z,snapshotKeys:[n,o,l],perPageKey:s,readSnapshot:qe.read,readPerPage:fe.read});const We=i??c[0]??25,Fe=!!(T!=null&&T.enabled)&&we.enabled,je=()=>{me(),qe.clear(),N==null||N()},ne=Ce.useMediaQuery("md"),ie=b?e.jsx(al,{searchKey:p,filterKey:o,pageKey:l,placeholder:C,shortcut:E,collapsible:W}):null;return ne?e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",fullWidth:!0,paddingTop:r?"sm":void 0,paddingBottom:r?"sm":void 0,paddingLeft:r?"md":void 0,paddingRight:r?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Hn,{configs:t,activeKeys:G,onToggle:J,hasActiveFilter:oe,onReset:je}),w==="left"&&ie,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(cl,{activeKeys:G,configByKey:X,getValue:V,setValue:ce,clearValue:xe,removeFilter:_}),oe&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"sm",onClick:je,children:"Reset"})]})]}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[$,e.jsx(Kn,{pagination:L,pageKey:l,perPageKey:s,pageSizeOptions:c,defaultPerPage:We,showPagination:a,showResultCount:d,showPageSize:g}),w==="right"&&ie,Fe&&e.jsx(hl,{views:we.views,onApply:we.applyView,onDelete:we.deleteView,onSave:we.saveView}),I.length>0&&e.jsx(dl,{columns:ue.orderedColumns,allVisible:ue.allVisible,onToggle:ue.toggleVisibility,onReorder:ue.reorder,onSetAllHidden:ue.setAllHidden})]})]}):e.jsx(ls,{withPadding:r,configs:t,activeKeys:G,configByKey:X,hasActiveFilter:oe,toggleFilter:J,removeFilter:_,getValue:V,setValue:ce,clearValue:xe,onReset:je,searchable:b,searchKey:p,filterKey:o,pageKey:l,searchPlaceholder:C,searchShortcut:E,searchCollapsible:W,pagination:L,perPageKey:s,pageSizeOptions:c,defaultPerPage:We,showPagination:a,showResultCount:d,showPageSize:g,hasColumns:I.length>0,orderedColumns:ue.orderedColumns,allVisible:ue.allVisible,onToggleVisibility:ue.toggleVisibility,onReorder:ue.reorder,onSetAllHidden:ue.setAllHidden,showSavedViews:Fe,savedViews:we.views,onApplyView:we.applyView,onDeleteView:we.deleteView,onSaveView:we.saveView,leadingActions:$})},ss=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r[0];return(t==null?void 0:t.value)!=null?String(t.value):void 0},cs=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r.map(o=>(o==null?void 0:o.value)!=null?String(o.value):null).filter(o=>o!=null);return t.length?t:void 0},is=(r,t)=>{switch(r.type){case"dropdown":case"radio":return ss(t);case"dropdown-multiple":case"checkbox-multiple":return cs(t);case"date":return t instanceof Date?t.toISOString():void 0;case"date-compact":return t;case"text":return typeof t=="string"&&t?t:void 0;default:return}},fl=(r,t)=>{if(r==null||r==="")return t;const o=Number(r);return Number.isFinite(o)&&o>0?o:t},as=r=>{const{filterConfigs:t,filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:s="perPage",searchKey:c="q",defaultPage:i=1,defaultPerPage:a=10,paramKeys:d,serialize:g}=r,{activeKeys:b,configByKey:p,hasActiveFilter:C,getValue:E}=Ft({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:c}),{searchParams:w}=Ve(),W=w.toString();return h.useMemo(()=>{const I={},k={},D=fl(w.get(l),i),O=fl(w.get(s),a);I[(d==null?void 0:d.page)??"page"]=D,I[(d==null?void 0:d.perPage)??"perPage"]=O;const T=Zr(c,w,o)||"";T&&(I[(d==null?void 0:d.search)??"search"]=T);let B=!1;for(const z of b){const H=p[z];if(!H)continue;const N=E(H);k[z]=N;const $=g==null?void 0:g[z],Z=$?$(N):is(H,N);if(Z==null||Array.isArray(Z)&&Z.length===0)continue;const G=(d==null?void 0:d[z])??z;I[G]=Z,B=!0}return{params:I,raw:k,hasActiveFilter:C||!!T||B}},[W,b.join("|"),o,n,l,s,c,i,a,d,g,p])},ds=["dropdown","dropdown-multiple","checkbox-multiple","radio"],hs=({filterConfigs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l})=>{const{configByKey:s,getValue:c,setValue:i,removeFilter:a,clearAll:d,hasActiveFilter:g}=Ft({configs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l}),b=(k,D)=>{var T;const O=k.options;return((T=O==null?void 0:O.find(B=>B.value===D))==null?void 0:T.label)??D},p=h.useCallback(k=>{const D=s[k];if(!D)return[];const O=c(D);return Array.isArray(O)?O.map(T=>String(T.value)):[]},[s,c]),C=h.useCallback((k,D)=>{const O=s[k];if(!O||!ds.includes(O.type))return;const T=Array.isArray(D)?D:[D];if(T.length===0){a(k);return}i(O,T.map(B=>({label:b(O,B),value:B})))},[s,i,a]),E=h.useCallback((k,D)=>{const O=p(k);C(k,O.includes(D)?O.filter(T=>T!==D):[...O,D])},[p,C]),w=h.useCallback((k,D)=>p(k).includes(D),[p]),W=h.useCallback(k=>a(k),[a]),L=h.useCallback(k=>{const D=s[k];return D?c(D):void 0},[s,c]),I=h.useCallback((k,D)=>{const O=s[k];if(O){if(D==null){a(k);return}i(O,D)}},[s,i,a]);return{set:C,toggle:E,clear:W,clearAll:d,isActive:w,values:p,getRaw:L,setRaw:I,hasActiveFilter:g}},Wt="var(--sa-background-brand, #04254f)",fs="var(--sa-text-brand, #031f43)",us={padding:"6px 8px",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:4,font:"inherit",fontSize:13,outline:"none",width:"100%",boxSizing:"border-box"},zt={padding:"4px 8px",border:"none",background:"none",cursor:"pointer",font:"inherit",textAlign:"left",fontSize:13,color:fs},ul=(r,t)=>{if(r.type==="text"||r.type==="date")return!!t.getRaw(r.key);if(r.type==="date-compact"){const o=t.getRaw(r.key);return!!(o&&(o.date||o.from||o.to||o.relative||o.op==="is-empty"||o.op==="is-not-empty"))}return t.values(r.key).length>0},gs=({field:r,controls:t})=>{const[o,n]=h.useState(""),l=r.type==="dropdown"||r.type==="radio",s=r.type==="checkbox-multiple"?!1:r.searchable!==!1,c=t.values(r.key),i=s&&o.trim()?r.options.filter(d=>d.label.toLowerCase().includes(o.toLowerCase())):r.options,a=d=>{l?t.set(r.key,c.includes(d)?[]:d):t.toggle(r.key,d)};return e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:4,minWidth:200},children:[s&&e.jsx("input",{value:o,onChange:d=>{var g;n(d.target.value),(g=r.onSearch)==null||g.call(r,d.target.value)},placeholder:"Cari…",style:us}),e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:2,maxHeight:220,overflowY:"auto"},children:[i.map(d=>{const g=c.includes(d.value);return e.jsxs("button",{type:"button",onClick:()=>a(d.value),style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 8px",border:"none",background:"none",cursor:"pointer",font:"inherit",textAlign:"left",borderRadius:4},children:[e.jsx("span",{style:{width:16,height:16,flexShrink:0,borderRadius:l?"50%":4,display:"inline-flex",alignItems:"center",justifyContent:"center",border:`1px solid ${g?Wt:"var(--sa-border-subtle, #0b120e24)"}`,background:g&&!l?Wt:"transparent"},children:g&&(l?e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:Wt}}):e.jsx(F.Icon,{name:"Check",size:"xs",style:{color:"#fff"}}))}),e.jsx(S.Text,{as:"span",style:{fontSize:14},children:d.label})]},d.value)}),i.length===0&&e.jsx(S.Text,{as:"span",style:{fontSize:13,color:"var(--sa-text-subtlest, #8c8f97)",padding:"6px 8px"},children:"Tak ada hasil"})]}),c.length>0&&e.jsx("button",{type:"button",onClick:()=>t.clear(r.key),style:zt,children:"Clear"})]})},ys=({field:r,controls:t})=>{const o=t.getRaw(r.key);return e.jsx(f.Box,{style:{minWidth:240},children:e.jsx(hr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:o,onChange:n=>t.setRaw(r.key,n??null),withPadding:!1})})},ps=({field:r,controls:t})=>{const o=t.getRaw(r.key),n=r.ops&&r.ops.length>0?r.ops:el,l=r.defaultOp&&n.includes(r.defaultOp)?r.defaultOp:n[0],s=r.mode??"days",c=(o==null?void 0:o.op)??l,i=d=>t.setRaw(r.key,d),a=d=>{if(d!==c)return i(d==="is-empty"||d==="is-not-empty"?{op:d}:d==="is-relative-to-today"?{op:d,relative:(o==null?void 0:o.relative)??{direction:"past",count:1,period:"week"}}:d==="is-between"?{op:d,from:o==null?void 0:o.from,to:o==null?void 0:o.to}:{op:d,date:o==null?void 0:o.date})};return e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:6,minWidth:280},children:[e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(rl,{op:c,ops:n,onChange:a})]}),e.jsx(tl,{value:o,op:c,mode:s,onChange:i}),ul(r,t)&&e.jsx("button",{type:"button",onClick:()=>t.setRaw(r.key,null),style:zt,children:"Clear"})]})},bs=({field:r,controls:t})=>{const o=t.getRaw(r.key)??"",[n,l]=h.useState(o),s=Ce.useDebounce(n,r.debounceMs??300);return h.useEffect(()=>{const c=t.getRaw(r.key)??"";s!==c&&t.setRaw(r.key,s||null)},[s]),e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:6,minWidth:220},children:[e.jsx(lr.Input,{size:"sm",fullWidth:!0,value:n,placeholder:r.placeholder??"Cari…",leftIcon:e.jsx(F.Icon,{name:"Search",width:16,height:16}),onChange:c=>l(c.target.value)}),n&&e.jsx("button",{type:"button",onClick:()=>{l(""),t.setRaw(r.key,null)},style:zt,children:"Clear"})]})},vs=({field:r,controls:t})=>r.type==="text"?e.jsx(bs,{field:r,controls:t}):r.type==="date"?e.jsx(ys,{field:r,controls:t}):r.type==="date-compact"?e.jsx(ps,{field:r,controls:t}):e.jsx(gs,{field:r,controls:t}),Cs=(r,t)=>{if(!r)return{};const{fromKey:o,toKey:n,opKey:l}=t,s={};switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date&&(s[o]=new Date(r.date).toISOString()),l&&(s[l]=r.op),s;case"is-between":return r.from&&(s[o]=new Date(r.from).toISOString()),r.to&&(s[n]=new Date(r.to).toISOString()),s;case"is-relative-to-today":{if(!r.relative)return s;const{from:c,to:i}=Xo(r.relative);return s[o]=c.toISOString(),s[n]=i.toISOString(),s}case"is-empty":case"is-not-empty":return l&&(s[l]=r.op==="is-empty"?"empty":"not-empty"),s;default:return s}},gl=({children:r,borderRadius:t,height:o})=>{const n=h.useRef(null),[l,s]=h.useState("100vh");return h.useEffect(()=>{if(o)return;const c=()=>{if(n.current){const i=n.current.getBoundingClientRect().top;s(`calc(100vh - ${i}px)`)}};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[o]),e.jsx(f.Box,{ref:n,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:t||"rounded-xs",style:{height:o??l,display:"flex",flexDirection:"column"},children:r})},yl=({action:r,rightContent:t,leftContent:o,headerSlot:n,advanceFilter:l,showFilter:s=!0})=>{const c=Ce.useMediaQuery("md"),i=s?e.jsx(Uo,{...l}):null,a=()=>r?h.isValidElement(r)?r:e.jsx(f.Box,{style:{display:"flex",flexDirection:c?"row":"column",gap:"8px",width:c?"auto":"100%",textWrap:"nowrap"},children:r.map(({title:d,icon:g,buttonProps:b,onClick:p},C)=>!d&&!g?null:e.jsx(j.Button,{fullWidth:!c,iconLeft:g?e.jsx(F.Icon,{name:g}):void 0,onClick:p,...b,children:d},`action-${C}`))}):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:c?"row":"column-reverse",gap:"16px"},children:n?n({filter:i}):e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[i,o]}),e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[t,a()]})]})})},xs=({totalData:r,withMarginBottom:t=!0,withMarginTop:o=!0})=>e.jsxs(f.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:t?"16px":void 0,marginTop:o?"16px":void 0},children:[e.jsxs(Xe.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Xe.Body1,{children:r||0})]}),pl=({pagination:r,pageKey:t="page",perPageKey:o="perPage",defaultPerPage:n=10,showPagination:l=!0,totalData:s})=>{const{searchQueries:c,setSearchParams:i,searchParams:a}=Ve(),d=a.get(o),g=E=>{i({...c,[t]:String(E)})},b=E=>{i({...c,[o]:E,[t]:"1"})},p=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),C=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsx(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:l?e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(S.Text,{children:"Rows Per Page: "}),e.jsx(pr.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:E=>{b(E[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}]}),e.jsx(S.Text,{children:`${p}-${C} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(Er.Pagination,{currentPage:r!=null&&r.currentPage?Number(r==null?void 0:r.currentPage):1,totalPages:r!=null&&r.totalPage?Number(r==null?void 0:r.totalPage):1,onPageChange:g})]}):e.jsx(xs,{totalData:s,withMarginBottom:!1,withMarginTop:!1})})},bl=({filter:r,columnTitle:t})=>{const[o,n]=h.useState(!1),l=h.useRef(null),s=h.useRef(null),c=h.useRef(null),[i,a]=h.useState(""),[d,g]=h.useState({top:0,left:0}),b=r.selectedValues,p=h.useMemo(()=>i?r.options.filter(w=>w.label.toLowerCase().includes(i.toLowerCase())):r.options,[r.options,i]);h.useEffect(()=>{if(o&&s.current){const w=s.current.getBoundingClientRect(),W=280,L={top:w.bottom+8};r.position==="left"||w.left+W>window.innerWidth?L.right=window.innerWidth-w.right:L.left=w.left,g(L)}},[o,r.position]),h.useEffect(()=>{o&&c.current?setTimeout(()=>{var w;return(w=c.current)==null?void 0:w.focus()},50):a("")},[o]),h.useEffect(()=>{const w=W=>{l.current&&!l.current.contains(W.target)&&s.current&&!s.current.contains(W.target)&&n(!1)};return o&&document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[o]);const C=w=>{const W=b.includes(w)?b.filter(L=>L!==w):[...b,w];r.onFilterChange(W)},E=()=>r.onFilterChange([]);return e.jsxs(f.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(f.Box,{ref:s,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:w=>{var W;w.stopPropagation(),o||(W=r.onOpen)==null||W.call(r),n(L=>!L)},children:e.jsx(F.Icon,{name:o?"ChevronUp":"ChevronDown",size:"sm",style:{color:b.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),o&&e.jsxs(f.Box,{ref:l,style:{position:"fixed",top:`${d.top}px`,...d.left!==void 0?{left:`${d.left}px`}:{right:`${d.right}px`},backgroundColor:"white",borderRadius:"4px",minWidth:"280px",maxHeight:"400px",display:"flex",flexDirection:"column",zIndex:9999,animation:"fadeInDropdown 0.15s ease-out",border:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(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(S.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",t]}),b.length>0&&e.jsx(f.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(S.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:w=>{w.stopPropagation(),E()},children:"CLEAR"})})]}),!r.hideSearch&&e.jsx(f.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(lr.Input,{ref:c,placeholder:`Search ${t.toLowerCase()}...`,leftIcon:e.jsx(F.Icon,{name:"Search",size:"sm"}),value:i,onChange:w=>a(w.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:r.isLoadingOptions?e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(F.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(S.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):p.length>0?e.jsx(f.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:p.map(w=>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:b.includes(w.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:W=>{W.stopPropagation(),C(w.value)},onMouseEnter:W=>{b.includes(w.value)||(W.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),W.currentTarget.style.transform="translateX(2px)"},onMouseLeave:W=>{W.currentTarget.style.backgroundColor=b.includes(w.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",W.currentTarget.style.transform="translateX(0)"},children:[e.jsx(nr.Checkbox,{checked:b.includes(w.value),onChange:()=>{}}),e.jsx(S.Text,{fontSize:"sm",fontWeight:b.includes(w.value)?"medium":"normal",color:b.includes(w.value)?"primary":"gray-700",children:w.label})]},w.value))}):e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(F.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(S.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),b.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:b.length}),e.jsxs(S.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",b.length>1?"s":""," selected"]})]})})]})]})},ws=({direction:r})=>{const t="var(--sa-text-primary, #292a2e)",o="var(--sa-text-subtle, #8c8f97)",n=r==="asc"?t:o,l=r==="desc"?t:o,s=r==="asc"?1:.45,c=r==="desc"?1:.45;return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:0},"aria-hidden":!0,children:[e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:n,opacity:s,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:l,opacity:c},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},Ds=({frozen:r})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:r?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),Ht="var(--sa-background-primary, #ffffff)",vl="var(--sa-background-primary-inverse, #f8f8f8)",Cl=({columns:r,records:t,handleDetail:o,handleUpdate:n,handleDelete:l,isLoading:s,visibleHandleDelete:c,visibleHandleUpdate:i,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:g,frozenCount:b=0,onFrozenCountChange:p,customActions:C,actionsOrder:E=["detail","update","delete","custom"],customEmptyState:w,enableColumnResize:W=!1,defaultColumnWidths:L,onColumnWidthsChange:I,defaultMinColumnWidth:k=60,sort:D,defaultSort:O,onSortChange:T,showActionDivider:B=!1})=>{const z=D!==void 0,[H,N]=h.useState(O??null),$=z?D??null:H,Z=P=>{if(P.sortKey)return P.sortKey;if(typeof P.accessor=="string")return P.accessor},G=P=>{const R=Z(P);if(!R)return;let U;!$||$.key!==R?U={key:R,direction:"asc"}:$.direction==="asc"?U={key:R,direction:"desc"}:U=null,z||N(U),T==null||T(U)},oe=[o,n,l].filter(P=>P!==void 0).length,J=!!C,_=!!o||!!n||!!l||J,V="var(--sa-border-subtle, #0b120e24)",ce=`1px solid ${V}`,xe=`inset 1px 0 0 ${V}`,me=`inset -1px 0 0 ${V}`,ue=oe===3?J?"178px":"140px":oe===2?J?"140px":"102px":oe===1?J?"112px":"74px":J?"74px":"",we=(P,R)=>{if(!R)return P;if(typeof R=="function")return R(P);if(typeof R=="string")return P[R]},[qe,fe]=h.useState(!1);h.useEffect(()=>{if(!(g!=null&&g.current))return;const P=g.current;fe(P.scrollHeight>P.clientHeight)},[t,g]);const We=h.useRef(null),[Fe,je]=h.useState([]),[ne,ie]=h.useState(()=>L??{}),ze=h.useRef(null);h.useLayoutEffect(()=>{if(!b||!We.current){je([]);return}const P=Array.from(We.current.querySelectorAll("thead tr th")),R=[];let U=0;P.forEach((de,Me)=>{R[Me]=U,Me<b&&(U+=de.offsetWidth)}),je(R)},[b,r,t,ne]);const Ze=P=>{p&&p(P<b?P:P+1)},Te=(P,R)=>{const U=ne[P];if(U!==void 0){const de=`${U}px`;return{width:de,minWidth:de,maxWidth:de}}return R?{width:R}:{}},De=P=>W&&(P.resizable??!0),Ne=(P,R)=>{P.preventDefault(),P.stopPropagation();const U=P.currentTarget.closest("th");if(!U)return;const de=Math.round(U.getBoundingClientRect().width);ze.current={colIndex:R,startX:P.clientX,startWidth:de};const Me=document.body.style.userSelect,ye=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const ke=Ge=>{var pe;const Qe=ze.current;if(!Qe)return;const Ke=((pe=r[Qe.colIndex])==null?void 0:pe.minWidth)??k,Ue=Math.max(Ke,Qe.startWidth+(Ge.clientX-Qe.startX));ie(rr=>rr[Qe.colIndex]===Ue?rr:{...rr,[Qe.colIndex]:Ue})},$e=()=>{document.removeEventListener("mousemove",ke),document.removeEventListener("mouseup",$e),document.body.style.userSelect=Me,document.body.style.cursor=ye,ze.current=null,I&&ie(Ge=>(I(Ge),Ge))};document.addEventListener("mousemove",ke),document.addEventListener("mouseup",$e)};return e.jsx("div",{ref:We,children:e.jsxs(Q.Table,{fullWidth:!0,children:[e.jsx(Q.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(Q.Tr,{children:[r.map((P,R)=>{var Dr,ar;const U=b>0&&R<b,de=Fe[R]??0,Me=De(P),ke=R===r.length-1&&_&&B,$e=Z(P),Ge=!!P.sortable&&!!$e,Qe=Ge&&($==null?void 0:$.key)===$e?$.direction:null,Ke=P.title||((Dr=P.accessor)==null?void 0:Dr.toString())||"",Ue=(ar=P.headerTooltip)!=null&&ar.showIcon?e.jsx(F.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,pe=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ke}),rr=Ge?e.jsxs("button",{type:"button",onClick:()=>G(P),title:Qe==="asc"?"Sorted ascending — click to sort descending":Qe==="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:P.textAlign==="text-right"?"right":P.textAlign==="text-center"?"center":"left"},children:[pe,Ue,e.jsx(ws,{direction:Qe})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[pe,Ue]});return e.jsxs(Q.Th,{style:{position:"sticky",top:0,left:U?de:void 0,zIndex:U?4:2,paddingLeft:R===0?"12px":"",borderRight:d&&!ke&&!U?ce:void 0,borderBottom:d?ce:void 0,boxShadow:d&&U?me:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:P.textAlign==="text-right"?"right":P.textAlign==="text-center"?"center":"left",...Te(R,P.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[P.headerTooltip?e.jsx(Ie.Tooltip,{label:P.headerTooltip.content,position:"bottom",children:rr}):rr,P.filter&&e.jsx(bl,{filter:P.filter,columnTitle:P.title}),p&&e.jsx("button",{onClick:()=>Ze(R),title:U?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:U?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:U?1:.45,transition:"opacity 0.15s"},children:e.jsx(Ds,{frozen:U})})]}),Me&&e.jsx("div",{onMouseDown:fr=>Ne(fr,R),onClick:fr=>fr.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-${R}`)}),_?e.jsx(Q.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?ce:void 0,boxShadow:d&&B?xe:void 0}}):null]})}),e.jsx(Q.Tbody,{children:s?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:r.length+1,children:e.jsxs(f.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(Ye.Skeleton,{variant:"list"}),e.jsx(Ye.Skeleton,{variant:"list"}),e.jsx(Ye.Skeleton,{variant:"list"}),e.jsx(Ye.Skeleton,{variant:"list"}),e.jsx(Ye.Skeleton,{variant:"list"})]})})}):!(t!=null&&t.length)&&w?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:r.length+1,children:w})}):t==null?void 0:t.map((P,R)=>e.jsxs(Q.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:R===t.length-1&&qe?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:U=>{const de=U.currentTarget;de.style.backgroundColor=vl,Array.from(de.querySelectorAll("td")).forEach(Me=>{Me.style.position==="sticky"&&(Me.style.backgroundColor=vl)})},onMouseLeave:U=>{const de=U.currentTarget;de.style.backgroundColor="",Array.from(de.querySelectorAll("td")).forEach(Me=>{Me.style.position==="sticky"&&(Me.style.backgroundColor=Ht)})},children:[r.map((U,de)=>{const Me=U.render?U.render(P,R,t):we(P,U.accessor),ye=b>0&&de<b,ke=Fe[de]??0,$e=ne[de]!==void 0,Ge=ye&&de===b-1;return e.jsx(Q.Td,{style:{position:ye?"sticky":void 0,left:ye?ke:void 0,zIndex:ye?1:void 0,backgroundColor:ye?Ht:void 0,transition:ye?"background-color 0.3s ease":void 0,paddingLeft:de===0?"12px":"",whiteSpace:"nowrap",overflow:$e?"hidden":void 0,borderLeft:U.showBorderLeft?ce:void 0,borderRight:U.showBorderRight?ce:void 0,boxShadow:Ge?me:void 0,textAlign:U.textAlign==="text-right"?"right":U.textAlign==="text-center"?"center":"left",...Te(de,U.width)},children:typeof Me=="string"?e.jsx(S.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:U.textAlign==="text-right"?"right":U.textAlign==="text-center"?"center":"left"},children:Me}):Me},`row-${R}-col-${de}`)}),_?e.jsx(Q.Td,{style:{width:ue,position:"sticky",right:0,zIndex:1,backgroundColor:Ht,boxShadow:B?xe:void 0,transition:"background-color 0.3s ease"},children:e.jsx(ae.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:E.map(U=>{const de=R===t.length-1?"top":"bottom";return U==="detail"&&o&&(a==null?void 0:a(P))!==!1?e.jsx(Ie.Tooltip,{label:"Detail",position:de,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(P.id,P),iconLeft:e.jsx(F.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):U==="update"&&n&&(i==null?void 0:i(P))!==!1?e.jsx(Ie.Tooltip,{label:"Update",position:de,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(P),iconLeft:e.jsx(F.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):U==="delete"&&l&&(c==null?void 0:c(P))!==!1?e.jsx(Ie.Tooltip,{label:"Delete",position:de,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>l(P.id,P),iconLeft:e.jsx(F.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):U==="custom"?e.jsx(h.Fragment,{children:C==null?void 0:C(P)},"custom"):null})})}):null]},`${P}${R}`))})]})})};let xl=!1;const Ss=({wrapperProps:r,dataTableProps:t,headerProps:o,footerProps:n})=>{var b;process.env.NODE_ENV!=="production"&&!xl&&(xl=!0,console.warn("[@starasia/admin] `TableSection` deprecated — pakai `<FilterBar>` + `<TableLayout>`. Lihat skill `starasia-list-page-pattern`. Akan dihapus di salah satu major berikutnya."));const l=h.useRef(null),[s,c]=h.useState((t==null?void 0:t.defaultFrozenCount)??0),i=(o==null?void 0:o.show)??!0,a=h.useRef(null),d=(b=t==null?void 0:t.pagination)==null?void 0:b.totalData;typeof d=="number"&&(a.current=d);const g=(n==null?void 0:n.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(gl,{...r,children:[i&&e.jsx(yl,{...o}),e.jsx(f.Box,{direction:"column",ref:l,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(Cl,{...t,scrollParentRef:l,frozenCount:t!=null&&t.enableFreezeColumns?s:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?c:void 0}):null}),g&&e.jsx(pl,{pagination:t==null?void 0:t.pagination,pageKey:t==null?void 0:t.pageKey,perPageKey:t==null?void 0:t.perPageKey,defaultPerPage:t==null?void 0:t.defaultPerPage,showPagination:t==null?void 0:t.showPagination,totalData:n==null?void 0:n.totalData})]})};function ks(r){return h.memo(r)}const Bs=ks(Ss),wl=200,Ur="1px solid var(--sa-border-subtle, #0b120e24)",Es=({sortDir:r,frozen:t,filterActive:o})=>r==="asc"?e.jsx(F.Icon,{name:"ChevronSmallUp"}):r==="desc"?e.jsx(F.Icon,{name:"ChevronSmallDown"}):t?e.jsx(F.Icon,{name:"LockOn",size:"xs"}):e.jsx(F.Icon,{name:"Filter",size:"xs",style:o?{color:"var(--sa-text-brand, #031f43)"}:void 0}),Jr=({icon:r,label:t,active:o,danger:n,onClick:l})=>{const s=n?"var(--sa-text-error, #a4133c)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:l,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:o?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:s,textAlign:"left"},onMouseEnter:c=>{o||(c.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:c=>{c.currentTarget.style.background=o?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(F.Icon,{name:r,size:"sm",style:{color:s,flexShrink:0}}),e.jsx(S.Text,{as:"span",style:{color:s},children:t})]})},Dl=({active:r,canSort:t,canHide:o,sortDir:n,frozen:l,onSort:s,onClearSort:c,onToggleFreeze:i,onHide:a,filterSlot:d,filterActive:g})=>{const[b,p]=h.useState(!1),C=h.useRef(null),E=h.useRef(null),[w,W]=h.useState({top:0,left:0});h.useEffect(()=>{if(b&&C.current){const I=C.current.getBoundingClientRect(),k=I.left+wl>window.innerWidth;W({top:I.bottom+6,...k?{right:window.innerWidth-I.right}:{left:I.left}})}},[b]),h.useEffect(()=>{if(!b)return;const I=k=>{E.current&&!E.current.contains(k.target)&&C.current&&!C.current.contains(k.target)&&p(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[b]);const L=I=>{I(),p(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:C,type:"button",className:"sa-tl-menu-trigger","data-active":r||b?"true":"false",onClick:I=>{I.stopPropagation(),p(k=>!k)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:Ur,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(Es,{sortDir:n,frozen:l,filterActive:g})}),b&&e.jsxs(f.Box,{ref:E,onClick:I=>I.stopPropagation(),style:{position:"fixed",top:`${w.top}px`,...w.left!==void 0?{left:`${w.left}px`}:{right:`${w.right}px`},minWidth:wl,backgroundColor:"var(--sa-background-primary, #ffffff)",border:Ur,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:[d!=null&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{padding:"6px 12px 2px"},children:e.jsx(S.Text,{as:"span",style:{fontSize:12,fontWeight:500,color:"var(--sa-text-subtlest, #8c8f97)"},children:"Filter"})}),e.jsx("div",{style:{padding:"2px 8px 4px"},children:d}),e.jsx("div",{style:{borderTop:Ur,margin:"4px 0"}})]}),t&&e.jsxs(e.Fragment,{children:[e.jsx(Jr,{icon:"ChevronUp",label:"Ascending",active:n==="asc",onClick:()=>L(()=>n==="asc"?c():s("asc"))}),e.jsx(Jr,{icon:"ChevronDown",label:"Descending",active:n==="desc",onClick:()=>L(()=>n==="desc"?c():s("desc"))}),e.jsx("div",{style:{borderTop:Ur,margin:"4px 0"}})]}),e.jsx(Jr,{icon:"Pin1",label:l?"Unfreeze":"Freeze",active:l,onClick:()=>L(i)}),o&&e.jsx(Jr,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>L(a)})]})]})},ms=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Fs={background:"var(--sa-background-warning-subtlest, #fef2e6)",color:"inherit",padding:0,borderRadius:2},Sl=({text:r,query:t,markStyle:o})=>{const n=t==null?void 0:t.trim();if(!n||!r)return e.jsx(e.Fragment,{children:r});const l=n.split(/\s+/).filter(Boolean);if(!l.length)return e.jsx(e.Fragment,{children:r});const s=new Set(l.map(a=>a.toLowerCase())),c=new RegExp(`(${l.map(ms).join("|")})`,"gi"),i=r.split(c);return e.jsx(e.Fragment,{children:i.map((a,d)=>a&&s.has(a.toLowerCase())?e.jsx("mark",{style:{...Fs,...o},children:a},d):e.jsx(h.Fragment,{children:a},d))})},Lr="1px solid var(--sa-border-subtle, #0b120e24)",Ms="var(--sa-text-subtle, #8c8f97)",wr="var(--sa-background-neutral, #f0f1f2)",kl="2px 0 4px -2px var(--sa-border-subtle, #0b120e24)",Or=40,Pt="var(--sa-background-brand-subtlest)",Yr={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Bl="sa-table-layout-styles",Is=()=>{if(typeof document>"u"||document.getElementById(Bl))return;const r=document.createElement("style");r.id=Bl,r.textContent=`
|
|
1
|
+
(function(u,pr){typeof exports=="object"&&typeof module<"u"?pr(exports,require("@starasia/alert"),require("@starasia/avatar"),require("@starasia/badges"),require("@starasia/box"),require("@starasia/breadcrumb"),require("@starasia/button"),require("@starasia/card"),require("@starasia/date"),require("@starasia/dialog"),require("@starasia/drawer"),require("@starasia/dropdown"),require("@starasia/hooks"),require("@starasia/http"),require("@starasia/input"),require("@starasia/menu"),require("@starasia/pagination"),require("@starasia/storage"),require("@starasia/table"),require("@starasia/tabs"),require("@starasia/textarea"),require("@starasia/theme"),require("@starasia/toast"),require("@starasia/toggle"),require("@starasia/tooltip"),require("@starasia/checkbox"),require("@starasia/radio"),require("@starasia/text"),require("@starasia/icon"),require("@starasia/flex"),require("@starasia/grid"),require("@starasia/progress"),require("@starasia/stepper"),require("@starasia/accordion"),require("@starasia/story-record"),require("@starasia/skeleton"),require("@starasia/progress-stepper"),require("react/jsx-runtime"),require("react"),require("react-dom"),require("react-easy-crop")):typeof define=="function"&&define.amd?define(["exports","@starasia/alert","@starasia/avatar","@starasia/badges","@starasia/box","@starasia/breadcrumb","@starasia/button","@starasia/card","@starasia/date","@starasia/dialog","@starasia/drawer","@starasia/dropdown","@starasia/hooks","@starasia/http","@starasia/input","@starasia/menu","@starasia/pagination","@starasia/storage","@starasia/table","@starasia/tabs","@starasia/textarea","@starasia/theme","@starasia/toast","@starasia/toggle","@starasia/tooltip","@starasia/checkbox","@starasia/radio","@starasia/text","@starasia/icon","@starasia/flex","@starasia/grid","@starasia/progress","@starasia/stepper","@starasia/accordion","@starasia/story-record","@starasia/skeleton","@starasia/progress-stepper","react/jsx-runtime","react","react-dom","react-easy-crop"],pr):(u=typeof globalThis<"u"?globalThis:u||self,pr(u["@starasia/admin"]={},u.alert,u.avatar,u.badges,u.box,u.breadcrumb,u.button,u.card,u.date,u.dialog,u.drawer,u.dropdown,u.hooks,u.http,u.input,u.menu,u.pagination,u.storage,u.table,u.tabs,u.textarea,u.theme,u.toast,u.toggle,u.tooltip,u.checkbox,u.radio,u.text,u.icon,u.flex,u.grid,u.progress,u.stepper,u.accordion,u.storyRecord,u.skeleton,u.progressStepper,u.jsxRuntime,u.React,u.ReactDOM,u.ReactEasyCrop))})(this,function(u,pr,Vr,ar,f,br,j,ft,ur,Ve,jr,vr,Ce,Cr,nr,A,mr,Fr,Q,lo,ut,xr,no,wr,Me,sr,gt,S,F,ae,so,co,io,ao,ho,$e,fo,e,h,Nr,Rl){"use strict";const en={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},yt=h.createContext(en),pt=()=>h.useContext(yt),uo=r=>{const[t,o]=h.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:o}},go=h.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),yo=({children:r})=>{const[t,o]=h.useState({}),n=h.useCallback(i=>{o(a=>typeof i=="function"?i(a):i)},[]),l=h.useCallback((i,a)=>{o(d=>{const g=typeof a=="function"?a(d[i]):a;return{...d,[i]:g}})},[]),s=h.useCallback(i=>{o(a=>{if(!(i in a))return a;const d={...a};return delete d[i],d})},[]),c=h.useMemo(()=>({badges:t,setBadge:l,setBadges:n,clearBadge:s}),[t,l,n,s]);return e.jsx(go.Provider,{value:c,children:r})},po=()=>h.useContext(go),_r=(r,t)=>{const o=t!==void 0?t:r;return o==null?null:typeof o=="string"||typeof o=="number"?{value:o}:o},bt=240,vt=200,Ct=480,rn="sa-sidebar-width",xt=(r,t,o)=>Math.min(Math.max(r,t),o),tn=(r,t,o,n)=>{if(typeof window>"u")return t;try{const l=window.localStorage.getItem(r);if(!l)return t;const s=parseInt(l,10);return Number.isFinite(s)?xt(s,o,n):t}catch{return t}},bo=(r,t)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(r,String(t))}catch{}},vo=h.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},width:bt,setWidth:()=>{},resetWidth:()=>{},minWidth:vt,maxWidth:Ct,mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),Co=({children:r,defaultCollapsed:t=!1,defaultWidth:o=bt,minWidth:n=vt,maxWidth:l=Ct,widthStorageKey:s=rn})=>{const[c,i]=h.useState(t),[a,d]=h.useState(!1),[g,b]=h.useState(()=>tn(s,o,n,l)),p=h.useCallback(B=>{i(z=>typeof B=="function"?B(z):B)},[]),C=h.useCallback(()=>i(B=>!B),[]),E=h.useCallback(()=>i(!0),[]),w=h.useCallback(()=>i(!1),[]),W=h.useCallback(B=>{b(z=>{const H=typeof B=="function"?B(z):B,N=xt(Math.round(H),n,l);return bo(s,N),N})},[n,l,s]),L=h.useCallback(()=>{const B=xt(o,n,l);bo(s,B),b(B)},[o,n,l,s]),I=h.useCallback(B=>{d(z=>typeof B=="function"?B(z):B)},[]),k=h.useCallback(()=>d(!0),[]),D=h.useCallback(()=>d(!1),[]),O=h.useCallback(()=>d(B=>!B),[]),T=h.useMemo(()=>({collapsed:c,setCollapsed:p,toggle:C,collapse:E,expand:w,width:g,setWidth:W,resetWidth:L,minWidth:n,maxWidth:l,mobileOpen:a,setMobileOpen:I,openMobile:k,closeMobile:D,toggleMobile:O}),[c,p,C,E,w,g,W,L,n,l,a,I,k,D,O]);return e.jsx(vo.Provider,{value:T,children:r})},xo=()=>h.useContext(vo),wo=h.createContext(null),Do=({adapter:r,children:t})=>e.jsx(wo.Provider,{value:r,children:t}),cr=()=>{const r=h.useContext(wo);if(!r)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 r},So=({router:r,routerAdapter:t,menus:o=[],menuBottom:n,logo:l,appName:s="Workspace",initialUserData:c,theme:i})=>{const a=uo({initialUserData:c}),{theme:d}=xr.useTheme();return e.jsx(Do,{adapter:t,children:e.jsx(yt.Provider,{value:{logo:l,appName:s,menus:o,userData:a.userData,setUserData:a.setUserData,menuBottom:n},children:e.jsx(yo,{children:e.jsx(Co,{children:i?e.jsx(xr.ThemeProvider,{value:i,children:r}):d?e.jsx(xr.ThemeProvider,{value:d,children:r}):r})})})})},on=h.memo(So);function ko({collapsed:r=!1,children:t}){if(!t)return null;const o=typeof t=="function",n=o?t({collapsed:r}):t;return n==null||n===!1?null:e.jsx("div",{style:{position:"sticky",top:"var(--app-header-height, 4rem)",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:r?"calc((var(--app-header-height, 4rem) - 2rem) / 2)":"0.5rem",paddingRight:r?"calc((var(--app-header-height, 4rem) - 2rem) / 2)":"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:o?n:e.jsx("div",{style:{opacity:r?0:1,transition:"opacity 0.3s",visibility:r?"hidden":"visible"},children:n})})}const wt=h.createContext(null);function Bo({children:r}){const[t,o]=h.useState(null),[n,l]=h.useState(null),[s,c]=h.useState(null),[i,a]=h.useState(0),d=h.useCallback(()=>(a(g=>g+1),()=>a(g=>g-1)),[]);return e.jsx(wt.Provider,{value:{prependNode:t,appendNode:n,replaceNode:s,setPrependNode:o,setAppendNode:l,setReplaceNode:c,replaceCount:i,registerReplace:d},children:r})}function Eo({children:r}){const t=h.useContext(wt);return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:t.setPrependNode,style:{display:"contents"}}),t.replaceCount>0?e.jsx("div",{ref:t.setReplaceNode,style:{display:"contents"}}):r,e.jsx("div",{ref:t.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:r})}function ln({children:r,mode:t="append"}){const o=h.useContext(wt);if(h.useEffect(()=>{if(!(t!=="replace"||!o))return o.registerReplace()},[t,o]),!o)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const n=t==="prepend"?o.prependNode:t==="replace"?o.replaceNode:o.appendNode;return n?Nr.createPortal(r,n):null}const Dt=h.createContext(null);function mo({children:r}){const[t,o]=h.useState({}),[n,l]=h.useState({}),s=h.useCallback((a,d)=>{o(g=>g[a]===d?g:{...g,[a]:d})},[]),c=h.useCallback(a=>(l(d=>({...d,[a]:(d[a]??0)+1})),()=>l(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),i=h.useMemo(()=>({outletNodes:t,setOutletNode:s,slotCounts:n,registerSlot:c}),[t,s,n,c]);return e.jsx(Dt.Provider,{value:i,children:r})}function St({slotKey:r,fallback:t}){const o=h.useContext(Dt),n=o?(o.slotCounts[r]??0)>0:!1,l=h.useRef(o==null?void 0:o.setOutletNode);l.current=o==null?void 0:o.setOutletNode;const s=h.useCallback(c=>{var i;return(i=l.current)==null?void 0:i.call(l,r,c)},[r]);return e.jsx(e.Fragment,{children:n?e.jsx("div",{ref:s,style:{display:"contents"}}):t})}function nn({slotKey:r,children:t}){const o=h.useContext(Dt),n=h.useRef(o==null?void 0:o.registerSlot);if(n.current=o==null?void 0:o.registerSlot,h.useEffect(()=>{var s;return(s=n.current)==null?void 0:s.call(n,r)},[r]),!o)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const l=o.outletNodes[r];return l?Nr.createPortal(t,l):null}const qr="moduleSwitcherGroupId",kt="sa-module-switcher-change";function Fo(){if(typeof window>"u")return null;const r=window.localStorage.getItem(qr);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function Mo(r){typeof window>"u"||(r===null?window.localStorage.removeItem(qr):window.localStorage.setItem(qr,String(r)),window.dispatchEvent(new CustomEvent(kt,{detail:r})))}function sn(){Mo(null)}function Bt(){const[r,t]=h.useState(()=>Fo());return h.useEffect(()=>{const n=()=>{t(Fo())},l=s=>{s.key===qr&&n()};return window.addEventListener(kt,n),window.addEventListener("storage",l),()=>{window.removeEventListener(kt,n),window.removeEventListener("storage",l)}},[]),{selectedGroupId:r,setSelectedGroupId:n=>{Mo(n),t(n)}}}let Zr=0,yr=!1,Io=new Set;const To=new Set;function cn(r,t){const[o,n]=h.useState(!1),l=h.useRef(null),s=h.useRef(null);return h.useLayoutEffect(()=>{const c=l.current;if(!c)return;let i=0;const a=()=>{i=0;const g=s.current;if(!g)return;const b=g.scrollWidth>c.clientWidth;n(p=>p===b?p:b)},d=new ResizeObserver(()=>{i||(i=requestAnimationFrame(a))});return d.observe(c),a(),()=>{i&&cancelAnimationFrame(i),d.disconnect()}},[r,t]),{containerRef:l,textRef:s,truncated:o}}function Lo({text:r,textStyle:t,active:o=!1}){const{containerRef:n,textRef:l,truncated:s}=cn(r,o),c=e.jsx(S.Text,{ref:l,as:"span",fontSize:"md",fontWeight:o?"medium":"normal",truncate:!0,style:{display:"block",...t},children:r});return e.jsx(f.Box,{ref:n,display:"block",style:{flex:1,minWidth:0},children:s?e.jsx(Me.Tooltip,{fluid:!0,label:r,position:"top",children:c}):c})}const an=200,Et="var(--app-header-height, 4rem)",Oo="44px",mt=`calc((${Et} - 2rem) / 2)`,Ao=16;function dn({children:r,headerLeftSlot:t,profile:o,isLoadingProfile:n,onLogout:l,isLoggingOut:s,loadingComponent:c,sidebarHeaderContent:i,headerActions:a,profileRole:d,profileMenuButtons:g,profileMenuItems:b,logoutButton:p,resizableSidebar:C=!0}){var gr,ct;const{useSearchParams:E,useNavigate:w,useLocation:W,Outlet:L}=cr(),[I]=E(),k=I.get("embed")==="true",D=pt(),{badges:O}=po(),T=w(),B=W(),H=!Ce.useMediaQuery("md"),[N,K]=h.useState(!1),{collapsed:Z,setCollapsed:G,width:X,setWidth:oe,resetWidth:J,minWidth:_,maxWidth:V,mobileOpen:ce,setMobileOpen:xe}=xo(),[Be,ue]=h.useState(!1),[we,Ge]=h.useState(()=>new Set(Io)),[fe,Ae]=h.useState(null),{selectedGroupId:Ee,setSelectedGroupId:Ne}=Bt(),ne=Z&&!H;h.useEffect(()=>{Io=we},[we]);const ie=h.useRef(null),We=h.useRef(null),Qe=h.useRef(null),[Ie,De]=h.useState(!1),[_e,P]=h.useState(null),R=C&&!H&&!Z,U=m=>Math.min(Math.max(m,_),V),de=_e??X,me=m=>{var ir,qe,ke;if(!R)return;m.preventDefault();const $=m.clientX,Y=((ir=Qe.current)==null?void 0:ir.getBoundingClientRect().width)??X;(ke=(qe=m.currentTarget).setPointerCapture)==null||ke.call(qe,m.pointerId),De(!0),document.body.style.userSelect="none",document.body.style.cursor="col-resize";let Te=0,ze=Y;const Le=fr=>{ze=Y+(fr.clientX-$),Te||(Te=requestAnimationFrame(()=>{Te=0,P(U(ze))}))},Fe=()=>{Te&&cancelAnimationFrame(Te),window.removeEventListener("pointermove",Le),window.removeEventListener("pointerup",Fe),document.body.style.userSelect="",document.body.style.cursor="",P(null),De(!1),ze<an?G(!0):oe(U(ze))};window.addEventListener("pointermove",Le),window.addEventListener("pointerup",Fe)},ye=m=>{R&&(m.key==="ArrowLeft"?(m.preventDefault(),oe($=>$-Ao)):m.key==="ArrowRight"?(m.preventDefault(),oe($=>$+Ao)):m.key==="Home"?(m.preventDefault(),oe(_)):m.key==="End"&&(m.preventDefault(),oe(V)))};h.useEffect(()=>{const m=ie.current;if(!m)return;const $=()=>{yr||(Zr=m.scrollTop)};return m.addEventListener("scroll",$),()=>m.removeEventListener("scroll",$)},[]);const Se=()=>{const m=ie.current;m&&Zr>0&&(yr=!0,m.scrollTop=Zr,requestAnimationFrame(()=>{yr=!1}))};h.useLayoutEffect(()=>{yr=!0,Se();const m=setTimeout(()=>{yr=!1},300);return()=>clearTimeout(m)},[]),h.useLayoutEffect(()=>{D.menus.length>0&&(Zr>0?Se():requestAnimationFrame(()=>{var $;const m=($=ie.current)==null?void 0:$.querySelector("[data-menu-active='true']");m&&m.scrollIntoView({block:"center",behavior:"instant"})}))},[D.menus]),h.useEffect(()=>{yr=!0,Se();const m=setTimeout(Se,0),$=setTimeout(Se,50),Y=setTimeout(Se,100),Te=setTimeout(Se,200),ze=setTimeout(()=>{yr=!1},300),Le=setTimeout(()=>{const Fe=ie.current,ir=Fe==null?void 0:Fe.querySelector("[data-menu-active='true']");if(Fe&&ir){const qe=Fe.getBoundingClientRect(),ke=ir.getBoundingClientRect();ke.top>=qe.top&&ke.bottom<=qe.bottom||ir.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(m),clearTimeout($),clearTimeout(Y),clearTimeout(Te),clearTimeout(ze),clearTimeout(Le)}},[B.pathname]),h.useEffect(()=>{We.current&&(We.current.scrollTop=0)},[B.pathname]),h.useEffect(()=>{H&&xe(!1)},[B.pathname,H]),h.useEffect(()=>{H&&G(!0)},[H]),h.useEffect(()=>{const m=document.documentElement;return m.style.setProperty("--app-header-height",Oo),()=>{m.style.removeProperty("--app-header-height")}},[]);const Re=()=>{K(!0)},Ue=()=>{K(!1)},Je=()=>{K(!1),l()},er=m=>{const $=m.slotKey?[]:[m.to];return m.children&&$.push(...m.children.map(Y=>Y.to)),$},Ye=[...D.menus.flatMap(m=>m.items.flatMap(er)),...((gr=D.menuBottom)==null?void 0:gr.flatMap(er))??[]],pe=m=>{if(!B.pathname.startsWith(m))return!1;const $=Ye.filter(Y=>B.pathname.startsWith(Y)).sort((Y,Te)=>Te.length-Y.length)[0];return m===$};h.useEffect(()=>{var $;const m=Y=>{var ze;const Te=Y.defaultExpanded&&!To.has(Y.id);Te&&To.add(Y.id),(Te||(ze=Y.children)!=null&&ze.some(Le=>B.pathname.startsWith(Le.to)))&&Ge(Le=>{const Fe=new Set(Le);return Fe.add(Y.id),Fe})};D.menus.forEach(Y=>{Y.items.forEach(m)}),($=D.menuBottom)==null||$.forEach(m)},[B.pathname,D.menus,D.menuBottom]);const or=m=>{Ge($=>{const Y=new Set($);return Y.has(m)?Y.delete(m):Y.add(m),Y})};h.useEffect(()=>{D.menus.length!==0&&Ee!==null&&!D.menus.some(m=>m.id===Ee)&&Ne(null)},[D.menus,Ee,Ne]);const kr=h.useMemo(()=>{if(Ee!==null)return D.menus.filter(Y=>Y.id===Ee||Y.parentGroupId===Ee);const m=D.menus.filter(Y=>Y.parentGroupId===void 0),$=D.menus.filter(Y=>Y.parentGroupId!==void 0).flatMap(Y=>Y.items);return $.length===0?m:[...m,{id:18,name:"Pengaturan",items:$,parentGroupId:void 0}]},[D.menus,Ee]);if(k)return e.jsx(f.Box,{as:"main",overflow:"overflow-y-auto",bg:"surface-inverse",style:{height:"100vh"},children:r||e.jsx(L,{})});const hr=m=>{const $=m.children&&m.children.length>0,Y=!!m.slotKey,Te=$||Y,ze=we.has(m.id),Le=$?m.children.some(qe=>pe(qe.to)):Y?!1:pe(m.to),Fe=_r(m.badge,O[m.id]),ir=!!Fe&&Z&&!H;return e.jsxs(f.Box,{display:"block","data-menu-active":Le||void 0,children:[e.jsxs(f.Box,{as:"button",onClick:qe=>{if(Y&&Z&&!H)T(m.to);else if(Te)if(Z&&!H){const ke=qe.currentTarget.getBoundingClientRect();Ae({item:m,top:ke.top,left:ke.right+8})}else or(m.id);else T(m.to)},fullWidth:!0,direction:"row",align:"center",justify:Z&&!H?"center":void 0,gap:"sm",paddingInline:Z&&!H?void 0:"sm",paddingBlock:"xs",height:"height-32",borderRadius:Le?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:Le?"white":void 0,hover:Le?void 0:{bg:"neutral"},title:Z&&!H?m.title:void 0,style:{textAlign:"left",color:Le?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",borderColor:Le?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsxs(f.Box,{position:"relative",display:"inline-flex",flexShrink:"0",style:{alignItems:"center"},children:[e.jsx(F.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),ir&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",top:"top-n2",right:"right-n2",display:"inline-flex",borderRadius:"rounded-full",style:{boxShadow:"0 0 0 1px var(--sa-background-primary, #ffffff)"},children:e.jsx(ar.BadgeDot,{tone:"error",variant:"solid",size:"xs"})})]}),(!Z||H)&&e.jsxs(e.Fragment,{children:[e.jsx(Lo,{text:m.title,active:Le,textStyle:{transition:"opacity 0.3s"}}),Fe&&e.jsx(ar.Badge,{text:String(Fe.value),variant:Fe.variant??"info",size:"xs",border:!0}),Te&&e.jsx(F.Icon,{name:"ChevronDown",size:"sm",style:{flexShrink:0,transition:"transform 0.2s",transform:ze?"rotate(180deg)":"rotate(0deg)"}})]})]}),Te&&(!Z||H)&&(()=>{const qe=m.children??[],ke=Y?-1:qe.findIndex(rr=>pe(rr.to)),fr=qe.map(rr=>{const Hr=_r(rr.badge,O[rr.id]),Pe=pe(rr.to);return e.jsxs(f.Box,{as:"button",onClick:()=>T(rr.to),fullWidth:!0,direction:"row",align:"center",gap:"sm",paddingLeft:"sm",paddingRight:"sm",paddingBlock:"xs",height:"height-32",borderRadius:Pe?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:Pe?"white":void 0,hover:Pe?void 0:{bg:"neutral"},style:{textAlign:"left",color:Pe?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",borderColor:Pe?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsx(F.Icon,{name:rr.icon,size:"sm",style:{flexShrink:0}}),e.jsx(Lo,{text:rr.title,active:Pe}),Hr&&e.jsx(ar.Badge,{text:String(Hr.value),variant:Hr.variant??"info",size:"xs",border:!0})]},rr.id)});return e.jsxs(f.Box,{position:"relative",overflow:"overflow-hidden",style:{marginLeft:"1rem",paddingLeft:"0.75rem",transition:"all 0.3s ease-in-out",maxHeight:ze?Y?"none":`${qe.length*36}px`:"0px",opacity:ze?1:0,marginTop:ze?"0.25rem":"0px"},children:[e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",top:"top-0",fullHeight:!0,style:{width:"1.5px",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),ke>=0&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",height:"height-32",zIndex:"10",style:{top:`${ke*32}px`,width:"1.5px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none"}}),Y?e.jsx(St,{slotKey:m.slotKey,fallback:fr}):fr]})})()]},m.id)};return e.jsx(mo,{children:e.jsxs(Bo,{children:[e.jsxs(f.Box,{direction:"row",position:"relative",style:{height:"100vh","--app-header-height":Oo,"--app-sidebar-width":H?"0px":Z?Et:`${de}px`,"--app-footer-zindex":H&&ce?"40":"998"},children:[H&&e.jsx(f.Box,{position:"fixed",zIndex:"40",bg:"black-alpha-a50",style:{inset:0,opacity:ce?.5:0,pointerEvents:ce?"auto":"none",transition:"opacity 0.3s"},onClick:()=>xe(!1)}),e.jsxs(f.Box,{as:"aside",ref:Qe,bg:"surface-inverse",borderWidth:"border-r",borderStyle:"border-solid-r",borderColor:"border-base",flexShrink:H?void 0:"0",style:{width:H?"16.375rem":Z?Et:`${de}px`,position:H?"fixed":"relative",...H&&{inset:0,zIndex:50,transform:ce?"translateX(0)":"translateX(-100%)"},transition:Ie?"none":"all 0.3s ease-in-out",minWidth:0},children:[e.jsx(f.Box,{onMouseEnter:()=>ue(!0),onMouseLeave:()=>ue(!1),direction:"row",align:"center",justify:"space-between",paddingInline:ne?void 0:"lg",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",position:"relative",style:{height:"var(--app-header-height, 4rem)",...ne?{paddingInline:mt}:null},children:(()=>{const m=!H&&Z&&!ce,$=m&&Be;return e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flex:m?"1":void 0,justify:m?"center":void 0,style:{transition:"opacity 0.2s",opacity:$?0:1,pointerEvents:$?"none":"auto"},children:[e.jsx("img",{src:D.logo,alt:"Logo",style:{width:"1.5rem",height:"1.5rem",flexShrink:0}}),(!Z||ce)&&e.jsx(S.Text,{as:"span",fontSize:"md",fontWeight:"semibold",color:"primary",truncate:!0,style:{transition:"opacity 0.3s"},children:D.appName})]}),!H&&!Z&&e.jsx(f.Box,{as:"button",onClick:()=>G(!0),"aria-label":"Collapse sidebar",display:"inline-flex",align:"center",justify:"center",flexShrink:"0",style:{color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(F.Icon,{name:"LayoutLeft",size:"sm"})}),m&&e.jsx(f.Box,{as:"button",onClick:()=>G(!1),"aria-label":"Expand sidebar",position:"absolute",display:"inline-flex",align:"center",justify:"center",width:"width-32",height:"height-32",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-sm",style:{top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"var(--sa-text-primary, #292a2e)",opacity:$?1:0,pointerEvents:$?"auto":"none",transition:"opacity 0.2s"},children:e.jsx(F.Icon,{name:"LayoutLeft",size:"sm"})}),H&&e.jsx(f.Box,{as:"button",onClick:()=>xe(!1),"aria-label":"Close menu",align:"center",justify:"center",borderRadius:"rounded-md",style:{padding:"0.375rem",color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(F.Icon,{name:"Cross",size:"md"})})]})})()}),i&&e.jsx(ko,{collapsed:H?!1:Z,children:i}),e.jsx(f.Box,{ref:ie,flex:"1",overflow:"overflow-y-auto",paddingBlock:"lg",children:kr.map(m=>e.jsxs(f.Box,{marginBottom:"lg",children:[!Z||H?m.name&&e.jsx(S.Text,{fontSize:"sm",fontWeight:"semibold",color:"subtlest",textTransform:"uppercase",truncate:!0,style:{letterSpacing:"0.06em",paddingLeft:"1.25rem",paddingRight:"0.75rem",paddingBottom:"0.25rem",transition:"opacity 0.3s"},children:m.name}):m.name&&e.jsx(f.Box,{"aria-label":m.name,direction:"row",align:"center",justify:"center",paddingBlock:"md",children:e.jsx(f.Box,{width:"width-16",style:{height:"2px",borderRadius:"1px",backgroundColor:m.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx(f.Box,{paddingInline:ne?void 0:"md",gap:"xs",style:ne?{paddingInline:mt}:void 0,children:m.slotKey?e.jsx(St,{slotKey:m.slotKey,fallback:m.items.map($=>hr($))}):m.items.map($=>hr($))})]},m.id))}),D.menuBottom&&D.menuBottom.length>0&&e.jsx(f.Box,{borderWidth:"border-t",borderStyle:"border-solid-t",borderColor:"border-base",paddingBlock:"md",paddingInline:ne?void 0:"md",bg:"surface-inverse",gap:"xs",flexShrink:"0",style:ne?{paddingInline:mt}:void 0,children:D.menuBottom.map(m=>hr(m))}),R&&e.jsx(f.Box,{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":X,"aria-valuemin":_,"aria-valuemax":V,tabIndex:0,onPointerDown:me,onKeyDown:ye,onDoubleClick:J,title:"Drag to resize · double-click to reset",position:"absolute",top:"top-0",right:"right-0",fullHeight:!0,style:{width:"6px",transform:"translateX(50%)",cursor:"col-resize",zIndex:5,touchAction:"none",background:Ie?"var(--sa-background-brand, #04254f)":"transparent",transition:"background 0.15s"},onMouseEnter:m=>{Ie||(m.currentTarget.style.background="var(--sa-border-bold, #0b120e40)")},onMouseLeave:m=>{Ie||(m.currentTarget.style.background="transparent")}})]}),e.jsxs(f.Box,{flex:"1",overflow:"overflow-hidden",children:[e.jsxs(f.Box,{as:"header",bg:"white",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",direction:"row",align:"center",justify:"space-between",paddingInline:"lg",flexShrink:"0",style:{height:"var(--app-header-height, 4rem)"},children:[e.jsxs(f.Box,{direction:"row",align:"center",gap:H?"lg":void 0,children:[H&&e.jsx(f.Box,{as:"button",onClick:()=>xe(!0),align:"center",justify:"center",borderRadius:"rounded-md",style:{padding:"0.375rem",color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(F.Icon,{name:"MenuBurger",size:"lg"})}),e.jsx(Eo,{children:t})]}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"md",children:[a,e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",cursor:"pointer",children:[!H&&e.jsxs(f.Box,{display:"block",textAlign:"right",customMaxWidth:"12.5rem",children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",textAlign:"right",truncate:!0,lineHeight:"leading-none",children:n?"Loading...":(o==null?void 0:o.name)||"unknown"}),e.jsx(S.Text,{fontSize:"sm",color:"subtle",textAlign:"right",truncate:!0,children:n?"":(o==null?void 0:o.email)||"unknown"})]}),e.jsx(Vr.Avatar,{size:"sm",initials:((o==null?void 0:o.name)||"U")[0].toUpperCase(),bg:"var(--sa-background-brand, #04254f)",color:"var(--sa-background-primary, #ffffff)"}),e.jsx(F.Icon,{name:"ChevronDown",size:"xs",color:"subtle"})]})}),e.jsxs(A.MenuLists,{width:280,style:{paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(A.MenuHeading,{children:e.jsxs(f.Box,{align:"center",textAlign:"center",paddingBlock:"sm",fullWidth:!0,children:[e.jsx(Vr.Avatar,{customSize:64,initials:((o==null?void 0:o.name)||"U")[0].toUpperCase(),bg:"var(--sa-background-brand, #04254f)",color:"var(--sa-background-primary, #ffffff)",style:{fontSize:"1.25rem",marginBottom:"0.75rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)"}}),e.jsx(S.Text,{fontSize:"md",fontWeight:"semibold",color:"primary",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(o==null?void 0:o.name)||"unknown"}),e.jsx(S.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(o==null?void 0:o.email)||"unknown"}),d&&e.jsx(S.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:d})]})}),(g&&g.length>0||b)&&e.jsxs(A.MenuBody,{children:[g==null?void 0:g.map((m,$)=>e.jsx(A.MenuItem,{onClick:m.onClick,startIcon:e.jsx(F.Icon,{name:m.icon,size:"md"}),children:m.label},`${m.label}-${$}`)),b]}),p??e.jsx(A.MenuFooter,{children:e.jsx(A.MenuItem,{intent:"danger",onClick:Re,startIcon:e.jsx(F.Icon,{name:"Logout",size:"md"}),children:"Logout"})})]})]})]})]}),e.jsx(f.Box,{as:"main",ref:We,flex:"1",overflow:"overflow-y-auto",children:r||e.jsx(L,{})})]})]}),s&&c&&e.jsx(f.Box,{position:"fixed",align:"center",justify:"center",bg:"black-alpha-a70",style:{inset:0,zIndex:9999},children:c}),e.jsxs(Ve.Dialog,{isShow:N,onHide:Ue,children:[e.jsx(Ve.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Ve.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Ve.DialogFooter,{children:e.jsx(f.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(ae.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(f.Box,{direction:"column",children:e.jsx(j.Button,{secondary:!0,onClick:Ue,children:"Cancel"})}),e.jsx(f.Box,{direction:"column",children:e.jsx(j.Button,{primary:!0,onClick:Je,children:"Yes, Sure"})})]})})})]}),fe&&e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{onClick:()=>Ae(null),position:"fixed",style:{inset:0,zIndex:60}}),e.jsxs(f.Box,{role:"dialog","aria-label":fe.item.title,position:"fixed",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-md",shadow:"shadow-lg",padding:"sm",gap:"spacing-2",style:{top:fe.top,left:fe.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem"},children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-500",textTransform:"uppercase",style:{padding:"0.25rem 0.5rem 0.5rem",letterSpacing:"0.05em"},children:fe.item.title}),(ct=fe.item.children)==null?void 0:ct.map(m=>{const $=pe(m.to),Y=_r(m.badge,O[m.id]);return e.jsxs(f.Box,{as:"button",onClick:()=>{T(m.to),Ae(null)},fullWidth:!0,direction:"row",align:"center",gap:"md",paddingBlock:"sm",paddingInline:"md",borderRadius:"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:$?"primary-inverse":void 0,hover:$?void 0:{bg:"primary-inverse"},style:{textAlign:"left",borderColor:"transparent",color:$?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)"},children:[m.icon&&e.jsx(F.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),e.jsx(S.Text,{as:"span",fontSize:"md",fontWeight:$?"medium":"normal",whiteSpace:"nowrap",style:{flex:1},children:m.title}),Y&&e.jsx(ar.Badge,{text:String(Y.value),variant:Y.variant??"info",size:"xs",border:!0})]},m.id)})]})]})]})})}const Mr=h.forwardRef(({children:r,...t},o)=>e.jsx(f.Box,{ref:o,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...t,children:r})),Wo=({title:r,iconName:t,textColor:o,iconColor:n,hoverTextColor:l,hoverIconColor:s})=>{const[c,i]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=o??"var(--sa-text-subtle, #8c8f97)",g=s??"var(--sa-text-subtle, #8c8f97)",b=l??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{cursor:"pointer"},children:[e.jsx(F.Icon,{name:t||"ChevronLeft",size:"xs",style:{color:c?g:a,transition:"color 0.15s ease"}}),e.jsx(S.Text,{variant:"sub-h3",style:{color:c?b:d,transition:"color 0.15s ease"},children:r||"Back"})]})},hn=({items:r,separator:t="/",iconName:o,iconColor:n,hoverIconColor:l})=>{const{Link:s}=cr(),[c,i]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=l??"var(--sa-text-subtle, #8c8f97)",g=r.length>1?r[0]:void 0,b=!!(g!=null&&g.to||g!=null&&g.onClick),p=e.jsx(F.Icon,{name:o||"ChevronLeft",size:"xs",onMouseEnter:b?()=>i(!0):void 0,onMouseLeave:b?()=>i(!1):void 0,style:{color:b&&c?d:a,transition:"color 0.15s ease",cursor:b?"pointer":void 0}}),C=g!=null&&g.to?e.jsx(s,{to:g.to,replace:!0,style:{textDecoration:"none"},children:p}):g!=null&&g.onClick?e.jsx(Mr,{onClick:g.onClick,children:p}):p;return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",children:[C,e.jsx(br.Breadcrumb,{separator:t,size:"md",children:r.map((E,w)=>{const W=w===r.length-1;return E.to&&!W?e.jsx(br.BreadcrumbItem,{children:e.jsx(s,{to:E.to,children:E.label})},w):e.jsx(br.BreadcrumbItem,{currentPage:W,children:e.jsx(br.BreadcrumbLink,{onClick:W?void 0:E.onClick,children:E.label})},w)})})]})},fn=r=>{const{Link:t}=cr(),{items:o,separator:n,onClick:l,navigateTo:s,...c}=r;return o&&o.length>0?e.jsx(hn,{items:o,separator:n,iconName:c.iconName,iconColor:c.iconColor,hoverIconColor:c.hoverIconColor}):s?e.jsx(f.Box,{direction:"row",children:e.jsx(t,{to:s,replace:!0,style:{textDecoration:"none"},children:e.jsx(Wo,{...c})})}):e.jsx(f.Box,{direction:"row",children:e.jsx(Mr,{onClick:l,children:e.jsx(Wo,{...c})})})},Ft=[{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 zo(r,t,o){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:r?`2px solid ${o.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:r?o.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:r?t?`0 8px 20px ${o.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${o.activeShadow}`:t?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:t?"translateY(-3px) scale(1.05)":"translateY(0) scale(1)",transition:"box-shadow 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease"}}const Ho={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},Po={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function Vo({isShow:r,onHide:t,menus:o,selectedGroupId:n,onSelect:l}){const[s,c]=h.useState(void 0),i=d=>{l(d),t()},a=Ft[0];return e.jsx(Ve.Dialog,{isShow:r,onHide:t,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Ve.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>i(null),onMouseEnter:()=>c("all"),onMouseLeave:()=>c(void 0),style:Po,children:[e.jsx("div",{style:zo(n===null,s==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(F.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Ho,children:"Semua"})]}),o.map((d,g)=>{var w;const b=n===d.id,p=s===d.id,C=((w=d.items[0])==null?void 0:w.icon)??"Grid",E=Ft[(g+1)%Ft.length];return e.jsxs("button",{onClick:()=>i(d.id),onMouseEnter:()=>c(d.id),onMouseLeave:()=>c(void 0),style:Po,children:[e.jsx("div",{style:zo(b,p,E),children:e.jsx("div",{style:{color:E.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(F.Icon,{name:C,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Ho,children:d.name})]},d.id)})]})})})}function un({onSelect:r,"aria-label":t="Pilih module"}={}){const o=pt(),{useNavigate:n}=cr(),l=n(),{selectedGroupId:s,setSelectedGroupId:c}=Bt(),[i,a]=h.useState(!1),d=g=>{var b;if(c(g),g!==null){const p=o.menus.find(E=>E.id===g),C=(b=p==null?void 0:p.items[0])==null?void 0:b.to;C&&l(C)}r==null||r(g)};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":t,onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent"},children:e.jsx(F.Icon,{name:"GridApplication",size:"sm"})}),s!==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(Vo,{isShow:i,onHide:()=>a(!1),menus:o.menus.filter(g=>g.parentGroupId===void 0),selectedGroupId:s,onSelect:d})]})}const gn=(r,t)=>{const o=[];if(t===0)return o.push(r),o;for(let n=0;n<r.length;n+=t){const l=r.slice(n,n+t);o.push(l)}return o},yn=h.memo(({value:r,label:t,separator:o,labelWidth:n,lastIndex:l,labelAlign:s="top"})=>{const c=h.useMemo(()=>({padding:0,paddingBottom:l?0:12,verticalAlign:s}),[l,s]),i=h.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:l?0:12,verticalAlign:s}),[l,s]),a=()=>typeof t=="string"?e.jsx(S.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,d=()=>typeof r=="string"||typeof r=="number"?e.jsx(S.Text,{color:"primary",fontWeight:"medium",children:r}):r,g=()=>typeof o=="string"||typeof o=="number"?e.jsx(S.Text,{fontWeight:"medium",color:"subtlest",children:o}):o;return e.jsxs(Q.Tr,{children:[e.jsx(Q.Td,{style:c,width:n,children:a()}),o?e.jsx(Q.Td,{style:i,width:24,children:g()}):null,e.jsx(Q.Td,{style:c,children:d()})]})}),pn=h.memo(({fields:r,separator:t,labelWidth:o})=>e.jsx(Q.Table,{withColumnBorder:!1,withRowBorder:!1,children:r.map((n,l)=>e.jsx(yn,{separator:t,labelWidth:o,lastIndex:l===r.length-1,...n},`field-group-field-${l}`))})),bn=h.memo(({maxRow:r=0,maxColumn:t=2,separator:o=":",fields:n=[],labelWidth:l=150,bordered:s=!1})=>{const c=h.useMemo(()=>gn(n,r),[n,r]),i=c.length>2,a=()=>{switch(t){case 1:return"width-full";case 2:return"width-1-2";case 3:return"width-1-3";case 4:return"width-1-4";default:return"width-1-2"}};return e.jsx(f.Box,{gap:i?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:i?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:s?"border":void 0,borderStyle:s?"border-solid":void 0,borderColor:s?"border-subtle":void 0,children:c.map((d,g)=>e.jsx(f.Box,{direction:"column",flex:i?void 0:"1",width:i?a():void 0,marginBottom:i?"lg":void 0,children:e.jsx(pn,{labelWidth:l,fields:d,separator:o})},g))})}),vn=({backButton:r})=>{const[t,o]=h.useState(!1),n=(r==null?void 0:r.iconColor)??"var(--sa-text-subtle, #8c8f97)",l=(r==null?void 0:r.textColor)??"var(--sa-text-subtle, #8c8f97)",s=(r==null?void 0:r.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",c=(r==null?void 0:r.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{cursor:"pointer"},children:[e.jsx(F.Icon,{name:(r==null?void 0:r.iconName)||"ChevronLeft",size:"xs",style:{color:t?s:n,transition:"color 0.15s ease"}}),e.jsx(S.Text,{variant:"sub-h3",style:{color:t?c:l,textDecoration:t?"underline":"none",transition:"color 0.15s ease"},children:(r==null?void 0:r.title)||"Back"})]})},Cn=({backButton:r,title:t,titleIcon:o,titleTag:n,children:l,header:s=!0,headerBorder:c=!1,disableAnimation:i=!1,scrollable:a=!1,stickyHeader:d=!1,subHeaders:g,action:b,titleTagProps:p,containerProps:C,headerProps:E})=>{const w=Ce.useMediaQuery("md"),{Link:W,useNavigate:L,useLocation:I}=cr(),k=L(),D=I(),O=r==null?void 0:r.show,T=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}k(-1,{replace:!0})},B=()=>{if(!b)return null;if(h.isValidElement(b))return b;const G=b.filter(X=>X&&(X.title||X.icon));return G.length===0?null:w?e.jsx(f.Box,{direction:"row",gap:"md",children:G.map(({title:X,icon:oe,buttonProps:J,onClick:_},V)=>e.jsx(j.Button,{iconLeft:oe?e.jsx(F.Icon,{name:oe,size:"md"}):void 0,onClick:_,...J,children:X},`action-${V}`))}):e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(F.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{minWidth:200},children:G.map(({title:X,icon:oe,buttonProps:J,onClick:_},V)=>{const ce=(J==null?void 0:J.tone)==="error"||(J==null?void 0:J.danger)===!0;return e.jsx(A.MenuItem,{intent:ce?"danger":void 0,disabled:J==null?void 0:J.disabled,startIcon:oe?e.jsx(F.Icon,{name:oe}):void 0,onClick:_,children:X},`action-${V}`)})})})]})},z=()=>{const G=e.jsx(vn,{backButton:r});return r!=null&&r.navigateTo?e.jsx(f.Box,{direction:"row",children:e.jsx(W,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:G})}):e.jsx(f.Box,{direction:"row",children:e.jsx(Mr,{onClick:T,children:G})})},H=()=>{const G=!!t,X=Array.isArray(b)&&b.length>0,oe=h.isValidElement(b)?!0:X;if(!G&&!oe&&!O)return null;const _=w||!w&&X;return e.jsxs(f.Box,{direction:"column",gap:"xs",paddingBlock:(E==null?void 0:E.paddingBlock)??"sm",paddingInline:(E==null?void 0:E.paddingInline)??"md",...E,style:{...c?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...E==null?void 0:E.style},children:[O&&z(),(G||oe)&&e.jsxs(f.Box,{direction:_?"row":"column",gap:"sm",justify:"space-between",align:_?"center":"flex-start",children:[G?typeof t=="string"?e.jsxs(f.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[o&&e.jsx(F.Icon,{name:o,size:"md",color:"primary"}),e.jsx(S.Text,{variant:"h3",fontWeight:"semibold",children:t})]}),n&&e.jsx(ar.Badge,{border:!0,size:"lg",text:n,...p})]}):t:null,B()]})]})},N=()=>{if(!g||g.length===0)return null;const G=g.filter(J=>J.show!==!1);if(G.length===0)return null;let X=0,oe=-1/0;return G.forEach((J,_)=>{const V=J.order??0;V>=oe&&(oe=V,X=_)}),G.map(({content:J,order:_,borderBottom:V=!0,keepBottomPadding:ce=!1,paddingInline:xe=!0,paddingBlock:Be=!0},ue)=>e.jsx(f.Box,{direction:"column",paddingTop:Be?"sm":"spacing-0",paddingBottom:Be&&(V||ce||ue===X)?"sm":"spacing-0",paddingInline:xe?"md":"spacing-0",style:{...V?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},..._!==void 0?{order:_}:{}},children:J},`sub-header-${ue}`))},K=()=>{const G=s?H():null,X=N();return!G&&!X?null:e.jsxs(f.Box,{direction:"column",style:{...a?{position:"sticky",left:0,...d?{top:0}:{},zIndex:2,background:"var(--sa-background-primary, #ffffff)"}:{},marginBottom:X?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[G,X]})},Z=()=>l;return e.jsxs(f.Box,{direction:"column",as:"main",...C,style:{...a?{height:"100%",minHeight:0,overflow:"auto"}:{},...(C==null?void 0:C.style)??{},...i?{}:{animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"}},children:[K(),Z()]},D.pathname)},xn=h.memo(Cn),wn={icon:"Cross",title:""},Dn=320,jo=16,No=4,Sn=8,_o=h.forwardRef(({onHide:r,show:t,withBlur:o=!1,style:n,children:l,closeButton:s=wn,paddingHorizontal:c=!0,width:i,minWidth:a,maxWidth:d,hideBackdrop:g=!1,title:b,headerAction:p,header:C=!0,widthPresets:E,resizable:w=!0,resizeMin:W=Dn,resizeMax:L,onWidthChange:I},k)=>{const O=!Ce.useMediaQuery("md"),T=i??d??a??"357px",B=E??[],z=B.length>1,[H,N]=h.useState(()=>{const ne=B.indexOf(T);return ne>=0?ne:0}),[K,Z]=h.useState(null),[G,X]=h.useState(!1),[oe,J]=h.useState(!1),_=h.useRef(null),V=ne=>{_.current=ne,typeof k=="function"?k(ne):k&&(k.current=ne)},ce=z?B[H]:T,xe=K!=null?`${K}px`:ce,Be=w&&!O,ue=H===B.length-1,we=()=>{const ne=(H+1)%B.length;Z(null),N(ne),I==null||I(B[ne])},Ge=h.useCallback(ne=>{const ie=L??window.innerWidth;return Math.min(Math.max(ne,W),ie)},[W,L]),fe=h.useRef(null),Ae=ne=>{if(!Be)return;ne.preventDefault();const ie=ne.currentTarget;ie.setPointerCapture(ne.pointerId),X(!0);const We=document.body.style.cursor,Qe=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let Ie=null;const De=P=>{const R=Ge(window.innerWidth-P.clientX);fe.current=R,Ie==null&&(Ie=window.requestAnimationFrame(()=>{Ie=null,fe.current!=null&&Z(fe.current)}))},_e=P=>{Ie!=null&&window.cancelAnimationFrame(Ie),fe.current!=null&&Z(fe.current),ie.releasePointerCapture(P.pointerId),ie.removeEventListener("pointermove",De),ie.removeEventListener("pointerup",_e),ie.removeEventListener("pointercancel",_e),document.body.style.cursor=We,document.body.style.userSelect=Qe,X(!1),fe.current!=null&&(I==null||I(`${fe.current}px`))};ie.addEventListener("pointermove",De),ie.addEventListener("pointerup",_e),ie.addEventListener("pointercancel",_e)},Ee=ne=>{var Ie;if(!Be||ne.key!=="ArrowLeft"&&ne.key!=="ArrowRight")return;ne.preventDefault();const ie=ne.key==="ArrowLeft"?jo:-jo,We=K??((Ie=_.current)==null?void 0:Ie.offsetWidth)??W,Qe=Ge(We+ie);Z(Qe),I==null||I(`${Qe}px`)},Ne=()=>{Be&&(Z(null),I==null||I(ce))};return e.jsx(jr.Drawer,{blur:o,isShow:t,position:"right",onHide:r,ref:V,size:xe,style:n,flush:!0,radius:"none",hideBackdrop:g,children:e.jsxs(f.Box,{direction:"column",height:"height-full",children:[Be?e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Ubah lebar panel",tabIndex:0,onPointerDown:Ae,onKeyDown:Ee,onDoubleClick:Ne,title:"Tarik untuk mengubah lebar — klik dua kali untuk reset",onPointerEnter:()=>J(!0),onPointerLeave:()=>J(!1),style:{position:"absolute",left:0,top:0,bottom:0,width:Sn,cursor:"col-resize",zIndex:1,background:G||oe?`linear-gradient(to right, var(--sa-border-brand, var(--sa-border-subtle)) 0 ${No}px, transparent ${No}px)`:"transparent",transition:"background 0.15s",touchAction:"none"}}):null,C?e.jsxs(f.Box,{direction:"row",align:"center",justify:"space-between",gap:"sm",paddingInline:"md",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",customHeight:"var(--app-header-height, 44px)",flexShrink:"0",children:[e.jsx(f.Box,{direction:"row",align:"center",gap:"sm",overflow:"overflow-hidden",children:typeof b=="string"?e.jsx(S.Text,{fontSize:"md",fontWeight:"bold",children:b}):b}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flexShrink:"0",children:[p,z?e.jsx(j.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:we,"aria-label":ue?"Kecilkan panel":"Lebarkan panel",iconRight:e.jsx(F.Icon,{name:ue?"ChevronRight":"ChevronLeft"})}):null,s?e.jsx(j.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:r,"aria-label":s.title||"Tutup",iconRight:e.jsx(F.Icon,{name:s.icon}),children:s.title||void 0}):null]})]}):null,e.jsx(f.Box,{direction:"column",paddingBlock:"md",paddingInline:c?"md":"spacing-0",overflow:"overflow-y-auto",style:{flex:1,minHeight:0},children:l})]})})}),Mt=h.memo(({children:r,borderBottom:t=!0,padding:o=!0})=>{const n=Ce.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:o?"md":"spacing-0",paddingLeft:o?"md":"spacing-0",paddingRight:o?"md":"spacing-0",style:t?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),It=h.memo(({children:r,borderTop:t=!0,padding:o=!0})=>{const n=Ce.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:o?"md":"spacing-0",paddingLeft:o?"md":"spacing-0",paddingRight:o?"md":"spacing-0",style:t?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),kn=h.memo(({children:r,...t})=>e.jsx(f.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),Bn=h.memo(({children:r,title:t,titleTag:o,action:n,header:l,footer:s,actionContainer:c,containerProps:i,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:g={borderTop:!0},variantTag:b="info"})=>{const p=Ce.useMediaQuery("lg"),C=()=>o?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(S.Text,{fontWeight:"medium",children:t}),e.jsx(ar.Badges,{border:!0,text:o,variant:b})]}):e.jsx(S.Text,{fontWeight:"medium",children:t}),E=()=>l||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:t?C():null}),e.jsx(f.Box,{direction:"column",style:p?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...c,children:n??null})]}),w=!!(l||t||n);return e.jsxs(f.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...i,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(i==null?void 0:i.style)??{}},children:[l!==null&&w?e.jsx(Mt,{...d,children:E()}):null,e.jsx(kn,{...a,children:r}),s?e.jsx(It,{...g,children:s}):null]})}),Ke={H1:r=>e.jsx(S.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(S.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(S.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(S.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(S.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(S.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(S.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(S.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(S.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(S.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(S.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(S.Text,{variant:"body-3",children:r.children,...r.props})},je=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=cr(),[n,l]=r(),s=Cr.searchParamsToObject(n.toString()),c=t(),i=o(),a=c.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,E)=>n.has(C)&&n.get(C)===E,getQueryParam:C=>n.get(C),getRouteParam:C=>c[C],params:c,location:i,id:a,hasId:!!a}},qo=r=>JSON.stringify(r),Zo=r=>JSON.stringify(r),Go=r=>JSON.stringify(r),Qo=r=>JSON.stringify(r),En=r=>r,mn=r=>JSON.stringify(r),Ir=r=>{if(typeof r!="string"||r==="")return{};try{const t=JSON.parse(r);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}},Tr=({value:r,name:t,type:o,withSearchParam:n=!0,setSearchParams:l,searchQueries:s,dropdownSearchKey:c,filterKey:i="filter",pageKey:a="page"})=>{if(n){let d;switch(o){case"search":d=En(r);break;case"dropdown":case"dropdown-multiple":d=qo(r);break;case"radio":d=Zo(r);break;case"date-range":d=Go(r);break;case"advanced-date-range":d=mn(r);break;case"date":d=Qo(r);break;default:d=r;break}if(typeof d<"u"){const g={...Ir(s[i]),[t]:d},b={...s};c&&typeof c=="string"&&delete b[c],delete b[a];const p={...b,[i]:JSON.stringify(g)},C=new URLSearchParams(s).toString(),E=new URLSearchParams(p).toString();if(C===E)return;l(p)}}},Gr=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,s=l&&typeof l=="string"?JSON.parse(l):void 0,c=s?s[r]:void 0;return n==="label"&&c?JSON.parse(c)[0].label:n==="value"&&c?JSON.parse(c)[0].value:c},Uo=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,s=l&&typeof l=="string"?JSON.parse(l):void 0,c=s?s[r]:void 0;return n==="label"&&c?JSON.parse(c).map(i=>i.label):n==="value"&&c?JSON.parse(c).map(i=>i.value):n==="array"&&c?JSON.parse(c):c},Fn=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,s=l&&typeof l=="string"?JSON.parse(l):void 0,c=s?s[r]:void 0;return n==="id"&&c?JSON.parse(c).id:n==="label"&&c?JSON.parse(c).label:n==="value"&&c?JSON.parse(c).value:c},Qr=(r,t,o)=>{const n=t.get(o||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0;return l?l[r]:void 0},Mn=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0,s=l?l[r]:void 0;return{start:s?JSON.parse(s).from:void 0,end:s?JSON.parse(s).to:void 0}},Jo=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0,s=l?l[r]:void 0;return s?JSON.parse(s):void 0},In=(r,{filterKey:t="filter",perPageKey:o="perPage",pageKey:n="page"})=>{const l=r.get(t)||void 0,s=r.get(o)||void 0,c=r.get(n)||void 0;return!!l||!!s||!!c},Yo=({isOpen:r,onClose:t,filterKey:o,pageKey:n,filters:l})=>{const{searchParams:s,setSearchParams:c,searchQueries:i}=je(),[a,d]=h.useState({}),g=()=>{s.delete(o||"filter"),c(s)},b=(p,C)=>{switch(p.type){case"radio":{const{show:E=!0}=p;return E&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}case"dropdown":{const{show:E=!0}=p;return E&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}case"date-range":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C);case"date":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C);case"dropdown-multiple":{const{show:E=!0}=p;return E&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}default:return null}};return e.jsx(_o,{onHide:t,show:r||!1,children:e.jsxs(f.Box,{direction:"column",gap:"md",children:[e.jsxs(ae.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:g,children:"Reset"})]}),l==null?void 0:l.map((p,C)=>b(p,C))]})})},Xo=({searchKey:r="q",statusKey:t="status",searchPlaceholder:o="Search",searchHighlightPlaceholder:n,extendedFilter:l,showSearchFilter:s=!0,showStatusFilter:c=!0,filterKey:i="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:g,filterConfigs:b,buttonToggleProps:p,position:C="right",titleSearchLabel:E="Work Order",withTitleLabels:w=!1})=>{const L=(p==null?void 0:p.isShowLabel)??!0,[I,k]=h.useState(!1),[D,O]=h.useState(0),T=()=>{O(V=>V+1)},{searchParams:B,setSearchParams:z,getQueryParam:H}=je(),N=Cr.searchParamsToObject(B.toString()),K=Qr(r,B,i)||"",[Z,G]=h.useState(K),X=H(i),J=!!(X&&!(()=>{if(X)try{const V=JSON.parse(X);return Object.keys(V).length===1&&V[r]===""}catch(V){console.error("Filter parameter is not a valid JSON:",V)}return!1})()),_=Ce.useMediaQuery("md");return h.useEffect(()=>{G(K)},[K]),h.useEffect(()=>{if(Z===K)return;const V=window.setTimeout(()=>{Tr({value:Z,name:r,type:"search",searchQueries:N,setSearchParams:z,filterKey:i,pageKey:a})},350);return()=>{window.clearTimeout(V)}},[Z,K,r,N,z,i,a]),e.jsxs(ae.Flex,{gap:"md",style:{flexDirection:_&&C==="left"?"row":_&&C==="right"?"row-reverse":"column"},align:"flex-end",children:[J&&e.jsx(f.Box,{direction:"column",justify:"flex-end",children:e.jsx(j.Button,{onClick:()=>{const V=new URLSearchParams(B);V.delete(i),z(V),G(""),T(),g&&g()},variant:"outline",tone:"neutral",children:e.jsx(S.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),l==null?void 0:l.map(({minWidth:V,content:ce,title:xe,onClickContainer:Be},ue)=>e.jsxs(f.Box,{direction:"column",gap:"sm",onClick:Be,style:{minWidth:V},children:[xe&&e.jsx(Ke.SubH3,{children:xe}),ce]},`extended-filter-${ue}-${D}`)),!!(b!=null&&b.length)&&e.jsx(j.Button,{primary:J,secondary:!J,iconLeft:e.jsx(F.Icon,{size:"sm",name:(p==null?void 0:p.icon)||"FilterHorizontal",style:{color:X?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!_,onClick:()=>k(!0),children:L?"Filter":void 0}),c&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[w&&e.jsx(Ke.SubH3,{children:"Status"}),e.jsx(vr.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Gr({get:"value",name:t,searchParams:B,filterKey:i})?[{label:Gr({get:"value",name:t,searchParams:B,filterKey:i})==="active"?"Active":"InActive",value:Gr({get:"value",name:t,searchParams:B,filterKey:i})}]:[],onChange:V=>Tr({value:V,name:t,type:"dropdown",searchQueries:N,setSearchParams:z,filterKey:i}),placeholder:w?"All":"All Status"},D)]}),s&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{width:d&&_?d:_?"310px":""},children:[w&&e.jsxs(Ke.SubH3,{children:["Search for ",E]}),e.jsx(nr.Input,{placeholder:o,leftIcon:e.jsx(F.Icon,{name:"Search",width:20,height:20}),onChange:V=>G(V.target.value),value:Z,fullWidth:!0},D+1+i)]}),e.jsx(Yo,{isOpen:I,onClose:()=>k(!1),filterKey:i,filters:b,pageKey:a})]})},Tn=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r==="text"?"search":r;function Tt({configs:r,filterKey:t="filter",activeFilterKey:o="filters",pageKey:n="page",searchKey:l="q"}){const{searchParams:s,setSearchParams:c,searchQueries:i}=je(),a=h.useMemo(()=>Object.fromEntries(r.map(D=>[D.key,D])),[r]),d=h.useMemo(()=>{const D=(s.get(o)||"").split(",").map(T=>T.trim()).filter(Boolean),O=Object.keys(Ir(s.get(t))).filter(T=>T!==l);return r.map(T=>T.key).filter(T=>{const B=a[T];return(B==null?void 0:B.locked)||D.includes(T)||O.includes(T)})},[s,o,t,l,r,a]),g=h.useCallback(D=>Ir(D[t]),[t]),b=h.useCallback(D=>{const O={...i};D.length?O[o]=D.join(","):delete O[o],c(O)},[i,o,c]),p=h.useCallback(D=>{d.includes(D)||b([...d,D])},[d,b]),C=h.useCallback(D=>{var z;if((z=a[D])!=null&&z.locked)return;const O={...i},T=d.filter(H=>H!==D);T.length?O[o]=T.join(","):delete O[o];const B=g(O);D in B&&(delete B[D],Object.keys(B).length?O[t]=JSON.stringify(B):delete O[t]),delete O[n],c(O)},[i,d,o,t,n,g,c,a]),E=h.useCallback(D=>d.includes(D)?C(D):p(D),[d,p,C]),w=h.useCallback(D=>{switch(D.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return Uo({name:D.key,get:"array",searchParams:s,filterKey:t})||[];case"date":{const O=Jo({name:D.key,searchParams:s,filterKey:t});return O?new Date(O):void 0}case"date-compact":{const T=g(Object.fromEntries(s.entries()))[D.key];return T&&typeof T=="object"?T:void 0}case"text":{const T=g(Object.fromEntries(s.entries()))[D.key];return typeof T=="string"?T:void 0}default:return}},[s,t,g]),W=h.useCallback((D,O)=>{if(D.type==="date-compact"||D.type==="text"){const T={...i},B=g(T);O==null||O===""?delete B[D.key]:B[D.key]=O,Object.keys(B).length?T[t]=JSON.stringify(B):delete T[t],delete T[n],c(T);return}Tr({value:O,name:D.key,type:Tn(D.type),searchQueries:i,setSearchParams:c,filterKey:t,pageKey:n})},[i,c,t,n,g]),L=h.useCallback(D=>{const O={...i},T=g(O);D in T&&(delete T[D],Object.keys(T).length?O[t]=JSON.stringify(T):delete O[t]),delete O[n],c(O)},[i,t,n,g,c]),I=h.useCallback(()=>{const D={...i};delete D[t],delete D[o],delete D[n],c(D)},[i,t,o,n,c]),k=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:k,addFilter:p,removeFilter:C,toggleFilter:E,getValue:w,setValue:W,clearValue:L,clearAll:I}}const Lt={get(r){return Fr.storage.get(r)??null},set(r,t){Fr.storage.save(r,t)},remove(r){Fr.storage.delete(r)}},Dr={columns:r=>`filterbar:colprefs:${r}`,savedViews:r=>`filterbar:views:${r}`,lastState:r=>`filterbar:last:${r}`,perPage:r=>`filterbar:perpage:${r}`,tableSort:r=>`tablelayout:sort:${r}`},Ur=(r,t)=>{const o=new Set(t.map(s=>s.key)),n=r.order.filter(s=>o.has(s));for(const s of t)n.includes(s.key)||n.push(s.key);const l=r.hidden.filter(s=>o.has(s));return{order:n,hidden:l}};function Ln({columns:r,scopeId:t,storage:o,onColumnsChange:n,value:l}){const s=h.useMemo(()=>({order:r.map(B=>B.key),hidden:[]}),[r]),c=t?Dr.columns(t):void 0,i=(B,z)=>Ur({order:B.order??z,hidden:B.hidden??[]},r),[a,d]=h.useState(()=>{if(l&&(l.order||l.hidden))return i(l,r.map(B=>B.key));if(c){const B=o.get(c);if(B&&Array.isArray(B.order))return Ur(B,r)}return s}),g=r.map(B=>B.key).join("|");h.useEffect(()=>d(B=>Ur(B,r)),[g]);const b=h.useRef(a);b.current=a;const p=l?`${(l.order??[]).join("|")}~${(l.hidden??[]).join("|")}`:null,C=h.useRef(p);h.useEffect(()=>{if(p==null||C.current===p)return;C.current=p;const B=b.current,z=i(l,B.order);z.order.join("|")===B.order.join("|")&&z.hidden.join("|")===B.hidden.join("|")||(d(z),c&&o.set(c,z))},[p,g]);const E=h.useRef(!1);h.useEffect(()=>{E.current||(E.current=!0,n==null||n(a))},[]);const w=h.useCallback(B=>{d(B),c&&o.set(c,B),n==null||n(B)},[c,o,n]),W=h.useMemo(()=>{const B=new Map(r.map(z=>[z.key,z]));return a.order.filter(z=>B.has(z)).map(z=>({...B.get(z),visible:!a.hidden.includes(z)}))},[a,r]),L=h.useCallback(B=>{const z=a.hidden.includes(B)?a.hidden.filter(H=>H!==B):[...a.hidden,B];w({...a,hidden:z})},[a,w]),I=h.useCallback((B,z)=>{if(B===z)return;const H=[...a.order],[N]=H.splice(B,1);H.splice(z,0,N),w({...a,order:H})},[a,w]),k=h.useCallback(B=>{w({...a,hidden:B?r.filter(z=>!z.locked).map(z=>z.key):[]})},[a,r,w]),D=h.useCallback(()=>w(s),[w,s]),O=h.useCallback(B=>w(Ur(B,r)),[w,r]),T=a.hidden.length===0;return{state:a,orderedColumns:W,allVisible:T,toggleVisibility:L,reorder:I,setAllHidden:k,reset:D,applyState:O}}function On({scopeId:r,storage:t,snapshotKeys:o,pageKey:n="page",getColumns:l,applyColumns:s}){const{searchParams:c,setSearchParams:i}=je(),a=r?Dr.savedViews(r):void 0,[d,g]=h.useState(()=>a?t.get(a)||[]:[]),b=h.useCallback(w=>{g(w),a&&t.set(a,w)},[a]),p=h.useCallback(w=>{const W=w.trim();if(!W)return;const L={};o.forEach(k=>{const D=c.get(k);D!=null&&(L[k]=D)});const I={id:`${Date.now()}`,name:W,query:L,columns:l==null?void 0:l(),createdAt:Date.now()};b([...d,I])},[o,c,l,b,d]),C=h.useCallback(w=>b(d.filter(W=>W.id!==w)),[b,d]),E=h.useCallback(w=>{const W=Object.fromEntries(c.entries());o.forEach(L=>delete W[L]),Object.assign(W,w.query),delete W[n],i(W),w.columns&&(s==null||s(w.columns))},[c,o,n,i,s]);return{enabled:!!a,views:d,saveView:p,deleteView:C,applyView:E}}function An(r,t){const o=Ir(r);return delete o[t],Object.keys(o).length>0?JSON.stringify(o):void 0}function $o(r,t,o){const n=r[t];if(n==null)return;const l=An(n,o);l===void 0?delete r[t]:r[t]=l}function Wn({scopeId:r,storage:t,snapshotKeys:o,enabled:n=!0,filterKey:l="filter",searchKey:s="q",persistSearch:c=!0}){const{searchParams:i}=je(),a=r&&n?Dr.lastState(r):void 0,d=h.useRef(a),g=h.useRef(!1);h.useEffect(()=>{if(!a){d.current=a;return}if(d.current!==a){d.current=a,g.current=!1;return}const C={};if(o.forEach(E=>{const w=i.get(E);w!=null&&(C[E]=w)}),c||$o(C,l,s),Object.keys(C).length===0){g.current&&t.remove(a);return}g.current=!0,t.set(a,C)},[i,a,o,t,c,l,s]);const b=h.useCallback(()=>{if(!a)return null;const C=t.get(a);if(!C||typeof C!="object"||Array.isArray(C)||Object.keys(C).length===0)return null;const E=C[l];return E!=null&&Object.keys(Ir(E)).length===0&&delete C[l],c||$o(C,l,s),Object.keys(C).length>0?C:null},[a,t,c,l,s]),p=h.useCallback(()=>{a&&t.remove(a)},[a,t]);return{enabled:!!a,read:b,clear:p}}function zn({scopeId:r,storage:t,perPageKey:o,pageSizeOptions:n,enabled:l=!0}){const{searchParams:s}=je(),c=r&&l?Dr.perPage(r):void 0,i=s.toString(),a=h.useRef(c);h.useEffect(()=>{if(!c){a.current=c;return}if(a.current!==c){a.current=c;return}const b=s.get(o);if(!b)return;const p=Number(b);!Number.isFinite(p)||p<=0||t.set(c,p)},[i,c,o,t]);const d=h.useCallback(()=>{if(!c)return null;const b=t.get(c);if(b==null)return null;const p=Number(b);return!Number.isFinite(p)||p<=0||n&&!n.includes(p)?null:String(p)},[c,t,n]),g=h.useCallback(()=>{c&&t.remove(c)},[c,t]);return{enabled:!!c,read:d,clear:g}}let Ot={},At=!1,Wt=null;const Hn=(r,t)=>{Object.assign(Ot,r),Wt=t,!At&&(At=!0,queueMicrotask(()=>{const o=Ot,n=Wt;Ot={},At=!1,Wt=null,!(!n||Object.keys(o).length===0)&&n(l=>{const s=new URLSearchParams(l);return Object.entries(o).forEach(([c,i])=>s.set(c,i)),s},{replace:!0})}))};function Pn({enabled:r,snapshotKeys:t,perPageKey:o,readSnapshot:n,readPerPage:l}){const{searchParams:s,setSearchParams:c,location:i}=je(),a=h.useRef(null);h.useEffect(()=>{if(!r||a.current===i.pathname)return;a.current=i.pathname;const d={};if(!s.has(o)){const g=l();g&&(d[o]=g)}if(!t.some(g=>s.has(g))){const g=n();g&&Object.assign(d,g)}Object.keys(d).length!==0&&Hn(d,c)},[i.pathname,r])}const Vn=({configs:r,activeKeys:t,onToggle:o,hasActiveFilter:n,onReset:l})=>r.length?e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:n?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{minWidth:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),n&&l&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"xs",onClick:l,children:"Reset"})]}),children:r.map(s=>e.jsx(A.MenuItem,{selected:s.locked||t.includes(s.key),disabled:s.locked,closeOnSelect:!1,startIcon:s.icon??void 0,onClick:()=>{s.locked||o(s.key)},children:s.label},s.key))})})]}):null,Lr=({onClear:r,onRemove:t})=>e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(F.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(A.MenuLists,{children:e.jsxs(A.MenuBody,{style:{width:180},children:[e.jsx(A.MenuItem,{startIcon:e.jsx(F.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(A.MenuItem,{intent:"danger",startIcon:e.jsx(F.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),jn=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},Ko=(r,t,o)=>{const n=new Date(r);return o==="day"?n.setDate(n.getDate()+t):o==="week"?n.setDate(n.getDate()+t*7):o==="month"?n.setMonth(n.getMonth()+t):n.setFullYear(n.getFullYear()+t),n},Ro=r=>{const t=jn(new Date);if(r.direction==="this"){const n=new Date(t),l=new Date(t);return r.period==="week"?(n.setDate(t.getDate()-t.getDay()),l.setDate(n.getDate()+6)):r.period==="month"?(n.setDate(1),l.setMonth(l.getMonth()+1,0)):r.period==="year"&&(n.setMonth(0,1),l.setMonth(11,31)),{from:n,to:l}}const o=r.count??1;return r.direction==="past"?{from:Ko(t,-o,r.period),to:t}:{from:t,to:Ko(t,o,r.period)}},el=24,rl=r=>r.length>el?`${r.slice(0,el)}...`:r,tl=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),zt=(r,t="days")=>t==="months"?r.toLocaleDateString(void 0,{month:"short",year:"numeric"}):t==="years"?String(r.getFullYear()):tl(r),Jr={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"},ol=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],Ht={past:"Past",next:"Next",this:"This"},Nn=["day","week","month","year"],_n=["past","next","this"],qn=r=>r.field.type==="date-compact"?e.jsx(Qn,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(Zn,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),Zn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=t?tl(new Date(t)):null,c=!!s,i=c?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:rl(s)})]}):r.label;return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c?e.jsx(F.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:i})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Lr,{onClear:n,onRemove:l})]}),children:e.jsx(ur.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:a=>a==null?n():o(a),withPadding:!1})})})]})},Gn=(r,t="days")=>{switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date?`${Jr[r.op]} ${zt(new Date(r.date),t)}`:null;case"is-between":return r.from&&r.to?`${zt(new Date(r.from),t)} - ${zt(new Date(r.to),t)}`:null;case"is-relative-to-today":{const o=r.relative;if(!o)return null;if(o.direction==="this")return`This ${o.period}`;const n=o.count??1,l=n===1?o.period:`${o.period}s`;return`${Ht[o.direction]} ${n} ${l}`}case"is-empty":case"is-not-empty":return Jr[r.op];default:return null}},Qn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=r.ops&&r.ops.length>0?r.ops:ol,c=r.defaultOp&&s.includes(r.defaultOp)?r.defaultOp:s[0],i=r.mode??"days",a=(t==null?void 0:t.op)??c,d=t?Gn(t,i):null,g=!!d,b=g?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:rl(d)})]}):r.label,p=C=>{if(C!==a){if(C==="is-empty"||C==="is-not-empty"){o({op:C});return}if(C==="is-relative-to-today"){o({op:C,relative:(t==null?void 0:t.relative)??{direction:"past",count:1,period:"week"}});return}if(C==="is-between"){o({op:C,from:t==null?void 0:t.from,to:t==null?void 0:t.to});return}o({op:C,date:t==null?void 0:t.date})}};return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:g?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:g?e.jsx(F.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsxs(A.MenuLists,{children:[e.jsx(A.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(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(ll,{op:a,ops:s,onChange:p})]}),e.jsx(Lr,{onClear:n,onRemove:l})]}),children:e.jsx(nl,{value:t,op:a,mode:i,onChange:o})}),a==="is-relative-to-today"&&e.jsx(A.MenuFooter,{children:e.jsx(S.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},ll=({op:r,ops:t,onChange:o})=>e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:Jr[r]})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:200},children:t.map(n=>e.jsx(A.MenuItem,{selected:r===n,onClick:()=>o(n),endIcon:r===n?e.jsx(F.Icon,{name:"Check"}):void 0,children:Jr[n]},n))})})]}),nl=({value:r,op:t,mode:o="days",onChange:n})=>{if(t==="is-empty"||t==="is-not-empty")return e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(S.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(t==="is-between"){const l=r!=null&&r.from||r!=null&&r.to?{from:r!=null&&r.from?new Date(r.from):null,to:r!=null&&r.to?new Date(r.to):null}:void 0;return e.jsx(ur.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,filter:o,value:l,onChange:s=>{if(s==null){n({op:t});return}if(typeof s=="object"&&s!==null&&"from"in s&&"to"in s){let{from:c,to:i}=s;if(!c&&i&&(c=i,i=null),!c&&!i){n({op:t});return}n({op:t,from:c?c.toISOString():void 0,to:i?i.toISOString():void 0})}},withPadding:!1},`range-${o}`)}return t==="is-relative-to-today"?e.jsx(Un,{value:r==null?void 0:r.relative,onChange:l=>n({op:t,relative:l})}):e.jsx(ur.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:o,value:r!=null&&r.date?new Date(r.date):void 0,onChange:l=>{if(l==null){n({op:t});return}l instanceof Date&&n({op:t,date:l.toISOString()})},withPadding:!1},`single-${o}`)},Un=({value:r,onChange:t})=>{const o=(r==null?void 0:r.direction)??"past",n=(r==null?void 0:r.count)??1,l=(r==null?void 0:r.period)??"week",s=o!=="this",c=Ro({direction:o,count:n,period:l});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(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:Ht[o]})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:140},children:_n.map(i=>e.jsx(A.MenuItem,{selected:o===i,endIcon:o===i?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>t(i==="this"?{direction:i,period:l}:{direction:i,count:n,period:l}),children:Ht[i]},i))})})]}),s&&e.jsx(nr.Input,{type:"number",size:"sm",min:1,clearable:!1,value:n,onChange:i=>{const a=Number(i.target.value);t({direction:o,count:Number.isFinite(a)&&a>0?a:1,period:l})},style:{width:72}}),e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:140},children:Nn.map(i=>e.jsx(A.MenuItem,{selected:l===i,endIcon:l===i?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>t(o==="this"?{direction:o,period:i}:{direction:o,count:n,period:i}),children:i},i))})})]})]}),e.jsx(ur.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:c,onChange:()=>{},withPadding:!1},"relative-preview")]})},sl=18,Jn=r=>r.length>sl?`${r.slice(0,sl)}...`:r,Yn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=r.type==="dropdown-multiple",c=t.length,i=r.searchable!==!1,[a,d]=h.useState(""),g=r.options,b=typeof r.onSearch=="function",p=(()=>{if(b)return g;const L=a.trim().toLowerCase();return L?g.filter(I=>I.label.toLowerCase().includes(L)):g})(),C=L=>t.some(I=>I.value===L.value),E=L=>{if(!s){o([{label:L.label,value:L.value}]),d("");return}o(C(L)?t.filter(I=>I.value!==L.value):[...t,{label:L.label,value:L.value}])},w=L=>{var I;d(L),(I=r.onSearch)==null||I.call(r,L)},W=c===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:c===1?Jn(t[0].label):`${c} Selected`})]});return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(F.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:W})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Lr,{onClear:n,onRemove:l})]}),children:e.jsxs(f.Box,{direction:"column",gap:"sm",children:[i&&e.jsx(vr.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:s,searchAble:!0,searchValue:a,onSearch:w,value:t,onChange:o,placeholder:`Search ${r.label.toLowerCase()}…`}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:r.isLoading?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(S.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):p.length===0?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(S.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):p.map(L=>e.jsx(A.MenuItem,{closeOnSelect:!s,selected:C(L),startIcon:L.avatar,endIcon:C(L)?e.jsx(F.Icon,{name:"Check"}):void 0,description:L.description,onClick:()=>E(L),children:L.label},L.value))})]})})})]})},cl=18,Xn=r=>r.length>cl?`${r.slice(0,cl)}...`:r,il=({checked:r,indeterminate:t})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(sr.Checkbox,{size:"sm",checked:r,readOnly:!0,onChange:()=>{},variant:t?"indeterminate":"select"})}),$n=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=new Set(t.map(p=>p.value)),c=t.length,i=r.options.length>0&&r.options.every(p=>s.has(p.value)),a=c>0&&!i,d=p=>{o(s.has(p.value)?t.filter(C=>C.value!==p.value):[...t,{label:p.label,value:p.value}])},g=()=>{o(i?[]:r.options.map(p=>({label:p.label,value:p.value})))},b=c===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs(S.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(S.Text,{as:"span",children:c===1?Xn(t[0].label):`${c} Selected`})]});return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(F.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsx(A.MenuLists,{children:e.jsxs(A.MenuBody,{style:{width:240},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Lr,{onClear:n,onRemove:l})]}),children:[e.jsx(A.MenuItem,{closeOnSelect:!1,selected:i,onClick:g,startIcon:e.jsx(il,{checked:i||a,indeterminate:a}),children:"Select All"}),r.options.map(p=>e.jsx(A.MenuItem,{closeOnSelect:!1,selected:s.has(p.value),onClick:()=>d(p),startIcon:e.jsx(il,{checked:s.has(p.value)}),children:p.label},p.value))]})})]})},al=18,Kn=r=>r.length>al?`${r.slice(0,al)}...`:r,Rn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const[s,c]=h.useState(t??""),i=Ce.useDebounce(s,r.debounceMs??300);h.useEffect(()=>{i!==(t??"")&&o(i)},[i]),h.useEffect(()=>{c(t??"")},[t]);const a=!!t,d=a?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Kn(t)})]}):r.label;return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:a?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:a?e.jsx(F.Icon,{name:"Search",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:d})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Lr,{onClear:n,onRemove:l})]}),children:e.jsx(nr.Input,{size:"sm",fullWidth:!0,value:s,placeholder:r.placeholder??"Cari…",leftIcon:e.jsx(F.Icon,{name:"Search",width:16,height:16}),onChange:g=>c(g.target.value)})})})]})},dl=({activeKeys:r,configByKey:t,getValue:o,setValue:n,clearValue:l,removeFilter:s})=>e.jsx(e.Fragment,{children:r.map(c=>{const i=t[c];if(!i)return null;const a=o(i),d=i.locked?void 0:()=>s(c);return i.type==="date"||i.type==="date-compact"?e.jsx(qn,{field:i,value:a,onChange:g=>n(i,g),onClear:()=>l(c),onRemove:d},c):i.type==="text"?e.jsx(Rn,{field:i,value:a||"",onChange:g=>n(i,g),onClear:()=>l(c),onRemove:d},c):i.type==="checkbox-multiple"?e.jsx($n,{field:i,value:a||[],onChange:g=>n(i,g),onClear:()=>l(c),onRemove:d},c):e.jsx(Yn,{field:i,value:a||[],onChange:g=>n(i,g),onClear:()=>l(c),onRemove:d},c)})}),hl=r=>`${r} Rows`,es=({pagination:r,pageKey:t="page",perPageKey:o="perPage",pageSizeOptions:n=[10,25,50,100],defaultPerPage:l=10,showResultCount:s=!0,showPageSize:c=!0,showPagination:i=!0})=>{var L;const{searchQueries:a,setSearchParams:d,searchParams:g}=je(),b=g.get(o),p=b?Number(b):l,C=I=>{d({...a,[t]:String(I)})},E=I=>{d({...a,[o]:I,[t]:"1"})},w=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:0),W=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[s&&e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${w}-${W} of ${((L=r==null?void 0:r.totalData)==null?void 0:L.toLocaleString())||0}`}),c&&e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:hl(p)})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{children:n.map(I=>e.jsx(A.MenuItem,{selected:I===p,onClick:()=>E(String(I)),children:hl(I)},I))})})]}),i&&((r==null?void 0:r.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(mr.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:r!=null&&r.currentPage?Number(r.currentPage):1,totalPages:Number(r==null?void 0:r.totalPage),onPageChange:C})})]})};function rs(r,t,o=!0){h.useEffect(()=>{if(!o)return;const n=l=>{var i;if(l.metaKey||l.ctrlKey||l.altKey||l.key!==r||Ve.isOverlayOpen())return;const s=l.target,c=(i=s==null?void 0:s.tagName)==null?void 0:i.toLowerCase();c==="input"||c==="textarea"||s!=null&&s.isContentEditable||(l.preventDefault(),t())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[r,t,o])}const ts=240,fl=({searchKey:r="q",filterKey:t="filter",pageKey:o="page",placeholder:n="Search",shortcut:l="/",collapsible:s=!0})=>{const{searchParams:c,setSearchParams:i,searchQueries:a}=je(),d=Qr(r,c,t)||"",[g,b]=h.useState(!s||!!d),[p,C]=h.useState(s&&!d),[E,w]=h.useState(d),W=Ce.useDebounce(E,350),L=h.useRef(null);h.useEffect(()=>{w(d),d&&b(!0)},[d]),h.useEffect(()=>{g&&C(!1)},[g]),h.useEffect(()=>{W!==d&&Tr({value:W,name:r,type:"search",searchQueries:a,setSearchParams:i,filterKey:t,pageKey:o})},[W]);const I=h.useCallback(()=>{b(!0),requestAnimationFrame(()=>{var T;return(T=L.current)==null?void 0:T.focus()})},[]);rs(l,I);const k=()=>{s&&!E&&b(!1)},D=T=>{var B;s&&T.key==="Escape"&&!E&&(b(!1),(B=L.current)==null||B.blur())},O=()=>{g||C(!0)};return e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[p&&e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:I}),e.jsxs(f.Box,{onTransitionEnd:O,style:{position:"relative",width:g?ts:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(nr.Input,{ref:L,size:"sm",fullWidth:!0,value:E,placeholder:n,leftIcon:e.jsx(F.Icon,{name:"Search",width:16,height:16}),onChange:T=>w(T.target.value),onKeyDown:D,onBlur:k,tabIndex:g?0:-1}),g&&!E&&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(S.Text,{fontSize:"xs",color:"subtle",children:l})})]})]})},ul=({columns:r,allVisible:t,onToggle:o,onReorder:n,onSetAllHidden:l})=>{const[s,c]=h.useState(null),[i,a]=h.useState(null),d=()=>{s!==null&&i!==null&&s!==i&&n(s,i),c(null),a(null)},g=(b,p)=>{const C=b+p;C<0||C>=r.length||n(b,C)};return e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{children:e.jsxs(f.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(S.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(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(j.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>l(t),children:t?"Hide All":"Show All"})]}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:r.map((b,p)=>{const C=!b.locked,E=i===p&&s!==null&&s!==p;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:C,onDragStart:()=>C&&c(p),onDragOver:w=>{w.preventDefault(),a(p)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:E?"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:C?0:-1,"aria-label":`Reorder ${b.title}`,"aria-disabled":!C||void 0,color:"icon-subtlest",onKeyDown:w=>{C&&(w.key==="ArrowUp"?(w.preventDefault(),g(p,-1)):w.key==="ArrowDown"&&(w.preventDefault(),g(p,1)))},style:{display:"inline-flex",cursor:C?"grab":"default",opacity:C?1:.4},children:e.jsx(F.Icon,{name:"DragVertical",width:16,height:16})}),b.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:b.icon}),e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:b.title}),e.jsx(f.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(wr.Toggle,{size:"sm",checked:b.visible,disabled:b.locked,onChange:()=>o(b.key),"aria-label":`Toggle ${b.title} column`})})]},b.key)})})]})})})]})},gl=({views:r,onApply:t,onDelete:o,onSave:n})=>{const[l,s]=h.useState(""),c=()=>{const i=l.trim();i&&(n(i),s(""))};return e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:r.length>0?"secondary":"outline",tone:(r.length>0,"neutral"),size:"sm",iconLeft:e.jsx(F.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(A.MenuLists,{style:{width:"260px"},children:[e.jsx(A.MenuBody,{children:e.jsxs(f.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(S.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:r.length===0?e.jsx(f.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(S.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(i=>e.jsx(A.MenuItem,{startIcon:e.jsx(F.Icon,{name:"Bookmark"}),onClick:()=>t(i),endIcon:e.jsx(j.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Trash2"}),"aria-label":`Delete ${i.name}`,onClick:a=>{a.stopPropagation(),o(i.id)}}),children:i.name},i.id))})]})}),e.jsx(A.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(nr.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:l,onChange:i=>s(i.target.value),onKeyDown:i=>{i.key==="Enter"&&c()}})}),e.jsx(j.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!l.trim(),onClick:c,children:"Save"})]})})]})]})},os=({isOpen:r,onClose:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,onToggle:c,onReset:i,getValue:a,setValue:d,clearValue:g,removeFilter:b})=>{const p=n.length;return e.jsx(jr.Drawer,{position:"bottom",isShow:r,onHide:t,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(S.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),p>0&&e.jsxs(S.Text,{fontSize:"sm",color:"subtle",children:["(",p,")"]})]}),e.jsx(j.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:t})]}),e.jsxs(f.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[p>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(S.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(dl,{activeKeys:n,configByKey:l,getValue:a,setValue:d,clearValue:g,removeFilter:b})})]}),o.length>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(S.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(f.Box,{direction:"column",children:o.map(C=>{const E=n.includes(C.key),w=!!C.locked;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:w?.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:[C.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:C.icon}),e.jsx(S.Text,{fontSize:"sm",color:"primary",truncate:!0,children:C.label})]}),e.jsx(wr.Toggle,{size:"sm",checked:E||w,disabled:w,onChange:()=>c(C.key),"aria-label":`Toggle ${C.label}`})]},C.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(j.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!s,onClick:i,children:"Reset"})}),e.jsx(f.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(j.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:t,children:"Selesai"})})]})]})})},ls=r=>`${r} Rows`,ns=({perPageKey:r,pageKey:t,pageSizeOptions:o,defaultPerPage:n=10,showPageSize:l})=>{const{searchQueries:s,setSearchParams:c,searchParams:i}=je(),a=i.get(r),d=a?Number(a):n,g=b=>{c({...s,[r]:b,[t]:"1"})};return l?e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(A.MenuLists,{children:e.jsxs(A.MenuBody,{style:{minWidth:200},children:[e.jsx(f.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(S.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),o.map(b=>e.jsx(A.MenuItem,{selected:b===d,endIcon:b===d?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>g(String(b)),children:ls(b)},b))]})})]}):null},ss=r=>{var We;const{withPadding:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,toggleFilter:c,removeFilter:i,getValue:a,setValue:d,clearValue:g,onReset:b,searchable:p,searchKey:C,filterKey:E,pageKey:w,searchPlaceholder:W,searchShortcut:L,searchCollapsible:I,pagination:k,perPageKey:D,pageSizeOptions:O,defaultPerPage:T,showPagination:B,showResultCount:z,showPageSize:H,hasColumns:N,orderedColumns:K,allVisible:Z,onToggleVisibility:G,onReorder:X,onSetAllHidden:oe,showSavedViews:J,savedViews:_,onApplyView:V,onDeleteView:ce,onSaveView:xe,leadingActions:Be}=r,[ue,we]=h.useState(!1),{searchQueries:Ge,setSearchParams:fe}=je(),Ae=(k==null?void 0:k.rangeStart)??(((k==null?void 0:k.currentPage)||0)>1?(((k==null?void 0:k.currentPage)||0)-1)*((k==null?void 0:k.perPage)||0)+1:1),Ee=(k==null?void 0:k.rangeEnd)??((k==null?void 0:k.totalCurrentPage)!==(k==null?void 0:k.perPage)?k==null?void 0:k.totalData:((k==null?void 0:k.currentPage)||1)*((k==null?void 0:k.totalCurrentPage)||0)),Ne=Qe=>{fe({...Ge,[w]:String(Qe)})},ne=z||B&&!!(k!=null&&k.totalPage),ie=()=>{b(),we(!1)};return e.jsxs(f.Box,{direction:"column",gap:"sm",fullWidth:!0,paddingTop:t?"sm":void 0,paddingBottom:t?"sm":void 0,paddingLeft:t?"md":void 0,paddingRight:t?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[p&&e.jsx(fl,{searchKey:C,filterKey:E,pageKey:w,placeholder:W,shortcut:L,collapsible:I}),e.jsx(j.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"FilterHorizontal"}),onClick:()=>we(!0),"aria-label":"Open filters",children:s?`Filter: ${n.length}`:null}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[Be,J&&e.jsx(gl,{views:_,onApply:V,onDelete:ce,onSave:xe}),N&&e.jsx(ul,{columns:K,allVisible:Z,onToggle:G,onReorder:X,onSetAllHidden:oe}),e.jsx(ns,{perPageKey:D,pageKey:w,pageSizeOptions:O,defaultPerPage:T,showPageSize:H})]})]}),ne&&e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[z?e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Ae}-${Ee} of ${((We=k==null?void 0:k.totalData)==null?void 0:We.toLocaleString())||0}`}):e.jsx(f.Box,{direction:"column"}),B&&!!(k!=null&&k.totalPage)&&e.jsx(mr.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:k!=null&&k.currentPage?Number(k.currentPage):1,totalPages:Number(k.totalPage),onPageChange:Ne})]}),e.jsx(os,{isOpen:ue,onClose:()=>we(!1),configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,onToggle:c,onReset:ie,getValue:a,setValue:d,clearValue:g,removeFilter:i})]})},cs=({withPadding:r=!1,filterConfigs:t=[],filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:s="perPage",pageSizeOptions:c=[25,50,100],defaultPerPage:i,showPagination:a=!0,showResultCount:d=!0,showPageSize:g=!0,searchable:b=!1,searchKey:p="q",searchPlaceholder:C="Search",searchShortcut:E="/",searchPosition:w="right",searchCollapsible:W=!0,pagination:L,columns:I=[],onColumnsChange:k,columnsState:D,scopeId:O,savedViews:T,persistLastState:B=!0,persistSearch:z=!0,storage:H=Lt,onReset:N,leadingActions:K})=>{const Z=O??(T==null?void 0:T.scopeId),{activeKeys:G,configByKey:X,hasActiveFilter:oe,toggleFilter:J,removeFilter:_,getValue:V,setValue:ce,clearValue:xe,clearAll:Be}=Tt({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:p}),ue=Ln({columns:I,scopeId:Z,storage:H,onColumnsChange:k,value:D}),we=On({scopeId:Z,storage:H,snapshotKeys:[n,o,s],pageKey:l,getColumns:()=>ue.state,applyColumns:ue.applyState}),Ge=Wn({scopeId:Z,storage:H,snapshotKeys:[n,o,l],enabled:B,filterKey:o,searchKey:p,persistSearch:z}),fe=zn({scopeId:Z,storage:H,perPageKey:s,pageSizeOptions:c,enabled:B});Pn({enabled:B&&!!Z,snapshotKeys:[n,o,l],perPageKey:s,readSnapshot:Ge.read,readPerPage:fe.read});const Ae=i??c[0]??25,Ee=!!(T!=null&&T.enabled)&&we.enabled,Ne=()=>{Be(),Ge.clear(),N==null||N()},ne=Ce.useMediaQuery("md"),ie=b?e.jsx(fl,{searchKey:p,filterKey:o,pageKey:l,placeholder:C,shortcut:E,collapsible:W}):null;return ne?e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",fullWidth:!0,paddingTop:r?"sm":void 0,paddingBottom:r?"sm":void 0,paddingLeft:r?"md":void 0,paddingRight:r?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Vn,{configs:t,activeKeys:G,onToggle:J,hasActiveFilter:oe,onReset:Ne}),w==="left"&&ie,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(dl,{activeKeys:G,configByKey:X,getValue:V,setValue:ce,clearValue:xe,removeFilter:_}),oe&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"sm",onClick:Ne,children:"Reset"})]})]}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[K,e.jsx(es,{pagination:L,pageKey:l,perPageKey:s,pageSizeOptions:c,defaultPerPage:Ae,showPagination:a,showResultCount:d,showPageSize:g}),w==="right"&&ie,Ee&&e.jsx(gl,{views:we.views,onApply:we.applyView,onDelete:we.deleteView,onSave:we.saveView}),I.length>0&&e.jsx(ul,{columns:ue.orderedColumns,allVisible:ue.allVisible,onToggle:ue.toggleVisibility,onReorder:ue.reorder,onSetAllHidden:ue.setAllHidden})]})]}):e.jsx(ss,{withPadding:r,configs:t,activeKeys:G,configByKey:X,hasActiveFilter:oe,toggleFilter:J,removeFilter:_,getValue:V,setValue:ce,clearValue:xe,onReset:Ne,searchable:b,searchKey:p,filterKey:o,pageKey:l,searchPlaceholder:C,searchShortcut:E,searchCollapsible:W,pagination:L,perPageKey:s,pageSizeOptions:c,defaultPerPage:Ae,showPagination:a,showResultCount:d,showPageSize:g,hasColumns:I.length>0,orderedColumns:ue.orderedColumns,allVisible:ue.allVisible,onToggleVisibility:ue.toggleVisibility,onReorder:ue.reorder,onSetAllHidden:ue.setAllHidden,showSavedViews:Ee,savedViews:we.views,onApplyView:we.applyView,onDeleteView:we.deleteView,onSaveView:we.saveView,leadingActions:K})},is=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r[0];return(t==null?void 0:t.value)!=null?String(t.value):void 0},as=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r.map(o=>(o==null?void 0:o.value)!=null?String(o.value):null).filter(o=>o!=null);return t.length?t:void 0},ds=(r,t)=>{switch(r.type){case"dropdown":case"radio":return is(t);case"dropdown-multiple":case"checkbox-multiple":return as(t);case"date":return t instanceof Date?t.toISOString():void 0;case"date-compact":return t;case"text":return typeof t=="string"&&t?t:void 0;default:return}},yl=(r,t)=>{if(r==null||r==="")return t;const o=Number(r);return Number.isFinite(o)&&o>0?o:t},hs=r=>{const{filterConfigs:t,filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:s="perPage",searchKey:c="q",defaultPage:i=1,defaultPerPage:a=10,paramKeys:d,serialize:g}=r,{activeKeys:b,configByKey:p,hasActiveFilter:C,getValue:E}=Tt({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:c}),{searchParams:w}=je(),W=w.toString();return h.useMemo(()=>{const I={},k={},D=yl(w.get(l),i),O=yl(w.get(s),a);I[(d==null?void 0:d.page)??"page"]=D,I[(d==null?void 0:d.perPage)??"perPage"]=O;const T=Qr(c,w,o)||"";T&&(I[(d==null?void 0:d.search)??"search"]=T);let B=!1;for(const z of b){const H=p[z];if(!H)continue;const N=E(H);k[z]=N;const K=g==null?void 0:g[z],Z=K?K(N):ds(H,N);if(Z==null||Array.isArray(Z)&&Z.length===0)continue;const G=(d==null?void 0:d[z])??z;I[G]=Z,B=!0}return{params:I,raw:k,hasActiveFilter:C||!!T||B}},[W,b.join("|"),o,n,l,s,c,i,a,d,g,p])},fs=["dropdown","dropdown-multiple","checkbox-multiple","radio"],us=({filterConfigs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l})=>{const{configByKey:s,getValue:c,setValue:i,removeFilter:a,clearAll:d,hasActiveFilter:g}=Tt({configs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l}),b=(k,D)=>{var T;const O=k.options;return((T=O==null?void 0:O.find(B=>B.value===D))==null?void 0:T.label)??D},p=h.useCallback(k=>{const D=s[k];if(!D)return[];const O=c(D);return Array.isArray(O)?O.map(T=>String(T.value)):[]},[s,c]),C=h.useCallback((k,D)=>{const O=s[k];if(!O||!fs.includes(O.type))return;const T=Array.isArray(D)?D:[D];if(T.length===0){a(k);return}i(O,T.map(B=>({label:b(O,B),value:B})))},[s,i,a]),E=h.useCallback((k,D)=>{const O=p(k);C(k,O.includes(D)?O.filter(T=>T!==D):[...O,D])},[p,C]),w=h.useCallback((k,D)=>p(k).includes(D),[p]),W=h.useCallback(k=>a(k),[a]),L=h.useCallback(k=>{const D=s[k];return D?c(D):void 0},[s,c]),I=h.useCallback((k,D)=>{const O=s[k];if(O){if(D==null){a(k);return}i(O,D)}},[s,i,a]);return{set:C,toggle:E,clear:W,clearAll:d,isActive:w,values:p,getRaw:L,setRaw:I,hasActiveFilter:g}},Pt="var(--sa-background-brand, #04254f)",gs="var(--sa-text-brand, #031f43)",ys={padding:"6px 8px",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:4,font:"inherit",fontSize:13,outline:"none",width:"100%",boxSizing:"border-box"},Vt={padding:"4px 8px",border:"none",background:"none",cursor:"pointer",font:"inherit",textAlign:"left",fontSize:13,color:gs},pl=(r,t)=>{if(r.type==="text"||r.type==="date")return!!t.getRaw(r.key);if(r.type==="date-compact"){const o=t.getRaw(r.key);return!!(o&&(o.date||o.from||o.to||o.relative||o.op==="is-empty"||o.op==="is-not-empty"))}return t.values(r.key).length>0},ps=({field:r,controls:t})=>{const[o,n]=h.useState(""),l=r.type==="dropdown"||r.type==="radio",s=r.type==="checkbox-multiple"?!1:r.searchable!==!1,c=t.values(r.key),i=s&&o.trim()?r.options.filter(d=>d.label.toLowerCase().includes(o.toLowerCase())):r.options,a=d=>{l?t.set(r.key,c.includes(d)?[]:d):t.toggle(r.key,d)};return e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:4,minWidth:200},children:[s&&e.jsx("input",{value:o,onChange:d=>{var g;n(d.target.value),(g=r.onSearch)==null||g.call(r,d.target.value)},placeholder:"Cari…",style:ys}),e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:2,maxHeight:220,overflowY:"auto"},children:[i.map(d=>{const g=c.includes(d.value);return e.jsxs("button",{type:"button",onClick:()=>a(d.value),style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 8px",border:"none",background:"none",cursor:"pointer",font:"inherit",textAlign:"left",borderRadius:4},children:[e.jsx("span",{style:{width:16,height:16,flexShrink:0,borderRadius:l?"50%":4,display:"inline-flex",alignItems:"center",justifyContent:"center",border:`1px solid ${g?Pt:"var(--sa-border-subtle, #0b120e24)"}`,background:g&&!l?Pt:"transparent"},children:g&&(l?e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:Pt}}):e.jsx(F.Icon,{name:"Check",size:"xs",style:{color:"#fff"}}))}),e.jsx(S.Text,{as:"span",style:{fontSize:14},children:d.label})]},d.value)}),i.length===0&&e.jsx(S.Text,{as:"span",style:{fontSize:13,color:"var(--sa-text-subtlest, #8c8f97)",padding:"6px 8px"},children:"Tak ada hasil"})]}),c.length>0&&e.jsx("button",{type:"button",onClick:()=>t.clear(r.key),style:Vt,children:"Clear"})]})},bs=({field:r,controls:t})=>{const o=t.getRaw(r.key);return e.jsx(f.Box,{style:{minWidth:240},children:e.jsx(ur.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:o,onChange:n=>t.setRaw(r.key,n??null),withPadding:!1})})},vs=({field:r,controls:t})=>{const o=t.getRaw(r.key),n=r.ops&&r.ops.length>0?r.ops:ol,l=r.defaultOp&&n.includes(r.defaultOp)?r.defaultOp:n[0],s=r.mode??"days",c=(o==null?void 0:o.op)??l,i=d=>t.setRaw(r.key,d),a=d=>{if(d!==c)return i(d==="is-empty"||d==="is-not-empty"?{op:d}:d==="is-relative-to-today"?{op:d,relative:(o==null?void 0:o.relative)??{direction:"past",count:1,period:"week"}}:d==="is-between"?{op:d,from:o==null?void 0:o.from,to:o==null?void 0:o.to}:{op:d,date:o==null?void 0:o.date})};return e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:6,minWidth:280},children:[e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(ll,{op:c,ops:n,onChange:a})]}),e.jsx(nl,{value:o,op:c,mode:s,onChange:i}),pl(r,t)&&e.jsx("button",{type:"button",onClick:()=>t.setRaw(r.key,null),style:Vt,children:"Clear"})]})},Cs=({field:r,controls:t})=>{const o=t.getRaw(r.key)??"",[n,l]=h.useState(o),s=Ce.useDebounce(n,r.debounceMs??300);return h.useEffect(()=>{const c=t.getRaw(r.key)??"";s!==c&&t.setRaw(r.key,s||null)},[s]),e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:6,minWidth:220},children:[e.jsx(nr.Input,{size:"sm",fullWidth:!0,value:n,placeholder:r.placeholder??"Cari…",leftIcon:e.jsx(F.Icon,{name:"Search",width:16,height:16}),onChange:c=>l(c.target.value)}),n&&e.jsx("button",{type:"button",onClick:()=>{l(""),t.setRaw(r.key,null)},style:Vt,children:"Clear"})]})},xs=({field:r,controls:t})=>r.type==="text"?e.jsx(Cs,{field:r,controls:t}):r.type==="date"?e.jsx(bs,{field:r,controls:t}):r.type==="date-compact"?e.jsx(vs,{field:r,controls:t}):e.jsx(ps,{field:r,controls:t}),ws=(r,t)=>{if(!r)return{};const{fromKey:o,toKey:n,opKey:l}=t,s={};switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date&&(s[o]=new Date(r.date).toISOString()),l&&(s[l]=r.op),s;case"is-between":return r.from&&(s[o]=new Date(r.from).toISOString()),r.to&&(s[n]=new Date(r.to).toISOString()),s;case"is-relative-to-today":{if(!r.relative)return s;const{from:c,to:i}=Ro(r.relative);return s[o]=c.toISOString(),s[n]=i.toISOString(),s}case"is-empty":case"is-not-empty":return l&&(s[l]=r.op==="is-empty"?"empty":"not-empty"),s;default:return s}},bl=({children:r,borderRadius:t,height:o})=>{const n=h.useRef(null),[l,s]=h.useState("100vh");return h.useEffect(()=>{if(o)return;const c=()=>{if(n.current){const i=n.current.getBoundingClientRect().top;s(`calc(100vh - ${i}px)`)}};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[o]),e.jsx(f.Box,{ref:n,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:t||"rounded-xs",style:{height:o??l,display:"flex",flexDirection:"column"},children:r})},vl=({action:r,rightContent:t,leftContent:o,headerSlot:n,advanceFilter:l,showFilter:s=!0})=>{const c=Ce.useMediaQuery("md"),i=s?e.jsx(Xo,{...l}):null,a=()=>r?h.isValidElement(r)?r:e.jsx(f.Box,{style:{display:"flex",flexDirection:c?"row":"column",gap:"8px",width:c?"auto":"100%",textWrap:"nowrap"},children:r.map(({title:d,icon:g,buttonProps:b,onClick:p},C)=>!d&&!g?null:e.jsx(j.Button,{fullWidth:!c,iconLeft:g?e.jsx(F.Icon,{name:g}):void 0,onClick:p,...b,children:d},`action-${C}`))}):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:c?"row":"column-reverse",gap:"16px"},children:n?n({filter:i}):e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[i,o]}),e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[t,a()]})]})})},Ds=({totalData:r,withMarginBottom:t=!0,withMarginTop:o=!0})=>e.jsxs(f.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:t?"16px":void 0,marginTop:o?"16px":void 0},children:[e.jsxs(Ke.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Ke.Body1,{children:r||0})]}),Cl=({pagination:r,pageKey:t="page",perPageKey:o="perPage",defaultPerPage:n=10,showPagination:l=!0,totalData:s})=>{const{searchQueries:c,setSearchParams:i,searchParams:a}=je(),d=a.get(o),g=E=>{i({...c,[t]:String(E)})},b=E=>{i({...c,[o]:E,[t]:"1"})},p=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),C=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsx(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:l?e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(S.Text,{children:"Rows Per Page: "}),e.jsx(vr.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:E=>{b(E[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}]}),e.jsx(S.Text,{children:`${p}-${C} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(mr.Pagination,{currentPage:r!=null&&r.currentPage?Number(r==null?void 0:r.currentPage):1,totalPages:r!=null&&r.totalPage?Number(r==null?void 0:r.totalPage):1,onPageChange:g})]}):e.jsx(Ds,{totalData:s,withMarginBottom:!1,withMarginTop:!1})})},xl=({filter:r,columnTitle:t})=>{const[o,n]=h.useState(!1),l=h.useRef(null),s=h.useRef(null),c=h.useRef(null),[i,a]=h.useState(""),[d,g]=h.useState({top:0,left:0}),b=r.selectedValues,p=h.useMemo(()=>i?r.options.filter(w=>w.label.toLowerCase().includes(i.toLowerCase())):r.options,[r.options,i]);h.useEffect(()=>{if(o&&s.current){const w=s.current.getBoundingClientRect(),W=280,L={top:w.bottom+8};r.position==="left"||w.left+W>window.innerWidth?L.right=window.innerWidth-w.right:L.left=w.left,g(L)}},[o,r.position]),h.useEffect(()=>{o&&c.current?setTimeout(()=>{var w;return(w=c.current)==null?void 0:w.focus()},50):a("")},[o]),h.useEffect(()=>{const w=W=>{l.current&&!l.current.contains(W.target)&&s.current&&!s.current.contains(W.target)&&n(!1)};return o&&document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[o]);const C=w=>{const W=b.includes(w)?b.filter(L=>L!==w):[...b,w];r.onFilterChange(W)},E=()=>r.onFilterChange([]);return e.jsxs(f.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(f.Box,{ref:s,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:w=>{var W;w.stopPropagation(),o||(W=r.onOpen)==null||W.call(r),n(L=>!L)},children:e.jsx(F.Icon,{name:o?"ChevronUp":"ChevronDown",size:"sm",style:{color:b.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),o&&e.jsxs(f.Box,{ref:l,style:{position:"fixed",top:`${d.top}px`,...d.left!==void 0?{left:`${d.left}px`}:{right:`${d.right}px`},backgroundColor:"white",borderRadius:"4px",minWidth:"280px",maxHeight:"400px",display:"flex",flexDirection:"column",zIndex:9999,animation:"fadeInDropdown 0.15s ease-out",border:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(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(S.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",t]}),b.length>0&&e.jsx(f.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(S.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:w=>{w.stopPropagation(),E()},children:"CLEAR"})})]}),!r.hideSearch&&e.jsx(f.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(nr.Input,{ref:c,placeholder:`Search ${t.toLowerCase()}...`,leftIcon:e.jsx(F.Icon,{name:"Search",size:"sm"}),value:i,onChange:w=>a(w.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:r.isLoadingOptions?e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(F.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(S.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):p.length>0?e.jsx(f.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:p.map(w=>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:b.includes(w.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:W=>{W.stopPropagation(),C(w.value)},onMouseEnter:W=>{b.includes(w.value)||(W.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),W.currentTarget.style.transform="translateX(2px)"},onMouseLeave:W=>{W.currentTarget.style.backgroundColor=b.includes(w.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",W.currentTarget.style.transform="translateX(0)"},children:[e.jsx(sr.Checkbox,{checked:b.includes(w.value),onChange:()=>{}}),e.jsx(S.Text,{fontSize:"sm",fontWeight:b.includes(w.value)?"medium":"normal",color:b.includes(w.value)?"primary":"gray-700",children:w.label})]},w.value))}):e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(F.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(S.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),b.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:b.length}),e.jsxs(S.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",b.length>1?"s":""," selected"]})]})})]})]})},Ss=({direction:r})=>{const t="var(--sa-text-primary, #292a2e)",o="var(--sa-text-subtle, #8c8f97)",n=r==="asc"?t:o,l=r==="desc"?t:o,s=r==="asc"?1:.45,c=r==="desc"?1:.45;return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:0},"aria-hidden":!0,children:[e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:n,opacity:s,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:l,opacity:c},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},ks=({frozen:r})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:r?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),jt="var(--sa-background-primary, #ffffff)",wl="var(--sa-background-primary-inverse, #f8f8f8)",Dl=({columns:r,records:t,handleDetail:o,handleUpdate:n,handleDelete:l,isLoading:s,visibleHandleDelete:c,visibleHandleUpdate:i,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:g,frozenCount:b=0,onFrozenCountChange:p,customActions:C,actionsOrder:E=["detail","update","delete","custom"],customEmptyState:w,enableColumnResize:W=!1,defaultColumnWidths:L,onColumnWidthsChange:I,defaultMinColumnWidth:k=60,sort:D,defaultSort:O,onSortChange:T,showActionDivider:B=!1})=>{const z=D!==void 0,[H,N]=h.useState(O??null),K=z?D??null:H,Z=P=>{if(P.sortKey)return P.sortKey;if(typeof P.accessor=="string")return P.accessor},G=P=>{const R=Z(P);if(!R)return;let U;!K||K.key!==R?U={key:R,direction:"asc"}:K.direction==="asc"?U={key:R,direction:"desc"}:U=null,z||N(U),T==null||T(U)},oe=[o,n,l].filter(P=>P!==void 0).length,J=!!C,_=!!o||!!n||!!l||J,V="var(--sa-border-subtle, #0b120e24)",ce=`1px solid ${V}`,xe=`inset 1px 0 0 ${V}`,Be=`inset -1px 0 0 ${V}`,ue=oe===3?J?"178px":"140px":oe===2?J?"140px":"102px":oe===1?J?"112px":"74px":J?"74px":"",we=(P,R)=>{if(!R)return P;if(typeof R=="function")return R(P);if(typeof R=="string")return P[R]},[Ge,fe]=h.useState(!1);h.useEffect(()=>{if(!(g!=null&&g.current))return;const P=g.current;fe(P.scrollHeight>P.clientHeight)},[t,g]);const Ae=h.useRef(null),[Ee,Ne]=h.useState([]),[ne,ie]=h.useState(()=>L??{}),We=h.useRef(null);h.useLayoutEffect(()=>{if(!b||!Ae.current){Ne([]);return}const P=Array.from(Ae.current.querySelectorAll("thead tr th")),R=[];let U=0;P.forEach((de,me)=>{R[me]=U,me<b&&(U+=de.offsetWidth)}),Ne(R)},[b,r,t,ne]);const Qe=P=>{p&&p(P<b?P:P+1)},Ie=(P,R)=>{const U=ne[P];if(U!==void 0){const de=`${U}px`;return{width:de,minWidth:de,maxWidth:de}}return R?{width:R}:{}},De=P=>W&&(P.resizable??!0),_e=(P,R)=>{P.preventDefault(),P.stopPropagation();const U=P.currentTarget.closest("th");if(!U)return;const de=Math.round(U.getBoundingClientRect().width);We.current={colIndex:R,startX:P.clientX,startWidth:de};const me=document.body.style.userSelect,ye=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Se=Ue=>{var pe;const Je=We.current;if(!Je)return;const er=((pe=r[Je.colIndex])==null?void 0:pe.minWidth)??k,Ye=Math.max(er,Je.startWidth+(Ue.clientX-Je.startX));ie(or=>or[Je.colIndex]===Ye?or:{...or,[Je.colIndex]:Ye})},Re=()=>{document.removeEventListener("mousemove",Se),document.removeEventListener("mouseup",Re),document.body.style.userSelect=me,document.body.style.cursor=ye,We.current=null,I&&ie(Ue=>(I(Ue),Ue))};document.addEventListener("mousemove",Se),document.addEventListener("mouseup",Re)};return e.jsx("div",{ref:Ae,children:e.jsxs(Q.Table,{fullWidth:!0,children:[e.jsx(Q.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(Q.Tr,{children:[r.map((P,R)=>{var kr,hr;const U=b>0&&R<b,de=Ee[R]??0,me=De(P),Se=R===r.length-1&&_&&B,Re=Z(P),Ue=!!P.sortable&&!!Re,Je=Ue&&(K==null?void 0:K.key)===Re?K.direction:null,er=P.title||((kr=P.accessor)==null?void 0:kr.toString())||"",Ye=(hr=P.headerTooltip)!=null&&hr.showIcon?e.jsx(F.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,pe=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:er}),or=Ue?e.jsxs("button",{type:"button",onClick:()=>G(P),title:Je==="asc"?"Sorted ascending — click to sort descending":Je==="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:P.textAlign==="text-right"?"right":P.textAlign==="text-center"?"center":"left"},children:[pe,Ye,e.jsx(Ss,{direction:Je})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[pe,Ye]});return e.jsxs(Q.Th,{style:{position:"sticky",top:0,left:U?de:void 0,zIndex:U?4:2,paddingLeft:R===0?"12px":"",borderRight:d&&!Se&&!U?ce:void 0,borderBottom:d?ce:void 0,boxShadow:d&&U?Be:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:P.textAlign==="text-right"?"right":P.textAlign==="text-center"?"center":"left",...Ie(R,P.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[P.headerTooltip?e.jsx(Me.Tooltip,{label:P.headerTooltip.content,position:"bottom",children:or}):or,P.filter&&e.jsx(xl,{filter:P.filter,columnTitle:P.title}),p&&e.jsx("button",{onClick:()=>Qe(R),title:U?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:U?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:U?1:.45,transition:"opacity 0.15s"},children:e.jsx(ks,{frozen:U})})]}),me&&e.jsx("div",{onMouseDown:gr=>_e(gr,R),onClick:gr=>gr.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-${R}`)}),_?e.jsx(Q.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?ce:void 0,boxShadow:d&&B?xe:void 0}}):null]})}),e.jsx(Q.Tbody,{children:s?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:r.length+1,children:e.jsxs(f.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx($e.Skeleton,{variant:"list"}),e.jsx($e.Skeleton,{variant:"list"}),e.jsx($e.Skeleton,{variant:"list"}),e.jsx($e.Skeleton,{variant:"list"}),e.jsx($e.Skeleton,{variant:"list"})]})})}):!(t!=null&&t.length)&&w?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:r.length+1,children:w})}):t==null?void 0:t.map((P,R)=>e.jsxs(Q.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:R===t.length-1&&Ge?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:U=>{const de=U.currentTarget;de.style.backgroundColor=wl,Array.from(de.querySelectorAll("td")).forEach(me=>{me.style.position==="sticky"&&(me.style.backgroundColor=wl)})},onMouseLeave:U=>{const de=U.currentTarget;de.style.backgroundColor="",Array.from(de.querySelectorAll("td")).forEach(me=>{me.style.position==="sticky"&&(me.style.backgroundColor=jt)})},children:[r.map((U,de)=>{const me=U.render?U.render(P,R,t):we(P,U.accessor),ye=b>0&&de<b,Se=Ee[de]??0,Re=ne[de]!==void 0,Ue=ye&&de===b-1;return e.jsx(Q.Td,{style:{position:ye?"sticky":void 0,left:ye?Se:void 0,zIndex:ye?1:void 0,backgroundColor:ye?jt:void 0,transition:ye?"background-color 0.3s ease":void 0,paddingLeft:de===0?"12px":"",whiteSpace:"nowrap",overflow:Re?"hidden":void 0,borderLeft:U.showBorderLeft?ce:void 0,borderRight:U.showBorderRight?ce:void 0,boxShadow:Ue?Be:void 0,textAlign:U.textAlign==="text-right"?"right":U.textAlign==="text-center"?"center":"left",...Ie(de,U.width)},children:typeof me=="string"?e.jsx(S.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:U.textAlign==="text-right"?"right":U.textAlign==="text-center"?"center":"left"},children:me}):me},`row-${R}-col-${de}`)}),_?e.jsx(Q.Td,{style:{width:ue,position:"sticky",right:0,zIndex:1,backgroundColor:jt,boxShadow:B?xe:void 0,transition:"background-color 0.3s ease"},children:e.jsx(ae.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:E.map(U=>{const de=R===t.length-1?"top":"bottom";return U==="detail"&&o&&(a==null?void 0:a(P))!==!1?e.jsx(Me.Tooltip,{label:"Detail",position:de,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(P.id,P),iconLeft:e.jsx(F.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):U==="update"&&n&&(i==null?void 0:i(P))!==!1?e.jsx(Me.Tooltip,{label:"Update",position:de,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(P),iconLeft:e.jsx(F.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):U==="delete"&&l&&(c==null?void 0:c(P))!==!1?e.jsx(Me.Tooltip,{label:"Delete",position:de,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>l(P.id,P),iconLeft:e.jsx(F.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):U==="custom"?e.jsx(h.Fragment,{children:C==null?void 0:C(P)},"custom"):null})})}):null]},`${P}${R}`))})]})})};let Sl=!1;const Bs=({wrapperProps:r,dataTableProps:t,headerProps:o,footerProps:n})=>{var b;process.env.NODE_ENV!=="production"&&!Sl&&(Sl=!0,console.warn("[@starasia/admin] `TableSection` deprecated — pakai `<FilterBar>` + `<TableLayout>`. Lihat skill `starasia-list-page-pattern`. Akan dihapus di salah satu major berikutnya."));const l=h.useRef(null),[s,c]=h.useState((t==null?void 0:t.defaultFrozenCount)??0),i=(o==null?void 0:o.show)??!0,a=h.useRef(null),d=(b=t==null?void 0:t.pagination)==null?void 0:b.totalData;typeof d=="number"&&(a.current=d);const g=(n==null?void 0:n.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(bl,{...r,children:[i&&e.jsx(vl,{...o}),e.jsx(f.Box,{direction:"column",ref:l,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(Dl,{...t,scrollParentRef:l,frozenCount:t!=null&&t.enableFreezeColumns?s:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?c:void 0}):null}),g&&e.jsx(Cl,{pagination:t==null?void 0:t.pagination,pageKey:t==null?void 0:t.pageKey,perPageKey:t==null?void 0:t.perPageKey,defaultPerPage:t==null?void 0:t.defaultPerPage,showPagination:t==null?void 0:t.showPagination,totalData:n==null?void 0:n.totalData})]})};function Es(r){return h.memo(r)}const ms=Es(Bs),kl=200,Yr="1px solid var(--sa-border-subtle, #0b120e24)",Fs=({sortDir:r,frozen:t,filterActive:o})=>r==="asc"?e.jsx(F.Icon,{name:"ChevronSmallUp"}):r==="desc"?e.jsx(F.Icon,{name:"ChevronSmallDown"}):t?e.jsx(F.Icon,{name:"LockOn",size:"xs"}):e.jsx(F.Icon,{name:"Filter",size:"xs",style:o?{color:"var(--sa-text-brand, #031f43)"}:void 0}),Xr=({icon:r,label:t,active:o,danger:n,onClick:l})=>{const s=n?"var(--sa-text-error, #a4133c)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:l,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:o?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:s,textAlign:"left"},onMouseEnter:c=>{o||(c.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:c=>{c.currentTarget.style.background=o?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(F.Icon,{name:r,size:"sm",style:{color:s,flexShrink:0}}),e.jsx(S.Text,{as:"span",style:{color:s},children:t})]})},Bl=({active:r,canSort:t,canHide:o,sortDir:n,frozen:l,onSort:s,onClearSort:c,onToggleFreeze:i,onHide:a,filterSlot:d,filterActive:g})=>{const[b,p]=h.useState(!1),C=h.useRef(null),E=h.useRef(null),[w,W]=h.useState({top:0,left:0});h.useEffect(()=>{if(b&&C.current){const I=C.current.getBoundingClientRect(),k=I.left+kl>window.innerWidth;W({top:I.bottom+6,...k?{right:window.innerWidth-I.right}:{left:I.left}})}},[b]),h.useEffect(()=>{if(!b)return;const I=k=>{E.current&&!E.current.contains(k.target)&&C.current&&!C.current.contains(k.target)&&p(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[b]);const L=I=>{I(),p(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:C,type:"button",className:"sa-tl-menu-trigger","data-active":r||b?"true":"false",onClick:I=>{I.stopPropagation(),p(k=>!k)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:Yr,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(Fs,{sortDir:n,frozen:l,filterActive:g})}),b&&e.jsxs(f.Box,{ref:E,onClick:I=>I.stopPropagation(),style:{position:"fixed",top:`${w.top}px`,...w.left!==void 0?{left:`${w.left}px`}:{right:`${w.right}px`},minWidth:kl,backgroundColor:"var(--sa-background-primary, #ffffff)",border:Yr,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:[d!=null&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{padding:"6px 12px 2px"},children:e.jsx(S.Text,{as:"span",style:{fontSize:12,fontWeight:500,color:"var(--sa-text-subtlest, #8c8f97)"},children:"Filter"})}),e.jsx("div",{style:{padding:"2px 8px 4px"},children:d}),e.jsx("div",{style:{borderTop:Yr,margin:"4px 0"}})]}),t&&e.jsxs(e.Fragment,{children:[e.jsx(Xr,{icon:"ChevronUp",label:"Ascending",active:n==="asc",onClick:()=>L(()=>n==="asc"?c():s("asc"))}),e.jsx(Xr,{icon:"ChevronDown",label:"Descending",active:n==="desc",onClick:()=>L(()=>n==="desc"?c():s("desc"))}),e.jsx("div",{style:{borderTop:Yr,margin:"4px 0"}})]}),e.jsx(Xr,{icon:"Pin1",label:l?"Unfreeze":"Freeze",active:l,onClick:()=>L(i)}),o&&e.jsx(Xr,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>L(a)})]})]})},Ms=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Is={background:"var(--sa-background-warning-subtlest, #fef2e6)",color:"inherit",padding:0,borderRadius:2},El=({text:r,query:t,markStyle:o})=>{const n=t==null?void 0:t.trim();if(!n||!r)return e.jsx(e.Fragment,{children:r});const l=n.split(/\s+/).filter(Boolean);if(!l.length)return e.jsx(e.Fragment,{children:r});const s=new Set(l.map(a=>a.toLowerCase())),c=new RegExp(`(${l.map(Ms).join("|")})`,"gi"),i=r.split(c);return e.jsx(e.Fragment,{children:i.map((a,d)=>a&&s.has(a.toLowerCase())?e.jsx("mark",{style:{...Is,...o},children:a},d):e.jsx(h.Fragment,{children:a},d))})},Or="1px solid var(--sa-border-subtle, #0b120e24)",Ts="var(--sa-text-subtle, #8c8f97)",Sr="var(--sa-background-neutral, #f0f1f2)",ml="2px 0 4px -2px var(--sa-border-subtle, #0b120e24)",Ar=40,Nt="var(--sa-background-brand-subtlest)",$r={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Fl="sa-table-layout-styles",Ls=()=>{if(typeof document>"u"||document.getElementById(Fl))return;const r=document.createElement("style");r.id=Fl,r.textContent=`
|
|
2
2
|
.sa-table-layout tbody td {
|
|
3
3
|
transition: background-color 0.15s ease;
|
|
4
4
|
background-color: var(--sa-tl-bg, transparent);
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
.sa-table-layout tfoot.sa-tl-sticky-foot > tr:first-child > th {
|
|
55
55
|
box-shadow: 0 -2px 4px -2px var(--sa-border-subtle, #0b120e24);
|
|
56
56
|
}
|
|
57
|
-
`,document.head.appendChild(r)},Ar=r=>r==="right"?"right":r==="center"?"center":"left",Ts=/^(#|rgb|hsl|var\()/,Xr=r=>r?Ts.test(r)?r:`var(--sa-background-${r})`:void 0,Ls=(r,t)=>{if(t)return r[t]},Os=(r,t)=>r==null&&t==null?0:r==null?-1:t==null?1:typeof r=="number"&&typeof t=="number"?r-t:String(r).localeCompare(String(t)),As=({columns:r,data:t,getRowKey:o,rowBg:n,size:l="md",resizable:s=!1,layout:c="auto",widthStorageKey:i,columnState:a,onColumnStateChange:d,columnMenu:g=!1,highlight:b,sort:p,defaultSort:C,onSortChange:E,height:w,mobileLayout:W="cards",mobileBreakpoint:L="md",groupSeparator:I,summary:k,footer:D,stickyFooter:O=!1,emptyState:T,loading:B=!1,loadingRows:z=8,rowActions:H,selectable:N=!1,selectedKeys:$,defaultSelectedKeys:Z,onSelectionChange:G,isRowSelectable:X})=>{Is();const J=!Ce.useMediaQuery(L)&&W!=="scroll",_=!!(H!=null&&H.length),[V,ce]=h.useState(null);h.useEffect(()=>{if(!V)return;const v=()=>ce(null),x=setTimeout(()=>document.addEventListener("click",v),0);return()=>{clearTimeout(x),document.removeEventListener("click",v)}},[V]);const[xe,me]=h.useState(()=>new Set),ue=a!==void 0,[we,qe]=h.useState({}),fe=a??we,We=v=>{d==null||d(v),ue||qe(v)},Fe=p!==void 0,[je,ne]=h.useState(C??null),ie=Fe?p??null:je,ze=!E,Ze=v=>{E==null||E(v),Fe||ne(v)},{headerGroups:Te,leafColumns:De,hasGroups:Ne}=h.useMemo(()=>{var le;const v=new Set(fe.hidden??[]),x=(te,be)=>te.key??(typeof te.accessor=="string"?te.accessor:`col-${be}`),M=r.map((te,be)=>{var Je;if((Je=te.children)!=null&&Je.length){const zr=te.children.map((or,Br)=>({col:or,key:x(or,`${be}-${Br}`)})).filter(or=>!v.has(or.key));return{col:te,key:te.key??`group-${be}`,isGroup:!0,leaves:zr}}const ve={col:te,key:x(te,`${be}`)};return{col:te,key:ve.key,isGroup:!1,leaves:v.has(ve.key)?[]:[ve]}}).filter(te=>te.leaves.length>0),q=M.some(te=>te.isGroup);let re=M.flatMap(te=>te.leaves);if(!q&&((le=fe.order)!=null&&le.length)){const te=new Map(fe.order.map((be,ve)=>[be,ve]));re=[...re].sort((be,ve)=>(te.get(be.key)??1/0)-(te.get(ve.key)??1/0))}return{headerGroups:M,leafColumns:re,hasGroups:q}},[r,fe]),P=h.useMemo(()=>new Map(De.map((v,x)=>[v.key,x])),[De]),R=!Ne&&De.some(v=>(v.col.headerColSpan??1)>1),U=De.map(v=>v.key).join("|"),de=(v,x)=>{const M=v.sortKey??(typeof v.accessor=="string"?v.accessor:void 0);return M?x[M]:void 0},Me=v=>v.sortable??(!!v.sortKey||typeof v.accessor=="string"),ye=h.useMemo(()=>{if(!ze||!ie)return t;const v=De.find(M=>M.key===ie.key);if(!v)return t;const x=ie.direction==="asc"?1:-1;return[...t].sort((M,q)=>Os(de(v.col,M),de(v.col,q))*x)},[t,ze,ie,De]),ke=!Ne&&!R,$e=!!i&&ke,[Ge,Qe]=Q.useColumnWidths(i??""),Ke=$e?Ge:void 0,Ue=h.useRef(null),[pe,rr]=h.useState();h.useLayoutEffect(()=>{rr(void 0)},[U]),h.useLayoutEffect(()=>{if(!ke||pe||!Ue.current)return;const v=Ue.current.querySelectorAll("th.sa-tl-leaf");rr(Array.from(v).map(x=>x.offsetWidth))},[pe,ke]);const[Dr,ar]=h.useState(),[fr,nt]=h.useState(0);h.useLayoutEffect(()=>{if(!Ne||!Ue.current)return;const v=Ue.current.querySelector(":scope > tr");v&&nt(v.offsetHeight)},[Ne,U]);const m=(v,x)=>{if((Ke==null?void 0:Ke[x])!=null)return Ke[x];if(v.width!=null)return v.width;if((pe==null?void 0:pe[x])!=null)return pe[x]},Y=(v,x)=>typeof v.width=="number"?v.width:pe==null?void 0:pe[x],K=fe.frozenKey&&!Ne&&!R?De.findIndex(v=>v.key===fe.frozenKey):-1,Se=v=>v<=K,Ae=N?Or:0,Re=v=>{const x=Dr??pe;if(!x)return Ae;let M=Ae;for(let q=0;q<v;q++)M+=x[q]??0;return M};h.useLayoutEffect(()=>{const v=Ue.current;if(!v||K<0){ar(void 0);return}let x=0;const M=()=>{x=0;const re=v.querySelectorAll("th.sa-tl-leaf"),le=Array.from(re).map(te=>te.getBoundingClientRect().width);ar(te=>te&&te.length===le.length&&te.every((be,ve)=>Math.abs(be-le[ve])<.5)?te:le)},q=new ResizeObserver(()=>{x||(x=requestAnimationFrame(M))});return q.observe(v),v.querySelectorAll("th.sa-tl-leaf").forEach(re=>q.observe(re)),M(),()=>{x&&cancelAnimationFrame(x),q.disconnect()}},[U,K,N,pe,Ke]);const Le=h.useRef(null),[Ee,tr]=h.useState("100vh");h.useLayoutEffect(()=>{if(w!==void 0)return;const v=()=>{if(Le.current){const x=Le.current.getBoundingClientRect().top;tr(`calc(100vh - ${x}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[w]);const Be=(v,x)=>o?o(v,x):x,Sr=$!==void 0,[jl,ni]=h.useState(()=>new Set(Z??[])),dr=h.useMemo(()=>Sr?new Set($):jl,[Sr,$,jl]);h.useEffect(()=>{N&&!o&&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).")},[N,!o]);const Nl=v=>{if(Sr||ni(v),G){const x=ye.filter((M,q)=>v.has(Be(M,q)));G(Array.from(v),x)}},Zt=(v,x)=>N&&(X?X(v,x):!0),Gt=v=>{const x=new Set(dr);x.has(v)?x.delete(v):x.add(v),Nl(x)},kr=h.useMemo(()=>N?ye.map((v,x)=>({row:v,i:x,key:Be(v,x)})).filter(({row:v,i:x})=>X?X(v,x):!0).map(({key:v})=>v):[],[N,ye,X,o]),_l=kr.filter(v=>dr.has(v)),Qt=kr.length>0&&_l.length===kr.length,ql=_l.length>0&&!Qt,si=()=>{const v=new Set(dr);Qt?kr.forEach(x=>v.delete(x)):kr.forEach(x=>v.add(x)),Nl(v)},Ut=(v,x,M)=>{const q=v.render?v.render(x,M,ye):Ls(x,v.accessor);if(b&&!v.render&&typeof q=="string"){const re=v.key??(typeof v.accessor=="string"?v.accessor:void 0),le=re?b[re]:void 0;if(le)return e.jsx(Sl,{text:q,query:le})}return q},Jt=De.length+(N?1:0)+(_?1:0),Zl=["80%","55%","70%","45%","90%","60%"],ci=(v,x)=>Zl[(v*7+x*3)%Zl.length],ii=(v,x)=>e.jsx(Ye.Skeleton,{height:14,width:ci(v,x),borderRadius:"rounded-sm"}),ai=Array.from({length:z},(v,x)=>e.jsxs(Q.Tr,{children:[N&&e.jsx(Q.Td,{style:{width:Or,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(Ye.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),De.map(({col:M,key:q},re)=>e.jsx(Q.Td,{style:{textAlign:Ar(M.align)},children:ii(x,re)},`sa-tl-sk-${x}-${q}`)),_&&e.jsx(Q.Td,{style:{width:1,padding:0,border:"none"}})]},`sa-tl-sk-${x}`)),di=(v,x)=>{x||We({...fe,hidden:[...fe.hidden??[],v]})},hi=v=>We({...fe,frozenKey:fe.frozenKey===v?void 0:v}),st=v=>(H??[]).filter(x=>{var M;return!((M=x.hidden)!=null&&M.call(x,v))}),Gl={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)"},ct=(v,x,M,q)=>{var Je;const re=(Je=v.disabled)==null?void 0:Je.call(v,x),le=(q==null?void 0:q.showLabel)??v.showLabel,te=(q==null?void 0:q.size)??"xs",be=e.jsx(j.Button,{size:te,variant:v.variant??"tertiary",tone:v.tone??"neutral",disabled:re,onClick:()=>v.onClick(x,M),iconLeft:v.icon?e.jsx(F.Icon,{name:v.icon,size:"sm"}):void 0,children:le&&v.label}),ve=v.tooltip;return ve?e.jsx(Ie.Tooltip,{label:ve,position:"top-end",children:be}):be},fi=(v,x)=>{const M=st(v);if(!M.length)return null;if(M.length>5){const re=Be(v,x),le=(V==null?void 0:V.rowKey)===re;return e.jsx("div",{className:"sa-tl-row-actions",style:Gl,onClick:te=>te.stopPropagation(),children:e.jsx(Ie.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(j.Button,{size:"xs",variant:"tertiary",onClick:te=>{const be=te.currentTarget.getBoundingClientRect();ce(le?null:{rowKey:re,top:be.bottom+4,right:window.innerWidth-be.right})},children:e.jsx(F.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:Gl,children:M.map(re=>e.jsx(h.Fragment,{children:ct(re,v,x)},re.key))})},ui=(v,x)=>{const M=st(v);return M.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:Lr},children:M.map(q=>e.jsx(h.Fragment,{children:ct(q,v,x,{showLabel:!0,size:"sm"})},q.key))}):null},gi=(v,x)=>{const M=st(v);return M.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:M.map(q=>e.jsx(h.Fragment,{children:ct(q,v,x,{showLabel:!1})},q.key))}):null},Yt=(v,x)=>{var Br;const{col:M,key:q}=v,re=P.get(q)??0,le=Se(re),te=le&&re===K,be=(ie==null?void 0:ie.key)===q?ie.direction:null,ve=g&&!M.disableMenu?e.jsx(Dl,{active:!!be||le||!!M.filterActive,canSort:Me(M),canHide:!M.locked,sortDir:be,frozen:le,onSort:at=>Ze({key:q,direction:at}),onClearSort:()=>Ze(null),onToggleFreeze:()=>hi(q),onHide:()=>di(q,M.locked),filterSlot:(Br=M.renderFilter)==null?void 0:Br.call(M),filterActive:M.filterActive}):null,Je=M.align==="right",zr=M.align==="right"?"flex-end":M.align==="center"?"center":"flex-start",or=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:zr,overflow:"hidden"},children:[M.icon&&e.jsx(F.Icon,{name:M.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:Yr,children:M.title})]});return e.jsx(Q.Th,{className:`sa-tl-leaf${le?" sa-tl-frozen":""}`,rowSpan:x==null?void 0:x.rowSpan,colSpan:x==null?void 0:x.colSpan,minWidth:M.minWidth,numeric:M.numeric,resizable:ke?M.resizable:!1,defaultWidth:Y(M,re),style:{textAlign:Ar(M.align),width:m(M,re),position:"sticky",top:(x==null?void 0:x.top)??0,left:le?Re(re):void 0,zIndex:le?3:2,backgroundColor:wr,boxShadow:te?kl:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:Je?e.jsxs(e.Fragment,{children:[ve,or]}):e.jsxs(e.Fragment,{children:[or,ve]})})},`th-${q}`)},yi=()=>{const v=[];for(let x=0;x<De.length;){const M=De[x],q=M.col.headerColSpan??1,re=Math.max(1,Math.min(q,De.length-x));v.push(Yt(M,re>1?{colSpan:re}:void 0)),x+=re}return v},Ql=v=>e.jsx(Q.Th,{rowSpan:v==null?void 0:v.rowSpan,style:{width:Or,position:"sticky",top:0,left:0,zIndex:4,backgroundColor:wr,padding:0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:x=>x.stopPropagation(),children:e.jsx(nr.Checkbox,{size:"sm",variant:ql?"indeterminate":"select",checked:Qt||ql,disabled:kr.length===0,onChange:si,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),pi=(v,x,M)=>{const q=Be(v,x);return e.jsx(Q.Td,{className:"sa-tl-frozen",style:{width:Or,padding:0,position:"sticky",left:0,zIndex:2,...M?{"--sa-tl-bg":M}:{}},children:Zt(v,x)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:re=>re.stopPropagation(),children:e.jsx(nr.Checkbox,{size:"sm",checked:dr.has(q),onChange:()=>Gt(q),"aria-label":"Pilih baris"})})},`tl-select-${x}`)},Xt=De.filter(v=>!v.col.hideOnMobile),$t=Xt.find(v=>v.col.primary)??Xt[0],bi=Xt.filter(v=>v!==$t),vi=v=>me(x=>{const M=new Set(x);return M.has(v)?M.delete(v):M.add(v),M}),Ul=(v,x)=>bi.map(({col:M,key:q})=>{const re=Ut(M,v,x),le={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right",...M.numeric?{fontVariantNumeric:"tabular-nums"}:{}},te=typeof re=="string"||typeof re=="number"?e.jsx(S.Text,{style:le,children:re}):e.jsx("div",{style:le,children:re});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof M.title=="string"?e.jsx(S.Text,{color:"subtle",fontWeight:"medium",style:{color:Ms,flexShrink:0},children:M.title}):e.jsx("div",{style:{flexShrink:0},children:M.title}),te]},q)}),Kt=(v,x)=>{const M=$t?Ut($t.col,v,x):null;return typeof M=="string"||typeof M=="number"?e.jsx(S.Text,{as:"span",style:Yr,children:M}):e.jsx("span",{style:Yr,children:M})},Ci=e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:z},(v,x)=>e.jsxs(f.Box,{style:{border:Lr,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Ye.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(Ye.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(Ye.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${x}`))}),Jl=e.jsx(f.Box,{fullWidth:!0,style:{minHeight:(T==null?void 0:T.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:T==null?void 0:T.content}),xi=B?Ci:ye.length===0?Jl:W==="expand"?e.jsx(f.Box,{style:{display:"flex",flexDirection:"column"},children:ye.map((v,x)=>{const M=Be(v,x),q=xe.has(M),le=N&&dr.has(M)?Pt:Xr(n==null?void 0:n(v,x));return e.jsxs("div",{style:{borderBottom:Lr,backgroundColor:le},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[Zt(v,x)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(nr.Checkbox,{size:"sm",checked:dr.has(M),onChange:()=>Gt(M),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>vi(M),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:[Kt(v,x),e.jsx(F.Icon,{name:q?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),_&&gi(v,x)]}),q&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:Ul(v,x)})]},M)})}):e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:ye.map((v,x)=>{const M=Be(v,x),q=N&&dr.has(M);return e.jsxs(f.Box,{style:{border:Lr,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:q?Pt:Xr(n==null?void 0:n(v,x))},children:[Zt(v,x)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(nr.Checkbox,{size:"sm",checked:dr.has(M),onChange:()=>Gt(M),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:Kt(v,x)})]}):Kt(v,x),Ul(v,x),_&&ui(v,x)]},M)})}),wi=s&&ke&&pe!==void 0,Yl=c==="fixed"&&!s&&(ke?pe!==void 0:!0),Di=Yl&&!ke,it=D&&D.length>0?D.map((v,x)=>e.jsx(Q.Tr,{children:v.cells.map((M,q)=>e.jsx(Q.Td,{colSpan:M.colSpan,rowSpan:M.rowSpan,numeric:M.numeric,style:{textAlign:Ar(M.align)},children:M.content},`tl-foot-${x}-${q}`))},`tl-foot-${x}`)):null,Si=e.jsxs(Q.Table,{className:"sa-table-layout",fullWidth:!0,size:l,resizable:wi,style:Yl?{tableLayout:"fixed"}:void 0,onWidthsChange:$e?Qe:void 0,children:[Di&&e.jsxs("colgroup",{children:[N&&e.jsx("col",{style:{width:Or}}),De.map(({col:v,key:x},M)=>e.jsx("col",{style:{width:m(v,M)}},`col-${x}`)),_&&e.jsx("col",{style:{width:1}})]}),e.jsx(Q.Thead,{ref:Ue,children:Ne?e.jsxs(e.Fragment,{children:[e.jsxs(Q.Tr,{children:[N&&Ql({rowSpan:2}),Te.map(v=>v.isGroup?e.jsx(Q.Th,{colSpan:v.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:wr},children:e.jsx("span",{style:Yr,children:v.col.title})},`grp-${v.key}`):Yt(v.leaves[0],{rowSpan:2})),_&&e.jsx(Q.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:wr}})]}),e.jsx(Q.Tr,{children:Te.flatMap(v=>v.isGroup?v.leaves.map(x=>Yt(x,{top:fr})):[])})]}):e.jsxs(Q.Tr,{children:[N&&Ql(),yi(),_&&e.jsx(Q.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:wr}})]})}),e.jsx(Q.Tbody,{children:B?ai:ye.length===0?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:Jt,children:Jl})}):e.jsxs(e.Fragment,{children:[ye.map((v,x)=>{const M=I==null?void 0:I(v,x,x>0?ye[x-1]:void 0),re=N&&dr.has(Be(v,x))?Pt:Xr(n==null?void 0:n(v,x));return e.jsxs(h.Fragment,{children:[M!=null&&M!==!1&&e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:Jt,style:{backgroundColor:wr},children:M})}),e.jsxs(Q.Tr,{children:[N&&pi(v,x,re),De.map(({col:le,key:te},be)=>{var Xl;const ve=(Xl=le.cellProps)==null?void 0:Xl.call(le,v,x,ye);if(ve!=null&&ve.hidden)return null;const Je=Se(be),zr=Je&&be===K,or=Ut(le,v,x),Br=typeof le.bg=="function"?le.bg(v,x,ye):le.bg,at=Xr(Br)??re;return e.jsx(Q.Td,{className:Je?"sa-tl-frozen":void 0,colSpan:ve==null?void 0:ve.colSpan,rowSpan:ve==null?void 0:ve.rowSpan,numeric:le.numeric,style:{textAlign:Ar(le.align),width:m(le,be),minWidth:le.minWidth,position:Je?"sticky":void 0,left:Je?Re(be):void 0,zIndex:Je?1:void 0,boxShadow:zr?kl:void 0,...at?{"--sa-tl-bg":at}:{}},children:typeof or=="string"?e.jsx(S.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Ar(le.align)},children:or}):or},`tl-cell-${x}-${te}`)}),_&&e.jsx(Q.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:fi(v,x)})]})]},Be(v,x))}),k!=null&&e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:Jt,children:k})})]})}),it&&e.jsx(Q.Tfoot,{className:O?"sa-tl-sticky-foot":void 0,children:it})]}),Rt=V?ye.findIndex((v,x)=>Be(v,x)===V.rowKey):-1,eo=Rt>=0?ye[Rt]:null;return e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{ref:Le,fullWidth:!0,style:{overflow:"auto",height:w??Ee},children:J?e.jsxs(e.Fragment,{children:[xi,it&&!B&&ye.length>0&&e.jsx(f.Box,{style:{borderTop:Lr},children:e.jsx(Q.Table,{fullWidth:!0,size:l,className:"sa-table-layout",children:e.jsx(Q.Tbody,{children:it})})})]}):Si}),V&&eo&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:V.top,right:V.right},onClick:v=>v.stopPropagation(),children:st(eo).map(v=>e.jsx("div",{style:{padding:"2px 4px"},children:ct(v,eo,Rt,{showLabel:!0,size:"sm"})},v.key))})]})},Vt=r=>r==="asc"||r==="desc",Ws=(r={})=>{const{sortKeyParam:t="sortBy",sortOrderParam:o="sortOrder",pageKey:n="page",defaultSort:l=null,paramKeys:s,scopeId:c,storage:i=Mt}=r,{searchParams:a,setSearchParams:d,searchQueries:g}=Ve(),b=a.toString(),p=c?xr.tableSort(c):void 0,C=h.useRef(!1);h.useEffect(()=>{if(C.current||(C.current=!0,!p)||a.has(t)||a.has(o))return;const k=i.get(p);!(k!=null&&k.key)||!Vt(k.direction)||d({...Object.fromEntries(a.entries()),[t]:k.key,[o]:k.direction},{replace:!0})},[]);const E=h.useMemo(()=>{const k=a.get(t),D=a.get(o);return k&&Vt(D)?{key:k,direction:D}:l},[b,t,o,l]);h.useEffect(()=>{if(!p)return;const k=a.get(t),D=a.get(o);k&&Vt(D)?i.set(p,{key:k,direction:D}):i.remove(p)},[b,p,t,o,i]);const w=(s==null?void 0:s.sortBy)??"sortBy",W=(s==null?void 0:s.sortOrder)??"sortOrder",L=h.useMemo(()=>E?{[w]:E.key,[W]:E.direction}:{},[E,w,W]),I=h.useCallback(k=>{const D={...g};k?(D[t]=k.key,D[o]=k.direction):(delete D[t],delete D[o]),delete D[n],d(D)},[g,t,o,n,d]);return{sort:E,setSort:I,params:L}},$r=({of:r,render:t})=>h.Children.toArray(r==null?void 0:r.map((o,n,l)=>t(o,n,l))),he=({condition:r,fallback:t,children:o,loading:n,isLoading:l})=>e.jsx(e.Fragment,{children:l?n:r?o:t}),ge=r=>e.jsx(S.Text,{...r,fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),ir=r=>e.jsx(S.Text,{color:"red-600",fontSize:"sm",children:r.message}),zs=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const s=l.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(he,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ge,{children:l.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:l.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(Ie.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(lr.Input,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default",fullWidth:!0}),!s&&l.errorMessage&&e.jsx(ir,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},Hs=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const s=l.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(he,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ge,{children:l.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:l.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(Ie.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(f.Box,{direction:"column",style:{width:l.inputProps.fullWidth?"100%":t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(pr.Dropdown,{size:r,...l.inputProps,error:!!l.errorMessage})}),!s&&l.errorMessage&&e.jsx(ir,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},Ps=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",Vs=r=>{var i;const[t,o]=h.useState(!1),n=a=>{a.preventDefault(),a.stopPropagation()},l=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&r.handleOnFileChange(a.dataTransfer.files.item(0))},s=a=>{a.preventDefault(),o(!0)},c=a=>{a.preventDefault(),o(!1)};return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:r.handleOnClick,onDragOver:n,onDrop:l,onDragEnter:s,onDragLeave:c,paddingBlock:"md",borderRadius:"rounded-md",style:{border:t?"1px solid var(--sa-border-info)":`1px solid ${Ps(r.errorMessage,r.status)}`},children:[e.jsx(F.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(ae.Flex,{direction:"column",gap:"xs",children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",children:[e.jsx(S.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(S.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(S.Text,{fontSize:"sm",color:"gray-500",children:(i=r.fileSupports)==null?void 0:i.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function js(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const El=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},Ns=r=>{const t={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},o=r.split(" ");if(o.length!==3)return null;const n=parseInt(o[0],10),l=t[o[1]],s=parseInt(o[2],10);return isNaN(n)||isNaN(l)||isNaN(s)?null:new Date(s,l,n)};function _s(r,t=!0){if(!r)return"Rp 0";const o=typeof r=="number"?r.toString():r;if(isNaN(Number(o)))return"Rp 0";const n=o.split("."),l=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),s=n.length===2?l+"."+n[1]:l;return t?"Rp"+s:s}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},String.prototype.toNumber=function(){return Number(this)};const qs=r=>{const t=r.split(" ");let o=t[0].charAt(0);return t.length>1&&(o+=""+t[1].charAt(0)),o.toUpperCase()};function Zs(r){const t=typeof r=="string"?new Date(r):r;if(isNaN(t.getTime()))throw new Error("Invalid date format");const o=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),l=String(t.getDate()).padStart(2,"0");return`${o}-${n}-${l}`}const Gs="sa-admin",er=r=>`var(--${Gs}-${r})`,Qs={base:{borderColor:er("base-border-color"),textColor:er("base-text-color"),iconColor:er("base-icon-color"),placeholderColor:er("base-placeholder-color")},document:{bgColor:er("document-bg-color")},sidebar:{bgColor:er("sidebar-bg-color"),borderColor:er("sidebar-border-color"),maxWidth:er("sidebar-max-width"),width:er("sidebar-width"),collapseWidth:er("sidebar-collapse-width"),collapseV2Width:er("sidebar-v2-collapse-width")}},Us=24*60*60*1e3,Js=r=>{const t="14px poppins",n=document.createElement("canvas").getContext("2d");n.font=t;const l=n.measureText(r).width;return Number(Math.ceil(l))},Ys=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Xs=/--+/,$s=/-$/;function Ks(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function Rs(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function ec(r){return/^[A-Za-z\s]+$/.test(r)}const rc=r=>{const t=/^[0-9]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&(r.key==="a"||r.key==="c"||r.key==="v")||!t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},tc=r=>{const t=/^[0-9]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},oc=r=>{const t=/^[0-9.]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||!t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},lc=r=>Ys.test(r);function nc(r){return!(Xs.test(r)||$s.test(r))}const sc=r=>{const t=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((r.ctrlKey||r.metaKey)&&["a","c","v","x"].includes(r.key.toLowerCase()))return;const o=r.currentTarget.value;/^[0-9]$/.test(r.key)||r.key==="."&&!o.includes(".")||r.key==="-"&&o.length===0&&!o.includes("-")||t.includes(r.key)||r.preventDefault()},cc=r=>{const t=document.getElementById(r);if(t){const o=t.getBoundingClientRect(),n=window.scrollY+o.top-80;window.scrollTo({top:n,behavior:"smooth"})}};function ic(r){const t=r.toLowerCase();if(["kb","mb","gb"].find(s=>t.endsWith(s)))return r;const l=Number(r);if(isNaN(l))throw new Error("Invalid size format");return l>=1e6?`${(l/1e6).toFixed(2)}MB`:l>=1e3?`${(l/1e3).toFixed(2)}KB`:`${l}B`}function ac(r){const t=r.split("/");return t[t.length-1]}const dc=r=>{var t,o;return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:r.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(ae.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(F.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(ae.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(S.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?ac(r.defaultFile.url):(t=r.fileSelected)==null?void 0:t.name}),r.defaultFile?(r.defaultFile.size||r.defaultFile.date)&&e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[r.defaultFile.size&&e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",children:r.defaultFile.size}),r.defaultFile.size&&r.defaultFile.date&&e.jsx(F.Icon,{name:"Dot",size:"xs"}),r.defaultFile.date&&e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:r.defaultFile.date})]}):e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",children:ic(((o=r.fileSelected)==null?void 0:o.size.toString())||"100000")}),e.jsx(F.Icon,{name:"Dot",size:"xs"}),e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:El(new Date)})]})]})]}),e.jsx(j.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:n=>{n.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(F.Icon,{name:"Trash1"})})]})},ml=({status:r="default",labelPosition:t="outside-top",...o})=>{var p;const n=h.useRef(null),l=()=>{if(o.defaultFile){window.open(o.defaultFile.url);return}n.current&&n.current.click()},s=Ce.useMediaQuery("md"),c=r==="error"||typeof o.errorMessage=="string"&&!!o.errorMessage,i=o.label?e.jsxs(ae.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(S.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:o.label}),o.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"}),o.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=o.description?e.jsx(S.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.description}):null,d=e.jsxs(e.Fragment,{children:[o.helperText&&e.jsx(S.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.helperText}),o.errorText&&r==="error"&&e.jsx(S.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorText}),o.errorMessage&&!o.errorText&&e.jsx(S.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorMessage})]}),g=e.jsx("input",{type:"file",style:{display:"none"},ref:n,onChange:C=>{var E;return o.handleOnChangeFile(((E=C.target.files)==null?void 0:E.item(0))||null)},accept:(p=o.fileSupportOption)==null?void 0:p.map(C=>"."+(C==null?void 0:C.toLowerCase())).join(", ")}),b=e.jsxs(f.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...o.containerProps,children:[g,(o.fileSelected||o.defaultFile)&&e.jsx(dc,{fileSelected:o.fileSelected,defaultFile:o.defaultFile,handleOnDeleteFile:o.handleOnDeleteFile,handleOnClickFile:l}),!o.fileSelected&&!o.defaultFile&&e.jsx(Vs,{fileSupports:o.fileSupportOption,isDesktop:s,errorMessage:c?o.errorText||o.errorMessage||" ":void 0,status:c?"error":"default",handleOnClick:l,handleOnFileChange:o.handleOnChangeFile})]});return t==="outside-left"?e.jsxs(ae.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(ae.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[i,a]}),e.jsxs(ae.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[b,d]})]}):e.jsxs(ae.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[i,a,b,d]})},hc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const s=l.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(he,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ge,{children:l.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:l.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(Ie.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(ae.Flex,{direction:"column",gap:"xs",children:[e.jsx(ml,{...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(ir,{message:l.errorMessage})]})]})},fc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...s})=>{var a,d,g,b;const c=s.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"||t==="horizontal-inline"?"spacing-96":"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(he,{condition:!!l,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ge,{children:s.title}),e.jsx(Xe.Body3,{props:{color:"gray-500"},children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:s.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Ie.Tooltip,{label:(d=s.tooltip)==null?void 0:d.label,arrowPosition:(g=s.tooltip)==null?void 0:g.arrowPosition,focusable:!0,...s.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!s.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:s.description})})]})}),e.jsx(f.Box,{gap:t==="horizontal-inline"?"xl":"md",direction:t==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx($r,{of:(b=s.checkBoxesList)==null?void 0:b.map(p=>({...p,isChecked:s.checkBoxesAreChecked.includes(p.id)})),render:p=>p.renderBadge?e.jsxs(f.Box,{direction:"row",justify:"space-between",gap:"lg",...s.badgeContainerProps,children:[e.jsx(nr.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:C=>s.onChecked(C.target.value,p),label:p.name,description:p.description}),p.renderBadge]}):e.jsx(nr.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:C=>s.onChecked(C.target.value,p),label:p.name,description:p.description})})}),!c&&s.errorMessage&&e.jsx(ir,{message:s.errorMessage})]})},uc=({position:r="vertical",size:t="md",fullWidth:o=!1,...n})=>{var s;const l=r==="horizontal-inline"||r==="horizontal-block"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal-inline"||r==="horizontal-block"?"spacing-96":"sm",direction:r==="horizontal-inline"||r==="horizontal-block"?"row":"column",children:[e.jsx(he,{condition:!!n.description||!!n.title,children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[n.title&&e.jsx(ge,{children:n.title}),e.jsx(he,{condition:!!n.description,children:e.jsx(S.Text,{color:"gray-500",children:n.description})})]})}),e.jsx(f.Box,{gap:"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx($r,{of:(s=n.radioList)==null?void 0:s.map(c=>({...c,isChecked:n.radioIsChecked===c.id})),render:({value:c,id:i,isChecked:a,subInput:d,label:g,description:b})=>e.jsxs(f.Box,{direction:"column",gap:"xs",customMaxWidth:l,children:[e.jsx(ft.Radio,{id:`${i.toString()}-${c}`,name:n.groupName||g,label:g,value:c,checked:a,onChange:p=>n.onChecked({id:i,label:p.target.name,value:p.target.value}),disabled:n.disableAll},i),b&&e.jsx(S.Text,{color:"gray-500",style:{marginLeft:28},children:b}),d]})})}),n.errorMessage&&e.jsx(ir,{message:n.errorMessage})]})},gc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const s=l.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(he,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ge,{children:l.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:l.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(Ie.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(ae.Flex,{direction:"column",gap:"xs",children:[e.jsx(ht.Textarea,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(ir,{message:l.errorMessage})]})]})},yc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",required:n=!1,fullWidth:l=!1,...s})=>{var i,a,d;const c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(he,{condition:n,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:l,children:[e.jsx(ge,{children:s.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:s.titleDescription})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:l,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:s.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((i=s.tooltip)!=null&&i.label),children:e.jsx(Ie.Tooltip,{label:(a=s.tooltip)==null?void 0:a.label,arrowPosition:(d=s.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...s.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!s.titleDescription,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:s.titleDescription})})]})}),e.jsx(Cr.Toggle,{checked:s.checked,onChange:s.onChange,label:s.label,description:s.description}),s.errorMessage&&e.jsx(ir,{message:s.errorMessage})]})},pc=({variant:r="primary",size:t="md",...o})=>{const n=vr.useColor(),l=c=>{var a,d,g,b,p,C;if(!c)return;const i=o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary"?"var(--sa-text-subtle, #8c8f97)":r==="secondary-danger"?(d=(a=n==null?void 0:n.computed)==null?void 0:a.red)==null?void 0:d[600]:r==="secondary-primary"?(b=(g=n==null?void 0:n.computed)==null?void 0:g.blue)==null?void 0:b[700]:(C=(p=n==null?void 0:n.computed)==null?void 0:p.gray)==null?void 0:C[50];return e.jsx(F.Icon,{name:c,size:t,style:{color:i}})},s=()=>{var i,a,d,g;if(r!=="secondary-danger"&&r!=="secondary-primary")return o.title;const c={color:o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary-danger"?(a=(i=n==null?void 0:n.computed)==null?void 0:i.red)==null?void 0:a[600]:(g=(d=n==null?void 0:n.computed)==null?void 0:d.blue)==null?void 0:g[700]};switch(t){case"xs":return e.jsx(Xe.Body2,{props:{style:c},children:o.title});case"sm":case"md":return e.jsx(Xe.SubH3,{props:{style:c},children:o.title});case"lg":return e.jsx(Xe.SubH2,{props:{style:c},children:o.title});default:return o.title}};return e.jsx(j.Button,{fullWidth:!0,disabled:o.disabled,primary:r==="primary",secondary:r==="secondary"||r==="secondary-danger"||r==="secondary-primary",success:r==="success",onClick:o.onClick,type:o.type,iconLeft:l(o.iconLeft),iconRight:l(o.iconRight),size:t,children:s()})},bc=r=>e.jsx(Xe.H5,{props:{...r},children:r.title}),vc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const s=l.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(he,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ge,{children:l.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:l.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(Ie.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(ae.Flex,{direction:"column",gap:"xs",children:[e.jsx(f.Box,{direction:"column",style:{width:t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(hr.StarasiaDate,{size:r,...l.inputProps,status:l.errorMessage?"error":void 0})}),!s&&l.errorMessage&&e.jsx(ir,{message:l.errorMessage})]})]})};async function Cc(r,t){const o=new Image;o.src=r,await new Promise((s,c)=>{o.onload=s,o.onerror=c});const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const l=n.getContext("2d",{alpha:!0});if(!l)throw new Error("No 2D context");return l.drawImage(o,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((s,c)=>{n.toBlob(i=>{if(!i)return c("Canvas is empty");const a=new File([i],"cropped.png",{type:"image/png"});s(a)},"image/png")})}const Fl={"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},Ml=h.forwardRef(({handleUpload:r,urlImage:t,isUploading:o,croppedImage:n,setCroppedImage:l,size:s="96",aspect:c="1:1",containerProps:i,maxFileSize:a=2,onError:d},g)=>{const b=Ce.useMediaQuery("md"),[p,C]=h.useState(!1),[E,w]=h.useState(null),[W,L]=h.useState(!1),[I,k]=h.useState({x:0,y:0}),[D,O]=h.useState(1),[T,B]=h.useState(null);h.useEffect(()=>{t===null&&l(null)},[t]);const z=h.useCallback((_,V)=>{B(V)},[]),H=_=>{var xe;const V=(xe=_.target.files)==null?void 0:xe[0];if(!V)return;const ce=new FileReader;ce.onload=()=>{w(ce.result),L(!0)},ce.readAsDataURL(V)},N=async()=>{if(!(!E||!T))try{const _=await Cc(E,T);if(a&&_.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}r==null||r(_);const V=URL.createObjectURL(_);l(V,_),L(!1)}catch{d==null||d("Gagal memproses gambar")}},$=h.useRef(null),Z=()=>{$.current&&$.current.click()};h.useImperativeHandle(g,()=>({openFileDialog:()=>{var _;(_=$.current)==null||_.click()}}));const G=parseInt(s,10),X=Fl[c];let oe,J;return X>=1?(J=G,oe=G*X):(oe=G,J=G/X),e.jsxs(f.Box,{direction:"column",display:"flex",position:"relative",bg:(i==null?void 0:i.bg)||"gray-200",borderStyle:(i==null?void 0:i.borderStyle)||"border-none",borderColor:(i==null?void 0:i.borderColor)||"gray-200",borderWidth:(i==null?void 0:i.borderWidth)||"border-2",borderRadius:(i==null?void 0:i.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:i!=null&&i.fullWidth?"100%":`${oe}px`,height:i!=null&&i.fullWidth?"auto":`${J}px`,aspectRatio:X,flexShrink:0},onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:[n||t?e.jsx("img",{src:n||t||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(F.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(s)/2<40?Number(s)/2:40,height:Number(s)/2<40?Number(s)/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, #080f214c)",opacity:p?1:0,transition:"opacity 0.3s ease-in-out"},onClick:Z,children:[e.jsx("input",{ref:$,type:"file",accept:"image/*",onChange:H,disabled:o,style:{display:"none"}}),e.jsxs(f.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(F.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(he,{condition:s.toNumber()>80,children:e.jsx(S.Text,{color:"gray-50",fontSize:s.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),o&&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, #e5e9f6cc)"},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"})}),W&&Vr.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:()=>L(!1),children:e.jsxs("div",{style:{backgroundColor:"var(--sa-background-primary)",borderRadius:"var(--sa-radii-md)",boxShadow:"0 20px 60px rgba(0,0,0,0.3)",overflow:"hidden",width:b?c==="1:1"?"min(90vw, 480px)":`min(90vw, ${oe*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:_=>_.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:E&&e.jsx($l,{image:E,crop:I,zoom:D,aspect:c?Fl[c]:void 0,onCropChange:k,onZoomChange:O,onCropComplete:z,objectFit:"contain",minZoom:.5,restrictPosition:!1})}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem",padding:"0.75rem 1rem",borderTop:"1px solid var(--sa-border-subtle)"},children:[e.jsx(j.Button,{size:"sm",secondary:!0,onClick:()=>L(!1),children:"Cancel"}),e.jsx(j.Button,{size:"sm",primary:!0,onClick:N,children:"Crop"})]})]})}),document.body)]})}),xc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...s})=>{var a,d,g;const c=s.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(he,{condition:!!l,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ge,{children:s.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:s.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Ie.Tooltip,{label:(d=s.tooltip)==null?void 0:d.label,arrowPosition:(g=s.tooltip)==null?void 0:g.arrowPosition,focusable:!0,...s.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!s.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:s.description})})]})}),e.jsxs(ae.Flex,{direction:"column",gap:"xs",children:[e.jsx(Ml,{...s.inputProps}),!c&&s.errorMessage&&e.jsx(ir,{message:s.errorMessage})]})]})},wc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,i,a;const s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(he,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ge,{children:l.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:l.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Ie.Tooltip,{label:(i=l.tooltip)==null?void 0:i.label,arrowPosition:(a=l.tooltip)==null?void 0:a.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),l.inputProps.extended&&l.inputProps.extended]})},Dc=({items:r,id:t,handleOnUpdate:o,width:n,toggleShow:l=!0,disabled:s=!1})=>{var g;const[c,i]=h.useState([]);h.useEffect(()=>{r&&i([...r.map(b=>({id:b.id,isActive:b.isActive}))])},[r]);const a=(g=c.find(b=>b.id===t))==null?void 0:g.isActive,d=h.useCallback(()=>{i(b=>b.map(p=>p.id===t?{...p,isActive:!p.isActive}:p)),o&&o(!a)},[t,o,a]);return e.jsx(f.Box,{direction:"row",gap:"md",style:{width:n},children:l&&e.jsx(Cr.Toggle,{disabled:s,checked:a,onChange:d,label:a?"Active":"Inactive"})})},Sc={InputText:zs,InputDropdown:Hs,InputSingleFile:hc,CheckBoxOptions:fc,RadioOptions:uc,InputTextArea:gc,ToggleForm:yc,ActionButton:pc,FormTitle:bc,InputDate:vc,InputImgFile:xc,Custom:wc},Il=({customBottom:r})=>{const[t,o]=h.useState(!1),n=()=>{window.scrollY>window.screenY?o(!0):o(!1)},l=()=>{window.scrollTo({top:0,behavior:"smooth"})};return h.useEffect(()=>(window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}),[]),e.jsx(f.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(f.Box,{direction:"column",position:"absolute",style:{bottom:r||"1.6rem",right:"2rem",transform:t?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(j.Button,{secondary:!0,size:"xs",onClick:l,type:"button",iconLeft:e.jsx(F.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},_e="sa-sidepanel-item",Tl="sa-sidepanel-item-styles",kc=`
|
|
58
|
-
.${
|
|
57
|
+
`,document.head.appendChild(r)},Wr=r=>r==="right"?"right":r==="center"?"center":"left",Os=/^(#|rgb|hsl|var\()/,Kr=r=>r?Os.test(r)?r:`var(--sa-background-${r})`:void 0,As=(r,t)=>{if(t)return r[t]},Ws=(r,t)=>r==null&&t==null?0:r==null?-1:t==null?1:typeof r=="number"&&typeof t=="number"?r-t:String(r).localeCompare(String(t)),zs=({columns:r,data:t,getRowKey:o,rowBg:n,size:l="md",resizable:s=!1,layout:c="auto",widthStorageKey:i,columnState:a,onColumnStateChange:d,columnMenu:g=!1,highlight:b,sort:p,defaultSort:C,onSortChange:E,height:w,mobileLayout:W="cards",mobileBreakpoint:L="md",groupSeparator:I,summary:k,footer:D,stickyFooter:O=!1,emptyState:T,loading:B=!1,loadingRows:z=8,rowActions:H,selectable:N=!1,selectedKeys:K,defaultSelectedKeys:Z,onSelectionChange:G,isRowSelectable:X})=>{Ls();const J=!Ce.useMediaQuery(L)&&W!=="scroll",_=!!(H!=null&&H.length),[V,ce]=h.useState(null);h.useEffect(()=>{if(!V)return;const v=()=>ce(null),x=setTimeout(()=>document.addEventListener("click",v),0);return()=>{clearTimeout(x),document.removeEventListener("click",v)}},[V]);const[xe,Be]=h.useState(()=>new Set),ue=a!==void 0,[we,Ge]=h.useState({}),fe=a??we,Ae=v=>{d==null||d(v),ue||Ge(v)},Ee=p!==void 0,[Ne,ne]=h.useState(C??null),ie=Ee?p??null:Ne,We=!E,Qe=v=>{E==null||E(v),Ee||ne(v)},{headerGroups:Ie,leafColumns:De,hasGroups:_e}=h.useMemo(()=>{var le;const v=new Set(fe.hidden??[]),x=(te,be)=>te.key??(typeof te.accessor=="string"?te.accessor:`col-${be}`),M=r.map((te,be)=>{var Xe;if((Xe=te.children)!=null&&Xe.length){const Pr=te.children.map((lr,Er)=>({col:lr,key:x(lr,`${be}-${Er}`)})).filter(lr=>!v.has(lr.key));return{col:te,key:te.key??`group-${be}`,isGroup:!0,leaves:Pr}}const ve={col:te,key:x(te,`${be}`)};return{col:te,key:ve.key,isGroup:!1,leaves:v.has(ve.key)?[]:[ve]}}).filter(te=>te.leaves.length>0),q=M.some(te=>te.isGroup);let re=M.flatMap(te=>te.leaves);if(!q&&((le=fe.order)!=null&&le.length)){const te=new Map(fe.order.map((be,ve)=>[be,ve]));re=[...re].sort((be,ve)=>(te.get(be.key)??1/0)-(te.get(ve.key)??1/0))}return{headerGroups:M,leafColumns:re,hasGroups:q}},[r,fe]),P=h.useMemo(()=>new Map(De.map((v,x)=>[v.key,x])),[De]),R=!_e&&De.some(v=>(v.col.headerColSpan??1)>1),U=De.map(v=>v.key).join("|"),de=(v,x)=>{const M=v.sortKey??(typeof v.accessor=="string"?v.accessor:void 0);return M?x[M]:void 0},me=v=>v.sortable??(!!v.sortKey||typeof v.accessor=="string"),ye=h.useMemo(()=>{if(!We||!ie)return t;const v=De.find(M=>M.key===ie.key);if(!v)return t;const x=ie.direction==="asc"?1:-1;return[...t].sort((M,q)=>Ws(de(v.col,M),de(v.col,q))*x)},[t,We,ie,De]),Se=!_e&&!R,Re=!!i&&Se,[Ue,Je]=Q.useColumnWidths(i??""),er=Re?Ue:void 0,Ye=h.useRef(null),[pe,or]=h.useState();h.useLayoutEffect(()=>{or(void 0)},[U]),h.useLayoutEffect(()=>{if(!Se||pe||!Ye.current)return;const v=Ye.current.querySelectorAll("th.sa-tl-leaf");or(Array.from(v).map(x=>x.offsetWidth))},[pe,Se]);const[kr,hr]=h.useState(),[gr,ct]=h.useState(0);h.useLayoutEffect(()=>{if(!_e||!Ye.current)return;const v=Ye.current.querySelector(":scope > tr");v&&ct(v.offsetHeight)},[_e,U]);const m=(v,x)=>{if((er==null?void 0:er[x])!=null)return er[x];if(v.width!=null)return v.width;if((pe==null?void 0:pe[x])!=null)return pe[x]},$=(v,x)=>typeof v.width=="number"?v.width:pe==null?void 0:pe[x],Y=fe.frozenKey&&!_e&&!R?De.findIndex(v=>v.key===fe.frozenKey):-1,Te=v=>v<=Y,ze=N?Ar:0,Le=v=>{const x=kr??pe;if(!x)return ze;let M=ze;for(let q=0;q<v;q++)M+=x[q]??0;return M};h.useLayoutEffect(()=>{const v=Ye.current;if(!v||Y<0){hr(void 0);return}let x=0;const M=()=>{x=0;const re=v.querySelectorAll("th.sa-tl-leaf"),le=Array.from(re).map(te=>te.getBoundingClientRect().width);hr(te=>te&&te.length===le.length&&te.every((be,ve)=>Math.abs(be-le[ve])<.5)?te:le)},q=new ResizeObserver(()=>{x||(x=requestAnimationFrame(M))});return q.observe(v),v.querySelectorAll("th.sa-tl-leaf").forEach(re=>q.observe(re)),M(),()=>{x&&cancelAnimationFrame(x),q.disconnect()}},[U,Y,N,pe,er]);const Fe=h.useRef(null),[ir,qe]=h.useState("100vh");h.useLayoutEffect(()=>{if(w!==void 0)return;const v=()=>{if(Fe.current){const x=Fe.current.getBoundingClientRect().top;qe(`calc(100vh - ${x}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[w]);const ke=(v,x)=>o?o(v,x):x,fr=K!==void 0,[rr,Hr]=h.useState(()=>new Set(Z??[])),Pe=h.useMemo(()=>fr?new Set(K):rr,[fr,K,rr]);h.useEffect(()=>{N&&!o&&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).")},[N,!o]);const ql=v=>{if(fr||Hr(v),G){const x=ye.filter((M,q)=>v.has(ke(M,q)));G(Array.from(v),x)}},Ut=(v,x)=>N&&(X?X(v,x):!0),Jt=v=>{const x=new Set(Pe);x.has(v)?x.delete(v):x.add(v),ql(x)},Br=h.useMemo(()=>N?ye.map((v,x)=>({row:v,i:x,key:ke(v,x)})).filter(({row:v,i:x})=>X?X(v,x):!0).map(({key:v})=>v):[],[N,ye,X,o]),Zl=Br.filter(v=>Pe.has(v)),Yt=Br.length>0&&Zl.length===Br.length,Gl=Zl.length>0&&!Yt,ci=()=>{const v=new Set(Pe);Yt?Br.forEach(x=>v.delete(x)):Br.forEach(x=>v.add(x)),ql(v)},Xt=(v,x,M)=>{const q=v.render?v.render(x,M,ye):As(x,v.accessor);if(b&&!v.render&&typeof q=="string"){const re=v.key??(typeof v.accessor=="string"?v.accessor:void 0),le=re?b[re]:void 0;if(le)return e.jsx(El,{text:q,query:le})}return q},$t=De.length+(N?1:0)+(_?1:0),Ql=["80%","55%","70%","45%","90%","60%"],ii=(v,x)=>Ql[(v*7+x*3)%Ql.length],ai=(v,x)=>e.jsx($e.Skeleton,{height:14,width:ii(v,x),borderRadius:"rounded-sm"}),di=Array.from({length:z},(v,x)=>e.jsxs(Q.Tr,{children:[N&&e.jsx(Q.Td,{style:{width:Ar,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx($e.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),De.map(({col:M,key:q},re)=>e.jsx(Q.Td,{style:{textAlign:Wr(M.align)},children:ai(x,re)},`sa-tl-sk-${x}-${q}`)),_&&e.jsx(Q.Td,{style:{width:1,padding:0,border:"none"}})]},`sa-tl-sk-${x}`)),hi=(v,x)=>{x||Ae({...fe,hidden:[...fe.hidden??[],v]})},fi=v=>Ae({...fe,frozenKey:fe.frozenKey===v?void 0:v}),it=v=>(H??[]).filter(x=>{var M;return!((M=x.hidden)!=null&&M.call(x,v))}),Ul={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)"},at=(v,x,M,q)=>{var Xe;const re=(Xe=v.disabled)==null?void 0:Xe.call(v,x),le=(q==null?void 0:q.showLabel)??v.showLabel,te=(q==null?void 0:q.size)??"xs",be=e.jsx(j.Button,{size:te,variant:v.variant??"tertiary",tone:v.tone??"neutral",disabled:re,onClick:()=>v.onClick(x,M),iconLeft:v.icon?e.jsx(F.Icon,{name:v.icon,size:"sm"}):void 0,children:le&&v.label}),ve=v.tooltip;return ve?e.jsx(Me.Tooltip,{label:ve,position:"top-end",children:be}):be},ui=(v,x)=>{const M=it(v);if(!M.length)return null;if(M.length>5){const re=ke(v,x),le=(V==null?void 0:V.rowKey)===re;return e.jsx("div",{className:"sa-tl-row-actions",style:Ul,onClick:te=>te.stopPropagation(),children:e.jsx(Me.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(j.Button,{size:"xs",variant:"tertiary",onClick:te=>{const be=te.currentTarget.getBoundingClientRect();ce(le?null:{rowKey:re,top:be.bottom+4,right:window.innerWidth-be.right})},children:e.jsx(F.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:Ul,children:M.map(re=>e.jsx(h.Fragment,{children:at(re,v,x)},re.key))})},gi=(v,x)=>{const M=it(v);return M.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:Or},children:M.map(q=>e.jsx(h.Fragment,{children:at(q,v,x,{showLabel:!0,size:"sm"})},q.key))}):null},yi=(v,x)=>{const M=it(v);return M.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:M.map(q=>e.jsx(h.Fragment,{children:at(q,v,x,{showLabel:!1})},q.key))}):null},Kt=(v,x)=>{var Er;const{col:M,key:q}=v,re=P.get(q)??0,le=Te(re),te=le&&re===Y,be=(ie==null?void 0:ie.key)===q?ie.direction:null,ve=g&&!M.disableMenu?e.jsx(Bl,{active:!!be||le||!!M.filterActive,canSort:me(M),canHide:!M.locked,sortDir:be,frozen:le,onSort:ht=>Qe({key:q,direction:ht}),onClearSort:()=>Qe(null),onToggleFreeze:()=>fi(q),onHide:()=>hi(q,M.locked),filterSlot:(Er=M.renderFilter)==null?void 0:Er.call(M),filterActive:M.filterActive}):null,Xe=M.align==="right",Pr=M.align==="right"?"flex-end":M.align==="center"?"center":"flex-start",lr=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:Pr,overflow:"hidden"},children:[M.icon&&e.jsx(F.Icon,{name:M.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:$r,children:M.title})]});return e.jsx(Q.Th,{className:`sa-tl-leaf${le?" sa-tl-frozen":""}`,rowSpan:x==null?void 0:x.rowSpan,colSpan:x==null?void 0:x.colSpan,minWidth:M.minWidth,numeric:M.numeric,resizable:Se?M.resizable:!1,defaultWidth:$(M,re),style:{textAlign:Wr(M.align),width:m(M,re),position:"sticky",top:(x==null?void 0:x.top)??0,left:le?Le(re):void 0,zIndex:le?3:2,backgroundColor:Sr,boxShadow:te?ml:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:Xe?e.jsxs(e.Fragment,{children:[ve,lr]}):e.jsxs(e.Fragment,{children:[lr,ve]})})},`th-${q}`)},pi=()=>{const v=[];for(let x=0;x<De.length;){const M=De[x],q=M.col.headerColSpan??1,re=Math.max(1,Math.min(q,De.length-x));v.push(Kt(M,re>1?{colSpan:re}:void 0)),x+=re}return v},Jl=v=>e.jsx(Q.Th,{rowSpan:v==null?void 0:v.rowSpan,style:{width:Ar,position:"sticky",top:0,left:0,zIndex:4,backgroundColor:Sr,padding:0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:x=>x.stopPropagation(),children:e.jsx(sr.Checkbox,{size:"sm",variant:Gl?"indeterminate":"select",checked:Yt||Gl,disabled:Br.length===0,onChange:ci,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),bi=(v,x,M)=>{const q=ke(v,x);return e.jsx(Q.Td,{className:"sa-tl-frozen",style:{width:Ar,padding:0,position:"sticky",left:0,zIndex:2,...M?{"--sa-tl-bg":M}:{}},children:Ut(v,x)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:re=>re.stopPropagation(),children:e.jsx(sr.Checkbox,{size:"sm",checked:Pe.has(q),onChange:()=>Jt(q),"aria-label":"Pilih baris"})})},`tl-select-${x}`)},Rt=De.filter(v=>!v.col.hideOnMobile),eo=Rt.find(v=>v.col.primary)??Rt[0],vi=Rt.filter(v=>v!==eo),Ci=v=>Be(x=>{const M=new Set(x);return M.has(v)?M.delete(v):M.add(v),M}),Yl=(v,x)=>vi.map(({col:M,key:q})=>{const re=Xt(M,v,x),le={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right",...M.numeric?{fontVariantNumeric:"tabular-nums"}:{}},te=typeof re=="string"||typeof re=="number"?e.jsx(S.Text,{style:le,children:re}):e.jsx("div",{style:le,children:re});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof M.title=="string"?e.jsx(S.Text,{color:"subtle",fontWeight:"medium",style:{color:Ts,flexShrink:0},children:M.title}):e.jsx("div",{style:{flexShrink:0},children:M.title}),te]},q)}),ro=(v,x)=>{const M=eo?Xt(eo.col,v,x):null;return typeof M=="string"||typeof M=="number"?e.jsx(S.Text,{as:"span",style:$r,children:M}):e.jsx("span",{style:$r,children:M})},xi=e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:z},(v,x)=>e.jsxs(f.Box,{style:{border:Or,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx($e.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx($e.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx($e.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${x}`))}),Xl=e.jsx(f.Box,{fullWidth:!0,style:{minHeight:(T==null?void 0:T.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:T==null?void 0:T.content}),wi=B?xi:ye.length===0?Xl:W==="expand"?e.jsx(f.Box,{style:{display:"flex",flexDirection:"column"},children:ye.map((v,x)=>{const M=ke(v,x),q=xe.has(M),le=N&&Pe.has(M)?Nt:Kr(n==null?void 0:n(v,x));return e.jsxs("div",{style:{borderBottom:Or,backgroundColor:le},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[Ut(v,x)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(sr.Checkbox,{size:"sm",checked:Pe.has(M),onChange:()=>Jt(M),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>Ci(M),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:[ro(v,x),e.jsx(F.Icon,{name:q?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),_&&yi(v,x)]}),q&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:Yl(v,x)})]},M)})}):e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:ye.map((v,x)=>{const M=ke(v,x),q=N&&Pe.has(M);return e.jsxs(f.Box,{style:{border:Or,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:q?Nt:Kr(n==null?void 0:n(v,x))},children:[Ut(v,x)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(sr.Checkbox,{size:"sm",checked:Pe.has(M),onChange:()=>Jt(M),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:ro(v,x)})]}):ro(v,x),Yl(v,x),_&&gi(v,x)]},M)})}),Di=s&&Se&&pe!==void 0,$l=c==="fixed"&&!s&&(Se?pe!==void 0:!0),Si=$l&&!Se,dt=D&&D.length>0?D.map((v,x)=>e.jsx(Q.Tr,{children:v.cells.map((M,q)=>e.jsx(Q.Td,{colSpan:M.colSpan,rowSpan:M.rowSpan,numeric:M.numeric,style:{textAlign:Wr(M.align)},children:M.content},`tl-foot-${x}-${q}`))},`tl-foot-${x}`)):null,ki=e.jsxs(Q.Table,{className:"sa-table-layout",fullWidth:!0,size:l,resizable:Di,style:$l?{tableLayout:"fixed"}:void 0,onWidthsChange:Re?Je:void 0,children:[Si&&e.jsxs("colgroup",{children:[N&&e.jsx("col",{style:{width:Ar}}),De.map(({col:v,key:x},M)=>e.jsx("col",{style:{width:m(v,M)}},`col-${x}`)),_&&e.jsx("col",{style:{width:1}})]}),e.jsx(Q.Thead,{ref:Ye,children:_e?e.jsxs(e.Fragment,{children:[e.jsxs(Q.Tr,{children:[N&&Jl({rowSpan:2}),Ie.map(v=>v.isGroup?e.jsx(Q.Th,{colSpan:v.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:Sr},children:e.jsx("span",{style:$r,children:v.col.title})},`grp-${v.key}`):Kt(v.leaves[0],{rowSpan:2})),_&&e.jsx(Q.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:Sr}})]}),e.jsx(Q.Tr,{children:Ie.flatMap(v=>v.isGroup?v.leaves.map(x=>Kt(x,{top:gr})):[])})]}):e.jsxs(Q.Tr,{children:[N&&Jl(),pi(),_&&e.jsx(Q.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:Sr}})]})}),e.jsx(Q.Tbody,{children:B?di:ye.length===0?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:$t,children:Xl})}):e.jsxs(e.Fragment,{children:[ye.map((v,x)=>{const M=I==null?void 0:I(v,x,x>0?ye[x-1]:void 0),re=N&&Pe.has(ke(v,x))?Nt:Kr(n==null?void 0:n(v,x));return e.jsxs(h.Fragment,{children:[M!=null&&M!==!1&&e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:$t,style:{backgroundColor:Sr},children:M})}),e.jsxs(Q.Tr,{children:[N&&bi(v,x,re),De.map(({col:le,key:te},be)=>{var Kl;const ve=(Kl=le.cellProps)==null?void 0:Kl.call(le,v,x,ye);if(ve!=null&&ve.hidden)return null;const Xe=Te(be),Pr=Xe&&be===Y,lr=Xt(le,v,x),Er=typeof le.bg=="function"?le.bg(v,x,ye):le.bg,ht=Kr(Er)??re;return e.jsx(Q.Td,{className:Xe?"sa-tl-frozen":void 0,colSpan:ve==null?void 0:ve.colSpan,rowSpan:ve==null?void 0:ve.rowSpan,numeric:le.numeric,style:{textAlign:Wr(le.align),width:m(le,be),minWidth:le.minWidth,position:Xe?"sticky":void 0,left:Xe?Le(be):void 0,zIndex:Xe?1:void 0,boxShadow:Pr?ml:void 0,...ht?{"--sa-tl-bg":ht}:{}},children:typeof lr=="string"?e.jsx(S.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Wr(le.align)},children:lr}):lr},`tl-cell-${x}-${te}`)}),_&&e.jsx(Q.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:ui(v,x)})]})]},ke(v,x))}),k!=null&&e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:$t,children:k})})]})}),dt&&e.jsx(Q.Tfoot,{className:O?"sa-tl-sticky-foot":void 0,children:dt})]}),to=V?ye.findIndex((v,x)=>ke(v,x)===V.rowKey):-1,oo=to>=0?ye[to]:null;return e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{ref:Fe,fullWidth:!0,style:{overflow:"auto",height:w??ir},children:J?e.jsxs(e.Fragment,{children:[wi,dt&&!B&&ye.length>0&&e.jsx(f.Box,{style:{borderTop:Or},children:e.jsx(Q.Table,{fullWidth:!0,size:l,className:"sa-table-layout",children:e.jsx(Q.Tbody,{children:dt})})})]}):ki}),V&&oo&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:V.top,right:V.right},onClick:v=>v.stopPropagation(),children:it(oo).map(v=>e.jsx("div",{style:{padding:"2px 4px"},children:at(v,oo,to,{showLabel:!0,size:"sm"})},v.key))})]})},_t=r=>r==="asc"||r==="desc",Hs=(r={})=>{const{sortKeyParam:t="sortBy",sortOrderParam:o="sortOrder",pageKey:n="page",defaultSort:l=null,paramKeys:s,scopeId:c,storage:i=Lt}=r,{searchParams:a,setSearchParams:d,searchQueries:g}=je(),b=a.toString(),p=c?Dr.tableSort(c):void 0,C=h.useRef(!1);h.useEffect(()=>{if(C.current||(C.current=!0,!p)||a.has(t)||a.has(o))return;const k=i.get(p);!(k!=null&&k.key)||!_t(k.direction)||d({...Object.fromEntries(a.entries()),[t]:k.key,[o]:k.direction},{replace:!0})},[]);const E=h.useMemo(()=>{const k=a.get(t),D=a.get(o);return k&&_t(D)?{key:k,direction:D}:l},[b,t,o,l]);h.useEffect(()=>{if(!p)return;const k=a.get(t),D=a.get(o);k&&_t(D)?i.set(p,{key:k,direction:D}):i.remove(p)},[b,p,t,o,i]);const w=(s==null?void 0:s.sortBy)??"sortBy",W=(s==null?void 0:s.sortOrder)??"sortOrder",L=h.useMemo(()=>E?{[w]:E.key,[W]:E.direction}:{},[E,w,W]),I=h.useCallback(k=>{const D={...g};k?(D[t]=k.key,D[o]=k.direction):(delete D[t],delete D[o]),delete D[n],d(D)},[g,t,o,n,d]);return{sort:E,setSort:I,params:L}},Rr=({of:r,render:t})=>h.Children.toArray(r==null?void 0:r.map((o,n,l)=>t(o,n,l))),he=({condition:r,fallback:t,children:o,loading:n,isLoading:l})=>e.jsx(e.Fragment,{children:l?n:r?o:t}),ge=r=>e.jsx(S.Text,{...r,fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),dr=r=>e.jsx(S.Text,{color:"red-600",fontSize:"sm",children:r.message}),Ps=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const s=l.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(he,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ge,{children:l.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:l.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(Me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(nr.Input,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default",fullWidth:!0}),!s&&l.errorMessage&&e.jsx(dr,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},Vs=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const s=l.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(he,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ge,{children:l.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:l.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(Me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(f.Box,{direction:"column",style:{width:l.inputProps.fullWidth?"100%":t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(vr.Dropdown,{size:r,...l.inputProps,error:!!l.errorMessage})}),!s&&l.errorMessage&&e.jsx(dr,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},js=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",Ns=r=>{var i;const[t,o]=h.useState(!1),n=a=>{a.preventDefault(),a.stopPropagation()},l=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&r.handleOnFileChange(a.dataTransfer.files.item(0))},s=a=>{a.preventDefault(),o(!0)},c=a=>{a.preventDefault(),o(!1)};return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:r.handleOnClick,onDragOver:n,onDrop:l,onDragEnter:s,onDragLeave:c,paddingBlock:"md",borderRadius:"rounded-md",style:{border:t?"1px solid var(--sa-border-info)":`1px solid ${js(r.errorMessage,r.status)}`},children:[e.jsx(F.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(ae.Flex,{direction:"column",gap:"xs",children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",children:[e.jsx(S.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(S.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(S.Text,{fontSize:"sm",color:"gray-500",children:(i=r.fileSupports)==null?void 0:i.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function _s(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const Ml=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},qs=r=>{const t={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},o=r.split(" ");if(o.length!==3)return null;const n=parseInt(o[0],10),l=t[o[1]],s=parseInt(o[2],10);return isNaN(n)||isNaN(l)||isNaN(s)?null:new Date(s,l,n)};function Zs(r,t=!0){if(!r)return"Rp 0";const o=typeof r=="number"?r.toString():r;if(isNaN(Number(o)))return"Rp 0";const n=o.split("."),l=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),s=n.length===2?l+"."+n[1]:l;return t?"Rp"+s:s}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},String.prototype.toNumber=function(){return Number(this)};const Gs=r=>{const t=r.split(" ");let o=t[0].charAt(0);return t.length>1&&(o+=""+t[1].charAt(0)),o.toUpperCase()};function Qs(r){const t=typeof r=="string"?new Date(r):r;if(isNaN(t.getTime()))throw new Error("Invalid date format");const o=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),l=String(t.getDate()).padStart(2,"0");return`${o}-${n}-${l}`}const Us="sa-admin",tr=r=>`var(--${Us}-${r})`,Js={base:{borderColor:tr("base-border-color"),textColor:tr("base-text-color"),iconColor:tr("base-icon-color"),placeholderColor:tr("base-placeholder-color")},document:{bgColor:tr("document-bg-color")},sidebar:{bgColor:tr("sidebar-bg-color"),borderColor:tr("sidebar-border-color"),maxWidth:tr("sidebar-max-width"),width:tr("sidebar-width"),collapseWidth:tr("sidebar-collapse-width"),collapseV2Width:tr("sidebar-v2-collapse-width")}},Ys=24*60*60*1e3,Xs=r=>{const t="14px poppins",n=document.createElement("canvas").getContext("2d");n.font=t;const l=n.measureText(r).width;return Number(Math.ceil(l))},$s=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Ks=/--+/,Rs=/-$/;function ec(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function rc(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function tc(r){return/^[A-Za-z\s]+$/.test(r)}const oc=r=>{const t=/^[0-9]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&(r.key==="a"||r.key==="c"||r.key==="v")||!t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},lc=r=>{const t=/^[0-9]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},nc=r=>{const t=/^[0-9.]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||!t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},sc=r=>$s.test(r);function cc(r){return!(Ks.test(r)||Rs.test(r))}const ic=r=>{const t=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((r.ctrlKey||r.metaKey)&&["a","c","v","x"].includes(r.key.toLowerCase()))return;const o=r.currentTarget.value;/^[0-9]$/.test(r.key)||r.key==="."&&!o.includes(".")||r.key==="-"&&o.length===0&&!o.includes("-")||t.includes(r.key)||r.preventDefault()},ac=r=>{const t=document.getElementById(r);if(t){const o=t.getBoundingClientRect(),n=window.scrollY+o.top-80;window.scrollTo({top:n,behavior:"smooth"})}};function dc(r){const t=r.toLowerCase();if(["kb","mb","gb"].find(s=>t.endsWith(s)))return r;const l=Number(r);if(isNaN(l))throw new Error("Invalid size format");return l>=1e6?`${(l/1e6).toFixed(2)}MB`:l>=1e3?`${(l/1e3).toFixed(2)}KB`:`${l}B`}function hc(r){const t=r.split("/");return t[t.length-1]}const fc=r=>{var t,o;return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:r.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(ae.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(F.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(ae.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(S.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?hc(r.defaultFile.url):(t=r.fileSelected)==null?void 0:t.name}),r.defaultFile?(r.defaultFile.size||r.defaultFile.date)&&e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[r.defaultFile.size&&e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",children:r.defaultFile.size}),r.defaultFile.size&&r.defaultFile.date&&e.jsx(F.Icon,{name:"Dot",size:"xs"}),r.defaultFile.date&&e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:r.defaultFile.date})]}):e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",children:dc(((o=r.fileSelected)==null?void 0:o.size.toString())||"100000")}),e.jsx(F.Icon,{name:"Dot",size:"xs"}),e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:Ml(new Date)})]})]})]}),e.jsx(j.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:n=>{n.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(F.Icon,{name:"Trash1"})})]})},Il=({status:r="default",labelPosition:t="outside-top",...o})=>{var p;const n=h.useRef(null),l=()=>{if(o.defaultFile){window.open(o.defaultFile.url);return}n.current&&n.current.click()},s=Ce.useMediaQuery("md"),c=r==="error"||typeof o.errorMessage=="string"&&!!o.errorMessage,i=o.label?e.jsxs(ae.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(S.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:o.label}),o.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"}),o.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=o.description?e.jsx(S.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.description}):null,d=e.jsxs(e.Fragment,{children:[o.helperText&&e.jsx(S.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.helperText}),o.errorText&&r==="error"&&e.jsx(S.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorText}),o.errorMessage&&!o.errorText&&e.jsx(S.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorMessage})]}),g=e.jsx("input",{type:"file",style:{display:"none"},ref:n,onChange:C=>{var E;return o.handleOnChangeFile(((E=C.target.files)==null?void 0:E.item(0))||null)},accept:(p=o.fileSupportOption)==null?void 0:p.map(C=>"."+(C==null?void 0:C.toLowerCase())).join(", ")}),b=e.jsxs(f.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...o.containerProps,children:[g,(o.fileSelected||o.defaultFile)&&e.jsx(fc,{fileSelected:o.fileSelected,defaultFile:o.defaultFile,handleOnDeleteFile:o.handleOnDeleteFile,handleOnClickFile:l}),!o.fileSelected&&!o.defaultFile&&e.jsx(Ns,{fileSupports:o.fileSupportOption,isDesktop:s,errorMessage:c?o.errorText||o.errorMessage||" ":void 0,status:c?"error":"default",handleOnClick:l,handleOnFileChange:o.handleOnChangeFile})]});return t==="outside-left"?e.jsxs(ae.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(ae.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[i,a]}),e.jsxs(ae.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[b,d]})]}):e.jsxs(ae.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[i,a,b,d]})},uc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const s=l.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(he,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ge,{children:l.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:l.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(Me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(ae.Flex,{direction:"column",gap:"xs",children:[e.jsx(Il,{...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(dr,{message:l.errorMessage})]})]})},gc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...s})=>{var a,d,g,b;const c=s.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"||t==="horizontal-inline"?"spacing-96":"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(he,{condition:!!l,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ge,{children:s.title}),e.jsx(Ke.Body3,{props:{color:"gray-500"},children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:s.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Me.Tooltip,{label:(d=s.tooltip)==null?void 0:d.label,arrowPosition:(g=s.tooltip)==null?void 0:g.arrowPosition,focusable:!0,...s.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!s.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:s.description})})]})}),e.jsx(f.Box,{gap:t==="horizontal-inline"?"xl":"md",direction:t==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(Rr,{of:(b=s.checkBoxesList)==null?void 0:b.map(p=>({...p,isChecked:s.checkBoxesAreChecked.includes(p.id)})),render:p=>p.renderBadge?e.jsxs(f.Box,{direction:"row",justify:"space-between",gap:"lg",...s.badgeContainerProps,children:[e.jsx(sr.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:C=>s.onChecked(C.target.value,p),label:p.name,description:p.description}),p.renderBadge]}):e.jsx(sr.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:C=>s.onChecked(C.target.value,p),label:p.name,description:p.description})})}),!c&&s.errorMessage&&e.jsx(dr,{message:s.errorMessage})]})},yc=({position:r="vertical",size:t="md",fullWidth:o=!1,...n})=>{var s;const l=r==="horizontal-inline"||r==="horizontal-block"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal-inline"||r==="horizontal-block"?"spacing-96":"sm",direction:r==="horizontal-inline"||r==="horizontal-block"?"row":"column",children:[e.jsx(he,{condition:!!n.description||!!n.title,children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[n.title&&e.jsx(ge,{children:n.title}),e.jsx(he,{condition:!!n.description,children:e.jsx(S.Text,{color:"gray-500",children:n.description})})]})}),e.jsx(f.Box,{gap:"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(Rr,{of:(s=n.radioList)==null?void 0:s.map(c=>({...c,isChecked:n.radioIsChecked===c.id})),render:({value:c,id:i,isChecked:a,subInput:d,label:g,description:b})=>e.jsxs(f.Box,{direction:"column",gap:"xs",customMaxWidth:l,children:[e.jsx(gt.Radio,{id:`${i.toString()}-${c}`,name:n.groupName||g,label:g,value:c,checked:a,onChange:p=>n.onChecked({id:i,label:p.target.name,value:p.target.value}),disabled:n.disableAll},i),b&&e.jsx(S.Text,{color:"gray-500",style:{marginLeft:28},children:b}),d]})})}),n.errorMessage&&e.jsx(dr,{message:n.errorMessage})]})},pc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const s=l.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(he,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ge,{children:l.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:l.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(Me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(ae.Flex,{direction:"column",gap:"xs",children:[e.jsx(ut.Textarea,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(dr,{message:l.errorMessage})]})]})},bc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",required:n=!1,fullWidth:l=!1,...s})=>{var i,a,d;const c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(he,{condition:n,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:l,children:[e.jsx(ge,{children:s.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:s.titleDescription})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:l,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:s.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((i=s.tooltip)!=null&&i.label),children:e.jsx(Me.Tooltip,{label:(a=s.tooltip)==null?void 0:a.label,arrowPosition:(d=s.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...s.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!s.titleDescription,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:s.titleDescription})})]})}),e.jsx(wr.Toggle,{checked:s.checked,onChange:s.onChange,label:s.label,description:s.description}),s.errorMessage&&e.jsx(dr,{message:s.errorMessage})]})},vc=({variant:r="primary",size:t="md",...o})=>{const n=xr.useColor(),l=c=>{var a,d,g,b,p,C;if(!c)return;const i=o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary"?"var(--sa-text-subtle, #8c8f97)":r==="secondary-danger"?(d=(a=n==null?void 0:n.computed)==null?void 0:a.red)==null?void 0:d[600]:r==="secondary-primary"?(b=(g=n==null?void 0:n.computed)==null?void 0:g.blue)==null?void 0:b[700]:(C=(p=n==null?void 0:n.computed)==null?void 0:p.gray)==null?void 0:C[50];return e.jsx(F.Icon,{name:c,size:t,style:{color:i}})},s=()=>{var i,a,d,g;if(r!=="secondary-danger"&&r!=="secondary-primary")return o.title;const c={color:o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary-danger"?(a=(i=n==null?void 0:n.computed)==null?void 0:i.red)==null?void 0:a[600]:(g=(d=n==null?void 0:n.computed)==null?void 0:d.blue)==null?void 0:g[700]};switch(t){case"xs":return e.jsx(Ke.Body2,{props:{style:c},children:o.title});case"sm":case"md":return e.jsx(Ke.SubH3,{props:{style:c},children:o.title});case"lg":return e.jsx(Ke.SubH2,{props:{style:c},children:o.title});default:return o.title}};return e.jsx(j.Button,{fullWidth:!0,disabled:o.disabled,primary:r==="primary",secondary:r==="secondary"||r==="secondary-danger"||r==="secondary-primary",success:r==="success",onClick:o.onClick,type:o.type,iconLeft:l(o.iconLeft),iconRight:l(o.iconRight),size:t,children:s()})},Cc=r=>e.jsx(Ke.H5,{props:{...r},children:r.title}),xc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const s=l.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(he,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ge,{children:l.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:l.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(Me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(ae.Flex,{direction:"column",gap:"xs",children:[e.jsx(f.Box,{direction:"column",style:{width:t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(ur.StarasiaDate,{size:r,...l.inputProps,status:l.errorMessage?"error":void 0})}),!s&&l.errorMessage&&e.jsx(dr,{message:l.errorMessage})]})]})};async function wc(r,t){const o=new Image;o.src=r,await new Promise((s,c)=>{o.onload=s,o.onerror=c});const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const l=n.getContext("2d",{alpha:!0});if(!l)throw new Error("No 2D context");return l.drawImage(o,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((s,c)=>{n.toBlob(i=>{if(!i)return c("Canvas is empty");const a=new File([i],"cropped.png",{type:"image/png"});s(a)},"image/png")})}const Tl={"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},Ll=h.forwardRef(({handleUpload:r,urlImage:t,isUploading:o,croppedImage:n,setCroppedImage:l,size:s="96",aspect:c="1:1",containerProps:i,maxFileSize:a=2,onError:d},g)=>{const b=Ce.useMediaQuery("md"),[p,C]=h.useState(!1),[E,w]=h.useState(null),[W,L]=h.useState(!1),[I,k]=h.useState({x:0,y:0}),[D,O]=h.useState(1),[T,B]=h.useState(null);h.useEffect(()=>{t===null&&l(null)},[t]);const z=h.useCallback((_,V)=>{B(V)},[]),H=_=>{var xe;const V=(xe=_.target.files)==null?void 0:xe[0];if(!V)return;const ce=new FileReader;ce.onload=()=>{w(ce.result),L(!0)},ce.readAsDataURL(V)},N=async()=>{if(!(!E||!T))try{const _=await wc(E,T);if(a&&_.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}r==null||r(_);const V=URL.createObjectURL(_);l(V,_),L(!1)}catch{d==null||d("Gagal memproses gambar")}},K=h.useRef(null),Z=()=>{K.current&&K.current.click()};h.useImperativeHandle(g,()=>({openFileDialog:()=>{var _;(_=K.current)==null||_.click()}}));const G=parseInt(s,10),X=Tl[c];let oe,J;return X>=1?(J=G,oe=G*X):(oe=G,J=G/X),e.jsxs(f.Box,{direction:"column",display:"flex",position:"relative",bg:(i==null?void 0:i.bg)||"gray-200",borderStyle:(i==null?void 0:i.borderStyle)||"border-none",borderColor:(i==null?void 0:i.borderColor)||"gray-200",borderWidth:(i==null?void 0:i.borderWidth)||"border-2",borderRadius:(i==null?void 0:i.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:i!=null&&i.fullWidth?"100%":`${oe}px`,height:i!=null&&i.fullWidth?"auto":`${J}px`,aspectRatio:X,flexShrink:0},onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:[n||t?e.jsx("img",{src:n||t||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(F.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(s)/2<40?Number(s)/2:40,height:Number(s)/2<40?Number(s)/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, #080f214c)",opacity:p?1:0,transition:"opacity 0.3s ease-in-out"},onClick:Z,children:[e.jsx("input",{ref:K,type:"file",accept:"image/*",onChange:H,disabled:o,style:{display:"none"}}),e.jsxs(f.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(F.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(he,{condition:s.toNumber()>80,children:e.jsx(S.Text,{color:"gray-50",fontSize:s.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),o&&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, #e5e9f6cc)"},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"})}),W&&Nr.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:()=>L(!1),children:e.jsxs("div",{style:{backgroundColor:"var(--sa-background-primary)",borderRadius:"var(--sa-radii-md)",boxShadow:"0 20px 60px rgba(0,0,0,0.3)",overflow:"hidden",width:b?c==="1:1"?"min(90vw, 480px)":`min(90vw, ${oe*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:_=>_.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:E&&e.jsx(Rl,{image:E,crop:I,zoom:D,aspect:c?Tl[c]:void 0,onCropChange:k,onZoomChange:O,onCropComplete:z,objectFit:"contain",minZoom:.5,restrictPosition:!1})}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem",padding:"0.75rem 1rem",borderTop:"1px solid var(--sa-border-subtle)"},children:[e.jsx(j.Button,{size:"sm",secondary:!0,onClick:()=>L(!1),children:"Cancel"}),e.jsx(j.Button,{size:"sm",primary:!0,onClick:N,children:"Crop"})]})]})}),document.body)]})}),Dc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...s})=>{var a,d,g;const c=s.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(he,{condition:!!l,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ge,{children:s.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:s.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Me.Tooltip,{label:(d=s.tooltip)==null?void 0:d.label,arrowPosition:(g=s.tooltip)==null?void 0:g.arrowPosition,focusable:!0,...s.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!s.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:s.description})})]})}),e.jsxs(ae.Flex,{direction:"column",gap:"xs",children:[e.jsx(Ll,{...s.inputProps}),!c&&s.errorMessage&&e.jsx(dr,{message:s.errorMessage})]})]})},Sc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,i,a;const s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(he,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ge,{children:l.title}),e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ge,{fontSize:r,children:l.title}),e.jsx(ge,{color:"error",fontSize:r,children:o}),e.jsx(he,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Me.Tooltip,{label:(i=l.tooltip)==null?void 0:i.label,arrowPosition:(a=l.tooltip)==null?void 0:a.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(he,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),l.inputProps.extended&&l.inputProps.extended]})},kc=({items:r,id:t,handleOnUpdate:o,width:n,toggleShow:l=!0,disabled:s=!1})=>{var g;const[c,i]=h.useState([]);h.useEffect(()=>{r&&i([...r.map(b=>({id:b.id,isActive:b.isActive}))])},[r]);const a=(g=c.find(b=>b.id===t))==null?void 0:g.isActive,d=h.useCallback(()=>{i(b=>b.map(p=>p.id===t?{...p,isActive:!p.isActive}:p)),o&&o(!a)},[t,o,a]);return e.jsx(f.Box,{direction:"row",gap:"md",style:{width:n},children:l&&e.jsx(wr.Toggle,{disabled:s,checked:a,onChange:d,label:a?"Active":"Inactive"})})},Bc={InputText:Ps,InputDropdown:Vs,InputSingleFile:uc,CheckBoxOptions:gc,RadioOptions:yc,InputTextArea:pc,ToggleForm:bc,ActionButton:vc,FormTitle:Cc,InputDate:xc,InputImgFile:Dc,Custom:Sc},Ol=({customBottom:r})=>{const[t,o]=h.useState(!1),n=()=>{window.scrollY>window.screenY?o(!0):o(!1)},l=()=>{window.scrollTo({top:0,behavior:"smooth"})};return h.useEffect(()=>(window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}),[]),e.jsx(f.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(f.Box,{direction:"column",position:"absolute",style:{bottom:r||"1.6rem",right:"2rem",transform:t?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(j.Button,{secondary:!0,size:"xs",onClick:l,type:"button",iconLeft:e.jsx(F.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},Ze="sa-sidepanel-item",Al="sa-sidepanel-item-styles",Ec=`
|
|
58
|
+
.${Ze} {
|
|
59
59
|
display: block;
|
|
60
60
|
box-sizing: border-box;
|
|
61
61
|
width: 100%;
|
|
@@ -70,39 +70,39 @@
|
|
|
70
70
|
outline: none;
|
|
71
71
|
transition: background-color 140ms ease, box-shadow 140ms ease;
|
|
72
72
|
}
|
|
73
|
-
.${
|
|
73
|
+
.${Ze}[data-divider="true"] {
|
|
74
74
|
border-bottom: 1px solid var(--sa-border-subtle, #0b120e24);
|
|
75
75
|
}
|
|
76
76
|
/* The first row also gets a top line so the list is bounded on its own,
|
|
77
77
|
without relying on a wrapping container's border. Adjacent rows still
|
|
78
78
|
share a single 1px line (only border-bottom), never a doubled 2px one. */
|
|
79
|
-
.${
|
|
79
|
+
.${Ze}[data-divider="true"]:first-child {
|
|
80
80
|
border-top: 1px solid var(--sa-border-subtle, #0b120e24);
|
|
81
81
|
}
|
|
82
|
-
.${
|
|
82
|
+
.${Ze}:hover {
|
|
83
83
|
background: var(--sa-background-neutral, #f0f1f2);
|
|
84
84
|
}
|
|
85
|
-
.${
|
|
86
|
-
.${
|
|
85
|
+
.${Ze}:focus-visible,
|
|
86
|
+
.${Ze}[data-active="true"] {
|
|
87
87
|
background: var(--sa-background-brand-subtlest, #e6edf6);
|
|
88
88
|
}
|
|
89
|
-
.${
|
|
89
|
+
.${Ze}:focus-visible {
|
|
90
90
|
background: var(--sa-background-neutral, #f0f1f2);
|
|
91
91
|
}
|
|
92
92
|
/* Accent bar — sign of the offset picks the edge it hugs. */
|
|
93
|
-
.${
|
|
94
|
-
.${
|
|
93
|
+
.${Ze}[data-accent="left"]:focus-visible,
|
|
94
|
+
.${Ze}[data-accent="left"][data-active="true"] {
|
|
95
95
|
box-shadow: inset 3.5px 0 0 0 var(--sa-border-focused, #1a4fa0);
|
|
96
96
|
}
|
|
97
|
-
.${
|
|
98
|
-
.${
|
|
97
|
+
.${Ze}[data-accent="right"]:focus-visible,
|
|
98
|
+
.${Ze}[data-accent="right"][data-active="true"] {
|
|
99
99
|
box-shadow: inset -3.5px 0 0 0 var(--sa-border-focused, #1a4fa0);
|
|
100
100
|
}
|
|
101
|
-
.${
|
|
101
|
+
.${Ze}[data-active="true"]:hover {
|
|
102
102
|
background: var(--sa-background-brand-subtlest, #e6edf6);
|
|
103
103
|
}
|
|
104
|
-
.${
|
|
104
|
+
.${Ze}:disabled {
|
|
105
105
|
cursor: not-allowed;
|
|
106
106
|
opacity: 0.55;
|
|
107
107
|
}
|
|
108
|
-
`;function Bc(){if(typeof document>"u"||document.getElementById(Tl))return;const r=document.createElement("style");r.id=Tl,r.textContent=kc,document.head.appendChild(r)}const Ec=({active:r=!1,accentSide:t="left",onClick:o,title:n,badge:l,heading:s,meta:c,children:i,divider:a=!0,disabled:d,className:g,style:b,"aria-label":p})=>(h.useEffect(Bc,[]),e.jsx("button",{type:"button",className:[_e,g].filter(Boolean).join(" "),"data-active":r?"true":"false","data-accent":t,"data-divider":a?"true":"false","aria-current":r?"true":void 0,"aria-label":p,disabled:d,onClick:o,style:b,children:i??e.jsxs(f.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(n||l)&&e.jsxs(ae.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[n?e.jsx(S.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:n}):e.jsx("span",{}),l?e.jsx(f.Box,{style:{flexShrink:0},children:l}):null]}),s?e.jsx(S.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:s}):null,c?e.jsx(S.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:c}):null]})})),jt=18,mc=40,Ll="280ms cubic-bezier(0.4, 0, 0.2, 1)",Ol="var(--sa-border-subtle, #0b120e24)",Fc=`1px solid ${Ol}`,Al="var(--sa-background-white, #ffffff)",Mc=({children:r,header:t,collapsed:o,defaultCollapsed:n=!1,onToggle:l,width:s=337,side:c="left",offsetTop:i="var(--app-header-height, 4rem)",height:a,showToggle:d=!0,togglePosition:g="top",toggleOffset:b=40,toggleLabel:p,style:C,bodyStyle:E,className:w,pageLayout:W,overlay:L="mobile",wrapperProps:I,contentProps:k})=>{const D=Ce.useMediaQuery("md"),O=o!==void 0,[T,B]=h.useState(n),z=O?o:T,H=()=>{const ce=!z;O||B(ce),l==null||l(ce)},N=c==="left",$=typeof i=="number"?`${i}px`:i,Z=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${$})`,G=p??{collapse:"Collapse panel",expand:"Expand panel"},X=g==="center"?{top:"50%",transform:"translateY(-50%)"}:g==="bottom"?{bottom:b}:{top:b},oe=z?N?"ChevronRight":"ChevronLeft":N?"ChevronLeft":"ChevronRight",J=W!==void 0&&(L==="mobile"?!D:L),_=J?{position:"absolute",top:0,bottom:0,width:s,transform:`translateX(${z?N?"-100%":"100%":"0"})`,transition:`transform ${Ll}`,zIndex:50,...N?{left:0}:{right:0},...C}:{position:"sticky",top:$,alignSelf:"flex-start",width:z?0:s,flexShrink:0,height:Z,transition:`width ${Ll}`,...C},V=e.jsxs(f.Box,{className:w,style:_,children:[e.jsx(f.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:z?void 0:N?"border-solid-r":"border-solid-l",borderWidth:z?void 0:N?"border-r":"border-l",style:{backgroundColor:Al,borderColor:Ol},children:e.jsxs(f.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:s,customMinWidth:s,style:N?void 0:{marginLeft:"auto"},children:[t?e.jsx(f.Box,{padding:"md",style:{flexShrink:0},children:t}):null,e.jsx(f.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...E},children:r})]})}),d&&e.jsx(Fr,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:H,"aria-label":z?G.expand:G.collapse,"aria-expanded":!z,"aria-pressed":z,customWidth:jt,customHeight:mc,style:{...X,backgroundColor:Al,border:Fc,zIndex:5,...N?{right:-jt,borderLeft:"none",borderRadius:"0 8px 8px 0"}:{left:-jt,borderRight:"none",borderRadius:"8px 0 0 8px"}},children:e.jsx(F.Icon,{name:oe,size:"sm"})})]});return W===void 0?V:e.jsxs(f.Box,{direction:"row",position:"relative",...I,style:{height:`calc(100vh - ${$})`,overflow:"hidden",...(I==null?void 0:I.style)??{}},children:[!J&&N?V:null,e.jsx(f.Box,{display:"block",...k,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(k==null?void 0:k.style)??{}},children:W}),!J&&!N?V:null,J&&e.jsxs(e.Fragment,{children:[!z&&e.jsx("div",{onClick:H,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),V]})]})},Nt="--app-aside-width",Ic=r=>typeof r=="number"?`${r}px`:r,Tc=({pageLayout:r,children:t,wrapperProps:o,containerProps:n})=>{const l=Ce.useMediaQuery("md"),s=(n==null?void 0:n.customWidth)??264;return h.useLayoutEffect(()=>{const c=document.documentElement;return c.style.setProperty(Nt,l?Ic(s):"0px"),()=>c.style.removeProperty(Nt)},[l,s]),e.jsxs(f.Box,{display:"block",direction:"row",...o,style:{marginRight:l?s:24,...(o==null?void 0:o.style)??{}},children:[r,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",...n,style:{marginTop:"var(--app-header-height, 4rem)",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(n==null?void 0:n.style)??{}},children:t})]})},_t="--sa-floating-footer-height",Lc=r=>typeof r=="number"?`${r}px`:r,Oc=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:o,respectAside:n=!1,offsetRight:l,containerProps:s})=>{const c=h.useRef(null),i=l!=null?Lc(l):n?"var(--app-aside-width, 0px)":"0px";return h.useLayoutEffect(()=>{const a=document.documentElement,d=()=>{var p;const b=((p=c.current)==null?void 0:p.getBoundingClientRect().height)??0;a.style.setProperty(_t,`${b}px`)};d();const g=new ResizeObserver(d);return c.current&&g.observe(c.current),()=>{g.disconnect(),a.style.removeProperty(_t)}},[]),e.jsx(f.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 998)"},children:e.jsxs(f.Box,{ref:c,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:i,transition:"left 0.3s ease-in-out, right 0.3s ease-in-out"},justify:(s==null?void 0:s.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[t&&e.jsx(Il,{...o,customBottom:(o==null?void 0:o.customBottom)||"5.7rem"}),r]})})},Ac=({fields:r})=>e.jsx(f.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx($r,{of:r,render:(t,o)=>e.jsx(Wc,{...t},o)})}),Wc=({title:r,value:t,icon:o})=>e.jsxs(f.Box,{display:"flex",direction:"column",gap:"sm",children:[o?e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(F.Icon,{name:o,color:"subtle"}),e.jsx(S.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(S.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(S.Text,{variant:"sub-h3",children:t}):t]}),Oe={silhouette:"#A7B0AC",accent:"#78867F"};function zc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r||"100",height:t||"90",viewBox:"0 0 102 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M51.0002 16.8145C36.0811 16.8145 24.8296 21.3801 24.8296 27.4328V76.5344C24.8296 82.573 36.0799 87.127 51.0002 87.127C65.9204 87.127 77.1707 82.573 77.1707 76.5344V27.4328C77.1707 21.3801 65.9204 16.8145 51.0002 16.8145ZM51.0002 19.1582C65.0602 19.1582 74.8582 23.5187 74.8582 27.4328C74.8582 30.1363 70.1615 32.9664 63.1708 34.4746C55.861 36.0543 46.1416 36.0543 38.8318 34.4746C31.8399 32.9664 27.1432 30.1363 27.1432 27.4328C27.1432 23.5187 36.9402 19.1582 51.0002 19.1582ZM74.8582 31.9199V43.784C74.8582 46.532 70.3142 49.2941 63.2737 50.8328C63.2391 50.8375 63.2032 50.8434 63.1697 50.8504C57.6867 52.0352 50.8498 52.3305 44.6893 51.7387C42.6358 51.5418 40.6575 51.2453 38.8306 50.8504C38.8029 50.8445 38.7682 50.8387 38.7347 50.8352C32.5707 49.4898 28.318 47.2047 27.3514 44.8141C27.2138 44.4719 27.1421 44.1285 27.1421 43.7852V31.9199C27.1999 31.9715 27.2693 32.0207 27.3294 32.0723C27.5052 32.2246 27.6902 32.3758 27.8844 32.5234C27.9954 32.609 28.1064 32.6934 28.2232 32.7766C28.4371 32.9301 28.6637 33.0801 28.8973 33.2289C29.0083 33.2992 29.1135 33.3719 29.2291 33.441C29.5702 33.6473 29.9275 33.8488 30.3044 34.0434C30.3195 34.0516 30.3333 34.0598 30.3484 34.068C30.7427 34.2707 31.1601 34.4652 31.5925 34.6551C31.7301 34.716 31.8758 34.7734 32.0168 34.832C32.3221 34.9598 32.6331 35.0852 32.9557 35.207C33.1303 35.2727 33.3095 35.3359 33.4887 35.4004C33.8032 35.5117 34.1247 35.6207 34.4542 35.7273C34.6404 35.7871 34.8254 35.8469 35.015 35.9043C35.3734 36.0133 35.7434 36.1164 36.1181 36.2184C36.2915 36.2652 36.4603 36.3145 36.6361 36.3602C37.1911 36.5031 37.7588 36.6402 38.3485 36.7668C42.1595 37.5906 46.5336 38.0254 50.999 38.0254C55.4644 38.0254 59.8397 37.5906 63.6495 36.768C64.2404 36.6402 64.8092 36.5031 65.3666 36.3602C65.5377 36.3156 65.7007 36.2688 65.8684 36.223C66.2499 36.1199 66.6246 36.0145 66.9888 35.9031C67.1749 35.8469 67.3553 35.7883 67.5368 35.7309C67.8745 35.623 68.2028 35.5105 68.5243 35.3969C68.6966 35.3359 68.8677 35.275 69.0353 35.2117C69.3672 35.0863 69.6852 34.9574 69.9985 34.8262C70.1326 34.7699 70.2725 34.7148 70.4032 34.6574C70.8379 34.4664 71.2576 34.2707 71.6542 34.0668C71.66 34.0633 71.6658 34.0609 71.6716 34.0574C72.0589 33.8582 72.4243 33.6508 72.7735 33.441C72.8868 33.3719 72.9909 33.3016 73.1007 33.2313C73.3354 33.0813 73.5632 32.9312 73.7794 32.7766C73.8951 32.6934 74.0049 32.609 74.1159 32.5258C74.3102 32.377 74.4963 32.2258 74.6732 32.0723C74.7322 32.0207 74.8027 31.9727 74.8594 31.9211L74.8582 31.9199ZM74.8582 48.2887V60.1598C74.8582 62.8773 70.3396 65.6359 63.335 67.2004C63.2737 67.2051 63.2136 67.2156 63.1547 67.2285C59.5021 68.016 55.2482 68.4109 50.9955 68.4098C48.8692 68.4098 46.7428 68.3113 44.6917 68.1145C42.6405 67.9176 40.6656 67.6211 38.8399 67.2273C38.7832 67.2133 38.7266 67.2051 38.6699 67.2004C31.663 65.6359 27.1432 62.8785 27.1432 60.1598V48.2887C27.2022 48.3426 27.2739 48.393 27.3352 48.4457C27.5075 48.5945 27.6878 48.7422 27.8763 48.8875C27.9908 48.9754 28.1052 49.0633 28.2255 49.15C28.4348 49.3 28.6568 49.4477 28.8834 49.593C28.999 49.6668 29.1089 49.7418 29.228 49.8145C29.5633 50.0172 29.9136 50.2152 30.2825 50.4074C30.3114 50.4227 30.338 50.4379 30.3669 50.452C30.7507 50.6488 31.1566 50.8398 31.5775 51.0262C31.722 51.0895 31.8746 51.1504 32.0226 51.2125C32.3198 51.3379 32.6227 51.4609 32.9372 51.5793C33.1164 51.6473 33.2991 51.7129 33.4841 51.7785C33.7917 51.8887 34.1073 51.9953 34.4299 52.0996C34.6196 52.1605 34.8092 52.2227 35.0046 52.2812C35.3584 52.3891 35.7238 52.4922 36.0938 52.593C36.2684 52.641 36.4395 52.6902 36.6176 52.7359C37.1714 52.8789 37.738 53.016 38.3253 53.1426C38.3554 53.1496 38.3889 53.1555 38.4236 53.159C42.2161 53.9723 46.5636 54.4023 51.0013 54.4023C55.439 54.4023 59.7784 53.9734 63.5697 53.1613C63.6056 53.1566 63.6414 53.1508 63.6773 53.1426C64.2647 53.0148 64.8312 52.8789 65.3851 52.7359C65.5643 52.6902 65.7342 52.6398 65.9088 52.593C66.2788 52.4922 66.6442 52.3891 66.998 52.2812C67.1934 52.2215 67.3831 52.1605 67.5727 52.0996C67.8953 51.9953 68.2109 51.8887 68.5185 51.7785C68.7023 51.7129 68.8862 51.6473 69.0654 51.5793C69.3799 51.4598 69.6817 51.3367 69.98 51.2125C70.128 51.1504 70.2806 51.0895 70.4252 51.0262C70.846 50.841 71.2507 50.65 71.6357 50.452C71.6646 50.4367 71.6912 50.4215 71.7201 50.4074C72.0901 50.2152 72.4405 50.0172 72.7747 49.8145C72.8949 49.7418 73.0036 49.6668 73.1192 49.593C73.347 49.4477 73.5678 49.3 73.7771 49.15C73.8974 49.0633 74.0118 48.9766 74.1263 48.8875C74.3148 48.7422 74.4952 48.5945 74.6674 48.4457C74.7287 48.393 74.7992 48.3426 74.8582 48.2887ZM74.8582 76.5355C74.8582 80.4367 65.0602 84.7844 51.0002 84.7844C36.9402 84.7844 27.1421 80.4367 27.1421 76.5355V64.6469C27.1987 64.6984 27.2693 64.7477 27.3282 64.7992C27.5028 64.9504 27.6844 65.0992 27.8763 65.2469C27.9873 65.3324 28.0995 65.418 28.2162 65.5023C28.4302 65.6559 28.6568 65.807 28.8892 65.9559C28.9979 66.0262 29.1019 66.0977 29.2152 66.1656C29.5691 66.3801 29.9367 66.591 30.3299 66.7937C30.331 66.7937 30.3322 66.7938 30.3333 66.7961C30.7253 66.9988 31.1404 67.1945 31.5694 67.3855C31.7058 67.4465 31.8515 67.5039 31.9914 67.5637C32.2955 67.6926 32.6054 67.8191 32.928 67.9422C33.1002 68.0078 33.2772 68.0711 33.4541 68.1355C33.7674 68.248 34.0888 68.3582 34.4184 68.466C34.6034 68.5258 34.7872 68.5867 34.9768 68.6453C35.3341 68.7555 35.703 68.8609 36.0764 68.9641C36.2476 69.0109 36.4141 69.0602 36.5887 69.1059C37.1413 69.2512 37.7079 69.3895 38.2941 69.5195C38.3462 69.5312 38.3993 69.5383 38.4514 69.543C42.2369 70.3516 46.5717 70.7793 50.999 70.7793C55.4263 70.7793 59.7599 70.3527 63.5478 69.543C63.5998 69.5383 63.653 69.5312 63.705 69.5195C64.2912 69.3906 64.8578 69.2512 65.4105 69.1059C65.5839 69.0602 65.7493 69.0121 65.9192 68.9652C66.295 68.8621 66.665 68.7555 67.0246 68.6453C67.2131 68.5879 67.3958 68.5281 67.5785 68.4684C67.9092 68.3605 68.2329 68.2492 68.5486 68.1355C68.7231 68.0723 68.8977 68.009 69.0689 67.9445C69.3938 67.8203 69.7071 67.6926 70.0135 67.5625C70.1511 67.5039 70.2933 67.4477 70.4275 67.3879C71.29 67.0047 72.0774 66.5969 72.7851 66.1668C72.8972 66.0988 73.0001 66.0273 73.1088 65.9582C73.3424 65.8082 73.5702 65.657 73.7852 65.5023C73.9008 65.4191 74.0118 65.3336 74.1217 65.2492C74.3148 65.1016 74.4975 64.9516 74.6732 64.7992C74.7322 64.7488 74.8016 64.6996 74.8582 64.648V76.5355Z",fill:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.accent,fillOpacity:"0.65"})]})})}const Hc=({title:r="create",children:t,onClickAction:o,variant:n="primary",variantTitle:l,leftIcon:s,showButton:c=!0,customHeight:i,childrenButton:a,customIcon:d})=>{const g=()=>{switch(n){case"primary":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{primary:!0,onClick:o,children:a||r})});case"secondary":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{secondary:!0,iconLeft:s,onClick:o,children:l?e.jsx(S.Text,{fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||r}):r}):e.jsx(j.Button,{secondary:!0,onClick:o,children:a||r})});case"success":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{success:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{success:!0,onClick:o,children:a||r})});default:return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{primary:!0,onClick:o,children:a||r})})}};return e.jsxs(f.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:i,children:[d||e.jsx(zc,{}),e.jsx(f.Box,{direction:"column",children:t.map((b,p)=>e.jsx(Xe.Body1,{props:{align:"center",textAlign:"center"},children:p>2?null:b},p))}),c?g():null]})},ee={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function Pc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke:ee.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:ee.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:ee.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:ee.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:ee.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:ee.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:ee.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:ee.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:ee.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:ee.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:ee.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:ee.cFFFFFF,stroke:ee.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:ee.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:ee.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:ee.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:ee.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:ee.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:ee.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:ee.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:ee.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:ee.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:ee.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:ee.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:ee.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:ee.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:ee.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:ee.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:ee.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:ee.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:ee.c001A72})]})})}function Vc({onClick:r}){const t=Ce.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(Pc,{width:t?600:300}),e.jsx(S.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(S.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const se={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 jc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:se.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:se.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:se.cEFF3F8,stroke:se.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:se.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:se.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:se.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:se.c956847,stroke:se.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:se.c956847,stroke:se.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:se.cC8CEF4,stroke:se.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:se.cC8CEF4,stroke:se.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:se.cC8CEF4,stroke:se.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:se.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:se.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:se.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:se.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:se.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:se.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:se.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:se.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:se.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:se.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:se.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:se.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:se.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function Nc({onClick:r}){const t=Ce.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(jc,{width:t?600:300}),e.jsx(S.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const y={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 _c({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 287",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M406.562 180.997C406.562 148.544 412.16 122.978 423.356 104.299C434.721 85.6199 452.957 76.2803 478.063 76.2803C503.168 76.2803 521.319 85.6199 532.514 104.299C543.88 122.978 549.562 148.544 549.562 180.997C549.562 213.827 543.88 239.582 532.514 258.261C521.319 276.941 503.168 286.28 478.063 286.28C452.957 286.28 434.721 276.941 423.356 258.261C412.16 239.582 406.562 213.827 406.562 180.997ZM506.815 180.997C506.815 161.941 504.949 147.318 501.217 137.129C497.485 126.752 489.767 121.563 478.063 121.563C466.358 121.563 458.64 126.752 454.908 137.129C451.176 147.318 449.31 161.941 449.31 180.997C449.31 193.827 449.988 204.488 451.345 212.978C452.703 221.28 455.417 228.073 459.488 233.356C463.729 238.45 469.92 240.997 478.063 240.997C486.205 240.997 492.312 238.45 496.383 233.356C500.624 228.073 503.423 221.28 504.78 212.978C506.137 204.488 506.815 193.827 506.815 180.997Z",fill:y.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:y.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:y.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:y.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:y.cFFFFFF,stroke:y.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:y.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:y.cFFFFFF,stroke:y.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:y.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:y.cFFFFFF,stroke:y.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:y.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:y.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:y.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:y.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:y.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:y.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:y.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:y.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:y.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:y.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:y.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:y.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:y.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:y.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:y.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:y.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:y.c000D58,stroke:y.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:y.c000D58,stroke:y.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:y.cFFFFFF,stroke:y.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:y.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:y.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:y.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:y.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:y.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:y.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:y.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:y.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:y.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:y.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:y.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:y.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:y.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function qc({onClick:r}){const t=Ce.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(_c,{width:t?600:300}),e.jsx(S.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(S.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const Zc=r=>{var o,n,l,s,c;const t=Ce.useMediaQuery("md");return e.jsxs(Pe.Dialog,{isShow:r.isShow,onHide:r.onHide,style:{...t?{minWidth:r.customMinWidth||"458px"}:{maxWidth:r.customMinWidth||"458px"}},children:[e.jsx(Pe.DialogTitle,{...r.dialogTitleProps,children:typeof r.title=="string"?e.jsx(S.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(Pe.DialogBody,{children:typeof r.description=="string"?e.jsx(S.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:r.description}):r.description}),e.jsx(Pe.DialogFooter,{children:e.jsx(f.Box,{display:"flex",direction:((o=r.containerConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((n=r.containerConfirmBtnProps)==null?void 0:n.justify)||"flex-end",...r.containerConfirmBtnProps,children:e.jsxs(f.Box,{display:"flex",direction:((l=r.wrapperConfirmBtnProps)==null?void 0:l.direction)||"row",justify:((s=r.wrapperConfirmBtnProps)==null?void 0:s.justify)||"flex-end",gap:((c=r.wrapperConfirmBtnProps)==null?void 0:c.gap)||"sm",...r.wrapperConfirmBtnProps,children:[r.onCancel&&e.jsx(j.Button,{secondary:!0,onClick:r.onCancel,size:"md",fullWidth:!0,children:r.titleCancelBtn||"Cancel"}),e.jsx(f.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(j.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},Gc=h.memo(({children:r,height:t,minHeight:o,customHeight:n,paddingInline:l="spacing-0",paddingBlock:s="spacing-0",header:c,footer:i,title:a,titleTag:d,action:g,actionContainer:b,containerProps:p,bodyProps:C,headerProps:E={borderBottom:!0},footerProps:w={borderTop:!0},variantTag:W="info"})=>{const L=h.useRef(null),[I,k]=h.useState("100vh");h.useEffect(()=>{const B=()=>{if(L.current){const z=L.current.getBoundingClientRect().top;k(`calc(100vh - ${z}px)`)}};return B(),window.addEventListener("resize",B),()=>window.removeEventListener("resize",B)},[]);const D=()=>d?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(S.Text,{fontWeight:"medium",children:a}),e.jsx(cr.Badges,{border:!0,text:d,variant:W})]}):e.jsx(S.Text,{fontWeight:"medium",children:a}),O=()=>c||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:a?D():null}),e.jsx(f.Box,{direction:"column",...b,children:g??null})]}),T=!!(c||a||g);return e.jsxs(f.Box,{ref:L,height:t,customMinHeight:o,customHeight:n,paddingBlock:s,paddingInline:l,bg:"white",direction:"column",...p,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:I,...(p==null?void 0:p.style)??{}},children:[c!==null&&T?e.jsx(Et,{...E,children:O()}):null,e.jsx(f.Box,{direction:"column",padding:"spacing-0",...C,style:{flex:1,overflow:"auto",...(C==null?void 0:C.style)??{}},children:r}),i?e.jsx(mt,{...w,children:i}):null]})}),Qc=h.memo(({value:r,options:t=[],onChange:o,multiple:n})=>{const l=(r==null?void 0:r.map(i=>i.value))||[],s=(t==null?void 0:t.filter(i=>l.includes(i.value)))||[],c=i=>{const a=[...s];let d=[];n?d=l.includes(i.value)?a.filter(g=>g.value!==i.value):[...a,i]:d=[i],o==null||o(d)};return e.jsx(f.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:t==null?void 0:t.map((i,a)=>e.jsx(j.Button,{...l.includes(i.value)?{primary:!0}:{secondary:!0},onClick:()=>c(i),children:i.label},a))})});function Kr(r){return null}Kr.displayName="LayoutDialog.Header";function Rr(r){return null}Rr.displayName="LayoutDialog.Body";function et(r){return null}et.displayName="LayoutDialog.Aside";function rt(r){return null}rt.displayName="LayoutDialog.Footer";const He={"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"},Uc=[{mode:"sidebar",label:"Sidebar",renderIcon:()=>e.jsx(Yc,{})},{mode:"modal",label:"Modal",renderIcon:()=>e.jsx(F.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",renderIcon:()=>e.jsx(F.Icon,{name:"Fullscreen",size:"sm"})}];function Jc({value:r,onChange:t}){return e.jsx("div",{className:He["lyd-vm-group"],role:"group","aria-label":"View mode",children:Uc.map(o=>e.jsx("button",{type:"button",className:He["lyd-vm-btn"],"data-active":r===o.mode,"aria-label":`Switch to ${o.label} view`,"aria-pressed":r===o.mode,onClick:()=>t(o.mode),children:o.renderIcon()},o.mode))})}function Yc(){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 qt={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function Xc(r){return r?r in qt?qt[r]:r:qt.xl}function tt(r,t){let o=null;return h.Children.forEach(r,n=>{h.isValidElement(n)&&n.type===t&&(o=n.props.children??null)}),o}function $c(r){const{isOpen:t,onClose:o,viewMode:n,defaultViewMode:l="modal",onViewModeChange:s,showViewModeToggle:c=!0,showCloseButton:i=!0,size:a,asideWidth:d,disableEscapeClose:g=!1,disableBackdropClose:b=!1,lockBodyScroll:p=!0,children:C}=r,[E,w]=h.useState(l),W=n??E,I=Ce.useMediaQuery("md")?W:"fullscreen",k=h.useCallback(G=>{n===void 0&&w(G),s==null||s(G)},[n,s]),D=h.useRef(null);h.useEffect(()=>{if(!(!t||!p))return D.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=D.current??""}},[t,p]);const O=h.useRef(o);O.current=o,h.useEffect(()=>{if(t)return Pe.registerOverlay({onEscape:g?void 0:()=>O.current()})},[t,g]);const T=h.useMemo(()=>tt(C,Kr),[C]),B=h.useMemo(()=>tt(C,Rr),[C]),z=h.useMemo(()=>tt(C,et),[C]),H=h.useMemo(()=>tt(C,rt),[C]);if(!t)return null;const N=[He["lyd-panel"],I==="modal"&&He["lyd-modal"],I==="fullscreen"&&He["lyd-fullscreen"],I==="sidebar"&&He["lyd-sidebar"]].filter(Boolean).join(" "),$={"--lyd-max-w":Xc(a),...d!==void 0&&{"--lyd-aside-w":d}},Z=()=>{b||o()};return typeof document>"u"?null:Vr.createPortal(e.jsxs("div",{className:He["lyd-root"],style:$,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:He["lyd-backdrop"],onClick:Z,"aria-hidden":"true"}),e.jsxs("div",{className:N,children:[e.jsxs("div",{className:He["lyd-header"],children:[e.jsx("div",{className:He["lyd-header-content"],children:T}),e.jsxs("div",{className:He["lyd-header-actions"],children:[c&&e.jsx(Jc,{value:W,onChange:k}),i&&e.jsx("button",{type:"button",className:He["lyd-close-btn"],onClick:o,"aria-label":"Close dialog",children:e.jsx(F.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:He["lyd-main"],children:[e.jsx("div",{className:He["lyd-body"],children:B}),z&&e.jsx("aside",{className:He["lyd-aside"],children:z})]}),H&&e.jsx("div",{className:He["lyd-footer"],children:H})]})]}),document.body)}const Wr=$c;Wr.Header=Kr,Wr.Body=Rr,Wr.Aside=et,Wr.Footer=rt;function Kc({url:r,filename:t,onClose:o}){const n=h.useRef(o);return n.current=o,h.useEffect(()=>Pe.registerOverlay({onEscape:()=>n.current()}),[]),e.jsxs("div",{onClick:o,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:l=>l.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:r,download:t,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.15)",color:"#fff",borderRadius:"var(--sa-radii-sm, 6px)",fontSize:"13px",textDecoration:"none",backdropFilter:"blur(4px)"},children:"Download"}),e.jsx("button",{onClick:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",backgroundColor:"rgba(255,255,255,0.15)",border:"none",borderRadius:"var(--sa-radii-sm, 6px)",color:"#fff",cursor:"pointer",backdropFilter:"blur(4px)"},"aria-label":"Close preview",children:"✕"})]}),e.jsx("img",{src:r,alt:t,onClick:l=>l.stopPropagation(),style:{maxWidth:"90vw",maxHeight:"85vh",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-lg, 0 25px 50px rgba(0,0,0,0.5))"}}),e.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:t})]})}const Wl="var(--sa-border-subtle, #e5e7eb)",ot=()=>e.jsx(f.Box,{style:{width:1,height:22,backgroundColor:Wl}}),Rc=r=>typeof r=="number"?`${r}px`:r;function zl({count:r,children:t,label:o,onClear:n,clearLabel:l="Clear selection",clearDisabled:s=!1,bottom:c=20,zIndex:i=50,style:a,className:d}){if(r===0)return null;const g=typeof o=="function"?o(r):o??`${r} selected`;return e.jsx(f.Box,{direction:"row",justify:"center",style:{position:"fixed",bottom:Rc(c),left:0,right:0,zIndex:i,pointerEvents:"none"},children:e.jsxs(f.Box,{direction:"row",align:"center",gap:"xs",bg:"white",padding:"spacing-8",className:d,style:{pointerEvents:"auto",borderRadius:10,border:`1px solid ${Wl}`,boxShadow:"var(--sa-shadow-xl, 0 10px 25px -5px rgb(0 0 0/0.15))",...a},children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",whiteSpace:"nowrap",style:{paddingInline:6},children:g}),e.jsx(ot,{}),t,n&&e.jsxs(e.Fragment,{children:[e.jsx(ot,{}),e.jsx(Ie.Tooltip,{label:l,position:"top",children:e.jsx(j.Button,{variant:"tertiary",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Cross",size:"xs"}),"aria-label":l,onClick:n,disabled:s})})]})]})})}zl.Divider=ot;const lt=r=>{const{variant:t="outlined",overflow:o="hidden",style:n,children:l,...s}=r;return e.jsx(dt.Card,{variant:t,overflow:o,style:{display:"flex",flexDirection:"column",...n},...s,children:l})},ei=r=>r==null?void 0:typeof r=="number"?`${r}px`:r,Hl=({src:r,alt:t="",height:o=140,bg:n="var(--sa-background-neutral, #f0f1f2)",avatar:l,children:s})=>e.jsxs(f.Box,{style:{position:"relative",marginBottom:l?24:void 0},children:[e.jsx(f.Box,{style:{height:ei(o),background:r?void 0:n,overflow:"hidden"},children:r?e.jsx("img",{src:r,alt:t,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):null}),s?e.jsx(f.Box,{style:{position:"absolute",inset:0,pointerEvents:"none"},children:s}):null,l?e.jsx(f.Box,{style:{position:"absolute",left:16,bottom:0,transform:"translateY(50%)"},children:l}):null]}),Pl=({avatar:r,title:t,subtitle:o,action:n,divided:l=!1,children:s})=>e.jsx(f.Box,{padding:"md",style:{borderBottom:l?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:s??e.jsxs(ae.Flex,{direction:"row",align:"center",gap:"sm",children:[r,e.jsxs(f.Box,{flex:"1",style:{minWidth:0},children:[t!=null&&e.jsx(S.Text,{fontWeight:"semibold",truncate:!0,children:t}),o!=null&&e.jsx(S.Text,{fontSize:"sm",color:"subtlest",truncate:!0,children:o})]}),n!=null&&e.jsx(f.Box,{style:{flexShrink:0},children:n})]})}),Vl=({left:r,right:t,divided:o=!0,children:n})=>e.jsx(f.Box,{padding:"md",style:{marginTop:"auto",borderTop:o?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:n??e.jsxs(ae.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",children:[e.jsx(f.Box,{style:{minWidth:0},children:r}),e.jsx(f.Box,{style:{flexShrink:0},children:t})]})});lt.Media=Hl,lt.Header=Pl,lt.Footer=Vl;const ri=r=>{const{defaultTab:t=0,paramKey:o="tab"}=r||{},{useSearchParams:n}=sr(),[l,s]=n(),c=br.searchParamsToObject(l.toString());return{activeTab:c[o]?parseInt(c[o]):t,handleTabChange:d=>{s({...c,[o]:d.toString()})},searchQueries:c}};function ti({appName:r,menuConfig:t,formatTitle:o}){const{useLocation:n}=sr(),l=n();h.useEffect(()=>{let s=null,c=null;for(const d of t){const g=d.items.find(b=>b.to?b.to==="/"?l.pathname==="/":!!(b.to===l.pathname||l.pathname.startsWith(b.to+"/")):!1);if(g){s=g,c=d;break}}const i=[];s!=null&&s.title&&i.push(s.title),c!=null&&c.name&&i.push(c.name.toTitleCase());const a=(d,g)=>d.length>0?`${d.join(" - ")} | ${g}`:g;document.title=(o||a)(i,r)},[l.pathname])}const oi=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=sr(),[n,l]=r(),s=br.searchParamsToObject(n.toString()),c=t(),i=o(),a=c.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,E)=>n.has(C)&&n.get(C)===E,getQueryParam:C=>n.get(C),getRouteParam:C=>c[C],params:c,location:i,id:a,hasId:!!a}};function li(r){var n,l;const t=r.decodedAccessToken;return h.useMemo(()=>{var a,d;const s=((d=(a=t==null?void 0:t.access)==null?void 0:a.role)==null?void 0:d.code)??"",c=Object.keys(r.role).reduce((g,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,C=>C.replace("_","").toUpperCase())}`;return{...g,[p]:!1}},{});return{...Object.keys(r.role).reduce((g,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,C=>C.replace("_","").toUpperCase())}`;return{...g,[p]:s===r.role[b]}},c),hasRole:g=>s===r.role[g],getRoleKey:()=>s}},[(l=(n=t==null?void 0:t.access)==null?void 0:n.role)==null?void 0:l.code,r])}u.ASIDE_WIDTH_VAR=Nt,u.AdvanceFilterBar=Uo,u.App=rn,u.AppComponent=xo,u.AppContext=ut,u.AppLayout=cn,u.AsideBar=Tc,u.BackButton=dn,u.ColumnFilterDropdown=bl,u.ColumnHeaderFilter=vs,u.ColumnMenu=Dl,u.ConfirmationDialog=Zc,u.DataTable=Cl,u.DecisionWrapper=he,u.EachUtils=$r,u.EmptyStatePage=Hc,u.EntityCard=lt,u.EntityCardFooter=Vl,u.EntityCardHeader=Pl,u.EntityCardMedia=Hl,u.FLOATING_FOOTER_HEIGHT_VAR=_t,u.FilterBar=ns,u.FilterDrawer=Qo,u.FloatingFooter=Oc,u.ForbiddenPage=Nc,u.Form=Sc,u.FullSection=Gc,u.HeaderLeftSlot=tn,u.HeaderLeftSlotOutlet=So,u.HeaderLeftSlotProvider=Do,u.Highlight=Sl,u.HorizontalField=yn,u.ImagePreview=Kc,u.InputFile=ml,u.InputImage=Ml,u.LayoutDialog=Wr,u.LayoutDialogAside=et,u.LayoutDialogBody=Rr,u.LayoutDialogFooter=rt,u.LayoutDialogHeader=Kr,u.ModuleSwitcher=hn,u.ModuleSwitcherModal=zo,u.NotFoundPage=Vc,u.PageLayout=vn,u.Pressable=Fr,u.RightDrawer=Vo,u.SIDEBAR_DEFAULT_WIDTH=yt,u.SIDEBAR_MAX_WIDTH=bt,u.SIDEBAR_MIN_WIDTH=pt,u.ScrollToTopButton=Il,u.Section=Sn,u.SectionFooter=mt,u.SectionHeader=Et,u.SelectButton=Qc,u.SelectionActionBar=zl,u.SelectionActionBarDivider=ot,u.ServerErrorPage=qc,u.SidePanel=Mc,u.SidePanelItem=Ec,u.SidebarBadgesProvider=fo,u.SidebarGroupSlot=on,u.SidebarGroupSlotOutlet=Bo,u.SidebarGroupSlotProvider=ko,u.SidebarHeaderSlot=wo,u.SidebarProvider=po,u.StarasiaRouterProvider=Co,u.TableFooter=pl,u.TableHeader=yl,u.TableLayout=As,u.TableSection=Bs,u.TableWrapper=gl,u.ToggleStatus=Dc,u.Typography=Xe,u.VerticalField=Ac,u.clearModuleSelection=ln,u.createInitialFromUserName=js,u.cssVars=Qs,u.expandDateCompact=Cs,u.formHasChanged=Ks,u.formatDate=Zs,u.formatDateToIndonesian=El,u.formatRupiah=_s,u.getDateFilterValue=Go,u.getDateRangeFilterValue=mn,u.getInitials=qs,u.getValueDropdownMultipleFilter=Zo,u.getValueRadioFilter=En,u.getValueSearch=Zr,u.getValuesFilter=qr,u.handleChangeFilter=Ir,u.handleOnScroll=cc,u.isColumnFilterActive=ul,u.isEmail=lc,u.isFilterActive=Fn,u.isOnlyLettersAndSpaces=ec,u.isPhoneNumber=Rs,u.isSlug=nc,u.localStorageAdapter=Mt,u.oneDayInMs=Us,u.parseIndonesianDateToDate=Ns,u.preventNonCoordinateInput=sc,u.preventNonNumberAndDecimalInput=oc,u.preventNonNumberInput=rc,u.preventNumberInput=tc,u.resolveDateRangeValueToString=_o,u.resolveDateValueToString=qo,u.resolveDropdownValueToString=jo,u.resolveRadioValueToString=No,u.resolveSidebarBadge=jr,u.storageKeys=xr,u.textWidth=Js,u.useApp=gt,u.useAppState=ao,u.useAuthRole=li,u.useDynamicTitle=ti,u.useFilterBarApiParams=as,u.useFilterBarControls=hs,u.useModuleSelection=Dt,u.useRouteInfo=Ve,u.useRouteParams=oi,u.useRouterAdapter=sr,u.useSidebar=bo,u.useSidebarBadges=uo,u.useTabState=ri,u.useTableSortApiParams=Ws,Object.keys(gr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>gr[r]})}),Object.keys(Hr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Hr[r]})}),Object.keys(cr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>cr[r]})}),Object.keys(f).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>f[r]})}),Object.keys(yr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>yr[r]})}),Object.keys(j).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>j[r]})}),Object.keys(dt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>dt[r]})}),Object.keys(hr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>hr[r]})}),Object.keys(Pe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Pe[r]})}),Object.keys(Pr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Pr[r]})}),Object.keys(pr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>pr[r]})}),Object.keys(Ce).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Ce[r]})}),Object.keys(br).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>br[r]})}),Object.keys(lr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>lr[r]})}),Object.keys(A).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>A[r]})}),Object.keys(Er).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Er[r]})}),Object.keys(mr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>mr[r]})}),Object.keys(Q).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Q[r]})}),Object.keys(ro).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ro[r]})}),Object.keys(ht).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ht[r]})}),Object.keys(vr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>vr[r]})}),Object.keys(to).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>to[r]})}),Object.keys(Cr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Cr[r]})}),Object.keys(Ie).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Ie[r]})}),Object.keys(nr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>nr[r]})}),Object.keys(ft).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ft[r]})}),Object.keys(S).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>S[r]})}),Object.keys(F).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>F[r]})}),Object.keys(ae).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ae[r]})}),Object.keys(oo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>oo[r]})}),Object.keys(lo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>lo[r]})}),Object.keys(no).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>no[r]})}),Object.keys(so).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>so[r]})}),Object.keys(co).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>co[r]})}),Object.keys(Ye).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Ye[r]})}),Object.keys(io).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>io[r]})}),Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
|
108
|
+
`;function mc(){if(typeof document>"u"||document.getElementById(Al))return;const r=document.createElement("style");r.id=Al,r.textContent=Ec,document.head.appendChild(r)}const Fc=({active:r=!1,accentSide:t="left",onClick:o,title:n,badge:l,heading:s,meta:c,children:i,divider:a=!0,disabled:d,className:g,style:b,"aria-label":p})=>(h.useEffect(mc,[]),e.jsx("button",{type:"button",className:[Ze,g].filter(Boolean).join(" "),"data-active":r?"true":"false","data-accent":t,"data-divider":a?"true":"false","aria-current":r?"true":void 0,"aria-label":p,disabled:d,onClick:o,style:b,children:i??e.jsxs(f.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(n||l)&&e.jsxs(ae.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[n?e.jsx(S.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:n}):e.jsx("span",{}),l?e.jsx(f.Box,{style:{flexShrink:0},children:l}):null]}),s?e.jsx(S.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:s}):null,c?e.jsx(S.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:c}):null]})})),qt=18,Mc=40,Wl="280ms cubic-bezier(0.4, 0, 0.2, 1)",zl="var(--sa-border-subtle, #0b120e24)",Ic=`1px solid ${zl}`,Hl="var(--sa-background-white, #ffffff)",Tc=({children:r,header:t,collapsed:o,defaultCollapsed:n=!1,onToggle:l,width:s=337,side:c="left",offsetTop:i="var(--app-header-height, 4rem)",height:a,showToggle:d=!0,togglePosition:g="top",toggleOffset:b=40,toggleLabel:p,style:C,bodyStyle:E,className:w,pageLayout:W,overlay:L="mobile",wrapperProps:I,contentProps:k})=>{const D=Ce.useMediaQuery("md"),O=o!==void 0,[T,B]=h.useState(n),z=O?o:T,H=()=>{const ce=!z;O||B(ce),l==null||l(ce)},N=c==="left",K=typeof i=="number"?`${i}px`:i,Z=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${K})`,G=p??{collapse:"Collapse panel",expand:"Expand panel"},X=g==="center"?{top:"50%",transform:"translateY(-50%)"}:g==="bottom"?{bottom:b}:{top:b},oe=z?N?"ChevronRight":"ChevronLeft":N?"ChevronLeft":"ChevronRight",J=W!==void 0&&(L==="mobile"?!D:L),_=J?{position:"absolute",top:0,bottom:0,width:s,transform:`translateX(${z?N?"-100%":"100%":"0"})`,transition:`transform ${Wl}`,zIndex:50,...N?{left:0}:{right:0},...C}:{position:"sticky",top:K,alignSelf:"flex-start",width:z?0:s,flexShrink:0,height:Z,transition:`width ${Wl}`,...C},V=e.jsxs(f.Box,{className:w,style:_,children:[e.jsx(f.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:z?void 0:N?"border-solid-r":"border-solid-l",borderWidth:z?void 0:N?"border-r":"border-l",style:{backgroundColor:Hl,borderColor:zl},children:e.jsxs(f.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:s,customMinWidth:s,style:N?void 0:{marginLeft:"auto"},children:[t?e.jsx(f.Box,{padding:"md",style:{flexShrink:0},children:t}):null,e.jsx(f.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...E},children:r})]})}),d&&e.jsx(Mr,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:H,"aria-label":z?G.expand:G.collapse,"aria-expanded":!z,"aria-pressed":z,customWidth:qt,customHeight:Mc,style:{...X,backgroundColor:Hl,border:Ic,zIndex:5,...N?{right:-qt,borderLeft:"none",borderRadius:"0 8px 8px 0"}:{left:-qt,borderRight:"none",borderRadius:"8px 0 0 8px"}},children:e.jsx(F.Icon,{name:oe,size:"sm"})})]});return W===void 0?V:e.jsxs(f.Box,{direction:"row",position:"relative",...I,style:{height:`calc(100vh - ${K})`,overflow:"hidden",...(I==null?void 0:I.style)??{}},children:[!J&&N?V:null,e.jsx(f.Box,{display:"block",...k,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(k==null?void 0:k.style)??{}},children:W}),!J&&!N?V:null,J&&e.jsxs(e.Fragment,{children:[!z&&e.jsx("div",{onClick:H,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),V]})]})},Zt="--app-aside-width",Lc=r=>typeof r=="number"?`${r}px`:r,Oc=({pageLayout:r,children:t,wrapperProps:o,containerProps:n})=>{const l=Ce.useMediaQuery("md"),s=(n==null?void 0:n.customWidth)??264;return h.useLayoutEffect(()=>{const c=document.documentElement;return c.style.setProperty(Zt,l?Lc(s):"0px"),()=>c.style.removeProperty(Zt)},[l,s]),e.jsxs(f.Box,{display:"block",direction:"row",...o,style:{marginRight:l?s:24,...(o==null?void 0:o.style)??{}},children:[r,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",...n,style:{marginTop:"var(--app-header-height, 4rem)",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(n==null?void 0:n.style)??{}},children:t})]})},Gt="--sa-floating-footer-height",Ac=r=>typeof r=="number"?`${r}px`:r,Wc=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:o,respectAside:n=!1,offsetRight:l,containerProps:s})=>{const c=h.useRef(null),i=l!=null?Ac(l):n?"var(--app-aside-width, 0px)":"0px";return h.useLayoutEffect(()=>{const a=document.documentElement,d=()=>{var p;const b=((p=c.current)==null?void 0:p.getBoundingClientRect().height)??0;a.style.setProperty(Gt,`${b}px`)};d();const g=new ResizeObserver(d);return c.current&&g.observe(c.current),()=>{g.disconnect(),a.style.removeProperty(Gt)}},[]),e.jsx(f.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 998)"},children:e.jsxs(f.Box,{ref:c,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:i,transition:"left 0.3s ease-in-out, right 0.3s ease-in-out"},justify:(s==null?void 0:s.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[t&&e.jsx(Ol,{...o,customBottom:(o==null?void 0:o.customBottom)||"5.7rem"}),r]})})},zc=({fields:r})=>e.jsx(f.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(Rr,{of:r,render:(t,o)=>e.jsx(Hc,{...t},o)})}),Hc=({title:r,value:t,icon:o})=>e.jsxs(f.Box,{display:"flex",direction:"column",gap:"sm",children:[o?e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(F.Icon,{name:o,color:"subtle"}),e.jsx(S.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(S.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(S.Text,{variant:"sub-h3",children:t}):t]}),Oe={silhouette:"#A7B0AC",accent:"#78867F"};function Pc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r||"100",height:t||"90",viewBox:"0 0 102 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M51.0002 16.8145C36.0811 16.8145 24.8296 21.3801 24.8296 27.4328V76.5344C24.8296 82.573 36.0799 87.127 51.0002 87.127C65.9204 87.127 77.1707 82.573 77.1707 76.5344V27.4328C77.1707 21.3801 65.9204 16.8145 51.0002 16.8145ZM51.0002 19.1582C65.0602 19.1582 74.8582 23.5187 74.8582 27.4328C74.8582 30.1363 70.1615 32.9664 63.1708 34.4746C55.861 36.0543 46.1416 36.0543 38.8318 34.4746C31.8399 32.9664 27.1432 30.1363 27.1432 27.4328C27.1432 23.5187 36.9402 19.1582 51.0002 19.1582ZM74.8582 31.9199V43.784C74.8582 46.532 70.3142 49.2941 63.2737 50.8328C63.2391 50.8375 63.2032 50.8434 63.1697 50.8504C57.6867 52.0352 50.8498 52.3305 44.6893 51.7387C42.6358 51.5418 40.6575 51.2453 38.8306 50.8504C38.8029 50.8445 38.7682 50.8387 38.7347 50.8352C32.5707 49.4898 28.318 47.2047 27.3514 44.8141C27.2138 44.4719 27.1421 44.1285 27.1421 43.7852V31.9199C27.1999 31.9715 27.2693 32.0207 27.3294 32.0723C27.5052 32.2246 27.6902 32.3758 27.8844 32.5234C27.9954 32.609 28.1064 32.6934 28.2232 32.7766C28.4371 32.9301 28.6637 33.0801 28.8973 33.2289C29.0083 33.2992 29.1135 33.3719 29.2291 33.441C29.5702 33.6473 29.9275 33.8488 30.3044 34.0434C30.3195 34.0516 30.3333 34.0598 30.3484 34.068C30.7427 34.2707 31.1601 34.4652 31.5925 34.6551C31.7301 34.716 31.8758 34.7734 32.0168 34.832C32.3221 34.9598 32.6331 35.0852 32.9557 35.207C33.1303 35.2727 33.3095 35.3359 33.4887 35.4004C33.8032 35.5117 34.1247 35.6207 34.4542 35.7273C34.6404 35.7871 34.8254 35.8469 35.015 35.9043C35.3734 36.0133 35.7434 36.1164 36.1181 36.2184C36.2915 36.2652 36.4603 36.3145 36.6361 36.3602C37.1911 36.5031 37.7588 36.6402 38.3485 36.7668C42.1595 37.5906 46.5336 38.0254 50.999 38.0254C55.4644 38.0254 59.8397 37.5906 63.6495 36.768C64.2404 36.6402 64.8092 36.5031 65.3666 36.3602C65.5377 36.3156 65.7007 36.2688 65.8684 36.223C66.2499 36.1199 66.6246 36.0145 66.9888 35.9031C67.1749 35.8469 67.3553 35.7883 67.5368 35.7309C67.8745 35.623 68.2028 35.5105 68.5243 35.3969C68.6966 35.3359 68.8677 35.275 69.0353 35.2117C69.3672 35.0863 69.6852 34.9574 69.9985 34.8262C70.1326 34.7699 70.2725 34.7148 70.4032 34.6574C70.8379 34.4664 71.2576 34.2707 71.6542 34.0668C71.66 34.0633 71.6658 34.0609 71.6716 34.0574C72.0589 33.8582 72.4243 33.6508 72.7735 33.441C72.8868 33.3719 72.9909 33.3016 73.1007 33.2313C73.3354 33.0813 73.5632 32.9312 73.7794 32.7766C73.8951 32.6934 74.0049 32.609 74.1159 32.5258C74.3102 32.377 74.4963 32.2258 74.6732 32.0723C74.7322 32.0207 74.8027 31.9727 74.8594 31.9211L74.8582 31.9199ZM74.8582 48.2887V60.1598C74.8582 62.8773 70.3396 65.6359 63.335 67.2004C63.2737 67.2051 63.2136 67.2156 63.1547 67.2285C59.5021 68.016 55.2482 68.4109 50.9955 68.4098C48.8692 68.4098 46.7428 68.3113 44.6917 68.1145C42.6405 67.9176 40.6656 67.6211 38.8399 67.2273C38.7832 67.2133 38.7266 67.2051 38.6699 67.2004C31.663 65.6359 27.1432 62.8785 27.1432 60.1598V48.2887C27.2022 48.3426 27.2739 48.393 27.3352 48.4457C27.5075 48.5945 27.6878 48.7422 27.8763 48.8875C27.9908 48.9754 28.1052 49.0633 28.2255 49.15C28.4348 49.3 28.6568 49.4477 28.8834 49.593C28.999 49.6668 29.1089 49.7418 29.228 49.8145C29.5633 50.0172 29.9136 50.2152 30.2825 50.4074C30.3114 50.4227 30.338 50.4379 30.3669 50.452C30.7507 50.6488 31.1566 50.8398 31.5775 51.0262C31.722 51.0895 31.8746 51.1504 32.0226 51.2125C32.3198 51.3379 32.6227 51.4609 32.9372 51.5793C33.1164 51.6473 33.2991 51.7129 33.4841 51.7785C33.7917 51.8887 34.1073 51.9953 34.4299 52.0996C34.6196 52.1605 34.8092 52.2227 35.0046 52.2812C35.3584 52.3891 35.7238 52.4922 36.0938 52.593C36.2684 52.641 36.4395 52.6902 36.6176 52.7359C37.1714 52.8789 37.738 53.016 38.3253 53.1426C38.3554 53.1496 38.3889 53.1555 38.4236 53.159C42.2161 53.9723 46.5636 54.4023 51.0013 54.4023C55.439 54.4023 59.7784 53.9734 63.5697 53.1613C63.6056 53.1566 63.6414 53.1508 63.6773 53.1426C64.2647 53.0148 64.8312 52.8789 65.3851 52.7359C65.5643 52.6902 65.7342 52.6398 65.9088 52.593C66.2788 52.4922 66.6442 52.3891 66.998 52.2812C67.1934 52.2215 67.3831 52.1605 67.5727 52.0996C67.8953 51.9953 68.2109 51.8887 68.5185 51.7785C68.7023 51.7129 68.8862 51.6473 69.0654 51.5793C69.3799 51.4598 69.6817 51.3367 69.98 51.2125C70.128 51.1504 70.2806 51.0895 70.4252 51.0262C70.846 50.841 71.2507 50.65 71.6357 50.452C71.6646 50.4367 71.6912 50.4215 71.7201 50.4074C72.0901 50.2152 72.4405 50.0172 72.7747 49.8145C72.8949 49.7418 73.0036 49.6668 73.1192 49.593C73.347 49.4477 73.5678 49.3 73.7771 49.15C73.8974 49.0633 74.0118 48.9766 74.1263 48.8875C74.3148 48.7422 74.4952 48.5945 74.6674 48.4457C74.7287 48.393 74.7992 48.3426 74.8582 48.2887ZM74.8582 76.5355C74.8582 80.4367 65.0602 84.7844 51.0002 84.7844C36.9402 84.7844 27.1421 80.4367 27.1421 76.5355V64.6469C27.1987 64.6984 27.2693 64.7477 27.3282 64.7992C27.5028 64.9504 27.6844 65.0992 27.8763 65.2469C27.9873 65.3324 28.0995 65.418 28.2162 65.5023C28.4302 65.6559 28.6568 65.807 28.8892 65.9559C28.9979 66.0262 29.1019 66.0977 29.2152 66.1656C29.5691 66.3801 29.9367 66.591 30.3299 66.7937C30.331 66.7937 30.3322 66.7938 30.3333 66.7961C30.7253 66.9988 31.1404 67.1945 31.5694 67.3855C31.7058 67.4465 31.8515 67.5039 31.9914 67.5637C32.2955 67.6926 32.6054 67.8191 32.928 67.9422C33.1002 68.0078 33.2772 68.0711 33.4541 68.1355C33.7674 68.248 34.0888 68.3582 34.4184 68.466C34.6034 68.5258 34.7872 68.5867 34.9768 68.6453C35.3341 68.7555 35.703 68.8609 36.0764 68.9641C36.2476 69.0109 36.4141 69.0602 36.5887 69.1059C37.1413 69.2512 37.7079 69.3895 38.2941 69.5195C38.3462 69.5312 38.3993 69.5383 38.4514 69.543C42.2369 70.3516 46.5717 70.7793 50.999 70.7793C55.4263 70.7793 59.7599 70.3527 63.5478 69.543C63.5998 69.5383 63.653 69.5312 63.705 69.5195C64.2912 69.3906 64.8578 69.2512 65.4105 69.1059C65.5839 69.0602 65.7493 69.0121 65.9192 68.9652C66.295 68.8621 66.665 68.7555 67.0246 68.6453C67.2131 68.5879 67.3958 68.5281 67.5785 68.4684C67.9092 68.3605 68.2329 68.2492 68.5486 68.1355C68.7231 68.0723 68.8977 68.009 69.0689 67.9445C69.3938 67.8203 69.7071 67.6926 70.0135 67.5625C70.1511 67.5039 70.2933 67.4477 70.4275 67.3879C71.29 67.0047 72.0774 66.5969 72.7851 66.1668C72.8972 66.0988 73.0001 66.0273 73.1088 65.9582C73.3424 65.8082 73.5702 65.657 73.7852 65.5023C73.9008 65.4191 74.0118 65.3336 74.1217 65.2492C74.3148 65.1016 74.4975 64.9516 74.6732 64.7992C74.7322 64.7488 74.8016 64.6996 74.8582 64.648V76.5355Z",fill:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.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:Oe.accent,fillOpacity:"0.65"})]})})}const Vc=({title:r="create",children:t,onClickAction:o,variant:n="primary",variantTitle:l,leftIcon:s,showButton:c=!0,customHeight:i,childrenButton:a,customIcon:d})=>{const g=()=>{switch(n){case"primary":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{primary:!0,onClick:o,children:a||r})});case"secondary":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{secondary:!0,iconLeft:s,onClick:o,children:l?e.jsx(S.Text,{fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||r}):r}):e.jsx(j.Button,{secondary:!0,onClick:o,children:a||r})});case"success":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{success:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{success:!0,onClick:o,children:a||r})});default:return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{primary:!0,onClick:o,children:a||r})})}};return e.jsxs(f.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:i,children:[d||e.jsx(Pc,{}),e.jsx(f.Box,{direction:"column",children:t.map((b,p)=>e.jsx(Ke.Body1,{props:{align:"center",textAlign:"center"},children:p>2?null:b},p))}),c?g():null]})},ee={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function jc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke:ee.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:ee.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:ee.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:ee.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:ee.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:ee.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:ee.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:ee.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:ee.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:ee.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:ee.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:ee.cFFFFFF,stroke:ee.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:ee.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:ee.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:ee.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:ee.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:ee.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:ee.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:ee.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:ee.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:ee.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:ee.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:ee.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:ee.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:ee.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:ee.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:ee.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:ee.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:ee.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:ee.c001A72})]})})}function Nc({onClick:r}){const t=Ce.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(jc,{width:t?600:300}),e.jsx(S.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(S.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const se={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 _c({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:se.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:se.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:se.cEFF3F8,stroke:se.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:se.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:se.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:se.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:se.c956847,stroke:se.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:se.c956847,stroke:se.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:se.cC8CEF4,stroke:se.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:se.cC8CEF4,stroke:se.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:se.cC8CEF4,stroke:se.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:se.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:se.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:se.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:se.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:se.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:se.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:se.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:se.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:se.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:se.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:se.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:se.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:se.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function qc({onClick:r}){const t=Ce.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(_c,{width:t?600:300}),e.jsx(S.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const y={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 Zc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 287",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M406.562 180.997C406.562 148.544 412.16 122.978 423.356 104.299C434.721 85.6199 452.957 76.2803 478.063 76.2803C503.168 76.2803 521.319 85.6199 532.514 104.299C543.88 122.978 549.562 148.544 549.562 180.997C549.562 213.827 543.88 239.582 532.514 258.261C521.319 276.941 503.168 286.28 478.063 286.28C452.957 286.28 434.721 276.941 423.356 258.261C412.16 239.582 406.562 213.827 406.562 180.997ZM506.815 180.997C506.815 161.941 504.949 147.318 501.217 137.129C497.485 126.752 489.767 121.563 478.063 121.563C466.358 121.563 458.64 126.752 454.908 137.129C451.176 147.318 449.31 161.941 449.31 180.997C449.31 193.827 449.988 204.488 451.345 212.978C452.703 221.28 455.417 228.073 459.488 233.356C463.729 238.45 469.92 240.997 478.063 240.997C486.205 240.997 492.312 238.45 496.383 233.356C500.624 228.073 503.423 221.28 504.78 212.978C506.137 204.488 506.815 193.827 506.815 180.997Z",fill:y.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:y.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:y.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:y.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:y.cFFFFFF,stroke:y.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:y.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:y.cFFFFFF,stroke:y.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:y.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:y.cFFFFFF,stroke:y.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:y.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:y.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:y.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:y.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:y.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:y.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:y.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:y.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:y.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:y.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:y.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:y.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:y.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:y.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:y.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:y.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:y.c000D58,stroke:y.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:y.c000D58,stroke:y.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:y.cFFFFFF,stroke:y.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:y.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:y.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:y.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:y.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:y.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:y.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:y.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:y.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:y.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:y.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:y.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:y.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:y.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Gc({onClick:r}){const t=Ce.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(Zc,{width:t?600:300}),e.jsx(S.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(S.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const Qc=r=>{var o,n,l,s,c;const t=Ce.useMediaQuery("md");return e.jsxs(Ve.Dialog,{isShow:r.isShow,onHide:r.onHide,style:{...t?{minWidth:r.customMinWidth||"458px"}:{maxWidth:r.customMinWidth||"458px"}},children:[e.jsx(Ve.DialogTitle,{...r.dialogTitleProps,children:typeof r.title=="string"?e.jsx(S.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(Ve.DialogBody,{children:typeof r.description=="string"?e.jsx(S.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:r.description}):r.description}),e.jsx(Ve.DialogFooter,{children:e.jsx(f.Box,{display:"flex",direction:((o=r.containerConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((n=r.containerConfirmBtnProps)==null?void 0:n.justify)||"flex-end",...r.containerConfirmBtnProps,children:e.jsxs(f.Box,{display:"flex",direction:((l=r.wrapperConfirmBtnProps)==null?void 0:l.direction)||"row",justify:((s=r.wrapperConfirmBtnProps)==null?void 0:s.justify)||"flex-end",gap:((c=r.wrapperConfirmBtnProps)==null?void 0:c.gap)||"sm",...r.wrapperConfirmBtnProps,children:[r.onCancel&&e.jsx(j.Button,{secondary:!0,onClick:r.onCancel,size:"md",fullWidth:!0,children:r.titleCancelBtn||"Cancel"}),e.jsx(f.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(j.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},Uc=h.memo(({children:r,height:t,minHeight:o,customHeight:n,paddingInline:l="spacing-0",paddingBlock:s="spacing-0",header:c,footer:i,title:a,titleTag:d,action:g,actionContainer:b,containerProps:p,bodyProps:C,headerProps:E={borderBottom:!0},footerProps:w={borderTop:!0},variantTag:W="info"})=>{const L=h.useRef(null),[I,k]=h.useState("100vh");h.useEffect(()=>{const B=()=>{if(L.current){const z=L.current.getBoundingClientRect().top;k(`calc(100vh - ${z}px)`)}};return B(),window.addEventListener("resize",B),()=>window.removeEventListener("resize",B)},[]);const D=()=>d?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(S.Text,{fontWeight:"medium",children:a}),e.jsx(ar.Badges,{border:!0,text:d,variant:W})]}):e.jsx(S.Text,{fontWeight:"medium",children:a}),O=()=>c||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:a?D():null}),e.jsx(f.Box,{direction:"column",...b,children:g??null})]}),T=!!(c||a||g);return e.jsxs(f.Box,{ref:L,height:t,customMinHeight:o,customHeight:n,paddingBlock:s,paddingInline:l,bg:"white",direction:"column",...p,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:I,...(p==null?void 0:p.style)??{}},children:[c!==null&&T?e.jsx(Mt,{...E,children:O()}):null,e.jsx(f.Box,{direction:"column",padding:"spacing-0",...C,style:{flex:1,overflow:"auto",...(C==null?void 0:C.style)??{}},children:r}),i?e.jsx(It,{...w,children:i}):null]})}),Jc=h.memo(({value:r,options:t=[],onChange:o,multiple:n})=>{const l=(r==null?void 0:r.map(i=>i.value))||[],s=(t==null?void 0:t.filter(i=>l.includes(i.value)))||[],c=i=>{const a=[...s];let d=[];n?d=l.includes(i.value)?a.filter(g=>g.value!==i.value):[...a,i]:d=[i],o==null||o(d)};return e.jsx(f.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:t==null?void 0:t.map((i,a)=>e.jsx(j.Button,{...l.includes(i.value)?{primary:!0}:{secondary:!0},onClick:()=>c(i),children:i.label},a))})});function et(r){return null}et.displayName="LayoutDialog.Header";function rt(r){return null}rt.displayName="LayoutDialog.Body";function tt(r){return null}tt.displayName="LayoutDialog.Aside";function ot(r){return null}ot.displayName="LayoutDialog.Footer";const He={"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"},Yc=[{mode:"sidebar",label:"Sidebar",renderIcon:()=>e.jsx($c,{})},{mode:"modal",label:"Modal",renderIcon:()=>e.jsx(F.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",renderIcon:()=>e.jsx(F.Icon,{name:"Fullscreen",size:"sm"})}];function Xc({value:r,onChange:t}){return e.jsx("div",{className:He["lyd-vm-group"],role:"group","aria-label":"View mode",children:Yc.map(o=>e.jsx("button",{type:"button",className:He["lyd-vm-btn"],"data-active":r===o.mode,"aria-label":`Switch to ${o.label} view`,"aria-pressed":r===o.mode,onClick:()=>t(o.mode),children:o.renderIcon()},o.mode))})}function $c(){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 Qt={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function Kc(r){return r?r in Qt?Qt[r]:r:Qt.xl}function lt(r,t){let o=null;return h.Children.forEach(r,n=>{h.isValidElement(n)&&n.type===t&&(o=n.props.children??null)}),o}function Rc(r){const{isOpen:t,onClose:o,viewMode:n,defaultViewMode:l="modal",onViewModeChange:s,showViewModeToggle:c=!0,showCloseButton:i=!0,size:a,asideWidth:d,disableEscapeClose:g=!1,disableBackdropClose:b=!1,lockBodyScroll:p=!0,children:C}=r,[E,w]=h.useState(l),W=n??E,I=Ce.useMediaQuery("md")?W:"fullscreen",k=h.useCallback(G=>{n===void 0&&w(G),s==null||s(G)},[n,s]),D=h.useRef(null);h.useEffect(()=>{if(!(!t||!p))return D.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=D.current??""}},[t,p]);const O=h.useRef(o);O.current=o,h.useEffect(()=>{if(t)return Ve.registerOverlay({onEscape:g?void 0:()=>O.current()})},[t,g]);const T=h.useMemo(()=>lt(C,et),[C]),B=h.useMemo(()=>lt(C,rt),[C]),z=h.useMemo(()=>lt(C,tt),[C]),H=h.useMemo(()=>lt(C,ot),[C]);if(!t)return null;const N=[He["lyd-panel"],I==="modal"&&He["lyd-modal"],I==="fullscreen"&&He["lyd-fullscreen"],I==="sidebar"&&He["lyd-sidebar"]].filter(Boolean).join(" "),K={"--lyd-max-w":Kc(a),...d!==void 0&&{"--lyd-aside-w":d}},Z=()=>{b||o()};return typeof document>"u"?null:Nr.createPortal(e.jsxs("div",{className:He["lyd-root"],style:K,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:He["lyd-backdrop"],onClick:Z,"aria-hidden":"true"}),e.jsxs("div",{className:N,children:[e.jsxs("div",{className:He["lyd-header"],children:[e.jsx("div",{className:He["lyd-header-content"],children:T}),e.jsxs("div",{className:He["lyd-header-actions"],children:[c&&e.jsx(Xc,{value:W,onChange:k}),i&&e.jsx("button",{type:"button",className:He["lyd-close-btn"],onClick:o,"aria-label":"Close dialog",children:e.jsx(F.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:He["lyd-main"],children:[e.jsx("div",{className:He["lyd-body"],children:B}),z&&e.jsx("aside",{className:He["lyd-aside"],children:z})]}),H&&e.jsx("div",{className:He["lyd-footer"],children:H})]})]}),document.body)}const zr=Rc;zr.Header=et,zr.Body=rt,zr.Aside=tt,zr.Footer=ot;function ei({url:r,filename:t,onClose:o}){const n=h.useRef(o);return n.current=o,h.useEffect(()=>Ve.registerOverlay({onEscape:()=>n.current()}),[]),e.jsxs("div",{onClick:o,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:l=>l.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:r,download:t,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.15)",color:"#fff",borderRadius:"var(--sa-radii-sm, 6px)",fontSize:"13px",textDecoration:"none",backdropFilter:"blur(4px)"},children:"Download"}),e.jsx("button",{onClick:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",backgroundColor:"rgba(255,255,255,0.15)",border:"none",borderRadius:"var(--sa-radii-sm, 6px)",color:"#fff",cursor:"pointer",backdropFilter:"blur(4px)"},"aria-label":"Close preview",children:"✕"})]}),e.jsx("img",{src:r,alt:t,onClick:l=>l.stopPropagation(),style:{maxWidth:"90vw",maxHeight:"85vh",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-lg, 0 25px 50px rgba(0,0,0,0.5))"}}),e.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:t})]})}const Pl="var(--sa-border-subtle, #e5e7eb)",nt=()=>e.jsx(f.Box,{style:{width:1,height:22,backgroundColor:Pl}}),ri=r=>typeof r=="number"?`${r}px`:r;function Vl({count:r,children:t,label:o,onClear:n,clearLabel:l="Clear selection",clearDisabled:s=!1,bottom:c=20,zIndex:i=50,style:a,className:d}){if(r===0)return null;const g=typeof o=="function"?o(r):o??`${r} selected`;return e.jsx(f.Box,{direction:"row",justify:"center",style:{position:"fixed",bottom:ri(c),left:0,right:0,zIndex:i,pointerEvents:"none"},children:e.jsxs(f.Box,{direction:"row",align:"center",gap:"xs",bg:"white",padding:"spacing-8",className:d,style:{pointerEvents:"auto",borderRadius:10,border:`1px solid ${Pl}`,boxShadow:"var(--sa-shadow-xl, 0 10px 25px -5px rgb(0 0 0/0.15))",...a},children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",whiteSpace:"nowrap",style:{paddingInline:6},children:g}),e.jsx(nt,{}),t,n&&e.jsxs(e.Fragment,{children:[e.jsx(nt,{}),e.jsx(Me.Tooltip,{label:l,position:"top",children:e.jsx(j.Button,{variant:"tertiary",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Cross",size:"xs"}),"aria-label":l,onClick:n,disabled:s})})]})]})})}Vl.Divider=nt;const st=r=>{const{variant:t="outlined",overflow:o="hidden",style:n,children:l,...s}=r;return e.jsx(ft.Card,{variant:t,overflow:o,style:{display:"flex",flexDirection:"column",...n},...s,children:l})},ti=r=>r==null?void 0:typeof r=="number"?`${r}px`:r,jl=({src:r,alt:t="",height:o=140,bg:n="var(--sa-background-neutral, #f0f1f2)",avatar:l,children:s})=>e.jsxs(f.Box,{style:{position:"relative",marginBottom:l?24:void 0},children:[e.jsx(f.Box,{style:{height:ti(o),background:r?void 0:n,overflow:"hidden"},children:r?e.jsx("img",{src:r,alt:t,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):null}),s?e.jsx(f.Box,{style:{position:"absolute",inset:0,pointerEvents:"none"},children:s}):null,l?e.jsx(f.Box,{style:{position:"absolute",left:16,bottom:0,transform:"translateY(50%)"},children:l}):null]}),Nl=({avatar:r,title:t,subtitle:o,action:n,divided:l=!1,children:s})=>e.jsx(f.Box,{padding:"md",style:{borderBottom:l?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:s??e.jsxs(ae.Flex,{direction:"row",align:"center",gap:"sm",children:[r,e.jsxs(f.Box,{flex:"1",style:{minWidth:0},children:[t!=null&&e.jsx(S.Text,{fontWeight:"semibold",truncate:!0,children:t}),o!=null&&e.jsx(S.Text,{fontSize:"sm",color:"subtlest",truncate:!0,children:o})]}),n!=null&&e.jsx(f.Box,{style:{flexShrink:0},children:n})]})}),_l=({left:r,right:t,divided:o=!0,children:n})=>e.jsx(f.Box,{padding:"md",style:{marginTop:"auto",borderTop:o?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:n??e.jsxs(ae.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",children:[e.jsx(f.Box,{style:{minWidth:0},children:r}),e.jsx(f.Box,{style:{flexShrink:0},children:t})]})});st.Media=jl,st.Header=Nl,st.Footer=_l;const oi=r=>{const{defaultTab:t=0,paramKey:o="tab"}=r||{},{useSearchParams:n}=cr(),[l,s]=n(),c=Cr.searchParamsToObject(l.toString());return{activeTab:c[o]?parseInt(c[o]):t,handleTabChange:d=>{s({...c,[o]:d.toString()})},searchQueries:c}};function li({appName:r,menuConfig:t,formatTitle:o}){const{useLocation:n}=cr(),l=n();h.useEffect(()=>{let s=null,c=null;for(const d of t){const g=d.items.find(b=>b.to?b.to==="/"?l.pathname==="/":!!(b.to===l.pathname||l.pathname.startsWith(b.to+"/")):!1);if(g){s=g,c=d;break}}const i=[];s!=null&&s.title&&i.push(s.title),c!=null&&c.name&&i.push(c.name.toTitleCase());const a=(d,g)=>d.length>0?`${d.join(" - ")} | ${g}`:g;document.title=(o||a)(i,r)},[l.pathname])}const ni=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=cr(),[n,l]=r(),s=Cr.searchParamsToObject(n.toString()),c=t(),i=o(),a=c.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,E)=>n.has(C)&&n.get(C)===E,getQueryParam:C=>n.get(C),getRouteParam:C=>c[C],params:c,location:i,id:a,hasId:!!a}};function si(r){var n,l;const t=r.decodedAccessToken;return h.useMemo(()=>{var a,d;const s=((d=(a=t==null?void 0:t.access)==null?void 0:a.role)==null?void 0:d.code)??"",c=Object.keys(r.role).reduce((g,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,C=>C.replace("_","").toUpperCase())}`;return{...g,[p]:!1}},{});return{...Object.keys(r.role).reduce((g,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,C=>C.replace("_","").toUpperCase())}`;return{...g,[p]:s===r.role[b]}},c),hasRole:g=>s===r.role[g],getRoleKey:()=>s}},[(l=(n=t==null?void 0:t.access)==null?void 0:n.role)==null?void 0:l.code,r])}u.ASIDE_WIDTH_VAR=Zt,u.AdvanceFilterBar=Xo,u.App=on,u.AppComponent=So,u.AppContext=yt,u.AppLayout=dn,u.AsideBar=Oc,u.BackButton=fn,u.ColumnFilterDropdown=xl,u.ColumnHeaderFilter=xs,u.ColumnMenu=Bl,u.ConfirmationDialog=Qc,u.DataTable=Dl,u.DecisionWrapper=he,u.EachUtils=Rr,u.EmptyStatePage=Vc,u.EntityCard=st,u.EntityCardFooter=_l,u.EntityCardHeader=Nl,u.EntityCardMedia=jl,u.FLOATING_FOOTER_HEIGHT_VAR=Gt,u.FilterBar=cs,u.FilterDrawer=Yo,u.FloatingFooter=Wc,u.ForbiddenPage=qc,u.Form=Bc,u.FullSection=Uc,u.HeaderLeftSlot=ln,u.HeaderLeftSlotOutlet=Eo,u.HeaderLeftSlotProvider=Bo,u.Highlight=El,u.HorizontalField=bn,u.ImagePreview=ei,u.InputFile=Il,u.InputImage=Ll,u.LayoutDialog=zr,u.LayoutDialogAside=tt,u.LayoutDialogBody=rt,u.LayoutDialogFooter=ot,u.LayoutDialogHeader=et,u.ModuleSwitcher=un,u.ModuleSwitcherModal=Vo,u.NotFoundPage=Nc,u.PageLayout=xn,u.Pressable=Mr,u.RightDrawer=_o,u.SIDEBAR_DEFAULT_WIDTH=bt,u.SIDEBAR_MAX_WIDTH=Ct,u.SIDEBAR_MIN_WIDTH=vt,u.ScrollToTopButton=Ol,u.Section=Bn,u.SectionFooter=It,u.SectionHeader=Mt,u.SelectButton=Jc,u.SelectionActionBar=Vl,u.SelectionActionBarDivider=nt,u.ServerErrorPage=Gc,u.SidePanel=Tc,u.SidePanelItem=Fc,u.SidebarBadgesProvider=yo,u.SidebarGroupSlot=nn,u.SidebarGroupSlotOutlet=St,u.SidebarGroupSlotProvider=mo,u.SidebarHeaderSlot=ko,u.SidebarProvider=Co,u.StarasiaRouterProvider=Do,u.TableFooter=Cl,u.TableHeader=vl,u.TableLayout=zs,u.TableSection=ms,u.TableWrapper=bl,u.ToggleStatus=kc,u.Typography=Ke,u.VerticalField=zc,u.clearModuleSelection=sn,u.createInitialFromUserName=_s,u.cssVars=Js,u.expandDateCompact=ws,u.formHasChanged=ec,u.formatDate=Qs,u.formatDateToIndonesian=Ml,u.formatRupiah=Zs,u.getDateFilterValue=Jo,u.getDateRangeFilterValue=Mn,u.getInitials=Gs,u.getValueDropdownMultipleFilter=Uo,u.getValueRadioFilter=Fn,u.getValueSearch=Qr,u.getValuesFilter=Gr,u.handleChangeFilter=Tr,u.handleOnScroll=ac,u.isColumnFilterActive=pl,u.isEmail=sc,u.isFilterActive=In,u.isOnlyLettersAndSpaces=tc,u.isPhoneNumber=rc,u.isSlug=cc,u.localStorageAdapter=Lt,u.oneDayInMs=Ys,u.parseIndonesianDateToDate=qs,u.preventNonCoordinateInput=ic,u.preventNonNumberAndDecimalInput=nc,u.preventNonNumberInput=oc,u.preventNumberInput=lc,u.resolveDateRangeValueToString=Go,u.resolveDateValueToString=Qo,u.resolveDropdownValueToString=qo,u.resolveRadioValueToString=Zo,u.resolveSidebarBadge=_r,u.storageKeys=Dr,u.textWidth=Xs,u.useApp=pt,u.useAppState=uo,u.useAuthRole=si,u.useDynamicTitle=li,u.useFilterBarApiParams=hs,u.useFilterBarControls=us,u.useModuleSelection=Bt,u.useRouteInfo=je,u.useRouteParams=ni,u.useRouterAdapter=cr,u.useSidebar=xo,u.useSidebarBadges=po,u.useTabState=oi,u.useTableSortApiParams=Hs,Object.keys(pr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>pr[r]})}),Object.keys(Vr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Vr[r]})}),Object.keys(ar).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ar[r]})}),Object.keys(f).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>f[r]})}),Object.keys(br).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>br[r]})}),Object.keys(j).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>j[r]})}),Object.keys(ft).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ft[r]})}),Object.keys(ur).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ur[r]})}),Object.keys(Ve).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Ve[r]})}),Object.keys(jr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>jr[r]})}),Object.keys(vr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>vr[r]})}),Object.keys(Ce).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Ce[r]})}),Object.keys(Cr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Cr[r]})}),Object.keys(nr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>nr[r]})}),Object.keys(A).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>A[r]})}),Object.keys(mr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>mr[r]})}),Object.keys(Fr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Fr[r]})}),Object.keys(Q).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Q[r]})}),Object.keys(lo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>lo[r]})}),Object.keys(ut).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ut[r]})}),Object.keys(xr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>xr[r]})}),Object.keys(no).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>no[r]})}),Object.keys(wr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>wr[r]})}),Object.keys(Me).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Me[r]})}),Object.keys(sr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>sr[r]})}),Object.keys(gt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>gt[r]})}),Object.keys(S).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>S[r]})}),Object.keys(F).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>F[r]})}),Object.keys(ae).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ae[r]})}),Object.keys(so).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>so[r]})}),Object.keys(co).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>co[r]})}),Object.keys(io).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>io[r]})}),Object.keys(ao).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ao[r]})}),Object.keys(ho).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ho[r]})}),Object.keys($e).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>$e[r]})}),Object.keys(fo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>fo[r]})}),Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|