@starasia/admin 8.4.3 → 8.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/FilterBar/FilterBar.d.ts +2 -1
- package/dist/components/FilterBar/types.d.ts +7 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +1211 -1209
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const mr=require("@starasia/alert"),_e=require("@starasia/badges"),h=require("@starasia/box"),rt=require("@starasia/breadcrumb"),z=require("@starasia/button"),gr=require("@starasia/card"),Xe=require("@starasia/date"),Oe=require("@starasia/dialog"),kt=require("@starasia/drawer"),ot=require("@starasia/dropdown"),ge=require("@starasia/hooks"),it=require("@starasia/http"),qe=require("@starasia/input"),I=require("@starasia/menu"),ut=require("@starasia/pagination"),dt=require("@starasia/storage"),Q=require("@starasia/table"),yr=require("@starasia/tabs"),Xt=require("@starasia/textarea"),nt=require("@starasia/theme"),pr=require("@starasia/toast"),st=require("@starasia/toggle"),Ce=require("@starasia/tooltip"),lt=require("@starasia/checkbox"),Kt=require("@starasia/radio"),w=require("@starasia/text"),B=require("@starasia/icon"),oe=require("@starasia/flex"),jr=require("@starasia/grid"),br=require("@starasia/progress"),Cr=require("@starasia/stepper"),vr=require("@starasia/accordion"),wr=require("@starasia/story-record"),ze=require("@starasia/skeleton"),Dr=require("@starasia/progress-stepper"),e=require("react/jsx-runtime"),u=require("react"),me=require("react-router"),tr=require("react-dom"),qn=require("react-easy-crop"),Zn={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},rr=u.createContext(Zn),nr=()=>u.useContext(rr),Gr=t=>{const[r,n]=u.useState((t==null?void 0:t.initialUserData)||null);return{userData:r,setUserData:n}},Qr=u.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),Ur=({children:t})=>{const[r,n]=u.useState({}),i=u.useCallback(l=>{n(a=>typeof l=="function"?l(a):l)},[]),o=u.useCallback((l,a)=>{n(d=>{const f=typeof a=="function"?a(d[l]):a;return{...d,[l]:f}})},[]),s=u.useCallback(l=>{n(a=>{if(!(l in a))return a;const d={...a};return delete d[l],d})},[]),c=u.useMemo(()=>({badges:r,setBadge:o,setBadges:i,clearBadge:s}),[r,o,i,s]);return e.jsx(Qr.Provider,{value:c,children:t})},Jr=()=>u.useContext(Qr),wt=(t,r)=>{const n=r!==void 0?r:t;return n==null?null:typeof n=="string"||typeof n=="number"?{value:n}:n},Yr=({router:t,menus:r=[],menuBottom:n,logo:i,appName:o="Workspace",initialUserData:s,theme:c})=>{const l=Gr({initialUserData:s}),{theme:a}=nt.useTheme();return e.jsx(rr.Provider,{value:{logo:i,appName:o,menus:r,userData:l.userData,setUserData:l.setUserData,menuBottom:n},children:e.jsx(Ur,{children:c?e.jsx(nt.ThemeProvider,{value:c,children:t}):a?e.jsx(nt.ThemeProvider,{value:a,children:t}):t})})},Gn=u.memo(Yr);function Xr({collapsed:t=!1,children:r}){if(!r)return null;const n=typeof r=="function",i=n?r({collapsed:t}):r;return i==null||i===!1?null:e.jsx("div",{style:{position:"sticky",top:"4rem",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:"0.5rem",paddingRight:"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:n?i:e.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.3s",visibility:t?"hidden":"visible"},children:i})})}const or=u.createContext(null);function Kr({children:t}){const[r,n]=u.useState(null),[i,o]=u.useState(null),[s,c]=u.useState(null),[l,a]=u.useState(0),d=u.useCallback(()=>(a(f=>f+1),()=>a(f=>f-1)),[]);return e.jsx(or.Provider,{value:{prependNode:r,appendNode:i,replaceNode:s,setPrependNode:n,setAppendNode:o,setReplaceNode:c,replaceCount:l,registerReplace:d},children:t})}function $r({children:t}){const r=u.useContext(or);return r?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:r.setPrependNode,style:{display:"contents"}}),r.replaceCount>0?e.jsx("div",{ref:r.setReplaceNode,style:{display:"contents"}}):t,e.jsx("div",{ref:r.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:t})}function Qn({children:t,mode:r="append"}){const n=u.useContext(or);if(u.useEffect(()=>{if(!(r!=="replace"||!n))return n.registerReplace()},[r,n]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const i=r==="prepend"?n.prependNode:r==="replace"?n.replaceNode:n.appendNode;return i?tr.createPortal(t,i):null}const ir=u.createContext(null);function en({children:t}){const[r,n]=u.useState({}),[i,o]=u.useState({}),s=u.useCallback((a,d)=>{n(f=>f[a]===d?f:{...f,[a]:d})},[]),c=u.useCallback(a=>(o(d=>({...d,[a]:(d[a]??0)+1})),()=>o(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),l=u.useMemo(()=>({outletNodes:r,setOutletNode:s,slotCounts:i,registerSlot:c}),[r,s,i,c]);return e.jsx(ir.Provider,{value:l,children:t})}function tn({slotKey:t,fallback:r}){const n=u.useContext(ir),i=n?(n.slotCounts[t]??0)>0:!1,o=u.useRef(n==null?void 0:n.setOutletNode);o.current=n==null?void 0:n.setOutletNode;const s=u.useCallback(c=>{var l;return(l=o.current)==null?void 0:l.call(o,t,c)},[t]);return e.jsx(e.Fragment,{children:i?e.jsx("div",{ref:s,style:{display:"contents"}}):r})}function Un({slotKey:t,children:r}){const n=u.useContext(ir),i=u.useRef(n==null?void 0:n.registerSlot);if(i.current=n==null?void 0:n.registerSlot,u.useEffect(()=>{var s;return(s=i.current)==null?void 0:s.call(i,t)},[t]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const o=n.outletNodes[t];return o?tr.createPortal(r,o):null}const Bt="moduleSwitcherGroupId",$t="sa-module-switcher-change";function Sr(){if(typeof window>"u")return null;const t=window.localStorage.getItem(Bt);if(t===null)return null;const r=Number(t);return Number.isFinite(r)?r:null}function rn(t){typeof window>"u"||(t===null?window.localStorage.removeItem(Bt):window.localStorage.setItem(Bt,String(t)),window.dispatchEvent(new CustomEvent($t,{detail:t})))}function Jn(){rn(null)}function sr(){const[t,r]=u.useState(()=>Sr());return u.useEffect(()=>{const i=()=>{r(Sr())},o=s=>{s.key===Bt&&i()};return window.addEventListener($t,i),window.addEventListener("storage",o),()=>{window.removeEventListener($t,i),window.removeEventListener("storage",o)}},[]),{selectedGroupId:t,setSelectedGroupId:i=>{rn(i),r(i)}}}let gt=0,Ye=!1,kr=new Set;const Br=()=>e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"1.667",y:"1.667",width:"12.667",height:"12.667",rx:"2"}),e.jsx("line",{x1:"6",y1:"1.667",x2:"6",y2:"14.333"})]}),Fr={width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",paddingLeft:"0.75rem",paddingRight:"0.75rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",fontSize:"0.875rem",color:"var(--sa-text-subtle, #8c8f97)",background:"transparent",border:"none",borderRadius:"0.375rem",cursor:"pointer",textAlign:"left"};function Yn({children:t,headerLeftSlot:r,profile:n,isLoadingProfile:i,onLogout:o,isLoggingOut:s,loadingComponent:c,sidebarHeaderContent:l,headerActions:a,profileRole:d,profileMenuButtons:f,profileMenuItems:g,logoutButton:m}){var Me,Ze;const[j]=me.useSearchParams(),L=j.get("embed")==="true",y=nr(),{badges:D}=Jr(),E=me.useNavigate(),v=me.useLocation(),b=!ge.useMediaQuery("md"),[R,O]=u.useState(!1),[C,F]=u.useState(!1),[H,Z]=u.useState(!1),[N,X]=u.useState(!1),[se,he]=u.useState(()=>new Set(kr)),[te,ae]=u.useState(null),{selectedGroupId:K,setSelectedGroupId:P}=sr();u.useEffect(()=>{kr=se},[se]);const re=u.useRef(null),le=u.useRef(null);u.useEffect(()=>{const S=re.current;if(!S)return;const G=()=>{Ye||(gt=S.scrollTop)};return S.addEventListener("scroll",G),()=>S.removeEventListener("scroll",G)},[]);const ue=()=>{const S=re.current;S&>>0&&(Ye=!0,S.scrollTop=gt,requestAnimationFrame(()=>{Ye=!1}))};u.useLayoutEffect(()=>{Ye=!0,ue();const S=setTimeout(()=>{Ye=!1},300);return()=>clearTimeout(S)},[]),u.useLayoutEffect(()=>{y.menus.length>0&&(gt>0?ue():requestAnimationFrame(()=>{var G;const S=(G=re.current)==null?void 0:G.querySelector("[data-menu-active='true']");S&&S.scrollIntoView({block:"center",behavior:"instant"})}))},[y.menus]),u.useEffect(()=>{Ye=!0,ue();const S=setTimeout(ue,0),G=setTimeout(ue,50),_=setTimeout(ue,100),M=setTimeout(ue,200),A=setTimeout(()=>{Ye=!1},300),V=setTimeout(()=>{const q=re.current,Y=q==null?void 0:q.querySelector("[data-menu-active='true']");if(q&&Y){const pe=q.getBoundingClientRect(),we=Y.getBoundingClientRect();we.top>=pe.top&&we.bottom<=pe.bottom||Y.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(S),clearTimeout(G),clearTimeout(_),clearTimeout(M),clearTimeout(A),clearTimeout(V)}},[v.pathname]),u.useEffect(()=>{le.current&&(le.current.scrollTop=0)},[v.pathname]),u.useEffect(()=>{b&&Z(!1)},[v.pathname,b]),u.useEffect(()=>{b&&F(!0)},[b]);const ke=()=>{O(!0)},Ee=()=>{O(!1)},xe=()=>{O(!1),o()},Be=S=>{const G=[S.to];return S.children&&G.push(...S.children.map(_=>_.to)),G},He=[...y.menus.flatMap(S=>S.items.flatMap(Be)),...((Me=y.menuBottom)==null?void 0:Me.flatMap(Be))??[]],je=S=>{if(!v.pathname.startsWith(S))return!1;const G=He.filter(_=>v.pathname.startsWith(_)).sort((_,M)=>M.length-_.length)[0];return S===G};u.useEffect(()=>{var G;const S=_=>{var M;(M=_.children)!=null&&M.some(A=>v.pathname.startsWith(A.to))&&he(A=>{const V=new Set(A);return V.add(_.id),V})};y.menus.forEach(_=>{_.items.forEach(S)}),(G=y.menuBottom)==null||G.forEach(S)},[v.pathname,y.menus,y.menuBottom]);const Pe=S=>{he(G=>{const _=new Set(G);return _.has(S)?_.delete(S):_.add(S),_})};u.useEffect(()=>{y.menus.length!==0&&K!==null&&!y.menus.some(S=>S.id===K)&&P(null)},[y.menus,K,P]);const Ve=u.useMemo(()=>{if(K!==null)return y.menus.filter(_=>_.id===K||_.parentGroupId===K);const S=y.menus.filter(_=>_.parentGroupId===void 0),G=y.menus.filter(_=>_.parentGroupId!==void 0).flatMap(_=>_.items);return G.length===0?S:[...S,{id:18,name:"Pengaturan",items:G,parentGroupId:void 0}]},[y.menus,K]);if(L)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:t||e.jsx(me.Outlet,{})});const ye=S=>{const G=S.children&&S.children.length>0,_=se.has(S.id),M=G?S.children.some(q=>je(q.to)):je(S.to),A=wt(S.badge,D[S.id]),V=!!A&&C&&!b;return e.jsxs("div",{"data-menu-active":M||void 0,children:[e.jsxs("button",{onClick:q=>{if(G)if(C&&!b){const Y=q.currentTarget.getBoundingClientRect();ae({item:S,top:Y.top,left:Y.right+8})}else Pe(S.id);else E(S.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:C&&!b?"center":void 0,gap:"0.5rem",paddingLeft:C&&!b?"0":"0.5rem",paddingRight:C&&!b?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:M?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:M?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:M?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:C&&!b?S.title:void 0,onMouseEnter:q=>{M||(q.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:q=>{M||(q.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(B.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),V&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:"-2px",right:"-2px",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-error-500, #ff4d6d)",border:"1px solid var(--sa-background-primary, #ffffff)"}})]}),(!C||b)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",transition:"opacity 0.3s",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:S.title}),A&&e.jsx(_e.Badges,{text:String(A.value),variant:A.variant??"info",size:"xs",border:!0}),G&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:_?"rotate(180deg)":"rotate(0deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),G&&(!C||b)&&(()=>{const q=S.children.findIndex(Y=>je(Y.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:_?`${S.children.length*36}px`:"0px",opacity:_?1:0,marginTop:_?"0.25rem":"0px"},children:[e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"1.5px",height:"100%",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),q>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${q*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),S.children.map(Y=>{const pe=wt(Y.badge,D[Y.id]);return e.jsxs("button",{onClick:()=>E(Y.to),style:{width:"100%",display:"flex",alignItems:"center",gap:"0.5rem",paddingLeft:"0.75rem",paddingRight:"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:je(Y.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:je(Y.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:je(Y.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:je(Y.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:we=>{je(Y.to)||(we.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:we=>{je(Y.to)||(we.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(B.Icon,{name:Y.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:Y.title}),pe&&e.jsx(_e.Badges,{text:String(pe.value),variant:pe.variant??"info",size:"xs",border:!0})]},Y.id)})]})})()]},S.id)};return e.jsx(en,{children:e.jsxs(Kr,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":b?"0px":C?"4.375rem":"16.375rem","--app-footer-zindex":b&&H?"40":"999"},children:[b&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:H?.5:0,pointerEvents:H?"auto":"none",transition:"opacity 0.3s"},onClick:()=>Z(!1)}),e.jsxs("aside",{style:{width:b?"16.375rem":C?"4.375rem":"16.375rem",position:b?"fixed":"relative",...b&&{inset:0,zIndex:50,transform:H?"translateX(0)":"translateX(-100%)"},backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",borderRight:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",flexDirection:"column",transition:"all 0.3s ease-in-out",flexShrink:b?void 0:0},children:[e.jsx("div",{onMouseEnter:()=>X(!0),onMouseLeave:()=>X(!1),style:{height:"4rem",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",position:"relative"},children:(()=>{const S=!b&&C&&!H,G=S&&N;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:S?1:void 0,justifyContent:S?"center":void 0,transition:"opacity 0.2s",opacity:G?0:1,pointerEvents:G?"none":"auto"},children:[e.jsx("img",{src:y.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!C||H)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:y.appName})]}),!b&&!C&&e.jsx("button",{type:"button",onClick:()=>F(!0),"aria-label":"Collapse sidebar",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1rem",height:"1rem",padding:0,background:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer",flexShrink:0},children:e.jsx(Br,{})}),S&&e.jsx("button",{type:"button",onClick:()=>F(!1),"aria-label":"Expand sidebar",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2rem",height:"2rem",padding:0,background:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-sm, 0.375rem)",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer",opacity:G?1:0,pointerEvents:G?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(Br,{})})}),b&&e.jsx("button",{onClick:()=>Z(!1),"aria-label":"Close menu",style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.25rem",height:"1.25rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})()}),l&&e.jsx(Xr,{collapsed:b?!1:C,children:l}),e.jsx("div",{ref:re,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:Ve.map(S=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!C||b?S.name&&e.jsx("div",{style:{paddingLeft:"1.5rem",paddingRight:"1rem",paddingTop:"0rem",paddingBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"400",color:"var(--sa-text-subtlest, #6b6e76)",transition:"opacity 0.3s",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:S.name}):S.name&&e.jsx("div",{"aria-label":S.name,style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"0.75rem",paddingBottom:"0.75rem"},children:e.jsx("span",{style:{display:"block",width:"1rem",height:"2px",borderRadius:"1px",backgroundColor:S.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx("div",{style:{paddingLeft:"1rem",paddingRight:"1rem",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)"},children:S.slotKey?e.jsx(tn,{slotKey:S.slotKey,fallback:S.items.map(G=>ye(G))}):S.items.map(G=>ye(G))})]},S.id))}),y.menuBottom&&y.menuBottom.length>0&&e.jsx("div",{style:{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",paddingTop:"0.75rem",paddingBottom:"0.75rem",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)",flexShrink:0},children:y.menuBottom.map(S=>ye(S))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("header",{style:{height:"4rem",backgroundColor:"var(--sa-background-primary, #ffffff)",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[b&&e.jsx("button",{onClick:()=>Z(!0),style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.5rem",height:"1.5rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),e.jsx($r,{children:r})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[a,e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[e.jsxs("div",{style:{textAlign:"right",maxWidth:"12.5rem"},children:[e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:500,color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i?"Loading...":(n==null?void 0:n.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i?"":(n==null?void 0:n.email)||"unknown"})]}),e.jsx("div",{style:{width:"2.5rem",height:"2.5rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"0.875rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",flexShrink:0,backgroundColor:"var(--sa-background-brand, #04254f)"},children:((n==null?void 0:n.name)||"U")[0].toUpperCase()}),e.jsx(B.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(I.MenuLists,{style:{width:"280px",paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(I.MenuHeading,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",paddingBlock:"0.5rem"},children:[e.jsx("div",{style:{width:"4rem",height:"4rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"1.25rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",marginBottom:"0.75rem",backgroundColor:"var(--sa-background-brand, #04254f)"},children:((n==null?void 0:n.name)||"U")[0].toUpperCase()}),e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:600,color:"var(--sa-text-primary, #292a2e)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(n==null?void 0:n.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(n==null?void 0:n.email)||"unknown"}),d&&e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d})]})}),(f&&f.length>0||g)&&e.jsxs(I.MenuBody,{children:[f==null?void 0:f.map((S,G)=>e.jsx(I.MenuButton,{children:e.jsxs("button",{type:"button",onClick:S.onClick,style:Fr,onMouseEnter:_=>{_.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:_=>{_.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(B.Icon,{name:S.icon,size:"md"}),e.jsx("span",{children:S.label})]})},`${S.label}-${G}`)),g]}),m??e.jsx(I.MenuFooter,{children:e.jsx(I.MenuButton,{children:e.jsxs("button",{type:"button",onClick:ke,style:{...Fr,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:S=>{S.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:S=>{S.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(B.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:le,style:{flex:1,overflowY:"auto"},children:t||e.jsx(me.Outlet,{})})]})]}),s&&c&&e.jsx("div",{style:{position:"fixed",inset:0,background:"var(--sa-color-black-alpha-a70, #181a19b8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:c}),e.jsxs(Oe.Dialog,{isShow:R,onHide:Ee,children:[e.jsx(Oe.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Oe.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Oe.DialogFooter,{children:e.jsx(h.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(oe.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(h.Box,{direction:"column",children:e.jsx(z.Button,{secondary:!0,onClick:Ee,children:"Cancel"})}),e.jsx(h.Box,{direction:"column",children:e.jsx(z.Button,{primary:!0,onClick:xe,children:"Yes, Sure"})})]})})})]}),te&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>ae(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":te.item.title,style:{position:"fixed",top:te.top,left:te.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem",backgroundColor:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-md, 0.5rem)",boxShadow:"var(--sa-shadow-lg, 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a)",padding:"0.5rem",display:"flex",flexDirection:"column",gap:"0.125rem"},children:[e.jsx("div",{style:{fontSize:"0.75rem",fontWeight:600,color:"var(--sa-color-gray-500, #8c8f97)",padding:"0.25rem 0.5rem 0.5rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:te.item.title}),(Ze=te.item.children)==null?void 0:Ze.map(S=>{const G=je(S.to),_=wt(S.badge,D[S.id]);return e.jsxs("button",{onClick:()=>{E(S.to),ae(null)},style:{width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.5rem 0.75rem",borderRadius:"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:G?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:G?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:M=>{G||(M.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:M=>{G||(M.currentTarget.style.backgroundColor="transparent")},children:[S.icon&&e.jsx(B.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:S.title}),_&&e.jsx(_e.Badges,{text:String(_.value),variant:_.variant??"info",size:"xs",border:!0})]},S.id)})]})]})]})})}const Et=u.forwardRef(({children:t,...r},n)=>e.jsx(h.Box,{ref:n,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...r,children:t})),Er=({title:t,iconName:r,textColor:n,iconColor:i,hoverTextColor:o,hoverIconColor:s})=>{const[c,l]=u.useState(!1),a=i??"var(--sa-text-subtle, #8c8f97)",d=n??"var(--sa-text-subtle, #8c8f97)",f=s??"var(--sa-text-subtle, #8c8f97)",g=o??"var(--sa-text-primary, #292a2e)";return e.jsxs(h.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{cursor:"pointer"},children:[e.jsx(B.Icon,{name:r||"ChevronLeft",size:"xs",style:{color:c?f:a,transition:"color 0.15s ease"}}),e.jsx(w.Text,{variant:"sub-h3",style:{color:c?g:d,transition:"color 0.15s ease"},children:t||"Back"})]})},Xn=({items:t,separator:r="/",iconName:n,iconColor:i,hoverIconColor:o})=>{const[s,c]=u.useState(!1),l=i??"var(--sa-text-subtle, #8c8f97)",a=o??"var(--sa-text-subtle, #8c8f97)",d=t.length>1?t[0]:void 0,f=!!(d!=null&&d.to||d!=null&&d.onClick),g=e.jsx(B.Icon,{name:n||"ChevronLeft",size:"xs",onMouseEnter:f?()=>c(!0):void 0,onMouseLeave:f?()=>c(!1):void 0,style:{color:f&&s?a:l,transition:"color 0.15s ease",cursor:f?"pointer":void 0}}),m=d!=null&&d.to?e.jsx(me.Link,{to:d.to,replace:!0,style:{textDecoration:"none"},children:g}):d!=null&&d.onClick?e.jsx(Et,{onClick:d.onClick,children:g}):g;return e.jsxs(h.Box,{direction:"row",gap:"xs",align:"center",children:[m,e.jsx(rt.Breadcrumb,{separator:r,size:"md",children:t.map((j,L)=>{const y=L===t.length-1;return j.to&&!y?e.jsx(rt.BreadcrumbItem,{children:e.jsx(me.Link,{to:j.to,children:j.label})},L):e.jsx(rt.BreadcrumbItem,{currentPage:y,children:e.jsx(rt.BreadcrumbLink,{onClick:y?void 0:j.onClick,children:j.label})},L)})})]})},Kn=t=>{const{items:r,separator:n,onClick:i,navigateTo:o,...s}=t;return r&&r.length>0?e.jsx(Xn,{items:r,separator:n,iconName:s.iconName,iconColor:s.iconColor,hoverIconColor:s.hoverIconColor}):o?e.jsx(h.Box,{direction:"row",children:e.jsx(me.Link,{to:o,replace:!0,style:{textDecoration:"none"},children:e.jsx(Er,{...s})})}):e.jsx(h.Box,{direction:"row",children:e.jsx(Et,{onClick:i,children:e.jsx(Er,{...s})})})},_t=[{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 Mr(t,r,n){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:t?`2px solid ${n.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:t?n.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:t?r?`0 8px 20px ${n.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${n.activeShadow}`:r?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:r?"translateY(-3px) scale(1.05)":"translateY(0) scale(1)",transition:"box-shadow 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease"}}const Lr={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},Ir={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function nn({isShow:t,onHide:r,menus:n,selectedGroupId:i,onSelect:o}){const[s,c]=u.useState(void 0),l=d=>{o(d),r()},a=_t[0];return e.jsx(Oe.Dialog,{isShow:t,onHide:r,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Oe.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>l(null),onMouseEnter:()=>c("all"),onMouseLeave:()=>c(void 0),style:Ir,children:[e.jsx("div",{style:Mr(i===null,s==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(B.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Lr,children:"Semua"})]}),n.map((d,f)=>{var y;const g=i===d.id,m=s===d.id,j=((y=d.items[0])==null?void 0:y.icon)??"Grid",L=_t[(f+1)%_t.length];return e.jsxs("button",{onClick:()=>l(d.id),onMouseEnter:()=>c(d.id),onMouseLeave:()=>c(void 0),style:Ir,children:[e.jsx("div",{style:Mr(g,m,L),children:e.jsx("div",{style:{color:L.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(B.Icon,{name:j,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Lr,children:d.name})]},d.id)})]})})})}function $n({onSelect:t,"aria-label":r="Pilih module"}={}){const n=nr(),i=me.useNavigate(),{selectedGroupId:o,setSelectedGroupId:s}=sr(),[c,l]=u.useState(!1),a=d=>{var f;if(s(d),d!==null){const g=n.menus.find(j=>j.id===d),m=(f=g==null?void 0:g.items[0])==null?void 0:f.to;m&&i(m)}t==null||t(d)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>l(!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2.25rem",height:"2.25rem",borderRadius:"var(--sa-radii-sm, 0.25rem)",border:"1px solid var(--sa-border-subtle, #0b120e24)",color:"var(--sa-text-subtle, #8c8f97)",backgroundColor:"transparent",cursor:"pointer"},"aria-label":r,onMouseEnter:d=>{d.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:e.jsx(B.Icon,{name:"GridApplication",size:"sm"})}),o!==null&&e.jsx("span",{style:{position:"absolute",top:"0.25rem",right:"0.25rem",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-brand-500, #1a4fa0)"},"aria-hidden":"true"})]}),e.jsx(nn,{isShow:c,onHide:()=>l(!1),menus:n.menus.filter(d=>d.parentGroupId===void 0),selectedGroupId:o,onSelect:a})]})}const eo=(t,r)=>{const n=[];if(r===0)return n.push(t),n;for(let i=0;i<t.length;i+=r){const o=t.slice(i,i+r);n.push(o)}return n},to=u.memo(({value:t,label:r,separator:n,labelWidth:i,lastIndex:o,labelAlign:s="top"})=>{const c=u.useMemo(()=>({padding:0,paddingBottom:o?0:12,verticalAlign:s}),[o,s]),l=u.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:o?0:12,verticalAlign:s}),[o,s]),a=()=>typeof r=="string"?e.jsx(w.Text,{fontWeight:"medium",color:"subtlest",children:r}):r,d=()=>typeof t=="string"||typeof t=="number"?e.jsx(w.Text,{color:"primary",fontWeight:"medium",children:t}):t,f=()=>typeof n=="string"||typeof n=="number"?e.jsx(w.Text,{fontWeight:"medium",color:"subtlest",children:n}):n;return e.jsxs(Q.Tr,{children:[e.jsx(Q.Td,{style:c,width:i,children:a()}),n?e.jsx(Q.Td,{style:l,width:24,children:f()}):null,e.jsx(Q.Td,{style:c,children:d()})]})}),ro=u.memo(({fields:t,separator:r,labelWidth:n})=>e.jsx(Q.Table,{children:t.map((i,o)=>e.jsx(to,{separator:r,labelWidth:n,lastIndex:o===t.length-1,...i},`field-group-field-${o}`))})),no=u.memo(({maxRow:t=0,maxColumn:r=2,separator:n=":",fields:i=[],labelWidth:o=150,bordered:s=!1})=>{const c=u.useMemo(()=>eo(i,t),[i,t]),l=c.length>2,a=()=>{switch(r){case 1:return"width-full";case 2:return"width-1-2";case 3:return"width-1-3";case 4:return"width-1-4";default:return"width-1-2"}};return e.jsx(h.Box,{gap:l?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:l?"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,f)=>e.jsx(h.Box,{direction:"column",flex:l?void 0:"1",width:l?a():void 0,marginBottom:l?"lg":void 0,children:e.jsx(ro,{labelWidth:o,fields:d,separator:n})},f))})}),oo=({backButton:t})=>{const[r,n]=u.useState(!1),i=(t==null?void 0:t.iconColor)??"var(--sa-text-subtle, #8c8f97)",o=(t==null?void 0:t.textColor)??"var(--sa-text-subtle, #8c8f97)",s=(t==null?void 0:t.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",c=(t==null?void 0:t.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(h.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{cursor:"pointer"},children:[e.jsx(B.Icon,{name:(t==null?void 0:t.iconName)||"ChevronLeft",size:"xs",style:{color:r?s:i,transition:"color 0.15s ease"}}),e.jsx(w.Text,{variant:"sub-h3",style:{color:r?c:o,textDecoration:r?"underline":"none",transition:"color 0.15s ease"},children:(t==null?void 0:t.title)||"Back"})]})},io=({backButton:t,title:r,titleIcon:n,titleTag:i,children:o,header:s=!0,headerBorder:c=!1,subHeaders:l,action:a,titleTagProps:d,containerProps:f,headerProps:g})=>{const m=ge.useMediaQuery("md"),j=me.useNavigate(),L=me.useLocation(),y=t==null?void 0:t.show,D=()=>{if(typeof(t==null?void 0:t.onClick)=="function"){t.onClick();return}j(-1,{replace:!0})},E=()=>{if(!a)return null;if(u.isValidElement(a))return a;const C=a.filter(F=>F&&(F.title||F.icon));return C.length===0?null:m?e.jsx(h.Box,{direction:"row",gap:"md",children:C.map(({title:F,icon:H,buttonProps:Z,onClick:N},X)=>e.jsx(z.Button,{iconLeft:H?e.jsx(B.Icon,{name:H,size:"md"}):void 0,onClick:N,...Z,children:F},`action-${X}`))}):e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(B.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{minWidth:200},children:C.map(({title:F,icon:H,buttonProps:Z,onClick:N},X)=>{const se=(Z==null?void 0:Z.tone)==="error"||(Z==null?void 0:Z.danger)===!0;return e.jsx(I.MenuItem,{intent:se?"danger":void 0,disabled:Z==null?void 0:Z.disabled,startIcon:H?e.jsx(B.Icon,{name:H}):void 0,onClick:N,children:F},`action-${X}`)})})})]})},v=()=>{const C=e.jsx(oo,{backButton:t});return t!=null&&t.navigateTo?e.jsx(h.Box,{direction:"row",children:e.jsx(me.Link,{to:t.navigateTo,replace:!0,style:{textDecoration:"none"},children:C})}):e.jsx(h.Box,{direction:"row",children:e.jsx(Et,{onClick:D,children:C})})},W=()=>{const C=!!r,F=Array.isArray(a)&&a.length>0,H=u.isValidElement(a)?!0:F;if(!C&&!H&&!y)return null;const N=m||!m&&F;return e.jsxs(h.Box,{direction:"column",gap:"xs",paddingBlock:(g==null?void 0:g.paddingBlock)??"sm",paddingInline:(g==null?void 0:g.paddingInline)??"md",...g,style:{...c?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...g==null?void 0:g.style},children:[y&&v(),(C||H)&&e.jsxs(h.Box,{direction:N?"row":"column",gap:"sm",justify:"space-between",align:N?"center":"flex-start",children:[C?typeof r=="string"?e.jsxs(h.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(h.Box,{direction:"row",gap:"sm",align:"center",children:[n&&e.jsx(B.Icon,{name:n,size:"md",color:"primary"}),e.jsx(w.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:r})]}),i&&e.jsx(_e.Badge,{border:!0,size:"lg",text:i,...d})]}):r:null,E()]})]})},b=()=>{if(!l||l.length===0)return null;let C=0,F=-1/0;return l.forEach((H,Z)=>{const N=H.order??0;N>=F&&(F=N,C=Z)}),l.map(({content:H,order:Z,borderBottom:N=!0},X)=>e.jsx(h.Box,{direction:"column",paddingTop:"sm",paddingBottom:N||X===C?"sm":"spacing-0",paddingInline:"md",style:{...N?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...Z!==void 0?{order:Z}:{}},children:H},`sub-header-${X}`))},R=()=>{const C=s?W():null,F=b();return!C&&!F?null:e.jsxs(h.Box,{direction:"column",style:{marginBottom:l&&l.length>0?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[C,F]})},O=()=>o;return e.jsxs(h.Box,{direction:"column",as:"main",...f,style:{...(f==null?void 0:f.style)??{},animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"},children:[R(),O()]},L.pathname)},so=u.memo(io),lo={icon:"Cross",title:""},co="calc(100vw - 16px)",Tr=t=>t==null?void 0:`min(${typeof t=="number"?`${t}px`:t}, ${co})`,on=u.forwardRef(({onHide:t,show:r,withBlur:n=!1,style:i,children:o,closeButton:s=lo,width:c,minWidth:l="357px",maxWidth:a="357px"},d)=>{const f=Tr(c??l),g=Tr(c??a);return e.jsx(kt.Drawer,{blur:n,isShow:r,position:"right",onHide:t,ref:d,style:{minWidth:f,maxWidth:g,...i},children:e.jsxs(h.Box,{direction:"column",padding:"lg",children:[s?e.jsxs(h.Box,{direction:"row",align:"center",gap:"sm",onClick:t,marginBottom:"lg",cursor:"pointer",children:[e.jsx(B.Icon,{name:s.icon,size:"md",color:"subtle",cursor:"pointer"}),s.title?e.jsx(w.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:s.title}):null]}):null,o]})})}),lr=u.memo(({children:t,borderBottom:r=!0,padding:n=!0})=>{const i=ge.useMediaQuery("lg");return e.jsx(h.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),cr=u.memo(({children:t,borderTop:r=!0,padding:n=!0})=>{const i=ge.useMediaQuery("lg");return e.jsx(h.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),ao=u.memo(({children:t,...r})=>e.jsx(h.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...r,children:t})),uo=u.memo(({children:t,title:r,titleTag:n,action:i,header:o,footer:s,actionContainer:c,containerProps:l,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:f={borderTop:!0},variantTag:g="info"})=>{const m=ge.useMediaQuery("lg"),j=()=>n?e.jsxs(h.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(w.Text,{fontWeight:"medium",children:r}),e.jsx(_e.Badges,{border:!0,text:n,variant:g})]}):e.jsx(w.Text,{fontWeight:"medium",children:r}),L=()=>o||e.jsxs(h.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(h.Box,{direction:"column",children:r?j():null}),e.jsx(h.Box,{direction:"column",style:m?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...c,children:i??null})]}),y=!!(o||r||i);return e.jsxs(h.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...l,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(l==null?void 0:l.style)??{}},children:[o!==null&&y?e.jsx(lr,{...d,children:L()}):null,e.jsx(ao,{...a,children:t}),s?e.jsx(cr,{...f,children:s}):null]})}),xo=t=>e.jsx(w.Text,{variant:"h1",children:t.children,...t.props}),ho=t=>e.jsx(w.Text,{variant:"h2",children:t.children,...t.props}),fo=t=>e.jsx(w.Text,{variant:"h3",children:t.children,...t.props}),mo=t=>e.jsx(w.Text,{variant:"h4",children:t.children,...t.props}),go=t=>e.jsx(w.Text,{variant:"h5",children:t.children,...t.props}),yo=t=>e.jsx(w.Text,{variant:"h6",children:t.children,...t.props}),po=t=>e.jsx(w.Text,{variant:"sub-h1",children:t.children,...t.props}),jo=t=>e.jsx(w.Text,{variant:"sub-h2",children:t.children,...t.props}),bo=t=>e.jsx(w.Text,{variant:"sub-h3",children:t.children,...t.props}),Co=t=>e.jsx(w.Text,{variant:"body-1",children:t.children,...t.props}),vo=t=>e.jsx(w.Text,{variant:"body-2",children:t.children,...t.props}),wo=t=>e.jsx(w.Text,{variant:"body-3",children:t.children,...t.props}),We={H1:xo,H2:ho,H3:fo,H4:mo,H5:go,H6:yo,SubH1:po,SubH2:jo,SubH3:bo,Body1:Co,Body2:vo,Body3:wo},Se=()=>{const[t,r]=me.useSearchParams(),n=it.searchParamsToObject(t.toString()),i=me.useParams(),o=me.useLocation(),s=i.id;return{setSearchParams:r,searchParams:t,searchQueries:n,isHasQuery:(f,g)=>t.has(f)&&t.get(f)===g,getQueryParam:f=>t.get(f),getRouteParam:f=>i[f],params:i,location:o,id:s,hasId:!!s}},sn=t=>JSON.stringify(t),ln=t=>JSON.stringify(t),cn=t=>JSON.stringify(t),an=t=>JSON.stringify(t),Do=t=>t,So=t=>JSON.stringify(t),xt=({value:t,name:r,type:n,withSearchParam:i=!0,setSearchParams:o,searchQueries:s,dropdownSearchKey:c,filterKey:l="filter",pageKey:a="page"})=>{if(i){let d;switch(n){case"search":d=Do(t);break;case"dropdown":case"dropdown-multiple":d=sn(t);break;case"radio":d=ln(t);break;case"date-range":d=cn(t);break;case"advanced-date-range":d=So(t);break;case"date":d=an(t);break;default:d=t;break}if(typeof d<"u"){const g={...s[l]&&typeof s[l]=="string"?JSON.parse(s[l]):void 0,[r]:d},m={...s};c&&typeof c=="string"&&delete m[c],delete m[a];const j={...m,[l]:JSON.stringify(g)},L=new URLSearchParams(s).toString(),y=new URLSearchParams(j).toString();if(L===y)return;o(j)}}},Dt=({name:t,filterKey:r="filter",searchParams:n,get:i})=>{const o=n.get(r)||void 0,s=o&&typeof o=="string"?JSON.parse(o):void 0,c=s?s[t]:void 0;return i==="label"&&c?JSON.parse(c)[0].label:i==="value"&&c?JSON.parse(c)[0].value:c},dn=({name:t,filterKey:r="filter",searchParams:n,get:i})=>{const o=n.get(r)||void 0,s=o&&typeof o=="string"?JSON.parse(o):void 0,c=s?s[t]:void 0;return i==="label"&&c?JSON.parse(c).map(l=>l.label):i==="value"&&c?JSON.parse(c).map(l=>l.value):i==="array"&&c?JSON.parse(c):c},ko=({name:t,filterKey:r="filter",searchParams:n,get:i})=>{const o=n.get(r)||void 0,s=o&&typeof o=="string"?JSON.parse(o):void 0,c=s?s[t]:void 0;return i==="id"&&c?JSON.parse(c).id:i==="label"&&c?JSON.parse(c).label:i==="value"&&c?JSON.parse(c).value:c},Mt=(t,r,n)=>{const i=r.get(n||"filter")||void 0,o=i&&typeof i=="string"?JSON.parse(i):void 0;return o?o[t]:void 0},Bo=({name:t,filterKey:r="filter",searchParams:n})=>{const i=n.get(r||"filter")||void 0,o=i&&typeof i=="string"?JSON.parse(i):void 0,s=o?o[t]:void 0;return{start:s?JSON.parse(s).from:void 0,end:s?JSON.parse(s).to:void 0}},un=({name:t,filterKey:r="filter",searchParams:n})=>{const i=n.get(r||"filter")||void 0,o=i&&typeof i=="string"?JSON.parse(i):void 0,s=o?o[t]:void 0;return s?JSON.parse(s):void 0},Fo=(t,{filterKey:r="filter",perPageKey:n="perPage",pageKey:i="page"})=>{const o=t.get(r)||void 0,s=t.get(n)||void 0,c=t.get(i)||void 0;return!!o||!!s||!!c},xn=({isOpen:t,onClose:r,filterKey:n,pageKey:i,filters:o})=>{const{searchParams:s,setSearchParams:c,searchQueries:l}=Se(),[a,d]=u.useState({}),f=()=>{s.delete(n||"filter"),c(s)},g=(m,j)=>{switch(m.type){case"radio":{const{show:L=!0}=m;return L&&e.jsx(h.Box,{direction:"column",children:e.jsx(h.Box,{direction:"column",children:m.title})},j)}case"dropdown":{const{show:L=!0}=m;return L&&e.jsx(h.Box,{direction:"column",children:e.jsx(h.Box,{direction:"column",children:m.title})},j)}case"date-range":return e.jsx(h.Box,{direction:"column",children:e.jsx(h.Box,{direction:"column",children:m.title})},j);case"date":return e.jsx(h.Box,{direction:"column",children:e.jsx(h.Box,{direction:"column",children:m.title})},j);case"dropdown-multiple":{const{show:L=!0}=m;return L&&e.jsx(h.Box,{direction:"column",children:e.jsx(h.Box,{direction:"column",children:m.title})},j)}default:return null}};return e.jsx(on,{onHide:r,show:t||!1,children:e.jsxs(h.Box,{direction:"column",gap:"md",children:[e.jsxs(oe.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(h.Box,{direction:"column",children:"Filter"}),e.jsx(h.Box,{direction:"column",style:{cursor:"pointer"},onClick:f,children:"Reset"})]}),o==null?void 0:o.map((m,j)=>g(m,j))]})})},hn=({searchKey:t="q",statusKey:r="status",searchPlaceholder:n="Search",searchHighlightPlaceholder:i,extendedFilter:o,showSearchFilter:s=!0,showStatusFilter:c=!0,filterKey:l="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:f,filterConfigs:g,buttonToggleProps:m,position:j="right",titleSearchLabel:L="Work Order",withTitleLabels:y=!1})=>{const E=(m==null?void 0:m.isShowLabel)??!0,[v,W]=u.useState(!1),[b,R]=u.useState(0),O=()=>{R(P=>P+1)},{searchParams:C,setSearchParams:F,getQueryParam:H}=Se(),Z=it.searchParamsToObject(C.toString()),N=Mt(t,C,l)||"",[X,se]=u.useState(N),he=H(l),ae=!!(he&&!(()=>{if(he)try{const P=JSON.parse(he);return Object.keys(P).length===1&&P[t]===""}catch(P){console.error("Filter parameter is not a valid JSON:",P)}return!1})()),K=ge.useMediaQuery("md");return u.useEffect(()=>{se(N)},[N]),u.useEffect(()=>{if(X===N)return;const P=window.setTimeout(()=>{xt({value:X,name:t,type:"search",searchQueries:Z,setSearchParams:F,filterKey:l,pageKey:a})},350);return()=>{window.clearTimeout(P)}},[X,N,t,Z,F,l,a]),e.jsxs(oe.Flex,{gap:"md",style:{flexDirection:K&&j==="left"?"row":K&&j==="right"?"row-reverse":"column"},align:"flex-end",children:[ae&&e.jsx(h.Box,{direction:"column",justify:"flex-end",children:e.jsx(z.Button,{onClick:()=>{const P=new URLSearchParams(C);P.delete(l),F(P),se(""),O(),f&&f()},variant:"outline",tone:"neutral",children:e.jsx(w.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),o==null?void 0:o.map(({minWidth:P,content:re,title:le,onClickContainer:ue},ke)=>e.jsxs(h.Box,{direction:"column",gap:"sm",onClick:ue,style:{minWidth:P},children:[le&&e.jsx(We.SubH3,{children:le}),re]},`extended-filter-${ke}-${b}`)),!!(g!=null&&g.length)&&e.jsx(z.Button,{primary:ae,secondary:!ae,iconLeft:e.jsx(B.Icon,{size:"sm",name:(m==null?void 0:m.icon)||"FilterHorizontal",style:{color:he?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!K,onClick:()=>W(!0),children:E?"Filter":void 0}),c&&e.jsxs(h.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[y&&e.jsx(We.SubH3,{children:"Status"}),e.jsx(ot.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Dt({get:"value",name:r,searchParams:C,filterKey:l})?[{label:Dt({get:"value",name:r,searchParams:C,filterKey:l})==="active"?"Active":"InActive",value:Dt({get:"value",name:r,searchParams:C,filterKey:l})}]:[],onChange:P=>xt({value:P,name:r,type:"dropdown",searchQueries:Z,setSearchParams:F,filterKey:l}),placeholder:y?"All":"All Status"},b)]}),s&&e.jsxs(h.Box,{direction:"column",gap:"sm",style:{width:d&&K?d:K?"310px":""},children:[y&&e.jsxs(We.SubH3,{children:["Search for ",L]}),e.jsx(qe.Input,{placeholder:n,leftIcon:e.jsx(B.Icon,{name:"Search",width:20,height:20}),onChange:P=>se(P.target.value),value:X,fullWidth:!0},b+1+l)]}),e.jsx(xn,{isOpen:v,onClose:()=>W(!1),filterKey:l,filters:g,pageKey:a})]})},Eo=t=>t==="checkbox-multiple"?"dropdown-multiple":t==="radio"?"dropdown":t==="date-compact"?"date":t;function ar({configs:t,filterKey:r="filter",activeFilterKey:n="filters",pageKey:i="page",searchKey:o="q"}){const{searchParams:s,setSearchParams:c,searchQueries:l}=Se(),a=u.useMemo(()=>Object.fromEntries(t.map(b=>[b.key,b])),[t]),d=u.useMemo(()=>{const b=(s.get(n)||"").split(",").map(O=>O.trim()).filter(Boolean);let R=[];try{const O=s.get(r);O&&(R=Object.keys(JSON.parse(O)).filter(C=>C!==o))}catch{}return t.map(O=>O.key).filter(O=>{const C=a[O];return(C==null?void 0:C.locked)||b.includes(O)||R.includes(O)})},[s,n,r,o,t,a]),f=u.useCallback(b=>{try{return b[r]?JSON.parse(b[r]):{}}catch{return{}}},[r]),g=u.useCallback(b=>{const R={...l};b.length?R[n]=b.join(","):delete R[n],c(R)},[l,n,c]),m=u.useCallback(b=>{d.includes(b)||g([...d,b])},[d,g]),j=u.useCallback(b=>{var F;if((F=a[b])!=null&&F.locked)return;const R={...l},O=d.filter(H=>H!==b);O.length?R[n]=O.join(","):delete R[n];const C=f(R);b in C&&(delete C[b],Object.keys(C).length?R[r]=JSON.stringify(C):delete R[r]),delete R[i],c(R)},[l,d,n,r,i,f,c,a]),L=u.useCallback(b=>d.includes(b)?j(b):m(b),[d,m,j]),y=u.useCallback(b=>{switch(b.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return dn({name:b.key,get:"array",searchParams:s,filterKey:r})||[];case"date":{const R=un({name:b.key,searchParams:s,filterKey:r});return R?new Date(R):void 0}case"date-compact":{const O=f(Object.fromEntries(s.entries()))[b.key];return O&&typeof O=="object"?O:void 0}default:return}},[s,r,f]),D=u.useCallback((b,R)=>{if(b.type==="date-compact"){const O={...l},C=f(O);R==null?delete C[b.key]:C[b.key]=R,Object.keys(C).length?O[r]=JSON.stringify(C):delete O[r],delete O[i],c(O);return}xt({value:R,name:b.key,type:Eo(b.type),searchQueries:l,setSearchParams:c,filterKey:r,pageKey:i})},[l,c,r,i,f]),E=u.useCallback(b=>{const R={...l},O=f(R);b in O&&(delete O[b],Object.keys(O).length?R[r]=JSON.stringify(O):delete R[r]),delete R[i],c(R)},[l,r,i,f,c]),v=u.useCallback(()=>{const b={...l};delete b[r],delete b[n],delete b[i],c(b)},[l,r,n,i,c]),W=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:W,addFilter:m,removeFilter:j,toggleFilter:L,getValue:y,setValue:D,clearValue:E,clearAll:v}}const dr={get(t){return dt.storage.get(t)??null},set(t,r){dt.storage.save(t,r)},remove(t){dt.storage.delete(t)}},ct={columns:t=>`filterbar:colprefs:${t}`,savedViews:t=>`filterbar:views:${t}`,lastState:t=>`filterbar:last:${t}`,perPage:t=>`filterbar:perpage:${t}`,tableSort:t=>`tablelayout:sort:${t}`},yt=(t,r)=>{const n=new Set(r.map(s=>s.key)),i=t.order.filter(s=>n.has(s));for(const s of r)i.includes(s.key)||i.push(s.key);const o=t.hidden.filter(s=>n.has(s));return{order:i,hidden:o}};function Mo({columns:t,scopeId:r,storage:n,onColumnsChange:i,value:o}){const s=u.useMemo(()=>({order:t.map(C=>C.key),hidden:[]}),[t]),c=r?ct.columns(r):void 0,l=(C,F)=>yt({order:C.order??F,hidden:C.hidden??[]},t),[a,d]=u.useState(()=>{if(o&&(o.order||o.hidden))return l(o,t.map(C=>C.key));if(c){const C=n.get(c);if(C&&Array.isArray(C.order))return yt(C,t)}return s}),f=t.map(C=>C.key).join("|");u.useEffect(()=>d(C=>yt(C,t)),[f]);const g=u.useRef(a);g.current=a;const m=o?`${(o.order??[]).join("|")}~${(o.hidden??[]).join("|")}`:null,j=u.useRef(m);u.useEffect(()=>{if(m==null||j.current===m)return;j.current=m;const C=g.current,F=l(o,C.order);F.order.join("|")===C.order.join("|")&&F.hidden.join("|")===C.hidden.join("|")||(d(F),c&&n.set(c,F))},[m,f]);const L=u.useRef(!1);u.useEffect(()=>{L.current||(L.current=!0,i==null||i(a))},[]);const y=u.useCallback(C=>{d(C),c&&n.set(c,C),i==null||i(C)},[c,n,i]),D=u.useMemo(()=>{const C=new Map(t.map(F=>[F.key,F]));return a.order.filter(F=>C.has(F)).map(F=>({...C.get(F),visible:!a.hidden.includes(F)}))},[a,t]),E=u.useCallback(C=>{const F=a.hidden.includes(C)?a.hidden.filter(H=>H!==C):[...a.hidden,C];y({...a,hidden:F})},[a,y]),v=u.useCallback((C,F)=>{if(C===F)return;const H=[...a.order],[Z]=H.splice(C,1);H.splice(F,0,Z),y({...a,order:H})},[a,y]),W=u.useCallback(C=>{y({...a,hidden:C?t.filter(F=>!F.locked).map(F=>F.key):[]})},[a,t,y]),b=u.useCallback(()=>y(s),[y,s]),R=u.useCallback(C=>y(yt(C,t)),[y,t]),O=a.hidden.length===0;return{state:a,orderedColumns:D,allVisible:O,toggleVisibility:E,reorder:v,setAllHidden:W,reset:b,applyState:R}}function Lo({scopeId:t,storage:r,snapshotKeys:n,pageKey:i="page",getColumns:o,applyColumns:s}){const{searchParams:c,setSearchParams:l}=Se(),a=t?ct.savedViews(t):void 0,[d,f]=u.useState(()=>a?r.get(a)||[]:[]),g=u.useCallback(y=>{f(y),a&&r.set(a,y)},[a]),m=u.useCallback(y=>{const D=y.trim();if(!D)return;const E={};n.forEach(W=>{const b=c.get(W);b!=null&&(E[W]=b)});const v={id:`${Date.now()}`,name:D,query:E,columns:o==null?void 0:o(),createdAt:Date.now()};g([...d,v])},[n,c,o,g,d]),j=u.useCallback(y=>g(d.filter(D=>D.id!==y)),[g,d]),L=u.useCallback(y=>{const D=Object.fromEntries(c.entries());n.forEach(E=>delete D[E]),Object.assign(D,y.query),delete D[i],l(D),y.columns&&(s==null||s(y.columns))},[c,n,i,l,s]);return{enabled:!!a,views:d,saveView:m,deleteView:j,applyView:L}}function Io({scopeId:t,storage:r,snapshotKeys:n,enabled:i=!0}){const{searchParams:o}=Se(),s=t&&i?ct.lastState(t):void 0,c=u.useRef(s);u.useEffect(()=>{if(!s){c.current=s;return}if(c.current!==s){c.current=s;return}const d={};n.forEach(f=>{const g=o.get(f);g!=null&&(d[f]=g)}),Object.keys(d).length!==0&&r.set(s,d)},[o,s,n,r]);const l=u.useCallback(()=>{if(!s)return null;const d=r.get(s);return d&&Object.keys(d).length>0?d:null},[s,r]),a=u.useCallback(()=>{s&&r.remove(s)},[s,r]);return{enabled:!!s,read:l,clear:a}}function To({scopeId:t,storage:r,perPageKey:n,pageSizeOptions:i,enabled:o=!0}){const{searchParams:s}=Se(),c=t&&o?ct.perPage(t):void 0,l=s.toString(),a=u.useRef(c);u.useEffect(()=>{if(!c){a.current=c;return}if(a.current!==c){a.current=c;return}const g=s.get(n);if(!g)return;const m=Number(g);!Number.isFinite(m)||m<=0||r.set(c,m)},[l,c,n,r]);const d=u.useCallback(()=>{if(!c)return null;const g=r.get(c);if(g==null)return null;const m=Number(g);return!Number.isFinite(m)||m<=0||i&&!i.includes(m)?null:String(m)},[c,r,i]),f=u.useCallback(()=>{c&&r.remove(c)},[c,r]);return{enabled:!!c,read:d,clear:f}}let qt={},Zt=!1,Gt=null;const Oo=(t,r)=>{Object.assign(qt,t),Gt=r,!Zt&&(Zt=!0,queueMicrotask(()=>{const n=qt,i=Gt;qt={},Zt=!1,Gt=null,!(!i||Object.keys(n).length===0)&&i(o=>{const s=new URLSearchParams(o);return Object.entries(n).forEach(([c,l])=>s.set(c,l)),s})}))};function Wo({enabled:t,snapshotKeys:r,perPageKey:n,readSnapshot:i,readPerPage:o}){const{searchParams:s,setSearchParams:c,location:l}=Se(),a=u.useRef(null);u.useEffect(()=>{if(!t||a.current===l.pathname)return;a.current=l.pathname;const d={};if(!s.has(n)){const f=o();f&&(d[n]=f)}if(!r.some(f=>s.has(f))){const f=i();f&&Object.assign(d,f)}Object.keys(d).length!==0&&Oo(d,c)},[l.pathname,t])}const Ro=({configs:t,activeKeys:r,onToggle:n,hasActiveFilter:i,onReset:o})=>t.length?e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{minWidth:260},title:e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),i&&o&&e.jsx(z.Button,{variant:"link",tone:"brand",size:"xs",onClick:o,children:"Reset"})]}),children:t.map(s=>e.jsx(I.MenuItem,{selected:s.locked||r.includes(s.key),disabled:s.locked,closeOnSelect:!1,startIcon:s.icon??void 0,onClick:()=>{s.locked||n(s.key)},children:s.label},s.key))})})]}):null,Lt=({onClear:t,onRemove:r})=>e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(B.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(I.MenuLists,{children:e.jsxs(I.MenuBody,{style:{width:180},children:[e.jsx(I.MenuItem,{startIcon:e.jsx(B.Icon,{name:"CrossCircle"}),onClick:t,children:"Clear value"}),r&&e.jsx(I.MenuItem,{intent:"danger",startIcon:e.jsx(B.Icon,{name:"Trash1"}),onClick:r,children:"Remove filter"})]})})]}),Ao=t=>{const r=new Date(t);return r.setHours(0,0,0,0),r},Or=(t,r,n)=>{const i=new Date(t);return n==="day"?i.setDate(i.getDate()+r):n==="week"?i.setDate(i.getDate()+r*7):n==="month"?i.setMonth(i.getMonth()+r):i.setFullYear(i.getFullYear()+r),i},fn=t=>{const r=Ao(new Date);if(t.direction==="this"){const i=new Date(r),o=new Date(r);return t.period==="week"?(i.setDate(r.getDate()-r.getDay()),o.setDate(i.getDate()+6)):t.period==="month"?(i.setDate(1),o.setMonth(o.getMonth()+1,0)):t.period==="year"&&(i.setMonth(0,1),o.setMonth(11,31)),{from:i,to:o}}const n=t.count??1;return t.direction==="past"?{from:Or(r,-n,t.period),to:r}:{from:r,to:Or(r,n,t.period)}},Wr=24,mn=t=>t.length>Wr?`${t.slice(0,Wr)}...`:t,St=t=>t.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),Ft={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"},zo=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],er={past:"Past",next:"Next",this:"This"},Vo=["day","week","month","year"],Ho=["past","next","this"],Po=t=>t.field.type==="date-compact"?e.jsx(qo,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}):e.jsx(No,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}),No=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=r?St(new Date(r)):null,c=!!s,l=c?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:mn(s)})]}):t.label;return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c?e.jsx(B.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:260},title:e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Lt,{onClear:i,onRemove:o})]}),children:e.jsx(Xe.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:t.mode,value:r,onChange:a=>a==null?i():n(a),withPadding:!1})})})]})},_o=t=>{switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date?`${Ft[t.op]} ${St(new Date(t.date))}`:null;case"is-between":return t.from&&t.to?`${St(new Date(t.from))} - ${St(new Date(t.to))}`:null;case"is-relative-to-today":{const r=t.relative;if(!r)return null;if(r.direction==="this")return`This ${r.period}`;const n=r.count??1,i=n===1?r.period:`${r.period}s`;return`${er[r.direction]} ${n} ${i}`}case"is-empty":case"is-not-empty":return Ft[t.op];default:return null}},qo=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=(r==null?void 0:r.op)??"is",c=r?_o(r):null,l=!!c,a=l?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:mn(c)})]}):t.label,d=f=>{if(f!==s){if(f==="is-empty"||f==="is-not-empty"){n({op:f});return}if(f==="is-relative-to-today"){n({op:f,relative:(r==null?void 0:r.relative)??{direction:"past",count:1,period:"week"}});return}if(f==="is-between"){n({op:f,from:r==null?void 0:r.from,to:r==null?void 0:r.to});return}n({op:f,date:r==null?void 0:r.date})}};return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:l?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l?e.jsx(B.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:a})}),e.jsxs(I.MenuLists,{children:[e.jsx(I.MenuBody,{style:{width:320},title:e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Zo,{op:s,onChange:d})]}),e.jsx(Lt,{onClear:i,onRemove:o})]}),children:e.jsx(Go,{value:r,op:s,onChange:n})}),s==="is-relative-to-today"&&e.jsx(I.MenuFooter,{children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},Zo=({op:t,onChange:r})=>e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:Ft[t]})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:200},children:zo.map(n=>e.jsx(I.MenuItem,{selected:t===n,onClick:()=>r(n),endIcon:t===n?e.jsx(B.Icon,{name:"Check"}):void 0,children:Ft[n]},n))})})]}),Go=({value:t,op:r,onChange:n})=>{if(r==="is-empty"||r==="is-not-empty")return e.jsx(h.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(r==="is-between"){const i=t!=null&&t.from||t!=null&&t.to?{from:t!=null&&t.from?new Date(t.from):null,to:t!=null&&t.to?new Date(t.to):null}:void 0;return e.jsx(Xe.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,value:i,onChange:o=>{if(o==null){n({op:r});return}if(typeof o=="object"&&o!==null&&"from"in o&&"to"in o){let{from:s,to:c}=o;if(!s&&c&&(s=c,c=null),!s&&!c){n({op:r});return}n({op:r,from:s?s.toISOString():void 0,to:c?c.toISOString():void 0})}},withPadding:!1},"range")}return r==="is-relative-to-today"?e.jsx(Qo,{value:t==null?void 0:t.relative,onChange:i=>n({op:r,relative:i})}):e.jsx(Xe.StarasiaDate,{size:"sm",input:!1,clearable:!0,value:t!=null&&t.date?new Date(t.date):void 0,onChange:i=>{if(i==null){n({op:r});return}i instanceof Date&&n({op:r,date:i.toISOString()})},withPadding:!1},"single")},Qo=({value:t,onChange:r})=>{const n=(t==null?void 0:t.direction)??"past",i=(t==null?void 0:t.count)??1,o=(t==null?void 0:t.period)??"week",s=n!=="this",c=fn({direction:n,count:i,period:o});return e.jsxs(h.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:er[n]})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:140},children:Ho.map(l=>e.jsx(I.MenuItem,{selected:n===l,endIcon:n===l?e.jsx(B.Icon,{name:"Check"}):void 0,onClick:()=>r(l==="this"?{direction:l,period:o}:{direction:l,count:i,period:o}),children:er[l]},l))})})]}),s&&e.jsx(qe.Input,{type:"number",size:"sm",min:1,clearable:!1,value:i,onChange:l=>{const a=Number(l.target.value);r({direction:n,count:Number.isFinite(a)&&a>0?a:1,period:o})},style:{width:72}}),e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:o})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:140},children:Vo.map(l=>e.jsx(I.MenuItem,{selected:o===l,endIcon:o===l?e.jsx(B.Icon,{name:"Check"}):void 0,onClick:()=>r(n==="this"?{direction:n,period:l}:{direction:n,count:i,period:l}),children:l},l))})})]})]}),e.jsx(Xe.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:c,onChange:()=>{},withPadding:!1},"relative-preview")]})},Rr=18,Uo=t=>t.length>Rr?`${t.slice(0,Rr)}...`:t,Jo=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=t.type==="dropdown-multiple",c=r.length,[l,a]=u.useState(""),d=t.options,f=typeof t.onSearch=="function",g=(()=>{if(f)return d;const D=l.trim().toLowerCase();return D?d.filter(E=>E.label.toLowerCase().includes(D)):d})(),m=D=>r.some(E=>E.value===D.value),j=D=>{if(!s){n([{label:D.label,value:D.value}]),a("");return}n(m(D)?r.filter(E=>E.value!==D.value):[...r,{label:D.label,value:D.value}])},L=D=>{var E;a(D),(E=t.onSearch)==null||E.call(t,D)},y=c===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:c===1?Uo(r[0].label):`${c} Selected`})]});return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(B.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:y})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:260},title:e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Lt,{onClear:i,onRemove:o})]}),children:e.jsxs(h.Box,{direction:"column",gap:"sm",children:[e.jsx(ot.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:s,searchAble:!0,searchValue:l,onSearch:L,value:r,onChange:n,placeholder:`Search ${t.label.toLowerCase()}…`}),e.jsx(h.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:t.isLoading?e.jsx(h.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):g.length===0?e.jsx(h.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):g.map(D=>e.jsx(I.MenuItem,{closeOnSelect:!s,selected:m(D),startIcon:D.avatar,endIcon:m(D)?e.jsx(B.Icon,{name:"Check"}):void 0,description:D.description,onClick:()=>j(D),children:D.label},D.value))})]})})})]})},Ar=18,Yo=t=>t.length>Ar?`${t.slice(0,Ar)}...`:t,zr=({checked:t,indeterminate:r})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(lt.Checkbox,{size:"sm",checked:t,readOnly:!0,onChange:()=>{},variant:r?"indeterminate":"select"})}),Xo=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=new Set(r.map(m=>m.value)),c=r.length,l=t.options.length>0&&t.options.every(m=>s.has(m.value)),a=c>0&&!l,d=m=>{n(s.has(m.value)?r.filter(j=>j.value!==m.value):[...r,{label:m.label,value:m.value}])},f=()=>{n(l?[]:t.options.map(m=>({label:m.label,value:m.value})))},g=c===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs(w.Text,{as:"span",fontWeight:"semibold",children:[t.label,":"]})," ",e.jsx(w.Text,{as:"span",children:c===1?Yo(r[0].label):`${c} Selected`})]});return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(B.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:g})}),e.jsx(I.MenuLists,{children:e.jsxs(I.MenuBody,{style:{width:240},title:e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Lt,{onClear:i,onRemove:o})]}),children:[e.jsx(I.MenuItem,{closeOnSelect:!1,selected:l,onClick:f,startIcon:e.jsx(zr,{checked:l||a,indeterminate:a}),children:"Select All"}),t.options.map(m=>e.jsx(I.MenuItem,{closeOnSelect:!1,selected:s.has(m.value),onClick:()=>d(m),startIcon:e.jsx(zr,{checked:s.has(m.value)}),children:m.label},m.value))]})})]})},gn=({activeKeys:t,configByKey:r,getValue:n,setValue:i,clearValue:o,removeFilter:s})=>e.jsx(e.Fragment,{children:t.map(c=>{const l=r[c];if(!l)return null;const a=n(l),d=l.locked?void 0:()=>s(c);return l.type==="date"||l.type==="date-compact"?e.jsx(Po,{field:l,value:a,onChange:f=>i(l,f),onClear:()=>o(c),onRemove:d},c):l.type==="checkbox-multiple"?e.jsx(Xo,{field:l,value:a||[],onChange:f=>i(l,f),onClear:()=>o(c),onRemove:d},c):e.jsx(Jo,{field:l,value:a||[],onChange:f=>i(l,f),onClear:()=>o(c),onRemove:d},c)})}),Vr=t=>`${t} Rows`,Ko=({pagination:t,pageKey:r="page",perPageKey:n="perPage",pageSizeOptions:i=[10,25,50,100],defaultPerPage:o=10,showResultCount:s=!0,showPageSize:c=!0,showPagination:l=!0})=>{var E;const{searchQueries:a,setSearchParams:d,searchParams:f}=Se(),g=f.get(n),m=g?Number(g):o,j=v=>{d({...a,[r]:String(v)})},L=v=>{d({...a,[n]:v,[r]:"1"})},y=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:1),D=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[s&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${y}-${D} of ${((E=t==null?void 0:t.totalData)==null?void 0:E.toLocaleString())||0}`}),c&&e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:"outline",tone:"neutral",size:"xs",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:Vr(m)})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{children:i.map(v=>e.jsx(I.MenuItem,{selected:v===m,onClick:()=>L(String(v)),children:Vr(v)},v))})})]}),l&&((t==null?void 0:t.totalPage)??0)>1&&e.jsx(h.Box,{direction:"column",display:"flex",align:"center",gap:"sm",paddingRight:"lg",style:{borderRight:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:e.jsx(ut.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:t!=null&&t.currentPage?Number(t.currentPage):1,totalPages:Number(t==null?void 0:t.totalPage),onPageChange:j})})]})};function $o(t,r,n=!0){u.useEffect(()=>{if(!n)return;const i=o=>{var l;if(o.metaKey||o.ctrlKey||o.altKey||o.key!==t)return;const s=o.target,c=(l=s==null?void 0:s.tagName)==null?void 0:l.toLowerCase();c==="input"||c==="textarea"||s!=null&&s.isContentEditable||(o.preventDefault(),r())};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[t,r,n])}const ei=240,yn=({searchKey:t="q",filterKey:r="filter",pageKey:n="page",placeholder:i="Search",shortcut:o="/"})=>{const{searchParams:s,setSearchParams:c,searchQueries:l}=Se(),a=Mt(t,s,r)||"",[d,f]=u.useState(!!a),[g,m]=u.useState(!a),[j,L]=u.useState(a),y=ge.useDebounce(j,350),D=u.useRef(null);u.useEffect(()=>{L(a),a&&f(!0)},[a]),u.useEffect(()=>{d&&m(!1)},[d]),u.useEffect(()=>{y!==a&&xt({value:y,name:t,type:"search",searchQueries:l,setSearchParams:c,filterKey:r,pageKey:n})},[y]);const E=u.useCallback(()=>{f(!0),requestAnimationFrame(()=>{var R;return(R=D.current)==null?void 0:R.focus()})},[]);$o(o,E);const v=()=>{j||f(!1)},W=R=>{var O;R.key==="Escape"&&!j&&(f(!1),(O=D.current)==null||O.blur())},b=()=>{d||m(!0)};return e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[g&&e.jsx(z.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:E}),e.jsxs(h.Box,{onTransitionEnd:b,style:{position:"relative",width:d?ei:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(qe.Input,{ref:D,size:"sm",fullWidth:!0,value:j,placeholder:i,leftIcon:e.jsx(B.Icon,{name:"Search",width:16,height:16}),onChange:R=>L(R.target.value),onKeyDown:W,onBlur:v,tabIndex:d?0:-1}),d&&!j&&e.jsx(h.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(w.Text,{fontSize:"xs",color:"subtle",children:o})})]})]})},pn=({columns:t,allVisible:r,onToggle:n,onReorder:i,onSetAllHidden:o})=>{const[s,c]=u.useState(null),[l,a]=u.useState(null),d=()=>{s!==null&&l!==null&&s!==l&&i(s,l),c(null),a(null)},f=(g,m)=>{const j=g+m;j<0||j>=t.length||i(g,j)};return e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:r?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{children:e.jsxs(h.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(w.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(z.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>o(r),children:r?"Hide All":"Show All"})]}),e.jsx(h.Box,{direction:"column",overflow:"overflow-y-auto",children:t.map((g,m)=>{const j=!g.locked,L=l===m&&s!==null&&s!==m;return e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:j,onDragStart:()=>j&&c(m),onDragOver:y=>{y.preventDefault(),a(m)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:L?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(h.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:j?0:-1,"aria-label":`Reorder ${g.title}`,"aria-disabled":!j||void 0,color:"icon-subtlest",onKeyDown:y=>{j&&(y.key==="ArrowUp"?(y.preventDefault(),f(m,-1)):y.key==="ArrowDown"&&(y.preventDefault(),f(m,1)))},style:{display:"inline-flex",cursor:j?"grab":"default",opacity:j?1:.4},children:e.jsx(B.Icon,{name:"DragVertical",width:16,height:16})}),g.icon&&e.jsx(h.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:g.icon}),e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:g.title}),e.jsx(h.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(st.Toggle,{size:"sm",checked:g.visible,disabled:g.locked,onChange:()=>n(g.key),"aria-label":`Toggle ${g.title} column`})})]},g.key)})})]})})})]})},jn=({views:t,onApply:r,onDelete:n,onSave:i})=>{const[o,s]=u.useState(""),c=()=>{const l=o.trim();l&&(i(l),s(""))};return e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:t.length>0?"secondary":"outline",tone:(t.length>0,"neutral"),size:"sm",iconLeft:e.jsx(B.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(I.MenuLists,{style:{width:"260px"},children:[e.jsx(I.MenuBody,{children:e.jsxs(h.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(w.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(h.Box,{direction:"column",overflow:"overflow-y-auto",children:t.length===0?e.jsx(h.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(w.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):t.map(l=>e.jsx(I.MenuItem,{startIcon:e.jsx(B.Icon,{name:"Bookmark"}),onClick:()=>r(l),endIcon:e.jsx(z.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Trash2"}),"aria-label":`Delete ${l.name}`,onClick:a=>{a.stopPropagation(),n(l.id)}}),children:l.name},l.id))})]})}),e.jsx(I.MenuFooter,{children:e.jsxs(h.Box,{direction:"row",gap:"xs",children:[e.jsx(h.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(qe.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:o,onChange:l=>s(l.target.value),onKeyDown:l=>{l.key==="Enter"&&c()}})}),e.jsx(z.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!o.trim(),onClick:c,children:"Save"})]})})]})]})},ti=({isOpen:t,onClose:r,configs:n,activeKeys:i,configByKey:o,hasActiveFilter:s,onToggle:c,onReset:l,getValue:a,setValue:d,clearValue:f,removeFilter:g})=>{const m=i.length;return e.jsx(kt.Drawer,{position:"bottom",isShow:t,onHide:r,children:e.jsxs(h.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(h.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(h.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(w.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),m>0&&e.jsxs(w.Text,{fontSize:"sm",color:"subtle",children:["(",m,")"]})]}),e.jsx(z.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:r})]}),e.jsxs(h.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[m>0&&e.jsxs(h.Box,{direction:"column",gap:"sm",children:[e.jsx(w.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(h.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(gn,{activeKeys:i,configByKey:o,getValue:a,setValue:d,clearValue:f,removeFilter:g})})]}),n.length>0&&e.jsxs(h.Box,{direction:"column",gap:"sm",children:[e.jsx(w.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(h.Box,{direction:"column",children:n.map(j=>{const L=i.includes(j.key),y=!!j.locked;return e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:y?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[j.icon&&e.jsx(h.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:j.icon}),e.jsx(w.Text,{fontSize:"sm",color:"primary",truncate:!0,children:j.label})]}),e.jsx(st.Toggle,{size:"sm",checked:L||y,disabled:y,onChange:()=>c(j.key),"aria-label":`Toggle ${j.label}`})]},j.key)})})]})]}),e.jsxs(h.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(h.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(z.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!s,onClick:l,children:"Reset"})}),e.jsx(h.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(z.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:r,children:"Selesai"})})]})]})})},ri=t=>`${t} Rows`,ni=({perPageKey:t,pageKey:r,pageSizeOptions:n,defaultPerPage:i=10,showPageSize:o})=>{const{searchQueries:s,setSearchParams:c,searchParams:l}=Se(),a=l.get(t),d=a?Number(a):i,f=g=>{c({...s,[t]:g,[r]:"1"})};return o?e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(I.MenuLists,{children:e.jsxs(I.MenuBody,{style:{minWidth:200},children:[e.jsx(h.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(w.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),n.map(g=>e.jsx(I.MenuItem,{selected:g===d,endIcon:g===d?e.jsx(B.Icon,{name:"Check"}):void 0,onClick:()=>f(String(g)),children:ri(g)},g))]})})]}):null},oi=t=>{var Ve;const{withPadding:r,configs:n,activeKeys:i,configByKey:o,hasActiveFilter:s,toggleFilter:c,removeFilter:l,getValue:a,setValue:d,clearValue:f,onReset:g,searchable:m,searchKey:j,filterKey:L,pageKey:y,searchPlaceholder:D,searchShortcut:E,pagination:v,perPageKey:W,pageSizeOptions:b,defaultPerPage:R,showPagination:O,showResultCount:C,showPageSize:F,hasColumns:H,orderedColumns:Z,allVisible:N,onToggleVisibility:X,onReorder:se,onSetAllHidden:he,showSavedViews:te,savedViews:ae,onApplyView:K,onDeleteView:P,onSaveView:re}=t,[le,ue]=u.useState(!1),{searchQueries:ke,setSearchParams:Ee}=Se(),xe=(v==null?void 0:v.rangeStart)??(((v==null?void 0:v.currentPage)||0)>1?(((v==null?void 0:v.currentPage)||0)-1)*((v==null?void 0:v.perPage)||0)+1:1),Be=(v==null?void 0:v.rangeEnd)??((v==null?void 0:v.totalCurrentPage)!==(v==null?void 0:v.perPage)?v==null?void 0:v.totalData:((v==null?void 0:v.currentPage)||1)*((v==null?void 0:v.totalCurrentPage)||0)),He=ye=>{Ee({...ke,[y]:String(ye)})},je=C||O&&!!(v!=null&&v.totalPage),Pe=()=>{g(),ue(!1)};return e.jsxs(h.Box,{direction:"column",gap:"sm",fullWidth:!0,paddingTop:r?"sm":void 0,paddingBottom:r?"sm":void 0,paddingLeft:r?"md":void 0,paddingRight:r?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[m&&e.jsx(yn,{searchKey:j,filterKey:L,pageKey:y,placeholder:D,shortcut:E}),e.jsx(z.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"FilterHorizontal"}),onClick:()=>ue(!0),"aria-label":"Open filters",children:s?`Filter: ${i.length}`:null}),e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[te&&e.jsx(jn,{views:ae,onApply:K,onDelete:P,onSave:re}),H&&e.jsx(pn,{columns:Z,allVisible:N,onToggle:X,onReorder:se,onSetAllHidden:he}),e.jsx(ni,{perPageKey:W,pageKey:y,pageSizeOptions:b,defaultPerPage:R,showPageSize:F})]})]}),je&&e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[C?e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${xe}-${Be} of ${((Ve=v==null?void 0:v.totalData)==null?void 0:Ve.toLocaleString())||0}`}):e.jsx(h.Box,{direction:"column"}),O&&!!(v!=null&&v.totalPage)&&e.jsx(ut.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:v!=null&&v.currentPage?Number(v.currentPage):1,totalPages:Number(v.totalPage),onPageChange:He})]}),e.jsx(ti,{isOpen:le,onClose:()=>ue(!1),configs:n,activeKeys:i,configByKey:o,hasActiveFilter:s,onToggle:c,onReset:Pe,getValue:a,setValue:d,clearValue:f,removeFilter:l})]})},ii=({withPadding:t=!1,filterConfigs:r=[],filterKey:n="filter",activeFilterKey:i="filters",pageKey:o="page",perPageKey:s="perPage",pageSizeOptions:c=[25,50,100],defaultPerPage:l,showPagination:a=!0,showResultCount:d=!0,showPageSize:f=!0,searchable:g=!1,searchKey:m="q",searchPlaceholder:j="Search",searchShortcut:L="/",pagination:y,columns:D=[],onColumnsChange:E,columnsState:v,scopeId:W,savedViews:b,persistLastState:R=!0,storage:O=dr,onReset:C})=>{const F=W??(b==null?void 0:b.scopeId),{activeKeys:H,configByKey:Z,hasActiveFilter:N,toggleFilter:X,removeFilter:se,getValue:he,setValue:te,clearValue:ae,clearAll:K}=ar({configs:r,filterKey:n,activeFilterKey:i,pageKey:o,searchKey:m}),P=Mo({columns:D,scopeId:F,storage:O,onColumnsChange:E,value:v}),re=Lo({scopeId:F,storage:O,snapshotKeys:[i,n,s],pageKey:o,getColumns:()=>P.state,applyColumns:P.applyState}),le=Io({scopeId:F,storage:O,snapshotKeys:[i,n,o],enabled:R}),ue=To({scopeId:F,storage:O,perPageKey:s,pageSizeOptions:c,enabled:R});Wo({enabled:R&&!!F,snapshotKeys:[i,n,o],perPageKey:s,readSnapshot:le.read,readPerPage:ue.read});const ke=l??c[0]??25,Ee=!!(b!=null&&b.enabled)&&re.enabled,xe=()=>{K(),le.clear(),C==null||C()};return ge.useMediaQuery("md")?e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",fullWidth:!0,paddingTop:t?"sm":void 0,paddingBottom:t?"sm":void 0,paddingLeft:t?"md":void 0,paddingRight:t?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Ro,{configs:r,activeKeys:H,onToggle:X,hasActiveFilter:N,onReset:xe}),e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(gn,{activeKeys:H,configByKey:Z,getValue:he,setValue:te,clearValue:ae,removeFilter:se}),N&&e.jsx(z.Button,{variant:"link",tone:"brand",size:"sm",onClick:xe,children:"Reset"})]})]}),e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[e.jsx(Ko,{pagination:y,pageKey:o,perPageKey:s,pageSizeOptions:c,defaultPerPage:ke,showPagination:a,showResultCount:d,showPageSize:f}),g&&e.jsx(yn,{searchKey:m,filterKey:n,pageKey:o,placeholder:j,shortcut:L}),Ee&&e.jsx(jn,{views:re.views,onApply:re.applyView,onDelete:re.deleteView,onSave:re.saveView}),D.length>0&&e.jsx(pn,{columns:P.orderedColumns,allVisible:P.allVisible,onToggle:P.toggleVisibility,onReorder:P.reorder,onSetAllHidden:P.setAllHidden})]})]}):e.jsx(oi,{withPadding:t,configs:r,activeKeys:H,configByKey:Z,hasActiveFilter:N,toggleFilter:X,removeFilter:se,getValue:he,setValue:te,clearValue:ae,onReset:xe,searchable:g,searchKey:m,filterKey:n,pageKey:o,searchPlaceholder:j,searchShortcut:L,pagination:y,perPageKey:s,pageSizeOptions:c,defaultPerPage:ke,showPagination:a,showResultCount:d,showPageSize:f,hasColumns:D.length>0,orderedColumns:P.orderedColumns,allVisible:P.allVisible,onToggleVisibility:P.toggleVisibility,onReorder:P.reorder,onSetAllHidden:P.setAllHidden,showSavedViews:Ee,savedViews:re.views,onApplyView:re.applyView,onDeleteView:re.deleteView,onSaveView:re.saveView})},si=t=>{if(!Array.isArray(t)||t.length===0)return;const r=t[0];return(r==null?void 0:r.value)!=null?String(r.value):void 0},li=t=>{if(!Array.isArray(t)||t.length===0)return;const r=t.map(n=>(n==null?void 0:n.value)!=null?String(n.value):null).filter(n=>n!=null);return r.length?r:void 0},ci=(t,r)=>{switch(t.type){case"dropdown":case"radio":return si(r);case"dropdown-multiple":case"checkbox-multiple":return li(r);case"date":return r instanceof Date?r.toISOString():void 0;case"date-compact":return r;default:return}},Hr=(t,r)=>{if(t==null||t==="")return r;const n=Number(t);return Number.isFinite(n)&&n>0?n:r},ai=t=>{const{filterConfigs:r,filterKey:n="filter",activeFilterKey:i="filters",pageKey:o="page",perPageKey:s="perPage",searchKey:c="q",defaultPage:l=1,defaultPerPage:a=10,paramKeys:d,serialize:f}=t,{activeKeys:g,configByKey:m,hasActiveFilter:j,getValue:L}=ar({configs:r,filterKey:n,activeFilterKey:i,pageKey:o,searchKey:c}),{searchParams:y}=Se(),D=y.toString();return u.useMemo(()=>{const v={},W={},b=Hr(y.get(o),l),R=Hr(y.get(s),a);v[(d==null?void 0:d.page)??"page"]=b,v[(d==null?void 0:d.perPage)??"perPage"]=R;const O=Mt(c,y,n)||"";O&&(v[(d==null?void 0:d.search)??"search"]=O);let C=!1;for(const F of g){const H=m[F];if(!H)continue;const Z=L(H);W[F]=Z;const N=f==null?void 0:f[F],X=N?N(Z):ci(H,Z);if(X==null||Array.isArray(X)&&X.length===0)continue;const se=(d==null?void 0:d[F])??F;v[se]=X,C=!0}return{params:v,raw:W,hasActiveFilter:j||!!O||C}},[D,g.join("|"),n,i,o,s,c,l,a,d,f,m])},di=["dropdown","dropdown-multiple","checkbox-multiple","radio"],ui=({filterConfigs:t,filterKey:r,activeFilterKey:n,pageKey:i,searchKey:o})=>{const{configByKey:s,getValue:c,setValue:l,removeFilter:a,clearAll:d,hasActiveFilter:f}=ar({configs:t,filterKey:r,activeFilterKey:n,pageKey:i,searchKey:o}),g=(E,v)=>{var b;const W=E.options;return((b=W==null?void 0:W.find(R=>R.value===v))==null?void 0:b.label)??v},m=u.useCallback(E=>{const v=s[E];if(!v)return[];const W=c(v);return Array.isArray(W)?W.map(b=>String(b.value)):[]},[s,c]),j=u.useCallback((E,v)=>{const W=s[E];if(!W||!di.includes(W.type))return;const b=Array.isArray(v)?v:[v];if(b.length===0){a(E);return}l(W,b.map(R=>({label:g(W,R),value:R})))},[s,l,a]),L=u.useCallback((E,v)=>{const W=m(E);j(E,W.includes(v)?W.filter(b=>b!==v):[...W,v])},[m,j]),y=u.useCallback((E,v)=>m(E).includes(v),[m]),D=u.useCallback(E=>a(E),[a]);return{set:j,toggle:L,clear:D,clearAll:d,isActive:y,values:m,hasActiveFilter:f}},xi=(t,r)=>{if(!t)return{};const{fromKey:n,toKey:i,opKey:o}=r,s={};switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date&&(s[n]=new Date(t.date).toISOString()),o&&(s[o]=t.op),s;case"is-between":return t.from&&(s[n]=new Date(t.from).toISOString()),t.to&&(s[i]=new Date(t.to).toISOString()),s;case"is-relative-to-today":{if(!t.relative)return s;const{from:c,to:l}=fn(t.relative);return s[n]=c.toISOString(),s[i]=l.toISOString(),s}case"is-empty":case"is-not-empty":return o&&(s[o]=t.op==="is-empty"?"empty":"not-empty"),s;default:return s}},bn=({children:t,borderRadius:r,height:n})=>{const i=u.useRef(null),[o,s]=u.useState("100vh");return u.useEffect(()=>{if(n)return;const c=()=>{if(i.current){const l=i.current.getBoundingClientRect().top;s(`calc(100vh - ${l}px)`)}};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[n]),e.jsx(h.Box,{ref:i,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:r||"rounded-xs",style:{height:n??o,display:"flex",flexDirection:"column"},children:t})},Cn=({action:t,rightContent:r,leftContent:n,headerSlot:i,advanceFilter:o,showFilter:s=!0})=>{const c=ge.useMediaQuery("md"),l=s?e.jsx(hn,{...o}):null,a=()=>t?u.isValidElement(t)?t:e.jsx(h.Box,{style:{display:"flex",flexDirection:c?"row":"column",gap:"8px",width:c?"auto":"100%",textWrap:"nowrap"},children:t.map(({title:d,icon:f,buttonProps:g,onClick:m},j)=>!d&&!f?null:e.jsx(z.Button,{fullWidth:!c,iconLeft:f?e.jsx(B.Icon,{name:f}):void 0,onClick:m,...g,children:d},`action-${j}`))}):null;return e.jsx(h.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:i?i({filter:l}):e.jsxs(e.Fragment,{children:[e.jsxs(h.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[l,n]}),e.jsxs(h.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[r,a()]})]})})},hi=({totalData:t,withMarginBottom:r=!0,withMarginTop:n=!0})=>e.jsxs(h.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:r?"16px":void 0,marginTop:n?"16px":void 0},children:[e.jsxs(We.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(We.Body1,{children:t||0})]}),vn=({pagination:t,pageKey:r="page",perPageKey:n="perPage",defaultPerPage:i=10,showPagination:o=!0,totalData:s})=>{const{searchQueries:c,setSearchParams:l,searchParams:a}=Se(),d=a.get(n),f=L=>{l({...c,[r]:String(L)})},g=L=>{l({...c,[n]:L,[r]:"1"})},m=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:1),j=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.totalCurrentPage)||0));return e.jsx(h.Box,{style:{display:"flex",width:"100%",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0},children:o?e.jsxs(e.Fragment,{children:[e.jsxs(h.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(w.Text,{children:"Rows Per Page: "}),e.jsx(ot.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:L=>{g(L[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${i} per row`,value:`${i}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${i} per row`,value:`${i}`}]}),e.jsx(w.Text,{children:`${m}-${j} of ${(t==null?void 0:t.totalData)||0}`})]}),e.jsx(ut.Pagination,{currentPage:t!=null&&t.currentPage?Number(t==null?void 0:t.currentPage):1,totalPages:t!=null&&t.totalPage?Number(t==null?void 0:t.totalPage):1,onPageChange:f})]}):e.jsx(hi,{totalData:s,withMarginBottom:!1,withMarginTop:!1})})},wn=({filter:t,columnTitle:r})=>{const[n,i]=u.useState(!1),o=u.useRef(null),s=u.useRef(null),c=u.useRef(null),[l,a]=u.useState(""),[d,f]=u.useState({top:0,left:0}),g=t.selectedValues,m=u.useMemo(()=>l?t.options.filter(y=>y.label.toLowerCase().includes(l.toLowerCase())):t.options,[t.options,l]);u.useEffect(()=>{if(n&&s.current){const y=s.current.getBoundingClientRect(),D=280,E={top:y.bottom+8};t.position==="left"||y.left+D>window.innerWidth?E.right=window.innerWidth-y.right:E.left=y.left,f(E)}},[n,t.position]),u.useEffect(()=>{n&&c.current?setTimeout(()=>{var y;return(y=c.current)==null?void 0:y.focus()},50):a("")},[n]),u.useEffect(()=>{const y=D=>{o.current&&!o.current.contains(D.target)&&s.current&&!s.current.contains(D.target)&&i(!1)};return n&&document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n]);const j=y=>{const D=g.includes(y)?g.filter(E=>E!==y):[...g,y];t.onFilterChange(D)},L=()=>t.onFilterChange([]);return e.jsxs(h.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(h.Box,{ref:s,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:y=>{var D;y.stopPropagation(),n||(D=t.onOpen)==null||D.call(t),i(E=>!E)},children:e.jsx(B.Icon,{name:n?"ChevronUp":"ChevronDown",size:"sm",style:{color:g.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),n&&e.jsxs(h.Box,{ref:o,style:{position:"fixed",top:`${d.top}px`,...d.left!==void 0?{left:`${d.left}px`}:{right:`${d.right}px`},backgroundColor:"white",borderRadius:"4px",minWidth:"280px",maxHeight:"400px",display:"flex",flexDirection:"column",zIndex:9999,animation:"fadeInDropdown 0.15s ease-out",border:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(h.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(w.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",r]}),g.length>0&&e.jsx(h.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(w.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:y=>{y.stopPropagation(),L()},children:"CLEAR"})})]}),!t.hideSearch&&e.jsx(h.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(qe.Input,{ref:c,placeholder:`Search ${r.toLowerCase()}...`,leftIcon:e.jsx(B.Icon,{name:"Search",size:"sm"}),value:l,onChange:y=>a(y.target.value),style:{fontSize:"14px"}})}),e.jsx(h.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:t.isLoadingOptions?e.jsxs(h.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(B.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):m.length>0?e.jsx(h.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:m.map(y=>e.jsxs(h.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:g.includes(y.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:D=>{D.stopPropagation(),j(y.value)},onMouseEnter:D=>{g.includes(y.value)||(D.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),D.currentTarget.style.transform="translateX(2px)"},onMouseLeave:D=>{D.currentTarget.style.backgroundColor=g.includes(y.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",D.currentTarget.style.transform="translateX(0)"},children:[e.jsx(lt.Checkbox,{checked:g.includes(y.value),onChange:()=>{}}),e.jsx(w.Text,{fontSize:"sm",fontWeight:g.includes(y.value)?"medium":"normal",color:g.includes(y.value)?"primary":"gray-700",children:y.label})]},y.value))}):e.jsxs(h.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(B.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),g.length>0&&e.jsx(h.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(h.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(h.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:g.length}),e.jsxs(w.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",g.length>1?"s":""," selected"]})]})})]})]})},fi=({direction:t})=>{const r="var(--sa-text-primary, #292a2e)",n="var(--sa-text-subtle, #8c8f97)",i=t==="asc"?r:n,o=t==="desc"?r:n,s=t==="asc"?1:.45,c=t==="desc"?1:.45;return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:0},"aria-hidden":!0,children:[e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:i,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:o,opacity:c},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},mi=({frozen:t})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:t?"currentColor":"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:t?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),Qt="var(--sa-background-primary, #ffffff)",Pr="var(--sa-background-primary-inverse, #f8f8f8)",Dn=({columns:t,records:r,handleDetail:n,handleUpdate:i,handleDelete:o,isLoading:s,visibleHandleDelete:c,visibleHandleUpdate:l,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:f,frozenCount:g=0,onFrozenCountChange:m,customActions:j,actionsOrder:L=["detail","update","delete","custom"],customEmptyState:y,enableColumnResize:D=!1,defaultColumnWidths:E,onColumnWidthsChange:v,defaultMinColumnWidth:W=60,sort:b,defaultSort:R,onSortChange:O,showActionDivider:C=!1})=>{const F=b!==void 0,[H,Z]=u.useState(R??null),N=F?b??null:H,X=M=>{if(M.sortKey)return M.sortKey;if(typeof M.accessor=="string")return M.accessor},se=M=>{const A=X(M);if(!A)return;let V;!N||N.key!==A?V={key:A,direction:"asc"}:N.direction==="asc"?V={key:A,direction:"desc"}:V=null,F||Z(V),O==null||O(V)},te=[n,i,o].filter(M=>M!==void 0).length,ae=!!j,K=!!n||!!i||!!o||ae,P="var(--sa-border-subtle, #0b120e24)",re=`1px solid ${P}`,le=`inset 1px 0 0 ${P}`,ue=`inset -1px 0 0 ${P}`,ke=te===3?ae?"178px":"140px":te===2?ae?"140px":"102px":te===1?ae?"112px":"74px":ae?"74px":"",Ee=(M,A)=>{if(!A)return M;if(typeof A=="function")return A(M);if(typeof A=="string")return M[A]},[xe,Be]=u.useState(!1);u.useEffect(()=>{if(!(f!=null&&f.current))return;const M=f.current;Be(M.scrollHeight>M.clientHeight)},[r,f]);const He=u.useRef(null),[je,Pe]=u.useState([]),[Ve,ye]=u.useState(()=>E??{}),Me=u.useRef(null);u.useLayoutEffect(()=>{if(!g||!He.current){Pe([]);return}const M=Array.from(He.current.querySelectorAll("thead tr th")),A=[];let V=0;M.forEach((q,Y)=>{A[Y]=V,Y<g&&(V+=q.offsetWidth)}),Pe(A)},[g,t,r,Ve]);const Ze=M=>{m&&m(M<g?M:M+1)},S=(M,A)=>{const V=Ve[M];if(V!==void 0){const q=`${V}px`;return{width:q,minWidth:q,maxWidth:q}}return A?{width:A}:{}},G=M=>D&&(M.resizable??!0),_=(M,A)=>{M.preventDefault(),M.stopPropagation();const V=M.currentTarget.closest("th");if(!V)return;const q=Math.round(V.getBoundingClientRect().width);Me.current={colIndex:A,startX:M.clientX,startWidth:q};const Y=document.body.style.userSelect,pe=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const we=Ie=>{var Ue;const Fe=Me.current;if(!Fe)return;const Ge=((Ue=t[Fe.colIndex])==null?void 0:Ue.minWidth)??W,Qe=Math.max(Ge,Fe.startWidth+(Ie.clientX-Fe.startX));ye(Te=>Te[Fe.colIndex]===Qe?Te:{...Te,[Fe.colIndex]:Qe})},Le=()=>{document.removeEventListener("mousemove",we),document.removeEventListener("mouseup",Le),document.body.style.userSelect=Y,document.body.style.cursor=pe,Me.current=null,v&&ye(Ie=>(v(Ie),Ie))};document.addEventListener("mousemove",we),document.addEventListener("mouseup",Le)};return e.jsx("div",{ref:He,children:e.jsxs(Q.Table,{fullWidth:!0,children:[e.jsx(Q.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(Q.Tr,{children:[t.map((M,A)=>{var Ke,$e;const V=g>0&&A<g,q=je[A]??0,Y=G(M),we=A===t.length-1&&K&&C,Le=X(M),Ie=!!M.sortable&&!!Le,Fe=Ie&&(N==null?void 0:N.key)===Le?N.direction:null,Ge=M.title||((Ke=M.accessor)==null?void 0:Ke.toString())||"",Qe=($e=M.headerTooltip)!=null&&$e.showIcon?e.jsx(B.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,Ue=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ge}),Te=Ie?e.jsxs("button",{type:"button",onClick:()=>se(M),title:Fe==="asc"?"Sorted ascending — click to sort descending":Fe==="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:M.textAlign==="text-right"?"right":M.textAlign==="text-center"?"center":"left"},children:[Ue,Qe,e.jsx(fi,{direction:Fe})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Ue,Qe]});return e.jsxs(Q.Th,{style:{position:"sticky",top:0,left:V?q:void 0,zIndex:V?4:2,paddingLeft:A===0?"12px":"",borderRight:d&&!we&&!V?re:void 0,borderBottom:d?re:void 0,boxShadow:d&&V?ue:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:M.textAlign==="text-right"?"right":M.textAlign==="text-center"?"center":"left",...S(A,M.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[M.headerTooltip?e.jsx(Ce.Tooltip,{label:M.headerTooltip.content,position:"bottom",children:Te}):Te,M.filter&&e.jsx(wn,{filter:M.filter,columnTitle:M.title}),m&&e.jsx("button",{onClick:()=>Ze(A),title:V?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:V?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:V?1:.45,transition:"opacity 0.15s"},children:e.jsx(mi,{frozen:V})})]}),Y&&e.jsx("div",{onMouseDown:et=>_(et,A),onClick:et=>et.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-${A}`)}),K?e.jsx(Q.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?re:void 0,boxShadow:d&&C?le:void 0}}):null]})}),e.jsx(Q.Tbody,{children:s?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:t.length+1,children:e.jsxs(h.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"})]})})}):!(r!=null&&r.length)&&y?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:t.length+1,children:y})}):r==null?void 0:r.map((M,A)=>e.jsxs(Q.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:A===r.length-1&&xe?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:V=>{const q=V.currentTarget;q.style.backgroundColor=Pr,Array.from(q.querySelectorAll("td")).forEach(Y=>{Y.style.position==="sticky"&&(Y.style.backgroundColor=Pr)})},onMouseLeave:V=>{const q=V.currentTarget;q.style.backgroundColor="",Array.from(q.querySelectorAll("td")).forEach(Y=>{Y.style.position==="sticky"&&(Y.style.backgroundColor=Qt)})},children:[t.map((V,q)=>{const Y=V.render?V.render(M,A,r):Ee(M,V.accessor),pe=g>0&&q<g,we=je[q]??0,Le=Ve[q]!==void 0,Ie=pe&&q===g-1;return e.jsx(Q.Td,{style:{position:pe?"sticky":void 0,left:pe?we:void 0,zIndex:pe?1:void 0,backgroundColor:pe?Qt:void 0,transition:pe?"background-color 0.3s ease":void 0,paddingLeft:q===0?"12px":"",whiteSpace:"nowrap",overflow:Le?"hidden":void 0,borderLeft:V.showBorderLeft?re:void 0,borderRight:V.showBorderRight?re:void 0,boxShadow:Ie?ue:void 0,textAlign:V.textAlign==="text-right"?"right":V.textAlign==="text-center"?"center":"left",...S(q,V.width)},children:typeof Y=="string"?e.jsx(w.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:V.textAlign==="text-right"?"right":V.textAlign==="text-center"?"center":"left"},children:Y}):Y},`row-${A}-col-${q}`)}),K?e.jsx(Q.Td,{style:{width:ke,position:"sticky",right:0,zIndex:1,backgroundColor:Qt,boxShadow:C?le:void 0,transition:"background-color 0.3s ease"},children:e.jsx(oe.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:L.map(V=>{const q=A===r.length-1?"top":"bottom";return V==="detail"&&n&&(a==null?void 0:a(M))!==!1?e.jsx(Ce.Tooltip,{label:"Detail",position:q,children:e.jsx(z.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(M.id,M),iconLeft:e.jsx(B.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):V==="update"&&i&&(l==null?void 0:l(M))!==!1?e.jsx(Ce.Tooltip,{label:"Update",position:q,children:e.jsx(z.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>i(M),iconLeft:e.jsx(B.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):V==="delete"&&o&&(c==null?void 0:c(M))!==!1?e.jsx(Ce.Tooltip,{label:"Delete",position:q,children:e.jsx(z.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(M.id,M),iconLeft:e.jsx(B.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):V==="custom"?e.jsx(u.Fragment,{children:j==null?void 0:j(M)},"custom"):null})})}):null]},`${M}${A}`))})]})})},gi=({wrapperProps:t,dataTableProps:r,headerProps:n,footerProps:i})=>{var g;const o=u.useRef(null),[s,c]=u.useState((r==null?void 0:r.defaultFrozenCount)??0),l=(n==null?void 0:n.show)??!0,a=u.useRef(null),d=(g=r==null?void 0:r.pagination)==null?void 0:g.totalData;typeof d=="number"&&(a.current=d);const f=(i==null?void 0:i.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(bn,{...t,children:[l&&e.jsx(Cn,{...n}),e.jsx(h.Box,{direction:"column",ref:o,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:r?e.jsx(Dn,{...r,scrollParentRef:o,frozenCount:r!=null&&r.enableFreezeColumns?s:0,onFrozenCountChange:r!=null&&r.enableFreezeColumns?c:void 0}):null}),f&&e.jsx(vn,{pagination:r==null?void 0:r.pagination,pageKey:r==null?void 0:r.pageKey,perPageKey:r==null?void 0:r.perPageKey,defaultPerPage:r==null?void 0:r.defaultPerPage,showPagination:r==null?void 0:r.showPagination,totalData:i==null?void 0:i.totalData})]})};function yi(t){return u.memo(t)}const pi=yi(gi),Nr=200,Ut="1px solid var(--sa-border-subtle, #0b120e24)",ji=({sortDir:t,frozen:r})=>t==="asc"?e.jsx(B.Icon,{name:"ChevronSmallUp"}):t==="desc"?e.jsx(B.Icon,{name:"ChevronSmallDown"}):r?e.jsx(B.Icon,{name:"LockOn",size:"xs"}):e.jsx(B.Icon,{name:"Filter",size:"xs"}),pt=({icon:t,label:r,active:n,danger:i,onClick:o})=>{const s=i?"var(--sa-color-error-600, #c9184a)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:n?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:s,textAlign:"left"},onMouseEnter:c=>{n||(c.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:c=>{c.currentTarget.style.background=n?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(B.Icon,{name:t,size:"sm",style:{color:s,flexShrink:0}}),e.jsx(w.Text,{as:"span",style:{color:s},children:r})]})},Sn=({active:t,canSort:r,canHide:n,sortDir:i,frozen:o,onSort:s,onClearSort:c,onToggleFreeze:l,onHide:a})=>{const[d,f]=u.useState(!1),g=u.useRef(null),m=u.useRef(null),[j,L]=u.useState({top:0,left:0});u.useEffect(()=>{if(d&&g.current){const D=g.current.getBoundingClientRect(),E=D.left+Nr>window.innerWidth;L({top:D.bottom+6,...E?{right:window.innerWidth-D.right}:{left:D.left}})}},[d]),u.useEffect(()=>{if(!d)return;const D=E=>{m.current&&!m.current.contains(E.target)&&g.current&&!g.current.contains(E.target)&&f(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[d]);const y=D=>{D(),f(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:g,type:"button",className:"sa-tl-menu-trigger","data-active":t||d?"true":"false",onClick:D=>{D.stopPropagation(),f(E=>!E)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:Ut,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(ji,{sortDir:i,frozen:o})}),d&&e.jsxs(h.Box,{ref:m,onClick:D=>D.stopPropagation(),style:{position:"fixed",top:`${j.top}px`,...j.left!==void 0?{left:`${j.left}px`}:{right:`${j.right}px`},minWidth:Nr,backgroundColor:"var(--sa-background-primary, #ffffff)",border:Ut,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"0 6px 24px rgba(0,0,0,0.12)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(pt,{icon:"ChevronUp",label:"Ascending",active:i==="asc",onClick:()=>y(()=>i==="asc"?c():s("asc"))}),e.jsx(pt,{icon:"ChevronDown",label:"Descending",active:i==="desc",onClick:()=>y(()=>i==="desc"?c():s("desc"))}),e.jsx("div",{style:{borderTop:Ut,margin:"4px 0"}})]}),e.jsx(pt,{icon:"Pin1",label:o?"Unfreeze":"Freeze",active:o,onClick:()=>y(l)}),n&&e.jsx(pt,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>y(a)})]})]})},jt="1px solid var(--sa-border-subtle, #0b120e24)",bi="var(--sa-text-subtle, #8c8f97)",at="var(--sa-background-neutral, #f0f1f2)",_r="2px 0 4px -2px rgba(0,0,0,0.15)",bt={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},qr="sa-table-layout-styles",Ci=()=>{if(typeof document>"u"||document.getElementById(qr))return;const t=document.createElement("style");t.id=qr,t.textContent=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const mr=require("@starasia/alert"),_e=require("@starasia/badges"),h=require("@starasia/box"),rt=require("@starasia/breadcrumb"),z=require("@starasia/button"),gr=require("@starasia/card"),Xe=require("@starasia/date"),Oe=require("@starasia/dialog"),kt=require("@starasia/drawer"),ot=require("@starasia/dropdown"),ye=require("@starasia/hooks"),it=require("@starasia/http"),qe=require("@starasia/input"),I=require("@starasia/menu"),ut=require("@starasia/pagination"),dt=require("@starasia/storage"),G=require("@starasia/table"),yr=require("@starasia/tabs"),Xt=require("@starasia/textarea"),nt=require("@starasia/theme"),pr=require("@starasia/toast"),st=require("@starasia/toggle"),Ce=require("@starasia/tooltip"),lt=require("@starasia/checkbox"),Kt=require("@starasia/radio"),w=require("@starasia/text"),B=require("@starasia/icon"),ie=require("@starasia/flex"),jr=require("@starasia/grid"),br=require("@starasia/progress"),Cr=require("@starasia/stepper"),vr=require("@starasia/accordion"),wr=require("@starasia/story-record"),Ve=require("@starasia/skeleton"),Dr=require("@starasia/progress-stepper"),e=require("react/jsx-runtime"),u=require("react"),ge=require("react-router"),tr=require("react-dom"),qn=require("react-easy-crop"),Zn={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},rr=u.createContext(Zn),nr=()=>u.useContext(rr),Gr=t=>{const[r,n]=u.useState((t==null?void 0:t.initialUserData)||null);return{userData:r,setUserData:n}},Qr=u.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),Ur=({children:t})=>{const[r,n]=u.useState({}),i=u.useCallback(l=>{n(a=>typeof l=="function"?l(a):l)},[]),o=u.useCallback((l,a)=>{n(d=>{const f=typeof a=="function"?a(d[l]):a;return{...d,[l]:f}})},[]),s=u.useCallback(l=>{n(a=>{if(!(l in a))return a;const d={...a};return delete d[l],d})},[]),c=u.useMemo(()=>({badges:r,setBadge:o,setBadges:i,clearBadge:s}),[r,o,i,s]);return e.jsx(Qr.Provider,{value:c,children:t})},Jr=()=>u.useContext(Qr),wt=(t,r)=>{const n=r!==void 0?r:t;return n==null?null:typeof n=="string"||typeof n=="number"?{value:n}:n},Yr=({router:t,menus:r=[],menuBottom:n,logo:i,appName:o="Workspace",initialUserData:s,theme:c})=>{const l=Gr({initialUserData:s}),{theme:a}=nt.useTheme();return e.jsx(rr.Provider,{value:{logo:i,appName:o,menus:r,userData:l.userData,setUserData:l.setUserData,menuBottom:n},children:e.jsx(Ur,{children:c?e.jsx(nt.ThemeProvider,{value:c,children:t}):a?e.jsx(nt.ThemeProvider,{value:a,children:t}):t})})},Gn=u.memo(Yr);function Xr({collapsed:t=!1,children:r}){if(!r)return null;const n=typeof r=="function",i=n?r({collapsed:t}):r;return i==null||i===!1?null:e.jsx("div",{style:{position:"sticky",top:"4rem",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:"0.5rem",paddingRight:"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:n?i:e.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.3s",visibility:t?"hidden":"visible"},children:i})})}const or=u.createContext(null);function Kr({children:t}){const[r,n]=u.useState(null),[i,o]=u.useState(null),[s,c]=u.useState(null),[l,a]=u.useState(0),d=u.useCallback(()=>(a(f=>f+1),()=>a(f=>f-1)),[]);return e.jsx(or.Provider,{value:{prependNode:r,appendNode:i,replaceNode:s,setPrependNode:n,setAppendNode:o,setReplaceNode:c,replaceCount:l,registerReplace:d},children:t})}function $r({children:t}){const r=u.useContext(or);return r?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:r.setPrependNode,style:{display:"contents"}}),r.replaceCount>0?e.jsx("div",{ref:r.setReplaceNode,style:{display:"contents"}}):t,e.jsx("div",{ref:r.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:t})}function Qn({children:t,mode:r="append"}){const n=u.useContext(or);if(u.useEffect(()=>{if(!(r!=="replace"||!n))return n.registerReplace()},[r,n]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const i=r==="prepend"?n.prependNode:r==="replace"?n.replaceNode:n.appendNode;return i?tr.createPortal(t,i):null}const ir=u.createContext(null);function en({children:t}){const[r,n]=u.useState({}),[i,o]=u.useState({}),s=u.useCallback((a,d)=>{n(f=>f[a]===d?f:{...f,[a]:d})},[]),c=u.useCallback(a=>(o(d=>({...d,[a]:(d[a]??0)+1})),()=>o(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),l=u.useMemo(()=>({outletNodes:r,setOutletNode:s,slotCounts:i,registerSlot:c}),[r,s,i,c]);return e.jsx(ir.Provider,{value:l,children:t})}function tn({slotKey:t,fallback:r}){const n=u.useContext(ir),i=n?(n.slotCounts[t]??0)>0:!1,o=u.useRef(n==null?void 0:n.setOutletNode);o.current=n==null?void 0:n.setOutletNode;const s=u.useCallback(c=>{var l;return(l=o.current)==null?void 0:l.call(o,t,c)},[t]);return e.jsx(e.Fragment,{children:i?e.jsx("div",{ref:s,style:{display:"contents"}}):r})}function Un({slotKey:t,children:r}){const n=u.useContext(ir),i=u.useRef(n==null?void 0:n.registerSlot);if(i.current=n==null?void 0:n.registerSlot,u.useEffect(()=>{var s;return(s=i.current)==null?void 0:s.call(i,t)},[t]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const o=n.outletNodes[t];return o?tr.createPortal(r,o):null}const Bt="moduleSwitcherGroupId",$t="sa-module-switcher-change";function Sr(){if(typeof window>"u")return null;const t=window.localStorage.getItem(Bt);if(t===null)return null;const r=Number(t);return Number.isFinite(r)?r:null}function rn(t){typeof window>"u"||(t===null?window.localStorage.removeItem(Bt):window.localStorage.setItem(Bt,String(t)),window.dispatchEvent(new CustomEvent($t,{detail:t})))}function Jn(){rn(null)}function sr(){const[t,r]=u.useState(()=>Sr());return u.useEffect(()=>{const i=()=>{r(Sr())},o=s=>{s.key===Bt&&i()};return window.addEventListener($t,i),window.addEventListener("storage",o),()=>{window.removeEventListener($t,i),window.removeEventListener("storage",o)}},[]),{selectedGroupId:t,setSelectedGroupId:i=>{rn(i),r(i)}}}let gt=0,Ye=!1,kr=new Set;const Br=()=>e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"1.667",y:"1.667",width:"12.667",height:"12.667",rx:"2"}),e.jsx("line",{x1:"6",y1:"1.667",x2:"6",y2:"14.333"})]}),Fr={width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",paddingLeft:"0.75rem",paddingRight:"0.75rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",fontSize:"0.875rem",color:"var(--sa-text-subtle, #8c8f97)",background:"transparent",border:"none",borderRadius:"0.375rem",cursor:"pointer",textAlign:"left"};function Yn({children:t,headerLeftSlot:r,profile:n,isLoadingProfile:i,onLogout:o,isLoggingOut:s,loadingComponent:c,sidebarHeaderContent:l,headerActions:a,profileRole:d,profileMenuButtons:f,profileMenuItems:g,logoutButton:m}){var Me,Ze;const[j]=ge.useSearchParams(),L=j.get("embed")==="true",y=nr(),{badges:D}=Jr(),F=ge.useNavigate(),v=ge.useLocation(),b=!ye.useMediaQuery("md"),[O,R]=u.useState(!1),[C,E]=u.useState(!1),[H,P]=u.useState(!1),[q,Y]=u.useState(!1),[le,he]=u.useState(()=>new Set(kr)),[ne,ae]=u.useState(null),{selectedGroupId:X,setSelectedGroupId:$}=sr();u.useEffect(()=>{kr=le},[le]);const te=u.useRef(null),re=u.useRef(null);u.useEffect(()=>{const S=te.current;if(!S)return;const Z=()=>{Ye||(gt=S.scrollTop)};return S.addEventListener("scroll",Z),()=>S.removeEventListener("scroll",Z)},[]);const ue=()=>{const S=te.current;S&>>0&&(Ye=!0,S.scrollTop=gt,requestAnimationFrame(()=>{Ye=!1}))};u.useLayoutEffect(()=>{Ye=!0,ue();const S=setTimeout(()=>{Ye=!1},300);return()=>clearTimeout(S)},[]),u.useLayoutEffect(()=>{y.menus.length>0&&(gt>0?ue():requestAnimationFrame(()=>{var Z;const S=(Z=te.current)==null?void 0:Z.querySelector("[data-menu-active='true']");S&&S.scrollIntoView({block:"center",behavior:"instant"})}))},[y.menus]),u.useEffect(()=>{Ye=!0,ue();const S=setTimeout(ue,0),Z=setTimeout(ue,50),N=setTimeout(ue,100),M=setTimeout(ue,200),A=setTimeout(()=>{Ye=!1},300),V=setTimeout(()=>{const _=te.current,J=_==null?void 0:_.querySelector("[data-menu-active='true']");if(_&&J){const je=_.getBoundingClientRect(),De=J.getBoundingClientRect();De.top>=je.top&&De.bottom<=je.bottom||J.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(S),clearTimeout(Z),clearTimeout(N),clearTimeout(M),clearTimeout(A),clearTimeout(V)}},[v.pathname]),u.useEffect(()=>{re.current&&(re.current.scrollTop=0)},[v.pathname]),u.useEffect(()=>{b&&P(!1)},[v.pathname,b]),u.useEffect(()=>{b&&E(!0)},[b]);const Fe=()=>{R(!0)},Ee=()=>{R(!1)},fe=()=>{R(!1),o()},ve=S=>{const Z=[S.to];return S.children&&Z.push(...S.children.map(N=>N.to)),Z},Re=[...y.menus.flatMap(S=>S.items.flatMap(ve)),...((Me=y.menuBottom)==null?void 0:Me.flatMap(ve))??[]],xe=S=>{if(!v.pathname.startsWith(S))return!1;const Z=Re.filter(N=>v.pathname.startsWith(N)).sort((N,M)=>M.length-N.length)[0];return S===Z};u.useEffect(()=>{var Z;const S=N=>{var M;(M=N.children)!=null&&M.some(A=>v.pathname.startsWith(A.to))&&he(A=>{const V=new Set(A);return V.add(N.id),V})};y.menus.forEach(N=>{N.items.forEach(S)}),(Z=y.menuBottom)==null||Z.forEach(S)},[v.pathname,y.menus,y.menuBottom]);const Pe=S=>{he(Z=>{const N=new Set(Z);return N.has(S)?N.delete(S):N.add(S),N})};u.useEffect(()=>{y.menus.length!==0&&X!==null&&!y.menus.some(S=>S.id===X)&&$(null)},[y.menus,X,$]);const He=u.useMemo(()=>{if(X!==null)return y.menus.filter(N=>N.id===X||N.parentGroupId===X);const S=y.menus.filter(N=>N.parentGroupId===void 0),Z=y.menus.filter(N=>N.parentGroupId!==void 0).flatMap(N=>N.items);return Z.length===0?S:[...S,{id:18,name:"Pengaturan",items:Z,parentGroupId:void 0}]},[y.menus,X]);if(L)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:t||e.jsx(ge.Outlet,{})});const pe=S=>{const Z=S.children&&S.children.length>0,N=le.has(S.id),M=Z?S.children.some(_=>xe(_.to)):xe(S.to),A=wt(S.badge,D[S.id]),V=!!A&&C&&!b;return e.jsxs("div",{"data-menu-active":M||void 0,children:[e.jsxs("button",{onClick:_=>{if(Z)if(C&&!b){const J=_.currentTarget.getBoundingClientRect();ae({item:S,top:J.top,left:J.right+8})}else Pe(S.id);else F(S.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:C&&!b?"center":void 0,gap:"0.5rem",paddingLeft:C&&!b?"0":"0.5rem",paddingRight:C&&!b?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:M?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:M?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:M?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:C&&!b?S.title:void 0,onMouseEnter:_=>{M||(_.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:_=>{M||(_.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(B.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),V&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:"-2px",right:"-2px",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-error-500, #ff4d6d)",border:"1px solid var(--sa-background-primary, #ffffff)"}})]}),(!C||b)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",transition:"opacity 0.3s",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:S.title}),A&&e.jsx(_e.Badges,{text:String(A.value),variant:A.variant??"info",size:"xs",border:!0}),Z&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:N?"rotate(180deg)":"rotate(0deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),Z&&(!C||b)&&(()=>{const _=S.children.findIndex(J=>xe(J.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:N?`${S.children.length*36}px`:"0px",opacity:N?1:0,marginTop:N?"0.25rem":"0px"},children:[e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"1.5px",height:"100%",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),_>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${_*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),S.children.map(J=>{const je=wt(J.badge,D[J.id]);return e.jsxs("button",{onClick:()=>F(J.to),style:{width:"100%",display:"flex",alignItems:"center",gap:"0.5rem",paddingLeft:"0.75rem",paddingRight:"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:xe(J.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:xe(J.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:xe(J.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:xe(J.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:De=>{xe(J.to)||(De.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:De=>{xe(J.to)||(De.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(B.Icon,{name:J.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:J.title}),je&&e.jsx(_e.Badges,{text:String(je.value),variant:je.variant??"info",size:"xs",border:!0})]},J.id)})]})})()]},S.id)};return e.jsx(en,{children:e.jsxs(Kr,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":b?"0px":C?"4.375rem":"16.375rem","--app-footer-zindex":b&&H?"40":"999"},children:[b&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:H?.5:0,pointerEvents:H?"auto":"none",transition:"opacity 0.3s"},onClick:()=>P(!1)}),e.jsxs("aside",{style:{width:b?"16.375rem":C?"4.375rem":"16.375rem",position:b?"fixed":"relative",...b&&{inset:0,zIndex:50,transform:H?"translateX(0)":"translateX(-100%)"},backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",borderRight:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",flexDirection:"column",transition:"all 0.3s ease-in-out",flexShrink:b?void 0:0},children:[e.jsx("div",{onMouseEnter:()=>Y(!0),onMouseLeave:()=>Y(!1),style:{height:"4rem",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",position:"relative"},children:(()=>{const S=!b&&C&&!H,Z=S&&q;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:S?1:void 0,justifyContent:S?"center":void 0,transition:"opacity 0.2s",opacity:Z?0:1,pointerEvents:Z?"none":"auto"},children:[e.jsx("img",{src:y.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!C||H)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:y.appName})]}),!b&&!C&&e.jsx("button",{type:"button",onClick:()=>E(!0),"aria-label":"Collapse sidebar",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1rem",height:"1rem",padding:0,background:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer",flexShrink:0},children:e.jsx(Br,{})}),S&&e.jsx("button",{type:"button",onClick:()=>E(!1),"aria-label":"Expand sidebar",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2rem",height:"2rem",padding:0,background:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-sm, 0.375rem)",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer",opacity:Z?1:0,pointerEvents:Z?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(Br,{})})}),b&&e.jsx("button",{onClick:()=>P(!1),"aria-label":"Close menu",style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.25rem",height:"1.25rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})()}),l&&e.jsx(Xr,{collapsed:b?!1:C,children:l}),e.jsx("div",{ref:te,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:He.map(S=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!C||b?S.name&&e.jsx("div",{style:{paddingLeft:"1.5rem",paddingRight:"1rem",paddingTop:"0rem",paddingBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"400",color:"var(--sa-text-subtlest, #6b6e76)",transition:"opacity 0.3s",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:S.name}):S.name&&e.jsx("div",{"aria-label":S.name,style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"0.75rem",paddingBottom:"0.75rem"},children:e.jsx("span",{style:{display:"block",width:"1rem",height:"2px",borderRadius:"1px",backgroundColor:S.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx("div",{style:{paddingLeft:"1rem",paddingRight:"1rem",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)"},children:S.slotKey?e.jsx(tn,{slotKey:S.slotKey,fallback:S.items.map(Z=>pe(Z))}):S.items.map(Z=>pe(Z))})]},S.id))}),y.menuBottom&&y.menuBottom.length>0&&e.jsx("div",{style:{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",paddingTop:"0.75rem",paddingBottom:"0.75rem",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)",flexShrink:0},children:y.menuBottom.map(S=>pe(S))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("header",{style:{height:"4rem",backgroundColor:"var(--sa-background-primary, #ffffff)",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[b&&e.jsx("button",{onClick:()=>P(!0),style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.5rem",height:"1.5rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),e.jsx($r,{children:r})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[a,e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[e.jsxs("div",{style:{textAlign:"right",maxWidth:"12.5rem"},children:[e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:500,color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i?"Loading...":(n==null?void 0:n.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i?"":(n==null?void 0:n.email)||"unknown"})]}),e.jsx("div",{style:{width:"2.5rem",height:"2.5rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"0.875rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",flexShrink:0,backgroundColor:"var(--sa-background-brand, #04254f)"},children:((n==null?void 0:n.name)||"U")[0].toUpperCase()}),e.jsx(B.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(I.MenuLists,{style:{width:"280px",paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(I.MenuHeading,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",paddingBlock:"0.5rem"},children:[e.jsx("div",{style:{width:"4rem",height:"4rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"1.25rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",marginBottom:"0.75rem",backgroundColor:"var(--sa-background-brand, #04254f)"},children:((n==null?void 0:n.name)||"U")[0].toUpperCase()}),e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:600,color:"var(--sa-text-primary, #292a2e)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(n==null?void 0:n.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(n==null?void 0:n.email)||"unknown"}),d&&e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d})]})}),(f&&f.length>0||g)&&e.jsxs(I.MenuBody,{children:[f==null?void 0:f.map((S,Z)=>e.jsx(I.MenuButton,{children:e.jsxs("button",{type:"button",onClick:S.onClick,style:Fr,onMouseEnter:N=>{N.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:N=>{N.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(B.Icon,{name:S.icon,size:"md"}),e.jsx("span",{children:S.label})]})},`${S.label}-${Z}`)),g]}),m??e.jsx(I.MenuFooter,{children:e.jsx(I.MenuButton,{children:e.jsxs("button",{type:"button",onClick:Fe,style:{...Fr,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:S=>{S.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:S=>{S.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(B.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:re,style:{flex:1,overflowY:"auto"},children:t||e.jsx(ge.Outlet,{})})]})]}),s&&c&&e.jsx("div",{style:{position:"fixed",inset:0,background:"var(--sa-color-black-alpha-a70, #181a19b8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:c}),e.jsxs(Oe.Dialog,{isShow:O,onHide:Ee,children:[e.jsx(Oe.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Oe.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Oe.DialogFooter,{children:e.jsx(h.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(ie.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(h.Box,{direction:"column",children:e.jsx(z.Button,{secondary:!0,onClick:Ee,children:"Cancel"})}),e.jsx(h.Box,{direction:"column",children:e.jsx(z.Button,{primary:!0,onClick:fe,children:"Yes, Sure"})})]})})})]}),ne&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>ae(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":ne.item.title,style:{position:"fixed",top:ne.top,left:ne.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem",backgroundColor:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-md, 0.5rem)",boxShadow:"var(--sa-shadow-lg, 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a)",padding:"0.5rem",display:"flex",flexDirection:"column",gap:"0.125rem"},children:[e.jsx("div",{style:{fontSize:"0.75rem",fontWeight:600,color:"var(--sa-color-gray-500, #8c8f97)",padding:"0.25rem 0.5rem 0.5rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:ne.item.title}),(Ze=ne.item.children)==null?void 0:Ze.map(S=>{const Z=xe(S.to),N=wt(S.badge,D[S.id]);return e.jsxs("button",{onClick:()=>{F(S.to),ae(null)},style:{width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.5rem 0.75rem",borderRadius:"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:Z?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:Z?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:M=>{Z||(M.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:M=>{Z||(M.currentTarget.style.backgroundColor="transparent")},children:[S.icon&&e.jsx(B.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:S.title}),N&&e.jsx(_e.Badges,{text:String(N.value),variant:N.variant??"info",size:"xs",border:!0})]},S.id)})]})]})]})})}const Et=u.forwardRef(({children:t,...r},n)=>e.jsx(h.Box,{ref:n,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...r,children:t})),Er=({title:t,iconName:r,textColor:n,iconColor:i,hoverTextColor:o,hoverIconColor:s})=>{const[c,l]=u.useState(!1),a=i??"var(--sa-text-subtle, #8c8f97)",d=n??"var(--sa-text-subtle, #8c8f97)",f=s??"var(--sa-text-subtle, #8c8f97)",g=o??"var(--sa-text-primary, #292a2e)";return e.jsxs(h.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{cursor:"pointer"},children:[e.jsx(B.Icon,{name:r||"ChevronLeft",size:"xs",style:{color:c?f:a,transition:"color 0.15s ease"}}),e.jsx(w.Text,{variant:"sub-h3",style:{color:c?g:d,transition:"color 0.15s ease"},children:t||"Back"})]})},Xn=({items:t,separator:r="/",iconName:n,iconColor:i,hoverIconColor:o})=>{const[s,c]=u.useState(!1),l=i??"var(--sa-text-subtle, #8c8f97)",a=o??"var(--sa-text-subtle, #8c8f97)",d=t.length>1?t[0]:void 0,f=!!(d!=null&&d.to||d!=null&&d.onClick),g=e.jsx(B.Icon,{name:n||"ChevronLeft",size:"xs",onMouseEnter:f?()=>c(!0):void 0,onMouseLeave:f?()=>c(!1):void 0,style:{color:f&&s?a:l,transition:"color 0.15s ease",cursor:f?"pointer":void 0}}),m=d!=null&&d.to?e.jsx(ge.Link,{to:d.to,replace:!0,style:{textDecoration:"none"},children:g}):d!=null&&d.onClick?e.jsx(Et,{onClick:d.onClick,children:g}):g;return e.jsxs(h.Box,{direction:"row",gap:"xs",align:"center",children:[m,e.jsx(rt.Breadcrumb,{separator:r,size:"md",children:t.map((j,L)=>{const y=L===t.length-1;return j.to&&!y?e.jsx(rt.BreadcrumbItem,{children:e.jsx(ge.Link,{to:j.to,children:j.label})},L):e.jsx(rt.BreadcrumbItem,{currentPage:y,children:e.jsx(rt.BreadcrumbLink,{onClick:y?void 0:j.onClick,children:j.label})},L)})})]})},Kn=t=>{const{items:r,separator:n,onClick:i,navigateTo:o,...s}=t;return r&&r.length>0?e.jsx(Xn,{items:r,separator:n,iconName:s.iconName,iconColor:s.iconColor,hoverIconColor:s.hoverIconColor}):o?e.jsx(h.Box,{direction:"row",children:e.jsx(ge.Link,{to:o,replace:!0,style:{textDecoration:"none"},children:e.jsx(Er,{...s})})}):e.jsx(h.Box,{direction:"row",children:e.jsx(Et,{onClick:i,children:e.jsx(Er,{...s})})})},_t=[{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 Mr(t,r,n){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:t?`2px solid ${n.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:t?n.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:t?r?`0 8px 20px ${n.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${n.activeShadow}`:r?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:r?"translateY(-3px) scale(1.05)":"translateY(0) scale(1)",transition:"box-shadow 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease"}}const Lr={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},Ir={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function nn({isShow:t,onHide:r,menus:n,selectedGroupId:i,onSelect:o}){const[s,c]=u.useState(void 0),l=d=>{o(d),r()},a=_t[0];return e.jsx(Oe.Dialog,{isShow:t,onHide:r,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Oe.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>l(null),onMouseEnter:()=>c("all"),onMouseLeave:()=>c(void 0),style:Ir,children:[e.jsx("div",{style:Mr(i===null,s==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(B.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Lr,children:"Semua"})]}),n.map((d,f)=>{var y;const g=i===d.id,m=s===d.id,j=((y=d.items[0])==null?void 0:y.icon)??"Grid",L=_t[(f+1)%_t.length];return e.jsxs("button",{onClick:()=>l(d.id),onMouseEnter:()=>c(d.id),onMouseLeave:()=>c(void 0),style:Ir,children:[e.jsx("div",{style:Mr(g,m,L),children:e.jsx("div",{style:{color:L.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(B.Icon,{name:j,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Lr,children:d.name})]},d.id)})]})})})}function $n({onSelect:t,"aria-label":r="Pilih module"}={}){const n=nr(),i=ge.useNavigate(),{selectedGroupId:o,setSelectedGroupId:s}=sr(),[c,l]=u.useState(!1),a=d=>{var f;if(s(d),d!==null){const g=n.menus.find(j=>j.id===d),m=(f=g==null?void 0:g.items[0])==null?void 0:f.to;m&&i(m)}t==null||t(d)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>l(!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2.25rem",height:"2.25rem",borderRadius:"var(--sa-radii-sm, 0.25rem)",border:"1px solid var(--sa-border-subtle, #0b120e24)",color:"var(--sa-text-subtle, #8c8f97)",backgroundColor:"transparent",cursor:"pointer"},"aria-label":r,onMouseEnter:d=>{d.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:e.jsx(B.Icon,{name:"GridApplication",size:"sm"})}),o!==null&&e.jsx("span",{style:{position:"absolute",top:"0.25rem",right:"0.25rem",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-brand-500, #1a4fa0)"},"aria-hidden":"true"})]}),e.jsx(nn,{isShow:c,onHide:()=>l(!1),menus:n.menus.filter(d=>d.parentGroupId===void 0),selectedGroupId:o,onSelect:a})]})}const eo=(t,r)=>{const n=[];if(r===0)return n.push(t),n;for(let i=0;i<t.length;i+=r){const o=t.slice(i,i+r);n.push(o)}return n},to=u.memo(({value:t,label:r,separator:n,labelWidth:i,lastIndex:o,labelAlign:s="top"})=>{const c=u.useMemo(()=>({padding:0,paddingBottom:o?0:12,verticalAlign:s}),[o,s]),l=u.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:o?0:12,verticalAlign:s}),[o,s]),a=()=>typeof r=="string"?e.jsx(w.Text,{fontWeight:"medium",color:"subtlest",children:r}):r,d=()=>typeof t=="string"||typeof t=="number"?e.jsx(w.Text,{color:"primary",fontWeight:"medium",children:t}):t,f=()=>typeof n=="string"||typeof n=="number"?e.jsx(w.Text,{fontWeight:"medium",color:"subtlest",children:n}):n;return e.jsxs(G.Tr,{children:[e.jsx(G.Td,{style:c,width:i,children:a()}),n?e.jsx(G.Td,{style:l,width:24,children:f()}):null,e.jsx(G.Td,{style:c,children:d()})]})}),ro=u.memo(({fields:t,separator:r,labelWidth:n})=>e.jsx(G.Table,{children:t.map((i,o)=>e.jsx(to,{separator:r,labelWidth:n,lastIndex:o===t.length-1,...i},`field-group-field-${o}`))})),no=u.memo(({maxRow:t=0,maxColumn:r=2,separator:n=":",fields:i=[],labelWidth:o=150,bordered:s=!1})=>{const c=u.useMemo(()=>eo(i,t),[i,t]),l=c.length>2,a=()=>{switch(r){case 1:return"width-full";case 2:return"width-1-2";case 3:return"width-1-3";case 4:return"width-1-4";default:return"width-1-2"}};return e.jsx(h.Box,{gap:l?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:l?"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,f)=>e.jsx(h.Box,{direction:"column",flex:l?void 0:"1",width:l?a():void 0,marginBottom:l?"lg":void 0,children:e.jsx(ro,{labelWidth:o,fields:d,separator:n})},f))})}),oo=({backButton:t})=>{const[r,n]=u.useState(!1),i=(t==null?void 0:t.iconColor)??"var(--sa-text-subtle, #8c8f97)",o=(t==null?void 0:t.textColor)??"var(--sa-text-subtle, #8c8f97)",s=(t==null?void 0:t.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",c=(t==null?void 0:t.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(h.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{cursor:"pointer"},children:[e.jsx(B.Icon,{name:(t==null?void 0:t.iconName)||"ChevronLeft",size:"xs",style:{color:r?s:i,transition:"color 0.15s ease"}}),e.jsx(w.Text,{variant:"sub-h3",style:{color:r?c:o,textDecoration:r?"underline":"none",transition:"color 0.15s ease"},children:(t==null?void 0:t.title)||"Back"})]})},io=({backButton:t,title:r,titleIcon:n,titleTag:i,children:o,header:s=!0,headerBorder:c=!1,subHeaders:l,action:a,titleTagProps:d,containerProps:f,headerProps:g})=>{const m=ye.useMediaQuery("md"),j=ge.useNavigate(),L=ge.useLocation(),y=t==null?void 0:t.show,D=()=>{if(typeof(t==null?void 0:t.onClick)=="function"){t.onClick();return}j(-1,{replace:!0})},F=()=>{if(!a)return null;if(u.isValidElement(a))return a;const C=a.filter(E=>E&&(E.title||E.icon));return C.length===0?null:m?e.jsx(h.Box,{direction:"row",gap:"md",children:C.map(({title:E,icon:H,buttonProps:P,onClick:q},Y)=>e.jsx(z.Button,{iconLeft:H?e.jsx(B.Icon,{name:H,size:"md"}):void 0,onClick:q,...P,children:E},`action-${Y}`))}):e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(B.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{minWidth:200},children:C.map(({title:E,icon:H,buttonProps:P,onClick:q},Y)=>{const le=(P==null?void 0:P.tone)==="error"||(P==null?void 0:P.danger)===!0;return e.jsx(I.MenuItem,{intent:le?"danger":void 0,disabled:P==null?void 0:P.disabled,startIcon:H?e.jsx(B.Icon,{name:H}):void 0,onClick:q,children:E},`action-${Y}`)})})})]})},v=()=>{const C=e.jsx(oo,{backButton:t});return t!=null&&t.navigateTo?e.jsx(h.Box,{direction:"row",children:e.jsx(ge.Link,{to:t.navigateTo,replace:!0,style:{textDecoration:"none"},children:C})}):e.jsx(h.Box,{direction:"row",children:e.jsx(Et,{onClick:D,children:C})})},W=()=>{const C=!!r,E=Array.isArray(a)&&a.length>0,H=u.isValidElement(a)?!0:E;if(!C&&!H&&!y)return null;const q=m||!m&&E;return e.jsxs(h.Box,{direction:"column",gap:"xs",paddingBlock:(g==null?void 0:g.paddingBlock)??"sm",paddingInline:(g==null?void 0:g.paddingInline)??"md",...g,style:{...c?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...g==null?void 0:g.style},children:[y&&v(),(C||H)&&e.jsxs(h.Box,{direction:q?"row":"column",gap:"sm",justify:"space-between",align:q?"center":"flex-start",children:[C?typeof r=="string"?e.jsxs(h.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(h.Box,{direction:"row",gap:"sm",align:"center",children:[n&&e.jsx(B.Icon,{name:n,size:"md",color:"primary"}),e.jsx(w.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:r})]}),i&&e.jsx(_e.Badge,{border:!0,size:"lg",text:i,...d})]}):r:null,F()]})]})},b=()=>{if(!l||l.length===0)return null;let C=0,E=-1/0;return l.forEach((H,P)=>{const q=H.order??0;q>=E&&(E=q,C=P)}),l.map(({content:H,order:P,borderBottom:q=!0},Y)=>e.jsx(h.Box,{direction:"column",paddingTop:"sm",paddingBottom:q||Y===C?"sm":"spacing-0",paddingInline:"md",style:{...q?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...P!==void 0?{order:P}:{}},children:H},`sub-header-${Y}`))},O=()=>{const C=s?W():null,E=b();return!C&&!E?null:e.jsxs(h.Box,{direction:"column",style:{marginBottom:l&&l.length>0?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[C,E]})},R=()=>o;return e.jsxs(h.Box,{direction:"column",as:"main",...f,style:{...(f==null?void 0:f.style)??{},animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"},children:[O(),R()]},L.pathname)},so=u.memo(io),lo={icon:"Cross",title:""},co="calc(100vw - 16px)",Tr=t=>t==null?void 0:`min(${typeof t=="number"?`${t}px`:t}, ${co})`,on=u.forwardRef(({onHide:t,show:r,withBlur:n=!1,style:i,children:o,closeButton:s=lo,width:c,minWidth:l="357px",maxWidth:a="357px"},d)=>{const f=Tr(c??l),g=Tr(c??a);return e.jsx(kt.Drawer,{blur:n,isShow:r,position:"right",onHide:t,ref:d,style:{minWidth:f,maxWidth:g,...i},children:e.jsxs(h.Box,{direction:"column",padding:"lg",children:[s?e.jsxs(h.Box,{direction:"row",align:"center",gap:"sm",onClick:t,marginBottom:"lg",cursor:"pointer",children:[e.jsx(B.Icon,{name:s.icon,size:"md",color:"subtle",cursor:"pointer"}),s.title?e.jsx(w.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:s.title}):null]}):null,o]})})}),lr=u.memo(({children:t,borderBottom:r=!0,padding:n=!0})=>{const i=ye.useMediaQuery("lg");return e.jsx(h.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),cr=u.memo(({children:t,borderTop:r=!0,padding:n=!0})=>{const i=ye.useMediaQuery("lg");return e.jsx(h.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),ao=u.memo(({children:t,...r})=>e.jsx(h.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...r,children:t})),uo=u.memo(({children:t,title:r,titleTag:n,action:i,header:o,footer:s,actionContainer:c,containerProps:l,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:f={borderTop:!0},variantTag:g="info"})=>{const m=ye.useMediaQuery("lg"),j=()=>n?e.jsxs(h.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(w.Text,{fontWeight:"medium",children:r}),e.jsx(_e.Badges,{border:!0,text:n,variant:g})]}):e.jsx(w.Text,{fontWeight:"medium",children:r}),L=()=>o||e.jsxs(h.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(h.Box,{direction:"column",children:r?j():null}),e.jsx(h.Box,{direction:"column",style:m?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...c,children:i??null})]}),y=!!(o||r||i);return e.jsxs(h.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...l,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(l==null?void 0:l.style)??{}},children:[o!==null&&y?e.jsx(lr,{...d,children:L()}):null,e.jsx(ao,{...a,children:t}),s?e.jsx(cr,{...f,children:s}):null]})}),xo=t=>e.jsx(w.Text,{variant:"h1",children:t.children,...t.props}),ho=t=>e.jsx(w.Text,{variant:"h2",children:t.children,...t.props}),fo=t=>e.jsx(w.Text,{variant:"h3",children:t.children,...t.props}),mo=t=>e.jsx(w.Text,{variant:"h4",children:t.children,...t.props}),go=t=>e.jsx(w.Text,{variant:"h5",children:t.children,...t.props}),yo=t=>e.jsx(w.Text,{variant:"h6",children:t.children,...t.props}),po=t=>e.jsx(w.Text,{variant:"sub-h1",children:t.children,...t.props}),jo=t=>e.jsx(w.Text,{variant:"sub-h2",children:t.children,...t.props}),bo=t=>e.jsx(w.Text,{variant:"sub-h3",children:t.children,...t.props}),Co=t=>e.jsx(w.Text,{variant:"body-1",children:t.children,...t.props}),vo=t=>e.jsx(w.Text,{variant:"body-2",children:t.children,...t.props}),wo=t=>e.jsx(w.Text,{variant:"body-3",children:t.children,...t.props}),We={H1:xo,H2:ho,H3:fo,H4:mo,H5:go,H6:yo,SubH1:po,SubH2:jo,SubH3:bo,Body1:Co,Body2:vo,Body3:wo},ke=()=>{const[t,r]=ge.useSearchParams(),n=it.searchParamsToObject(t.toString()),i=ge.useParams(),o=ge.useLocation(),s=i.id;return{setSearchParams:r,searchParams:t,searchQueries:n,isHasQuery:(f,g)=>t.has(f)&&t.get(f)===g,getQueryParam:f=>t.get(f),getRouteParam:f=>i[f],params:i,location:o,id:s,hasId:!!s}},sn=t=>JSON.stringify(t),ln=t=>JSON.stringify(t),cn=t=>JSON.stringify(t),an=t=>JSON.stringify(t),Do=t=>t,So=t=>JSON.stringify(t),xt=({value:t,name:r,type:n,withSearchParam:i=!0,setSearchParams:o,searchQueries:s,dropdownSearchKey:c,filterKey:l="filter",pageKey:a="page"})=>{if(i){let d;switch(n){case"search":d=Do(t);break;case"dropdown":case"dropdown-multiple":d=sn(t);break;case"radio":d=ln(t);break;case"date-range":d=cn(t);break;case"advanced-date-range":d=So(t);break;case"date":d=an(t);break;default:d=t;break}if(typeof d<"u"){const g={...s[l]&&typeof s[l]=="string"?JSON.parse(s[l]):void 0,[r]:d},m={...s};c&&typeof c=="string"&&delete m[c],delete m[a];const j={...m,[l]:JSON.stringify(g)},L=new URLSearchParams(s).toString(),y=new URLSearchParams(j).toString();if(L===y)return;o(j)}}},Dt=({name:t,filterKey:r="filter",searchParams:n,get:i})=>{const o=n.get(r)||void 0,s=o&&typeof o=="string"?JSON.parse(o):void 0,c=s?s[t]:void 0;return i==="label"&&c?JSON.parse(c)[0].label:i==="value"&&c?JSON.parse(c)[0].value:c},dn=({name:t,filterKey:r="filter",searchParams:n,get:i})=>{const o=n.get(r)||void 0,s=o&&typeof o=="string"?JSON.parse(o):void 0,c=s?s[t]:void 0;return i==="label"&&c?JSON.parse(c).map(l=>l.label):i==="value"&&c?JSON.parse(c).map(l=>l.value):i==="array"&&c?JSON.parse(c):c},ko=({name:t,filterKey:r="filter",searchParams:n,get:i})=>{const o=n.get(r)||void 0,s=o&&typeof o=="string"?JSON.parse(o):void 0,c=s?s[t]:void 0;return i==="id"&&c?JSON.parse(c).id:i==="label"&&c?JSON.parse(c).label:i==="value"&&c?JSON.parse(c).value:c},Mt=(t,r,n)=>{const i=r.get(n||"filter")||void 0,o=i&&typeof i=="string"?JSON.parse(i):void 0;return o?o[t]:void 0},Bo=({name:t,filterKey:r="filter",searchParams:n})=>{const i=n.get(r||"filter")||void 0,o=i&&typeof i=="string"?JSON.parse(i):void 0,s=o?o[t]:void 0;return{start:s?JSON.parse(s).from:void 0,end:s?JSON.parse(s).to:void 0}},un=({name:t,filterKey:r="filter",searchParams:n})=>{const i=n.get(r||"filter")||void 0,o=i&&typeof i=="string"?JSON.parse(i):void 0,s=o?o[t]:void 0;return s?JSON.parse(s):void 0},Fo=(t,{filterKey:r="filter",perPageKey:n="perPage",pageKey:i="page"})=>{const o=t.get(r)||void 0,s=t.get(n)||void 0,c=t.get(i)||void 0;return!!o||!!s||!!c},xn=({isOpen:t,onClose:r,filterKey:n,pageKey:i,filters:o})=>{const{searchParams:s,setSearchParams:c,searchQueries:l}=ke(),[a,d]=u.useState({}),f=()=>{s.delete(n||"filter"),c(s)},g=(m,j)=>{switch(m.type){case"radio":{const{show:L=!0}=m;return L&&e.jsx(h.Box,{direction:"column",children:e.jsx(h.Box,{direction:"column",children:m.title})},j)}case"dropdown":{const{show:L=!0}=m;return L&&e.jsx(h.Box,{direction:"column",children:e.jsx(h.Box,{direction:"column",children:m.title})},j)}case"date-range":return e.jsx(h.Box,{direction:"column",children:e.jsx(h.Box,{direction:"column",children:m.title})},j);case"date":return e.jsx(h.Box,{direction:"column",children:e.jsx(h.Box,{direction:"column",children:m.title})},j);case"dropdown-multiple":{const{show:L=!0}=m;return L&&e.jsx(h.Box,{direction:"column",children:e.jsx(h.Box,{direction:"column",children:m.title})},j)}default:return null}};return e.jsx(on,{onHide:r,show:t||!1,children:e.jsxs(h.Box,{direction:"column",gap:"md",children:[e.jsxs(ie.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(h.Box,{direction:"column",children:"Filter"}),e.jsx(h.Box,{direction:"column",style:{cursor:"pointer"},onClick:f,children:"Reset"})]}),o==null?void 0:o.map((m,j)=>g(m,j))]})})},hn=({searchKey:t="q",statusKey:r="status",searchPlaceholder:n="Search",searchHighlightPlaceholder:i,extendedFilter:o,showSearchFilter:s=!0,showStatusFilter:c=!0,filterKey:l="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:f,filterConfigs:g,buttonToggleProps:m,position:j="right",titleSearchLabel:L="Work Order",withTitleLabels:y=!1})=>{const F=(m==null?void 0:m.isShowLabel)??!0,[v,W]=u.useState(!1),[b,O]=u.useState(0),R=()=>{O($=>$+1)},{searchParams:C,setSearchParams:E,getQueryParam:H}=ke(),P=it.searchParamsToObject(C.toString()),q=Mt(t,C,l)||"",[Y,le]=u.useState(q),he=H(l),ae=!!(he&&!(()=>{if(he)try{const $=JSON.parse(he);return Object.keys($).length===1&&$[t]===""}catch($){console.error("Filter parameter is not a valid JSON:",$)}return!1})()),X=ye.useMediaQuery("md");return u.useEffect(()=>{le(q)},[q]),u.useEffect(()=>{if(Y===q)return;const $=window.setTimeout(()=>{xt({value:Y,name:t,type:"search",searchQueries:P,setSearchParams:E,filterKey:l,pageKey:a})},350);return()=>{window.clearTimeout($)}},[Y,q,t,P,E,l,a]),e.jsxs(ie.Flex,{gap:"md",style:{flexDirection:X&&j==="left"?"row":X&&j==="right"?"row-reverse":"column"},align:"flex-end",children:[ae&&e.jsx(h.Box,{direction:"column",justify:"flex-end",children:e.jsx(z.Button,{onClick:()=>{const $=new URLSearchParams(C);$.delete(l),E($),le(""),R(),f&&f()},variant:"outline",tone:"neutral",children:e.jsx(w.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),o==null?void 0:o.map(({minWidth:$,content:te,title:re,onClickContainer:ue},Fe)=>e.jsxs(h.Box,{direction:"column",gap:"sm",onClick:ue,style:{minWidth:$},children:[re&&e.jsx(We.SubH3,{children:re}),te]},`extended-filter-${Fe}-${b}`)),!!(g!=null&&g.length)&&e.jsx(z.Button,{primary:ae,secondary:!ae,iconLeft:e.jsx(B.Icon,{size:"sm",name:(m==null?void 0:m.icon)||"FilterHorizontal",style:{color:he?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!X,onClick:()=>W(!0),children:F?"Filter":void 0}),c&&e.jsxs(h.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[y&&e.jsx(We.SubH3,{children:"Status"}),e.jsx(ot.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Dt({get:"value",name:r,searchParams:C,filterKey:l})?[{label:Dt({get:"value",name:r,searchParams:C,filterKey:l})==="active"?"Active":"InActive",value:Dt({get:"value",name:r,searchParams:C,filterKey:l})}]:[],onChange:$=>xt({value:$,name:r,type:"dropdown",searchQueries:P,setSearchParams:E,filterKey:l}),placeholder:y?"All":"All Status"},b)]}),s&&e.jsxs(h.Box,{direction:"column",gap:"sm",style:{width:d&&X?d:X?"310px":""},children:[y&&e.jsxs(We.SubH3,{children:["Search for ",L]}),e.jsx(qe.Input,{placeholder:n,leftIcon:e.jsx(B.Icon,{name:"Search",width:20,height:20}),onChange:$=>le($.target.value),value:Y,fullWidth:!0},b+1+l)]}),e.jsx(xn,{isOpen:v,onClose:()=>W(!1),filterKey:l,filters:g,pageKey:a})]})},Eo=t=>t==="checkbox-multiple"?"dropdown-multiple":t==="radio"?"dropdown":t==="date-compact"?"date":t;function ar({configs:t,filterKey:r="filter",activeFilterKey:n="filters",pageKey:i="page",searchKey:o="q"}){const{searchParams:s,setSearchParams:c,searchQueries:l}=ke(),a=u.useMemo(()=>Object.fromEntries(t.map(b=>[b.key,b])),[t]),d=u.useMemo(()=>{const b=(s.get(n)||"").split(",").map(R=>R.trim()).filter(Boolean);let O=[];try{const R=s.get(r);R&&(O=Object.keys(JSON.parse(R)).filter(C=>C!==o))}catch{}return t.map(R=>R.key).filter(R=>{const C=a[R];return(C==null?void 0:C.locked)||b.includes(R)||O.includes(R)})},[s,n,r,o,t,a]),f=u.useCallback(b=>{try{return b[r]?JSON.parse(b[r]):{}}catch{return{}}},[r]),g=u.useCallback(b=>{const O={...l};b.length?O[n]=b.join(","):delete O[n],c(O)},[l,n,c]),m=u.useCallback(b=>{d.includes(b)||g([...d,b])},[d,g]),j=u.useCallback(b=>{var E;if((E=a[b])!=null&&E.locked)return;const O={...l},R=d.filter(H=>H!==b);R.length?O[n]=R.join(","):delete O[n];const C=f(O);b in C&&(delete C[b],Object.keys(C).length?O[r]=JSON.stringify(C):delete O[r]),delete O[i],c(O)},[l,d,n,r,i,f,c,a]),L=u.useCallback(b=>d.includes(b)?j(b):m(b),[d,m,j]),y=u.useCallback(b=>{switch(b.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return dn({name:b.key,get:"array",searchParams:s,filterKey:r})||[];case"date":{const O=un({name:b.key,searchParams:s,filterKey:r});return O?new Date(O):void 0}case"date-compact":{const R=f(Object.fromEntries(s.entries()))[b.key];return R&&typeof R=="object"?R:void 0}default:return}},[s,r,f]),D=u.useCallback((b,O)=>{if(b.type==="date-compact"){const R={...l},C=f(R);O==null?delete C[b.key]:C[b.key]=O,Object.keys(C).length?R[r]=JSON.stringify(C):delete R[r],delete R[i],c(R);return}xt({value:O,name:b.key,type:Eo(b.type),searchQueries:l,setSearchParams:c,filterKey:r,pageKey:i})},[l,c,r,i,f]),F=u.useCallback(b=>{const O={...l},R=f(O);b in R&&(delete R[b],Object.keys(R).length?O[r]=JSON.stringify(R):delete O[r]),delete O[i],c(O)},[l,r,i,f,c]),v=u.useCallback(()=>{const b={...l};delete b[r],delete b[n],delete b[i],c(b)},[l,r,n,i,c]),W=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:W,addFilter:m,removeFilter:j,toggleFilter:L,getValue:y,setValue:D,clearValue:F,clearAll:v}}const dr={get(t){return dt.storage.get(t)??null},set(t,r){dt.storage.save(t,r)},remove(t){dt.storage.delete(t)}},ct={columns:t=>`filterbar:colprefs:${t}`,savedViews:t=>`filterbar:views:${t}`,lastState:t=>`filterbar:last:${t}`,perPage:t=>`filterbar:perpage:${t}`,tableSort:t=>`tablelayout:sort:${t}`},yt=(t,r)=>{const n=new Set(r.map(s=>s.key)),i=t.order.filter(s=>n.has(s));for(const s of r)i.includes(s.key)||i.push(s.key);const o=t.hidden.filter(s=>n.has(s));return{order:i,hidden:o}};function Mo({columns:t,scopeId:r,storage:n,onColumnsChange:i,value:o}){const s=u.useMemo(()=>({order:t.map(C=>C.key),hidden:[]}),[t]),c=r?ct.columns(r):void 0,l=(C,E)=>yt({order:C.order??E,hidden:C.hidden??[]},t),[a,d]=u.useState(()=>{if(o&&(o.order||o.hidden))return l(o,t.map(C=>C.key));if(c){const C=n.get(c);if(C&&Array.isArray(C.order))return yt(C,t)}return s}),f=t.map(C=>C.key).join("|");u.useEffect(()=>d(C=>yt(C,t)),[f]);const g=u.useRef(a);g.current=a;const m=o?`${(o.order??[]).join("|")}~${(o.hidden??[]).join("|")}`:null,j=u.useRef(m);u.useEffect(()=>{if(m==null||j.current===m)return;j.current=m;const C=g.current,E=l(o,C.order);E.order.join("|")===C.order.join("|")&&E.hidden.join("|")===C.hidden.join("|")||(d(E),c&&n.set(c,E))},[m,f]);const L=u.useRef(!1);u.useEffect(()=>{L.current||(L.current=!0,i==null||i(a))},[]);const y=u.useCallback(C=>{d(C),c&&n.set(c,C),i==null||i(C)},[c,n,i]),D=u.useMemo(()=>{const C=new Map(t.map(E=>[E.key,E]));return a.order.filter(E=>C.has(E)).map(E=>({...C.get(E),visible:!a.hidden.includes(E)}))},[a,t]),F=u.useCallback(C=>{const E=a.hidden.includes(C)?a.hidden.filter(H=>H!==C):[...a.hidden,C];y({...a,hidden:E})},[a,y]),v=u.useCallback((C,E)=>{if(C===E)return;const H=[...a.order],[P]=H.splice(C,1);H.splice(E,0,P),y({...a,order:H})},[a,y]),W=u.useCallback(C=>{y({...a,hidden:C?t.filter(E=>!E.locked).map(E=>E.key):[]})},[a,t,y]),b=u.useCallback(()=>y(s),[y,s]),O=u.useCallback(C=>y(yt(C,t)),[y,t]),R=a.hidden.length===0;return{state:a,orderedColumns:D,allVisible:R,toggleVisibility:F,reorder:v,setAllHidden:W,reset:b,applyState:O}}function Lo({scopeId:t,storage:r,snapshotKeys:n,pageKey:i="page",getColumns:o,applyColumns:s}){const{searchParams:c,setSearchParams:l}=ke(),a=t?ct.savedViews(t):void 0,[d,f]=u.useState(()=>a?r.get(a)||[]:[]),g=u.useCallback(y=>{f(y),a&&r.set(a,y)},[a]),m=u.useCallback(y=>{const D=y.trim();if(!D)return;const F={};n.forEach(W=>{const b=c.get(W);b!=null&&(F[W]=b)});const v={id:`${Date.now()}`,name:D,query:F,columns:o==null?void 0:o(),createdAt:Date.now()};g([...d,v])},[n,c,o,g,d]),j=u.useCallback(y=>g(d.filter(D=>D.id!==y)),[g,d]),L=u.useCallback(y=>{const D=Object.fromEntries(c.entries());n.forEach(F=>delete D[F]),Object.assign(D,y.query),delete D[i],l(D),y.columns&&(s==null||s(y.columns))},[c,n,i,l,s]);return{enabled:!!a,views:d,saveView:m,deleteView:j,applyView:L}}function Io({scopeId:t,storage:r,snapshotKeys:n,enabled:i=!0}){const{searchParams:o}=ke(),s=t&&i?ct.lastState(t):void 0,c=u.useRef(s);u.useEffect(()=>{if(!s){c.current=s;return}if(c.current!==s){c.current=s;return}const d={};n.forEach(f=>{const g=o.get(f);g!=null&&(d[f]=g)}),Object.keys(d).length!==0&&r.set(s,d)},[o,s,n,r]);const l=u.useCallback(()=>{if(!s)return null;const d=r.get(s);return d&&Object.keys(d).length>0?d:null},[s,r]),a=u.useCallback(()=>{s&&r.remove(s)},[s,r]);return{enabled:!!s,read:l,clear:a}}function To({scopeId:t,storage:r,perPageKey:n,pageSizeOptions:i,enabled:o=!0}){const{searchParams:s}=ke(),c=t&&o?ct.perPage(t):void 0,l=s.toString(),a=u.useRef(c);u.useEffect(()=>{if(!c){a.current=c;return}if(a.current!==c){a.current=c;return}const g=s.get(n);if(!g)return;const m=Number(g);!Number.isFinite(m)||m<=0||r.set(c,m)},[l,c,n,r]);const d=u.useCallback(()=>{if(!c)return null;const g=r.get(c);if(g==null)return null;const m=Number(g);return!Number.isFinite(m)||m<=0||i&&!i.includes(m)?null:String(m)},[c,r,i]),f=u.useCallback(()=>{c&&r.remove(c)},[c,r]);return{enabled:!!c,read:d,clear:f}}let qt={},Zt=!1,Gt=null;const Oo=(t,r)=>{Object.assign(qt,t),Gt=r,!Zt&&(Zt=!0,queueMicrotask(()=>{const n=qt,i=Gt;qt={},Zt=!1,Gt=null,!(!i||Object.keys(n).length===0)&&i(o=>{const s=new URLSearchParams(o);return Object.entries(n).forEach(([c,l])=>s.set(c,l)),s})}))};function Wo({enabled:t,snapshotKeys:r,perPageKey:n,readSnapshot:i,readPerPage:o}){const{searchParams:s,setSearchParams:c,location:l}=ke(),a=u.useRef(null);u.useEffect(()=>{if(!t||a.current===l.pathname)return;a.current=l.pathname;const d={};if(!s.has(n)){const f=o();f&&(d[n]=f)}if(!r.some(f=>s.has(f))){const f=i();f&&Object.assign(d,f)}Object.keys(d).length!==0&&Oo(d,c)},[l.pathname,t])}const Ro=({configs:t,activeKeys:r,onToggle:n,hasActiveFilter:i,onReset:o})=>t.length?e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{minWidth:260},title:e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),i&&o&&e.jsx(z.Button,{variant:"link",tone:"brand",size:"xs",onClick:o,children:"Reset"})]}),children:t.map(s=>e.jsx(I.MenuItem,{selected:s.locked||r.includes(s.key),disabled:s.locked,closeOnSelect:!1,startIcon:s.icon??void 0,onClick:()=>{s.locked||n(s.key)},children:s.label},s.key))})})]}):null,Lt=({onClear:t,onRemove:r})=>e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(B.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(I.MenuLists,{children:e.jsxs(I.MenuBody,{style:{width:180},children:[e.jsx(I.MenuItem,{startIcon:e.jsx(B.Icon,{name:"CrossCircle"}),onClick:t,children:"Clear value"}),r&&e.jsx(I.MenuItem,{intent:"danger",startIcon:e.jsx(B.Icon,{name:"Trash1"}),onClick:r,children:"Remove filter"})]})})]}),Ao=t=>{const r=new Date(t);return r.setHours(0,0,0,0),r},Or=(t,r,n)=>{const i=new Date(t);return n==="day"?i.setDate(i.getDate()+r):n==="week"?i.setDate(i.getDate()+r*7):n==="month"?i.setMonth(i.getMonth()+r):i.setFullYear(i.getFullYear()+r),i},fn=t=>{const r=Ao(new Date);if(t.direction==="this"){const i=new Date(r),o=new Date(r);return t.period==="week"?(i.setDate(r.getDate()-r.getDay()),o.setDate(i.getDate()+6)):t.period==="month"?(i.setDate(1),o.setMonth(o.getMonth()+1,0)):t.period==="year"&&(i.setMonth(0,1),o.setMonth(11,31)),{from:i,to:o}}const n=t.count??1;return t.direction==="past"?{from:Or(r,-n,t.period),to:r}:{from:r,to:Or(r,n,t.period)}},Wr=24,mn=t=>t.length>Wr?`${t.slice(0,Wr)}...`:t,St=t=>t.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),Ft={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"},zo=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],er={past:"Past",next:"Next",this:"This"},Vo=["day","week","month","year"],Ho=["past","next","this"],Po=t=>t.field.type==="date-compact"?e.jsx(qo,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}):e.jsx(No,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}),No=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=r?St(new Date(r)):null,c=!!s,l=c?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:mn(s)})]}):t.label;return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c?e.jsx(B.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:260},title:e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Lt,{onClear:i,onRemove:o})]}),children:e.jsx(Xe.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:t.mode,value:r,onChange:a=>a==null?i():n(a),withPadding:!1})})})]})},_o=t=>{switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date?`${Ft[t.op]} ${St(new Date(t.date))}`:null;case"is-between":return t.from&&t.to?`${St(new Date(t.from))} - ${St(new Date(t.to))}`:null;case"is-relative-to-today":{const r=t.relative;if(!r)return null;if(r.direction==="this")return`This ${r.period}`;const n=r.count??1,i=n===1?r.period:`${r.period}s`;return`${er[r.direction]} ${n} ${i}`}case"is-empty":case"is-not-empty":return Ft[t.op];default:return null}},qo=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=(r==null?void 0:r.op)??"is",c=r?_o(r):null,l=!!c,a=l?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:mn(c)})]}):t.label,d=f=>{if(f!==s){if(f==="is-empty"||f==="is-not-empty"){n({op:f});return}if(f==="is-relative-to-today"){n({op:f,relative:(r==null?void 0:r.relative)??{direction:"past",count:1,period:"week"}});return}if(f==="is-between"){n({op:f,from:r==null?void 0:r.from,to:r==null?void 0:r.to});return}n({op:f,date:r==null?void 0:r.date})}};return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:l?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l?e.jsx(B.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:a})}),e.jsxs(I.MenuLists,{children:[e.jsx(I.MenuBody,{style:{width:320},title:e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Zo,{op:s,onChange:d})]}),e.jsx(Lt,{onClear:i,onRemove:o})]}),children:e.jsx(Go,{value:r,op:s,onChange:n})}),s==="is-relative-to-today"&&e.jsx(I.MenuFooter,{children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},Zo=({op:t,onChange:r})=>e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:Ft[t]})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:200},children:zo.map(n=>e.jsx(I.MenuItem,{selected:t===n,onClick:()=>r(n),endIcon:t===n?e.jsx(B.Icon,{name:"Check"}):void 0,children:Ft[n]},n))})})]}),Go=({value:t,op:r,onChange:n})=>{if(r==="is-empty"||r==="is-not-empty")return e.jsx(h.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(r==="is-between"){const i=t!=null&&t.from||t!=null&&t.to?{from:t!=null&&t.from?new Date(t.from):null,to:t!=null&&t.to?new Date(t.to):null}:void 0;return e.jsx(Xe.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,value:i,onChange:o=>{if(o==null){n({op:r});return}if(typeof o=="object"&&o!==null&&"from"in o&&"to"in o){let{from:s,to:c}=o;if(!s&&c&&(s=c,c=null),!s&&!c){n({op:r});return}n({op:r,from:s?s.toISOString():void 0,to:c?c.toISOString():void 0})}},withPadding:!1},"range")}return r==="is-relative-to-today"?e.jsx(Qo,{value:t==null?void 0:t.relative,onChange:i=>n({op:r,relative:i})}):e.jsx(Xe.StarasiaDate,{size:"sm",input:!1,clearable:!0,value:t!=null&&t.date?new Date(t.date):void 0,onChange:i=>{if(i==null){n({op:r});return}i instanceof Date&&n({op:r,date:i.toISOString()})},withPadding:!1},"single")},Qo=({value:t,onChange:r})=>{const n=(t==null?void 0:t.direction)??"past",i=(t==null?void 0:t.count)??1,o=(t==null?void 0:t.period)??"week",s=n!=="this",c=fn({direction:n,count:i,period:o});return e.jsxs(h.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:er[n]})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:140},children:Ho.map(l=>e.jsx(I.MenuItem,{selected:n===l,endIcon:n===l?e.jsx(B.Icon,{name:"Check"}):void 0,onClick:()=>r(l==="this"?{direction:l,period:o}:{direction:l,count:i,period:o}),children:er[l]},l))})})]}),s&&e.jsx(qe.Input,{type:"number",size:"sm",min:1,clearable:!1,value:i,onChange:l=>{const a=Number(l.target.value);r({direction:n,count:Number.isFinite(a)&&a>0?a:1,period:o})},style:{width:72}}),e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:o})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:140},children:Vo.map(l=>e.jsx(I.MenuItem,{selected:o===l,endIcon:o===l?e.jsx(B.Icon,{name:"Check"}):void 0,onClick:()=>r(n==="this"?{direction:n,period:l}:{direction:n,count:i,period:l}),children:l},l))})})]})]}),e.jsx(Xe.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:c,onChange:()=>{},withPadding:!1},"relative-preview")]})},Rr=18,Uo=t=>t.length>Rr?`${t.slice(0,Rr)}...`:t,Jo=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=t.type==="dropdown-multiple",c=r.length,[l,a]=u.useState(""),d=t.options,f=typeof t.onSearch=="function",g=(()=>{if(f)return d;const D=l.trim().toLowerCase();return D?d.filter(F=>F.label.toLowerCase().includes(D)):d})(),m=D=>r.some(F=>F.value===D.value),j=D=>{if(!s){n([{label:D.label,value:D.value}]),a("");return}n(m(D)?r.filter(F=>F.value!==D.value):[...r,{label:D.label,value:D.value}])},L=D=>{var F;a(D),(F=t.onSearch)==null||F.call(t,D)},y=c===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:c===1?Uo(r[0].label):`${c} Selected`})]});return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(B.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:y})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:260},title:e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Lt,{onClear:i,onRemove:o})]}),children:e.jsxs(h.Box,{direction:"column",gap:"sm",children:[e.jsx(ot.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:s,searchAble:!0,searchValue:l,onSearch:L,value:r,onChange:n,placeholder:`Search ${t.label.toLowerCase()}…`}),e.jsx(h.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:t.isLoading?e.jsx(h.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):g.length===0?e.jsx(h.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):g.map(D=>e.jsx(I.MenuItem,{closeOnSelect:!s,selected:m(D),startIcon:D.avatar,endIcon:m(D)?e.jsx(B.Icon,{name:"Check"}):void 0,description:D.description,onClick:()=>j(D),children:D.label},D.value))})]})})})]})},Ar=18,Yo=t=>t.length>Ar?`${t.slice(0,Ar)}...`:t,zr=({checked:t,indeterminate:r})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(lt.Checkbox,{size:"sm",checked:t,readOnly:!0,onChange:()=>{},variant:r?"indeterminate":"select"})}),Xo=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=new Set(r.map(m=>m.value)),c=r.length,l=t.options.length>0&&t.options.every(m=>s.has(m.value)),a=c>0&&!l,d=m=>{n(s.has(m.value)?r.filter(j=>j.value!==m.value):[...r,{label:m.label,value:m.value}])},f=()=>{n(l?[]:t.options.map(m=>({label:m.label,value:m.value})))},g=c===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs(w.Text,{as:"span",fontWeight:"semibold",children:[t.label,":"]})," ",e.jsx(w.Text,{as:"span",children:c===1?Yo(r[0].label):`${c} Selected`})]});return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(B.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:g})}),e.jsx(I.MenuLists,{children:e.jsxs(I.MenuBody,{style:{width:240},title:e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Lt,{onClear:i,onRemove:o})]}),children:[e.jsx(I.MenuItem,{closeOnSelect:!1,selected:l,onClick:f,startIcon:e.jsx(zr,{checked:l||a,indeterminate:a}),children:"Select All"}),t.options.map(m=>e.jsx(I.MenuItem,{closeOnSelect:!1,selected:s.has(m.value),onClick:()=>d(m),startIcon:e.jsx(zr,{checked:s.has(m.value)}),children:m.label},m.value))]})})]})},gn=({activeKeys:t,configByKey:r,getValue:n,setValue:i,clearValue:o,removeFilter:s})=>e.jsx(e.Fragment,{children:t.map(c=>{const l=r[c];if(!l)return null;const a=n(l),d=l.locked?void 0:()=>s(c);return l.type==="date"||l.type==="date-compact"?e.jsx(Po,{field:l,value:a,onChange:f=>i(l,f),onClear:()=>o(c),onRemove:d},c):l.type==="checkbox-multiple"?e.jsx(Xo,{field:l,value:a||[],onChange:f=>i(l,f),onClear:()=>o(c),onRemove:d},c):e.jsx(Jo,{field:l,value:a||[],onChange:f=>i(l,f),onClear:()=>o(c),onRemove:d},c)})}),Vr=t=>`${t} Rows`,Ko=({pagination:t,pageKey:r="page",perPageKey:n="perPage",pageSizeOptions:i=[10,25,50,100],defaultPerPage:o=10,showResultCount:s=!0,showPageSize:c=!0,showPagination:l=!0})=>{var F;const{searchQueries:a,setSearchParams:d,searchParams:f}=ke(),g=f.get(n),m=g?Number(g):o,j=v=>{d({...a,[r]:String(v)})},L=v=>{d({...a,[n]:v,[r]:"1"})},y=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:0),D=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[s&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${y}-${D} of ${((F=t==null?void 0:t.totalData)==null?void 0:F.toLocaleString())||0}`}),c&&e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:"outline",tone:"neutral",size:"xs",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:Vr(m)})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{children:i.map(v=>e.jsx(I.MenuItem,{selected:v===m,onClick:()=>L(String(v)),children:Vr(v)},v))})})]}),l&&((t==null?void 0:t.totalPage)??0)>1&&e.jsx(h.Box,{direction:"column",display:"flex",align:"center",gap:"sm",paddingRight:"lg",style:{borderRight:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:e.jsx(ut.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:t!=null&&t.currentPage?Number(t.currentPage):1,totalPages:Number(t==null?void 0:t.totalPage),onPageChange:j})})]})};function $o(t,r,n=!0){u.useEffect(()=>{if(!n)return;const i=o=>{var l;if(o.metaKey||o.ctrlKey||o.altKey||o.key!==t)return;const s=o.target,c=(l=s==null?void 0:s.tagName)==null?void 0:l.toLowerCase();c==="input"||c==="textarea"||s!=null&&s.isContentEditable||(o.preventDefault(),r())};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[t,r,n])}const ei=240,yn=({searchKey:t="q",filterKey:r="filter",pageKey:n="page",placeholder:i="Search",shortcut:o="/"})=>{const{searchParams:s,setSearchParams:c,searchQueries:l}=ke(),a=Mt(t,s,r)||"",[d,f]=u.useState(!!a),[g,m]=u.useState(!a),[j,L]=u.useState(a),y=ye.useDebounce(j,350),D=u.useRef(null);u.useEffect(()=>{L(a),a&&f(!0)},[a]),u.useEffect(()=>{d&&m(!1)},[d]),u.useEffect(()=>{y!==a&&xt({value:y,name:t,type:"search",searchQueries:l,setSearchParams:c,filterKey:r,pageKey:n})},[y]);const F=u.useCallback(()=>{f(!0),requestAnimationFrame(()=>{var O;return(O=D.current)==null?void 0:O.focus()})},[]);$o(o,F);const v=()=>{j||f(!1)},W=O=>{var R;O.key==="Escape"&&!j&&(f(!1),(R=D.current)==null||R.blur())},b=()=>{d||m(!0)};return e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[g&&e.jsx(z.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:F}),e.jsxs(h.Box,{onTransitionEnd:b,style:{position:"relative",width:d?ei:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(qe.Input,{ref:D,size:"sm",fullWidth:!0,value:j,placeholder:i,leftIcon:e.jsx(B.Icon,{name:"Search",width:16,height:16}),onChange:O=>L(O.target.value),onKeyDown:W,onBlur:v,tabIndex:d?0:-1}),d&&!j&&e.jsx(h.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(w.Text,{fontSize:"xs",color:"subtle",children:o})})]})]})},pn=({columns:t,allVisible:r,onToggle:n,onReorder:i,onSetAllHidden:o})=>{const[s,c]=u.useState(null),[l,a]=u.useState(null),d=()=>{s!==null&&l!==null&&s!==l&&i(s,l),c(null),a(null)},f=(g,m)=>{const j=g+m;j<0||j>=t.length||i(g,j)};return e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:r?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{children:e.jsxs(h.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(w.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(z.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>o(r),children:r?"Hide All":"Show All"})]}),e.jsx(h.Box,{direction:"column",overflow:"overflow-y-auto",children:t.map((g,m)=>{const j=!g.locked,L=l===m&&s!==null&&s!==m;return e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:j,onDragStart:()=>j&&c(m),onDragOver:y=>{y.preventDefault(),a(m)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:L?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(h.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:j?0:-1,"aria-label":`Reorder ${g.title}`,"aria-disabled":!j||void 0,color:"icon-subtlest",onKeyDown:y=>{j&&(y.key==="ArrowUp"?(y.preventDefault(),f(m,-1)):y.key==="ArrowDown"&&(y.preventDefault(),f(m,1)))},style:{display:"inline-flex",cursor:j?"grab":"default",opacity:j?1:.4},children:e.jsx(B.Icon,{name:"DragVertical",width:16,height:16})}),g.icon&&e.jsx(h.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:g.icon}),e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:g.title}),e.jsx(h.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(st.Toggle,{size:"sm",checked:g.visible,disabled:g.locked,onChange:()=>n(g.key),"aria-label":`Toggle ${g.title} column`})})]},g.key)})})]})})})]})},jn=({views:t,onApply:r,onDelete:n,onSave:i})=>{const[o,s]=u.useState(""),c=()=>{const l=o.trim();l&&(i(l),s(""))};return e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:t.length>0?"secondary":"outline",tone:(t.length>0,"neutral"),size:"sm",iconLeft:e.jsx(B.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(I.MenuLists,{style:{width:"260px"},children:[e.jsx(I.MenuBody,{children:e.jsxs(h.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(w.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(h.Box,{direction:"column",overflow:"overflow-y-auto",children:t.length===0?e.jsx(h.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(w.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):t.map(l=>e.jsx(I.MenuItem,{startIcon:e.jsx(B.Icon,{name:"Bookmark"}),onClick:()=>r(l),endIcon:e.jsx(z.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Trash2"}),"aria-label":`Delete ${l.name}`,onClick:a=>{a.stopPropagation(),n(l.id)}}),children:l.name},l.id))})]})}),e.jsx(I.MenuFooter,{children:e.jsxs(h.Box,{direction:"row",gap:"xs",children:[e.jsx(h.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(qe.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:o,onChange:l=>s(l.target.value),onKeyDown:l=>{l.key==="Enter"&&c()}})}),e.jsx(z.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!o.trim(),onClick:c,children:"Save"})]})})]})]})},ti=({isOpen:t,onClose:r,configs:n,activeKeys:i,configByKey:o,hasActiveFilter:s,onToggle:c,onReset:l,getValue:a,setValue:d,clearValue:f,removeFilter:g})=>{const m=i.length;return e.jsx(kt.Drawer,{position:"bottom",isShow:t,onHide:r,children:e.jsxs(h.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(h.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(h.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(w.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),m>0&&e.jsxs(w.Text,{fontSize:"sm",color:"subtle",children:["(",m,")"]})]}),e.jsx(z.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:r})]}),e.jsxs(h.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[m>0&&e.jsxs(h.Box,{direction:"column",gap:"sm",children:[e.jsx(w.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(h.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(gn,{activeKeys:i,configByKey:o,getValue:a,setValue:d,clearValue:f,removeFilter:g})})]}),n.length>0&&e.jsxs(h.Box,{direction:"column",gap:"sm",children:[e.jsx(w.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(h.Box,{direction:"column",children:n.map(j=>{const L=i.includes(j.key),y=!!j.locked;return e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:y?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[j.icon&&e.jsx(h.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:j.icon}),e.jsx(w.Text,{fontSize:"sm",color:"primary",truncate:!0,children:j.label})]}),e.jsx(st.Toggle,{size:"sm",checked:L||y,disabled:y,onChange:()=>c(j.key),"aria-label":`Toggle ${j.label}`})]},j.key)})})]})]}),e.jsxs(h.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(h.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(z.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!s,onClick:l,children:"Reset"})}),e.jsx(h.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(z.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:r,children:"Selesai"})})]})]})})},ri=t=>`${t} Rows`,ni=({perPageKey:t,pageKey:r,pageSizeOptions:n,defaultPerPage:i=10,showPageSize:o})=>{const{searchQueries:s,setSearchParams:c,searchParams:l}=ke(),a=l.get(t),d=a?Number(a):i,f=g=>{c({...s,[t]:g,[r]:"1"})};return o?e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(z.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(I.MenuLists,{children:e.jsxs(I.MenuBody,{style:{minWidth:200},children:[e.jsx(h.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(w.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),n.map(g=>e.jsx(I.MenuItem,{selected:g===d,endIcon:g===d?e.jsx(B.Icon,{name:"Check"}):void 0,onClick:()=>f(String(g)),children:ri(g)},g))]})})]}):null},oi=t=>{var He;const{withPadding:r,configs:n,activeKeys:i,configByKey:o,hasActiveFilter:s,toggleFilter:c,removeFilter:l,getValue:a,setValue:d,clearValue:f,onReset:g,searchable:m,searchKey:j,filterKey:L,pageKey:y,searchPlaceholder:D,searchShortcut:F,pagination:v,perPageKey:W,pageSizeOptions:b,defaultPerPage:O,showPagination:R,showResultCount:C,showPageSize:E,hasColumns:H,orderedColumns:P,allVisible:q,onToggleVisibility:Y,onReorder:le,onSetAllHidden:he,showSavedViews:ne,savedViews:ae,onApplyView:X,onDeleteView:$,onSaveView:te}=t,[re,ue]=u.useState(!1),{searchQueries:Fe,setSearchParams:Ee}=ke(),fe=(v==null?void 0:v.rangeStart)??(((v==null?void 0:v.currentPage)||0)>1?(((v==null?void 0:v.currentPage)||0)-1)*((v==null?void 0:v.perPage)||0)+1:1),ve=(v==null?void 0:v.rangeEnd)??((v==null?void 0:v.totalCurrentPage)!==(v==null?void 0:v.perPage)?v==null?void 0:v.totalData:((v==null?void 0:v.currentPage)||1)*((v==null?void 0:v.totalCurrentPage)||0)),Re=pe=>{Ee({...Fe,[y]:String(pe)})},xe=C||R&&!!(v!=null&&v.totalPage),Pe=()=>{g(),ue(!1)};return e.jsxs(h.Box,{direction:"column",gap:"sm",fullWidth:!0,paddingTop:r?"sm":void 0,paddingBottom:r?"sm":void 0,paddingLeft:r?"md":void 0,paddingRight:r?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[m&&e.jsx(yn,{searchKey:j,filterKey:L,pageKey:y,placeholder:D,shortcut:F}),e.jsx(z.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"FilterHorizontal"}),onClick:()=>ue(!0),"aria-label":"Open filters",children:s?`Filter: ${i.length}`:null}),e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[ne&&e.jsx(jn,{views:ae,onApply:X,onDelete:$,onSave:te}),H&&e.jsx(pn,{columns:P,allVisible:q,onToggle:Y,onReorder:le,onSetAllHidden:he}),e.jsx(ni,{perPageKey:W,pageKey:y,pageSizeOptions:b,defaultPerPage:O,showPageSize:E})]})]}),xe&&e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[C?e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${fe}-${ve} of ${((He=v==null?void 0:v.totalData)==null?void 0:He.toLocaleString())||0}`}):e.jsx(h.Box,{direction:"column"}),R&&!!(v!=null&&v.totalPage)&&e.jsx(ut.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:v!=null&&v.currentPage?Number(v.currentPage):1,totalPages:Number(v.totalPage),onPageChange:Re})]}),e.jsx(ti,{isOpen:re,onClose:()=>ue(!1),configs:n,activeKeys:i,configByKey:o,hasActiveFilter:s,onToggle:c,onReset:Pe,getValue:a,setValue:d,clearValue:f,removeFilter:l})]})},ii=({withPadding:t=!1,filterConfigs:r=[],filterKey:n="filter",activeFilterKey:i="filters",pageKey:o="page",perPageKey:s="perPage",pageSizeOptions:c=[25,50,100],defaultPerPage:l,showPagination:a=!0,showResultCount:d=!0,showPageSize:f=!0,searchable:g=!1,searchKey:m="q",searchPlaceholder:j="Search",searchShortcut:L="/",searchPosition:y="right",pagination:D,columns:F=[],onColumnsChange:v,columnsState:W,scopeId:b,savedViews:O,persistLastState:R=!0,storage:C=dr,onReset:E})=>{const H=b??(O==null?void 0:O.scopeId),{activeKeys:P,configByKey:q,hasActiveFilter:Y,toggleFilter:le,removeFilter:he,getValue:ne,setValue:ae,clearValue:X,clearAll:$}=ar({configs:r,filterKey:n,activeFilterKey:i,pageKey:o,searchKey:m}),te=Mo({columns:F,scopeId:H,storage:C,onColumnsChange:v,value:W}),re=Lo({scopeId:H,storage:C,snapshotKeys:[i,n,s],pageKey:o,getColumns:()=>te.state,applyColumns:te.applyState}),ue=Io({scopeId:H,storage:C,snapshotKeys:[i,n,o],enabled:R}),Fe=To({scopeId:H,storage:C,perPageKey:s,pageSizeOptions:c,enabled:R});Wo({enabled:R&&!!H,snapshotKeys:[i,n,o],perPageKey:s,readSnapshot:ue.read,readPerPage:Fe.read});const Ee=l??c[0]??25,fe=!!(O!=null&&O.enabled)&&re.enabled,ve=()=>{$(),ue.clear(),E==null||E()},Re=ye.useMediaQuery("md"),xe=g?e.jsx(yn,{searchKey:m,filterKey:n,pageKey:o,placeholder:j,shortcut:L}):null;return Re?e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",fullWidth:!0,paddingTop:t?"sm":void 0,paddingBottom:t?"sm":void 0,paddingLeft:t?"md":void 0,paddingRight:t?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Ro,{configs:r,activeKeys:P,onToggle:le,hasActiveFilter:Y,onReset:ve}),y==="left"&&xe,e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(gn,{activeKeys:P,configByKey:q,getValue:ne,setValue:ae,clearValue:X,removeFilter:he}),Y&&e.jsx(z.Button,{variant:"link",tone:"brand",size:"sm",onClick:ve,children:"Reset"})]})]}),e.jsxs(h.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[e.jsx(Ko,{pagination:D,pageKey:o,perPageKey:s,pageSizeOptions:c,defaultPerPage:Ee,showPagination:a,showResultCount:d,showPageSize:f}),y==="right"&&xe,fe&&e.jsx(jn,{views:re.views,onApply:re.applyView,onDelete:re.deleteView,onSave:re.saveView}),F.length>0&&e.jsx(pn,{columns:te.orderedColumns,allVisible:te.allVisible,onToggle:te.toggleVisibility,onReorder:te.reorder,onSetAllHidden:te.setAllHidden})]})]}):e.jsx(oi,{withPadding:t,configs:r,activeKeys:P,configByKey:q,hasActiveFilter:Y,toggleFilter:le,removeFilter:he,getValue:ne,setValue:ae,clearValue:X,onReset:ve,searchable:g,searchKey:m,filterKey:n,pageKey:o,searchPlaceholder:j,searchShortcut:L,pagination:D,perPageKey:s,pageSizeOptions:c,defaultPerPage:Ee,showPagination:a,showResultCount:d,showPageSize:f,hasColumns:F.length>0,orderedColumns:te.orderedColumns,allVisible:te.allVisible,onToggleVisibility:te.toggleVisibility,onReorder:te.reorder,onSetAllHidden:te.setAllHidden,showSavedViews:fe,savedViews:re.views,onApplyView:re.applyView,onDeleteView:re.deleteView,onSaveView:re.saveView})},si=t=>{if(!Array.isArray(t)||t.length===0)return;const r=t[0];return(r==null?void 0:r.value)!=null?String(r.value):void 0},li=t=>{if(!Array.isArray(t)||t.length===0)return;const r=t.map(n=>(n==null?void 0:n.value)!=null?String(n.value):null).filter(n=>n!=null);return r.length?r:void 0},ci=(t,r)=>{switch(t.type){case"dropdown":case"radio":return si(r);case"dropdown-multiple":case"checkbox-multiple":return li(r);case"date":return r instanceof Date?r.toISOString():void 0;case"date-compact":return r;default:return}},Hr=(t,r)=>{if(t==null||t==="")return r;const n=Number(t);return Number.isFinite(n)&&n>0?n:r},ai=t=>{const{filterConfigs:r,filterKey:n="filter",activeFilterKey:i="filters",pageKey:o="page",perPageKey:s="perPage",searchKey:c="q",defaultPage:l=1,defaultPerPage:a=10,paramKeys:d,serialize:f}=t,{activeKeys:g,configByKey:m,hasActiveFilter:j,getValue:L}=ar({configs:r,filterKey:n,activeFilterKey:i,pageKey:o,searchKey:c}),{searchParams:y}=ke(),D=y.toString();return u.useMemo(()=>{const v={},W={},b=Hr(y.get(o),l),O=Hr(y.get(s),a);v[(d==null?void 0:d.page)??"page"]=b,v[(d==null?void 0:d.perPage)??"perPage"]=O;const R=Mt(c,y,n)||"";R&&(v[(d==null?void 0:d.search)??"search"]=R);let C=!1;for(const E of g){const H=m[E];if(!H)continue;const P=L(H);W[E]=P;const q=f==null?void 0:f[E],Y=q?q(P):ci(H,P);if(Y==null||Array.isArray(Y)&&Y.length===0)continue;const le=(d==null?void 0:d[E])??E;v[le]=Y,C=!0}return{params:v,raw:W,hasActiveFilter:j||!!R||C}},[D,g.join("|"),n,i,o,s,c,l,a,d,f,m])},di=["dropdown","dropdown-multiple","checkbox-multiple","radio"],ui=({filterConfigs:t,filterKey:r,activeFilterKey:n,pageKey:i,searchKey:o})=>{const{configByKey:s,getValue:c,setValue:l,removeFilter:a,clearAll:d,hasActiveFilter:f}=ar({configs:t,filterKey:r,activeFilterKey:n,pageKey:i,searchKey:o}),g=(F,v)=>{var b;const W=F.options;return((b=W==null?void 0:W.find(O=>O.value===v))==null?void 0:b.label)??v},m=u.useCallback(F=>{const v=s[F];if(!v)return[];const W=c(v);return Array.isArray(W)?W.map(b=>String(b.value)):[]},[s,c]),j=u.useCallback((F,v)=>{const W=s[F];if(!W||!di.includes(W.type))return;const b=Array.isArray(v)?v:[v];if(b.length===0){a(F);return}l(W,b.map(O=>({label:g(W,O),value:O})))},[s,l,a]),L=u.useCallback((F,v)=>{const W=m(F);j(F,W.includes(v)?W.filter(b=>b!==v):[...W,v])},[m,j]),y=u.useCallback((F,v)=>m(F).includes(v),[m]),D=u.useCallback(F=>a(F),[a]);return{set:j,toggle:L,clear:D,clearAll:d,isActive:y,values:m,hasActiveFilter:f}},xi=(t,r)=>{if(!t)return{};const{fromKey:n,toKey:i,opKey:o}=r,s={};switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date&&(s[n]=new Date(t.date).toISOString()),o&&(s[o]=t.op),s;case"is-between":return t.from&&(s[n]=new Date(t.from).toISOString()),t.to&&(s[i]=new Date(t.to).toISOString()),s;case"is-relative-to-today":{if(!t.relative)return s;const{from:c,to:l}=fn(t.relative);return s[n]=c.toISOString(),s[i]=l.toISOString(),s}case"is-empty":case"is-not-empty":return o&&(s[o]=t.op==="is-empty"?"empty":"not-empty"),s;default:return s}},bn=({children:t,borderRadius:r,height:n})=>{const i=u.useRef(null),[o,s]=u.useState("100vh");return u.useEffect(()=>{if(n)return;const c=()=>{if(i.current){const l=i.current.getBoundingClientRect().top;s(`calc(100vh - ${l}px)`)}};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[n]),e.jsx(h.Box,{ref:i,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:r||"rounded-xs",style:{height:n??o,display:"flex",flexDirection:"column"},children:t})},Cn=({action:t,rightContent:r,leftContent:n,headerSlot:i,advanceFilter:o,showFilter:s=!0})=>{const c=ye.useMediaQuery("md"),l=s?e.jsx(hn,{...o}):null,a=()=>t?u.isValidElement(t)?t:e.jsx(h.Box,{style:{display:"flex",flexDirection:c?"row":"column",gap:"8px",width:c?"auto":"100%",textWrap:"nowrap"},children:t.map(({title:d,icon:f,buttonProps:g,onClick:m},j)=>!d&&!f?null:e.jsx(z.Button,{fullWidth:!c,iconLeft:f?e.jsx(B.Icon,{name:f}):void 0,onClick:m,...g,children:d},`action-${j}`))}):null;return e.jsx(h.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:i?i({filter:l}):e.jsxs(e.Fragment,{children:[e.jsxs(h.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[l,n]}),e.jsxs(h.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[r,a()]})]})})},hi=({totalData:t,withMarginBottom:r=!0,withMarginTop:n=!0})=>e.jsxs(h.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:r?"16px":void 0,marginTop:n?"16px":void 0},children:[e.jsxs(We.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(We.Body1,{children:t||0})]}),vn=({pagination:t,pageKey:r="page",perPageKey:n="perPage",defaultPerPage:i=10,showPagination:o=!0,totalData:s})=>{const{searchQueries:c,setSearchParams:l,searchParams:a}=ke(),d=a.get(n),f=L=>{l({...c,[r]:String(L)})},g=L=>{l({...c,[n]:L,[r]:"1"})},m=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:1),j=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.totalCurrentPage)||0));return e.jsx(h.Box,{style:{display:"flex",width:"100%",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0},children:o?e.jsxs(e.Fragment,{children:[e.jsxs(h.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(w.Text,{children:"Rows Per Page: "}),e.jsx(ot.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:L=>{g(L[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${i} per row`,value:`${i}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${i} per row`,value:`${i}`}]}),e.jsx(w.Text,{children:`${m}-${j} of ${(t==null?void 0:t.totalData)||0}`})]}),e.jsx(ut.Pagination,{currentPage:t!=null&&t.currentPage?Number(t==null?void 0:t.currentPage):1,totalPages:t!=null&&t.totalPage?Number(t==null?void 0:t.totalPage):1,onPageChange:f})]}):e.jsx(hi,{totalData:s,withMarginBottom:!1,withMarginTop:!1})})},wn=({filter:t,columnTitle:r})=>{const[n,i]=u.useState(!1),o=u.useRef(null),s=u.useRef(null),c=u.useRef(null),[l,a]=u.useState(""),[d,f]=u.useState({top:0,left:0}),g=t.selectedValues,m=u.useMemo(()=>l?t.options.filter(y=>y.label.toLowerCase().includes(l.toLowerCase())):t.options,[t.options,l]);u.useEffect(()=>{if(n&&s.current){const y=s.current.getBoundingClientRect(),D=280,F={top:y.bottom+8};t.position==="left"||y.left+D>window.innerWidth?F.right=window.innerWidth-y.right:F.left=y.left,f(F)}},[n,t.position]),u.useEffect(()=>{n&&c.current?setTimeout(()=>{var y;return(y=c.current)==null?void 0:y.focus()},50):a("")},[n]),u.useEffect(()=>{const y=D=>{o.current&&!o.current.contains(D.target)&&s.current&&!s.current.contains(D.target)&&i(!1)};return n&&document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n]);const j=y=>{const D=g.includes(y)?g.filter(F=>F!==y):[...g,y];t.onFilterChange(D)},L=()=>t.onFilterChange([]);return e.jsxs(h.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(h.Box,{ref:s,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:y=>{var D;y.stopPropagation(),n||(D=t.onOpen)==null||D.call(t),i(F=>!F)},children:e.jsx(B.Icon,{name:n?"ChevronUp":"ChevronDown",size:"sm",style:{color:g.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),n&&e.jsxs(h.Box,{ref:o,style:{position:"fixed",top:`${d.top}px`,...d.left!==void 0?{left:`${d.left}px`}:{right:`${d.right}px`},backgroundColor:"white",borderRadius:"4px",minWidth:"280px",maxHeight:"400px",display:"flex",flexDirection:"column",zIndex:9999,animation:"fadeInDropdown 0.15s ease-out",border:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(h.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(w.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",r]}),g.length>0&&e.jsx(h.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(w.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:y=>{y.stopPropagation(),L()},children:"CLEAR"})})]}),!t.hideSearch&&e.jsx(h.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(qe.Input,{ref:c,placeholder:`Search ${r.toLowerCase()}...`,leftIcon:e.jsx(B.Icon,{name:"Search",size:"sm"}),value:l,onChange:y=>a(y.target.value),style:{fontSize:"14px"}})}),e.jsx(h.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:t.isLoadingOptions?e.jsxs(h.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(B.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):m.length>0?e.jsx(h.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:m.map(y=>e.jsxs(h.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:g.includes(y.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:D=>{D.stopPropagation(),j(y.value)},onMouseEnter:D=>{g.includes(y.value)||(D.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),D.currentTarget.style.transform="translateX(2px)"},onMouseLeave:D=>{D.currentTarget.style.backgroundColor=g.includes(y.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",D.currentTarget.style.transform="translateX(0)"},children:[e.jsx(lt.Checkbox,{checked:g.includes(y.value),onChange:()=>{}}),e.jsx(w.Text,{fontSize:"sm",fontWeight:g.includes(y.value)?"medium":"normal",color:g.includes(y.value)?"primary":"gray-700",children:y.label})]},y.value))}):e.jsxs(h.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(B.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),g.length>0&&e.jsx(h.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(h.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(h.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:g.length}),e.jsxs(w.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",g.length>1?"s":""," selected"]})]})})]})]})},fi=({direction:t})=>{const r="var(--sa-text-primary, #292a2e)",n="var(--sa-text-subtle, #8c8f97)",i=t==="asc"?r:n,o=t==="desc"?r:n,s=t==="asc"?1:.45,c=t==="desc"?1:.45;return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:0},"aria-hidden":!0,children:[e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:i,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:o,opacity:c},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},mi=({frozen:t})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:t?"currentColor":"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:t?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),Qt="var(--sa-background-primary, #ffffff)",Pr="var(--sa-background-primary-inverse, #f8f8f8)",Dn=({columns:t,records:r,handleDetail:n,handleUpdate:i,handleDelete:o,isLoading:s,visibleHandleDelete:c,visibleHandleUpdate:l,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:f,frozenCount:g=0,onFrozenCountChange:m,customActions:j,actionsOrder:L=["detail","update","delete","custom"],customEmptyState:y,enableColumnResize:D=!1,defaultColumnWidths:F,onColumnWidthsChange:v,defaultMinColumnWidth:W=60,sort:b,defaultSort:O,onSortChange:R,showActionDivider:C=!1})=>{const E=b!==void 0,[H,P]=u.useState(O??null),q=E?b??null:H,Y=M=>{if(M.sortKey)return M.sortKey;if(typeof M.accessor=="string")return M.accessor},le=M=>{const A=Y(M);if(!A)return;let V;!q||q.key!==A?V={key:A,direction:"asc"}:q.direction==="asc"?V={key:A,direction:"desc"}:V=null,E||P(V),R==null||R(V)},ne=[n,i,o].filter(M=>M!==void 0).length,ae=!!j,X=!!n||!!i||!!o||ae,$="var(--sa-border-subtle, #0b120e24)",te=`1px solid ${$}`,re=`inset 1px 0 0 ${$}`,ue=`inset -1px 0 0 ${$}`,Fe=ne===3?ae?"178px":"140px":ne===2?ae?"140px":"102px":ne===1?ae?"112px":"74px":ae?"74px":"",Ee=(M,A)=>{if(!A)return M;if(typeof A=="function")return A(M);if(typeof A=="string")return M[A]},[fe,ve]=u.useState(!1);u.useEffect(()=>{if(!(f!=null&&f.current))return;const M=f.current;ve(M.scrollHeight>M.clientHeight)},[r,f]);const Re=u.useRef(null),[xe,Pe]=u.useState([]),[He,pe]=u.useState(()=>F??{}),Me=u.useRef(null);u.useLayoutEffect(()=>{if(!g||!Re.current){Pe([]);return}const M=Array.from(Re.current.querySelectorAll("thead tr th")),A=[];let V=0;M.forEach((_,J)=>{A[J]=V,J<g&&(V+=_.offsetWidth)}),Pe(A)},[g,t,r,He]);const Ze=M=>{m&&m(M<g?M:M+1)},S=(M,A)=>{const V=He[M];if(V!==void 0){const _=`${V}px`;return{width:_,minWidth:_,maxWidth:_}}return A?{width:A}:{}},Z=M=>D&&(M.resizable??!0),N=(M,A)=>{M.preventDefault(),M.stopPropagation();const V=M.currentTarget.closest("th");if(!V)return;const _=Math.round(V.getBoundingClientRect().width);Me.current={colIndex:A,startX:M.clientX,startWidth:_};const J=document.body.style.userSelect,je=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const De=Ie=>{var Ue;const Be=Me.current;if(!Be)return;const Ge=((Ue=t[Be.colIndex])==null?void 0:Ue.minWidth)??W,Qe=Math.max(Ge,Be.startWidth+(Ie.clientX-Be.startX));pe(Te=>Te[Be.colIndex]===Qe?Te:{...Te,[Be.colIndex]:Qe})},Le=()=>{document.removeEventListener("mousemove",De),document.removeEventListener("mouseup",Le),document.body.style.userSelect=J,document.body.style.cursor=je,Me.current=null,v&&pe(Ie=>(v(Ie),Ie))};document.addEventListener("mousemove",De),document.addEventListener("mouseup",Le)};return e.jsx("div",{ref:Re,children:e.jsxs(G.Table,{fullWidth:!0,children:[e.jsx(G.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(G.Tr,{children:[t.map((M,A)=>{var Ke,$e;const V=g>0&&A<g,_=xe[A]??0,J=Z(M),De=A===t.length-1&&X&&C,Le=Y(M),Ie=!!M.sortable&&!!Le,Be=Ie&&(q==null?void 0:q.key)===Le?q.direction:null,Ge=M.title||((Ke=M.accessor)==null?void 0:Ke.toString())||"",Qe=($e=M.headerTooltip)!=null&&$e.showIcon?e.jsx(B.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,Ue=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ge}),Te=Ie?e.jsxs("button",{type:"button",onClick:()=>le(M),title:Be==="asc"?"Sorted ascending — click to sort descending":Be==="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:M.textAlign==="text-right"?"right":M.textAlign==="text-center"?"center":"left"},children:[Ue,Qe,e.jsx(fi,{direction:Be})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Ue,Qe]});return e.jsxs(G.Th,{style:{position:"sticky",top:0,left:V?_:void 0,zIndex:V?4:2,paddingLeft:A===0?"12px":"",borderRight:d&&!De&&!V?te:void 0,borderBottom:d?te:void 0,boxShadow:d&&V?ue:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:M.textAlign==="text-right"?"right":M.textAlign==="text-center"?"center":"left",...S(A,M.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[M.headerTooltip?e.jsx(Ce.Tooltip,{label:M.headerTooltip.content,position:"bottom",children:Te}):Te,M.filter&&e.jsx(wn,{filter:M.filter,columnTitle:M.title}),m&&e.jsx("button",{onClick:()=>Ze(A),title:V?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:V?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:V?1:.45,transition:"opacity 0.15s"},children:e.jsx(mi,{frozen:V})})]}),J&&e.jsx("div",{onMouseDown:et=>N(et,A),onClick:et=>et.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-${A}`)}),X?e.jsx(G.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?te:void 0,boxShadow:d&&C?re:void 0}}):null]})}),e.jsx(G.Tbody,{children:s?e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:t.length+1,children:e.jsxs(h.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(Ve.Skeleton,{variant:"list"}),e.jsx(Ve.Skeleton,{variant:"list"}),e.jsx(Ve.Skeleton,{variant:"list"}),e.jsx(Ve.Skeleton,{variant:"list"}),e.jsx(Ve.Skeleton,{variant:"list"})]})})}):!(r!=null&&r.length)&&y?e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:t.length+1,children:y})}):r==null?void 0:r.map((M,A)=>e.jsxs(G.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:A===r.length-1&&fe?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:V=>{const _=V.currentTarget;_.style.backgroundColor=Pr,Array.from(_.querySelectorAll("td")).forEach(J=>{J.style.position==="sticky"&&(J.style.backgroundColor=Pr)})},onMouseLeave:V=>{const _=V.currentTarget;_.style.backgroundColor="",Array.from(_.querySelectorAll("td")).forEach(J=>{J.style.position==="sticky"&&(J.style.backgroundColor=Qt)})},children:[t.map((V,_)=>{const J=V.render?V.render(M,A,r):Ee(M,V.accessor),je=g>0&&_<g,De=xe[_]??0,Le=He[_]!==void 0,Ie=je&&_===g-1;return e.jsx(G.Td,{style:{position:je?"sticky":void 0,left:je?De:void 0,zIndex:je?1:void 0,backgroundColor:je?Qt:void 0,transition:je?"background-color 0.3s ease":void 0,paddingLeft:_===0?"12px":"",whiteSpace:"nowrap",overflow:Le?"hidden":void 0,borderLeft:V.showBorderLeft?te:void 0,borderRight:V.showBorderRight?te:void 0,boxShadow:Ie?ue:void 0,textAlign:V.textAlign==="text-right"?"right":V.textAlign==="text-center"?"center":"left",...S(_,V.width)},children:typeof J=="string"?e.jsx(w.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:V.textAlign==="text-right"?"right":V.textAlign==="text-center"?"center":"left"},children:J}):J},`row-${A}-col-${_}`)}),X?e.jsx(G.Td,{style:{width:Fe,position:"sticky",right:0,zIndex:1,backgroundColor:Qt,boxShadow:C?re:void 0,transition:"background-color 0.3s ease"},children:e.jsx(ie.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:L.map(V=>{const _=A===r.length-1?"top":"bottom";return V==="detail"&&n&&(a==null?void 0:a(M))!==!1?e.jsx(Ce.Tooltip,{label:"Detail",position:_,children:e.jsx(z.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(M.id,M),iconLeft:e.jsx(B.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):V==="update"&&i&&(l==null?void 0:l(M))!==!1?e.jsx(Ce.Tooltip,{label:"Update",position:_,children:e.jsx(z.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>i(M),iconLeft:e.jsx(B.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):V==="delete"&&o&&(c==null?void 0:c(M))!==!1?e.jsx(Ce.Tooltip,{label:"Delete",position:_,children:e.jsx(z.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(M.id,M),iconLeft:e.jsx(B.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):V==="custom"?e.jsx(u.Fragment,{children:j==null?void 0:j(M)},"custom"):null})})}):null]},`${M}${A}`))})]})})},gi=({wrapperProps:t,dataTableProps:r,headerProps:n,footerProps:i})=>{var g;const o=u.useRef(null),[s,c]=u.useState((r==null?void 0:r.defaultFrozenCount)??0),l=(n==null?void 0:n.show)??!0,a=u.useRef(null),d=(g=r==null?void 0:r.pagination)==null?void 0:g.totalData;typeof d=="number"&&(a.current=d);const f=(i==null?void 0:i.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(bn,{...t,children:[l&&e.jsx(Cn,{...n}),e.jsx(h.Box,{direction:"column",ref:o,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:r?e.jsx(Dn,{...r,scrollParentRef:o,frozenCount:r!=null&&r.enableFreezeColumns?s:0,onFrozenCountChange:r!=null&&r.enableFreezeColumns?c:void 0}):null}),f&&e.jsx(vn,{pagination:r==null?void 0:r.pagination,pageKey:r==null?void 0:r.pageKey,perPageKey:r==null?void 0:r.perPageKey,defaultPerPage:r==null?void 0:r.defaultPerPage,showPagination:r==null?void 0:r.showPagination,totalData:i==null?void 0:i.totalData})]})};function yi(t){return u.memo(t)}const pi=yi(gi),Nr=200,Ut="1px solid var(--sa-border-subtle, #0b120e24)",ji=({sortDir:t,frozen:r})=>t==="asc"?e.jsx(B.Icon,{name:"ChevronSmallUp"}):t==="desc"?e.jsx(B.Icon,{name:"ChevronSmallDown"}):r?e.jsx(B.Icon,{name:"LockOn",size:"xs"}):e.jsx(B.Icon,{name:"Filter",size:"xs"}),pt=({icon:t,label:r,active:n,danger:i,onClick:o})=>{const s=i?"var(--sa-color-error-600, #c9184a)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:n?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:s,textAlign:"left"},onMouseEnter:c=>{n||(c.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:c=>{c.currentTarget.style.background=n?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(B.Icon,{name:t,size:"sm",style:{color:s,flexShrink:0}}),e.jsx(w.Text,{as:"span",style:{color:s},children:r})]})},Sn=({active:t,canSort:r,canHide:n,sortDir:i,frozen:o,onSort:s,onClearSort:c,onToggleFreeze:l,onHide:a})=>{const[d,f]=u.useState(!1),g=u.useRef(null),m=u.useRef(null),[j,L]=u.useState({top:0,left:0});u.useEffect(()=>{if(d&&g.current){const D=g.current.getBoundingClientRect(),F=D.left+Nr>window.innerWidth;L({top:D.bottom+6,...F?{right:window.innerWidth-D.right}:{left:D.left}})}},[d]),u.useEffect(()=>{if(!d)return;const D=F=>{m.current&&!m.current.contains(F.target)&&g.current&&!g.current.contains(F.target)&&f(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[d]);const y=D=>{D(),f(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:g,type:"button",className:"sa-tl-menu-trigger","data-active":t||d?"true":"false",onClick:D=>{D.stopPropagation(),f(F=>!F)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:Ut,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(ji,{sortDir:i,frozen:o})}),d&&e.jsxs(h.Box,{ref:m,onClick:D=>D.stopPropagation(),style:{position:"fixed",top:`${j.top}px`,...j.left!==void 0?{left:`${j.left}px`}:{right:`${j.right}px`},minWidth:Nr,backgroundColor:"var(--sa-background-primary, #ffffff)",border:Ut,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"0 6px 24px rgba(0,0,0,0.12)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(pt,{icon:"ChevronUp",label:"Ascending",active:i==="asc",onClick:()=>y(()=>i==="asc"?c():s("asc"))}),e.jsx(pt,{icon:"ChevronDown",label:"Descending",active:i==="desc",onClick:()=>y(()=>i==="desc"?c():s("desc"))}),e.jsx("div",{style:{borderTop:Ut,margin:"4px 0"}})]}),e.jsx(pt,{icon:"Pin1",label:o?"Unfreeze":"Freeze",active:o,onClick:()=>y(l)}),n&&e.jsx(pt,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>y(a)})]})]})},jt="1px solid var(--sa-border-subtle, #0b120e24)",bi="var(--sa-text-subtle, #8c8f97)",at="var(--sa-background-neutral, #f0f1f2)",_r="2px 0 4px -2px rgba(0,0,0,0.15)",bt={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},qr="sa-table-layout-styles",Ci=()=>{if(typeof document>"u"||document.getElementById(qr))return;const t=document.createElement("style");t.id=qr,t.textContent=`
|
|
2
2
|
.sa-table-layout tbody td { transition: background-color 0.15s ease; }
|
|
3
3
|
.sa-table-layout tbody tr:hover td {
|
|
4
4
|
background-color: var(--sa-background-primary-inverse, #f8f8f8);
|
|
@@ -40,4 +40,4 @@
|
|
|
40
40
|
box-shadow: 0 4px 12px rgba(0,0,0,0.12);
|
|
41
41
|
padding: 4px 0;
|
|
42
42
|
}
|
|
43
|
-
`,document.head.appendChild(t)},Ct=t=>t==="right"?"right":t==="center"?"center":"left",vi=(t,r)=>{if(r)return t[r]},wi=(t,r)=>t==null&&r==null?0:t==null?-1:r==null?1:typeof t=="number"&&typeof r=="number"?t-r:String(t).localeCompare(String(r)),Di=({columns:t,data:r,getRowKey:n,size:i="md",resizable:o=!1,widthStorageKey:s,columnState:c,onColumnStateChange:l,columnMenu:a=!1,sort:d,defaultSort:f,onSortChange:g,height:m,mobileLayout:j="cards",mobileBreakpoint:L="md",groupSeparator:y,summary:D,emptyState:E,loading:v=!1,loadingRows:W=8,rowActions:b})=>{Ci();const O=!ge.useMediaQuery(L)&&j!=="scroll",C=!!(b!=null&&b.length),[F,H]=u.useState(null);u.useEffect(()=>{if(!F)return;const p=()=>H(null),k=setTimeout(()=>document.addEventListener("click",p),0);return()=>{clearTimeout(k),document.removeEventListener("click",p)}},[F]);const[Z,N]=u.useState(()=>new Set),X=c!==void 0,[se,he]=u.useState({}),te=c??se,ae=p=>{l==null||l(p),X||he(p)},K=d!==void 0,[P,re]=u.useState(f??null),le=K?d??null:P,ue=!g,ke=p=>{g==null||g(p),K||re(p)},{headerGroups:Ee,leafColumns:xe,hasGroups:Be}=u.useMemo(()=>{var fe;const p=new Set(te.hidden??[]),k=($,de)=>$.key??(typeof $.accessor=="string"?$.accessor:`col-${de}`),T=t.map(($,de)=>{var Re;if((Re=$.children)!=null&&Re.length){const tt=$.children.map((Je,Nt)=>({col:Je,key:k(Je,`${de}-${Nt}`)})).filter(Je=>!p.has(Je.key));return{col:$,key:$.key??`group-${de}`,isGroup:!0,leaves:tt}}const De={col:$,key:k($,`${de}`)};return{col:$,key:De.key,isGroup:!1,leaves:p.has(De.key)?[]:[De]}}).filter($=>$.leaves.length>0),U=T.some($=>$.isGroup);let ce=T.flatMap($=>$.leaves);if(!U&&((fe=te.order)!=null&&fe.length)){const $=new Map(te.order.map((de,De)=>[de,De]));ce=[...ce].sort((de,De)=>($.get(de.key)??1/0)-($.get(De.key)??1/0))}return{headerGroups:T,leafColumns:ce,hasGroups:U}},[t,te]),He=u.useMemo(()=>new Map(xe.map((p,k)=>[p.key,k])),[xe]),je=xe.map(p=>p.key).join("|"),Pe=(p,k)=>{const T=p.sortKey??(typeof p.accessor=="string"?p.accessor:void 0);return T?k[T]:void 0},Ve=p=>p.sortable??(!!p.sortKey||typeof p.accessor=="string"),ye=u.useMemo(()=>{if(!ue||!le)return r;const p=xe.find(T=>T.key===le.key);if(!p)return r;const k=le.direction==="asc"?1:-1;return[...r].sort((T,U)=>wi(Pe(p.col,T),Pe(p.col,U))*k)},[r,ue,le,xe]),Me=!Be,Ze=!!s&&Me,[S,G]=Q.useColumnWidths(s??""),_=Ze?S:void 0,M=u.useRef(null),[A,V]=u.useState();u.useLayoutEffect(()=>{V(void 0)},[je]),u.useLayoutEffect(()=>{if(!Me||A||!M.current)return;const p=M.current.querySelectorAll("th.sa-tl-leaf");V(Array.from(p).map(k=>k.offsetWidth))},[A,Me]);const[q,Y]=u.useState(0);u.useLayoutEffect(()=>{if(!Be||!M.current)return;const p=M.current.querySelector(":scope > tr");p&&Y(p.offsetHeight)},[Be,je]);const pe=(p,k)=>{if((_==null?void 0:_[k])!=null)return _[k];if(p.width!=null)return p.width;if((A==null?void 0:A[k])!=null)return A[k]},we=(p,k)=>typeof p.width=="number"?p.width:A==null?void 0:A[k],Le=te.frozenKey&&!Be?xe.findIndex(p=>p.key===te.frozenKey):-1,Ie=p=>p<=Le,Fe=p=>{if(!A)return 0;let k=0;for(let T=0;T<p;T++)k+=A[T]??0;return k},Ge=u.useRef(null),[Qe,Ue]=u.useState("100vh");u.useLayoutEffect(()=>{if(m!==void 0)return;const p=()=>{if(Ge.current){const k=Ge.current.getBoundingClientRect().top;Ue(`calc(100vh - ${k}px)`)}};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[m]);const Te=(p,k)=>n?n(p,k):k,Ke=(p,k,T)=>p.render?p.render(k,T,ye):vi(k,p.accessor),$e=xe.length+(C?1:0),et=["80%","55%","70%","45%","90%","60%"],Mn=(p,k)=>et[(p*7+k*3)%et.length],Ln=(p,k)=>e.jsx(ze.Skeleton,{height:14,width:Mn(p,k),borderRadius:"rounded-sm"}),In=Array.from({length:W},(p,k)=>e.jsxs(Q.Tr,{children:[xe.map(({col:T,key:U},ce)=>e.jsx(Q.Td,{style:{textAlign:Ct(T.align)},children:Ln(k,ce)},`sa-tl-sk-${k}-${U}`)),C&&e.jsx(Q.Td,{style:{width:1,padding:0,border:"none"}})]},`sa-tl-sk-${k}`)),Tn=(p,k)=>{k||ae({...te,hidden:[...te.hidden??[],p]})},On=p=>ae({...te,frozenKey:te.frozenKey===p?void 0:p}),ft=p=>(b??[]).filter(k=>{var T;return!((T=k.hidden)!=null&&T.call(k,p))}),ur={position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:4,paddingRight:16,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},mt=(p,k,T,U)=>{var Re;const ce=(Re=p.disabled)==null?void 0:Re.call(p,k),fe=(U==null?void 0:U.showLabel)??p.showLabel,$=(U==null?void 0:U.size)??"xs",de=e.jsx(z.Button,{size:$,variant:p.variant??"tertiary",tone:p.tone??"neutral",disabled:ce,onClick:()=>p.onClick(k,T),iconLeft:p.icon?e.jsx(B.Icon,{name:p.icon,size:"sm"}):void 0,children:fe&&p.label}),De=p.tooltip;return De?e.jsx(Ce.Tooltip,{label:De,position:"top-end",children:de}):de},Wn=(p,k)=>{const T=ft(p);if(!T.length)return null;if(T.length>5){const ce=Te(p,k),fe=(F==null?void 0:F.rowKey)===ce;return e.jsx("div",{className:"sa-tl-row-actions",style:ur,onClick:$=>$.stopPropagation(),children:e.jsx(Ce.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(z.Button,{size:"xs",variant:"tertiary",onClick:$=>{const de=$.currentTarget.getBoundingClientRect();H(fe?null:{rowKey:ce,top:de.bottom+4,right:window.innerWidth-de.right})},children:e.jsx(B.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:ur,children:T.map(ce=>e.jsx(u.Fragment,{children:mt(ce,p,k)},ce.key))})},Rn=(p,k)=>{const T=ft(p);return T.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:jt},children:T.map(U=>e.jsx(u.Fragment,{children:mt(U,p,k,{showLabel:!0,size:"sm"})},U.key))}):null},An=(p,k)=>{const T=ft(p);return T.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:T.map(U=>e.jsx(u.Fragment,{children:mt(U,p,k,{showLabel:!1})},U.key))}):null},At=(p,k)=>{const{col:T,key:U}=p,ce=He.get(U)??0,fe=Ie(ce),$=fe&&ce===Le,de=(le==null?void 0:le.key)===U?le.direction:null,De=a&&!T.disableMenu?e.jsx(Sn,{active:!!de||fe,canSort:Ve(T),canHide:!T.locked,sortDir:de,frozen:fe,onSort:Nt=>ke({key:U,direction:Nt}),onClearSort:()=>ke(null),onToggleFreeze:()=>On(U),onHide:()=>Tn(U,T.locked)}):null,Re=T.align==="right",tt=T.align==="right"?"flex-end":T.align==="center"?"center":"flex-start",Je=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:tt,overflow:"hidden"},children:[T.icon&&e.jsx(B.Icon,{name:T.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:bt,children:T.title})]});return e.jsx(Q.Th,{className:`sa-tl-leaf${fe?" sa-tl-frozen":""}`,rowSpan:k==null?void 0:k.rowSpan,minWidth:T.minWidth,resizable:Me?T.resizable:!1,defaultWidth:we(T,ce),style:{textAlign:Ct(T.align),width:pe(T,ce),position:"sticky",top:(k==null?void 0:k.top)??0,left:fe?Fe(ce):void 0,zIndex:fe?3:2,backgroundColor:at,boxShadow:$?_r:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:Re?e.jsxs(e.Fragment,{children:[De,Je]}):e.jsxs(e.Fragment,{children:[Je,De]})})},`th-${U}`)},zt=xe.filter(p=>!p.col.hideOnMobile),Vt=zt.find(p=>p.col.primary)??zt[0],zn=zt.filter(p=>p!==Vt),Vn=p=>N(k=>{const T=new Set(k);return T.has(p)?T.delete(p):T.add(p),T}),xr=(p,k)=>zn.map(({col:T,key:U})=>{const ce=Ke(T,p,k),fe=typeof ce=="string"||typeof ce=="number"?e.jsx(w.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:ce}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:ce});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof T.title=="string"?e.jsx(w.Text,{color:"subtle",fontWeight:"medium",style:{color:bi,flexShrink:0},children:T.title}):e.jsx("div",{style:{flexShrink:0},children:T.title}),fe]},U)}),hr=(p,k)=>{const T=Vt?Ke(Vt.col,p,k):null;return typeof T=="string"||typeof T=="number"?e.jsx(w.Text,{as:"span",style:bt,children:T}):e.jsx("span",{style:bt,children:T})},Hn=e.jsx(h.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:W},(p,k)=>e.jsxs(h.Box,{style:{border:jt,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(ze.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(ze.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(ze.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${k}`))}),fr=e.jsx(h.Box,{fullWidth:!0,style:{minHeight:(E==null?void 0:E.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:E==null?void 0:E.content}),Pn=v?Hn:ye.length===0?fr:j==="expand"?e.jsx(h.Box,{style:{display:"flex",flexDirection:"column"},children:ye.map((p,k)=>{const T=Te(p,k),U=Z.has(T);return e.jsxs("div",{style:{borderBottom:jt},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsxs("button",{type:"button",onClick:()=>Vn(T),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:[hr(p,k),e.jsx(B.Icon,{name:U?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),C&&An(p,k)]}),U&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:xr(p,k)})]},T)})}):e.jsx(h.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:ye.map((p,k)=>e.jsxs(h.Box,{style:{border:jt,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6},children:[hr(p,k),xr(p,k),C&&Rn(p,k)]},Te(p,k)))}),Nn=o&&Me&&A!==void 0,_n=e.jsxs(Q.Table,{className:"sa-table-layout",fullWidth:!0,size:i,resizable:Nn,onWidthsChange:Ze?G:void 0,children:[e.jsx(Q.Thead,{ref:M,children:Be?e.jsxs(e.Fragment,{children:[e.jsxs(Q.Tr,{children:[Ee.map(p=>p.isGroup?e.jsx(Q.Th,{colSpan:p.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:at},children:e.jsx("span",{style:bt,children:p.col.title})},`grp-${p.key}`):At(p.leaves[0],{rowSpan:2})),C&&e.jsx(Q.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:at}})]}),e.jsx(Q.Tr,{children:Ee.flatMap(p=>p.isGroup?p.leaves.map(k=>At(k,{top:q})):[])})]}):e.jsxs(Q.Tr,{children:[xe.map(p=>At(p)),C&&e.jsx(Q.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:at}})]})}),e.jsx(Q.Tbody,{children:v?In:ye.length===0?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:$e,children:fr})}):e.jsxs(e.Fragment,{children:[ye.map((p,k)=>{const T=y==null?void 0:y(p,k,k>0?ye[k-1]:void 0);return e.jsxs(u.Fragment,{children:[T!=null&&T!==!1&&e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:$e,style:{backgroundColor:at},children:T})}),e.jsxs(Q.Tr,{children:[xe.map(({col:U,key:ce},fe)=>{var tt;const $=(tt=U.cellProps)==null?void 0:tt.call(U,p,k,ye);if($!=null&&$.hidden)return null;const de=Ie(fe),De=de&&fe===Le,Re=Ke(U,p,k);return e.jsx(Q.Td,{className:de?"sa-tl-frozen":void 0,colSpan:$==null?void 0:$.colSpan,rowSpan:$==null?void 0:$.rowSpan,style:{textAlign:Ct(U.align),width:pe(U,fe),minWidth:U.minWidth,position:de?"sticky":void 0,left:de?Fe(fe):void 0,zIndex:de?1:void 0,boxShadow:De?_r:void 0},children:typeof Re=="string"?e.jsx(w.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Ct(U.align)},children:Re}):Re},`tl-cell-${k}-${ce}`)}),C&&e.jsx(Q.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:Wn(p,k)})]})]},Te(p,k))}),D!=null&&e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:$e,children:D})})]})})]}),Ht=F?ye.findIndex((p,k)=>Te(p,k)===F.rowKey):-1,Pt=Ht>=0?ye[Ht]:null;return e.jsxs(e.Fragment,{children:[e.jsx(h.Box,{ref:Ge,fullWidth:!0,style:{overflow:"auto",height:m??Qe},children:O?Pn:_n}),F&&Pt&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:F.top,right:F.right},onClick:p=>p.stopPropagation(),children:ft(Pt).map(p=>e.jsx("div",{style:{padding:"2px 4px"},children:mt(p,Pt,Ht,{showLabel:!0,size:"sm"})},p.key))})]})},Jt=t=>t==="asc"||t==="desc",Si=(t={})=>{const{sortKeyParam:r="sortBy",sortOrderParam:n="sortOrder",pageKey:i="page",defaultSort:o=null,paramKeys:s,scopeId:c,storage:l=dr}=t,{searchParams:a,setSearchParams:d,searchQueries:f}=Se(),g=a.toString(),m=c?ct.tableSort(c):void 0,j=u.useRef(!1);u.useEffect(()=>{if(j.current||(j.current=!0,!m)||a.has(r)||a.has(n))return;const W=l.get(m);!(W!=null&&W.key)||!Jt(W.direction)||d({...Object.fromEntries(a.entries()),[r]:W.key,[n]:W.direction})},[]);const L=u.useMemo(()=>{const W=a.get(r),b=a.get(n);return W&&Jt(b)?{key:W,direction:b}:o},[g,r,n,o]);u.useEffect(()=>{if(!m)return;const W=a.get(r),b=a.get(n);W&&Jt(b)?l.set(m,{key:W,direction:b}):l.remove(m)},[g,m,r,n,l]);const y=(s==null?void 0:s.sortBy)??"sortBy",D=(s==null?void 0:s.sortOrder)??"sortOrder",E=u.useMemo(()=>L?{[y]:L.key,[D]:L.direction}:{},[L,y,D]),v=u.useCallback(W=>{const b={...f};W?(b[r]=W.key,b[n]=W.direction):(delete b[r],delete b[n]),delete b[i],d(b)},[f,r,n,i,d]);return{sort:L,setSort:v,params:E}},It=({of:t,render:r})=>u.Children.toArray(t==null?void 0:t.map((n,i,o)=>r(n,i,o))),ne=({condition:t,fallback:r,children:n,loading:i,isLoading:o})=>e.jsx(e.Fragment,{children:o?i:t?n:r}),ie=t=>e.jsx(w.Text,{...t,fontFamily:"Poppins",fontSize:t.fontSize||"md",fontWeight:t.fontWeight||"medium",color:t.color||"gray-700",children:t.children}),Ne=t=>e.jsx(w.Text,{color:"red-600",fontSize:"sm",children:t.message}),ki=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,a,d;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(ie,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:o.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(h.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(qe.Input,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default",fullWidth:!0}),!s&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},Bi=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,a,d;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(ie,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:o.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(h.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(h.Box,{direction:"column",style:{width:o.inputProps.fullWidth?"100%":r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(ot.Dropdown,{size:t,...o.inputProps,error:!!o.errorMessage})}),!s&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},Fi=(t,r)=>typeof t=="string"&&t||r==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",Ei=t=>{var l;const[r,n]=u.useState(!1),i=a=>{a.preventDefault(),a.stopPropagation()},o=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&t.handleOnFileChange(a.dataTransfer.files.item(0))},s=a=>{a.preventDefault(),n(!0)},c=a=>{a.preventDefault(),n(!1)};return e.jsxs(h.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:t.handleOnClick,onDragOver:i,onDrop:o,onDragEnter:s,onDragLeave:c,paddingBlock:"md",borderRadius:"rounded-md",style:{border:r?"1px solid var(--sa-border-info)":`1px solid ${Fi(t.errorMessage,t.status)}`},children:[e.jsx(B.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",children:[e.jsx(w.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(w.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",children:(l=t.fileSupports)==null?void 0:l.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function Mi(t){return t.split(" ").map(r=>r[0]).join("").slice(0,2).toUpperCase()}const kn=t=>{const r={day:"2-digit",month:"short",year:"numeric"};return t.toLocaleDateString("id-ID",r)},Li=t=>{const r={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},n=t.split(" ");if(n.length!==3)return null;const i=parseInt(n[0],10),o=r[n[1]],s=parseInt(n[2],10);return isNaN(i)||isNaN(o)||isNaN(s)?null:new Date(s,o,i)};function Ii(t,r=!0){if(!t)return"Rp 0";const n=typeof t=="number"?t.toString():t;if(isNaN(Number(n)))return"Rp 0";const i=n.split("."),o=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),s=i.length===2?o+"."+i[1]:o;return r?"Rp"+s:s}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")};String.prototype.toNumber=function(){return Number(this)};const Ti=t=>{const r=t.split(" ");let n=r[0].charAt(0);return r.length>1&&(n+=""+r[1].charAt(0)),n.toUpperCase()};function Oi(t){const r=typeof t=="string"?new Date(t):t;if(isNaN(r.getTime()))throw new Error("Invalid date format");const n=r.getFullYear(),i=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${n}-${i}-${o}`}const Wi="sa-admin",Ae=t=>`var(--${Wi}-${t})`,Ri={base:{borderColor:Ae("base-border-color"),textColor:Ae("base-text-color"),iconColor:Ae("base-icon-color"),placeholderColor:Ae("base-placeholder-color")},document:{bgColor:Ae("document-bg-color")},sidebar:{bgColor:Ae("sidebar-bg-color"),borderColor:Ae("sidebar-border-color"),maxWidth:Ae("sidebar-max-width"),width:Ae("sidebar-width"),collapseWidth:Ae("sidebar-collapse-width"),collapseV2Width:Ae("sidebar-v2-collapse-width")}},Ai=24*60*60*1e3,zi=t=>{const r="14px poppins",i=document.createElement("canvas").getContext("2d");i.font=r;const o=i.measureText(t).width;return Number(Math.ceil(o))},Vi=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Hi=/--+/,Pi=/-$/;function Ni(t,r){return JSON.stringify(t)!==JSON.stringify(r)}function _i(t){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(t)}function qi(t){return/^[A-Za-z\s]+$/.test(t)}const Zi=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&(t.key==="a"||t.key==="c"||t.key==="v")||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},Gi=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},Qi=t=>{const r=/^[0-9.]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},Ui=t=>Vi.test(t);function Ji(t){return!(Hi.test(t)||Pi.test(t))}const Yi=t=>{const r=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((t.ctrlKey||t.metaKey)&&["a","c","v","x"].includes(t.key.toLowerCase()))return;const n=t.currentTarget.value;/^[0-9]$/.test(t.key)||t.key==="."&&!n.includes(".")||t.key==="-"&&n.length===0&&!n.includes("-")||r.includes(t.key)||t.preventDefault()},Xi=t=>{const r=document.getElementById(t);if(r){const n=r.getBoundingClientRect(),i=window.scrollY+n.top-80;window.scrollTo({top:i,behavior:"smooth"})}};function Ki(t){const r=t.toLowerCase();if(["kb","mb","gb"].find(s=>r.endsWith(s)))return t;const o=Number(t);if(isNaN(o))throw new Error("Invalid size format");return o>=1e6?`${(o/1e6).toFixed(2)}MB`:o>=1e3?`${(o/1e3).toFixed(2)}KB`:`${o}B`}function $i(t){const r=t.split("/");return r[r.length-1]}const es=t=>{var r,n;return e.jsxs(h.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:t.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(oe.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(B.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(oe.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(w.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:t.defaultFile?$i(t.defaultFile.url):(r=t.fileSelected)==null?void 0:r.name}),t.defaultFile?(t.defaultFile.size||t.defaultFile.date)&&e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[t.defaultFile.size&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",children:t.defaultFile.size}),t.defaultFile.size&&t.defaultFile.date&&e.jsx(B.Icon,{name:"Dot",size:"xs"}),t.defaultFile.date&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:t.defaultFile.date})]}):e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",children:Ki(((n=t.fileSelected)==null?void 0:n.size.toString())||"100000")}),e.jsx(B.Icon,{name:"Dot",size:"xs"}),e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:kn(new Date)})]})]})]}),e.jsx(z.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:i=>{i.stopPropagation(),t.handleOnDeleteFile()},iconLeft:e.jsx(B.Icon,{name:"Trash1"})})]})},Bn=({status:t="default",labelPosition:r="outside-top",...n})=>{var m;const i=u.useRef(null),o=()=>{if(n.defaultFile){window.open(n.defaultFile.url);return}i.current&&i.current.click()},s=ge.useMediaQuery("md"),c=t==="error"||typeof n.errorMessage=="string"&&!!n.errorMessage,l=n.label?e.jsxs(oe.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(w.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:n.label}),n.optional&&e.jsx("span",{style:{background:"var(--sa-background-neutral)",border:"1px solid var(--sa-border-subtle)",borderRadius:"4px",padding:"0 8px",fontSize:"10px",fontWeight:500,lineHeight:"18px",color:"var(--sa-text-primary)",display:"inline-flex",alignItems:"center"},children:"Optional"}),n.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=n.description?e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.description}):null,d=e.jsxs(e.Fragment,{children:[n.helperText&&e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.helperText}),n.errorText&&t==="error"&&e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorText}),n.errorMessage&&!n.errorText&&e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorMessage})]}),f=e.jsx("input",{type:"file",style:{display:"none"},ref:i,onChange:j=>{var L;return n.handleOnChangeFile(((L=j.target.files)==null?void 0:L.item(0))||null)},accept:(m=n.fileSupportOption)==null?void 0:m.map(j=>"."+(j==null?void 0:j.toLowerCase())).join(", ")}),g=e.jsxs(h.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...n.containerProps,children:[f,(n.fileSelected||n.defaultFile)&&e.jsx(es,{fileSelected:n.fileSelected,defaultFile:n.defaultFile,handleOnDeleteFile:n.handleOnDeleteFile,handleOnClickFile:o}),!n.fileSelected&&!n.defaultFile&&e.jsx(Ei,{fileSupports:n.fileSupportOption,isDesktop:s,errorMessage:c?n.errorText||n.errorMessage||" ":void 0,status:c?"error":"default",handleOnClick:o,handleOnFileChange:n.handleOnChangeFile})]});return r==="outside-left"?e.jsxs(oe.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(oe.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[l,a]}),e.jsxs(oe.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[g,d]})]}):e.jsxs(oe.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[l,a,g,d]})},ts=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,a,d;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(ie,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:o.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(Bn,{...o.inputProps,status:o.errorMessage?"error":"default"}),!s&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage})]})]})},rs=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,required:o=!1,...s})=>{var a,d,f,g;const c=s.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"||r==="horizontal-inline"?"spacing-96":"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(ne,{condition:!!o,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsx(ie,{children:s.title}),e.jsx(We.Body3,{props:{color:"gray-500"},children:s.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:s.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Ce.Tooltip,{label:(d=s.tooltip)==null?void 0:d.label,arrowPosition:(f=s.tooltip)==null?void 0:f.arrowPosition,...s.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!s.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:s.description})})]})}),e.jsx(h.Box,{gap:r==="horizontal-inline"?"xl":"md",direction:r==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(It,{of:(g=s.checkBoxesList)==null?void 0:g.map(m=>({...m,isChecked:s.checkBoxesAreChecked.includes(m.id)})),render:m=>m.renderBadge?e.jsxs(h.Box,{direction:"row",justify:"space-between",gap:"lg",...s.badgeContainerProps,children:[e.jsx(lt.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:j=>s.onChecked(j.target.value,m),label:m.name,description:m.description}),m.renderBadge]}):e.jsx(lt.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:j=>s.onChecked(j.target.value,m),label:m.name,description:m.description})})}),!c&&s.errorMessage&&e.jsx(Ne,{message:s.errorMessage})]})},ns=({position:t="vertical",size:r="md",fullWidth:n=!1,...i})=>{var s;const o=t==="horizontal-inline"||t==="horizontal-block"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:t==="horizontal-inline"||t==="horizontal-block"?"spacing-96":"sm",direction:t==="horizontal-inline"||t==="horizontal-block"?"row":"column",children:[e.jsx(ne,{condition:!!i.description||!!i.title,children:e.jsxs(h.Box,{direction:"column",customMaxWidth:o,fullWidth:n,children:[i.title&&e.jsx(ie,{children:i.title}),e.jsx(ne,{condition:!!i.description,children:e.jsx(w.Text,{color:"gray-500",children:i.description})})]})}),e.jsx(h.Box,{gap:"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(It,{of:(s=i.radioList)==null?void 0:s.map(c=>({...c,isChecked:i.radioIsChecked===c.id})),render:({value:c,id:l,isChecked:a,subInput:d,label:f,description:g})=>e.jsxs(h.Box,{direction:"column",gap:"xs",customMaxWidth:o,children:[e.jsx(Kt.Radio,{id:`${l.toString()}-${c}`,name:i.groupName||f,label:f,value:c,checked:a,onChange:m=>i.onChecked({id:l,label:m.target.name,value:m.target.value}),disabled:i.disableAll},l),g&&e.jsx(w.Text,{color:"gray-500",style:{marginLeft:28},children:g}),d]})})}),i.errorMessage&&e.jsx(Ne,{message:i.errorMessage})]})},os=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,a,d;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(ie,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:o.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(Xt.Textarea,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default"}),!s&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage})]})]})},is=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",required:i=!1,fullWidth:o=!1,...s})=>{var l,a,d;const c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(ne,{condition:i,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:o,children:[e.jsx(ie,{children:s.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:s.titleDescription})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:o,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:s.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((l=s.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=s.tooltip)==null?void 0:a.label,arrowPosition:(d=s.tooltip)==null?void 0:d.arrowPosition,...s.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!s.titleDescription,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:s.titleDescription})})]})}),e.jsx(st.Toggle,{checked:s.checked,onChange:s.onChange,label:s.label,description:s.description}),s.errorMessage&&e.jsx(Ne,{message:s.errorMessage})]})},ss=({variant:t="primary",size:r="md",...n})=>{const i=nt.useColor(),o=c=>{var a,d,f,g,m,j;if(!c)return;const l=n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary"?"var(--sa-text-subtle, #8c8f97)":t==="secondary-danger"?(d=(a=i==null?void 0:i.computed)==null?void 0:a.red)==null?void 0:d[600]:t==="secondary-primary"?(g=(f=i==null?void 0:i.computed)==null?void 0:f.blue)==null?void 0:g[700]:(j=(m=i==null?void 0:i.computed)==null?void 0:m.gray)==null?void 0:j[50];return e.jsx(B.Icon,{name:c,size:r,style:{color:l}})},s=()=>{var l,a,d,f;if(t!=="secondary-danger"&&t!=="secondary-primary")return n.title;const c={color:n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary-danger"?(a=(l=i==null?void 0:i.computed)==null?void 0:l.red)==null?void 0:a[600]:(f=(d=i==null?void 0:i.computed)==null?void 0:d.blue)==null?void 0:f[700]};switch(r){case"xs":return e.jsx(We.Body2,{props:{style:c},children:n.title});case"sm":case"md":return e.jsx(We.SubH3,{props:{style:c},children:n.title});case"lg":return e.jsx(We.SubH2,{props:{style:c},children:n.title});default:return n.title}};return e.jsx(z.Button,{fullWidth:!0,disabled:n.disabled,primary:t==="primary",secondary:t==="secondary"||t==="secondary-danger"||t==="secondary-primary",success:t==="success",onClick:n.onClick,type:n.type,iconLeft:o(n.iconLeft),iconRight:o(n.iconRight),size:r,children:s()})},ls=t=>e.jsx(We.H5,{props:{...t},children:t.title}),cs=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,a,d;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(ie,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:o.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(h.Box,{direction:"column",style:{width:r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(Xe.StarasiaDate,{size:t,...o.inputProps,status:o.errorMessage?"error":void 0})}),!s&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage})]})]})};async function as(t,r){const n=new Image;n.src=t,await new Promise((s,c)=>{n.onload=s,n.onerror=c});const i=document.createElement("canvas");i.width=r.width,i.height=r.height;const o=i.getContext("2d",{alpha:!0});if(!o)throw new Error("No 2D context");return o.drawImage(n,r.x,r.y,r.width,r.height,0,0,r.width,r.height),new Promise((s,c)=>{i.toBlob(l=>{if(!l)return c("Canvas is empty");const a=new File([l],"cropped.png",{type:"image/png"});s(a)},"image/png")})}const Zr={"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},Fn=u.forwardRef(({handleUpload:t,urlImage:r,isUploading:n,croppedImage:i,setCroppedImage:o,size:s="96",aspect:c="1:1",containerProps:l,maxFileSize:a=2,onError:d},f)=>{const g=ge.useMediaQuery("md"),[m,j]=u.useState(!1),[L,y]=u.useState(null),[D,E]=u.useState(!1),[v,W]=u.useState({x:0,y:0}),[b,R]=u.useState(1),[O,C]=u.useState(null);u.useEffect(()=>{r===null&&o(null)},[r]);const F=u.useCallback((K,P)=>{C(P)},[]),H=K=>{var le;const P=(le=K.target.files)==null?void 0:le[0];if(!P)return;const re=new FileReader;re.onload=()=>{y(re.result),E(!0)},re.readAsDataURL(P)},Z=async()=>{if(!(!L||!O))try{const K=await as(L,O);if(a&&K.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}t==null||t(K);const P=URL.createObjectURL(K);o(P,K),E(!1)}catch{d==null||d("Gagal memproses gambar")}},N=u.useRef(null),X=()=>{N.current&&N.current.click()};u.useImperativeHandle(f,()=>({openFileDialog:()=>{var K;(K=N.current)==null||K.click()}}));const se=parseInt(s,10),he=Zr[c];let te,ae;return he>=1?(ae=se,te=se*he):(te=se,ae=se/he),e.jsxs(h.Box,{direction:"column",display:"flex",position:"relative",bg:(l==null?void 0:l.bg)||"gray-200",borderStyle:(l==null?void 0:l.borderStyle)||"border-none",borderColor:(l==null?void 0:l.borderColor)||"gray-200",borderWidth:(l==null?void 0:l.borderWidth)||"border-2",borderRadius:(l==null?void 0:l.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:l!=null&&l.fullWidth?"100%":`${te}px`,height:l!=null&&l.fullWidth?"auto":`${ae}px`,aspectRatio:he,flexShrink:0},onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[i||r?e.jsx("img",{src:i||r||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(h.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(B.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(h.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",cursor:"pointer",style:{inset:0,backgroundColor:"var(--sa-color-black-alpha-a30, #080f214a)",opacity:m?1:0,transition:"opacity 0.3s ease-in-out"},onClick:X,children:[e.jsx("input",{ref:N,type:"file",accept:"image/*",onChange:H,disabled:n,style:{display:"none"}}),e.jsxs(h.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(B.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(ne,{condition:s.toNumber()>80,children:e.jsx(w.Text,{color:"gray-50",fontSize:s.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),n&&e.jsx(h.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",style:{inset:0,zIndex:20,backgroundColor:"var(--sa-color-white-alpha-a80, #e5e9f640)"},children:e.jsx(h.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),D&&tr.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:()=>E(!1),children:e.jsxs("div",{style:{backgroundColor:"var(--sa-background-primary)",borderRadius:"var(--sa-radii-md)",boxShadow:"0 20px 60px rgba(0,0,0,0.3)",overflow:"hidden",width:g?c==="1:1"?"min(90vw, 480px)":`min(90vw, ${te*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:K=>K.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:L&&e.jsx(qn,{image:L,crop:v,zoom:b,aspect:c?Zr[c]:void 0,onCropChange:W,onZoomChange:R,onCropComplete:F,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(z.Button,{size:"sm",secondary:!0,onClick:()=>E(!1),children:"Cancel"}),e.jsx(z.Button,{size:"sm",primary:!0,onClick:Z,children:"Crop"})]})]})}),document.body)]})}),ds=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,required:o=!1,...s})=>{var a,d,f;const c=s.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(ne,{condition:!!o,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsx(ie,{children:s.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:s.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:s.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Ce.Tooltip,{label:(d=s.tooltip)==null?void 0:d.label,arrowPosition:(f=s.tooltip)==null?void 0:f.arrowPosition,...s.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!s.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:s.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(Fn,{...s.inputProps}),!c&&s.errorMessage&&e.jsx(Ne,{message:s.errorMessage})]})]})},us=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var c,l,a;const s=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:s,fullWidth:i,children:[e.jsx(ie,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:s,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:o.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Ce.Tooltip,{label:(l=o.tooltip)==null?void 0:l.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),o.inputProps.extended&&o.inputProps.extended]})},xs=({items:t,id:r,handleOnUpdate:n,width:i,toggleShow:o=!0,disabled:s=!1})=>{var f;const[c,l]=u.useState([]);u.useEffect(()=>{t&&l([...t.map(g=>({id:g.id,isActive:g.isActive}))])},[t]);const a=(f=c.find(g=>g.id===r))==null?void 0:f.isActive,d=u.useCallback(()=>{l(g=>g.map(m=>m.id===r?{...m,isActive:!m.isActive}:m)),n&&n(!a)},[r,n,a]);return e.jsx(h.Box,{direction:"row",gap:"md",style:{width:i},children:o&&e.jsx(st.Toggle,{disabled:s,checked:a,onChange:d,label:a?"Active":"Inactive"})})},hs={InputText:ki,InputDropdown:Bi,InputSingleFile:ts,CheckBoxOptions:rs,RadioOptions:ns,InputTextArea:os,ToggleForm:is,ActionButton:ss,FormTitle:ls,InputDate:cs,InputImgFile:ds,Custom:us},En=({customBottom:t})=>{const[r,n]=u.useState(!1),i=()=>{window.scrollY>window.screenY?n(!0):n(!1)},o=()=>{window.scrollTo({top:0,behavior:"smooth"})};return u.useEffect(()=>(window.addEventListener("scroll",i),()=>{window.removeEventListener("scroll",i)}),[]),e.jsx(h.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(h.Box,{direction:"column",position:"absolute",style:{bottom:t||"1.6rem",right:"2rem",transform:r?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(z.Button,{secondary:!0,size:"xs",onClick:o,type:"button",iconLeft:e.jsx(B.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},fs=({pageLayout:t,children:r,wrapperProps:n,containerProps:i})=>{const o=ge.useMediaQuery("md"),s=(i==null?void 0:i.customWidth)??264;return e.jsxs(h.Box,{display:"block",direction:"row",...n,style:{marginRight:o?s:24,...(n==null?void 0:n.style)??{}},children:[t,e.jsx(h.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",...i,style:{marginTop:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(i==null?void 0:i.style)??{}},children:r})]})},ms=({children:t,withScrollToTopButton:r=!1,scrollToTopButtonProps:n,containerProps:i})=>e.jsx(h.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 999)"},children:e.jsxs(h.Box,{position:"fixed",bottom:"bottom-0",right:"right-0",padding:"spacing-32",height:"height-24",bg:"gray-50",direction:"row",align:"center",display:"flex",style:{left:"var(--app-sidebar-width, 0px)",transition:"left 0.3s ease-in-out",borderColor:"var(--sa-border-subtle, #0b120e24)"},justify:(i==null?void 0:i.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[r&&e.jsx(En,{...n,customBottom:(n==null?void 0:n.customBottom)||"5.7rem"}),t]})}),gs=({fields:t})=>e.jsx(h.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(It,{of:t,render:(r,n)=>e.jsx(ys,{...r},n)})}),ys=({title:t,value:r,icon:n})=>e.jsxs(h.Box,{display:"flex",direction:"column",gap:"sm",children:[n?e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(B.Icon,{name:n,color:"subtle"}),e.jsx(w.Text,{color:"gray-500",variant:"sub-h3",children:t})]}):e.jsx(w.Text,{color:"gray-500",variant:"sub-h3",children:t}),typeof r=="string"?e.jsx(w.Text,{variant:"sub-h3",children:r}):r]}),be={silhouette:"#A7B0AC",accent:"#78867F"};function ps({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t||"100",height:r||"90",viewBox:"0 0 102 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M51.0002 16.8145C36.0811 16.8145 24.8296 21.3801 24.8296 27.4328V76.5344C24.8296 82.573 36.0799 87.127 51.0002 87.127C65.9204 87.127 77.1707 82.573 77.1707 76.5344V27.4328C77.1707 21.3801 65.9204 16.8145 51.0002 16.8145ZM51.0002 19.1582C65.0602 19.1582 74.8582 23.5187 74.8582 27.4328C74.8582 30.1363 70.1615 32.9664 63.1708 34.4746C55.861 36.0543 46.1416 36.0543 38.8318 34.4746C31.8399 32.9664 27.1432 30.1363 27.1432 27.4328C27.1432 23.5187 36.9402 19.1582 51.0002 19.1582ZM74.8582 31.9199V43.784C74.8582 46.532 70.3142 49.2941 63.2737 50.8328C63.2391 50.8375 63.2032 50.8434 63.1697 50.8504C57.6867 52.0352 50.8498 52.3305 44.6893 51.7387C42.6358 51.5418 40.6575 51.2453 38.8306 50.8504C38.8029 50.8445 38.7682 50.8387 38.7347 50.8352C32.5707 49.4898 28.318 47.2047 27.3514 44.8141C27.2138 44.4719 27.1421 44.1285 27.1421 43.7852V31.9199C27.1999 31.9715 27.2693 32.0207 27.3294 32.0723C27.5052 32.2246 27.6902 32.3758 27.8844 32.5234C27.9954 32.609 28.1064 32.6934 28.2232 32.7766C28.4371 32.9301 28.6637 33.0801 28.8973 33.2289C29.0083 33.2992 29.1135 33.3719 29.2291 33.441C29.5702 33.6473 29.9275 33.8488 30.3044 34.0434C30.3195 34.0516 30.3333 34.0598 30.3484 34.068C30.7427 34.2707 31.1601 34.4652 31.5925 34.6551C31.7301 34.716 31.8758 34.7734 32.0168 34.832C32.3221 34.9598 32.6331 35.0852 32.9557 35.207C33.1303 35.2727 33.3095 35.3359 33.4887 35.4004C33.8032 35.5117 34.1247 35.6207 34.4542 35.7273C34.6404 35.7871 34.8254 35.8469 35.015 35.9043C35.3734 36.0133 35.7434 36.1164 36.1181 36.2184C36.2915 36.2652 36.4603 36.3145 36.6361 36.3602C37.1911 36.5031 37.7588 36.6402 38.3485 36.7668C42.1595 37.5906 46.5336 38.0254 50.999 38.0254C55.4644 38.0254 59.8397 37.5906 63.6495 36.768C64.2404 36.6402 64.8092 36.5031 65.3666 36.3602C65.5377 36.3156 65.7007 36.2688 65.8684 36.223C66.2499 36.1199 66.6246 36.0145 66.9888 35.9031C67.1749 35.8469 67.3553 35.7883 67.5368 35.7309C67.8745 35.623 68.2028 35.5105 68.5243 35.3969C68.6966 35.3359 68.8677 35.275 69.0353 35.2117C69.3672 35.0863 69.6852 34.9574 69.9985 34.8262C70.1326 34.7699 70.2725 34.7148 70.4032 34.6574C70.8379 34.4664 71.2576 34.2707 71.6542 34.0668C71.66 34.0633 71.6658 34.0609 71.6716 34.0574C72.0589 33.8582 72.4243 33.6508 72.7735 33.441C72.8868 33.3719 72.9909 33.3016 73.1007 33.2313C73.3354 33.0813 73.5632 32.9312 73.7794 32.7766C73.8951 32.6934 74.0049 32.609 74.1159 32.5258C74.3102 32.377 74.4963 32.2258 74.6732 32.0723C74.7322 32.0207 74.8027 31.9727 74.8594 31.9211L74.8582 31.9199ZM74.8582 48.2887V60.1598C74.8582 62.8773 70.3396 65.6359 63.335 67.2004C63.2737 67.2051 63.2136 67.2156 63.1547 67.2285C59.5021 68.016 55.2482 68.4109 50.9955 68.4098C48.8692 68.4098 46.7428 68.3113 44.6917 68.1145C42.6405 67.9176 40.6656 67.6211 38.8399 67.2273C38.7832 67.2133 38.7266 67.2051 38.6699 67.2004C31.663 65.6359 27.1432 62.8785 27.1432 60.1598V48.2887C27.2022 48.3426 27.2739 48.393 27.3352 48.4457C27.5075 48.5945 27.6878 48.7422 27.8763 48.8875C27.9908 48.9754 28.1052 49.0633 28.2255 49.15C28.4348 49.3 28.6568 49.4477 28.8834 49.593C28.999 49.6668 29.1089 49.7418 29.228 49.8145C29.5633 50.0172 29.9136 50.2152 30.2825 50.4074C30.3114 50.4227 30.338 50.4379 30.3669 50.452C30.7507 50.6488 31.1566 50.8398 31.5775 51.0262C31.722 51.0895 31.8746 51.1504 32.0226 51.2125C32.3198 51.3379 32.6227 51.4609 32.9372 51.5793C33.1164 51.6473 33.2991 51.7129 33.4841 51.7785C33.7917 51.8887 34.1073 51.9953 34.4299 52.0996C34.6196 52.1605 34.8092 52.2227 35.0046 52.2812C35.3584 52.3891 35.7238 52.4922 36.0938 52.593C36.2684 52.641 36.4395 52.6902 36.6176 52.7359C37.1714 52.8789 37.738 53.016 38.3253 53.1426C38.3554 53.1496 38.3889 53.1555 38.4236 53.159C42.2161 53.9723 46.5636 54.4023 51.0013 54.4023C55.439 54.4023 59.7784 53.9734 63.5697 53.1613C63.6056 53.1566 63.6414 53.1508 63.6773 53.1426C64.2647 53.0148 64.8312 52.8789 65.3851 52.7359C65.5643 52.6902 65.7342 52.6398 65.9088 52.593C66.2788 52.4922 66.6442 52.3891 66.998 52.2812C67.1934 52.2215 67.3831 52.1605 67.5727 52.0996C67.8953 51.9953 68.2109 51.8887 68.5185 51.7785C68.7023 51.7129 68.8862 51.6473 69.0654 51.5793C69.3799 51.4598 69.6817 51.3367 69.98 51.2125C70.128 51.1504 70.2806 51.0895 70.4252 51.0262C70.846 50.841 71.2507 50.65 71.6357 50.452C71.6646 50.4367 71.6912 50.4215 71.7201 50.4074C72.0901 50.2152 72.4405 50.0172 72.7747 49.8145C72.8949 49.7418 73.0036 49.6668 73.1192 49.593C73.347 49.4477 73.5678 49.3 73.7771 49.15C73.8974 49.0633 74.0118 48.9766 74.1263 48.8875C74.3148 48.7422 74.4952 48.5945 74.6674 48.4457C74.7287 48.393 74.7992 48.3426 74.8582 48.2887ZM74.8582 76.5355C74.8582 80.4367 65.0602 84.7844 51.0002 84.7844C36.9402 84.7844 27.1421 80.4367 27.1421 76.5355V64.6469C27.1987 64.6984 27.2693 64.7477 27.3282 64.7992C27.5028 64.9504 27.6844 65.0992 27.8763 65.2469C27.9873 65.3324 28.0995 65.418 28.2162 65.5023C28.4302 65.6559 28.6568 65.807 28.8892 65.9559C28.9979 66.0262 29.1019 66.0977 29.2152 66.1656C29.5691 66.3801 29.9367 66.591 30.3299 66.7937C30.331 66.7937 30.3322 66.7938 30.3333 66.7961C30.7253 66.9988 31.1404 67.1945 31.5694 67.3855C31.7058 67.4465 31.8515 67.5039 31.9914 67.5637C32.2955 67.6926 32.6054 67.8191 32.928 67.9422C33.1002 68.0078 33.2772 68.0711 33.4541 68.1355C33.7674 68.248 34.0888 68.3582 34.4184 68.466C34.6034 68.5258 34.7872 68.5867 34.9768 68.6453C35.3341 68.7555 35.703 68.8609 36.0764 68.9641C36.2476 69.0109 36.4141 69.0602 36.5887 69.1059C37.1413 69.2512 37.7079 69.3895 38.2941 69.5195C38.3462 69.5312 38.3993 69.5383 38.4514 69.543C42.2369 70.3516 46.5717 70.7793 50.999 70.7793C55.4263 70.7793 59.7599 70.3527 63.5478 69.543C63.5998 69.5383 63.653 69.5312 63.705 69.5195C64.2912 69.3906 64.8578 69.2512 65.4105 69.1059C65.5839 69.0602 65.7493 69.0121 65.9192 68.9652C66.295 68.8621 66.665 68.7555 67.0246 68.6453C67.2131 68.5879 67.3958 68.5281 67.5785 68.4684C67.9092 68.3605 68.2329 68.2492 68.5486 68.1355C68.7231 68.0723 68.8977 68.009 69.0689 67.9445C69.3938 67.8203 69.7071 67.6926 70.0135 67.5625C70.1511 67.5039 70.2933 67.4477 70.4275 67.3879C71.29 67.0047 72.0774 66.5969 72.7851 66.1668C72.8972 66.0988 73.0001 66.0273 73.1088 65.9582C73.3424 65.8082 73.5702 65.657 73.7852 65.5023C73.9008 65.4191 74.0118 65.3336 74.1217 65.2492C74.3148 65.1016 74.4975 64.9516 74.6732 64.7992C74.7322 64.7488 74.8016 64.6996 74.8582 64.648V76.5355Z",fill:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.accent,fillOpacity:"0.65"})]})})}const js=({title:t="create",children:r,onClickAction:n,variant:i="primary",variantTitle:o,leftIcon:s,showButton:c=!0,customHeight:l,childrenButton:a,customIcon:d})=>{const f=()=>{switch(i){case"primary":return e.jsx(e.Fragment,{children:s?e.jsx(z.Button,{primary:!0,iconLeft:s,onClick:n,children:a||t}):e.jsx(z.Button,{primary:!0,onClick:n,children:a||t})});case"secondary":return e.jsx(e.Fragment,{children:s?e.jsx(z.Button,{secondary:!0,iconLeft:s,onClick:n,children:o?e.jsx(w.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||t}):t}):e.jsx(z.Button,{secondary:!0,onClick:n,children:a||t})});case"success":return e.jsx(e.Fragment,{children:s?e.jsx(z.Button,{success:!0,iconLeft:s,onClick:n,children:a||t}):e.jsx(z.Button,{success:!0,onClick:n,children:a||t})});default:return e.jsx(e.Fragment,{children:s?e.jsx(z.Button,{primary:!0,iconLeft:s,onClick:n,children:a||t}):e.jsx(z.Button,{primary:!0,onClick:n,children:a||t})})}};return e.jsxs(h.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:l,children:[d||e.jsx(ps,{}),e.jsx(h.Box,{direction:"column",children:r.map((g,m)=>e.jsx(We.Body1,{props:{align:"center",textAlign:"center"},children:m>2?null:g},m))}),c?f():null]})},J={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function bs({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke:J.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:J.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:J.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:J.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:J.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:J.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:J.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:J.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:J.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:J.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:J.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:J.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:J.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:J.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:J.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:J.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:J.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:J.cFFFFFF,stroke:J.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:J.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:J.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:J.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:J.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:J.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:J.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:J.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:J.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:J.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:J.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:J.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:J.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:J.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:J.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:J.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:J.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:J.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:J.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:J.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:J.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:J.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:J.c001A72})]})})}function Cs({onClick:t}){const r=ge.useMediaQuery("md");return e.jsxs(h.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(bs,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(w.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),t&&e.jsx(z.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const ee={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 vs({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:ee.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:ee.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:ee.cEFF3F8,stroke:ee.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:ee.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:ee.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:ee.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:ee.c956847,stroke:ee.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:ee.c956847,stroke:ee.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:ee.cC8CEF4,stroke:ee.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:ee.cC8CEF4,stroke:ee.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:ee.cC8CEF4,stroke:ee.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:ee.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:ee.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:ee.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:ee.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:ee.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:ee.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:ee.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:ee.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:ee.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:ee.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:ee.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:ee.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:ee.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function ws({onClick:t}){const r=ge.useMediaQuery("md");return e.jsxs(h.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(vs,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",children:"We Are Sorry ..."}),t&&e.jsx(z.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const x={c000D58:"#000D58",c001174:"#001174",c28AC6E:"#28AC6E",c48504C:"#48504C",c64B5F6:"#64B5F6",c90CAF9:"#90CAF9",cC9184A:"#C9184A",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cD9D9D9:"#D9D9D9",cDEECF8:"#DEECF8",cE7EAE9:"#E7EAE9",cF3F8FD:"#F3F8FD",cFFE18B:"#FFE18B",cFFFFFF:"#FFFFFF"};function Ds({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,viewBox:"0 0 622 287",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M406.562 180.997C406.562 148.544 412.16 122.978 423.356 104.299C434.721 85.6199 452.957 76.2803 478.063 76.2803C503.168 76.2803 521.319 85.6199 532.514 104.299C543.88 122.978 549.562 148.544 549.562 180.997C549.562 213.827 543.88 239.582 532.514 258.261C521.319 276.941 503.168 286.28 478.063 286.28C452.957 286.28 434.721 276.941 423.356 258.261C412.16 239.582 406.562 213.827 406.562 180.997ZM506.815 180.997C506.815 161.941 504.949 147.318 501.217 137.129C497.485 126.752 489.767 121.563 478.063 121.563C466.358 121.563 458.64 126.752 454.908 137.129C451.176 147.318 449.31 161.941 449.31 180.997C449.31 193.827 449.988 204.488 451.345 212.978C452.703 221.28 455.417 228.073 459.488 233.356C463.729 238.45 469.92 240.997 478.063 240.997C486.205 240.997 492.312 238.45 496.383 233.356C500.624 228.073 503.423 221.28 504.78 212.978C506.137 204.488 506.815 193.827 506.815 180.997Z",fill:x.cD6EBFD}),e.jsx("path",{d:"M246.562 180.558C246.562 148.105 252.16 122.539 263.356 103.86C274.721 85.1804 292.957 75.8408 318.063 75.8408C343.168 75.8408 361.319 85.1804 372.514 103.86C383.88 122.539 389.562 148.105 389.562 180.558C389.562 213.388 383.88 239.143 372.514 257.822C361.319 276.501 343.168 285.841 318.063 285.841C292.957 285.841 274.721 276.501 263.356 257.822C252.16 239.143 246.562 213.388 246.562 180.558ZM346.815 180.558C346.815 161.501 344.949 146.879 341.217 136.69C337.485 126.313 329.767 121.124 318.063 121.124C306.358 121.124 298.64 126.313 294.908 136.69C291.176 146.879 289.31 161.501 289.31 180.558C289.31 193.388 289.988 204.048 291.345 212.539C292.702 220.841 295.417 227.633 299.488 232.916C303.729 238.011 309.92 240.558 318.063 240.558C326.205 240.558 332.312 238.011 336.383 232.916C340.624 227.633 343.423 220.841 344.78 212.539C346.137 204.048 346.815 193.388 346.815 180.558Z",fill:x.cD6EBFD}),e.jsx("path",{d:"M222.808 118.703H128.062V159.858C132.111 155.484 137.779 151.905 145.067 149.122C152.356 146.338 160.251 144.946 168.754 144.946C183.938 144.946 196.49 148.326 206.41 155.086C216.532 161.846 223.922 170.594 228.578 181.329C233.234 192.065 235.562 203.696 235.562 216.221C235.562 239.483 228.882 257.972 215.52 271.691C202.158 285.21 183.357 282.89 159.062 282.89C142.867 282.89 131.098 284.939 116.826 283.918C104.881 278.351 95.6695 270.697 89.1911 260.955C82.7127 251.213 79.1698 239.98 78.5625 227.256H129.276C130.491 233.419 133.426 238.588 138.083 242.763C142.739 246.739 149.116 248.728 157.214 248.728C166.729 248.728 173.815 245.745 178.472 239.781C183.128 233.817 185.456 225.864 185.456 215.923C185.456 206.181 183.027 198.726 178.168 193.557C173.309 188.387 166.223 185.803 156.911 185.803C150.027 185.803 144.359 187.493 139.905 190.873C135.451 194.054 132.515 198.328 131.098 203.696H80.9919V73.9697H222.808V118.703Z",fill:x.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:x.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:x.cFFFFFF,stroke:x.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 200.539C269.878 200.263 270.101 200.039 270.377 200.039L305.476 199.955C305.753 199.955 305.978 200.179 305.978 200.455V206.461H269.878V200.539Z",stroke:x.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:x.cFFFFFF,stroke:x.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 235.871C269.878 235.595 270.101 235.372 270.377 235.371L305.476 235.288C305.753 235.287 305.978 235.511 305.978 235.788V241.794H269.878V235.871Z",stroke:x.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:x.cFFFFFF,stroke:x.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 272.088C269.878 271.812 270.101 271.589 270.377 271.588L305.476 271.505C305.753 271.504 305.978 271.728 305.978 272.005V278.011H269.878V272.088Z",stroke:x.c001174}),e.jsx("path",{d:"M279.095 176.348H364.373C365.459 176.348 366.125 176.992 366.986 178.252V202.985C366.986 202.985 366.986 203.869 366.545 204.752C366.103 205.635 365.661 206.077 365.661 206.077L306.478 206.163V199.452L279.095 199.518V176.348Z",fill:x.cF3F8FD}),e.jsx("path",{d:"M279.095 211.093H364.373C365.459 211.093 366.125 211.736 366.986 212.997V237.73C366.986 237.73 366.986 238.613 366.545 239.497C366.103 240.38 365.661 240.822 365.661 240.822L306.478 240.908V234.197L279.095 234.262V211.093Z",fill:x.cF3F8FD}),e.jsx("path",{d:"M279.095 248.008H364.373C365.459 248.008 366.125 248.652 366.986 249.912V274.646C366.986 274.646 366.986 275.529 366.545 276.412C366.103 277.296 365.661 277.737 365.661 277.737L306.478 277.824V271.112L279.095 271.178V248.008Z",fill:x.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:x.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:x.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:x.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:x.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:x.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:x.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:x.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:x.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:x.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:x.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:x.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:x.cDEECF8}),e.jsx("path",{d:"M268.053 210.494C268.483 209.112 268.564 208.343 268.053 206.961H362.569C361.955 208.363 361.972 209.136 362.569 210.494H268.053Z",fill:x.c000D58,stroke:x.c001174}),e.jsx("path",{d:"M268.053 246.269C268.483 244.887 268.564 244.118 268.053 242.736H362.569C361.955 244.138 361.972 244.911 362.569 246.269H268.053Z",fill:x.c000D58,stroke:x.c001174}),e.jsx("path",{d:"M283.312 130.775C283.312 129.64 283.987 128.72 284.82 128.72H349.805C350.638 128.72 351.312 129.64 351.312 130.775V169.72H283.312V130.775Z",fill:x.cFFFFFF,stroke:x.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M279.574 171.847C279.381 171.283 279.267 170.624 279.33 169.72H355.195C355.423 170.925 355.287 171.695 355.063 172.241C354.834 172.802 354.506 173.186 354.101 173.66C354.084 173.68 354.067 173.7 354.05 173.72H280.503C280.468 173.658 280.434 173.598 280.4 173.539C280.051 172.922 279.774 172.434 279.574 171.847Z",stroke:x.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M350.312 133.72V129.726L284.812 129.72C284.312 129.726 284.312 129.726 284.312 130.125V133.72H350.312Z",fill:x.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:x.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:x.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:x.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:x.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:x.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:x.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:x.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:x.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:x.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:x.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:x.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Ss({onClick:t}){const r=ge.useMediaQuery("md");return e.jsxs(h.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(Ds,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(w.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),t&&e.jsx(z.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const ks=t=>{var n,i,o,s,c;const r=ge.useMediaQuery("md");return e.jsxs(Oe.Dialog,{isShow:t.isShow,onHide:t.onHide,style:{...r?{minWidth:t.customMinWidth||"458px"}:{maxWidth:t.customMinWidth||"458px"}},children:[e.jsx(Oe.DialogTitle,{...t.dialogTitleProps,children:typeof t.title=="string"?e.jsx(w.Text,{fontSize:"lg",fontWeight:"medium",children:t.title}):t.title}),e.jsx(Oe.DialogBody,{children:typeof t.description=="string"?e.jsx(w.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:t.description}):t.description}),e.jsx(Oe.DialogFooter,{children:e.jsx(h.Box,{display:"flex",direction:((n=t.containerConfirmBtnProps)==null?void 0:n.direction)||"row",justify:((i=t.containerConfirmBtnProps)==null?void 0:i.justify)||"flex-end",...t.containerConfirmBtnProps,children:e.jsxs(h.Box,{display:"flex",direction:((o=t.wrapperConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((s=t.wrapperConfirmBtnProps)==null?void 0:s.justify)||"flex-end",gap:((c=t.wrapperConfirmBtnProps)==null?void 0:c.gap)||"sm",...t.wrapperConfirmBtnProps,children:[t.onCancel&&e.jsx(z.Button,{secondary:!0,onClick:t.onCancel,size:"md",fullWidth:!0,children:t.titleCancelBtn||"Cancel"}),e.jsx(h.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(z.Button,{...t.buttonConfirmProps,onClick:t.onConfirm,size:"md",fullWidth:!0,children:t.titleConfirmBtn||"Ok"})})]})})})]},t.key)},Bs=u.memo(({children:t,height:r,minHeight:n,customHeight:i,paddingInline:o="spacing-0",paddingBlock:s="spacing-0",header:c,footer:l,title:a,titleTag:d,action:f,actionContainer:g,containerProps:m,bodyProps:j,headerProps:L={borderBottom:!0},footerProps:y={borderTop:!0},variantTag:D="info"})=>{const E=u.useRef(null),[v,W]=u.useState("100vh");u.useEffect(()=>{const C=()=>{if(E.current){const F=E.current.getBoundingClientRect().top;W(`calc(100vh - ${F}px)`)}};return C(),window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[]);const b=()=>d?e.jsxs(h.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(w.Text,{fontWeight:"medium",children:a}),e.jsx(_e.Badges,{border:!0,text:d,variant:D})]}):e.jsx(w.Text,{fontWeight:"medium",children:a}),R=()=>c||e.jsxs(h.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(h.Box,{direction:"column",children:a?b():null}),e.jsx(h.Box,{direction:"column",...g,children:f??null})]}),O=!!(c||a||f);return e.jsxs(h.Box,{ref:E,height:r,customMinHeight:n,customHeight:i,paddingBlock:s,paddingInline:o,bg:"white",direction:"column",...m,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:v,...(m==null?void 0:m.style)??{}},children:[c!==null&&O?e.jsx(lr,{...L,children:R()}):null,e.jsx(h.Box,{direction:"column",padding:"spacing-0",...j,style:{flex:1,overflow:"auto",...(j==null?void 0:j.style)??{}},children:t}),l?e.jsx(cr,{...y,children:l}):null]})}),Fs=u.memo(({value:t,options:r=[],onChange:n,multiple:i})=>{const o=(t==null?void 0:t.map(l=>l.value))||[],s=(r==null?void 0:r.filter(l=>o.includes(l.value)))||[],c=l=>{const a=[...s];let d=[];i?d=o.includes(l.value)?a.filter(f=>f.value!==l.value):[...a,l]:d=[l],n==null||n(d)};return e.jsx(h.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:r==null?void 0:r.map((l,a)=>e.jsx(z.Button,{...o.includes(l.value)?{primary:!0}:{secondary:!0},onClick:()=>c(l),children:l.label},a))})});function Tt(t){return null}Tt.displayName="LayoutDialog.Header";function Ot(t){return null}Ot.displayName="LayoutDialog.Body";function Wt(t){return null}Wt.displayName="LayoutDialog.Aside";function Rt(t){return null}Rt.displayName="LayoutDialog.Footer";const ve={"lyd-root":"_lyd-root_1e92c_1","lyd-backdrop":"_lyd-backdrop_1e92c_28","lyd-panel":"_lyd-panel_1e92c_37","lyd-modal":"_lyd-modal_1e92c_48","lyd-fullscreen":"_lyd-fullscreen_1e92c_58","lyd-sidebar":"_lyd-sidebar_1e92c_66","lyd-header":"_lyd-header_1e92c_94","lyd-header-content":"_lyd-header-content_1e92c_105","lyd-header-actions":"_lyd-header-actions_1e92c_113","lyd-main":"_lyd-main_1e92c_120","lyd-body":"_lyd-body_1e92c_127","lyd-aside":"_lyd-aside_1e92c_133","lyd-footer":"_lyd-footer_1e92c_149","lyd-vm-group":"_lyd-vm-group_1e92c_162","lyd-vm-btn":"_lyd-vm-btn_1e92c_170","lyd-close-btn":"_lyd-close-btn_1e92c_193"},Es=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(Ls,{})},{mode:"modal",label:"Modal",icon:e.jsx(B.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(B.Icon,{name:"Fullscreen",size:"sm"})}];function Ms({value:t,onChange:r}){return e.jsx("div",{className:ve["lyd-vm-group"],role:"group","aria-label":"View mode",children:Es.map(n=>e.jsx("button",{type:"button",className:ve["lyd-vm-btn"],"data-active":t===n.mode,"aria-label":`Switch to ${n.label} view`,"aria-pressed":t===n.mode,onClick:()=>r(n.mode),children:n.icon},n.mode))})}function Ls(){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 Yt={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function Is(t){return t?t in Yt?Yt[t]:t:Yt.xl}function vt(t,r){let n=null;return u.Children.forEach(t,i=>{u.isValidElement(i)&&i.type===r&&(n=i.props.children??null)}),n}function Ts(t){const{isOpen:r,onClose:n,viewMode:i,defaultViewMode:o="modal",onViewModeChange:s,showViewModeToggle:c=!0,showCloseButton:l=!0,size:a,asideWidth:d,disableEscapeClose:f=!1,disableBackdropClose:g=!1,lockBodyScroll:m=!0,children:j}=t,[L,y]=u.useState(o),D=i??L,v=ge.useMediaQuery("md")?D:"fullscreen",W=u.useCallback(X=>{i===void 0&&y(X),s==null||s(X)},[i,s]),b=u.useRef(null);u.useEffect(()=>{if(!(!r||!m))return b.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=b.current??""}},[r,m]),u.useEffect(()=>{if(!r||f)return;const X=se=>{se.key==="Escape"&&n()};return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[r,f,n]);const R=u.useMemo(()=>vt(j,Tt),[j]),O=u.useMemo(()=>vt(j,Ot),[j]),C=u.useMemo(()=>vt(j,Wt),[j]),F=u.useMemo(()=>vt(j,Rt),[j]);if(!r)return null;const H=[ve["lyd-panel"],v==="modal"&&ve["lyd-modal"],v==="fullscreen"&&ve["lyd-fullscreen"],v==="sidebar"&&ve["lyd-sidebar"]].filter(Boolean).join(" "),Z={"--lyd-max-w":Is(a),...d!==void 0&&{"--lyd-aside-w":d}},N=()=>{g||n()};return e.jsxs("div",{className:ve["lyd-root"],style:Z,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:ve["lyd-backdrop"],onClick:N,"aria-hidden":"true"}),e.jsxs("div",{className:H,children:[e.jsxs("div",{className:ve["lyd-header"],children:[e.jsx("div",{className:ve["lyd-header-content"],children:R}),e.jsxs("div",{className:ve["lyd-header-actions"],children:[c&&e.jsx(Ms,{value:D,onChange:W}),l&&e.jsx("button",{type:"button",className:ve["lyd-close-btn"],onClick:n,"aria-label":"Close dialog",children:e.jsx(B.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:ve["lyd-main"],children:[e.jsx("div",{className:ve["lyd-body"],children:O}),C&&e.jsx("aside",{className:ve["lyd-aside"],children:C})]}),F&&e.jsx("div",{className:ve["lyd-footer"],children:F})]})]})}const ht=Ts;ht.Header=Tt;ht.Body=Ot;ht.Aside=Wt;ht.Footer=Rt;function Os({url:t,filename:r,onClose:n}){return u.useEffect(()=>{const i=o=>{o.key==="Escape"&&n()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[n]),e.jsxs("div",{onClick:n,style:{position:"fixed",inset:0,zIndex:9999,backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px"},children:[e.jsxs("div",{onClick:i=>i.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:t,download:r,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.15)",color:"#fff",borderRadius:"var(--sa-radii-sm, 6px)",fontSize:"13px",textDecoration:"none",backdropFilter:"blur(4px)"},children:"Download"}),e.jsx("button",{onClick:n,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",backgroundColor:"rgba(255,255,255,0.15)",border:"none",borderRadius:"var(--sa-radii-sm, 6px)",color:"#fff",cursor:"pointer",backdropFilter:"blur(4px)"},"aria-label":"Close preview",children:"✕"})]}),e.jsx("img",{src:t,alt:r,onClick:i=>i.stopPropagation(),style:{maxWidth:"90vw",maxHeight:"85vh",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-lg, 0 25px 50px rgba(0,0,0,0.5))"}}),e.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:r})]})}const Ws=t=>{const{defaultTab:r=0,paramKey:n="tab"}=t||{},[i,o]=me.useSearchParams(),s=it.searchParamsToObject(i.toString());return{activeTab:s[n]?parseInt(s[n]):r,handleTabChange:a=>{o({...s,[n]:a.toString()})},searchQueries:s}};function Rs({appName:t,menuConfig:r,formatTitle:n}){const i=me.useLocation();u.useEffect(()=>{let o=null,s=null;for(const a of r){const d=a.items.find(f=>f.to?f.to==="/"?i.pathname==="/":!!(f.to===i.pathname||i.pathname.startsWith(f.to+"/")):!1);if(d){o=d,s=a;break}}const c=[];o!=null&&o.title&&c.push(o.title),s!=null&&s.name&&c.push(s.name.toTitleCase());const l=(a,d)=>a.length>0?`${a.join(" - ")} | ${d}`:d;document.title=(n||l)(c,t)},[i.pathname])}const As=()=>{const[t,r]=me.useSearchParams(),n=it.searchParamsToObject(t.toString()),i=me.useParams(),o=me.useLocation(),s=i.id;return{setSearchParams:r,searchParams:t,searchQueries:n,isHasQuery:(f,g)=>t.has(f)&&t.get(f)===g,getQueryParam:f=>t.get(f),getRouteParam:f=>i[f],params:i,location:o,id:s,hasId:!!s}};function zs(t){var i,o;const r=t.decodedAccessToken;return u.useMemo(()=>{var a,d;const s=((d=(a=r==null?void 0:r.access)==null?void 0:a.role)==null?void 0:d.code)??"",c=Object.keys(t.role).reduce((f,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,j=>j.replace("_","").toUpperCase())}`;return{...f,[m]:!1}},{});return{...Object.keys(t.role).reduce((f,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,j=>j.replace("_","").toUpperCase())}`;return{...f,[m]:s===t.role[g]}},c),hasRole:f=>s===t.role[f],getRoleKey:()=>s}},[(o=(i=r==null?void 0:r.access)==null?void 0:i.role)==null?void 0:o.code,t])}exports.AdvanceFilterBar=hn;exports.App=Gn;exports.AppComponent=Yr;exports.AppContext=rr;exports.AppLayout=Yn;exports.AsideBar=fs;exports.BackButton=Kn;exports.ColumnFilterDropdown=wn;exports.ColumnMenu=Sn;exports.ConfirmationDialog=ks;exports.DataTable=Dn;exports.DecisionWrapper=ne;exports.EachUtils=It;exports.EmptyStatePage=js;exports.FilterBar=ii;exports.FilterDrawer=xn;exports.FloatingFooter=ms;exports.ForbiddenPage=ws;exports.Form=hs;exports.FullSection=Bs;exports.HeaderLeftSlot=Qn;exports.HeaderLeftSlotOutlet=$r;exports.HeaderLeftSlotProvider=Kr;exports.HorizontalField=no;exports.ImagePreview=Os;exports.InputFile=Bn;exports.InputImage=Fn;exports.LayoutDialog=ht;exports.LayoutDialogAside=Wt;exports.LayoutDialogBody=Ot;exports.LayoutDialogFooter=Rt;exports.LayoutDialogHeader=Tt;exports.ModuleSwitcher=$n;exports.ModuleSwitcherModal=nn;exports.NotFoundPage=Cs;exports.PageLayout=so;exports.Pressable=Et;exports.RightDrawer=on;exports.ScrollToTopButton=En;exports.Section=uo;exports.SectionFooter=cr;exports.SectionHeader=lr;exports.SelectButton=Fs;exports.ServerErrorPage=Ss;exports.SidebarBadgesProvider=Ur;exports.SidebarGroupSlot=Un;exports.SidebarGroupSlotOutlet=tn;exports.SidebarGroupSlotProvider=en;exports.SidebarHeaderSlot=Xr;exports.TableFooter=vn;exports.TableHeader=Cn;exports.TableLayout=Di;exports.TableSection=pi;exports.TableWrapper=bn;exports.ToggleStatus=xs;exports.Typography=We;exports.VerticalField=gs;exports.clearModuleSelection=Jn;exports.createInitialFromUserName=Mi;exports.cssVars=Ri;exports.expandDateCompact=xi;exports.formHasChanged=Ni;exports.formatDate=Oi;exports.formatDateToIndonesian=kn;exports.formatRupiah=Ii;exports.getDateFilterValue=un;exports.getDateRangeFilterValue=Bo;exports.getInitials=Ti;exports.getValueDropdownMultipleFilter=dn;exports.getValueRadioFilter=ko;exports.getValueSearch=Mt;exports.getValuesFilter=Dt;exports.handleChangeFilter=xt;exports.handleOnScroll=Xi;exports.isEmail=Ui;exports.isFilterActive=Fo;exports.isOnlyLettersAndSpaces=qi;exports.isPhoneNumber=_i;exports.isSlug=Ji;exports.localStorageAdapter=dr;exports.oneDayInMs=Ai;exports.parseIndonesianDateToDate=Li;exports.preventNonCoordinateInput=Yi;exports.preventNonNumberAndDecimalInput=Qi;exports.preventNonNumberInput=Zi;exports.preventNumberInput=Gi;exports.resolveDateRangeValueToString=cn;exports.resolveDateValueToString=an;exports.resolveDropdownValueToString=sn;exports.resolveRadioValueToString=ln;exports.resolveSidebarBadge=wt;exports.storageKeys=ct;exports.textWidth=zi;exports.useApp=nr;exports.useAppState=Gr;exports.useAuthRole=zs;exports.useDynamicTitle=Rs;exports.useFilterBarApiParams=ai;exports.useFilterBarControls=ui;exports.useModuleSelection=sr;exports.useRouteInfo=Se;exports.useRouteParams=As;exports.useSidebarBadges=Jr;exports.useTabState=Ws;exports.useTableSortApiParams=Si;Object.keys(mr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>mr[t]})});Object.keys(_e).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>_e[t]})});Object.keys(h).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>h[t]})});Object.keys(rt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>rt[t]})});Object.keys(z).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>z[t]})});Object.keys(gr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>gr[t]})});Object.keys(Xe).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Xe[t]})});Object.keys(Oe).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Oe[t]})});Object.keys(kt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>kt[t]})});Object.keys(ot).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ot[t]})});Object.keys(ge).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ge[t]})});Object.keys(it).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>it[t]})});Object.keys(qe).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>qe[t]})});Object.keys(I).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>I[t]})});Object.keys(ut).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ut[t]})});Object.keys(dt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>dt[t]})});Object.keys(Q).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Q[t]})});Object.keys(yr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>yr[t]})});Object.keys(Xt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Xt[t]})});Object.keys(nt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>nt[t]})});Object.keys(pr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>pr[t]})});Object.keys(st).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>st[t]})});Object.keys(Ce).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ce[t]})});Object.keys(lt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>lt[t]})});Object.keys(Kt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Kt[t]})});Object.keys(w).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>w[t]})});Object.keys(B).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>B[t]})});Object.keys(oe).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>oe[t]})});Object.keys(jr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>jr[t]})});Object.keys(br).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>br[t]})});Object.keys(Cr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Cr[t]})});Object.keys(vr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>vr[t]})});Object.keys(wr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>wr[t]})});Object.keys(ze).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ze[t]})});Object.keys(Dr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Dr[t]})});
|
|
43
|
+
`,document.head.appendChild(t)},Ct=t=>t==="right"?"right":t==="center"?"center":"left",vi=(t,r)=>{if(r)return t[r]},wi=(t,r)=>t==null&&r==null?0:t==null?-1:r==null?1:typeof t=="number"&&typeof r=="number"?t-r:String(t).localeCompare(String(r)),Di=({columns:t,data:r,getRowKey:n,size:i="md",resizable:o=!1,widthStorageKey:s,columnState:c,onColumnStateChange:l,columnMenu:a=!1,sort:d,defaultSort:f,onSortChange:g,height:m,mobileLayout:j="cards",mobileBreakpoint:L="md",groupSeparator:y,summary:D,emptyState:F,loading:v=!1,loadingRows:W=8,rowActions:b})=>{Ci();const R=!ye.useMediaQuery(L)&&j!=="scroll",C=!!(b!=null&&b.length),[E,H]=u.useState(null);u.useEffect(()=>{if(!E)return;const p=()=>H(null),k=setTimeout(()=>document.addEventListener("click",p),0);return()=>{clearTimeout(k),document.removeEventListener("click",p)}},[E]);const[P,q]=u.useState(()=>new Set),Y=c!==void 0,[le,he]=u.useState({}),ne=c??le,ae=p=>{l==null||l(p),Y||he(p)},X=d!==void 0,[$,te]=u.useState(f??null),re=X?d??null:$,ue=!g,Fe=p=>{g==null||g(p),X||te(p)},{headerGroups:Ee,leafColumns:fe,hasGroups:ve}=u.useMemo(()=>{var me;const p=new Set(ne.hidden??[]),k=(K,de)=>K.key??(typeof K.accessor=="string"?K.accessor:`col-${de}`),T=t.map((K,de)=>{var Ae;if((Ae=K.children)!=null&&Ae.length){const tt=K.children.map((Je,Nt)=>({col:Je,key:k(Je,`${de}-${Nt}`)})).filter(Je=>!p.has(Je.key));return{col:K,key:K.key??`group-${de}`,isGroup:!0,leaves:tt}}const Se={col:K,key:k(K,`${de}`)};return{col:K,key:Se.key,isGroup:!1,leaves:p.has(Se.key)?[]:[Se]}}).filter(K=>K.leaves.length>0),Q=T.some(K=>K.isGroup);let ce=T.flatMap(K=>K.leaves);if(!Q&&((me=ne.order)!=null&&me.length)){const K=new Map(ne.order.map((de,Se)=>[de,Se]));ce=[...ce].sort((de,Se)=>(K.get(de.key)??1/0)-(K.get(Se.key)??1/0))}return{headerGroups:T,leafColumns:ce,hasGroups:Q}},[t,ne]),Re=u.useMemo(()=>new Map(fe.map((p,k)=>[p.key,k])),[fe]),xe=fe.map(p=>p.key).join("|"),Pe=(p,k)=>{const T=p.sortKey??(typeof p.accessor=="string"?p.accessor:void 0);return T?k[T]:void 0},He=p=>p.sortable??(!!p.sortKey||typeof p.accessor=="string"),pe=u.useMemo(()=>{if(!ue||!re)return r;const p=fe.find(T=>T.key===re.key);if(!p)return r;const k=re.direction==="asc"?1:-1;return[...r].sort((T,Q)=>wi(Pe(p.col,T),Pe(p.col,Q))*k)},[r,ue,re,fe]),Me=!ve,Ze=!!s&&Me,[S,Z]=G.useColumnWidths(s??""),N=Ze?S:void 0,M=u.useRef(null),[A,V]=u.useState();u.useLayoutEffect(()=>{V(void 0)},[xe]),u.useLayoutEffect(()=>{if(!Me||A||!M.current)return;const p=M.current.querySelectorAll("th.sa-tl-leaf");V(Array.from(p).map(k=>k.offsetWidth))},[A,Me]);const[_,J]=u.useState(0);u.useLayoutEffect(()=>{if(!ve||!M.current)return;const p=M.current.querySelector(":scope > tr");p&&J(p.offsetHeight)},[ve,xe]);const je=(p,k)=>{if((N==null?void 0:N[k])!=null)return N[k];if(p.width!=null)return p.width;if((A==null?void 0:A[k])!=null)return A[k]},De=(p,k)=>typeof p.width=="number"?p.width:A==null?void 0:A[k],Le=ne.frozenKey&&!ve?fe.findIndex(p=>p.key===ne.frozenKey):-1,Ie=p=>p<=Le,Be=p=>{if(!A)return 0;let k=0;for(let T=0;T<p;T++)k+=A[T]??0;return k},Ge=u.useRef(null),[Qe,Ue]=u.useState("100vh");u.useLayoutEffect(()=>{if(m!==void 0)return;const p=()=>{if(Ge.current){const k=Ge.current.getBoundingClientRect().top;Ue(`calc(100vh - ${k}px)`)}};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[m]);const Te=(p,k)=>n?n(p,k):k,Ke=(p,k,T)=>p.render?p.render(k,T,pe):vi(k,p.accessor),$e=fe.length+(C?1:0),et=["80%","55%","70%","45%","90%","60%"],Mn=(p,k)=>et[(p*7+k*3)%et.length],Ln=(p,k)=>e.jsx(Ve.Skeleton,{height:14,width:Mn(p,k),borderRadius:"rounded-sm"}),In=Array.from({length:W},(p,k)=>e.jsxs(G.Tr,{children:[fe.map(({col:T,key:Q},ce)=>e.jsx(G.Td,{style:{textAlign:Ct(T.align)},children:Ln(k,ce)},`sa-tl-sk-${k}-${Q}`)),C&&e.jsx(G.Td,{style:{width:1,padding:0,border:"none"}})]},`sa-tl-sk-${k}`)),Tn=(p,k)=>{k||ae({...ne,hidden:[...ne.hidden??[],p]})},On=p=>ae({...ne,frozenKey:ne.frozenKey===p?void 0:p}),ft=p=>(b??[]).filter(k=>{var T;return!((T=k.hidden)!=null&&T.call(k,p))}),ur={position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:4,paddingRight:16,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},mt=(p,k,T,Q)=>{var Ae;const ce=(Ae=p.disabled)==null?void 0:Ae.call(p,k),me=(Q==null?void 0:Q.showLabel)??p.showLabel,K=(Q==null?void 0:Q.size)??"xs",de=e.jsx(z.Button,{size:K,variant:p.variant??"tertiary",tone:p.tone??"neutral",disabled:ce,onClick:()=>p.onClick(k,T),iconLeft:p.icon?e.jsx(B.Icon,{name:p.icon,size:"sm"}):void 0,children:me&&p.label}),Se=p.tooltip;return Se?e.jsx(Ce.Tooltip,{label:Se,position:"top-end",children:de}):de},Wn=(p,k)=>{const T=ft(p);if(!T.length)return null;if(T.length>5){const ce=Te(p,k),me=(E==null?void 0:E.rowKey)===ce;return e.jsx("div",{className:"sa-tl-row-actions",style:ur,onClick:K=>K.stopPropagation(),children:e.jsx(Ce.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(z.Button,{size:"xs",variant:"tertiary",onClick:K=>{const de=K.currentTarget.getBoundingClientRect();H(me?null:{rowKey:ce,top:de.bottom+4,right:window.innerWidth-de.right})},children:e.jsx(B.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:ur,children:T.map(ce=>e.jsx(u.Fragment,{children:mt(ce,p,k)},ce.key))})},Rn=(p,k)=>{const T=ft(p);return T.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:jt},children:T.map(Q=>e.jsx(u.Fragment,{children:mt(Q,p,k,{showLabel:!0,size:"sm"})},Q.key))}):null},An=(p,k)=>{const T=ft(p);return T.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:T.map(Q=>e.jsx(u.Fragment,{children:mt(Q,p,k,{showLabel:!1})},Q.key))}):null},At=(p,k)=>{const{col:T,key:Q}=p,ce=Re.get(Q)??0,me=Ie(ce),K=me&&ce===Le,de=(re==null?void 0:re.key)===Q?re.direction:null,Se=a&&!T.disableMenu?e.jsx(Sn,{active:!!de||me,canSort:He(T),canHide:!T.locked,sortDir:de,frozen:me,onSort:Nt=>Fe({key:Q,direction:Nt}),onClearSort:()=>Fe(null),onToggleFreeze:()=>On(Q),onHide:()=>Tn(Q,T.locked)}):null,Ae=T.align==="right",tt=T.align==="right"?"flex-end":T.align==="center"?"center":"flex-start",Je=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:tt,overflow:"hidden"},children:[T.icon&&e.jsx(B.Icon,{name:T.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:bt,children:T.title})]});return e.jsx(G.Th,{className:`sa-tl-leaf${me?" sa-tl-frozen":""}`,rowSpan:k==null?void 0:k.rowSpan,minWidth:T.minWidth,resizable:Me?T.resizable:!1,defaultWidth:De(T,ce),style:{textAlign:Ct(T.align),width:je(T,ce),position:"sticky",top:(k==null?void 0:k.top)??0,left:me?Be(ce):void 0,zIndex:me?3:2,backgroundColor:at,boxShadow:K?_r:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:Ae?e.jsxs(e.Fragment,{children:[Se,Je]}):e.jsxs(e.Fragment,{children:[Je,Se]})})},`th-${Q}`)},zt=fe.filter(p=>!p.col.hideOnMobile),Vt=zt.find(p=>p.col.primary)??zt[0],zn=zt.filter(p=>p!==Vt),Vn=p=>q(k=>{const T=new Set(k);return T.has(p)?T.delete(p):T.add(p),T}),xr=(p,k)=>zn.map(({col:T,key:Q})=>{const ce=Ke(T,p,k),me=typeof ce=="string"||typeof ce=="number"?e.jsx(w.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:ce}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:ce});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof T.title=="string"?e.jsx(w.Text,{color:"subtle",fontWeight:"medium",style:{color:bi,flexShrink:0},children:T.title}):e.jsx("div",{style:{flexShrink:0},children:T.title}),me]},Q)}),hr=(p,k)=>{const T=Vt?Ke(Vt.col,p,k):null;return typeof T=="string"||typeof T=="number"?e.jsx(w.Text,{as:"span",style:bt,children:T}):e.jsx("span",{style:bt,children:T})},Hn=e.jsx(h.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:W},(p,k)=>e.jsxs(h.Box,{style:{border:jt,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Ve.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(Ve.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(Ve.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${k}`))}),fr=e.jsx(h.Box,{fullWidth:!0,style:{minHeight:(F==null?void 0:F.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:F==null?void 0:F.content}),Pn=v?Hn:pe.length===0?fr:j==="expand"?e.jsx(h.Box,{style:{display:"flex",flexDirection:"column"},children:pe.map((p,k)=>{const T=Te(p,k),Q=P.has(T);return e.jsxs("div",{style:{borderBottom:jt},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsxs("button",{type:"button",onClick:()=>Vn(T),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:[hr(p,k),e.jsx(B.Icon,{name:Q?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),C&&An(p,k)]}),Q&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:xr(p,k)})]},T)})}):e.jsx(h.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:pe.map((p,k)=>e.jsxs(h.Box,{style:{border:jt,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6},children:[hr(p,k),xr(p,k),C&&Rn(p,k)]},Te(p,k)))}),Nn=o&&Me&&A!==void 0,_n=e.jsxs(G.Table,{className:"sa-table-layout",fullWidth:!0,size:i,resizable:Nn,onWidthsChange:Ze?Z:void 0,children:[e.jsx(G.Thead,{ref:M,children:ve?e.jsxs(e.Fragment,{children:[e.jsxs(G.Tr,{children:[Ee.map(p=>p.isGroup?e.jsx(G.Th,{colSpan:p.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:at},children:e.jsx("span",{style:bt,children:p.col.title})},`grp-${p.key}`):At(p.leaves[0],{rowSpan:2})),C&&e.jsx(G.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:at}})]}),e.jsx(G.Tr,{children:Ee.flatMap(p=>p.isGroup?p.leaves.map(k=>At(k,{top:_})):[])})]}):e.jsxs(G.Tr,{children:[fe.map(p=>At(p)),C&&e.jsx(G.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:at}})]})}),e.jsx(G.Tbody,{children:v?In:pe.length===0?e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:$e,children:fr})}):e.jsxs(e.Fragment,{children:[pe.map((p,k)=>{const T=y==null?void 0:y(p,k,k>0?pe[k-1]:void 0);return e.jsxs(u.Fragment,{children:[T!=null&&T!==!1&&e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:$e,style:{backgroundColor:at},children:T})}),e.jsxs(G.Tr,{children:[fe.map(({col:Q,key:ce},me)=>{var tt;const K=(tt=Q.cellProps)==null?void 0:tt.call(Q,p,k,pe);if(K!=null&&K.hidden)return null;const de=Ie(me),Se=de&&me===Le,Ae=Ke(Q,p,k);return e.jsx(G.Td,{className:de?"sa-tl-frozen":void 0,colSpan:K==null?void 0:K.colSpan,rowSpan:K==null?void 0:K.rowSpan,style:{textAlign:Ct(Q.align),width:je(Q,me),minWidth:Q.minWidth,position:de?"sticky":void 0,left:de?Be(me):void 0,zIndex:de?1:void 0,boxShadow:Se?_r:void 0},children:typeof Ae=="string"?e.jsx(w.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Ct(Q.align)},children:Ae}):Ae},`tl-cell-${k}-${ce}`)}),C&&e.jsx(G.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:Wn(p,k)})]})]},Te(p,k))}),D!=null&&e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:$e,children:D})})]})})]}),Ht=E?pe.findIndex((p,k)=>Te(p,k)===E.rowKey):-1,Pt=Ht>=0?pe[Ht]:null;return e.jsxs(e.Fragment,{children:[e.jsx(h.Box,{ref:Ge,fullWidth:!0,style:{overflow:"auto",height:m??Qe},children:R?Pn:_n}),E&&Pt&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:E.top,right:E.right},onClick:p=>p.stopPropagation(),children:ft(Pt).map(p=>e.jsx("div",{style:{padding:"2px 4px"},children:mt(p,Pt,Ht,{showLabel:!0,size:"sm"})},p.key))})]})},Jt=t=>t==="asc"||t==="desc",Si=(t={})=>{const{sortKeyParam:r="sortBy",sortOrderParam:n="sortOrder",pageKey:i="page",defaultSort:o=null,paramKeys:s,scopeId:c,storage:l=dr}=t,{searchParams:a,setSearchParams:d,searchQueries:f}=ke(),g=a.toString(),m=c?ct.tableSort(c):void 0,j=u.useRef(!1);u.useEffect(()=>{if(j.current||(j.current=!0,!m)||a.has(r)||a.has(n))return;const W=l.get(m);!(W!=null&&W.key)||!Jt(W.direction)||d({...Object.fromEntries(a.entries()),[r]:W.key,[n]:W.direction})},[]);const L=u.useMemo(()=>{const W=a.get(r),b=a.get(n);return W&&Jt(b)?{key:W,direction:b}:o},[g,r,n,o]);u.useEffect(()=>{if(!m)return;const W=a.get(r),b=a.get(n);W&&Jt(b)?l.set(m,{key:W,direction:b}):l.remove(m)},[g,m,r,n,l]);const y=(s==null?void 0:s.sortBy)??"sortBy",D=(s==null?void 0:s.sortOrder)??"sortOrder",F=u.useMemo(()=>L?{[y]:L.key,[D]:L.direction}:{},[L,y,D]),v=u.useCallback(W=>{const b={...f};W?(b[r]=W.key,b[n]=W.direction):(delete b[r],delete b[n]),delete b[i],d(b)},[f,r,n,i,d]);return{sort:L,setSort:v,params:F}},It=({of:t,render:r})=>u.Children.toArray(t==null?void 0:t.map((n,i,o)=>r(n,i,o))),oe=({condition:t,fallback:r,children:n,loading:i,isLoading:o})=>e.jsx(e.Fragment,{children:o?i:t?n:r}),se=t=>e.jsx(w.Text,{...t,fontFamily:"Poppins",fontSize:t.fontSize||"md",fontWeight:t.fontWeight||"medium",color:t.color||"gray-700",children:t.children}),Ne=t=>e.jsx(w.Text,{color:"red-600",fontSize:"sm",children:t.message}),ki=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,a,d;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(se,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(se,{fontSize:t,children:o.title}),e.jsx(se,{color:"error",fontSize:t,children:n}),e.jsx(oe,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(h.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(qe.Input,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default",fullWidth:!0}),!s&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},Bi=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,a,d;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(se,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(se,{fontSize:t,children:o.title}),e.jsx(se,{color:"error",fontSize:t,children:n}),e.jsx(oe,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(h.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(h.Box,{direction:"column",style:{width:o.inputProps.fullWidth?"100%":r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(ot.Dropdown,{size:t,...o.inputProps,error:!!o.errorMessage})}),!s&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},Fi=(t,r)=>typeof t=="string"&&t||r==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",Ei=t=>{var l;const[r,n]=u.useState(!1),i=a=>{a.preventDefault(),a.stopPropagation()},o=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&t.handleOnFileChange(a.dataTransfer.files.item(0))},s=a=>{a.preventDefault(),n(!0)},c=a=>{a.preventDefault(),n(!1)};return e.jsxs(h.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:t.handleOnClick,onDragOver:i,onDrop:o,onDragEnter:s,onDragLeave:c,paddingBlock:"md",borderRadius:"rounded-md",style:{border:r?"1px solid var(--sa-border-info)":`1px solid ${Fi(t.errorMessage,t.status)}`},children:[e.jsx(B.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(ie.Flex,{direction:"column",gap:"xs",children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",children:[e.jsx(w.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(w.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",children:(l=t.fileSupports)==null?void 0:l.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function Mi(t){return t.split(" ").map(r=>r[0]).join("").slice(0,2).toUpperCase()}const kn=t=>{const r={day:"2-digit",month:"short",year:"numeric"};return t.toLocaleDateString("id-ID",r)},Li=t=>{const r={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},n=t.split(" ");if(n.length!==3)return null;const i=parseInt(n[0],10),o=r[n[1]],s=parseInt(n[2],10);return isNaN(i)||isNaN(o)||isNaN(s)?null:new Date(s,o,i)};function Ii(t,r=!0){if(!t)return"Rp 0";const n=typeof t=="number"?t.toString():t;if(isNaN(Number(n)))return"Rp 0";const i=n.split("."),o=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),s=i.length===2?o+"."+i[1]:o;return r?"Rp"+s:s}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")};String.prototype.toNumber=function(){return Number(this)};const Ti=t=>{const r=t.split(" ");let n=r[0].charAt(0);return r.length>1&&(n+=""+r[1].charAt(0)),n.toUpperCase()};function Oi(t){const r=typeof t=="string"?new Date(t):t;if(isNaN(r.getTime()))throw new Error("Invalid date format");const n=r.getFullYear(),i=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${n}-${i}-${o}`}const Wi="sa-admin",ze=t=>`var(--${Wi}-${t})`,Ri={base:{borderColor:ze("base-border-color"),textColor:ze("base-text-color"),iconColor:ze("base-icon-color"),placeholderColor:ze("base-placeholder-color")},document:{bgColor:ze("document-bg-color")},sidebar:{bgColor:ze("sidebar-bg-color"),borderColor:ze("sidebar-border-color"),maxWidth:ze("sidebar-max-width"),width:ze("sidebar-width"),collapseWidth:ze("sidebar-collapse-width"),collapseV2Width:ze("sidebar-v2-collapse-width")}},Ai=24*60*60*1e3,zi=t=>{const r="14px poppins",i=document.createElement("canvas").getContext("2d");i.font=r;const o=i.measureText(t).width;return Number(Math.ceil(o))},Vi=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Hi=/--+/,Pi=/-$/;function Ni(t,r){return JSON.stringify(t)!==JSON.stringify(r)}function _i(t){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(t)}function qi(t){return/^[A-Za-z\s]+$/.test(t)}const Zi=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&(t.key==="a"||t.key==="c"||t.key==="v")||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},Gi=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},Qi=t=>{const r=/^[0-9.]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},Ui=t=>Vi.test(t);function Ji(t){return!(Hi.test(t)||Pi.test(t))}const Yi=t=>{const r=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((t.ctrlKey||t.metaKey)&&["a","c","v","x"].includes(t.key.toLowerCase()))return;const n=t.currentTarget.value;/^[0-9]$/.test(t.key)||t.key==="."&&!n.includes(".")||t.key==="-"&&n.length===0&&!n.includes("-")||r.includes(t.key)||t.preventDefault()},Xi=t=>{const r=document.getElementById(t);if(r){const n=r.getBoundingClientRect(),i=window.scrollY+n.top-80;window.scrollTo({top:i,behavior:"smooth"})}};function Ki(t){const r=t.toLowerCase();if(["kb","mb","gb"].find(s=>r.endsWith(s)))return t;const o=Number(t);if(isNaN(o))throw new Error("Invalid size format");return o>=1e6?`${(o/1e6).toFixed(2)}MB`:o>=1e3?`${(o/1e3).toFixed(2)}KB`:`${o}B`}function $i(t){const r=t.split("/");return r[r.length-1]}const es=t=>{var r,n;return e.jsxs(h.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:t.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(ie.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(B.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(ie.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(w.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:t.defaultFile?$i(t.defaultFile.url):(r=t.fileSelected)==null?void 0:r.name}),t.defaultFile?(t.defaultFile.size||t.defaultFile.date)&&e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[t.defaultFile.size&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",children:t.defaultFile.size}),t.defaultFile.size&&t.defaultFile.date&&e.jsx(B.Icon,{name:"Dot",size:"xs"}),t.defaultFile.date&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:t.defaultFile.date})]}):e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",children:Ki(((n=t.fileSelected)==null?void 0:n.size.toString())||"100000")}),e.jsx(B.Icon,{name:"Dot",size:"xs"}),e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:kn(new Date)})]})]})]}),e.jsx(z.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:i=>{i.stopPropagation(),t.handleOnDeleteFile()},iconLeft:e.jsx(B.Icon,{name:"Trash1"})})]})},Bn=({status:t="default",labelPosition:r="outside-top",...n})=>{var m;const i=u.useRef(null),o=()=>{if(n.defaultFile){window.open(n.defaultFile.url);return}i.current&&i.current.click()},s=ye.useMediaQuery("md"),c=t==="error"||typeof n.errorMessage=="string"&&!!n.errorMessage,l=n.label?e.jsxs(ie.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(w.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:n.label}),n.optional&&e.jsx("span",{style:{background:"var(--sa-background-neutral)",border:"1px solid var(--sa-border-subtle)",borderRadius:"4px",padding:"0 8px",fontSize:"10px",fontWeight:500,lineHeight:"18px",color:"var(--sa-text-primary)",display:"inline-flex",alignItems:"center"},children:"Optional"}),n.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=n.description?e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.description}):null,d=e.jsxs(e.Fragment,{children:[n.helperText&&e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.helperText}),n.errorText&&t==="error"&&e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorText}),n.errorMessage&&!n.errorText&&e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorMessage})]}),f=e.jsx("input",{type:"file",style:{display:"none"},ref:i,onChange:j=>{var L;return n.handleOnChangeFile(((L=j.target.files)==null?void 0:L.item(0))||null)},accept:(m=n.fileSupportOption)==null?void 0:m.map(j=>"."+(j==null?void 0:j.toLowerCase())).join(", ")}),g=e.jsxs(h.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...n.containerProps,children:[f,(n.fileSelected||n.defaultFile)&&e.jsx(es,{fileSelected:n.fileSelected,defaultFile:n.defaultFile,handleOnDeleteFile:n.handleOnDeleteFile,handleOnClickFile:o}),!n.fileSelected&&!n.defaultFile&&e.jsx(Ei,{fileSupports:n.fileSupportOption,isDesktop:s,errorMessage:c?n.errorText||n.errorMessage||" ":void 0,status:c?"error":"default",handleOnClick:o,handleOnFileChange:n.handleOnChangeFile})]});return r==="outside-left"?e.jsxs(ie.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(ie.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[l,a]}),e.jsxs(ie.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[g,d]})]}):e.jsxs(ie.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[l,a,g,d]})},ts=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,a,d;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(se,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(se,{fontSize:t,children:o.title}),e.jsx(se,{color:"error",fontSize:t,children:n}),e.jsx(oe,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ie.Flex,{direction:"column",gap:"xs",children:[e.jsx(Bn,{...o.inputProps,status:o.errorMessage?"error":"default"}),!s&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage})]})]})},rs=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,required:o=!1,...s})=>{var a,d,f,g;const c=s.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"||r==="horizontal-inline"?"spacing-96":"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(oe,{condition:!!o,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsx(se,{children:s.title}),e.jsx(We.Body3,{props:{color:"gray-500"},children:s.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(se,{fontSize:t,children:s.title}),e.jsx(se,{color:"error",fontSize:t,children:n}),e.jsx(oe,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Ce.Tooltip,{label:(d=s.tooltip)==null?void 0:d.label,arrowPosition:(f=s.tooltip)==null?void 0:f.arrowPosition,...s.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!s.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:s.description})})]})}),e.jsx(h.Box,{gap:r==="horizontal-inline"?"xl":"md",direction:r==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(It,{of:(g=s.checkBoxesList)==null?void 0:g.map(m=>({...m,isChecked:s.checkBoxesAreChecked.includes(m.id)})),render:m=>m.renderBadge?e.jsxs(h.Box,{direction:"row",justify:"space-between",gap:"lg",...s.badgeContainerProps,children:[e.jsx(lt.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:j=>s.onChecked(j.target.value,m),label:m.name,description:m.description}),m.renderBadge]}):e.jsx(lt.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:j=>s.onChecked(j.target.value,m),label:m.name,description:m.description})})}),!c&&s.errorMessage&&e.jsx(Ne,{message:s.errorMessage})]})},ns=({position:t="vertical",size:r="md",fullWidth:n=!1,...i})=>{var s;const o=t==="horizontal-inline"||t==="horizontal-block"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:t==="horizontal-inline"||t==="horizontal-block"?"spacing-96":"sm",direction:t==="horizontal-inline"||t==="horizontal-block"?"row":"column",children:[e.jsx(oe,{condition:!!i.description||!!i.title,children:e.jsxs(h.Box,{direction:"column",customMaxWidth:o,fullWidth:n,children:[i.title&&e.jsx(se,{children:i.title}),e.jsx(oe,{condition:!!i.description,children:e.jsx(w.Text,{color:"gray-500",children:i.description})})]})}),e.jsx(h.Box,{gap:"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(It,{of:(s=i.radioList)==null?void 0:s.map(c=>({...c,isChecked:i.radioIsChecked===c.id})),render:({value:c,id:l,isChecked:a,subInput:d,label:f,description:g})=>e.jsxs(h.Box,{direction:"column",gap:"xs",customMaxWidth:o,children:[e.jsx(Kt.Radio,{id:`${l.toString()}-${c}`,name:i.groupName||f,label:f,value:c,checked:a,onChange:m=>i.onChecked({id:l,label:m.target.name,value:m.target.value}),disabled:i.disableAll},l),g&&e.jsx(w.Text,{color:"gray-500",style:{marginLeft:28},children:g}),d]})})}),i.errorMessage&&e.jsx(Ne,{message:i.errorMessage})]})},os=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,a,d;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(se,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(se,{fontSize:t,children:o.title}),e.jsx(se,{color:"error",fontSize:t,children:n}),e.jsx(oe,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ie.Flex,{direction:"column",gap:"xs",children:[e.jsx(Xt.Textarea,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default"}),!s&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage})]})]})},is=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",required:i=!1,fullWidth:o=!1,...s})=>{var l,a,d;const c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(oe,{condition:i,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:o,children:[e.jsx(se,{children:s.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:s.titleDescription})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:o,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(se,{fontSize:t,children:s.title}),e.jsx(se,{color:"error",fontSize:t,children:n}),e.jsx(oe,{condition:!!((l=s.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=s.tooltip)==null?void 0:a.label,arrowPosition:(d=s.tooltip)==null?void 0:d.arrowPosition,...s.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!s.titleDescription,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:s.titleDescription})})]})}),e.jsx(st.Toggle,{checked:s.checked,onChange:s.onChange,label:s.label,description:s.description}),s.errorMessage&&e.jsx(Ne,{message:s.errorMessage})]})},ss=({variant:t="primary",size:r="md",...n})=>{const i=nt.useColor(),o=c=>{var a,d,f,g,m,j;if(!c)return;const l=n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary"?"var(--sa-text-subtle, #8c8f97)":t==="secondary-danger"?(d=(a=i==null?void 0:i.computed)==null?void 0:a.red)==null?void 0:d[600]:t==="secondary-primary"?(g=(f=i==null?void 0:i.computed)==null?void 0:f.blue)==null?void 0:g[700]:(j=(m=i==null?void 0:i.computed)==null?void 0:m.gray)==null?void 0:j[50];return e.jsx(B.Icon,{name:c,size:r,style:{color:l}})},s=()=>{var l,a,d,f;if(t!=="secondary-danger"&&t!=="secondary-primary")return n.title;const c={color:n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary-danger"?(a=(l=i==null?void 0:i.computed)==null?void 0:l.red)==null?void 0:a[600]:(f=(d=i==null?void 0:i.computed)==null?void 0:d.blue)==null?void 0:f[700]};switch(r){case"xs":return e.jsx(We.Body2,{props:{style:c},children:n.title});case"sm":case"md":return e.jsx(We.SubH3,{props:{style:c},children:n.title});case"lg":return e.jsx(We.SubH2,{props:{style:c},children:n.title});default:return n.title}};return e.jsx(z.Button,{fullWidth:!0,disabled:n.disabled,primary:t==="primary",secondary:t==="secondary"||t==="secondary-danger"||t==="secondary-primary",success:t==="success",onClick:n.onClick,type:n.type,iconLeft:o(n.iconLeft),iconRight:o(n.iconRight),size:r,children:s()})},ls=t=>e.jsx(We.H5,{props:{...t},children:t.title}),cs=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,a,d;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(se,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(se,{fontSize:t,children:o.title}),e.jsx(se,{color:"error",fontSize:t,children:n}),e.jsx(oe,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ie.Flex,{direction:"column",gap:"xs",children:[e.jsx(h.Box,{direction:"column",style:{width:r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(Xe.StarasiaDate,{size:t,...o.inputProps,status:o.errorMessage?"error":void 0})}),!s&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage})]})]})};async function as(t,r){const n=new Image;n.src=t,await new Promise((s,c)=>{n.onload=s,n.onerror=c});const i=document.createElement("canvas");i.width=r.width,i.height=r.height;const o=i.getContext("2d",{alpha:!0});if(!o)throw new Error("No 2D context");return o.drawImage(n,r.x,r.y,r.width,r.height,0,0,r.width,r.height),new Promise((s,c)=>{i.toBlob(l=>{if(!l)return c("Canvas is empty");const a=new File([l],"cropped.png",{type:"image/png"});s(a)},"image/png")})}const Zr={"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},Fn=u.forwardRef(({handleUpload:t,urlImage:r,isUploading:n,croppedImage:i,setCroppedImage:o,size:s="96",aspect:c="1:1",containerProps:l,maxFileSize:a=2,onError:d},f)=>{const g=ye.useMediaQuery("md"),[m,j]=u.useState(!1),[L,y]=u.useState(null),[D,F]=u.useState(!1),[v,W]=u.useState({x:0,y:0}),[b,O]=u.useState(1),[R,C]=u.useState(null);u.useEffect(()=>{r===null&&o(null)},[r]);const E=u.useCallback((X,$)=>{C($)},[]),H=X=>{var re;const $=(re=X.target.files)==null?void 0:re[0];if(!$)return;const te=new FileReader;te.onload=()=>{y(te.result),F(!0)},te.readAsDataURL($)},P=async()=>{if(!(!L||!R))try{const X=await as(L,R);if(a&&X.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}t==null||t(X);const $=URL.createObjectURL(X);o($,X),F(!1)}catch{d==null||d("Gagal memproses gambar")}},q=u.useRef(null),Y=()=>{q.current&&q.current.click()};u.useImperativeHandle(f,()=>({openFileDialog:()=>{var X;(X=q.current)==null||X.click()}}));const le=parseInt(s,10),he=Zr[c];let ne,ae;return he>=1?(ae=le,ne=le*he):(ne=le,ae=le/he),e.jsxs(h.Box,{direction:"column",display:"flex",position:"relative",bg:(l==null?void 0:l.bg)||"gray-200",borderStyle:(l==null?void 0:l.borderStyle)||"border-none",borderColor:(l==null?void 0:l.borderColor)||"gray-200",borderWidth:(l==null?void 0:l.borderWidth)||"border-2",borderRadius:(l==null?void 0:l.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:l!=null&&l.fullWidth?"100%":`${ne}px`,height:l!=null&&l.fullWidth?"auto":`${ae}px`,aspectRatio:he,flexShrink:0},onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[i||r?e.jsx("img",{src:i||r||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(h.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(B.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(h.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",cursor:"pointer",style:{inset:0,backgroundColor:"var(--sa-color-black-alpha-a30, #080f214a)",opacity:m?1:0,transition:"opacity 0.3s ease-in-out"},onClick:Y,children:[e.jsx("input",{ref:q,type:"file",accept:"image/*",onChange:H,disabled:n,style:{display:"none"}}),e.jsxs(h.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(B.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(oe,{condition:s.toNumber()>80,children:e.jsx(w.Text,{color:"gray-50",fontSize:s.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),n&&e.jsx(h.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",style:{inset:0,zIndex:20,backgroundColor:"var(--sa-color-white-alpha-a80, #e5e9f640)"},children:e.jsx(h.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),D&&tr.createPortal(e.jsx("div",{style:{position:"fixed",inset:0,zIndex:19999,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.6)"},onClick:()=>F(!1),children:e.jsxs("div",{style:{backgroundColor:"var(--sa-background-primary)",borderRadius:"var(--sa-radii-md)",boxShadow:"0 20px 60px rgba(0,0,0,0.3)",overflow:"hidden",width:g?c==="1:1"?"min(90vw, 480px)":`min(90vw, ${ne*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:X=>X.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:L&&e.jsx(qn,{image:L,crop:v,zoom:b,aspect:c?Zr[c]:void 0,onCropChange:W,onZoomChange:O,onCropComplete:E,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(z.Button,{size:"sm",secondary:!0,onClick:()=>F(!1),children:"Cancel"}),e.jsx(z.Button,{size:"sm",primary:!0,onClick:P,children:"Crop"})]})]})}),document.body)]})}),ds=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,required:o=!1,...s})=>{var a,d,f;const c=s.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(oe,{condition:!!o,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsx(se,{children:s.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:s.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(se,{fontSize:t,children:s.title}),e.jsx(se,{color:"error",fontSize:t,children:n}),e.jsx(oe,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Ce.Tooltip,{label:(d=s.tooltip)==null?void 0:d.label,arrowPosition:(f=s.tooltip)==null?void 0:f.arrowPosition,...s.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!s.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:s.description})})]})}),e.jsxs(ie.Flex,{direction:"column",gap:"xs",children:[e.jsx(Fn,{...s.inputProps}),!c&&s.errorMessage&&e.jsx(Ne,{message:s.errorMessage})]})]})},us=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var c,l,a;const s=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(h.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(h.Box,{direction:"column",customMaxWidth:s,fullWidth:i,children:[e.jsx(se,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(h.Box,{direction:"column",customMaxWidth:s,fullWidth:i,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(se,{fontSize:t,children:o.title}),e.jsx(se,{color:"error",fontSize:t,children:n}),e.jsx(oe,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Ce.Tooltip,{label:(l=o.tooltip)==null?void 0:l.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),o.inputProps.extended&&o.inputProps.extended]})},xs=({items:t,id:r,handleOnUpdate:n,width:i,toggleShow:o=!0,disabled:s=!1})=>{var f;const[c,l]=u.useState([]);u.useEffect(()=>{t&&l([...t.map(g=>({id:g.id,isActive:g.isActive}))])},[t]);const a=(f=c.find(g=>g.id===r))==null?void 0:f.isActive,d=u.useCallback(()=>{l(g=>g.map(m=>m.id===r?{...m,isActive:!m.isActive}:m)),n&&n(!a)},[r,n,a]);return e.jsx(h.Box,{direction:"row",gap:"md",style:{width:i},children:o&&e.jsx(st.Toggle,{disabled:s,checked:a,onChange:d,label:a?"Active":"Inactive"})})},hs={InputText:ki,InputDropdown:Bi,InputSingleFile:ts,CheckBoxOptions:rs,RadioOptions:ns,InputTextArea:os,ToggleForm:is,ActionButton:ss,FormTitle:ls,InputDate:cs,InputImgFile:ds,Custom:us},En=({customBottom:t})=>{const[r,n]=u.useState(!1),i=()=>{window.scrollY>window.screenY?n(!0):n(!1)},o=()=>{window.scrollTo({top:0,behavior:"smooth"})};return u.useEffect(()=>(window.addEventListener("scroll",i),()=>{window.removeEventListener("scroll",i)}),[]),e.jsx(h.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(h.Box,{direction:"column",position:"absolute",style:{bottom:t||"1.6rem",right:"2rem",transform:r?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(z.Button,{secondary:!0,size:"xs",onClick:o,type:"button",iconLeft:e.jsx(B.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},fs=({pageLayout:t,children:r,wrapperProps:n,containerProps:i})=>{const o=ye.useMediaQuery("md"),s=(i==null?void 0:i.customWidth)??264;return e.jsxs(h.Box,{display:"block",direction:"row",...n,style:{marginRight:o?s:24,...(n==null?void 0:n.style)??{}},children:[t,e.jsx(h.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",...i,style:{marginTop:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(i==null?void 0:i.style)??{}},children:r})]})},ms=({children:t,withScrollToTopButton:r=!1,scrollToTopButtonProps:n,containerProps:i})=>e.jsx(h.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 999)"},children:e.jsxs(h.Box,{position:"fixed",bottom:"bottom-0",right:"right-0",padding:"spacing-32",height:"height-24",bg:"gray-50",direction:"row",align:"center",display:"flex",style:{left:"var(--app-sidebar-width, 0px)",transition:"left 0.3s ease-in-out",borderColor:"var(--sa-border-subtle, #0b120e24)"},justify:(i==null?void 0:i.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[r&&e.jsx(En,{...n,customBottom:(n==null?void 0:n.customBottom)||"5.7rem"}),t]})}),gs=({fields:t})=>e.jsx(h.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(It,{of:t,render:(r,n)=>e.jsx(ys,{...r},n)})}),ys=({title:t,value:r,icon:n})=>e.jsxs(h.Box,{display:"flex",direction:"column",gap:"sm",children:[n?e.jsxs(h.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(B.Icon,{name:n,color:"subtle"}),e.jsx(w.Text,{color:"gray-500",variant:"sub-h3",children:t})]}):e.jsx(w.Text,{color:"gray-500",variant:"sub-h3",children:t}),typeof r=="string"?e.jsx(w.Text,{variant:"sub-h3",children:r}):r]}),be={silhouette:"#A7B0AC",accent:"#78867F"};function ps({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t||"100",height:r||"90",viewBox:"0 0 102 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M51.0002 16.8145C36.0811 16.8145 24.8296 21.3801 24.8296 27.4328V76.5344C24.8296 82.573 36.0799 87.127 51.0002 87.127C65.9204 87.127 77.1707 82.573 77.1707 76.5344V27.4328C77.1707 21.3801 65.9204 16.8145 51.0002 16.8145ZM51.0002 19.1582C65.0602 19.1582 74.8582 23.5187 74.8582 27.4328C74.8582 30.1363 70.1615 32.9664 63.1708 34.4746C55.861 36.0543 46.1416 36.0543 38.8318 34.4746C31.8399 32.9664 27.1432 30.1363 27.1432 27.4328C27.1432 23.5187 36.9402 19.1582 51.0002 19.1582ZM74.8582 31.9199V43.784C74.8582 46.532 70.3142 49.2941 63.2737 50.8328C63.2391 50.8375 63.2032 50.8434 63.1697 50.8504C57.6867 52.0352 50.8498 52.3305 44.6893 51.7387C42.6358 51.5418 40.6575 51.2453 38.8306 50.8504C38.8029 50.8445 38.7682 50.8387 38.7347 50.8352C32.5707 49.4898 28.318 47.2047 27.3514 44.8141C27.2138 44.4719 27.1421 44.1285 27.1421 43.7852V31.9199C27.1999 31.9715 27.2693 32.0207 27.3294 32.0723C27.5052 32.2246 27.6902 32.3758 27.8844 32.5234C27.9954 32.609 28.1064 32.6934 28.2232 32.7766C28.4371 32.9301 28.6637 33.0801 28.8973 33.2289C29.0083 33.2992 29.1135 33.3719 29.2291 33.441C29.5702 33.6473 29.9275 33.8488 30.3044 34.0434C30.3195 34.0516 30.3333 34.0598 30.3484 34.068C30.7427 34.2707 31.1601 34.4652 31.5925 34.6551C31.7301 34.716 31.8758 34.7734 32.0168 34.832C32.3221 34.9598 32.6331 35.0852 32.9557 35.207C33.1303 35.2727 33.3095 35.3359 33.4887 35.4004C33.8032 35.5117 34.1247 35.6207 34.4542 35.7273C34.6404 35.7871 34.8254 35.8469 35.015 35.9043C35.3734 36.0133 35.7434 36.1164 36.1181 36.2184C36.2915 36.2652 36.4603 36.3145 36.6361 36.3602C37.1911 36.5031 37.7588 36.6402 38.3485 36.7668C42.1595 37.5906 46.5336 38.0254 50.999 38.0254C55.4644 38.0254 59.8397 37.5906 63.6495 36.768C64.2404 36.6402 64.8092 36.5031 65.3666 36.3602C65.5377 36.3156 65.7007 36.2688 65.8684 36.223C66.2499 36.1199 66.6246 36.0145 66.9888 35.9031C67.1749 35.8469 67.3553 35.7883 67.5368 35.7309C67.8745 35.623 68.2028 35.5105 68.5243 35.3969C68.6966 35.3359 68.8677 35.275 69.0353 35.2117C69.3672 35.0863 69.6852 34.9574 69.9985 34.8262C70.1326 34.7699 70.2725 34.7148 70.4032 34.6574C70.8379 34.4664 71.2576 34.2707 71.6542 34.0668C71.66 34.0633 71.6658 34.0609 71.6716 34.0574C72.0589 33.8582 72.4243 33.6508 72.7735 33.441C72.8868 33.3719 72.9909 33.3016 73.1007 33.2313C73.3354 33.0813 73.5632 32.9312 73.7794 32.7766C73.8951 32.6934 74.0049 32.609 74.1159 32.5258C74.3102 32.377 74.4963 32.2258 74.6732 32.0723C74.7322 32.0207 74.8027 31.9727 74.8594 31.9211L74.8582 31.9199ZM74.8582 48.2887V60.1598C74.8582 62.8773 70.3396 65.6359 63.335 67.2004C63.2737 67.2051 63.2136 67.2156 63.1547 67.2285C59.5021 68.016 55.2482 68.4109 50.9955 68.4098C48.8692 68.4098 46.7428 68.3113 44.6917 68.1145C42.6405 67.9176 40.6656 67.6211 38.8399 67.2273C38.7832 67.2133 38.7266 67.2051 38.6699 67.2004C31.663 65.6359 27.1432 62.8785 27.1432 60.1598V48.2887C27.2022 48.3426 27.2739 48.393 27.3352 48.4457C27.5075 48.5945 27.6878 48.7422 27.8763 48.8875C27.9908 48.9754 28.1052 49.0633 28.2255 49.15C28.4348 49.3 28.6568 49.4477 28.8834 49.593C28.999 49.6668 29.1089 49.7418 29.228 49.8145C29.5633 50.0172 29.9136 50.2152 30.2825 50.4074C30.3114 50.4227 30.338 50.4379 30.3669 50.452C30.7507 50.6488 31.1566 50.8398 31.5775 51.0262C31.722 51.0895 31.8746 51.1504 32.0226 51.2125C32.3198 51.3379 32.6227 51.4609 32.9372 51.5793C33.1164 51.6473 33.2991 51.7129 33.4841 51.7785C33.7917 51.8887 34.1073 51.9953 34.4299 52.0996C34.6196 52.1605 34.8092 52.2227 35.0046 52.2812C35.3584 52.3891 35.7238 52.4922 36.0938 52.593C36.2684 52.641 36.4395 52.6902 36.6176 52.7359C37.1714 52.8789 37.738 53.016 38.3253 53.1426C38.3554 53.1496 38.3889 53.1555 38.4236 53.159C42.2161 53.9723 46.5636 54.4023 51.0013 54.4023C55.439 54.4023 59.7784 53.9734 63.5697 53.1613C63.6056 53.1566 63.6414 53.1508 63.6773 53.1426C64.2647 53.0148 64.8312 52.8789 65.3851 52.7359C65.5643 52.6902 65.7342 52.6398 65.9088 52.593C66.2788 52.4922 66.6442 52.3891 66.998 52.2812C67.1934 52.2215 67.3831 52.1605 67.5727 52.0996C67.8953 51.9953 68.2109 51.8887 68.5185 51.7785C68.7023 51.7129 68.8862 51.6473 69.0654 51.5793C69.3799 51.4598 69.6817 51.3367 69.98 51.2125C70.128 51.1504 70.2806 51.0895 70.4252 51.0262C70.846 50.841 71.2507 50.65 71.6357 50.452C71.6646 50.4367 71.6912 50.4215 71.7201 50.4074C72.0901 50.2152 72.4405 50.0172 72.7747 49.8145C72.8949 49.7418 73.0036 49.6668 73.1192 49.593C73.347 49.4477 73.5678 49.3 73.7771 49.15C73.8974 49.0633 74.0118 48.9766 74.1263 48.8875C74.3148 48.7422 74.4952 48.5945 74.6674 48.4457C74.7287 48.393 74.7992 48.3426 74.8582 48.2887ZM74.8582 76.5355C74.8582 80.4367 65.0602 84.7844 51.0002 84.7844C36.9402 84.7844 27.1421 80.4367 27.1421 76.5355V64.6469C27.1987 64.6984 27.2693 64.7477 27.3282 64.7992C27.5028 64.9504 27.6844 65.0992 27.8763 65.2469C27.9873 65.3324 28.0995 65.418 28.2162 65.5023C28.4302 65.6559 28.6568 65.807 28.8892 65.9559C28.9979 66.0262 29.1019 66.0977 29.2152 66.1656C29.5691 66.3801 29.9367 66.591 30.3299 66.7937C30.331 66.7937 30.3322 66.7938 30.3333 66.7961C30.7253 66.9988 31.1404 67.1945 31.5694 67.3855C31.7058 67.4465 31.8515 67.5039 31.9914 67.5637C32.2955 67.6926 32.6054 67.8191 32.928 67.9422C33.1002 68.0078 33.2772 68.0711 33.4541 68.1355C33.7674 68.248 34.0888 68.3582 34.4184 68.466C34.6034 68.5258 34.7872 68.5867 34.9768 68.6453C35.3341 68.7555 35.703 68.8609 36.0764 68.9641C36.2476 69.0109 36.4141 69.0602 36.5887 69.1059C37.1413 69.2512 37.7079 69.3895 38.2941 69.5195C38.3462 69.5312 38.3993 69.5383 38.4514 69.543C42.2369 70.3516 46.5717 70.7793 50.999 70.7793C55.4263 70.7793 59.7599 70.3527 63.5478 69.543C63.5998 69.5383 63.653 69.5312 63.705 69.5195C64.2912 69.3906 64.8578 69.2512 65.4105 69.1059C65.5839 69.0602 65.7493 69.0121 65.9192 68.9652C66.295 68.8621 66.665 68.7555 67.0246 68.6453C67.2131 68.5879 67.3958 68.5281 67.5785 68.4684C67.9092 68.3605 68.2329 68.2492 68.5486 68.1355C68.7231 68.0723 68.8977 68.009 69.0689 67.9445C69.3938 67.8203 69.7071 67.6926 70.0135 67.5625C70.1511 67.5039 70.2933 67.4477 70.4275 67.3879C71.29 67.0047 72.0774 66.5969 72.7851 66.1668C72.8972 66.0988 73.0001 66.0273 73.1088 65.9582C73.3424 65.8082 73.5702 65.657 73.7852 65.5023C73.9008 65.4191 74.0118 65.3336 74.1217 65.2492C74.3148 65.1016 74.4975 64.9516 74.6732 64.7992C74.7322 64.7488 74.8016 64.6996 74.8582 64.648V76.5355Z",fill:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.accent,fillOpacity:"0.65"})]})})}const js=({title:t="create",children:r,onClickAction:n,variant:i="primary",variantTitle:o,leftIcon:s,showButton:c=!0,customHeight:l,childrenButton:a,customIcon:d})=>{const f=()=>{switch(i){case"primary":return e.jsx(e.Fragment,{children:s?e.jsx(z.Button,{primary:!0,iconLeft:s,onClick:n,children:a||t}):e.jsx(z.Button,{primary:!0,onClick:n,children:a||t})});case"secondary":return e.jsx(e.Fragment,{children:s?e.jsx(z.Button,{secondary:!0,iconLeft:s,onClick:n,children:o?e.jsx(w.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||t}):t}):e.jsx(z.Button,{secondary:!0,onClick:n,children:a||t})});case"success":return e.jsx(e.Fragment,{children:s?e.jsx(z.Button,{success:!0,iconLeft:s,onClick:n,children:a||t}):e.jsx(z.Button,{success:!0,onClick:n,children:a||t})});default:return e.jsx(e.Fragment,{children:s?e.jsx(z.Button,{primary:!0,iconLeft:s,onClick:n,children:a||t}):e.jsx(z.Button,{primary:!0,onClick:n,children:a||t})})}};return e.jsxs(h.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:l,children:[d||e.jsx(ps,{}),e.jsx(h.Box,{direction:"column",children:r.map((g,m)=>e.jsx(We.Body1,{props:{align:"center",textAlign:"center"},children:m>2?null:g},m))}),c?f():null]})},U={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function bs({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke:U.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:U.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:U.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:U.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:U.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:U.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:U.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:U.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:U.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:U.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:U.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:U.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:U.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:U.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:U.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:U.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:U.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:U.cFFFFFF,stroke:U.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:U.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:U.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:U.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:U.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:U.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:U.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:U.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:U.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:U.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:U.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:U.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:U.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:U.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:U.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:U.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:U.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:U.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:U.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:U.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:U.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:U.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:U.c001A72})]})})}function Cs({onClick:t}){const r=ye.useMediaQuery("md");return e.jsxs(h.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(bs,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(w.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),t&&e.jsx(z.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const ee={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 vs({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:ee.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:ee.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:ee.cEFF3F8,stroke:ee.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:ee.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:ee.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:ee.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:ee.c956847,stroke:ee.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:ee.c956847,stroke:ee.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:ee.cC8CEF4,stroke:ee.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:ee.cC8CEF4,stroke:ee.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:ee.cC8CEF4,stroke:ee.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:ee.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:ee.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:ee.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:ee.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:ee.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:ee.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:ee.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:ee.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:ee.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:ee.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:ee.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:ee.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:ee.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function ws({onClick:t}){const r=ye.useMediaQuery("md");return e.jsxs(h.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(vs,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",children:"We Are Sorry ..."}),t&&e.jsx(z.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const x={c000D58:"#000D58",c001174:"#001174",c28AC6E:"#28AC6E",c48504C:"#48504C",c64B5F6:"#64B5F6",c90CAF9:"#90CAF9",cC9184A:"#C9184A",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cD9D9D9:"#D9D9D9",cDEECF8:"#DEECF8",cE7EAE9:"#E7EAE9",cF3F8FD:"#F3F8FD",cFFE18B:"#FFE18B",cFFFFFF:"#FFFFFF"};function Ds({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,viewBox:"0 0 622 287",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M406.562 180.997C406.562 148.544 412.16 122.978 423.356 104.299C434.721 85.6199 452.957 76.2803 478.063 76.2803C503.168 76.2803 521.319 85.6199 532.514 104.299C543.88 122.978 549.562 148.544 549.562 180.997C549.562 213.827 543.88 239.582 532.514 258.261C521.319 276.941 503.168 286.28 478.063 286.28C452.957 286.28 434.721 276.941 423.356 258.261C412.16 239.582 406.562 213.827 406.562 180.997ZM506.815 180.997C506.815 161.941 504.949 147.318 501.217 137.129C497.485 126.752 489.767 121.563 478.063 121.563C466.358 121.563 458.64 126.752 454.908 137.129C451.176 147.318 449.31 161.941 449.31 180.997C449.31 193.827 449.988 204.488 451.345 212.978C452.703 221.28 455.417 228.073 459.488 233.356C463.729 238.45 469.92 240.997 478.063 240.997C486.205 240.997 492.312 238.45 496.383 233.356C500.624 228.073 503.423 221.28 504.78 212.978C506.137 204.488 506.815 193.827 506.815 180.997Z",fill:x.cD6EBFD}),e.jsx("path",{d:"M246.562 180.558C246.562 148.105 252.16 122.539 263.356 103.86C274.721 85.1804 292.957 75.8408 318.063 75.8408C343.168 75.8408 361.319 85.1804 372.514 103.86C383.88 122.539 389.562 148.105 389.562 180.558C389.562 213.388 383.88 239.143 372.514 257.822C361.319 276.501 343.168 285.841 318.063 285.841C292.957 285.841 274.721 276.501 263.356 257.822C252.16 239.143 246.562 213.388 246.562 180.558ZM346.815 180.558C346.815 161.501 344.949 146.879 341.217 136.69C337.485 126.313 329.767 121.124 318.063 121.124C306.358 121.124 298.64 126.313 294.908 136.69C291.176 146.879 289.31 161.501 289.31 180.558C289.31 193.388 289.988 204.048 291.345 212.539C292.702 220.841 295.417 227.633 299.488 232.916C303.729 238.011 309.92 240.558 318.063 240.558C326.205 240.558 332.312 238.011 336.383 232.916C340.624 227.633 343.423 220.841 344.78 212.539C346.137 204.048 346.815 193.388 346.815 180.558Z",fill:x.cD6EBFD}),e.jsx("path",{d:"M222.808 118.703H128.062V159.858C132.111 155.484 137.779 151.905 145.067 149.122C152.356 146.338 160.251 144.946 168.754 144.946C183.938 144.946 196.49 148.326 206.41 155.086C216.532 161.846 223.922 170.594 228.578 181.329C233.234 192.065 235.562 203.696 235.562 216.221C235.562 239.483 228.882 257.972 215.52 271.691C202.158 285.21 183.357 282.89 159.062 282.89C142.867 282.89 131.098 284.939 116.826 283.918C104.881 278.351 95.6695 270.697 89.1911 260.955C82.7127 251.213 79.1698 239.98 78.5625 227.256H129.276C130.491 233.419 133.426 238.588 138.083 242.763C142.739 246.739 149.116 248.728 157.214 248.728C166.729 248.728 173.815 245.745 178.472 239.781C183.128 233.817 185.456 225.864 185.456 215.923C185.456 206.181 183.027 198.726 178.168 193.557C173.309 188.387 166.223 185.803 156.911 185.803C150.027 185.803 144.359 187.493 139.905 190.873C135.451 194.054 132.515 198.328 131.098 203.696H80.9919V73.9697H222.808V118.703Z",fill:x.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:x.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:x.cFFFFFF,stroke:x.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 200.539C269.878 200.263 270.101 200.039 270.377 200.039L305.476 199.955C305.753 199.955 305.978 200.179 305.978 200.455V206.461H269.878V200.539Z",stroke:x.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:x.cFFFFFF,stroke:x.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 235.871C269.878 235.595 270.101 235.372 270.377 235.371L305.476 235.288C305.753 235.287 305.978 235.511 305.978 235.788V241.794H269.878V235.871Z",stroke:x.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:x.cFFFFFF,stroke:x.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 272.088C269.878 271.812 270.101 271.589 270.377 271.588L305.476 271.505C305.753 271.504 305.978 271.728 305.978 272.005V278.011H269.878V272.088Z",stroke:x.c001174}),e.jsx("path",{d:"M279.095 176.348H364.373C365.459 176.348 366.125 176.992 366.986 178.252V202.985C366.986 202.985 366.986 203.869 366.545 204.752C366.103 205.635 365.661 206.077 365.661 206.077L306.478 206.163V199.452L279.095 199.518V176.348Z",fill:x.cF3F8FD}),e.jsx("path",{d:"M279.095 211.093H364.373C365.459 211.093 366.125 211.736 366.986 212.997V237.73C366.986 237.73 366.986 238.613 366.545 239.497C366.103 240.38 365.661 240.822 365.661 240.822L306.478 240.908V234.197L279.095 234.262V211.093Z",fill:x.cF3F8FD}),e.jsx("path",{d:"M279.095 248.008H364.373C365.459 248.008 366.125 248.652 366.986 249.912V274.646C366.986 274.646 366.986 275.529 366.545 276.412C366.103 277.296 365.661 277.737 365.661 277.737L306.478 277.824V271.112L279.095 271.178V248.008Z",fill:x.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:x.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:x.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:x.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:x.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:x.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:x.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:x.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:x.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:x.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:x.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:x.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:x.cDEECF8}),e.jsx("path",{d:"M268.053 210.494C268.483 209.112 268.564 208.343 268.053 206.961H362.569C361.955 208.363 361.972 209.136 362.569 210.494H268.053Z",fill:x.c000D58,stroke:x.c001174}),e.jsx("path",{d:"M268.053 246.269C268.483 244.887 268.564 244.118 268.053 242.736H362.569C361.955 244.138 361.972 244.911 362.569 246.269H268.053Z",fill:x.c000D58,stroke:x.c001174}),e.jsx("path",{d:"M283.312 130.775C283.312 129.64 283.987 128.72 284.82 128.72H349.805C350.638 128.72 351.312 129.64 351.312 130.775V169.72H283.312V130.775Z",fill:x.cFFFFFF,stroke:x.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M279.574 171.847C279.381 171.283 279.267 170.624 279.33 169.72H355.195C355.423 170.925 355.287 171.695 355.063 172.241C354.834 172.802 354.506 173.186 354.101 173.66C354.084 173.68 354.067 173.7 354.05 173.72H280.503C280.468 173.658 280.434 173.598 280.4 173.539C280.051 172.922 279.774 172.434 279.574 171.847Z",stroke:x.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M350.312 133.72V129.726L284.812 129.72C284.312 129.726 284.312 129.726 284.312 130.125V133.72H350.312Z",fill:x.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:x.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:x.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:x.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:x.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:x.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:x.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:x.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:x.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:x.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:x.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:x.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Ss({onClick:t}){const r=ye.useMediaQuery("md");return e.jsxs(h.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(Ds,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(w.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),t&&e.jsx(z.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const ks=t=>{var n,i,o,s,c;const r=ye.useMediaQuery("md");return e.jsxs(Oe.Dialog,{isShow:t.isShow,onHide:t.onHide,style:{...r?{minWidth:t.customMinWidth||"458px"}:{maxWidth:t.customMinWidth||"458px"}},children:[e.jsx(Oe.DialogTitle,{...t.dialogTitleProps,children:typeof t.title=="string"?e.jsx(w.Text,{fontSize:"lg",fontWeight:"medium",children:t.title}):t.title}),e.jsx(Oe.DialogBody,{children:typeof t.description=="string"?e.jsx(w.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:t.description}):t.description}),e.jsx(Oe.DialogFooter,{children:e.jsx(h.Box,{display:"flex",direction:((n=t.containerConfirmBtnProps)==null?void 0:n.direction)||"row",justify:((i=t.containerConfirmBtnProps)==null?void 0:i.justify)||"flex-end",...t.containerConfirmBtnProps,children:e.jsxs(h.Box,{display:"flex",direction:((o=t.wrapperConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((s=t.wrapperConfirmBtnProps)==null?void 0:s.justify)||"flex-end",gap:((c=t.wrapperConfirmBtnProps)==null?void 0:c.gap)||"sm",...t.wrapperConfirmBtnProps,children:[t.onCancel&&e.jsx(z.Button,{secondary:!0,onClick:t.onCancel,size:"md",fullWidth:!0,children:t.titleCancelBtn||"Cancel"}),e.jsx(h.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(z.Button,{...t.buttonConfirmProps,onClick:t.onConfirm,size:"md",fullWidth:!0,children:t.titleConfirmBtn||"Ok"})})]})})})]},t.key)},Bs=u.memo(({children:t,height:r,minHeight:n,customHeight:i,paddingInline:o="spacing-0",paddingBlock:s="spacing-0",header:c,footer:l,title:a,titleTag:d,action:f,actionContainer:g,containerProps:m,bodyProps:j,headerProps:L={borderBottom:!0},footerProps:y={borderTop:!0},variantTag:D="info"})=>{const F=u.useRef(null),[v,W]=u.useState("100vh");u.useEffect(()=>{const C=()=>{if(F.current){const E=F.current.getBoundingClientRect().top;W(`calc(100vh - ${E}px)`)}};return C(),window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[]);const b=()=>d?e.jsxs(h.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(w.Text,{fontWeight:"medium",children:a}),e.jsx(_e.Badges,{border:!0,text:d,variant:D})]}):e.jsx(w.Text,{fontWeight:"medium",children:a}),O=()=>c||e.jsxs(h.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(h.Box,{direction:"column",children:a?b():null}),e.jsx(h.Box,{direction:"column",...g,children:f??null})]}),R=!!(c||a||f);return e.jsxs(h.Box,{ref:F,height:r,customMinHeight:n,customHeight:i,paddingBlock:s,paddingInline:o,bg:"white",direction:"column",...m,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:v,...(m==null?void 0:m.style)??{}},children:[c!==null&&R?e.jsx(lr,{...L,children:O()}):null,e.jsx(h.Box,{direction:"column",padding:"spacing-0",...j,style:{flex:1,overflow:"auto",...(j==null?void 0:j.style)??{}},children:t}),l?e.jsx(cr,{...y,children:l}):null]})}),Fs=u.memo(({value:t,options:r=[],onChange:n,multiple:i})=>{const o=(t==null?void 0:t.map(l=>l.value))||[],s=(r==null?void 0:r.filter(l=>o.includes(l.value)))||[],c=l=>{const a=[...s];let d=[];i?d=o.includes(l.value)?a.filter(f=>f.value!==l.value):[...a,l]:d=[l],n==null||n(d)};return e.jsx(h.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:r==null?void 0:r.map((l,a)=>e.jsx(z.Button,{...o.includes(l.value)?{primary:!0}:{secondary:!0},onClick:()=>c(l),children:l.label},a))})});function Tt(t){return null}Tt.displayName="LayoutDialog.Header";function Ot(t){return null}Ot.displayName="LayoutDialog.Body";function Wt(t){return null}Wt.displayName="LayoutDialog.Aside";function Rt(t){return null}Rt.displayName="LayoutDialog.Footer";const we={"lyd-root":"_lyd-root_1e92c_1","lyd-backdrop":"_lyd-backdrop_1e92c_28","lyd-panel":"_lyd-panel_1e92c_37","lyd-modal":"_lyd-modal_1e92c_48","lyd-fullscreen":"_lyd-fullscreen_1e92c_58","lyd-sidebar":"_lyd-sidebar_1e92c_66","lyd-header":"_lyd-header_1e92c_94","lyd-header-content":"_lyd-header-content_1e92c_105","lyd-header-actions":"_lyd-header-actions_1e92c_113","lyd-main":"_lyd-main_1e92c_120","lyd-body":"_lyd-body_1e92c_127","lyd-aside":"_lyd-aside_1e92c_133","lyd-footer":"_lyd-footer_1e92c_149","lyd-vm-group":"_lyd-vm-group_1e92c_162","lyd-vm-btn":"_lyd-vm-btn_1e92c_170","lyd-close-btn":"_lyd-close-btn_1e92c_193"},Es=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(Ls,{})},{mode:"modal",label:"Modal",icon:e.jsx(B.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(B.Icon,{name:"Fullscreen",size:"sm"})}];function Ms({value:t,onChange:r}){return e.jsx("div",{className:we["lyd-vm-group"],role:"group","aria-label":"View mode",children:Es.map(n=>e.jsx("button",{type:"button",className:we["lyd-vm-btn"],"data-active":t===n.mode,"aria-label":`Switch to ${n.label} view`,"aria-pressed":t===n.mode,onClick:()=>r(n.mode),children:n.icon},n.mode))})}function Ls(){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 Yt={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function Is(t){return t?t in Yt?Yt[t]:t:Yt.xl}function vt(t,r){let n=null;return u.Children.forEach(t,i=>{u.isValidElement(i)&&i.type===r&&(n=i.props.children??null)}),n}function Ts(t){const{isOpen:r,onClose:n,viewMode:i,defaultViewMode:o="modal",onViewModeChange:s,showViewModeToggle:c=!0,showCloseButton:l=!0,size:a,asideWidth:d,disableEscapeClose:f=!1,disableBackdropClose:g=!1,lockBodyScroll:m=!0,children:j}=t,[L,y]=u.useState(o),D=i??L,v=ye.useMediaQuery("md")?D:"fullscreen",W=u.useCallback(Y=>{i===void 0&&y(Y),s==null||s(Y)},[i,s]),b=u.useRef(null);u.useEffect(()=>{if(!(!r||!m))return b.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=b.current??""}},[r,m]),u.useEffect(()=>{if(!r||f)return;const Y=le=>{le.key==="Escape"&&n()};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[r,f,n]);const O=u.useMemo(()=>vt(j,Tt),[j]),R=u.useMemo(()=>vt(j,Ot),[j]),C=u.useMemo(()=>vt(j,Wt),[j]),E=u.useMemo(()=>vt(j,Rt),[j]);if(!r)return null;const H=[we["lyd-panel"],v==="modal"&&we["lyd-modal"],v==="fullscreen"&&we["lyd-fullscreen"],v==="sidebar"&&we["lyd-sidebar"]].filter(Boolean).join(" "),P={"--lyd-max-w":Is(a),...d!==void 0&&{"--lyd-aside-w":d}},q=()=>{g||n()};return e.jsxs("div",{className:we["lyd-root"],style:P,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:we["lyd-backdrop"],onClick:q,"aria-hidden":"true"}),e.jsxs("div",{className:H,children:[e.jsxs("div",{className:we["lyd-header"],children:[e.jsx("div",{className:we["lyd-header-content"],children:O}),e.jsxs("div",{className:we["lyd-header-actions"],children:[c&&e.jsx(Ms,{value:D,onChange:W}),l&&e.jsx("button",{type:"button",className:we["lyd-close-btn"],onClick:n,"aria-label":"Close dialog",children:e.jsx(B.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:we["lyd-main"],children:[e.jsx("div",{className:we["lyd-body"],children:R}),C&&e.jsx("aside",{className:we["lyd-aside"],children:C})]}),E&&e.jsx("div",{className:we["lyd-footer"],children:E})]})]})}const ht=Ts;ht.Header=Tt;ht.Body=Ot;ht.Aside=Wt;ht.Footer=Rt;function Os({url:t,filename:r,onClose:n}){return u.useEffect(()=>{const i=o=>{o.key==="Escape"&&n()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[n]),e.jsxs("div",{onClick:n,style:{position:"fixed",inset:0,zIndex:9999,backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px"},children:[e.jsxs("div",{onClick:i=>i.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:t,download:r,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.15)",color:"#fff",borderRadius:"var(--sa-radii-sm, 6px)",fontSize:"13px",textDecoration:"none",backdropFilter:"blur(4px)"},children:"Download"}),e.jsx("button",{onClick:n,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",backgroundColor:"rgba(255,255,255,0.15)",border:"none",borderRadius:"var(--sa-radii-sm, 6px)",color:"#fff",cursor:"pointer",backdropFilter:"blur(4px)"},"aria-label":"Close preview",children:"✕"})]}),e.jsx("img",{src:t,alt:r,onClick:i=>i.stopPropagation(),style:{maxWidth:"90vw",maxHeight:"85vh",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-lg, 0 25px 50px rgba(0,0,0,0.5))"}}),e.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:r})]})}const Ws=t=>{const{defaultTab:r=0,paramKey:n="tab"}=t||{},[i,o]=ge.useSearchParams(),s=it.searchParamsToObject(i.toString());return{activeTab:s[n]?parseInt(s[n]):r,handleTabChange:a=>{o({...s,[n]:a.toString()})},searchQueries:s}};function Rs({appName:t,menuConfig:r,formatTitle:n}){const i=ge.useLocation();u.useEffect(()=>{let o=null,s=null;for(const a of r){const d=a.items.find(f=>f.to?f.to==="/"?i.pathname==="/":!!(f.to===i.pathname||i.pathname.startsWith(f.to+"/")):!1);if(d){o=d,s=a;break}}const c=[];o!=null&&o.title&&c.push(o.title),s!=null&&s.name&&c.push(s.name.toTitleCase());const l=(a,d)=>a.length>0?`${a.join(" - ")} | ${d}`:d;document.title=(n||l)(c,t)},[i.pathname])}const As=()=>{const[t,r]=ge.useSearchParams(),n=it.searchParamsToObject(t.toString()),i=ge.useParams(),o=ge.useLocation(),s=i.id;return{setSearchParams:r,searchParams:t,searchQueries:n,isHasQuery:(f,g)=>t.has(f)&&t.get(f)===g,getQueryParam:f=>t.get(f),getRouteParam:f=>i[f],params:i,location:o,id:s,hasId:!!s}};function zs(t){var i,o;const r=t.decodedAccessToken;return u.useMemo(()=>{var a,d;const s=((d=(a=r==null?void 0:r.access)==null?void 0:a.role)==null?void 0:d.code)??"",c=Object.keys(t.role).reduce((f,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,j=>j.replace("_","").toUpperCase())}`;return{...f,[m]:!1}},{});return{...Object.keys(t.role).reduce((f,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,j=>j.replace("_","").toUpperCase())}`;return{...f,[m]:s===t.role[g]}},c),hasRole:f=>s===t.role[f],getRoleKey:()=>s}},[(o=(i=r==null?void 0:r.access)==null?void 0:i.role)==null?void 0:o.code,t])}exports.AdvanceFilterBar=hn;exports.App=Gn;exports.AppComponent=Yr;exports.AppContext=rr;exports.AppLayout=Yn;exports.AsideBar=fs;exports.BackButton=Kn;exports.ColumnFilterDropdown=wn;exports.ColumnMenu=Sn;exports.ConfirmationDialog=ks;exports.DataTable=Dn;exports.DecisionWrapper=oe;exports.EachUtils=It;exports.EmptyStatePage=js;exports.FilterBar=ii;exports.FilterDrawer=xn;exports.FloatingFooter=ms;exports.ForbiddenPage=ws;exports.Form=hs;exports.FullSection=Bs;exports.HeaderLeftSlot=Qn;exports.HeaderLeftSlotOutlet=$r;exports.HeaderLeftSlotProvider=Kr;exports.HorizontalField=no;exports.ImagePreview=Os;exports.InputFile=Bn;exports.InputImage=Fn;exports.LayoutDialog=ht;exports.LayoutDialogAside=Wt;exports.LayoutDialogBody=Ot;exports.LayoutDialogFooter=Rt;exports.LayoutDialogHeader=Tt;exports.ModuleSwitcher=$n;exports.ModuleSwitcherModal=nn;exports.NotFoundPage=Cs;exports.PageLayout=so;exports.Pressable=Et;exports.RightDrawer=on;exports.ScrollToTopButton=En;exports.Section=uo;exports.SectionFooter=cr;exports.SectionHeader=lr;exports.SelectButton=Fs;exports.ServerErrorPage=Ss;exports.SidebarBadgesProvider=Ur;exports.SidebarGroupSlot=Un;exports.SidebarGroupSlotOutlet=tn;exports.SidebarGroupSlotProvider=en;exports.SidebarHeaderSlot=Xr;exports.TableFooter=vn;exports.TableHeader=Cn;exports.TableLayout=Di;exports.TableSection=pi;exports.TableWrapper=bn;exports.ToggleStatus=xs;exports.Typography=We;exports.VerticalField=gs;exports.clearModuleSelection=Jn;exports.createInitialFromUserName=Mi;exports.cssVars=Ri;exports.expandDateCompact=xi;exports.formHasChanged=Ni;exports.formatDate=Oi;exports.formatDateToIndonesian=kn;exports.formatRupiah=Ii;exports.getDateFilterValue=un;exports.getDateRangeFilterValue=Bo;exports.getInitials=Ti;exports.getValueDropdownMultipleFilter=dn;exports.getValueRadioFilter=ko;exports.getValueSearch=Mt;exports.getValuesFilter=Dt;exports.handleChangeFilter=xt;exports.handleOnScroll=Xi;exports.isEmail=Ui;exports.isFilterActive=Fo;exports.isOnlyLettersAndSpaces=qi;exports.isPhoneNumber=_i;exports.isSlug=Ji;exports.localStorageAdapter=dr;exports.oneDayInMs=Ai;exports.parseIndonesianDateToDate=Li;exports.preventNonCoordinateInput=Yi;exports.preventNonNumberAndDecimalInput=Qi;exports.preventNonNumberInput=Zi;exports.preventNumberInput=Gi;exports.resolveDateRangeValueToString=cn;exports.resolveDateValueToString=an;exports.resolveDropdownValueToString=sn;exports.resolveRadioValueToString=ln;exports.resolveSidebarBadge=wt;exports.storageKeys=ct;exports.textWidth=zi;exports.useApp=nr;exports.useAppState=Gr;exports.useAuthRole=zs;exports.useDynamicTitle=Rs;exports.useFilterBarApiParams=ai;exports.useFilterBarControls=ui;exports.useModuleSelection=sr;exports.useRouteInfo=ke;exports.useRouteParams=As;exports.useSidebarBadges=Jr;exports.useTabState=Ws;exports.useTableSortApiParams=Si;Object.keys(mr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>mr[t]})});Object.keys(_e).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>_e[t]})});Object.keys(h).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>h[t]})});Object.keys(rt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>rt[t]})});Object.keys(z).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>z[t]})});Object.keys(gr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>gr[t]})});Object.keys(Xe).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Xe[t]})});Object.keys(Oe).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Oe[t]})});Object.keys(kt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>kt[t]})});Object.keys(ot).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ot[t]})});Object.keys(ye).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ye[t]})});Object.keys(it).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>it[t]})});Object.keys(qe).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>qe[t]})});Object.keys(I).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>I[t]})});Object.keys(ut).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ut[t]})});Object.keys(dt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>dt[t]})});Object.keys(G).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>G[t]})});Object.keys(yr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>yr[t]})});Object.keys(Xt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Xt[t]})});Object.keys(nt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>nt[t]})});Object.keys(pr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>pr[t]})});Object.keys(st).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>st[t]})});Object.keys(Ce).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ce[t]})});Object.keys(lt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>lt[t]})});Object.keys(Kt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Kt[t]})});Object.keys(w).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>w[t]})});Object.keys(B).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>B[t]})});Object.keys(ie).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ie[t]})});Object.keys(jr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>jr[t]})});Object.keys(br).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>br[t]})});Object.keys(Cr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Cr[t]})});Object.keys(vr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>vr[t]})});Object.keys(wr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>wr[t]})});Object.keys(Ve).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ve[t]})});Object.keys(Dr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Dr[t]})});
|